@things-factory/operato-hub 4.3.634 → 4.3.636

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.
@@ -0,0 +1,216 @@
1
+ module.exports = {
2
+ domainType: 'company',
3
+ domainExtType: 'company',
4
+ useVirtualHostBasedDomain: false,
5
+ fallbackRoute: '/',
6
+ subdomainOffset: 2,
7
+ port: 4445,
8
+ inspect: '9260',
9
+ // ormconfig: {
10
+ // name: 'default',
11
+ // type: 'postgres',
12
+ // database: 'operato',
13
+ // username: 'postgres',
14
+ // password: 'hatio',
15
+ // host: '192.168.0.153',
16
+ // port: 15432,
17
+ // synchronize: false,
18
+ // logging: true
19
+ // },
20
+
21
+ //db izzah
22
+ // ormconfig: {
23
+ // name: 'default',
24
+ // type: 'postgres',
25
+ // database: '06072023',
26
+ // username: 'postgres',
27
+ // password: 'hatio',
28
+ // host: '192.168.0.153',
29
+ // port: 15432,
30
+ // synchronize: true,
31
+ // logging: true
32
+ // },
33
+ //postgres
34
+ ormconfig: {
35
+ name: 'default',
36
+ type: 'postgres',
37
+ database: 'postgres',
38
+ username: 'postgres',
39
+ password: 'hatio',
40
+ host: '192.168.0.151',
41
+ port: 15432,
42
+ synchronize: false,
43
+ logging: true
44
+ },
45
+
46
+ // //ERIC
47
+ // ormconfig: {
48
+ // name: 'default',
49
+ // type: 'postgres',
50
+ // database: 'eric',
51
+ // username: 'postgres',
52
+ // password: 'hatio',
53
+ // host: '192.168.0.153',
54
+ // port: 15432,
55
+ // synchronize: true,
56
+ // logging: true
57
+ // },
58
+
59
+ //eric2
60
+ // ormconfig: {
61
+ // name: 'default',
62
+ // type: 'postgres',
63
+ // database: 'eric2',
64
+ // username: 'postgres',
65
+ // password: 'hatio',
66
+ // host: '192.168.0.153',
67
+ // port: 15432,
68
+ // synchronize: false,
69
+ // logging: true
70
+ // },
71
+
72
+ // ormconfig: {
73
+ // name: 'default',
74
+ // type: 'postgres',
75
+ // database: 'dev2', // dev2
76
+ // username: 'postgres',
77
+ // password: 'abcd1234',
78
+ // host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
79
+ // port: 55432,
80
+ // synchronize:false,
81
+ // logging: false,
82
+ // connectTimeoutMS: 30000,
83
+ // extra: { poolSize: 30 }
84
+ // },
85
+ // ormconfig: {
86
+ // name: 'default',
87
+ // type: 'postgres',
88
+ // host: 'localhost',
89
+ // port: 15432,
90
+ // database: 'postgres',
91
+ // username: 'postgres',
92
+ // password: 'hatio',
93
+ // synchronize: false,
94
+ // logging: true,
95
+ // connectTimeoutMS: 30000,
96
+ // extra: { poolSize: 30 }
97
+ // },
98
+ password: {
99
+ lowerCase: true,
100
+ upperCase: false,
101
+ digit: false,
102
+ specialCharacter: false,
103
+ allowRepeat: true,
104
+ useTightPattern: false,
105
+ useLoosePattern: true,
106
+ tightCharacterLength: 4,
107
+ looseCharacterLength: 4,
108
+ history: 2
109
+ },
110
+ sftpFileStorage: {
111
+ type: 's3',
112
+ accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
113
+ secretAccessKey: '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',
114
+ bucketName: 'operato-sftp'
115
+ },
116
+ // storage: {
117
+ // type: 's3',
118
+ // accessKeyId: 'AKIAUQEOPWEJCDH6AR5H',
119
+ // secretAccessKey: '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',
120
+ // bucketName: 'opa-one',
121
+ // region: 'ap-southeast-1'
122
+ // },
123
+ uploads: 'uploads',
124
+ attachmentsPath: 'attachments',
125
+ SECRET: '0xD58F835B69D207A76CC5F84a70a1D0d4C79dfC95',
126
+ logger: {
127
+ file: {
128
+ filename: 'logs/application-%DATE%.log',
129
+ datePattern: 'YYYY-MM-DD-HH',
130
+ zippedArchive: true,
131
+ maxSize: '200m',
132
+ maxFiles: '1m',
133
+ level: 'info'
134
+ }
135
+ },
136
+ email: {
137
+ host: 'smtp.office365.com',
138
+ port: 587,
139
+ secure: false, // true for 465, false for other ports
140
+ auth: {
141
+ user: 'noreply@hatiolab.com', // generated ethereal user
142
+ pass: 'h@ti0LAB1008' // generated ethereal password
143
+ },
144
+ secureConnection: false,
145
+ tls: {
146
+ ciphers: 'SSLv3'
147
+ }
148
+ },
149
+ sender: 'noreply@hatiolab.com',
150
+ notification: {
151
+ // fcm: {
152
+ // serviceAccount: {
153
+ // project_id: 'operato',
154
+ // private_key:
155
+ // '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDYNOfyNjPMSeG9\nzU1qs0cpVK5cVfadcUaw5g+hkQZMOMlAA7uqW2eX4vkayj7MzbYUayH+sei8044Q\nJIyl6f26dNX1VT3UgTmSmCS0v48EBEZHCgusrUGFjduLRN6OS6uvrXW1xKA18k9q\nai1C2EHCXF2AE4PTvf239RC1UIOnVePcMtT7rMTdHRO4s8OKVuSDbzIt8k1cV3Zt\nES0YsJlkELqBisYpV//2/ZSILTt39J9JzrVef03X9kkoo9p+YnNyy6tWsfQPfgJO\nybiRGBNxiyJ/E2pxRo/WqU0go9OzYJlGaSUrUx09heNiRD1b0MAOmyPDJz/6AaTk\nkU/A+kLzAgMBAAECggEADQ5s2gtR53VSujk1V/Xe8e0Di99DwaWUj5w6YhcK7/wX\nPdQRN4Fw6RLeLjL7xeG/rCNSwzm6hKSrQJL5zLnWW7XbMdyQRk6jdmnVAEv3zACi\nFH9+eFK3e+Q214XfgWz/v4p/FZdRLCYni5VBNHcwyWxLLS/V1ynzB3KM1sDiTRmI\npcT7+uTtwrKgJq64sXtFE2pYrFxDdCiyqzkhv/2ed4YIowAjpKBbbcCDKeVxVkoz\nC1P4PAzs9EeUuKSWYrWaUjN17lqtRlYeT1ylR1PIJuWqd4cKfgoEgz+lHwRPDCEX\nAYbk3nofiJIPBhSfCHrXS755wK48mY8vMwFdfCPJeQKBgQDsz4tjYTHdat5A25n5\nekwMxZwFQ5OvMV4eulwZUDMypTAYSz1iB6sDlgwKDm5omZIfuneqCEIvrqxV/kx3\n5wV/DANHO3hYxdp/NV7rM23xmqlaKZhHQbDono1Fm/LP6DEmJiD7N2eFKsXYcPpR\nSAIdCv0X3zkDQ4zRi51yJlCXzQKBgQDpufJBxCoXngiQJ2j14lWVAeOOdQ6zh5Ip\nBcDwF0X67cNSN3Wl40bS4yLFdolhEAyj5m0WPuYYXpjzhHhZ0W3V3ItdBkrmwIvy\nWOWu26qN0ZbwxVS2qVpHuj6iHWJKHuDZZUkFtJg3BeeBSOUHSA8TvjnA0xd83xeb\n8ZJasWoFvwKBgQDFs/gQ/gIdcq0exLfluh5nw0qgcmyHpNWJHdjqITS9IX/nqFkU\n0IYLtmdStf2jQiLmbkydHcvz9wZVvLqml67VBHhwLcwpgPULoskd34/4V0Dvzy4c\nv1Esw8H5zVqIDLeLu+VpFjZMzQrjyl6RIWbyTExEc84rVWfpQYAu3qIGOQKBgAFr\nXatEk7TdAtRNSPflTfu/rTAaSeKROjQBkvBiU8x4US1YpOBDBxUUyAtG8wKh5FHC\nfnsaGq+fM3KXJVv2R6J62mXQOfg4xyDLpWlwcBK4aSBBMoiBcsjouqSlZQlqMpdf\nZBgixqHe6U8BsFJg/6ZxC0y+e3AIss4Bo4/lb+1lAoGAFOexvaBh21K6W3inmRW4\nLlkVYJaBJ20OwokXg5aXjBiHxqmk7VLAuFbkpb5LOKH2xPILRQ0OEkn51yVymS3T\n9lLpHOFTQXt5tF2/F7NW7kaQJNlLr/h5jPi3O9XHeFmuaN2z150ZB6zzgjeGKzr8\ni+1fgTsRfDtNw8xkSH9qL1Y=\n-----END PRIVATE KEY-----\n',
156
+ // client_email: 'firebase-adminsdk-xmm2e@operato.iam.gserviceaccount.com'
157
+ // },
158
+ // appConfig: {
159
+ // apiKey: 'AIzaSyDdTM2BTLHSt2LNS0G5QB8G0i4KBXFiG7U',
160
+ // projectId: 'operato',
161
+ // messagingSenderId: 79537064975,
162
+ // appId: '1:79537064975:web:32f53119e9c8c6ee2a277a'
163
+ // },
164
+ // serverKey:
165
+ // 'AAAAEoTHTA8:APA91bGwt-4HT82Dfwf_VwbQaKT0_qHd0Y3tuW41udjWz5Lz0Ko0mEMD6WbHHSILvQpa6yuoGGKCMsrU7VW2qWRrUm3CYpyG9oSwshNm1tIhljAnOuUfwHCoawbVLwf9qlWpHt4dwCoc'
166
+ // },
167
+ // vapidKey: {
168
+ // subject: 'mailto:heartyoh@hatiolab.com',
169
+ // publicKey: 'BAkVkITsCXBIsYL1yeaBmx5_dn57we-ZXMjirPPHzC2dan82cdEnAio_53PQ-1_w3ykWCBPrrFAWQ_d9N4cFF0o',
170
+ // privateKey: '4pmlt3Wk019u7nqU3Q_oGZE6LbUDjjf8DpmAcn9-iss'
171
+ // }
172
+ },
173
+ fulfillmentIntegrationOperato: {
174
+ host: '192.168.0.161:3000',
175
+ protocol: 'http',
176
+ platform: 'operato',
177
+ application: 'Operato MMS',
178
+ appKey: 'a9bf751e622bf146662b240d58971051',
179
+ appSecret: '1c385935dc131c4b902b9bbf6a4798af',
180
+ callback: 'http://192.168.0.161:5000/callback-operato'
181
+ },
182
+ marketplaceIntegrationShopee: {
183
+ platform: 'shopee',
184
+ isUAT: false,
185
+ application: 'Operato MMS',
186
+ partnerId: 846025,
187
+ partnerKey: 'd34cfd85a603f196a0d74ebe08043280c1a27788bb36bdffd61e7e0bb1c90b64'
188
+ },
189
+ marketplaceIntegrationLazada: {
190
+ platform: 'lazada',
191
+ application: 'operato-mms',
192
+ appKey: '120961',
193
+ appSecret: 'HB3RTNEXHlVSlBr9SmWF8AjbSUT7a825',
194
+ callback: 'https://maybank.operato-m.com/lazada-callback'
195
+ },
196
+ accountingIntegrationXero: {
197
+ platform: 'xero',
198
+ application: 'Operato WMS',
199
+ apiKey: '6B12D1AAC05347DC92159C2AEC812859',
200
+ apiSecret: 'T139_ItMjObC82mmy7iwnNflhd2iV0kUvDBj0P_201EmA7Sj',
201
+ callback: 'http://operato-h.com:3000/callback-xero',
202
+ hostname: 'http://operato-h.com:3000/'
203
+ },
204
+ lambda: {
205
+ region: 'ap-southeast-1',
206
+ accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
207
+ secretAccessKey: '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'
208
+ },
209
+ awbFileStorage: {
210
+ type: 's3',
211
+ accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
212
+ secretAccessKey: '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',
213
+ bucketName: 'operato-awb',
214
+ region: 'ap-southeast-1'
215
+ }
216
+ }
@@ -28,6 +28,7 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-return-order-details', middlewares
28
28
  relations: [
29
29
  'bizplace',
30
30
  'orderInventories',
31
+ 'orderInventories.releaseGood',
31
32
  'orderInventories.product',
32
33
  'orderInventories.productDetail',
33
34
  'creator',
@@ -39,7 +40,9 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-return-order-details', middlewares
39
40
  throw new error_util_1.ApiError('E04', 'return order');
40
41
  }
