ia-common 1.0.1-beta.42 → 1.0.1-beta.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,3 +20,4 @@ export * from "./get-organization-by-id.interface";
20
20
  export * from "./get-advice-by-id.interface";
21
21
  export * from "./get-advice-by-ids-status.inteface";
22
22
  export * from "./create-advice.interface";
23
+ export * from "./update-advice.interface";
@@ -36,3 +36,4 @@ __exportStar(require("./get-organization-by-id.interface"), exports);
36
36
  __exportStar(require("./get-advice-by-id.interface"), exports);
37
37
  __exportStar(require("./get-advice-by-ids-status.inteface"), exports);
38
38
  __exportStar(require("./create-advice.interface"), exports);
39
+ __exportStar(require("./update-advice.interface"), exports);
@@ -0,0 +1,19 @@
1
+ import { AdviceTransactionType, AdviceType, InvestDurationType } from "../../@enum";
2
+ import { IAdviceEntity } from "../entity";
3
+ import { IModifyEntity } from "../modify-entity.interface";
4
+ export interface IUpdateAdviceRequest {
5
+ type?: AdviceType;
6
+ stockName?: string;
7
+ cmp?: number;
8
+ targetPrice?: number;
9
+ stopLoss: number;
10
+ investmentDurationType: InvestDurationType;
11
+ transactionType: AdviceTransactionType;
12
+ fromDateCode: number;
13
+ toDateCode: number;
14
+ noteDocument?: string;
15
+ videoDocument?: string;
16
+ voiceDocument?: string;
17
+ }
18
+ export interface IUpdateAdviceResponse extends IModifyEntity<IAdviceEntity> {
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,7 +9,7 @@ export declare class PricingPlanModel implements IPricingPlanModel {
9
9
  };
10
10
  constructor(data: IGetPricingPlanByDateResponse);
11
11
  getBillingCycleKeys(): string[];
12
+ validateBillingCycleKey(key: string): void;
12
13
  getNoOfSubscriptionDays(type: string): number;
13
14
  getBillCycleByKey(type: string): ISelectedBillingCycle;
14
- validateBillingCycleKey(key: string): void;
15
15
  }
@@ -9,13 +9,6 @@ var PricingPlanModel = /** @class */ (function () {
9
9
  PricingPlanModel.prototype.getBillingCycleKeys = function () {
10
10
  return Object.values(this.billingCycle).map(function (billingCycleObj) { return billingCycleObj.key; });
11
11
  };
12
- PricingPlanModel.prototype.getNoOfSubscriptionDays = function (type) {
13
- var billingCycleModel = this.getBillCycleByKey(type);
14
- return billingCycleModel.noOfMonths * 30 - 1;
15
- };
16
- PricingPlanModel.prototype.getBillCycleByKey = function (type) {
17
- return Object.values(this.billingCycle).filter(function (billingCycleObj) { return billingCycleObj.key === type; })[0];
18
- };
19
12
  PricingPlanModel.prototype.validateBillingCycleKey = function (key) {
20
13
  if (!this.getBillingCycleKeys().includes(key)) {
21
14
  throw new _model_1.AppBadRequestException({
@@ -26,6 +19,15 @@ var PricingPlanModel = /** @class */ (function () {
26
19
  });
27
20
  }
28
21
  };
22
+ PricingPlanModel.prototype.getNoOfSubscriptionDays = function (type) {
23
+ this.validateBillingCycleKey(type);
24
+ var billingCycleModel = this.getBillCycleByKey(type);
25
+ return billingCycleModel.noOfMonths * 30 - 1;
26
+ };
27
+ PricingPlanModel.prototype.getBillCycleByKey = function (type) {
28
+ this.validateBillingCycleKey(type);
29
+ return Object.values(this.billingCycle).filter(function (billingCycleObj) { return billingCycleObj.key === type; })[0];
30
+ };
29
31
  return PricingPlanModel;
30
32
  }());
31
33
  exports.PricingPlanModel = PricingPlanModel;
@@ -8,5 +8,6 @@ export declare class DateUtil {
8
8
  addNDaysToDateCode(dateCode: string, n: number): string;
9
9
  convertMonthsToNumber: (months: INgbDateStruct) => string;
10
10
  convertNumberToNgbDateStruct: (numericDate: string) => INgbDateStruct | null;
11
+ formatDateCode(dateCode: string): string;
11
12
  }
12
13
  export declare const dateUtil: DateUtil;
@@ -57,6 +57,11 @@ var DateUtil = /** @class */ (function () {
57
57
  DateUtil.prototype.addNDaysToDateCode = function (dateCode, n) {
58
58
  return this.getDateCode(this.addNDaysToDate(this.convertStringToDate(dateCode, "yyMMdd"), n));
59
59
  };
60
+ DateUtil.prototype.formatDateCode = function (dateCode) {
61
+ var date = (0, date_fns_1.parse)(dateCode, "yyMMdd", new Date());
62
+ var d = (0, date_fns_1.format)(date, "dd-MMM (EE)");
63
+ return d.slice(0, d.length - 2) + d.slice(d.length - 1);
64
+ };
60
65
  return DateUtil;
61
66
  }());
62
67
  exports.DateUtil = DateUtil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ia-common",
3
- "version": "1.0.1-beta.42",
3
+ "version": "1.0.1-beta.44",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",