ia-common 1.0.1-beta.29 → 1.0.1-beta.30

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.
package/build/@type.js CHANGED
@@ -24,3 +24,4 @@ __exportStar(require("./interface/modify.interface"), exports);
24
24
  __exportStar(require("./interface/update-user-info.interface"), exports);
25
25
  __exportStar(require("./interface/user-entity-without-password.interface"), exports);
26
26
  __exportStar(require("./interface/pricing-plan-model.interface"), exports);
27
+ // export * from "./interface/ng-date-struct.interface";
File without changes
@@ -0,0 +1,5 @@
1
+ // export interface INgbDateStruct {
2
+ // year: number;
3
+ // month: number;
4
+ // day: number;
5
+ // }
@@ -1,21 +1 @@
1
- import { PricingPlanModel } from "./pricing-plan-model";
2
- export declare class SubscribedPricingPlanModel {
3
- billingCycleKey: string;
4
- selectedBillingCycle: {
5
- noOfMonths: number;
6
- discount: string;
7
- name: string;
8
- key: string;
9
- };
10
- selectedPitchSlabBasePrice: number;
11
- basePrice: number;
12
- constructor(data: PricingPlanModel, billingCycleKey: string);
13
- getBasePrice(): number;
14
- getGrossAmount(config?: {
15
- roundDown: boolean;
16
- }): number;
17
- getNetAmount(config?: {
18
- roundDown: boolean;
19
- }): number;
20
- getBillingDiscount(): number;
21
- }
1
+ export {};
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubscribedPricingPlanModel = void 0;
3
+ var _utils_1 = require("../@utils");
4
4
  var SubscribedPricingPlanModel = /** @class */ (function () {
5
5
  function SubscribedPricingPlanModel(data, billingCycleKey) {
6
6
  // super(data);
7
7
  this.basePrice = data.basePrice;
8
8
  this.billingCycleKey = billingCycleKey;
9
9
  this.selectedBillingCycle = data.getBillCycleByKey(billingCycleKey);
10
+ this.pricingPlanModel = data;
10
11
  }
11
- SubscribedPricingPlanModel.prototype.getBasePrice = function () {
12
- return this.selectedPitchSlabBasePrice;
13
- };
14
12
  SubscribedPricingPlanModel.prototype.getGrossAmount = function (config) {
15
13
  if (config === void 0) { config = { roundDown: false }; }
16
14
  var roundDown = config.roundDown;
@@ -21,6 +19,11 @@ var SubscribedPricingPlanModel = /** @class */ (function () {
21
19
  return Math.round(this.basePrice * this.selectedBillingCycle.noOfMonths);
22
20
  }
23
21
  };
22
+ SubscribedPricingPlanModel.prototype.getNextBillingCycleDateRange = function () {
23
+ var subscriptionDays = this.pricingPlanModel.getNoOfSubscriptionDays(this.billingCycleKey);
24
+ var date = _utils_1.dateUtil.addNDaysToDateCode(_utils_1.dateUtil.getDateCode(new Date()), subscriptionDays);
25
+ return { subscriptionDays: subscriptionDays, date: date };
26
+ };
24
27
  SubscribedPricingPlanModel.prototype.getNetAmount = function (config) {
25
28
  if (config === void 0) { config = { roundDown: false }; }
26
29
  var roundDown = config.roundDown;
@@ -43,4 +46,3 @@ var SubscribedPricingPlanModel = /** @class */ (function () {
43
46
  };
44
47
  return SubscribedPricingPlanModel;
45
48
  }());
46
- exports.SubscribedPricingPlanModel = SubscribedPricingPlanModel;
@@ -1,6 +1,7 @@
1
1
  export declare class DateUtil {
2
2
  static isValidDate(dateCode: string): boolean;
3
3
  getDateCode(date: Date): string;
4
+ getTodayCode(): string;
4
5
  convertStringToDate(dateString: string, format?: string): Date;
5
6
  addNDaysToDate(date: Date, n: number): Date;
6
7
  addNDaysToDateCode(dateCode: string, n: number): string;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dateUtil = exports.DateUtil = void 0;
4
4
  var date_fns_1 = require("date-fns");
5
+ // import { INgbDateStruct } from "../@type";
5
6
  var DateUtil = /** @class */ (function () {
6
7
  function DateUtil() {
7
8
  }
@@ -23,6 +24,9 @@ var DateUtil = /** @class */ (function () {
23
24
  DateUtil.prototype.getDateCode = function (date) {
24
25
  return (0, date_fns_1.format)(date, "yyMMdd");
25
26
  };
27
+ DateUtil.prototype.getTodayCode = function () {
28
+ return (0, date_fns_1.format)(new Date(), "yyMMdd");
29
+ };
26
30
  DateUtil.prototype.convertStringToDate = function (dateString, format) {
27
31
  if (format === void 0) { format = "yyMMdd"; }
28
32
  var parsedDate = (0, date_fns_1.parse)(dateString, format, new Date());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ia-common",
3
- "version": "1.0.1-beta.29",
3
+ "version": "1.0.1-beta.30",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,22 +0,0 @@
1
- export interface ILoginResponse {
2
- UIMessage: string;
3
- tokenType: string;
4
- accessToken: string;
5
- id: string;
6
- firstname: string;
7
- status: string;
8
- requireNewPassword: boolean;
9
- userId: number;
10
- role: string;
11
- email: string | null;
12
- imageUrl: string | null;
13
- userPermissions: string[];
14
- registrationId: number;
15
- organizationId: number;
16
- subscriptionStatus: string | null;
17
- contact: string;
18
- }
19
- export interface ILoginRequest {
20
- username: string;
21
- password: string;
22
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });