gemcap-be-common 1.5.47 → 1.5.48

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.
@@ -3,13 +3,15 @@ interface ISalesLocal {
3
3
  sku: string;
4
4
  skuName: string;
5
5
  unitsSold: number;
6
- unitSalePrice: number;
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
  }
@@ -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);
@@ -8,7 +8,8 @@ interface ISalesLocal {
8
8
  sku: string;
9
9
  skuName: string;
10
10
  unitsSold: number;
11
- unitSalePrice: number;
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) {
@@ -77,7 +77,7 @@ export declare const createQuery: (groupFields: {
77
77
  };
78
78
  };
79
79
  itemQueries: any;
80
- enumKey: "INVENTORY" | "RECEIVABLE" | "ACCOUNT_PAYABLE" | "SALES" | "OTHER" | "CASH" | "LOAN_TRANSACTIONS" | "QUICKBOOKS" | "UPLOADED_BANK_TRANSACTIONS";
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 Sold',
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 Sale Price',
253
+ title: 'Unit sale price',
247
254
  required: true,
248
255
  items: [],
249
- validators: [validators_enums_1.EValidators.NOT_EMPTY, validators_enums_1.EValidators.IS_NUMBER, validators_enums_1.EValidators.NUMBER_GT_NULL],
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 Sold',
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 Sale Price',
253
+ title: 'Unit sale price',
247
254
  required: true,
248
255
  items: [],
249
- validators: [EValidators.NOT_EMPTY, EValidators.IS_NUMBER, EValidators.NUMBER_GT_NULL],
256
+ validators: [EValidators.IS_NUMBER],
250
257
  },
251
258
  ],
252
259
  [ECollaterals.LOAN_TRANSACTIONS]: [
@@ -29,7 +29,8 @@ export interface ISalesItem extends ICollateralItem {
29
29
  sku: string;
30
30
  skuName?: string;
31
31
  unitsSold: number;
32
- unitSalePrice: number;
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
- unitSalePrice: number;
58
- __v?: number;
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
- unitSalePrice: number;
69
- __v?: number;
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
- unitSalePrice: number;
80
- __v?: number;
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: true,
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
- unitSalePrice: number;
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: true,
71
+ required: false,
65
72
  },
66
73
  __v: { type: Number, select: false },
67
74
  },
@@ -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
- __v?: number;
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
- __v?: number;
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
- __v?: number;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.47",
3
+ "version": "1.5.48",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
- }>)[] | BrokerView[]>;
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, "borrower" | "fundingStatus" | "items"> | {
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 | Date | string[])[];
158
+ [x: string]: (string | number | string[] | Date)[];
159
159
  }[];
160
160
  }>;
161
161
  getBorrowerIdsForFile(transactionFileId: string): Promise<{