@things-factory/warehouse-base 4.3.2 → 4.4.0-alpha.1

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.
Files changed (47) hide show
  1. package/dist-server/constants/index.js +5 -2
  2. package/dist-server/constants/index.js.map +1 -1
  3. package/dist-server/controllers/ecommerce/index.js +5 -1
  4. package/dist-server/controllers/ecommerce/index.js.map +1 -1
  5. package/dist-server/controllers/index.js +5 -1
  6. package/dist-server/controllers/index.js.map +1 -1
  7. package/dist-server/index.js +6 -4
  8. package/dist-server/index.js.map +1 -1
  9. package/dist-server/service/index.js +7 -8
  10. package/dist-server/service/index.js.map +1 -1
  11. package/dist-server/service/inventory/inventory-query.js +1 -2
  12. package/dist-server/service/inventory/inventory-query.js.map +1 -1
  13. package/dist-server/service/inventory-change/inventory-change-mutation.js +273 -334
  14. package/dist-server/service/inventory-change/inventory-change-mutation.js.map +1 -1
  15. package/dist-server/service/inventory-history/inventory-history-query.js +2 -23
  16. package/dist-server/service/inventory-history/inventory-history-query.js.map +1 -1
  17. package/dist-server/utils/index.js +5 -1
  18. package/dist-server/utils/index.js.map +1 -1
  19. package/dist-server/utils/inventory-util.js +3 -5
  20. package/dist-server/utils/inventory-util.js.map +1 -1
  21. package/package.json +8 -8
  22. package/server/constants/index.ts +0 -1
  23. package/server/index.ts +0 -2
  24. package/server/service/index.ts +2 -7
  25. package/server/service/inventory/inventory-query.ts +1 -2
  26. package/server/service/inventory-change/index.ts +1 -1
  27. package/server/service/inventory-change/inventory-change-mutation.ts +407 -471
  28. package/server/service/inventory-history/inventory-history-query.ts +2 -23
  29. package/server/utils/inventory-util.ts +3 -5
  30. package/dist-server/constants/tote.js +0 -9
  31. package/dist-server/constants/tote.js.map +0 -1
  32. package/dist-server/service/tote/index.js +0 -9
  33. package/dist-server/service/tote/index.js.map +0 -1
  34. package/dist-server/service/tote/tote-mutation.js +0 -192
  35. package/dist-server/service/tote/tote-mutation.js.map +0 -1
  36. package/dist-server/service/tote/tote-query.js +0 -146
  37. package/dist-server/service/tote/tote-query.js.map +0 -1
  38. package/dist-server/service/tote/tote-types.js +0 -75
  39. package/dist-server/service/tote/tote-types.js.map +0 -1
  40. package/dist-server/service/tote/tote.js +0 -98
  41. package/dist-server/service/tote/tote.js.map +0 -1
  42. package/server/constants/tote.ts +0 -5
  43. package/server/service/tote/index.ts +0 -6
  44. package/server/service/tote/tote-mutation.ts +0 -200
  45. package/server/service/tote/tote-query.ts +0 -102
  46. package/server/service/tote/tote-types.ts +0 -44
  47. package/server/service/tote/tote.ts +0 -77
@@ -262,7 +262,7 @@ export class InventoryHistoryQuery {
262
262
  (
263
263
  SELECT prd.name AS product_name, prd.description AS product_description, prd.type as product_type, prd.aux_value_1 AS product_aux_value_1, trim(invh.batch_id) as batch_id, invh.product_id,
264
264
  invh.packing_type, invh.bizplace_id, invh.domain_id,
265
- invh.ref_order_id, invh.order_no, invh.order_ref_no, invh.transaction_type, invh.status, invh.created_at,
265
+ invh.ref_order_id, invh.order_no, invh.order_ref_no, invh.transaction_type, invh.created_at,
266
266
  invh.qty, invh.opening_qty,
267
267
  invh.uom, COALESCE(invh.uom_value, 0) as uom_value, COALESCE(invh.opening_uom_value, 0) as opening_uom_value
268
268
  FROM reduced_inventory_histories invh
@@ -335,27 +335,6 @@ export class InventoryHistoryQuery {
335
335
  ) AS inv_movement
336
336
  GROUP BY product_name, product_description, product_type, product_aux_value_1, batch_id, product_id, packing_type, uom, bizplace_id,
337
337
  domain_id, order_name, ref_no, rn, created_at
338
- UNION ALL
339
- SELECT product_name, product_description, product_type, product_aux_value_1, batch_id, product_id, packing_type, uom, bizplace_id,
340
- domain_id, sum(-opening_qty) as qty, sum(opening_qty) as opening_qty, sum(-opening_uom_value) as uom_value, sum(opening_uom_value) as opening_uom_value,
341
- order_name, ref_no, 1 AS rn, created_at - $2::interval as created_at, created_at::date as created_date
342
- FROM (
343
- SELECT invh.product_name, invh.product_description, invh.product_type, invh.product_aux_value_1, invh.batch_id, invh.product_id, invh.packing_type, invh.uom, invh.bizplace_id,
344
- invh.domain_id,
345
- invh.qty, invh.opening_qty, invh.uom_value, invh.opening_uom_value,
346
- invh.transaction_type AS order_name,
347
- invh.transaction_type AS ref_no,
348
- invh.created_at,
349
- invh.created_at:: date as created_date
350
- FROM temp_data_src invh
351
- WHERE
352
- invh.transaction_type = 'ADJUSTMENT' AND
353
- invh.status = 'MISSING'
354
- AND invh.created_at >= $1::timestamp
355
- ) AS inv_movement
356
- GROUP BY product_name, product_description, product_type, product_aux_value_1, batch_id, product_id, packing_type, uom, bizplace_id,
357
- domain_id, order_name, ref_no, rn, created_at
358
-
359
338
  )`,
360
339
  [fromDate.value, tzoffset]
361
340
  )
@@ -1129,7 +1108,7 @@ export class InventoryHistoryQuery {
1129
1108
  group by ih.domain_id, ih.pallet_id
1130
1109
  ) dt
1131
1110
  inner join tmp_src rih on dt.domain_id = rih.domain_id and dt.pallet_id = rih.pallet_id and dt.last_seq = rih.seq and rih.status <> 'TERMINATED'
1132
- inner join inventories iv on iv.domain_id = dt.domain_id and iv.pallet_id = dt.pallet_id and iv.status <> 'MISSING'
1111
+ inner join inventories iv on iv.domain_id = dt.domain_id and iv.pallet_id = dt.pallet_id
1133
1112
  where exists (
1134
1113
  SELECT * FROM tmp_bizfilter bizFilter
1135
1114
  WHERE bizFilter.bizplace_id = "rih"."bizplace_id"
@@ -355,7 +355,7 @@ export async function getProductBundleInventory(
355
355
  ) pb
356
356
  inner join product_bundle_settings pbs on pbs.product_bundle_id = pb.id
357
357
  inner join product_details pd on pd.id = pbs.product_detail_id
358
- left join inventories inv on ((inv.status <> 'TERMINATED' and (inv.qty - coalesce(inv.locked_qty,0)) > 0) or (inv.status = 'TERMINATED' and (inv.qty - coalesce(inv.locked_qty,0)) = 0)) and inv.product_id = pd.product_id and inv.packing_type = pd.packing_type and inv.packing_size = pd.packing_size and inv.uom = pd.uom
358
+ left join inventories inv on inv.status <> 'TERMINATED' and (inv.qty - coalesce(inv.locked_qty,0)) > 0 and inv.product_id = pd.product_id and inv.packing_type = pd.packing_type and inv.packing_size = pd.packing_size and inv.uom = pd.uom
359
359
  where inv.domain_id = $2
360
360
  group by pb.sku, pb.name, pbs.product_bundle_id, pbs.bundle_qty, pd.product_id, pd.packing_type, pd.packing_size, pd.uom
361
361
  ) foo group by product_bundle_id, sku, name
@@ -404,8 +404,7 @@ export async function getInventoriesByStrategy(
404
404
  "packingSize" INT,
405
405
  "uom" VARCHAR(10),
406
406
  "releaseQty" INT,
407
- "pickingStrategy" VARCHAR(25),
408
- "orderProductId" VARCHAR(50)
407
+ "pickingStrategy" VARCHAR(25)
409
408
  );
410
409
  `
411
410
  )
@@ -413,7 +412,7 @@ export async function getInventoriesByStrategy(
413
412
  await trxMgr.query(
414
413
  `
415
414
  INSERT INTO temp_op2
416
- SELECT "productId", "batchId", "packingType", "packingSize", "uom", "releaseQty", "pickingStrategy", "orderProductId"
415
+ SELECT "productId", "batchId", "packingType", "packingSize", "uom", "releaseQty", "pickingStrategy"
417
416
  FROM JSON_POPULATE_RECORDSET(NULL::temp_op2, $1) js
418
417
  `,
419
418
  [orderProductsJSON]
@@ -446,7 +445,6 @@ export async function getInventoriesByStrategy(
446
445
  op."packingType",
447
446
  op."packingSize",
448
447
  op."uom",
449
- op."orderProductId",
450
448
  ROW_NUMBER() OVER (
451
449
  PARTITION BY op."productId", op."batchId", op."packingType", op."packingSize", op."uom"
452
450
  ORDER BY
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TOTE_STATUS = void 0;
4
- exports.TOTE_STATUS = {
5
- ACTIVE: 'ACTIVE',
6
- DISPATCHED: 'DISPATCHED',
7
- DAMAGED: 'DAMAGED'
8
- };
9
- //# sourceMappingURL=tote.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tote.js","sourceRoot":"","sources":["../../server/constants/tote.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;CACnB,CAAA"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvers = exports.entities = void 0;
4
- const tote_1 = require("./tote");
5
- const tote_mutation_1 = require("./tote-mutation");
6
- const tote_query_1 = require("./tote-query");
7
- exports.entities = [tote_1.Tote];
8
- exports.resolvers = [tote_query_1.ToteQuery, tote_mutation_1.ToteMutation];
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/tote/index.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,mDAA8C;AAC9C,6CAAwC;AAE3B,QAAA,QAAQ,GAAG,CAAC,WAAI,CAAC,CAAA;AACjB,QAAA,SAAS,GAAG,CAAC,sBAAS,EAAE,4BAAY,CAAC,CAAA"}
@@ -1,192 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ToteMutation = void 0;
16
- const type_graphql_1 = require("type-graphql");
17
- const typeorm_1 = require("typeorm");
18
- const biz_base_1 = require("@things-factory/biz-base");
19
- const tote_1 = require("./tote");
20
- const tote_types_1 = require("./tote-types");
21
- let ToteMutation = class ToteMutation {
22
- async createTote(tote, context) {
23
- const { domain, user, tx } = context.state;
24
- const existingTote = (await tx.getRepository(tote_1.Tote).find({ relations: ['user'] })).map(tote => tote.name);
25
- if (existingTote.includes(tote.name))
26
- throw new Error('tote box already exists');
27
- return await tx.getRepository(tote_1.Tote).save(Object.assign(Object.assign({}, tote), { domain: domain, creator: user, updater: user }));
28
- }
29
- async updateTote(name, patch, context) {
30
- const { domain, user, tx } = context.state;
31
- const repository = tx.getRepository(tote_1.Tote);
32
- const tote = await repository.findOne({
33
- where: { domain: domain, name }
34
- });
35
- return await repository.save(Object.assign(Object.assign(Object.assign({}, tote), patch), { updater: user }));
36
- }
37
- async updateMultipleTote(patches, context) {
38
- const { domain, user, tx } = context.state;
39
- let results = [];
40
- const _createRecords = patches.filter((patch) => patch.cuFlag === '+');
41
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
42
- if (_createRecords.length > 0) {
43
- for (let i = 0; i < _createRecords.length; i++) {
44
- const newRecord = _createRecords[i];
45
- if (newRecord.bizplace && newRecord.bizplace.id) {
46
- newRecord.bizplace = await tx.getRepository(biz_base_1.Bizplace).findOne(newRecord.bizplace.id);
47
- }
48
- let foundTote = await tx
49
- .getRepository(tote_1.Tote)
50
- .findOne({ where: { domain, name: newRecord.name, bizplace: newRecord.bizplace } });
51
- if (foundTote) {
52
- throw new Error('Duplicated tote found');
53
- }
54
- const result = await tx.getRepository(tote_1.Tote).save(Object.assign({ domain: domain, creator: user, updater: user }, newRecord));
55
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
56
- }
57
- }
58
- if (_updateRecords.length > 0) {
59
- for (let i = 0; i < _updateRecords.length; i++) {
60
- const newRecord = _updateRecords[i];
61
- const tote = await tx.getRepository(tote_1.Tote).findOne({
62
- where: { id: newRecord.id },
63
- relations: ['bizplace']
64
- });
65
- if (newRecord.bizplace && newRecord.bizplace.id) {
66
- newRecord.bizplace = await tx.getRepository(biz_base_1.Bizplace).findOne(newRecord.bizplace.id);
67
- }
68
- let foundTote = await tx
69
- .getRepository(tote_1.Tote)
70
- .findOne({ where: { domain, name: newRecord.name, bizplace: newRecord.bizplace } });
71
- if (foundTote) {
72
- throw new Error('Duplicated tote found');
73
- }
74
- const result = await tx.getRepository(tote_1.Tote).save(Object.assign(Object.assign(Object.assign({}, tote), newRecord), { updater: user }));
75
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
76
- }
77
- }
78
- return results;
79
- }
80
- async deleteTote(id, context) {
81
- const { domain, user, tx } = context.state;
82
- const foundTote = await tx.getRepository(tote_1.Tote).find({ where: { id } });
83
- await tx.getRepository(tote_1.Tote).save(Object.assign(Object.assign({}, foundTote), { deletedAt: new Date(), updater: user }));
84
- return true;
85
- }
86
- async deleteTotes(ids, context) {
87
- const { domain, user, tx } = context.state;
88
- const totes = await tx.getRepository(tote_1.Tote).find({
89
- where: {
90
- domain: domain,
91
- id: (0, typeorm_1.In)(ids)
92
- },
93
- relations: ['bizplace']
94
- });
95
- await Promise.all(totes.map(async (tote) => {
96
- await tx.getRepository(tote_1.Tote).save(Object.assign(Object.assign({}, tote), { deletedAt: new Date(), updater: user }));
97
- }));
98
- return true;
99
- }
100
- async undeleteTotes(ids, context) {
101
- const { tx, user } = context.state;
102
- const toteRepo = tx.getRepository(tote_1.Tote);
103
- await toteRepo.update({
104
- id: (0, typeorm_1.In)(ids)
105
- }, {
106
- deletedAt: null,
107
- updater: user
108
- });
109
- return true;
110
- }
111
- async bulkUpdateToteStatus(ids, status, context) {
112
- const { tx, user } = context.state;
113
- const toteRepo = tx.getRepository(tote_1.Tote);
114
- await toteRepo.update({
115
- id: (0, typeorm_1.In)(ids)
116
- }, {
117
- status,
118
- updater: user
119
- });
120
- return true;
121
- }
122
- };
123
- __decorate([
124
- (0, type_graphql_1.Directive)('@transaction'),
125
- (0, type_graphql_1.Mutation)(returns => tote_1.Tote),
126
- __param(0, (0, type_graphql_1.Arg)('pallet')),
127
- __param(1, (0, type_graphql_1.Ctx)()),
128
- __metadata("design:type", Function),
129
- __metadata("design:paramtypes", [tote_types_1.NewTote, Object]),
130
- __metadata("design:returntype", Promise)
131
- ], ToteMutation.prototype, "createTote", null);
132
- __decorate([
133
- (0, type_graphql_1.Directive)('@transaction'),
134
- (0, type_graphql_1.Mutation)(returns => tote_1.Tote),
135
- __param(0, (0, type_graphql_1.Arg)('name')),
136
- __param(1, (0, type_graphql_1.Arg)('patch')),
137
- __param(2, (0, type_graphql_1.Ctx)()),
138
- __metadata("design:type", Function),
139
- __metadata("design:paramtypes", [String, tote_types_1.TotePatch, Object]),
140
- __metadata("design:returntype", Promise)
141
- ], ToteMutation.prototype, "updateTote", null);
142
- __decorate([
143
- (0, type_graphql_1.Directive)('@transaction'),
144
- (0, type_graphql_1.Mutation)(returns => [tote_1.Tote]),
145
- __param(0, (0, type_graphql_1.Arg)('patches', type => [tote_types_1.TotePatch])),
146
- __param(1, (0, type_graphql_1.Ctx)()),
147
- __metadata("design:type", Function),
148
- __metadata("design:paramtypes", [Array, Object]),
149
- __metadata("design:returntype", Promise)
150
- ], ToteMutation.prototype, "updateMultipleTote", null);
151
- __decorate([
152
- (0, type_graphql_1.Directive)('@transaction'),
153
- (0, type_graphql_1.Mutation)(returns => Boolean),
154
- __param(0, (0, type_graphql_1.Arg)('name')),
155
- __param(1, (0, type_graphql_1.Ctx)()),
156
- __metadata("design:type", Function),
157
- __metadata("design:paramtypes", [String, Object]),
158
- __metadata("design:returntype", Promise)
159
- ], ToteMutation.prototype, "deleteTote", null);
160
- __decorate([
161
- (0, type_graphql_1.Directive)('@transaction'),
162
- (0, type_graphql_1.Mutation)(returns => Boolean),
163
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
164
- __param(1, (0, type_graphql_1.Ctx)()),
165
- __metadata("design:type", Function),
166
- __metadata("design:paramtypes", [Array, Object]),
167
- __metadata("design:returntype", Promise)
168
- ], ToteMutation.prototype, "deleteTotes", null);
169
- __decorate([
170
- (0, type_graphql_1.Directive)('@transaction'),
171
- (0, type_graphql_1.Mutation)(returns => Boolean),
172
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
173
- __param(1, (0, type_graphql_1.Ctx)()),
174
- __metadata("design:type", Function),
175
- __metadata("design:paramtypes", [Array, Object]),
176
- __metadata("design:returntype", Promise)
177
- ], ToteMutation.prototype, "undeleteTotes", null);
178
- __decorate([
179
- (0, type_graphql_1.Directive)('@transaction'),
180
- (0, type_graphql_1.Mutation)(returns => Boolean),
181
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
182
- __param(1, (0, type_graphql_1.Arg)('status', type => String)),
183
- __param(2, (0, type_graphql_1.Ctx)()),
184
- __metadata("design:type", Function),
185
- __metadata("design:paramtypes", [Array, String, Object]),
186
- __metadata("design:returntype", Promise)
187
- ], ToteMutation.prototype, "bulkUpdateToteStatus", null);
188
- ToteMutation = __decorate([
189
- (0, type_graphql_1.Resolver)(tote_1.Tote)
190
- ], ToteMutation);
191
- exports.ToteMutation = ToteMutation;
192
- //# sourceMappingURL=tote-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tote-mutation.js","sourceRoot":"","sources":["../../../server/service/tote/tote-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAG3C,uDAAmD;AAInD,iCAA6B;AAC7B,6CAAiD;AAGjD,IAAa,YAAY,GAAzB,MAAa,YAAY;IAGvB,KAAK,CAAC,UAAU,CAAgB,IAAa,EAAS,OAAY;QAChE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAE7F,MAAM,YAAY,GAAa,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,C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C,OAAO,CAAC;IACX,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;8CAW/C;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACV,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAqBpE;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACR,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAetE;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IAE1B,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,WAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAgBP;AA1LU,YAAY;IADxB,IAAA,uBAAQ,EAAC,WAAI,CAAC;GACF,YAAY,CA2LxB;AA3LY,oCAAY"}
@@ -1,146 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var _a;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ToteQuery = void 0;
17
- const type_graphql_1 = require("type-graphql");
18
- const typeorm_1 = require("typeorm");
19
- const auth_base_1 = require("@things-factory/auth-base");
20
- const biz_base_1 = require("@things-factory/biz-base");
21
- const shell_1 = require("@things-factory/shell");
22
- const tote_1 = require("./tote");
23
- const tote_types_1 = require("./tote-types");
24
- let ToteQuery = class ToteQuery {
25
- async totes(context, filters, pagination, sortings) {
26
- const { domain } = context.state;
27
- const deletedFilter = filters.find((filter) => filter.name === 'deleted' && filter.value === true);
28
- const queryBuilder = (0, typeorm_1.getRepository)(tote_1.Tote).createQueryBuilder();
29
- (0, shell_1.buildQuery)(queryBuilder, { filters, pagination, sortings }, context);
30
- queryBuilder
31
- .leftJoinAndSelect('Tote.domain', 'Domain')
32
- .leftJoinAndSelect('Tote.bizplace', 'Bizplace')
33
- .leftJoinAndSelect('Tote.creator', 'Creator')
34
- .leftJoinAndSelect('Tote.updater', 'Updater')
35
- .where('Domain.id = :domainId', { domainId: domain.id });
36
- if (deletedFilter) {
37
- queryBuilder.andWhere('Tote.deletedAt IS NOT NULL');
38
- }
39
- else {
40
- queryBuilder.andWhere('Tote.deletedAt IS NULL');
41
- }
42
- const [items, total] = await queryBuilder.getManyAndCount();
43
- return { items, total };
44
- }
45
- async tote(name, bizplace, context) {
46
- const { domain } = context.state;
47
- let foundBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({ where: { name: bizplace } });
48
- let foundTote = await (0, typeorm_1.getRepository)(tote_1.Tote).findOne({
49
- where: { domain, bizplace: foundBizplace, name, deletedAt: (0, typeorm_1.IsNull)() },
50
- relations: ['domain', 'bizplace', 'creator', 'updater']
51
- });
52
- if (!foundTote) {
53
- throw new Error('Tote not found');
54
- }
55
- else {
56
- return foundTote;
57
- }
58
- }
59
- async checkToteStatus(name, bizplace, context) {
60
- const { domain } = context.state;
61
- let foundBizplace = await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne({ where: { name: bizplace } });
62
- let foundTote = await (0, typeorm_1.getRepository)(tote_1.Tote).findOne({
63
- where: { domain, bizplace: foundBizplace, name, deletedAt: (0, typeorm_1.IsNull)() },
64
- relations: ['domain', 'bizplace', 'creator', 'updater']
65
- });
66
- if (!foundTote) {
67
- return '';
68
- }
69
- else {
70
- return foundTote.status;
71
- }
72
- }
73
- async domain(tote) {
74
- return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(tote.domainId);
75
- }
76
- async bizplace(tote) {
77
- return await (0, typeorm_1.getRepository)(biz_base_1.Bizplace).findOne(tote.bizplaceId);
78
- }
79
- async updater(tote) {
80
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(tote.updaterId);
81
- }
82
- async creator(tote) {
83
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(tote.creatorId);
84
- }
85
- };
86
- __decorate([
87
- (0, type_graphql_1.Query)(returns => tote_types_1.ToteList),
88
- __param(0, (0, type_graphql_1.Ctx)()),
89
- __param(1, (0, type_graphql_1.Arg)('filters', type => [shell_1.Filter], { nullable: true })),
90
- __param(2, (0, type_graphql_1.Arg)('pagination', type => shell_1.Pagination, { nullable: true })),
91
- __param(3, (0, type_graphql_1.Arg)('sortings', type => [shell_1.Sorting], { nullable: true })),
92
- __metadata("design:type", Function),
93
- __metadata("design:paramtypes", [Object, Array, typeof (_a = typeof shell_1.Pagination !== "undefined" && shell_1.Pagination) === "function" ? _a : Object, Array]),
94
- __metadata("design:returntype", Promise)
95
- ], ToteQuery.prototype, "totes", null);
96
- __decorate([
97
- (0, type_graphql_1.Query)(returns => tote_1.Tote),
98
- __param(0, (0, type_graphql_1.Arg)('name')),
99
- __param(1, (0, type_graphql_1.Arg)('bizplace')),
100
- __param(2, (0, type_graphql_1.Ctx)()),
101
- __metadata("design:type", Function),
102
- __metadata("design:paramtypes", [String, String, Object]),
103
- __metadata("design:returntype", Promise)
104
- ], ToteQuery.prototype, "tote", null);
105
- __decorate([
106
- (0, type_graphql_1.Query)(returns => String),
107
- __param(0, (0, type_graphql_1.Arg)('name')),
108
- __param(1, (0, type_graphql_1.Arg)('bizplace')),
109
- __param(2, (0, type_graphql_1.Ctx)()),
110
- __metadata("design:type", Function),
111
- __metadata("design:paramtypes", [String, String, Object]),
112
- __metadata("design:returntype", Promise)
113
- ], ToteQuery.prototype, "checkToteStatus", null);
114
- __decorate([
115
- (0, type_graphql_1.FieldResolver)(),
116
- __param(0, (0, type_graphql_1.Root)()),
117
- __metadata("design:type", Function),
118
- __metadata("design:paramtypes", [tote_1.Tote]),
119
- __metadata("design:returntype", Promise)
120
- ], ToteQuery.prototype, "domain", null);
121
- __decorate([
122
- (0, type_graphql_1.FieldResolver)(),
123
- __param(0, (0, type_graphql_1.Root)()),
124
- __metadata("design:type", Function),
125
- __metadata("design:paramtypes", [tote_1.Tote]),
126
- __metadata("design:returntype", Promise)
127
- ], ToteQuery.prototype, "bizplace", null);
128
- __decorate([
129
- (0, type_graphql_1.FieldResolver)(),
130
- __param(0, (0, type_graphql_1.Root)()),
131
- __metadata("design:type", Function),
132
- __metadata("design:paramtypes", [tote_1.Tote]),
133
- __metadata("design:returntype", Promise)
134
- ], ToteQuery.prototype, "updater", null);
135
- __decorate([
136
- (0, type_graphql_1.FieldResolver)(),
137
- __param(0, (0, type_graphql_1.Root)()),
138
- __metadata("design:type", Function),
139
- __metadata("design:paramtypes", [tote_1.Tote]),
140
- __metadata("design:returntype", Promise)
141
- ], ToteQuery.prototype, "creator", null);
142
- ToteQuery = __decorate([
143
- (0, type_graphql_1.Resolver)(tote_1.Tote)
144
- ], ToteQuery);
145
- exports.ToteQuery = ToteQuery;
146
- //# sourceMappingURL=tote-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tote-query.js","sourceRoot":"","sources":["../../../server/service/tote/tote-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6E;AAC7E,qCAA+C;AAE/C,yDAAgD;AAChD,uDAAmD;AACnD,iDAAuF;AAEvF,iCAA6B;AAC7B,6CAAuC;AAGvC,IAAa,SAAS,GAAtB,MAAa,SAAS;IAEpB,KAAK,CAAC,KAAK,CACF,OAAY,EACmC,OAAkB,EACb,UAAuB,EAC1B,QAAoB;QAE5E,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QAEpD,MAAM,aAAa,GAAQ,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,CAAA;QAE5G,MAAM,YAAY,GAAG,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC,kBAAkB,EAAE,CAAA;QAC7D,IAAA,kBAAU,EAAC,YAAY,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;QAEpE,YAAY;aACT,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC;aAC1C,iBAAiB,CAAC,eAAe,EAAE,UAAU,CAAC;aAC9C,iBAAiB,CAAC,cAAc,EAAE,SAAS,CAAC;aAC5C,iBAAiB,CAAC,cAAc,EAAE,SAAS,CAAC;aAC5C,KAAK,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;QAE1D,IAAI,aAAa,EAAE;YACjB,YAAY,CAAC,QAAQ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3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a, _b;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.TotePatch = exports.ToteList = exports.NewTote = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const shell_1 = require("@things-factory/shell");
16
- const tote_1 = require("./tote");
17
- let NewTote = class NewTote {
18
- };
19
- __decorate([
20
- (0, type_graphql_1.Field)(),
21
- __metadata("design:type", String)
22
- ], NewTote.prototype, "name", void 0);
23
- __decorate([
24
- (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
25
- __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
26
- ], NewTote.prototype, "bizplace", void 0);
27
- __decorate([
28
- (0, type_graphql_1.Field)({ nullable: true }),
29
- __metadata("design:type", String)
30
- ], NewTote.prototype, "status", void 0);
31
- NewTote = __decorate([
32
- (0, type_graphql_1.InputType)()
33
- ], NewTote);
34
- exports.NewTote = NewTote;
35
- let ToteList = class ToteList {
36
- };
37
- __decorate([
38
- (0, type_graphql_1.Field)(type => [tote_1.Tote], { nullable: true }),
39
- __metadata("design:type", Array)
40
- ], ToteList.prototype, "items", void 0);
41
- __decorate([
42
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
43
- __metadata("design:type", Number)
44
- ], ToteList.prototype, "total", void 0);
45
- ToteList = __decorate([
46
- (0, type_graphql_1.ObjectType)()
47
- ], ToteList);
48
- exports.ToteList = ToteList;
49
- let TotePatch = class TotePatch {
50
- };
51
- __decorate([
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", String)
54
- ], TotePatch.prototype, "id", void 0);
55
- __decorate([
56
- (0, type_graphql_1.Field)({ nullable: true }),
57
- __metadata("design:type", String)
58
- ], TotePatch.prototype, "name", void 0);
59
- __decorate([
60
- (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
61
- __metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
62
- ], TotePatch.prototype, "bizplace", void 0);
63
- __decorate([
64
- (0, type_graphql_1.Field)({ nullable: true }),
65
- __metadata("design:type", String)
66
- ], TotePatch.prototype, "status", void 0);
67
- __decorate([
68
- (0, type_graphql_1.Field)({ nullable: true }),
69
- __metadata("design:type", String)
70
- ], TotePatch.prototype, "cuFlag", void 0);
71
- TotePatch = __decorate([
72
- (0, type_graphql_1.InputType)()
73
- ], TotePatch);
74
- exports.TotePatch = TotePatch;
75
- //# sourceMappingURL=tote-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tote-types.js","sourceRoot":"","sources":["../../../server/service/tote/tote-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,iCAA6B;AAG7B,IAAa,OAAO,GAApB,MAAa,OAAO;CASnB,CAAA;AAPC;IADC,IAAA,oBAAK,GAAE;;qCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAClC,iBAAS,oBAAT,iBAAS;yCAAA;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACX;AARJ,OAAO;IADnB,IAAA,wBAAS,GAAE;GACC,OAAO,CASnB;AATY,0BAAO;AAYpB,IAAa,QAAQ,GAArB,MAAa,QAAQ;CAMpB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAC5B;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACzB;AALH,QAAQ;IADpB,IAAA,yBAAU,GAAE;GACA,QAAQ,CAMpB;AANY,4BAAQ;AASrB,IAAa,SAAS,GAAtB,MAAa,SAAS;CAerB,CAAA;AAbC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCACf;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAClC,iBAAS,oBAAT,iBAAS;2CAAA;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACX;AAdJ,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CAerB;AAfY,8BAAS"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a, _b, _c, _d;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Tote = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const typeorm_1 = require("typeorm");
16
- const auth_base_1 = require("@things-factory/auth-base");
17
- const biz_base_1 = require("@things-factory/biz-base");
18
- const shell_1 = require("@things-factory/shell");
19
- let Tote = class Tote {
20
- };
21
- __decorate([
22
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
- (0, type_graphql_1.Field)(),
24
- __metadata("design:type", String)
25
- ], Tote.prototype, "id", void 0);
26
- __decorate([
27
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
28
- (0, type_graphql_1.Field)(),
29
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
30
- ], Tote.prototype, "domain", void 0);
31
- __decorate([
32
- (0, typeorm_1.RelationId)((tote) => tote.domain),
33
- __metadata("design:type", String)
34
- ], Tote.prototype, "domainId", void 0);
35
- __decorate([
36
- (0, typeorm_1.Column)(),
37
- (0, type_graphql_1.Field)(),
38
- __metadata("design:type", String)
39
- ], Tote.prototype, "name", void 0);
40
- __decorate([
41
- (0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
42
- (0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
43
- (0, type_graphql_1.Field)(type => biz_base_1.Bizplace),
44
- __metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
45
- ], Tote.prototype, "bizplace", void 0);
46
- __decorate([
47
- (0, typeorm_1.RelationId)((tote) => tote.bizplace),
48
- __metadata("design:type", String)
49
- ], Tote.prototype, "bizplaceId", void 0);
50
- __decorate([
51
- (0, typeorm_1.Column)(),
52
- (0, type_graphql_1.Field)(),
53
- __metadata("design:type", String)
54
- ], Tote.prototype, "status", void 0);
55
- __decorate([
56
- (0, typeorm_1.CreateDateColumn)(),
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- __metadata("design:type", Date)
59
- ], Tote.prototype, "createdAt", void 0);
60
- __decorate([
61
- (0, typeorm_1.UpdateDateColumn)(),
62
- (0, type_graphql_1.Field)({ nullable: true }),
63
- __metadata("design:type", Date)
64
- ], Tote.prototype, "updatedAt", void 0);
65
- __decorate([
66
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
67
- nullable: true
68
- }),
69
- (0, type_graphql_1.Field)({ nullable: true }),
70
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
71
- ], Tote.prototype, "creator", void 0);
72
- __decorate([
73
- (0, typeorm_1.RelationId)((tote) => tote.creator),
74
- __metadata("design:type", String)
75
- ], Tote.prototype, "creatorId", void 0);
76
- __decorate([
77
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
78
- nullable: true
79
- }),
80
- (0, type_graphql_1.Field)({ nullable: true }),
81
- __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
82
- ], Tote.prototype, "updater", void 0);
83
- __decorate([
84
- (0, typeorm_1.RelationId)((tote) => tote.updater),
85
- __metadata("design:type", String)
86
- ], Tote.prototype, "updaterId", void 0);
87
- __decorate([
88
- (0, typeorm_1.Column)({ nullable: true }),
89
- (0, type_graphql_1.Field)({ nullable: true }),
90
- __metadata("design:type", Date)
91
- ], Tote.prototype, "deletedAt", void 0);
92
- Tote = __decorate([
93
- (0, typeorm_1.Entity)(),
94
- (0, typeorm_1.Index)('ix_tote_0', (tote) => [tote.bizplace, tote.name], { unique: true }),
95
- (0, type_graphql_1.ObjectType)()
96
- ], Tote);
97
- exports.Tote = Tote;
98
- //# sourceMappingURL=tote.js.map