gemcap-be-common 1.5.44 → 1.5.45
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/db/collaterals.db.d.ts +1 -3
- package/db/collaterals.db.js +1 -1
- package/db/collaterals.db.ts +2 -2
- package/models/BBCSheet.model.js +1 -1
- package/models/BBCSheet.model.ts +2 -2
- package/models/SalesItem.model.d.ts +22 -34
- package/models/SalesItem.model.js +2 -2
- package/models/SalesItem.model.ts +13 -26
- package/models/_index.d.ts +3 -3
- package/package.json +1 -1
- package/services/brokers.service.d.ts +2 -2
- package/services/compliance-borrowers.service.d.ts +1 -1
- package/services/loan-transactions.service.d.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/db/collaterals.db.d.ts
CHANGED
|
@@ -46,9 +46,7 @@ export declare const collateralMap: {
|
|
|
46
46
|
ACCOUNT_PAYABLE: mongoose.Model<import("../models/AccountPayableItem.model").IAccountPayableItemDoc, {}, {}, {}, mongoose.Document<unknown, {}, import("../models/AccountPayableItem.model").IAccountPayableItemDoc> & import("../models/AccountPayableItem.model").IAccountPayableItemDoc & {
|
|
47
47
|
_id: mongoose.Types.ObjectId;
|
|
48
48
|
}, any>;
|
|
49
|
-
SALES:
|
|
50
|
-
_id: mongoose.Types.ObjectId;
|
|
51
|
-
}, any>;
|
|
49
|
+
SALES: import("../models/SalesItem.model").TSalesItemModel;
|
|
52
50
|
};
|
|
53
51
|
export declare const collateralFields: {
|
|
54
52
|
INVENTORY: string[];
|
package/db/collaterals.db.js
CHANGED
|
@@ -22,7 +22,7 @@ exports.collateralMap = {
|
|
|
22
22
|
[collaterals_enum_1.ECollaterals.INVENTORY]: InventoryItem_model_1.InventoryItemModel,
|
|
23
23
|
[collaterals_enum_1.ECollaterals.RECEIVABLE]: ReceivableItem_model_1.ReceivableItemModel,
|
|
24
24
|
[collaterals_enum_1.ECollaterals.ACCOUNT_PAYABLE]: AccountPayableItem_model_1.AccountPayableItemModel,
|
|
25
|
-
[collaterals_enum_1.ECollaterals.SALES]: SalesItem_model_1.
|
|
25
|
+
[collaterals_enum_1.ECollaterals.SALES]: SalesItem_model_1.SalesItem,
|
|
26
26
|
};
|
|
27
27
|
exports.collateralFields = {
|
|
28
28
|
[collaterals_enum_1.ECollaterals.INVENTORY]: InventoryItem_model_1.INVENTORY_FIELDS,
|
package/db/collaterals.db.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { getEnumKeyByEnumValue } from '../helpers/enums.helper';
|
|
|
13
13
|
import { getBBCSheetsByType } from './bbcSheets.db';
|
|
14
14
|
import { getBBCDatesByBorrower } from './bbcDates.db';
|
|
15
15
|
import { getBorrowerGroups } from './groups.db';
|
|
16
|
-
import { SALES_FIELDS,
|
|
16
|
+
import { SALES_FIELDS, SalesItem } from '../models/SalesItem.model';
|
|
17
17
|
|
|
18
18
|
export interface IBbcDateWithSheets {
|
|
19
19
|
_id: mongoose.Types.ObjectId;
|
|
@@ -27,7 +27,7 @@ export const collateralMap = {
|
|
|
27
27
|
[ECollaterals.INVENTORY]: InventoryItemModel,
|
|
28
28
|
[ECollaterals.RECEIVABLE]: ReceivableItemModel,
|
|
29
29
|
[ECollaterals.ACCOUNT_PAYABLE]: AccountPayableItemModel,
|
|
30
|
-
[ECollaterals.SALES]:
|
|
30
|
+
[ECollaterals.SALES]: SalesItem,
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const collateralFields = {
|
package/models/BBCSheet.model.js
CHANGED
|
@@ -47,6 +47,6 @@ exports.BBCSheetSchema.pre('findOneAndDelete', async function () {
|
|
|
47
47
|
await InventoryItem_model_1.InventoryItemModel.deleteMany({ bbcSheetId: bbcSheetId });
|
|
48
48
|
await ReceivableItem_model_1.ReceivableItemModel.deleteMany({ bbcSheetId: bbcSheetId });
|
|
49
49
|
await AccountPayableItem_model_1.AccountPayableItemModel.deleteMany({ bbcSheetId: bbcSheetId });
|
|
50
|
-
await SalesItem_model_1.
|
|
50
|
+
await SalesItem_model_1.SalesItem.deleteMany({ bbcSheetId: bbcSheetId });
|
|
51
51
|
});
|
|
52
52
|
exports.BBCSheetModel = mongoose_1.default.model(_models_1.MODEL_NAMES.BBCSheets, exports.BBCSheetSchema);
|
package/models/BBCSheet.model.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IBBCDate } from './BBCDate.model';
|
|
|
5
5
|
import { InventoryItemModel } from './InventoryItem.model';
|
|
6
6
|
import { AccountPayableItemModel } from './AccountPayableItem.model';
|
|
7
7
|
import { ReceivableItemModel } from './ReceivableItem.model';
|
|
8
|
-
import {
|
|
8
|
+
import { SalesItem } from './SalesItem.model';
|
|
9
9
|
|
|
10
10
|
export interface IBBCSheet {
|
|
11
11
|
bbcDateId: mongoose.Types.ObjectId;
|
|
@@ -65,7 +65,7 @@ BBCSheetSchema.pre('findOneAndDelete', async function () {
|
|
|
65
65
|
await InventoryItemModel.deleteMany({ bbcSheetId: bbcSheetId });
|
|
66
66
|
await ReceivableItemModel.deleteMany({ bbcSheetId: bbcSheetId });
|
|
67
67
|
await AccountPayableItemModel.deleteMany({ bbcSheetId: bbcSheetId });
|
|
68
|
-
await
|
|
68
|
+
await SalesItem.deleteMany({ bbcSheetId: bbcSheetId });
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
export const BBCSheetModel: mongoose.Model<IBBCSheetDoc> = mongoose.model<IBBCSheetDoc>(MODEL_NAMES.BBCSheets, BBCSheetSchema);
|
|
@@ -22,10 +22,8 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
import mongoose, {
|
|
25
|
+
import mongoose, { Model } from 'mongoose';
|
|
26
26
|
import { ICollateralItem } from '../interfaces/collaterals.interface';
|
|
27
|
-
import { IBBCSheetDoc } from './BBCSheet.model';
|
|
28
|
-
import { IBBCDateDoc } from './BBCDate.model';
|
|
29
27
|
export declare const SALES_FIELDS: string[];
|
|
30
28
|
export interface ISalesItem extends ICollateralItem {
|
|
31
29
|
sku: string;
|
|
@@ -33,65 +31,55 @@ export interface ISalesItem extends ICollateralItem {
|
|
|
33
31
|
unitsSold: number;
|
|
34
32
|
unitSalePrice: number;
|
|
35
33
|
}
|
|
36
|
-
export interface
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
bbc: IBBCDateDoc;
|
|
41
|
-
expireDays: number;
|
|
42
|
-
skuDays: number;
|
|
43
|
-
sheetName: string;
|
|
44
|
-
inventoryName: string;
|
|
45
|
-
advanceRate: number;
|
|
46
|
-
availability: number;
|
|
47
|
-
}
|
|
48
|
-
export interface ISalesItemAvailabilityWithGroups extends ISalesItemDocWithCalculation {
|
|
49
|
-
groups: string[];
|
|
50
|
-
}
|
|
51
|
-
interface IMatchedGroup {
|
|
52
|
-
groups: string[];
|
|
53
|
-
items: ISalesItemAvailabilityWithGroups[];
|
|
34
|
+
export interface IBankIncomingPaymentNotificationRuleLean extends ISalesItem {
|
|
35
|
+
_id: mongoose.Types.ObjectId;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
updatedAt: Date;
|
|
54
38
|
}
|
|
55
|
-
export interface
|
|
56
|
-
|
|
39
|
+
export interface IBankIncomingPaymentNotificationRulePlain extends Omit<ISalesItem, 'bbcSheetId'> {
|
|
40
|
+
_id: string;
|
|
41
|
+
bbcSheetId: string;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date;
|
|
57
44
|
}
|
|
45
|
+
export type TSalesItemDoc = mongoose.HydratedDocument<ISalesItem>;
|
|
46
|
+
export type TSalesItemModel = Model<TSalesItemDoc>;
|
|
58
47
|
export declare const SalesItemSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
59
48
|
timestamps: true;
|
|
60
49
|
}, {
|
|
61
50
|
createdAt: NativeDate;
|
|
62
51
|
updatedAt: NativeDate;
|
|
63
52
|
} & {
|
|
64
|
-
order: number;
|
|
65
|
-
bbcSheetId: mongoose.Types.ObjectId;
|
|
66
53
|
sku: string;
|
|
67
54
|
unitsSold: number;
|
|
68
55
|
unitSalePrice: number;
|
|
69
|
-
|
|
56
|
+
bbcSheetId: mongoose.Types.ObjectId;
|
|
57
|
+
order: number;
|
|
70
58
|
skuName?: string;
|
|
59
|
+
__v?: number;
|
|
71
60
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
72
61
|
createdAt: NativeDate;
|
|
73
62
|
updatedAt: NativeDate;
|
|
74
63
|
} & {
|
|
75
|
-
order: number;
|
|
76
|
-
bbcSheetId: mongoose.Types.ObjectId;
|
|
77
64
|
sku: string;
|
|
78
65
|
unitsSold: number;
|
|
79
66
|
unitSalePrice: number;
|
|
80
|
-
|
|
67
|
+
bbcSheetId: mongoose.Types.ObjectId;
|
|
68
|
+
order: number;
|
|
81
69
|
skuName?: string;
|
|
70
|
+
__v?: number;
|
|
82
71
|
}>> & mongoose.FlatRecord<{
|
|
83
72
|
createdAt: NativeDate;
|
|
84
73
|
updatedAt: NativeDate;
|
|
85
74
|
} & {
|
|
86
|
-
order: number;
|
|
87
|
-
bbcSheetId: mongoose.Types.ObjectId;
|
|
88
75
|
sku: string;
|
|
89
76
|
unitsSold: number;
|
|
90
77
|
unitSalePrice: number;
|
|
91
|
-
|
|
78
|
+
bbcSheetId: mongoose.Types.ObjectId;
|
|
79
|
+
order: number;
|
|
92
80
|
skuName?: string;
|
|
81
|
+
__v?: number;
|
|
93
82
|
}> & {
|
|
94
83
|
_id: mongoose.Types.ObjectId;
|
|
95
84
|
}>;
|
|
96
|
-
export declare const
|
|
97
|
-
export {};
|
|
85
|
+
export declare const SalesItem: TSalesItemModel;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.SalesItem = exports.SalesItemSchema = exports.SALES_FIELDS = void 0;
|
|
7
7
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
8
|
const _models_1 = require("./_models");
|
|
9
9
|
exports.SALES_FIELDS = [
|
|
@@ -42,4 +42,4 @@ exports.SalesItemSchema = new mongoose_1.default.Schema({
|
|
|
42
42
|
},
|
|
43
43
|
__v: { type: Number, select: false },
|
|
44
44
|
}, { timestamps: true });
|
|
45
|
-
exports.
|
|
45
|
+
exports.SalesItem = mongoose_1.default.model(_models_1.MODEL_NAMES.salesItem, exports.SalesItemSchema);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import mongoose, { Document } from 'mongoose';
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
2
|
|
|
3
3
|
import { MODEL_NAMES } from './_models';
|
|
4
4
|
import { ICollateralItem } from '../interfaces/collaterals.interface';
|
|
5
|
-
import { IBBCSheetDoc } from './BBCSheet.model';
|
|
6
|
-
import { IBBCDateDoc } from './BBCDate.model';
|
|
7
5
|
|
|
8
6
|
export const SALES_FIELDS = [
|
|
9
7
|
'_id',
|
|
@@ -13,7 +11,6 @@ export const SALES_FIELDS = [
|
|
|
13
11
|
'unitSalePrice',
|
|
14
12
|
];
|
|
15
13
|
|
|
16
|
-
|
|
17
14
|
export interface ISalesItem extends ICollateralItem {
|
|
18
15
|
sku: string;
|
|
19
16
|
skuName?: string;
|
|
@@ -21,32 +18,22 @@ export interface ISalesItem extends ICollateralItem {
|
|
|
21
18
|
unitSalePrice: number;
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
export interface
|
|
21
|
+
export interface IBankIncomingPaymentNotificationRuleLean extends ISalesItem {
|
|
22
|
+
_id: mongoose.Types.ObjectId;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export interface
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
sheetName: string;
|
|
33
|
-
inventoryName: string;
|
|
34
|
-
advanceRate: number;
|
|
35
|
-
availability: number;
|
|
27
|
+
export interface IBankIncomingPaymentNotificationRulePlain extends Omit<ISalesItem, 'bbcSheetId'> {
|
|
28
|
+
_id: string;
|
|
29
|
+
bbcSheetId: string;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
updatedAt: Date;
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
export
|
|
39
|
-
groups: string[];
|
|
40
|
-
}
|
|
34
|
+
export type TSalesItemDoc = mongoose.HydratedDocument<ISalesItem>
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
groups: string[];
|
|
44
|
-
items: ISalesItemAvailabilityWithGroups[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface IMatchedGroups {
|
|
48
|
-
[groupName: string]: IMatchedGroup;
|
|
49
|
-
}
|
|
36
|
+
export type TSalesItemModel = Model<TSalesItemDoc>;
|
|
50
37
|
|
|
51
38
|
export const SalesItemSchema = new mongoose.Schema(
|
|
52
39
|
{
|
|
@@ -81,4 +68,4 @@ export const SalesItemSchema = new mongoose.Schema(
|
|
|
81
68
|
{ timestamps: true }
|
|
82
69
|
);
|
|
83
70
|
|
|
84
|
-
export const
|
|
71
|
+
export const SalesItem = mongoose.model<ICollateralItem, TSalesItemModel>(MODEL_NAMES.salesItem, SalesItemSchema);
|
package/models/_index.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export declare const allSchemas: {
|
|
|
31
31
|
createdAt: NativeDate;
|
|
32
32
|
updatedAt: NativeDate;
|
|
33
33
|
} & {
|
|
34
|
-
order: number;
|
|
35
34
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
35
|
+
order: number;
|
|
36
36
|
apDate: Date;
|
|
37
37
|
amount: number;
|
|
38
38
|
__v?: number;
|
|
@@ -45,8 +45,8 @@ export declare const allSchemas: {
|
|
|
45
45
|
createdAt: NativeDate;
|
|
46
46
|
updatedAt: NativeDate;
|
|
47
47
|
} & {
|
|
48
|
-
order: number;
|
|
49
48
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
49
|
+
order: number;
|
|
50
50
|
apDate: Date;
|
|
51
51
|
amount: number;
|
|
52
52
|
__v?: number;
|
|
@@ -59,8 +59,8 @@ export declare const allSchemas: {
|
|
|
59
59
|
createdAt: NativeDate;
|
|
60
60
|
updatedAt: NativeDate;
|
|
61
61
|
} & {
|
|
62
|
-
order: number;
|
|
63
62
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
63
|
+
order: number;
|
|
64
64
|
apDate: Date;
|
|
65
65
|
amount: number;
|
|
66
66
|
__v?: number;
|
package/package.json
CHANGED
|
@@ -46,9 +46,9 @@ export declare class BrokersService {
|
|
|
46
46
|
getAllProductBrokers(): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & Required<{
|
|
47
47
|
_id: import("mongoose").Types.ObjectId;
|
|
48
48
|
}>)[]>;
|
|
49
|
-
getBorrowerBrokers(borrowerId: string): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & Required<{
|
|
49
|
+
getBorrowerBrokers(borrowerId: string): Promise<BrokerView[] | (import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & Required<{
|
|
50
50
|
_id: import("mongoose").Types.ObjectId;
|
|
51
|
-
}>)[]
|
|
51
|
+
}>)[]>;
|
|
52
52
|
getProductBrokers(productId: string): Promise<import("../models/ProductBroker.model").IProductBrokerDocWithBroker[]>;
|
|
53
53
|
getTotalShares(borrowerId: string, brokers: IProductBrokerView[], replaceNames?: boolean): Promise<ProductTotal>;
|
|
54
54
|
getTotals(borrowerId: string): Promise<BrokerTotalView[]>;
|
|
@@ -45,7 +45,7 @@ export declare class ComplianceBorrowersService {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
getFullComplianceBorrowerById(complianceBorrowerId: string): Promise<any>;
|
|
48
|
-
getAllBorrowersShortened(userAccess: IUserAccess): Promise<(Pick<IComplianceBorrowerWithBorrower, "
|
|
48
|
+
getAllBorrowersShortened(userAccess: IUserAccess): Promise<(Pick<IComplianceBorrowerWithBorrower, "items" | "borrower" | "fundingStatus"> | {
|
|
49
49
|
items: {
|
|
50
50
|
instances: any[];
|
|
51
51
|
item: import("../models/ComplianceItem.model").IComplianceItemDocument;
|
|
@@ -155,7 +155,7 @@ export declare class LoanTransactionsService {
|
|
|
155
155
|
getTransactionReport(transactionIds: string[], borrowerId: string, effectiveDate: Date): Promise<{
|
|
156
156
|
transactionIdsToMark: string[];
|
|
157
157
|
transactions: {
|
|
158
|
-
[x: string]: (string | number |
|
|
158
|
+
[x: string]: (string | number | string[] | Date)[];
|
|
159
159
|
}[];
|
|
160
160
|
}>;
|
|
161
161
|
getBorrowerIdsForFile(transactionFileId: string): Promise<{
|