turf-common 1.4.1-beta.0 → 1.4.1-beta.10

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.
Files changed (67) hide show
  1. package/README.md +20 -20
  2. package/build/@enum.d.ts +1 -0
  3. package/build/@enum.js +17 -0
  4. package/build/@exception.d.ts +1 -0
  5. package/build/@exception.js +17 -0
  6. package/build/@model.d.ts +1 -0
  7. package/build/@model.js +17 -0
  8. package/build/@type.d.ts +1 -0
  9. package/build/@type.js +17 -0
  10. package/build/@utils.d.ts +1 -0
  11. package/build/@utils.js +17 -0
  12. package/build/src/@enum.d.ts +3 -0
  13. package/build/src/@enum.js +3 -0
  14. package/build/src/@type.d.ts +2 -0
  15. package/build/src/@type.js +2 -0
  16. package/build/src/interface/api/get-pricing-plan-by-date-response.interface.d.ts +24 -0
  17. package/build/src/interface/billing-cycle.interface.d.ts +6 -0
  18. package/build/src/interface/entity/pricing-plan-entity.interface.d.ts +16 -0
  19. package/build/src/interface/entity/subscription-entity.interface.d.ts +4 -0
  20. package/build/src/interface/entity/subscription-pitch-mapping.interface.d.ts +7 -0
  21. package/build/src/interface/get-pricing-plan-by-date-response.interface.d.ts +22 -0
  22. package/build/src/interface/model/pricing-plan-entity-model.interface.d.ts +13 -4
  23. package/build/src/interface/pitch-slab-dto.interface.d.ts +8 -0
  24. package/build/src/interface/pitch-slab.interface.d.ts +4 -0
  25. package/build/src/interface/pricing-plan.interface.d.ts +16 -2
  26. package/build/src/interface/ui/upgrade-subscription-data.interface.d.ts +5 -0
  27. package/build/src/interface/user-entity-essential-info.interface.d.ts +3 -0
  28. package/build/src/interface/user-entity-essential-info.interface.js +2 -0
  29. package/build/src/models/billing-cycle-model.d.ts +9 -1
  30. package/build/src/models/billing-cycle-model.js +25 -1
  31. package/build/src/models/entity/pricing-plan-entity-model.d.ts +47 -7
  32. package/build/src/models/entity/pricing-plan-entity-model.js +175 -1
  33. package/build/src/models/entity/subscription-model.d.ts +42 -4
  34. package/build/src/models/entity/subscription-model.js +138 -1
  35. package/build/src/models/pitch-slab-model.d.ts +6 -1
  36. package/build/src/models/pitch-slab-model.js +12 -1
  37. package/build/src/models/pricing-plan-model.d.ts +28 -3
  38. package/build/src/models/pricing-plan-model.js +87 -1
  39. package/build/src/models/subscribed-pricing-plan-model.d.ts +48 -6
  40. package/build/src/models/subscribed-pricing-plan-model.js +447 -1
  41. package/build/src/utils/string-util.d.ts +1 -0
  42. package/build/src/utils/string-util.js +7 -0
  43. package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-booking-TURF-476.spec.js +1 -1
  44. package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-booking-without-discount-TURF-476.e2e-spec.js +1 -1
  45. package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-discount-TURF-476.spec.js +1 -1
  46. package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-extend-remove-TURF-476.spec.js +1 -1
  47. package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-half-amount-paid.spec.js +1 -1
  48. package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid-cancellation-not-present.spec.js +1 -1
  49. package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid.spec.js +1 -1
  50. package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-paid.spec.js +1 -1
  51. package/build/{src/tests → tests}/unit/charges/discount-conditional/basic.-amount-not-paid.spec.js +1 -1
  52. package/build/{src/tests → tests}/unit/charges/discount-conditional/decimal-discount.spec.js +1 -1
  53. package/build/{src/tests → tests}/unit/charges/per-hour-unit/phu-basic-amount-not-paid-TURF-486.spec.js +1 -1
  54. package/build/{src/tests → tests}/utils/models/booking-entity-test.d.ts +1 -1
  55. package/build/{src/tests → tests}/utils/models/booking-entity-test.js +1 -1
  56. package/package.json +42 -42
  57. /package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-booking-TURF-476.spec.d.ts +0 -0
  58. /package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-booking-without-discount-TURF-476.e2e-spec.d.ts +0 -0
  59. /package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-discount-TURF-476.spec.d.ts +0 -0
  60. /package/build/{src/tests → tests}/unit/charges/across-dates/across-dates-extend-remove-TURF-476.spec.d.ts +0 -0
  61. /package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-half-amount-paid.spec.d.ts +0 -0
  62. /package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid-cancellation-not-present.spec.d.ts +0 -0
  63. /package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid.spec.d.ts +0 -0
  64. /package/build/{src/tests → tests}/unit/charges/discount-conditional/basic-amount-paid.spec.d.ts +0 -0
  65. /package/build/{src/tests → tests}/unit/charges/discount-conditional/basic.-amount-not-paid.spec.d.ts +0 -0
  66. /package/build/{src/tests → tests}/unit/charges/discount-conditional/decimal-discount.spec.d.ts +0 -0
  67. /package/build/{src/tests → tests}/unit/charges/per-hour-unit/phu-basic-amount-not-paid-TURF-486.spec.d.ts +0 -0
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
- ## 1 npm init -y
2
-
3
- ## 2 npm login
4
-
5
- ## 3 npm version patch
6
-
7
- # //it increase version
8
-
9
- ## 3 npm publish --access public
10
-
11
- # //npm publish by default --access public
12
-
13
- ## 4 npm run version:deploy
14
-
15
- ### deploy version
16
-
17
- ## Client side
18
-
19
- update package command <br />
20
- npm update turf-comman
1
+ ## 1 npm init -y
2
+
3
+ ## 2 npm login
4
+
5
+ ## 3 npm version patch
6
+
7
+ # //it increase version
8
+
9
+ ## 3 npm publish --access public
10
+
11
+ # //npm publish by default --access public
12
+
13
+ ## 4 npm run version:deploy
14
+
15
+ ### deploy version
16
+
17
+ ## Client side
18
+
19
+ update package command <br />
20
+ npm update turf-comman
@@ -0,0 +1 @@
1
+ export * from "./src/@enum";
package/build/@enum.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/@enum"), exports);
@@ -0,0 +1 @@
1
+ export * from "./src/exceptions/app-badrequest.exception";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/exceptions/app-badrequest.exception"), exports);
@@ -0,0 +1 @@
1
+ export * from "./src/@model";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/@model"), exports);
@@ -0,0 +1 @@
1
+ export * from "./src/@type";
package/build/@type.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/@type"), exports);
@@ -0,0 +1 @@
1
+ export * from "./src/@utils";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/@utils"), exports);
@@ -24,3 +24,6 @@ export * from "./enums/bookings-status.enum";
24
24
  export * from "./enums/organization-type.enum";
25
25
  export * from "./enums/environment.enum";
26
26
  export * from "./enums/availability-view.enum";
27
+ export * from "./enums/socket-io-booking-operation.enum";
28
+ export * from "./enums/pitch-sports.enum";
29
+ export * from "./enums/pitch-operation.enum";
@@ -40,3 +40,6 @@ __exportStar(require("./enums/bookings-status.enum"), exports);
40
40
  __exportStar(require("./enums/organization-type.enum"), exports);
41
41
  __exportStar(require("./enums/environment.enum"), exports);
42
42
  __exportStar(require("./enums/availability-view.enum"), exports);
43
+ __exportStar(require("./enums/socket-io-booking-operation.enum"), exports);
44
+ __exportStar(require("./enums/pitch-sports.enum"), exports);
45
+ __exportStar(require("./enums/pitch-operation.enum"), exports);
@@ -31,3 +31,5 @@ export * from "./interface/ui/upgrade-subscription-data.interface";
31
31
  export * from "./interface/ui/booking-data.interface";
32
32
  export * from "./interface/ng-date-structure.interface";
33
33
  export * from "./interface/convert-to-midnight-time.interface";
34
+ export * from "./interface/socket-io-bookings.interface";
35
+ export * from "./interface/user-entity-essential-info.interface";
@@ -48,3 +48,5 @@ __exportStar(require("./interface/ui/upgrade-subscription-data.interface"), expo
48
48
  __exportStar(require("./interface/ui/booking-data.interface"), exports);
49
49
  __exportStar(require("./interface/ng-date-structure.interface"), exports);
50
50
  __exportStar(require("./interface/convert-to-midnight-time.interface"), exports);
51
+ __exportStar(require("./interface/socket-io-bookings.interface"), exports);
52
+ __exportStar(require("./interface/user-entity-essential-info.interface"), exports);
@@ -21,3 +21,27 @@ export interface IGetPricingPlanByDateResponse {
21
21
  };
22
22
  };
23
23
  }
24
+ export interface IGetPricingPlanByDateResponseV2 {
25
+ id: number;
26
+ effective_from_date: number;
27
+ effective_to_date: number;
28
+ base_price: number;
29
+ unit: string;
30
+ billing_cost_code: string;
31
+ pitch_slab: {
32
+ [key: string]: {
33
+ from: number;
34
+ to: number;
35
+ discount: string;
36
+ };
37
+ };
38
+ billing_cycle: {
39
+ [key: string]: {
40
+ from: number;
41
+ to: number;
42
+ discount: string;
43
+ name: string;
44
+ key: string;
45
+ };
46
+ };
47
+ }
@@ -5,3 +5,9 @@ export interface IBillingCycleModel {
5
5
  name: string;
6
6
  key: string;
7
7
  }
8
+ export interface IBillingCycleModelV2 {
9
+ from: number;
10
+ to: number;
11
+ name: string;
12
+ key: string;
13
+ }
@@ -13,4 +13,20 @@ export interface IPricingPlanEntity extends IEntityAuditColumn {
13
13
  basePrice: number;
14
14
  billingCycle: string;
15
15
  unit: string;
16
+ billingCostCode: string | null;
17
+ subscriptionCycle: string | null;
18
+ }
19
+ export interface IPricingPlanEntityV2 extends IEntityAuditColumn {
20
+ id: number;
21
+ effectiveFrom: Date;
22
+ effectiveTo: Date;
23
+ status: PricingPlanStatus;
24
+ createdBy: number;
25
+ createdOn: Date;
26
+ updatedBy: number;
27
+ updatedOn: Date;
28
+ basePrice: number;
29
+ unit: string;
30
+ subscriptionCycle: string | null;
31
+ billingCostCode: string | null;
16
32
  }
@@ -24,3 +24,7 @@ export type ISubscriptionModel = ISubscriptionEntity & {
24
24
  details?: ISubscriptionPitchMappingEntity[];
25
25
  advanceAmount?: number;
26
26
  };
27
+ export type ISubscriptionModelV2 = ISubscriptionEntity & {
28
+ details?: ISubscriptionPitchMappingEntity[];
29
+ advanceAmount?: number;
30
+ };
@@ -6,3 +6,10 @@ export interface ISubscriptionPitchMappingEntity extends IEntityAuditColumn {
6
6
  status: string;
7
7
  organizationId: number;
8
8
  }
9
+ export interface ISubscriptionPitchMappingEntityV2 extends IEntityAuditColumn {
10
+ pitchId: number;
11
+ turfId: number;
12
+ subscriptionId: number;
13
+ status: string;
14
+ organizationId: number;
15
+ }
@@ -21,3 +21,25 @@ export interface GetPricingPlanByDateResponse {
21
21
  };
22
22
  };
23
23
  }
24
+ export interface GetPricingPlanByDateResponseV2 {
25
+ id: number;
26
+ effective_from_date: number;
27
+ effective_to_date: number;
28
+ base_price: number;
29
+ unit: string;
30
+ pitch_slab: {
31
+ [key: string]: {
32
+ from: number;
33
+ to: number;
34
+ };
35
+ };
36
+ billing_cycle: {
37
+ [key: string]: {
38
+ from: number;
39
+ to: number;
40
+ name: string;
41
+ key: string;
42
+ };
43
+ };
44
+ billing_cost_code: string;
45
+ }
@@ -1,7 +1,7 @@
1
- import { PricingPlanModel } from "../../models/pricing-plan-model";
2
- import { IPricingPlanEntity } from "../entity/pricing-plan-entity.interface";
3
- import { GetPricingPlanByDateResponse } from "../get-pricing-plan-by-date-response.interface";
4
- import { IPitchSlab } from "../pitch-slab.interface";
1
+ import { PricingPlanModel, PricingPlanModelV2 } from "../../models/pricing-plan-model";
2
+ import { IPricingPlanEntity, IPricingPlanEntityV2 } from "../entity/pricing-plan-entity.interface";
3
+ import { GetPricingPlanByDateResponse, GetPricingPlanByDateResponseV2 } from "../get-pricing-plan-by-date-response.interface";
4
+ import { IPitchSlab, IPitchSlabV2 } from "../pitch-slab.interface";
5
5
  export interface IPricingPlanEntityModel extends IPricingPlanEntity {
6
6
  getBillingCycleKeys(): string[];
7
7
  toModel(): PricingPlanModel;
@@ -11,3 +11,12 @@ export interface IPricingPlanEntityModel extends IPricingPlanEntity {
11
11
  toObject(): GetPricingPlanByDateResponse;
12
12
  toPitchSlabs(): IPitchSlab[];
13
13
  }
14
+ export interface IPricingPlanEntityModelV2 extends IPricingPlanEntityV2 {
15
+ getBillingCycleKeys(): string[];
16
+ toModel(): PricingPlanModelV2;
17
+ arrayToIndexedObject<T>(arr: T[]): {
18
+ [key: string]: T;
19
+ };
20
+ toObject(): GetPricingPlanByDateResponseV2;
21
+ toPitchSlabs(): IPitchSlabV2[];
22
+ }
@@ -6,3 +6,11 @@ export interface ISlabDto {
6
6
  to: number;
7
7
  discount: string;
8
8
  }
9
+ export interface IPitchSlabDtoV2 {
10
+ [key: string]: ISlabDtoV2;
11
+ }
12
+ export interface ISlabDtoV2 {
13
+ from: number;
14
+ to: number;
15
+ discount: string;
16
+ }
@@ -3,3 +3,7 @@ export interface IPitchSlab {
3
3
  to: number;
4
4
  discount: string;
5
5
  }
6
+ export interface IPitchSlabV2 {
7
+ from: number;
8
+ to: number;
9
+ }
@@ -1,5 +1,5 @@
1
- import { IBillingCycleModel } from "./billing-cycle.interface";
2
- import { IPitchSlab } from "./pitch-slab.interface";
1
+ import { IBillingCycleModel, IBillingCycleModelV2 } from "./billing-cycle.interface";
2
+ import { IPitchSlab, IPitchSlabV2 } from "./pitch-slab.interface";
3
3
  export interface IPricingPlanModel {
4
4
  id: number;
5
5
  effective_from_date: number;
@@ -13,3 +13,17 @@ export interface IPricingPlanModel {
13
13
  [key: string]: IBillingCycleModel;
14
14
  };
15
15
  }
16
+ export interface IPricingPlanModelV2 {
17
+ id: number;
18
+ effective_from_date: number;
19
+ effective_to_date: number;
20
+ base_price: number;
21
+ unit: string;
22
+ pitch_slab: {
23
+ [key: string]: IPitchSlabV2;
24
+ };
25
+ billing_cycle: {
26
+ [key: string]: IBillingCycleModelV2;
27
+ };
28
+ billing_cost_code: string;
29
+ }
@@ -13,3 +13,8 @@ export type RenewSubscriptionData = PickOnly<ISubscriptionEntity, "noOfPitches"
13
13
  toDate: Date;
14
14
  basePrice: number;
15
15
  };
