gemcap-be-common 1.5.107 → 1.5.109

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.
@@ -28,28 +28,29 @@
28
28
  /// <reference types="mongoose/types/virtuals" />
29
29
  /// <reference types="mongoose/types/inferschematype" />
30
30
  import mongoose from 'mongoose';
31
- import { MODEL_NAMES } from './_models';
31
+ import { TModelName } from './_models';
32
32
  import { TTaskStatus } from '../interfaces/task.interface';
33
+ export interface IAIJobResultFile {
34
+ storageFileId: string;
35
+ aiStorageFileId: string;
36
+ filename: string;
37
+ mimeType?: string;
38
+ size?: number;
39
+ }
33
40
  export interface IAIJob {
34
41
  taskId: string;
35
42
  userId: string;
36
43
  status: TTaskStatus;
37
44
  target: {
38
- type: keyof typeof MODEL_NAMES;
45
+ type: TModelName;
39
46
  id: string;
40
47
  };
41
48
  context: unknown;
42
49
  inputFiles?: Array<{
43
- fileId: string;
44
- aiFileId: string;
45
- }>;
46
- resultFiles?: Array<{
47
- fileId: string;
48
- anthropicFileId: string;
49
- filename: string;
50
- mimeType?: string;
51
- size?: number;
50
+ storageFileId: string;
51
+ aiStorageFileId: string;
52
52
  }>;
53
+ resultFiles?: Array<IAIJobResultFile>;
53
54
  userPrompt?: string;
54
55
  provider?: string;
55
56
  model?: string;
@@ -31,21 +31,21 @@ exports.AIJobSchema = new mongoose_1.default.Schema({
31
31
  },
32
32
  context: mongoose_1.default.Schema.Types.Mixed,
33
33
  inputFiles: [{
34
- fileId: {
34
+ storageFileId: {
35
35
  type: String,
36
36
  required: true,
37
37
  },
38
- aiFileId: {
38
+ aiStorageFileId: {
39
39
  type: String,
40
40
  required: true,
41
41
  },
42
42
  }],
43
43
  resultFiles: [{
44
- fileId: {
44
+ storageFileId: {
45
45
  type: String,
46
46
  required: true,
47
47
  },
48
- anthropicFileId: {
48
+ aiStorageFileId: {
49
49
  type: String,
50
50
  required: true,
51
51
  },
@@ -1,8 +1,16 @@
1
1
  import mongoose from 'mongoose';
2
2
 
3
- import { MODEL_NAMES } from './_models';
3
+ import { MODEL_NAMES, TModelName } from './_models';
4
4
  import { TTaskStatus } from '../interfaces/task.interface';
5
5
 
6
+ export interface IAIJobResultFile {
7
+ storageFileId: string;
8
+ aiStorageFileId: string;
9
+ filename: string;
10
+ mimeType?: string;
11
+ size?: number;
12
+ }
13
+
6
14
  export interface IAIJob {
7
15
  taskId: string;
8
16
  userId: string;
@@ -10,24 +18,18 @@ export interface IAIJob {
10
18
  status: TTaskStatus;
11
19
 
12
20
  target: {
13
- type: keyof typeof MODEL_NAMES;
21
+ type: TModelName;
14
22
  id: string;
15
23
  }
16
24
 
17
25
  context: unknown;
18
26
 
19
27
  inputFiles?: Array<{
20
- fileId: string;
21
- aiFileId: string;
28
+ storageFileId: string;
29
+ aiStorageFileId: string;
22
30
  }>;
23
31
 
24
- resultFiles?: Array<{
25
- fileId: string;
26
- anthropicFileId: string;
27
- filename: string;
28
- mimeType?: string;
29
- size?: number;
30
- }>;
32
+ resultFiles?: Array<IAIJobResultFile>;
31
33
 
32
34
  userPrompt?: string;
33
35
  provider?: string,
@@ -88,22 +90,22 @@ export const AIJobSchema = new mongoose.Schema<IAIJob, TAIJobModel>(
88
90
  context: mongoose.Schema.Types.Mixed,
89
91
 
90
92
  inputFiles: [{
91
- fileId: {
93
+ storageFileId: {
92
94
  type: String,
93
95
  required: true,
94
96
  },
95
- aiFileId: {
97
+ aiStorageFileId: {
96
98
  type: String,
97
99
  required: true,
98
100
  },
99
101
  }],
100
102
 
101
103
  resultFiles: [{
102
- fileId: {
104
+ storageFileId: {
103
105
  type: String,
104
106
  required: true,
105
107
  },
106
- anthropicFileId: {
108
+ aiStorageFileId: {
107
109
  type: String,
108
110
  required: true,
109
111
  },
@@ -73,6 +73,10 @@ export declare const LoanPaymentSchema: mongoose.Schema<any, mongoose.Model<any,
73
73
  createdAt: NativeDate;
74
74
  updatedAt: NativeDate;
75
75
  } & {
76
+ loanTransactions: mongoose.Types.DocumentArray<{
77
+ amount?: number;
78
+ transactionId?: mongoose.Types.ObjectId;
79
+ }>;
76
80
  date: Date;
77
81
  productId: mongoose.Types.ObjectId;
78
82
  amount: number;
@@ -81,16 +85,16 @@ export declare const LoanPaymentSchema: mongoose.Schema<any, mongoose.Model<any,
81
85
  amount?: number;
82
86
  statementId?: mongoose.Types.ObjectId;
83
87
  }>;
84
- loanTransactions: mongoose.Types.DocumentArray<{
85
- amount?: number;
86
- transactionId?: mongoose.Types.ObjectId;
87
- }>;
88
88
  __v?: number;
89
89
  settlementCode?: string;
90
90
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
91
91
  createdAt: NativeDate;
92
92
  updatedAt: NativeDate;
93
93
  } & {
94
+ loanTransactions: mongoose.Types.DocumentArray<{
95
+ amount?: number;
96
+ transactionId?: mongoose.Types.ObjectId;
97
+ }>;
94
98
  date: Date;
95
99
  productId: mongoose.Types.ObjectId;
96
100
  amount: number;
@@ -99,16 +103,16 @@ export declare const LoanPaymentSchema: mongoose.Schema<any, mongoose.Model<any,
99
103
  amount?: number;
100
104
  statementId?: mongoose.Types.ObjectId;
101
105
  }>;
102
- loanTransactions: mongoose.Types.DocumentArray<{
103
- amount?: number;
104
- transactionId?: mongoose.Types.ObjectId;
105
- }>;
106
106
  __v?: number;
107
107
  settlementCode?: string;
108
108
  }>> & mongoose.FlatRecord<{
109
109
  createdAt: NativeDate;
110
110
  updatedAt: NativeDate;
111
111
  } & {
112
+ loanTransactions: mongoose.Types.DocumentArray<{
113
+ amount?: number;
114
+ transactionId?: mongoose.Types.ObjectId;
115
+ }>;
112
116
  date: Date;
113
117
  productId: mongoose.Types.ObjectId;
114
118
  amount: number;
@@ -117,10 +121,6 @@ export declare const LoanPaymentSchema: mongoose.Schema<any, mongoose.Model<any,
117
121
  amount?: number;
118
122
  statementId?: mongoose.Types.ObjectId;
119
123
  }>;
120
- loanTransactions: mongoose.Types.DocumentArray<{
121
- amount?: number;
122
- transactionId?: mongoose.Types.ObjectId;
123
- }>;
124
124
  __v?: number;
125
125
  settlementCode?: string;
126
126
  }> & {
@@ -138,3 +138,4 @@ export declare const MODEL_NAMES: {
138
138
  userTokens: string;
139
139
  yieldData: string;
140
140
  };
141
+ export type TModelName = (typeof MODEL_NAMES)[keyof typeof MODEL_NAMES];
package/models/_models.ts CHANGED
@@ -66,7 +66,7 @@ export const MODEL_NAMES = {
66
66
  customerGroups: 'customerGroups',
67
67
  deletedRecords: 'deleted_records',
68
68
  equipment: 'equipment',
69
- earlyPayments : 'early_payments',
69
+ earlyPayments: 'early_payments',
70
70
  externalUserAccess: 'external_user_access',
71
71
  facilities: 'facilities',
72
72
  facilityChargeGroups: 'facility_charge_groups',
@@ -138,3 +138,5 @@ export const MODEL_NAMES = {
138
138
  userTokens: 'user_tokens',
139
139
  yieldData: 'yield_data',
140
140
  };
141
+
142
+ export type TModelName = (typeof MODEL_NAMES)[keyof typeof MODEL_NAMES];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.107",
3
+ "version": "1.5.109",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {