gemcap-be-common 1.5.47 → 1.5.49
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/classes/sales-item.d.ts +3 -1
- package/classes/sales-item.js +1 -0
- package/classes/sales-item.ts +3 -1
- package/db/collaterals.db.d.ts +1 -1
- package/helpers/column-desciptions.helper.js +10 -3
- package/helpers/column-desciptions.helper.ts +10 -3
- package/models/BBCDate.model.js +5 -0
- package/models/BBCDate.model.ts +6 -0
- package/models/SalesItem.model.d.ts +17 -13
- package/models/SalesItem.model.js +7 -1
- package/models/SalesItem.model.ts +9 -2
- package/models/_index.d.ts +9 -9
- 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/classes/sales-item.d.ts
CHANGED
|
@@ -3,13 +3,15 @@ interface ISalesLocal {
|
|
|
3
3
|
sku: string;
|
|
4
4
|
skuName: string;
|
|
5
5
|
unitsSold: number;
|
|
6
|
-
|
|
6
|
+
unitsCost?: number;
|
|
7
|
+
unitSalePrice?: number;
|
|
7
8
|
}
|
|
8
9
|
export declare class SalesItem implements ISalesLocal {
|
|
9
10
|
bbcDate: Date;
|
|
10
11
|
sku: string;
|
|
11
12
|
skuName: string;
|
|
12
13
|
unitsSold: number;
|
|
14
|
+
unitsCost: number;
|
|
13
15
|
unitSalePrice: number;
|
|
14
16
|
constructor(item: Partial<SalesItem>, bbcDate?: any);
|
|
15
17
|
}
|
package/classes/sales-item.js
CHANGED
|
@@ -12,6 +12,7 @@ class SalesItem {
|
|
|
12
12
|
sku = '';
|
|
13
13
|
skuName = '';
|
|
14
14
|
unitsSold = 0;
|
|
15
|
+
unitsCost = 0;
|
|
15
16
|
unitSalePrice = 0;
|
|
16
17
|
constructor(item, bbcDate = null) {
|
|
17
18
|
const itemWithDates = (0, column_desciptions_helper_1.convertIntoDates)(item, collaterals_enum_1.ECollaterals.SALES);
|
package/classes/sales-item.ts
CHANGED
|
@@ -8,7 +8,8 @@ interface ISalesLocal {
|
|
|
8
8
|
sku: string;
|
|
9
9
|
skuName: string;
|
|
10
10
|
unitsSold: number;
|
|
11
|
-
|
|
11
|
+
unitsCost?: number;
|
|
12
|
+
unitSalePrice?: number;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export class SalesItem implements ISalesLocal {
|
|
@@ -17,6 +18,7 @@ export class SalesItem implements ISalesLocal {
|
|
|
17
18
|
sku: string = '';
|
|
18
19
|
skuName: string = '';
|
|
19
20
|
unitsSold: number = 0;
|
|
21
|
+
unitsCost: number = 0;
|
|
20
22
|
unitSalePrice: number = 0;
|
|
21
23
|
|
|
22
24
|
constructor(item: Partial<SalesItem>, bbcDate = null) {
|
package/db/collaterals.db.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare const createQuery: (groupFields: {
|
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
itemQueries: any;
|
|
80
|
-
enumKey: "INVENTORY" | "RECEIVABLE" | "ACCOUNT_PAYABLE" | "SALES" | "
|
|
80
|
+
enumKey: "INVENTORY" | "RECEIVABLE" | "ACCOUNT_PAYABLE" | "SALES" | "LOAN_TRANSACTIONS" | "UPLOADED_BANK_TRANSACTIONS" | "QUICKBOOKS" | "OTHER" | "CASH";
|
|
81
81
|
};
|
|
82
82
|
export declare const ITEMS_PAGINATION: (paginatorOptions: IPaginatorOptions) => ({
|
|
83
83
|
$skip: number;
|
|
@@ -236,17 +236,24 @@ exports.COLLATERALS = {
|
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
db_title: 'unitsSold',
|
|
239
|
-
title: 'Units
|
|
239
|
+
title: 'Units sold',
|
|
240
240
|
required: true,
|
|
241
241
|
items: [],
|
|
242
242
|
validators: [validators_enums_1.EValidators.NOT_EMPTY, validators_enums_1.EValidators.IS_NUMBER, validators_enums_1.EValidators.NUMBER_GT_NULL],
|
|
243
243
|
},
|
|
244
|
+
{
|
|
245
|
+
db_title: 'unitsCost',
|
|
246
|
+
title: 'Units cost',
|
|
247
|
+
required: true,
|
|
248
|
+
items: [],
|
|
249
|
+
validators: [validators_enums_1.EValidators.IS_NUMBER],
|
|
250
|
+
},
|
|
244
251
|
{
|
|
245
252
|
db_title: 'unitSalePrice',
|
|
246
|
-
title: 'Unit
|
|
253
|
+
title: 'Unit sale price',
|
|
247
254
|
required: true,
|
|
248
255
|
items: [],
|
|
249
|
-
validators: [validators_enums_1.EValidators.
|
|
256
|
+
validators: [validators_enums_1.EValidators.IS_NUMBER],
|
|
250
257
|
},
|
|
251
258
|
],
|
|
252
259
|
[collaterals_enum_1.ECollaterals.LOAN_TRANSACTIONS]: [
|
|
@@ -236,17 +236,24 @@ COLLATERALS = {
|
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
db_title: 'unitsSold',
|
|
239
|
-
title: 'Units
|
|
239
|
+
title: 'Units sold',
|
|
240
240
|
required: true,
|
|
241
241
|
items: [],
|
|
242
242
|
validators: [EValidators.NOT_EMPTY, EValidators.IS_NUMBER, EValidators.NUMBER_GT_NULL],
|
|
243
243
|
},
|
|
244
|
+
{
|
|
245
|
+
db_title: 'unitsCost',
|
|
246
|
+
title: 'Units cost',
|
|
247
|
+
required: true,
|
|
248
|
+
items: [],
|
|
249
|
+
validators: [EValidators.IS_NUMBER],
|
|
250
|
+
},
|
|
244
251
|
{
|
|
245
252
|
db_title: 'unitSalePrice',
|
|
246
|
-
title: 'Unit
|
|
253
|
+
title: 'Unit sale price',
|
|
247
254
|
required: true,
|
|
248
255
|
items: [],
|
|
249
|
-
validators: [EValidators.
|
|
256
|
+
validators: [EValidators.IS_NUMBER],
|
|
250
257
|
},
|
|
251
258
|
],
|
|
252
259
|
[ECollaterals.LOAN_TRANSACTIONS]: [
|
package/models/BBCDate.model.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.BBCDateModel = exports.BBCDateSchema = exports.ICreateBBCDateSchema = vo
|
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
8
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
9
9
|
const _models_1 = require("./_models");
|
|
10
|
+
const BBCSheet_model_1 = require("./BBCSheet.model");
|
|
10
11
|
const mongooseLeanId = require('../plugins/id.plugin');
|
|
11
12
|
exports.ICreateBBCDateSchema = joi_1.default.object({
|
|
12
13
|
date: joi_1.default.date().required(),
|
|
@@ -27,4 +28,8 @@ exports.BBCDateSchema = new mongoose_1.default.Schema({
|
|
|
27
28
|
__v: { type: Number, select: false },
|
|
28
29
|
}, { timestamps: true });
|
|
29
30
|
exports.BBCDateSchema.plugin(mongooseLeanId);
|
|
31
|
+
BBCSheet_model_1.BBCSheetSchema.index({
|
|
32
|
+
borrowerId: 1,
|
|
33
|
+
bbcDate: 1,
|
|
34
|
+
});
|
|
30
35
|
exports.BBCDateModel = mongoose_1.default.model(_models_1.MODEL_NAMES.BBCDates, exports.BBCDateSchema);
|
package/models/BBCDate.model.ts
CHANGED
|
@@ -3,6 +3,7 @@ import mongoose, { Document } from 'mongoose';
|
|
|
3
3
|
|
|
4
4
|
import { MODEL_NAMES } from './_models';
|
|
5
5
|
import { ILoanStatementStatus } from './LoanStatementStatus.model';
|
|
6
|
+
import { BBCSheetSchema } from './BBCSheet.model';
|
|
6
7
|
|
|
7
8
|
const mongooseLeanId = require('../plugins/id.plugin');
|
|
8
9
|
|
|
@@ -67,4 +68,9 @@ export const BBCDateSchema = new mongoose.Schema(
|
|
|
67
68
|
|
|
68
69
|
BBCDateSchema.plugin(mongooseLeanId);
|
|
69
70
|
|
|
71
|
+
BBCSheetSchema.index({
|
|
72
|
+
borrowerId: 1,
|
|
73
|
+
bbcDate: 1,
|
|
74
|
+
});
|
|
75
|
+
|
|
70
76
|
export const BBCDateModel: mongoose.Model<IBBCDateDoc> = mongoose.model<IBBCDateDoc>(MODEL_NAMES.BBCDates, BBCDateSchema);
|
|
@@ -29,7 +29,8 @@ export interface ISalesItem extends ICollateralItem {
|
|
|
29
29
|
sku: string;
|
|
30
30
|
skuName?: string;
|
|
31
31
|
unitsSold: number;
|
|
32
|
-
|
|
32
|
+
unitsCost?: number;
|
|
33
|
+
unitSalePrice?: number;
|
|
33
34
|
}
|
|
34
35
|
export interface ISalesItemLean extends ISalesItem {
|
|
35
36
|
_id: mongoose.Types.ObjectId;
|
|
@@ -50,35 +51,38 @@ export declare const SalesItemSchema: mongoose.Schema<any, mongoose.Model<any, a
|
|
|
50
51
|
createdAt: NativeDate;
|
|
51
52
|
updatedAt: NativeDate;
|
|
52
53
|
} & {
|
|
53
|
-
bbcSheetId: mongoose.Types.ObjectId;
|
|
54
|
-
order: number;
|
|
55
54
|
sku: string;
|
|
56
55
|
unitsSold: number;
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
bbcSheetId: mongoose.Types.ObjectId;
|
|
57
|
+
order: number;
|
|
59
58
|
skuName?: string;
|
|
59
|
+
unitsCost?: number;
|
|
60
|
+
unitSalePrice?: number;
|
|
61
|
+
__v?: number;
|
|
60
62
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
61
63
|
createdAt: NativeDate;
|
|
62
64
|
updatedAt: NativeDate;
|
|
63
65
|
} & {
|
|
64
|
-
bbcSheetId: mongoose.Types.ObjectId;
|
|
65
|
-
order: number;
|
|
66
66
|
sku: string;
|
|
67
67
|
unitsSold: number;
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
bbcSheetId: mongoose.Types.ObjectId;
|
|
69
|
+
order: number;
|
|
70
70
|
skuName?: string;
|
|
71
|
+
unitsCost?: number;
|
|
72
|
+
unitSalePrice?: number;
|
|
73
|
+
__v?: number;
|
|
71
74
|
}>> & mongoose.FlatRecord<{
|
|
72
75
|
createdAt: NativeDate;
|
|
73
76
|
updatedAt: NativeDate;
|
|
74
77
|
} & {
|
|
75
|
-
bbcSheetId: mongoose.Types.ObjectId;
|
|
76
|
-
order: number;
|
|
77
78
|
sku: string;
|
|
78
79
|
unitsSold: number;
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
bbcSheetId: mongoose.Types.ObjectId;
|
|
81
|
+
order: number;
|
|
81
82
|
skuName?: string;
|
|
83
|
+
unitsCost?: number;
|
|
84
|
+
unitSalePrice?: number;
|
|
85
|
+
__v?: number;
|
|
82
86
|
}> & {
|
|
83
87
|
_id: mongoose.Types.ObjectId;
|
|
84
88
|
}>;
|
|
@@ -11,6 +11,7 @@ exports.SALES_FIELDS = [
|
|
|
11
11
|
'sku',
|
|
12
12
|
'skuName',
|
|
13
13
|
'unitsSold',
|
|
14
|
+
'unitsCost',
|
|
14
15
|
'unitSalePrice',
|
|
15
16
|
];
|
|
16
17
|
exports.SalesItemSchema = new mongoose_1.default.Schema({
|
|
@@ -31,14 +32,19 @@ exports.SalesItemSchema = new mongoose_1.default.Schema({
|
|
|
31
32
|
skuName: {
|
|
32
33
|
type: String,
|
|
33
34
|
trim: true,
|
|
35
|
+
required: false,
|
|
34
36
|
},
|
|
35
37
|
unitsSold: {
|
|
36
38
|
type: Number,
|
|
37
39
|
required: true,
|
|
38
40
|
},
|
|
41
|
+
unitsCost: {
|
|
42
|
+
type: Number,
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
39
45
|
unitSalePrice: {
|
|
40
46
|
type: Number,
|
|
41
|
-
required:
|
|
47
|
+
required: false,
|
|
42
48
|
},
|
|
43
49
|
__v: { type: Number, select: false },
|
|
44
50
|
}, { timestamps: true });
|
|
@@ -8,6 +8,7 @@ export const SALES_FIELDS = [
|
|
|
8
8
|
'sku',
|
|
9
9
|
'skuName',
|
|
10
10
|
'unitsSold',
|
|
11
|
+
'unitsCost',
|
|
11
12
|
'unitSalePrice',
|
|
12
13
|
];
|
|
13
14
|
|
|
@@ -15,7 +16,8 @@ export interface ISalesItem extends ICollateralItem {
|
|
|
15
16
|
sku: string;
|
|
16
17
|
skuName?: string;
|
|
17
18
|
unitsSold: number;
|
|
18
|
-
|
|
19
|
+
unitsCost?: number;
|
|
20
|
+
unitSalePrice?: number;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export interface ISalesItemLean extends ISalesItem {
|
|
@@ -54,14 +56,19 @@ export const SalesItemSchema = new mongoose.Schema(
|
|
|
54
56
|
skuName: {
|
|
55
57
|
type: String,
|
|
56
58
|
trim: true,
|
|
59
|
+
required: false,
|
|
57
60
|
},
|
|
58
61
|
unitsSold: {
|
|
59
62
|
type: Number,
|
|
60
63
|
required: true,
|
|
61
64
|
},
|
|
65
|
+
unitsCost: {
|
|
66
|
+
type: Number,
|
|
67
|
+
required: false,
|
|
68
|
+
},
|
|
62
69
|
unitSalePrice: {
|
|
63
70
|
type: Number,
|
|
64
|
-
required:
|
|
71
|
+
required: false,
|
|
65
72
|
},
|
|
66
73
|
__v: { type: Number, select: false },
|
|
67
74
|
},
|
package/models/_index.d.ts
CHANGED
|
@@ -31,44 +31,44 @@ export declare const allSchemas: {
|
|
|
31
31
|
createdAt: NativeDate;
|
|
32
32
|
updatedAt: NativeDate;
|
|
33
33
|
} & {
|
|
34
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
35
|
-
order: number;
|
|
36
34
|
apDate: Date;
|
|
37
35
|
amount: number;
|
|
38
|
-
|
|
36
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
37
|
+
order: number;
|
|
39
38
|
poNumber?: string;
|
|
40
39
|
customerName?: string;
|
|
41
40
|
otherInformation1?: string;
|
|
42
41
|
otherInformation2?: string;
|
|
43
42
|
otherInformation3?: string;
|
|
43
|
+
__v?: number;
|
|
44
44
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
45
45
|
createdAt: NativeDate;
|
|
46
46
|
updatedAt: NativeDate;
|
|
47
47
|
} & {
|
|
48
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
49
|
-
order: number;
|
|
50
48
|
apDate: Date;
|
|
51
49
|
amount: number;
|
|
52
|
-
|
|
50
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
51
|
+
order: number;
|
|
53
52
|
poNumber?: string;
|
|
54
53
|
customerName?: string;
|
|
55
54
|
otherInformation1?: string;
|
|
56
55
|
otherInformation2?: string;
|
|
57
56
|
otherInformation3?: string;
|
|
57
|
+
__v?: number;
|
|
58
58
|
}>> & import("mongoose").FlatRecord<{
|
|
59
59
|
createdAt: NativeDate;
|
|
60
60
|
updatedAt: NativeDate;
|
|
61
61
|
} & {
|
|
62
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
63
|
-
order: number;
|
|
64
62
|
apDate: Date;
|
|
65
63
|
amount: number;
|
|
66
|
-
|
|
64
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
65
|
+
order: number;
|
|
67
66
|
poNumber?: string;
|
|
68
67
|
customerName?: string;
|
|
69
68
|
otherInformation1?: string;
|
|
70
69
|
otherInformation2?: string;
|
|
71
70
|
otherInformation3?: string;
|
|
71
|
+
__v?: number;
|
|
72
72
|
}> & {
|
|
73
73
|
_id: import("mongoose").Types.ObjectId;
|
|
74
74
|
}>;
|
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<{
|