gemcap-be-common 1.5.42 → 1.5.44

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.
@@ -221,25 +221,33 @@ exports.COLLATERALS = {
221
221
  validators: [validators_enums_1.EValidators.NOT_EMPTY, validators_enums_1.EValidators.IS_DATE],
222
222
  },
223
223
  {
224
- db_title: 'apDate',
225
- title: 'AP date',
226
- required: false,
224
+ db_title: 'sku',
225
+ title: 'SKU',
226
+ required: true,
227
227
  items: [],
228
- validators: [validators_enums_1.EValidators.NOT_EMPTY, validators_enums_1.EValidators.IS_DATE],
229
- isDate: true,
228
+ validators: [validators_enums_1.EValidators.NOT_EMPTY],
230
229
  },
231
- { db_title: 'poNumber', title: 'PO number', required: false, items: [] },
232
- { db_title: 'customerName', title: 'Customer name', required: false, items: [] },
233
230
  {
234
- db_title: 'amount',
235
- title: 'Amount',
231
+ db_title: 'skuName',
232
+ title: 'SKU Name',
233
+ required: true,
234
+ items: [],
235
+ validators: [validators_enums_1.EValidators.NOT_EMPTY],
236
+ },
237
+ {
238
+ db_title: 'unitsSold',
239
+ title: 'Units Sold',
240
+ required: true,
241
+ items: [],
242
+ validators: [validators_enums_1.EValidators.NOT_EMPTY, validators_enums_1.EValidators.IS_NUMBER, validators_enums_1.EValidators.NUMBER_GT_NULL],
243
+ },
244
+ {
245
+ db_title: 'unitSalePrice',
246
+ title: 'Unit Sale Price',
236
247
  required: true,
237
248
  items: [],
238
249
  validators: [validators_enums_1.EValidators.NOT_EMPTY, validators_enums_1.EValidators.IS_NUMBER, validators_enums_1.EValidators.NUMBER_GT_NULL],
239
250
  },
240
- { db_title: 'otherInformation1', title: 'Other Information 1', required: false, items: [] },
241
- { db_title: 'otherInformation2', title: 'Other Information 2', required: false, items: [] },
242
- { db_title: 'otherInformation3', title: 'Other Information 3', required: false, items: [] },
243
251
  ],
244
252
  [collaterals_enum_1.ECollaterals.LOAN_TRANSACTIONS]: [
245
253
  {
@@ -221,25 +221,33 @@ COLLATERALS = {
221
221
  validators: [EValidators.NOT_EMPTY, EValidators.IS_DATE],
222
222
  },
223
223
  {
224
- db_title: 'apDate',
225
- title: 'AP date',
226
- required: false,
224
+ db_title: 'sku',
225
+ title: 'SKU',
226
+ required: true,
227
227
  items: [],
228
- validators: [EValidators.NOT_EMPTY, EValidators.IS_DATE],
229
- isDate: true,
228
+ validators: [EValidators.NOT_EMPTY],
230
229
  },
231
- { db_title: 'poNumber', title: 'PO number', required: false, items: [] },
232
- { db_title: 'customerName', title: 'Customer name', required: false, items: [] },
233
230
  {
234
- db_title: 'amount',
235
- title: 'Amount',
231
+ db_title: 'skuName',
232
+ title: 'SKU Name',
233
+ required: true,
234
+ items: [],
235
+ validators: [EValidators.NOT_EMPTY],
236
+ },
237
+ {
238
+ db_title: 'unitsSold',
239
+ title: 'Units Sold',
240
+ required: true,
241
+ items: [],
242
+ validators: [EValidators.NOT_EMPTY, EValidators.IS_NUMBER, EValidators.NUMBER_GT_NULL],
243
+ },
244
+ {
245
+ db_title: 'unitSalePrice',
246
+ title: 'Unit Sale Price',
236
247
  required: true,
237
248
  items: [],
238
249
  validators: [EValidators.NOT_EMPTY, EValidators.IS_NUMBER, EValidators.NUMBER_GT_NULL],
239
250
  },
240
- { db_title: 'otherInformation1', title: 'Other Information 1', required: false, items: [] },
241
- { db_title: 'otherInformation2', title: 'Other Information 2', required: false, items: [] },
242
- { db_title: 'otherInformation3', title: 'Other Information 3', required: false, items: [] },
243
251
  ],
244
252
  [ECollaterals.LOAN_TRANSACTIONS]: [
245
253
  {
@@ -36,7 +36,8 @@ export declare enum EQueriesGroups {
36
36
  INVENTORY = "INVENTORY",
37
37
  RECEIVABLE = "RECEIVABLE",
38
38
  OTHER = "OTHER",
39
- CASH = "CASH"
39
+ CASH = "CASH",
40
+ SALES = "SALES"
40
41
  }
41
42
  export declare enum EChartsInventory {
42
43
  BENFORD = "BENFORD",
@@ -71,6 +72,9 @@ export declare enum EChartsCash {
71
72
  TRANSACTIONS = "TRANSACTIONS",
72
73
  DELUTION = "DELUTION"
73
74
  }
75
+ export declare enum EChartsSales {
76
+ FOR_PERIOD = "FOR_PERIOD"
77
+ }
74
78
  export declare enum EFilterParams {
75
79
  NONE = "NONE",
76
80
  BBC = "BBC",
@@ -97,6 +101,9 @@ type TQueryGroups = {
97
101
  [EQueriesGroups.CASH]: {
98
102
  [key in EChartsCash]: IQueryDetail;
99
103
  };
104
+ [EQueriesGroups.SALES]: {
105
+ [key in EChartsSales]: IQueryDetail;
106
+ };
100
107
  };
101
108
  export declare const QUERY_GROUPS: TQueryGroups;
102
109
  export interface IQueryResult {
@@ -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.QueryResult = exports.QueryResultSchema = exports.QUERY_GROUPS = exports.EFilterParams = exports.EChartsCash = exports.EChartsMisc = exports.EChartsReceivable = exports.EChartsInventory = exports.EQueriesGroups = void 0;
6
+ exports.QueryResult = exports.QueryResultSchema = exports.QUERY_GROUPS = exports.EFilterParams = exports.EChartsSales = exports.EChartsCash = exports.EChartsMisc = exports.EChartsReceivable = exports.EChartsInventory = exports.EQueriesGroups = void 0;
7
7
  const mongoose_1 = __importDefault(require("mongoose"));
8
8
  const _models_1 = require("./_models");
9
9
  const unit_cost_difference_1 = require("../queries/inventory/unit-cost-difference");
@@ -24,6 +24,7 @@ var EQueriesGroups;
24
24
  EQueriesGroups["RECEIVABLE"] = "RECEIVABLE";
25
25
  EQueriesGroups["OTHER"] = "OTHER";
26
26
  EQueriesGroups["CASH"] = "CASH";
27
+ EQueriesGroups["SALES"] = "SALES";
27
28
  })(EQueriesGroups || (exports.EQueriesGroups = EQueriesGroups = {}));
28
29
  var EChartsInventory;
29
30
  (function (EChartsInventory) {
@@ -62,6 +63,10 @@ var EChartsCash;
62
63
  EChartsCash["TRANSACTIONS"] = "TRANSACTIONS";
63
64
  EChartsCash["DELUTION"] = "DELUTION";
64
65
  })(EChartsCash || (exports.EChartsCash = EChartsCash = {}));
66
+ var EChartsSales;
67
+ (function (EChartsSales) {
68
+ EChartsSales["FOR_PERIOD"] = "FOR_PERIOD";
69
+ })(EChartsSales || (exports.EChartsSales = EChartsSales = {}));
65
70
  var EFilterParams;
66
71
  (function (EFilterParams) {
67
72
  EFilterParams["NONE"] = "NONE";
@@ -179,6 +184,9 @@ exports.QUERY_GROUPS = {
179
184
  [EChartsCash.TRANSACTIONS]: { scheduled: false, queryAPI: 'transactions', queryFunction: null },
180
185
  [EChartsCash.DELUTION]: { scheduled: false, queryAPI: 'delution', queryFunction: null },
181
186
  },
187
+ [EQueriesGroups.SALES]: {
188
+ [EChartsSales.FOR_PERIOD]: { scheduled: false, queryAPI: 'sales-for-period', queryFunction: null },
189
+ }
182
190
  };
183
191
  exports.QueryResultSchema = new mongoose_1.default.Schema({
184
192
  query: {
@@ -27,6 +27,7 @@ export enum EQueriesGroups {
27
27
  RECEIVABLE = 'RECEIVABLE',
28
28
  OTHER = 'OTHER',
29
29
  CASH = 'CASH',
30
+ SALES = 'SALES',
30
31
  }
31
32
 
32
33
  export enum EChartsInventory {
@@ -66,6 +67,11 @@ export enum EChartsCash {
66
67
  DELUTION = 'DELUTION',
67
68
  }
68
69
 
70
+ export enum EChartsSales {
71
+ FOR_PERIOD = 'FOR_PERIOD',
72
+ }
73
+
74
+
69
75
  export enum EFilterParams {
70
76
  NONE = 'NONE',
71
77
  BBC = 'BBC',
@@ -94,6 +100,9 @@ type TQueryGroups = {
94
100
  [EQueriesGroups.CASH]: {
95
101
  [key in EChartsCash]: IQueryDetail;
96
102
  };
103
+ [EQueriesGroups.SALES]: {
104
+ [key in EChartsSales]: IQueryDetail;
105
+ };
97
106
  };
98
107
 
99
108
  export const QUERY_GROUPS: TQueryGroups = {
@@ -209,6 +218,10 @@ export const QUERY_GROUPS: TQueryGroups = {
209
218
  [EChartsCash.TRANSACTIONS]: { scheduled: false, queryAPI: 'transactions', queryFunction: null },
210
219
  [EChartsCash.DELUTION]: { scheduled: false, queryAPI: 'delution', queryFunction: null },
211
220
  },
221
+
222
+ [EQueriesGroups.SALES]: {
223
+ [EChartsSales.FOR_PERIOD]: { scheduled: false, queryAPI: 'sales-for-period', queryFunction: null },
224
+ }
212
225
  };
213
226
 
214
227
 
@@ -32,9 +32,9 @@ export declare const allSchemas: {
32
32
  updatedAt: NativeDate;
33
33
  } & {
34
34
  order: number;
35
- amount: number;
36
35
  bbcSheetId: import("mongoose").Types.ObjectId;
37
36
  apDate: Date;
37
+ amount: number;
38
38
  __v?: number;
39
39
  poNumber?: string;
40
40
  customerName?: string;
@@ -46,9 +46,9 @@ export declare const allSchemas: {
46
46
  updatedAt: NativeDate;
47
47
  } & {
48
48
  order: number;
49
- amount: number;
50
49
  bbcSheetId: import("mongoose").Types.ObjectId;
51
50
  apDate: Date;
51
+ amount: number;
52
52
  __v?: number;
53
53
  poNumber?: string;
54
54
  customerName?: string;
@@ -60,9 +60,9 @@ export declare const allSchemas: {
60
60
  updatedAt: NativeDate;
61
61
  } & {
62
62
  order: number;
63
- amount: number;
64
63
  bbcSheetId: import("mongoose").Types.ObjectId;
65
64
  apDate: Date;
65
+ amount: number;
66
66
  __v?: number;
67
67
  poNumber?: string;
68
68
  customerName?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.42",
3
+ "version": "1.5.44",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,7 @@ const BorrowerDataReceivable_model_1 = require("../models/BorrowerDataReceivable
17
17
  const BorrowerDataInventory_model_1 = require("../models/BorrowerDataInventory.model");
18
18
  const BorrowerDataTerm_model_1 = require("../models/BorrowerDataTerm.model");
19
19
  const BorrowerDataBootCollateral_model_1 = require("../models/BorrowerDataBootCollateral.model");
20
+ const collaterals_enum_1 = require("../enums/collaterals.enum");
20
21
  exports.borrowerDataModels = {
21
22
  receivables: BorrowerDataReceivable_model_1.BorrowerDataReceivableModel,
22
23
  inventories: BorrowerDataInventory_model_1.BorrowerDataInventoryModel,
@@ -80,11 +81,11 @@ class BorrowerService {
80
81
  const defaultSettings = {
81
82
  borrower: new mongoose_1.default.Types.ObjectId(borrowerId),
82
83
  queries: {
83
- inventory: {},
84
- receivable: {},
85
- 'account payable': {},
86
- other: {},
87
- cash: {},
84
+ [collaterals_enum_1.ECollaterals.INVENTORY]: {},
85
+ [collaterals_enum_1.ECollaterals.RECEIVABLE]: {},
86
+ [collaterals_enum_1.ECollaterals.OTHER]: {},
87
+ [collaterals_enum_1.ECollaterals.CASH]: {},
88
+ [collaterals_enum_1.ECollaterals.SALES]: {},
88
89
  },
89
90
  dataTypes: {
90
91
  upload: [],
@@ -25,6 +25,7 @@ import { LoanStatementStatusService } from './loan-statement-status.service';
25
25
  import { LoanTransactionsService } from './loan-transactions.service';
26
26
  import { SignsService } from './signs.service';
27
27
  import { IUser, IUserAccess } from '../interfaces/auth-user.interface';
28
+ import { ECollaterals } from '../enums/collaterals.enum';
28
29
 
29
30
  export const borrowerDataModels: {
30
31
  [modelName: string]: mongoose.Model<any>
@@ -96,11 +97,11 @@ export class BorrowerService {
96
97
  const defaultSettings: IBorrowerSettings = {
97
98
  borrower: new mongoose.Types.ObjectId(borrowerId),
98
99
  queries: {
99
- inventory: {},
100
- receivable: {},
101
- 'account payable': {},
102
- other: {},
103
- cash: {},
100
+ [ECollaterals.INVENTORY]: {},
101
+ [ECollaterals.RECEIVABLE]: {},
102
+ [ECollaterals.OTHER]: {},
103
+ [ECollaterals.CASH]: {},
104
+ [ECollaterals.SALES]: {},
104
105
  },
105
106
  dataTypes: {
106
107
  upload: [],