gemcap-be-common 1.5.83 → 1.5.84
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/models/HistoricalLoanCharge.model.d.ts +61 -0
- package/models/HistoricalLoanCharge.model.js +71 -0
- package/models/HistoricalLoanCharge.model.ts +106 -0
- package/models/_models.d.ts +1 -0
- package/models/_models.js +2 -1
- package/models/_models.ts +2 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/types" />
|
|
2
|
+
/// <reference types="mongoose/types/models" />
|
|
3
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
4
|
+
/// <reference types="mongoose/types/utility" />
|
|
5
|
+
/// <reference types="mongoose/types/document" />
|
|
6
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
7
|
+
/// <reference types="mongoose/types/callback" />
|
|
8
|
+
/// <reference types="mongoose/types/collection" />
|
|
9
|
+
/// <reference types="mongoose/types/connection" />
|
|
10
|
+
/// <reference types="mongoose/types/cursor" />
|
|
11
|
+
/// <reference types="mongoose/types/document" />
|
|
12
|
+
/// <reference types="mongoose/types/error" />
|
|
13
|
+
/// <reference types="mongoose/types/expressions" />
|
|
14
|
+
/// <reference types="mongoose/types/helpers" />
|
|
15
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
16
|
+
/// <reference types="mongoose/types/indexes" />
|
|
17
|
+
/// <reference types="mongoose/types/models" />
|
|
18
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
19
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
20
|
+
/// <reference types="mongoose/types/populate" />
|
|
21
|
+
/// <reference types="mongoose/types/query" />
|
|
22
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
23
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
24
|
+
/// <reference types="mongoose/types/session" />
|
|
25
|
+
/// <reference types="mongoose/types/types" />
|
|
26
|
+
/// <reference types="mongoose/types/utility" />
|
|
27
|
+
/// <reference types="mongoose/types/validation" />
|
|
28
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
29
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
30
|
+
import mongoose from 'mongoose';
|
|
31
|
+
import Joi from 'joi';
|
|
32
|
+
export interface IHistoricalLoanCharge {
|
|
33
|
+
loanProductId: mongoose.Types.ObjectId;
|
|
34
|
+
date: Date;
|
|
35
|
+
paymentDate: Date;
|
|
36
|
+
source: string;
|
|
37
|
+
chargeId: mongoose.Types.ObjectId;
|
|
38
|
+
chargeName: string;
|
|
39
|
+
amount: number;
|
|
40
|
+
amountPaid: number;
|
|
41
|
+
}
|
|
42
|
+
export type THistoricalLoanChargeDoc = mongoose.HydratedDocument<IHistoricalLoanCharge>;
|
|
43
|
+
export interface IHistoricalLoanChargeLean extends IHistoricalLoanCharge {
|
|
44
|
+
_id: mongoose.Types.ObjectId;
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
updatedAt: Date;
|
|
47
|
+
}
|
|
48
|
+
export interface IHistoricalLoanChargePlain extends Omit<IHistoricalLoanCharge, 'loanProductId' | 'chargeId'> {
|
|
49
|
+
_id: string;
|
|
50
|
+
loanProductId: string;
|
|
51
|
+
chargeId: string;
|
|
52
|
+
createdAt: Date;
|
|
53
|
+
updatedAt: Date;
|
|
54
|
+
}
|
|
55
|
+
export declare const HistoricalLoanChargeCreateValidationSchema: Joi.ObjectSchema<any>;
|
|
56
|
+
export declare const HistoricalLoanChargeUpdateValidationSchema: Joi.ObjectSchema<any>;
|
|
57
|
+
export type THistoricalLoanChargeModel = mongoose.Model<IHistoricalLoanCharge>;
|
|
58
|
+
export declare const HistoricalLoanChargeSchema: mongoose.Schema<IHistoricalLoanCharge, THistoricalLoanChargeModel, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, IHistoricalLoanCharge, mongoose.Document<unknown, {}, mongoose.FlatRecord<IHistoricalLoanCharge>> & mongoose.FlatRecord<IHistoricalLoanCharge> & {
|
|
59
|
+
_id: mongoose.Types.ObjectId;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const HistoricalLoanCharge: THistoricalLoanChargeModel;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HistoricalLoanCharge = exports.HistoricalLoanChargeSchema = exports.HistoricalLoanChargeUpdateValidationSchema = exports.HistoricalLoanChargeCreateValidationSchema = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const joi_1 = __importDefault(require("joi"));
|
|
9
|
+
const _models_1 = require("./_models");
|
|
10
|
+
exports.HistoricalLoanChargeCreateValidationSchema = joi_1.default.object({
|
|
11
|
+
loanProductId: joi_1.default.string().required(),
|
|
12
|
+
date: joi_1.default.date().required(),
|
|
13
|
+
paymentDate: joi_1.default.date().required(),
|
|
14
|
+
chargeId: joi_1.default.string().required(),
|
|
15
|
+
source: joi_1.default.string().required(),
|
|
16
|
+
chargeName: joi_1.default.string().required(),
|
|
17
|
+
amount: joi_1.default.number().required(),
|
|
18
|
+
amountPaid: joi_1.default.number().required(),
|
|
19
|
+
});
|
|
20
|
+
exports.HistoricalLoanChargeUpdateValidationSchema = joi_1.default.object({
|
|
21
|
+
_id: joi_1.default.string().required(),
|
|
22
|
+
loanProductId: joi_1.default.string(),
|
|
23
|
+
date: joi_1.default.date(),
|
|
24
|
+
paymentDate: joi_1.default.date(),
|
|
25
|
+
chargeId: joi_1.default.string(),
|
|
26
|
+
source: joi_1.default.string(),
|
|
27
|
+
chargeName: joi_1.default.string(),
|
|
28
|
+
amount: joi_1.default.number(),
|
|
29
|
+
amountPaid: joi_1.default.number(),
|
|
30
|
+
});
|
|
31
|
+
exports.HistoricalLoanChargeSchema = new mongoose_1.default.Schema({
|
|
32
|
+
loanProductId: {
|
|
33
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
34
|
+
ref: _models_1.MODEL_NAMES.loanProducts,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
date: {
|
|
38
|
+
type: Date,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
paymentDate: {
|
|
42
|
+
type: Date,
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
source: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
chargeId: {
|
|
50
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
51
|
+
ref: _models_1.MODEL_NAMES.loanCharges,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
chargeName: {
|
|
55
|
+
type: String,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
amount: {
|
|
59
|
+
type: Number,
|
|
60
|
+
required: true,
|
|
61
|
+
},
|
|
62
|
+
amountPaid: {
|
|
63
|
+
type: Number,
|
|
64
|
+
required: true,
|
|
65
|
+
},
|
|
66
|
+
}, {
|
|
67
|
+
timestamps: { createdAt: true, updatedAt: true },
|
|
68
|
+
versionKey: false,
|
|
69
|
+
});
|
|
70
|
+
exports.HistoricalLoanChargeSchema.index({ loanProductId: 1, chargeId: 1, date: 1 }, { unique: true });
|
|
71
|
+
exports.HistoricalLoanCharge = mongoose_1.default.model(_models_1.MODEL_NAMES.historicalLoanCharges, exports.HistoricalLoanChargeSchema);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
|
|
4
|
+
import { MODEL_NAMES } from './_models';
|
|
5
|
+
|
|
6
|
+
export interface IHistoricalLoanCharge {
|
|
7
|
+
loanProductId: mongoose.Types.ObjectId;
|
|
8
|
+
date: Date;
|
|
9
|
+
paymentDate: Date;
|
|
10
|
+
source: string;
|
|
11
|
+
chargeId: mongoose.Types.ObjectId;
|
|
12
|
+
chargeName: string;
|
|
13
|
+
amount: number;
|
|
14
|
+
amountPaid: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type THistoricalLoanChargeDoc = mongoose.HydratedDocument<IHistoricalLoanCharge>;
|
|
18
|
+
|
|
19
|
+
export interface IHistoricalLoanChargeLean extends IHistoricalLoanCharge {
|
|
20
|
+
_id: mongoose.Types.ObjectId;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface IHistoricalLoanChargePlain extends Omit<IHistoricalLoanCharge, 'loanProductId' | 'chargeId'> {
|
|
26
|
+
_id: string;
|
|
27
|
+
loanProductId: string;
|
|
28
|
+
chargeId: string;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
updatedAt: Date;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const HistoricalLoanChargeCreateValidationSchema = Joi.object({
|
|
34
|
+
loanProductId: Joi.string().required(),
|
|
35
|
+
date: Joi.date().required(),
|
|
36
|
+
paymentDate: Joi.date().required(),
|
|
37
|
+
chargeId: Joi.string().required(),
|
|
38
|
+
source: Joi.string().required(),
|
|
39
|
+
chargeName: Joi.string().required(),
|
|
40
|
+
amount: Joi.number().required(),
|
|
41
|
+
amountPaid: Joi.number().required(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const HistoricalLoanChargeUpdateValidationSchema = Joi.object({
|
|
45
|
+
_id: Joi.string().required(),
|
|
46
|
+
loanProductId: Joi.string(),
|
|
47
|
+
date: Joi.date(),
|
|
48
|
+
paymentDate: Joi.date(),
|
|
49
|
+
chargeId: Joi.string(),
|
|
50
|
+
source: Joi.string(),
|
|
51
|
+
chargeName: Joi.string(),
|
|
52
|
+
amount: Joi.number(),
|
|
53
|
+
amountPaid: Joi.number(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export type THistoricalLoanChargeModel = mongoose.Model<IHistoricalLoanCharge>;
|
|
57
|
+
|
|
58
|
+
export const HistoricalLoanChargeSchema = new mongoose.Schema<IHistoricalLoanCharge, THistoricalLoanChargeModel>(
|
|
59
|
+
{
|
|
60
|
+
loanProductId: {
|
|
61
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
62
|
+
ref: MODEL_NAMES.loanProducts,
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
date: {
|
|
66
|
+
type: Date,
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
paymentDate: {
|
|
70
|
+
type: Date,
|
|
71
|
+
required: true,
|
|
72
|
+
},
|
|
73
|
+
source: {
|
|
74
|
+
type: String,
|
|
75
|
+
required: true,
|
|
76
|
+
},
|
|
77
|
+
chargeId: {
|
|
78
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
79
|
+
ref: MODEL_NAMES.loanCharges,
|
|
80
|
+
required: true,
|
|
81
|
+
},
|
|
82
|
+
chargeName: {
|
|
83
|
+
type: String,
|
|
84
|
+
required: true,
|
|
85
|
+
},
|
|
86
|
+
amount: {
|
|
87
|
+
type: Number,
|
|
88
|
+
required: true,
|
|
89
|
+
},
|
|
90
|
+
amountPaid: {
|
|
91
|
+
type: Number,
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
timestamps: { createdAt: true, updatedAt: true },
|
|
97
|
+
versionKey: false,
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
HistoricalLoanChargeSchema.index(
|
|
102
|
+
{ loanProductId: 1, chargeId: 1, date: 1 },
|
|
103
|
+
{ unique: true },
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
export const HistoricalLoanCharge = mongoose.model<IHistoricalLoanCharge, THistoricalLoanChargeModel>(MODEL_NAMES.historicalLoanCharges, HistoricalLoanChargeSchema);
|
package/models/_models.d.ts
CHANGED
package/models/_models.js
CHANGED
|
@@ -79,7 +79,8 @@ exports.MODEL_NAMES = {
|
|
|
79
79
|
financialSpreadingExclusion: 'financial_spreading_exclusions',
|
|
80
80
|
financialSpreadingSheets: 'financial_spreading_sheets',
|
|
81
81
|
globals: 'globals',
|
|
82
|
-
loanSnapshots: '
|
|
82
|
+
loanSnapshots: 'loan_snapshots',
|
|
83
|
+
historicalLoanCharges: 'historical_loan_charges',
|
|
83
84
|
insuranceReportSettings: 'insurance_report_settings',
|
|
84
85
|
inventories: 'inventories',
|
|
85
86
|
inventoryAvailability: 'inventoryAvailabilities',
|
package/models/_models.ts
CHANGED
|
@@ -76,7 +76,8 @@ export const MODEL_NAMES = {
|
|
|
76
76
|
financialSpreadingExclusion: 'financial_spreading_exclusions',
|
|
77
77
|
financialSpreadingSheets: 'financial_spreading_sheets',
|
|
78
78
|
globals: 'globals',
|
|
79
|
-
loanSnapshots: '
|
|
79
|
+
loanSnapshots: 'loan_snapshots',
|
|
80
|
+
historicalLoanCharges: 'historical_loan_charges',
|
|
80
81
|
insuranceReportSettings: 'insurance_report_settings',
|
|
81
82
|
inventories: 'inventories',
|
|
82
83
|
inventoryAvailability: 'inventoryAvailabilities',
|