gemcap-be-common 1.4.99 → 1.4.101

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.
@@ -38,7 +38,6 @@ export interface IBorrowerNote {
38
38
  subjectId: mongoose.Types.ObjectId;
39
39
  text: string;
40
40
  attachments: IBorrowerNoteAttachment[];
41
- inline: IBorrowerNoteAttachment[];
42
41
  createdBy: string;
43
42
  updatedBy?: string;
44
43
  source?: {
@@ -67,7 +67,6 @@ exports.BorrowerNoteSchema = new mongoose_1.default.Schema({
67
67
  type: String,
68
68
  },
69
69
  attachments: [BorrowerNoteAttachmentSchema],
70
- inline: [BorrowerNoteAttachmentSchema],
71
70
  source: {
72
71
  type: {
73
72
  type: String,
@@ -18,7 +18,6 @@ export interface IBorrowerNote {
18
18
  subjectId: mongoose.Types.ObjectId;
19
19
  text: string;
20
20
  attachments: IBorrowerNoteAttachment[];
21
- inline: IBorrowerNoteAttachment[];
22
21
  createdBy: string;
23
22
  updatedBy?: string;
24
23
  source?: {
@@ -123,7 +122,6 @@ export const BorrowerNoteSchema = new mongoose.Schema<IBorrowerNoteDoc>({
123
122
  type: String,
124
123
  },
125
124
  attachments: [BorrowerNoteAttachmentSchema],
126
- inline: [BorrowerNoteAttachmentSchema],
127
125
  source: {
128
126
  type: {
129
127
  type: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.99",
3
+ "version": "1.4.101",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -43,7 +43,14 @@ interface IWorkingDaysApi {
43
43
  export declare class CalendarService {
44
44
  private readonly calendarRepository;
45
45
  constructor(calendarRepository: CalendarRepository);
46
- fulfillCalendar(): Promise<void>;
46
+ /**
47
+ * Download a calendar from working days API and save it to DB.
48
+ * It will download all days between startDate and endDate inclusive,
49
+ * for example,
50
+ * startDate as 2025-01-01
51
+ * endDate as 2026-01-01
52
+ */
53
+ fulfillCalendar(startDate: string, endDate: string): Promise<void>;
47
54
  createDate(date: string, dateProp: IWorkingDaysApi): Promise<void>;
48
55
  isWorkingDay(date: string): Promise<boolean>;
49
56
  isLastWorkingDay(date: string): Promise<boolean>;
@@ -12,11 +12,18 @@ class CalendarService {
12
12
  constructor(calendarRepository) {
13
13
  this.calendarRepository = calendarRepository;
14
14
  }
15
- async fulfillCalendar() {
15
+ /**
16
+ * Download a calendar from working days API and save it to DB.
17
+ * It will download all days between startDate and endDate inclusive,
18
+ * for example,
19
+ * startDate as 2025-01-01
20
+ * endDate as 2026-01-01
21
+ */
22
+ async fulfillCalendar(startDate, endDate) {
16
23
  const getDays = () => {
17
24
  const days = [];
18
- const start = (0, dayjs_1.default)('2025-01-01');
19
- const end = (0, dayjs_1.default)('2026-01-01'); // TODO add custom date
25
+ const start = (0, dayjs_1.default)(startDate);
26
+ const end = (0, dayjs_1.default)(endDate);
20
27
  for (let day = (0, dayjs_1.default)(start); day.isBefore(end); day = day.add(1, 'day')) {
21
28
  days.push(day.format('YYYY-MM-DD'));
22
29
  }
@@ -28,12 +28,19 @@ export class CalendarService {
28
28
  ) {
29
29
  }
30
30
 
31
- async fulfillCalendar() {
31
+ /**
32
+ * Download a calendar from working days API and save it to DB.
33
+ * It will download all days between startDate and endDate inclusive,
34
+ * for example,
35
+ * startDate as 2025-01-01
36
+ * endDate as 2026-01-01
37
+ */
38
+ async fulfillCalendar(startDate: string, endDate: string) {
32
39
 
33
40
  const getDays = () => {
34
41
  const days: string[] = [];
35
- const start = dayjs('2025-01-01');
36
- const end = dayjs('2026-01-01'); // TODO add custom date
42
+ const start = dayjs(startDate);
43
+ const end = dayjs(endDate);
37
44
  for (let day = dayjs(start); day.isBefore(end); day = day.add(1, 'day')) {
38
45
  days.push(day.format('YYYY-MM-DD'));
39
46
  }
@@ -155,7 +155,7 @@ export declare class LoanTransactionsService {
155
155
  getTransactionReport(transactionIds: string[], borrowerId: string, effectiveDate: Date): Promise<{
156
156
  transactionIdsToMark: any[];
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<{