16
+ export type RenewSubscriptionDataV2 = PickOnly<ISubscriptionEntity, "noOfPitches" | "netAmount" | "grossAmount" | "organizationId" | "pricingPlanId" | "registrationId" | "type" | "previousSubscriptionIds" | "amountPaid" | "discount"> & {
17
+ fromDate: Date;
18
+ toDate: Date;
19
+ basePrice: number;
20
+ };
@@ -0,0 +1,3 @@
1
+ import { IUserEntity } from "./entity";
2
+ export interface IUserEntityEssentialInfo extends Pick<IUserEntity, "id" | "firstname" | "phone" | "email" | "type"> {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { IBillingCycleModel } from "../interface/billing-cycle.interface";
1
+ import { IBillingCycleModel, IBillingCycleModelV2 } from "../interface/billing-cycle.interface";
2
2
  export declare class BillingCycleModel implements IBillingCycleModel {
3
3
  from: number;
4
4
  to: number;
@@ -9,3 +9,11 @@ export declare class BillingCycleModel implements IBillingCycleModel {
9
9
  getDiscount(): number;
10
10
  getBillingCycle(date: Date): [Date, Date];
11
11
  }
12
+ export declare class BillingCycleModelV2 implements IBillingCycleModelV2 {
13
+ from: number;
14
+ to: number;
15
+ name: string;
16
+ key: string;
17
+ constructor(data: IBillingCycleModelV2);
18
+ getBillingCycle(date: Date): [Date, Date];
19
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BillingCycleModel = void 0;
3
+ exports.BillingCycleModelV2 = exports.BillingCycleModel = void 0;
4
4
  var date_util_1 = require("../utils/date-util");
5
5
  var BillingCycleModel = /** @class */ (function () {
6
6
  function BillingCycleModel(data) {
@@ -25,3 +25,27 @@ var BillingCycleModel = /** @class */ (function () {
25
25
  return BillingCycleModel;
26
26
  }());
27
27
  exports.BillingCycleModel = BillingCycleModel;
28
+ // v2 __________________________________________________________________________________________//
29
+ var BillingCycleModelV2 = /** @class */ (function () {
30
+ function BillingCycleModelV2(data) {
31
+ this.from = data.from;
32
+ this.to = data.to;
33
+ // this.discount = data.discount;
34
+ this.name = data.name;
35
+ this.key = data.key;
36
+ }
37
+ // public getDiscount(): number {
38
+ // if (this.discount.indexOf("P") > -1) {
39
+ // return parseFloat(this.discount.replace("P", ""));
40
+ // }
41
+ // return 0;
42
+ // }
43
+ BillingCycleModelV2.prototype.getBillingCycle = function (date) {
44
+ // const dateUtilService = AppInjector.get(DateUtilService);
45
+ var startDate = date_util_1.dateUtilService.addNDaysToDate(date, 1);
46
+ var endDate = date_util_1.dateUtilService.addNDaysToDate(startDate, this.to * 30);
47
+ return [startDate, endDate];
48
+ };
49
+ return BillingCycleModelV2;
50
+ }());
51
+ exports.BillingCycleModelV2 = BillingCycleModelV2;
@@ -1,11 +1,11 @@
1
1
  import { PricingPlanStatus } from "../../enums/pricing-plan-status.enum";
2
- import { IBillingCycleModel } from "../../interface/billing-cycle.interface";
3
- import { GetPricingPlanByDateResponse } from "../../interface/get-pricing-plan-by-date-response.interface";
4
- import { IPitchSlab } from "../../interface/pitch-slab.interface";
5
- import { IPricingPlanEntityModel } from "../../interface/model/pricing-plan-entity-model.interface";
6
- import { IPricingPlanEntity } from "../../interface/entity/pricing-plan-entity.interface";
7
- import { BillingCycleModel } from "../billing-cycle-model";
8
- import { PricingPlanModel } from "../pricing-plan-model";
2
+ import { IBillingCycleModel, IBillingCycleModelV2 } from "../../interface/billing-cycle.interface";
3
+ import { GetPricingPlanByDateResponse, GetPricingPlanByDateResponseV2 } from "../../interface/get-pricing-plan-by-date-response.interface";
4
+ import { IPitchSlab, IPitchSlabV2 } from "../../interface/pitch-slab.interface";
5
+ import { IPricingPlanEntityModel, IPricingPlanEntityModelV2 } from "../../interface/model/pricing-plan-entity-model.interface";
6
+ import { IPricingPlanEntity, IPricingPlanEntityV2 } from "../../interface/entity/pricing-plan-entity.interface";
7
+ import { BillingCycleModel, BillingCycleModelV2 } from "../billing-cycle-model";
8
+ import { PricingPlanModel, PricingPlanModelV2 } from "../pricing-plan-model";
9
9
  export declare class PricingPlanEntityModel implements IPricingPlanEntityModel {
10
10
  id: number;
11
11
  effectiveFrom: Date;
@@ -19,6 +19,8 @@ export declare class PricingPlanEntityModel implements IPricingPlanEntityModel {
19
19
  basePrice: number;
20
20
  billingCycle: string;
21
21
  unit: string;
22
+ billingCostCode: string | null;
23
+ subscriptionCycle: string | null;
22
24
  constructor(data: IPricingPlanEntity);
23
25
  getBillingCycleKeys(): string[];
24
26
  toModel(): PricingPlanModel;
@@ -34,6 +36,11 @@ export declare class PitchSlabParser {
34
36
  constructor(code: string);
35
37
  parseToModel(): IPitchSlab;
36
38
  }
39
+ export declare class PitchSlabParserV2 {
40
+ code: string;
41
+ constructor(code: string);
42
+ parseToModel(): IPitchSlabV2;
43
+ }
37
44
  export declare class BillingCycleCodeParser {
38
45
  code: string;
39
46
  from: number;
@@ -45,3 +52,36 @@ export declare class BillingCycleCodeParser {
45
52
  parseToModel(): BillingCycleModel;
46
53
  getKey(): string;
47
54
  }
55
+ export declare class PricingPlanEntityModelV2 implements IPricingPlanEntityModelV2 {
56
+ id: number;
57
+ effectiveFrom: Date;
58
+ effectiveTo: Date;
59
+ status: PricingPlanStatus;
60
+ createdBy: number;
61
+ createdOn: Date;
62
+ updatedBy: number;
63
+ updatedOn: Date;
64
+ basePrice: number;
65
+ unit: string;
66
+ billingCostCode: string | null;
67
+ subscriptionCycle: string | null;
68
+ constructor(data: IPricingPlanEntityV2);
69
+ getBillingCycleKeys(): string[];
70
+ toModel(): PricingPlanModelV2;
71
+ arrayToIndexedObject<T>(arr: T[]): {
72
+ [key: string]: T;
73
+ };
74
+ toObject(): GetPricingPlanByDateResponseV2;
75
+ toPitchSlabs(): IPitchSlabV2[];
76
+ toBillingCycles(): IBillingCycleModelV2[];
77
+ }
78
+ export declare class BillingCycleCodeParserV2 {
79
+ code: string;
80
+ from: number;
81
+ to: number;
82
+ name: string;
83
+ constructor(code: string);
84
+ parse(): BillingCycleCodeParserV2;
85
+ parseToModel(): BillingCycleModelV2;
86
+ getKey(): string;
87
+ }