41
42
  // Flatten inventoryInfos for frontend
42
- const itemInfos = (returnOrder.orderInventories || []).map(orderInv => {
43
+ const itemInfos = (returnOrder.orderInventories || [])
44
+ .filter(orderInv => orderInv.type === 'RETURN_ORDER')
45
+ .map(orderInv => {
43
46
  var _a, _b, _c, _d, _e, _f, _g;
44
47
  return {
45
48
  batchId: orderInv.batchId,
@@ -60,6 +63,13 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-return-order-details', middlewares
60
63
  uom: (_f = orderInv.productDetail) === null || _f === void 0 ? void 0 : _f.uom,
61
64
  uomValue: (_g = orderInv.productDetail) === null || _g === void 0 ? void 0 : _g.uomValue
62
65
  },
66
+ releaseGood: {
67
+ id: orderInv.releaseGood.id,
68
+ name: orderInv.releaseGood.name,
69
+ refNo: orderInv.releaseGood.refNo,
70
+ refNo2: orderInv.releaseGood.refNo2,
71
+ refNo3: orderInv.releaseGood.refNo3
72
+ },
63
73
  returnQty: orderInv.returnQty,
64
74
  remark: orderInv.remark,
65
75
  status: orderInv.status
@@ -77,7 +87,9 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-return-order-details', middlewares
77
87
  bizplace: returnOrder.bizplace ? { id: returnOrder.bizplace.id, name: returnOrder.bizplace.name } : null,
78
88
  creator: returnOrder.creator ? { id: returnOrder.creator.id, name: returnOrder.creator.name } : null,
79
89
  updater: returnOrder.updater ? { id: returnOrder.updater.id, name: returnOrder.updater.name } : null,
80
- acceptedBy: returnOrder.acceptedBy ? { id: returnOrder.acceptedBy.id, name: returnOrder.acceptedBy.name } : null,
90
+ acceptedBy: returnOrder.acceptedBy
91
+ ? { id: returnOrder.acceptedBy.id, name: returnOrder.acceptedBy.name }
92
+ : null,
81
93
  createdAt: returnOrder.createdAt,
82
94
  updatedAt: returnOrder.updatedAt,
83
95
  itemInfos
@@ -1 +1 @@
1
- {"version":3,"file":"get-return-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-return-order-details.ts"],"names":[],"mappings":";;AACA,qCAAuC;AACvC,2DAAwD;AAExD,6CAAgE;AAChE,gDAA4F;AAC5F,oDAAyF;AAEzF,sBAAM,CAAC,GAAG,CACR,wCAAwC,EACxC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,IAAI,MAAM,mCAAQ,OAAO,CAAC,KAAK,KAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAE,CAAA;QACpD,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;YACzC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;SAC5B;QACD,IAAI,MAAM,CAAC,EAAE,EAAE;YACb,M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C,IAAI;YACpG,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI;YACpG,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI;YAChH,SAAS,EAAE,WAAW,CAAC,SAAS;YAChC,SAAS,EAAE,WAAW,CAAC,SAAS;YAChC,SAAS;SACV,CAAA;QACD,OAAO,CAAC,IAAI,GAAG,EAAE,IAAI,EAAE,CAAA;KACxB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,YAAY,qBAAQ;YAAE,IAAA,4BAAe,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;;YACjD,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CACF,CAAA"}
1
+ {"version":3,"file":"get-return-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-return-order-details.ts"],"names":[],"mappings":";;AACA,qCAAuC;AACvC,2DAAwD;AAExD,6CAAgE;AAChE,gDAA4F;AAC5F,oDAAyF;AAEzF,sBAAM,CAAC,GAAG,CACR,wCAAwC,EACxC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,IAAI,MAAM,mCAAQ,OAAO,CAAC,KAAK,KAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAE,CAAA;QACpD,IAAI,MAAM,CAAC,UAAU,EAAE;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;AACH,CAAC,CACF,CAAA"}
@@ -236,47 +236,80 @@ definitions:
236
236
  updatedAt:
237
237
  type: string
238
238
  example: '2025-05-05T12:00:00Z'
239
- inventoryInfos:
239
+ itemInfos:
240
240
  type: array
241
241
  items:
242
242
  type: object
243
243
  properties:
244
- id:
245
- type: string
246
- example: 'inventory-uuid'
247
- name:
248
- type: string
249
- example: 'Product A'
250
244
  batchId:
251
245
  type: string
252
246
  example: 'batch-001'
253
- palletId:
254
- type: string
255
- example: 'pallet-001'
256
247
  product:
257
248
  type: object
258
249
  properties:
259
250
  id:
260
251
  type: string
261
252
  example: 'product-uuid'
253
+ sku:
254
+ type: string
255
+ example: '1234567890'
256
+ brandSku:
257
+ type: string
258
+ example: '1234567890'
259
+ brand:
260
+ type: string
261
+ example: 'Brand A'
262
+ subBrand:
263
+ type: string
264
+ example: 'Sub Brand A'
265
+ productDetail:
266
+ type: object
267
+ properties:
268
+ id:
269
+ type: string
270
+ example: 'product-uuid'
271
+ refCode:
272
+ type: string
273
+ example: '1234567890'
274
+ isDefault:
275
+ type: boolean
276
+ example: true
277
+ packingType:
278
+ type: string
279
+ example: 'box'
280
+ packingSize:
281
+ type: integer
282
+ example: 24
283
+ movement:
284
+ type: string
285
+ example: 'IN'
286
+ uom:
287
+ type: string
288
+ example: 'PCS'
289
+ uomValue:
290
+ type: number
291
+ example: 10.0
292
+ releaseGood:
293
+ type: object
294
+ properties:
295
+ id:
296
+ type: string
297
+ example: 'release-good-uuid'
262
298
  name:
263
299
  type: string
264
- example: 'Product A'
265
- productName:
266
- type: string
267
- example: 'Product A'
268
- packingType:
269
- type: string
270
- example: 'box'
271
- packingSize:
272
- type: integer
273
- example: 24
300
+ example: 'Release Good A'
301
+ refNo:
302
+ type: string
303
+ example: '1234567890'
304
+ refNo2:
305
+ type: string
306
+ example: '1234567890'
307
+ refNo3:
308
+ type: string
309
+ example: '1234567890'
274
310
  returnQty:
275
311
  type: integer
276
312
  example: 10
277
- returnUomValue:
278
- type: number
279
- example: 10.0
280
313
  remark:
281
314
  type: string
282
315
  example: 'Defective'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-hub",
3
- "version": "4.3.634",
3
+ "version": "4.3.636",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -92,7 +92,7 @@
92
92
  "@things-factory/pdf": "^4.3.591",
93
93
  "@things-factory/product-ui": "^4.3.631",
94
94
  "@things-factory/resource-ui": "^4.3.591",
95
- "@things-factory/sales-base": "^4.3.634",
95
+ "@things-factory/sales-base": "^4.3.636",
96
96
  "@things-factory/scene-data-transform": "^4.3.591",
97
97
  "@things-factory/scene-excel": "^4.3.591",
98
98
  "@things-factory/scene-firebase": "^4.3.591",
@@ -108,8 +108,8 @@
108
108
  "@things-factory/shell": "^4.3.591",
109
109
  "@things-factory/system-ui": "^4.3.591",
110
110
  "@things-factory/transport-base": "^4.3.631",
111
- "@things-factory/warehouse-base": "^4.3.626",
112
- "@things-factory/worksheet-base": "^4.3.634",
111
+ "@things-factory/warehouse-base": "^4.3.636",
112
+ "@things-factory/worksheet-base": "^4.3.636",
113
113
  "cron-parser": "^4.7.0",
114
114
  "koa2-swagger-ui": "^5.0.2",
115
115
  "swagger-jsdoc": "^5.0.0",
@@ -122,5 +122,5 @@
122
122
  "resolutions": {
123
123
  "core-js": "^3.16.0"
124
124
  },
125
- "gitHead": "6d074a8146cfab0031b13ad291218f20495dda3f"
125
+ "gitHead": "876351704622885dd9c6f5980b37cd12d9702b00"
126
126
  }
@@ -37,6 +37,7 @@ router.get(
37
37
  relations: [
38
38
  'bizplace',
39
39
  'orderInventories',
40
+ 'orderInventories.releaseGood',
40
41
  'orderInventories.product',
41
42
  'orderInventories.productDetail',
42
43
  'creator',
@@ -48,31 +49,40 @@ router.get(
48
49
  throw new ApiError('E04', 'return order')
49
50
  }
50
51
  // Flatten inventoryInfos for frontend
51
- const itemInfos = (returnOrder.orderInventories || []).map(orderInv => {
52
- return {
53
- batchId: orderInv.batchId,
54
- product: {
55
- id: orderInv.product.id,
56
- sku: orderInv.product.sku,
57
- brandSku: orderInv.product?.brandSku,
58
- brand: orderInv.product?.brand,
59
- subBrand: orderInv.product?.subBrand
60
- },
61
- productDetail: {
62
- id: orderInv.productDetail.id,
63
- refCode: orderInv.productDetail.refCode,
64
- isDefault: orderInv.productDetail?.isDefault,
65
- packingType: orderInv.productDetail.packingType,
66
- packingSize: orderInv.productDetail.packingSize,
67
- movement: orderInv.productDetail?.movement,
68
- uom: orderInv.productDetail?.uom,
69
- uomValue: orderInv.productDetail?.uomValue
70
- },
71
- returnQty: orderInv.returnQty,
72
- remark: orderInv.remark,
73
- status: orderInv.status
74
- }
75
- })
52
+ const itemInfos = (returnOrder.orderInventories || [])
53
+ .filter(orderInv => orderInv.type === 'RETURN_ORDER')
54
+ .map(orderInv => {
55
+ return {
56
+ batchId: orderInv.batchId,
57
+ product: {
58
+ id: orderInv.product.id,
59
+ sku: orderInv.product.sku,
60
+ brandSku: orderInv.product?.brandSku,
61
+ brand: orderInv.product?.brand,
62
+ subBrand: orderInv.product?.subBrand
63
+ },
64
+ productDetail: {
65
+ id: orderInv.productDetail.id,
66
+ refCode: orderInv.productDetail.refCode,
67
+ isDefault: orderInv.productDetail?.isDefault,
68
+ packingType: orderInv.productDetail.packingType,
69
+ packingSize: orderInv.productDetail.packingSize,
70
+ movement: orderInv.productDetail?.movement,
71
+ uom: orderInv.productDetail?.uom,
72
+ uomValue: orderInv.productDetail?.uomValue
73
+ },
74
+ releaseGood: {
75
+ id: orderInv.releaseGood.id,
76
+ name: orderInv.releaseGood.name,
77
+ refNo: orderInv.releaseGood.refNo,
78
+ refNo2: orderInv.releaseGood.refNo2,
79
+ refNo3: orderInv.releaseGood.refNo3
80
+ },
81
+ returnQty: orderInv.returnQty,
82
+ remark: orderInv.remark,
83
+ status: orderInv.status
84
+ }
85
+ })
76
86
  const data = {
77
87
  id: returnOrder.id,
78
88
  name: returnOrder.name,
@@ -85,7 +95,9 @@ router.get(
85
95
  bizplace: returnOrder.bizplace ? { id: returnOrder.bizplace.id, name: returnOrder.bizplace.name } : null,
86
96
  creator: returnOrder.creator ? { id: returnOrder.creator.id, name: returnOrder.creator.name } : null,
87
97
  updater: returnOrder.updater ? { id: returnOrder.updater.id, name: returnOrder.updater.name } : null,
88
- acceptedBy: returnOrder.acceptedBy ? { id: returnOrder.acceptedBy.id, name: returnOrder.acceptedBy.name } : null,
98
+ acceptedBy: returnOrder.acceptedBy
99
+ ? { id: returnOrder.acceptedBy.id, name: returnOrder.acceptedBy.name }
100
+ : null,
89
101
  createdAt: returnOrder.createdAt,
90
102
  updatedAt: returnOrder.updatedAt,
91
103
  itemInfos