ia-common 1.0.1-beta.169 → 1.0.1-beta.171
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/interface/api/get-nfo-advice.interface.d.ts +2 -1
- package/package.json +1 -1
- package/build/interface/api/remove-bank-details-by-id.interface.d.ts +0 -7
- package/build/interface/api/remove-bank-details-by-id.interface.js +0 -2
- package/build/interface/api/remove-pricing-plan-by-id.interface.d.ts +0 -6
- package/build/interface/api/remove-pricing-plan-by-id.interface.js +0 -2
- package/build/model/subscription-model.d.ts +0 -24
- package/build/model/subscription-model.js +0 -53
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SubscriptionStatus } from "../@enum";
|
|
2
|
-
import { ICreateSubscriptionRequest, ISubscriptionEntity, IUserEntity } from "../@type";
|
|
3
|
-
export declare class SubscriptionEntityModel implements ISubscriptionEntity {
|
|
4
|
-
id: number;
|
|
5
|
-
fromDateCode: number;
|
|
6
|
-
toDateCode: number;
|
|
7
|
-
organizationId: number;
|
|
8
|
-
type: string;
|
|
9
|
-
grossAmount: number;
|
|
10
|
-
discount: string;
|
|
11
|
-
netAmount: number;
|
|
12
|
-
amountPaid: number;
|
|
13
|
-
status: SubscriptionStatus;
|
|
14
|
-
remarks: string;
|
|
15
|
-
registrationId: number;
|
|
16
|
-
pricingPlanId: number;
|
|
17
|
-
createdOn: Date;
|
|
18
|
-
updatedOn: Date;
|
|
19
|
-
createdBy: number;
|
|
20
|
-
updatedBy: number;
|
|
21
|
-
constructor(subscriptionEntity: ISubscriptionEntity);
|
|
22
|
-
static getEntityInstanceByICreateSubscriptionRequestUserEntity(body: ICreateSubscriptionRequest, userEntity: IUserEntity, status: SubscriptionStatus, pricingPlanId: number): ISubscriptionEntity;
|
|
23
|
-
validateAdvanceAmount(isAmountPaidValidation?: boolean): void;
|
|
24
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionEntityModel = void 0;
|
|
4
|
-
var _model_1 = require("../@model");
|
|
5
|
-
var SubscriptionEntityModel = /** @class */ (function () {
|
|
6
|
-
function SubscriptionEntityModel(subscriptionEntity) {
|
|
7
|
-
Object.assign(this, subscriptionEntity);
|
|
8
|
-
}
|
|
9
|
-
SubscriptionEntityModel.getEntityInstanceByICreateSubscriptionRequestUserEntity = function (body, userEntity, status, pricingPlanId) {
|
|
10
|
-
var _a;
|
|
11
|
-
var subscriptionEntity = {};
|
|
12
|
-
subscriptionEntity.organizationId = userEntity.organizationId;
|
|
13
|
-
subscriptionEntity.fromDateCode = body.from;
|
|
14
|
-
subscriptionEntity.toDateCode = body.to;
|
|
15
|
-
subscriptionEntity.type = body.type;
|
|
16
|
-
subscriptionEntity.grossAmount = body.grossAmount;
|
|
17
|
-
subscriptionEntity.discount = body.discount;
|
|
18
|
-
subscriptionEntity.netAmount = body.netAmount;
|
|
19
|
-
subscriptionEntity.amountPaid = body.amountPaid;
|
|
20
|
-
subscriptionEntity.status = status;
|
|
21
|
-
subscriptionEntity.remarks = (_a = body.remarks) !== null && _a !== void 0 ? _a : "";
|
|
22
|
-
subscriptionEntity.createdBy = userEntity.id;
|
|
23
|
-
subscriptionEntity.createdOn = new Date();
|
|
24
|
-
subscriptionEntity.updatedBy = userEntity.id;
|
|
25
|
-
subscriptionEntity.updatedOn = new Date();
|
|
26
|
-
subscriptionEntity.pricingPlanId = pricingPlanId;
|
|
27
|
-
subscriptionEntity.registrationId = userEntity.registrationId;
|
|
28
|
-
return subscriptionEntity;
|
|
29
|
-
};
|
|
30
|
-
SubscriptionEntityModel.prototype.validateAdvanceAmount = function (isAmountPaidValidation) {
|
|
31
|
-
if (isAmountPaidValidation === void 0) { isAmountPaidValidation = false; }
|
|
32
|
-
if (this.amountPaid > this.netAmount) {
|
|
33
|
-
if (isAmountPaidValidation) {
|
|
34
|
-
throw new _model_1.AppBadRequestException({
|
|
35
|
-
key: "amountPaid",
|
|
36
|
-
message: [
|
|
37
|
-
"amount paid ".concat(this.amountPaid, " is not equal to net amount ").concat(this.netAmount),
|
|
38
|
-
],
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
throw new _model_1.AppBadRequestException({
|
|
43
|
-
key: "advanceAmount",
|
|
44
|
-
message: [
|
|
45
|
-
"advance should not greater than net amount:'".concat(this.netAmount, "'"),
|
|
46
|
-
],
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
return SubscriptionEntityModel;
|
|
52
|
-
}());
|
|
53
|
-
exports.SubscriptionEntityModel = SubscriptionEntityModel;
|