@things-factory/sales-base 4.3.239 → 4.3.244

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 (61) hide show
  1. package/dist-server/constants/order.js +2 -1
  2. package/dist-server/constants/order.js.map +1 -1
  3. package/dist-server/controllers/ecommerce/index.js +1 -0
  4. package/dist-server/controllers/ecommerce/index.js.map +1 -1
  5. package/dist-server/controllers/ecommerce/powrup-controller.js +211 -0
  6. package/dist-server/controllers/ecommerce/powrup-controller.js.map +1 -0
  7. package/dist-server/index.js +1 -0
  8. package/dist-server/index.js.map +1 -1
  9. package/dist-server/service/delivery-order/delivery-order-query.js +2 -2
  10. package/dist-server/service/delivery-order/delivery-order-query.js.map +1 -1
  11. package/dist-server/service/index.js +4 -0
  12. package/dist-server/service/index.js.map +1 -1
  13. package/dist-server/service/order-inventory/order-inventory-query.js +2 -1
  14. package/dist-server/service/order-inventory/order-inventory-query.js.map +1 -1
  15. package/dist-server/service/order-vas/order-vas-mutation.js +85 -0
  16. package/dist-server/service/order-vas/order-vas-mutation.js.map +1 -1
  17. package/dist-server/service/order-vas/order-vas-query.js +4 -1
  18. package/dist-server/service/order-vas/order-vas-query.js.map +1 -1
  19. package/dist-server/service/order-vas/order-vas-types.js +54 -10
  20. package/dist-server/service/order-vas/order-vas-types.js.map +1 -1
  21. package/dist-server/service/order-vas/order-vas.js +103 -21
  22. package/dist-server/service/order-vas/order-vas.js.map +1 -1
  23. package/dist-server/service/order-vas-item/index.js +9 -0
  24. package/dist-server/service/order-vas-item/index.js.map +1 -0
  25. package/dist-server/service/order-vas-item/order-vas-item-mutation.js +120 -0
  26. package/dist-server/service/order-vas-item/order-vas-item-mutation.js.map +1 -0
  27. package/dist-server/service/order-vas-item/order-vas-item-query.js +99 -0
  28. package/dist-server/service/order-vas-item/order-vas-item-query.js.map +1 -0
  29. package/dist-server/service/order-vas-item/order-vas-item-type.js +111 -0
  30. package/dist-server/service/order-vas-item/order-vas-item-type.js.map +1 -0
  31. package/dist-server/service/order-vas-item/order-vas-item.js +146 -0
  32. package/dist-server/service/order-vas-item/order-vas-item.js.map +1 -0
  33. package/dist-server/service/release-good/release-good-mutation.js +28 -25
  34. package/dist-server/service/release-good/release-good-mutation.js.map +1 -1
  35. package/dist-server/service/release-good/release-good-query.js +6 -1
  36. package/dist-server/service/release-good/release-good-query.js.map +1 -1
  37. package/dist-server/service/vas/vas.js +8 -6
  38. package/dist-server/service/vas/vas.js.map +1 -1
  39. package/dist-server/service/vas-order/vas-order-mutation.js +2 -2
  40. package/dist-server/service/vas-order/vas-order-mutation.js.map +1 -1
  41. package/package.json +4 -3
  42. package/server/constants/order.ts +2 -1
  43. package/server/controllers/ecommerce/index.ts +1 -0
  44. package/server/controllers/ecommerce/powrup-controller.ts +301 -0
  45. package/server/index.ts +1 -0
  46. package/server/service/delivery-order/delivery-order-query.ts +19 -19
  47. package/server/service/index.ts +4 -0
  48. package/server/service/order-inventory/order-inventory-query.ts +2 -1
  49. package/server/service/order-vas/order-vas-mutation.ts +94 -1
  50. package/server/service/order-vas/order-vas-query.ts +4 -1
  51. package/server/service/order-vas/order-vas-types.ts +34 -1
  52. package/server/service/order-vas/order-vas.ts +89 -10
  53. package/server/service/order-vas-item/index.ts +6 -0
  54. package/server/service/order-vas-item/order-vas-item-mutation.ts +112 -0
  55. package/server/service/order-vas-item/order-vas-item-query.ts +58 -0
  56. package/server/service/order-vas-item/order-vas-item-type.ts +71 -0
  57. package/server/service/order-vas-item/order-vas-item.ts +128 -0
  58. package/server/service/release-good/release-good-mutation.ts +30 -26
  59. package/server/service/release-good/release-good-query.ts +56 -87
  60. package/server/service/vas/vas.ts +11 -5
  61. package/server/service/vas-order/vas-order-mutation.ts +2 -2
@@ -0,0 +1,120 @@
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.OrderVasItemMutation = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const order_vas_item_1 = require("./order-vas-item");
19
+ const order_vas_item_type_1 = require("./order-vas-item-type");
20
+ let OrderVasItemMutation = class OrderVasItemMutation {
21
+ async createOrderVasItem(orderVasItem, context) {
22
+ const { domain, user, tx } = context.state;
23
+ return await tx.getRepository(order_vas_item_1.OrderVasItem).save(Object.assign(Object.assign({}, orderVasItem), { domain, creator: user, updater: user }));
24
+ }
25
+ async updateOrderVasItem(id, patch, context) {
26
+ const { domain, user, tx } = context.state;
27
+ const repository = tx.getRepository(order_vas_item_1.OrderVasItem);
28
+ const orderVasItem = await repository.findOne({
29
+ where: { domain, id }
30
+ });
31
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, orderVasItem), patch), { updater: user }));
32
+ }
33
+ async updateMultipleOrderVasItem(patches, context) {
34
+ const { domain, user, tx } = context.state;
35
+ let results = [];
36
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
37
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
38
+ const orderVasItemRepo = tx.getRepository(order_vas_item_1.OrderVasItem);
39
+ if (_createRecords.length > 0) {
40
+ for (let i = 0; i < _createRecords.length; i++) {
41
+ const newRecord = _createRecords[i];
42
+ const result = await orderVasItemRepo.save(Object.assign(Object.assign({}, newRecord), { executedAt: null, domain, creator: user, updater: user }));
43
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
44
+ }
45
+ }
46
+ if (_updateRecords.length > 0) {
47
+ for (let i = 0; i < _updateRecords.length; i++) {
48
+ const newRecord = _updateRecords[i];
49
+ const orderVasItem = await orderVasItemRepo.findOne(newRecord.id);
50
+ const result = await orderVasItemRepo.save(Object.assign(Object.assign(Object.assign({}, orderVasItem), newRecord), { updater: user }));
51
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
52
+ }
53
+ }
54
+ return results;
55
+ }
56
+ async deleteOrderVasItem(id, context) {
57
+ const { domain, tx } = context.state;
58
+ await tx.getRepository(order_vas_item_1.OrderVasItem).delete({ domain, id });
59
+ return true;
60
+ }
61
+ async deleteOrderVasItems(ids, context) {
62
+ const { domain, tx } = context.state;
63
+ await tx.getRepository(order_vas_item_1.OrderVasItem).delete({
64
+ domain,
65
+ id: (0, typeorm_1.In)(ids)
66
+ });
67
+ return true;
68
+ }
69
+ };
70
+ __decorate([
71
+ (0, type_graphql_1.Directive)('@transaction'),
72
+ (0, type_graphql_1.Mutation)(returns => order_vas_item_1.OrderVasItem, { description: 'To create new OrderVasItem' }),
73
+ __param(0, (0, type_graphql_1.Arg)('orderVasItem')),
74
+ __param(1, (0, type_graphql_1.Ctx)()),
75
+ __metadata("design:type", Function),
76
+ __metadata("design:paramtypes", [order_vas_item_type_1.NewOrderVasItem, Object]),
77
+ __metadata("design:returntype", Promise)
78
+ ], OrderVasItemMutation.prototype, "createOrderVasItem", null);
79
+ __decorate([
80
+ (0, type_graphql_1.Directive)('@transaction'),
81
+ (0, type_graphql_1.Mutation)(returns => order_vas_item_1.OrderVasItem, { description: 'To modify OrderVasItem information' }),
82
+ __param(0, (0, type_graphql_1.Arg)('id')),
83
+ __param(1, (0, type_graphql_1.Arg)('patch')),
84
+ __param(2, (0, type_graphql_1.Ctx)()),
85
+ __metadata("design:type", Function),
86
+ __metadata("design:paramtypes", [String, order_vas_item_type_1.OrderVasItemPatch, Object]),
87
+ __metadata("design:returntype", Promise)
88
+ ], OrderVasItemMutation.prototype, "updateOrderVasItem", null);
89
+ __decorate([
90
+ (0, type_graphql_1.Directive)('@transaction'),
91
+ (0, type_graphql_1.Mutation)(returns => [order_vas_item_1.OrderVasItem], { description: "To modify multiple OrderVasItems' information" }),
92
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [order_vas_item_type_1.OrderVasItemPatch])),
93
+ __param(1, (0, type_graphql_1.Ctx)()),
94
+ __metadata("design:type", Function),
95
+ __metadata("design:paramtypes", [Array, Object]),
96
+ __metadata("design:returntype", Promise)
97
+ ], OrderVasItemMutation.prototype, "updateMultipleOrderVasItem", null);
98
+ __decorate([
99
+ (0, type_graphql_1.Directive)('@transaction'),
100
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete OrderVasItem' }),
101
+ __param(0, (0, type_graphql_1.Arg)('id')),
102
+ __param(1, (0, type_graphql_1.Ctx)()),
103
+ __metadata("design:type", Function),
104
+ __metadata("design:paramtypes", [String, Object]),
105
+ __metadata("design:returntype", Promise)
106
+ ], OrderVasItemMutation.prototype, "deleteOrderVasItem", null);
107
+ __decorate([
108
+ (0, type_graphql_1.Directive)('@transaction'),
109
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple orderVasItems' }),
110
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
111
+ __param(1, (0, type_graphql_1.Ctx)()),
112
+ __metadata("design:type", Function),
113
+ __metadata("design:paramtypes", [Array, Object]),
114
+ __metadata("design:returntype", Promise)
115
+ ], OrderVasItemMutation.prototype, "deleteOrderVasItems", null);
116
+ OrderVasItemMutation = __decorate([
117
+ (0, type_graphql_1.Resolver)(order_vas_item_1.OrderVasItem)
118
+ ], OrderVasItemMutation);
119
+ exports.OrderVasItemMutation = OrderVasItemMutation;
120
+ //# sourceMappingURL=order-vas-item-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-vas-item-mutation.js","sourceRoot":"","sources":["../../../server/service/order-vas-item/order-vas-item-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAC3C,qDAA+C;AAC/C,+DAA0E;AAGnE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAGzB,AAAN,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,6BAAY,CAAC,CAAC,IAAI,iCAC3C,YAAY,KACf,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,6BAAY,CAAC,CAAA;QACjD,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,YAAY,GACZ,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,0BAA0B,CACe,OAA4B,EAClE,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,C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A,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,6BAAY,CAAC,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;IAEnG,WAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,uCAAiB,CAAC,CAAC,CAAA;IAC3C,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;sEAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC9C,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;8DAKrD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAS5E;AAxGU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,6BAAY,CAAC;GACV,oBAAoB,CAyGhC;AAzGY,oDAAoB"}
@@ -0,0 +1,99 @@
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.OrderVasItemQuery = void 0;
17
+ const type_graphql_1 = require("type-graphql");
18
+ const typeorm_1 = require("typeorm");
19
+ const shell_1 = require("@things-factory/shell");
20
+ const auth_base_1 = require("@things-factory/auth-base");
21
+ const order_vas_item_1 = require("./order-vas-item");
22
+ const order_vas_item_type_1 = require("./order-vas-item-type");
23
+ let OrderVasItemQuery = class OrderVasItemQuery {
24
+ async orderVasItem(id, context) {
25
+ const { domain } = context.state;
26
+ return await (0, typeorm_1.getRepository)(order_vas_item_1.OrderVasItem).findOne({
27
+ where: { domain, id }
28
+ });
29
+ }
30
+ async orderVasItems(params, context) {
31
+ const { domain } = context.state;
32
+ const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
33
+ const [items, total] = await (0, typeorm_1.getRepository)(order_vas_item_1.OrderVasItem).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: [
34
+ 'domain',
35
+ 'bizplace',
36
+ 'orderVas',
37
+ 'vas',
38
+ 'product',
39
+ 'productDetail',
40
+ 'newProduct',
41
+ 'newProductDetail',
42
+ 'orderInventory',
43
+ 'creator',
44
+ 'updater'
45
+ ] }));
46
+ return { items, total };
47
+ }
48
+ async domain(orderVasItem) {
49
+ return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(orderVasItem.domainId);
50
+ }
51
+ async updater(orderVasItem) {
52
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(orderVasItem.updaterId);
53
+ }
54
+ async creator(orderVasItem) {
55
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(orderVasItem.creatorId);
56
+ }
57
+ };
58
+ __decorate([
59
+ (0, type_graphql_1.Query)(returns => order_vas_item_1.OrderVasItem, { description: 'To fetch a OrderVasItem' }),
60
+ __param(0, (0, type_graphql_1.Arg)('id')),
61
+ __param(1, (0, type_graphql_1.Ctx)()),
62
+ __metadata("design:type", Function),
63
+ __metadata("design:paramtypes", [String, Object]),
64
+ __metadata("design:returntype", Promise)
65
+ ], OrderVasItemQuery.prototype, "orderVasItem", null);
66
+ __decorate([
67
+ (0, type_graphql_1.Query)(returns => order_vas_item_type_1.OrderVasItemList, { description: 'To fetch multiple OrderVasItems' }),
68
+ __param(0, (0, type_graphql_1.Args)()),
69
+ __param(1, (0, type_graphql_1.Ctx)()),
70
+ __metadata("design:type", Function),
71
+ __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
72
+ __metadata("design:returntype", Promise)
73
+ ], OrderVasItemQuery.prototype, "orderVasItems", null);
74
+ __decorate([
75
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
76
+ __param(0, (0, type_graphql_1.Root)()),
77
+ __metadata("design:type", Function),
78
+ __metadata("design:paramtypes", [order_vas_item_1.OrderVasItem]),
79
+ __metadata("design:returntype", Promise)
80
+ ], OrderVasItemQuery.prototype, "domain", null);
81
+ __decorate([
82
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
83
+ __param(0, (0, type_graphql_1.Root)()),
84
+ __metadata("design:type", Function),
85
+ __metadata("design:paramtypes", [order_vas_item_1.OrderVasItem]),
86
+ __metadata("design:returntype", Promise)
87
+ ], OrderVasItemQuery.prototype, "updater", null);
88
+ __decorate([
89
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
90
+ __param(0, (0, type_graphql_1.Root)()),
91
+ __metadata("design:type", Function),
92
+ __metadata("design:paramtypes", [order_vas_item_1.OrderVasItem]),
93
+ __metadata("design:returntype", Promise)
94
+ ], OrderVasItemQuery.prototype, "creator", null);
95
+ OrderVasItemQuery = __decorate([
96
+ (0, type_graphql_1.Resolver)(order_vas_item_1.OrderVasItem)
97
+ ], OrderVasItemQuery);
98
+ exports.OrderVasItemQuery = OrderVasItemQuery;
99
+ //# sourceMappingURL=order-vas-item-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-vas-item-query.js","sourceRoot":"","sources":["../../../server/service/order-vas-item/order-vas-item-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AACvC,iDAA4E;AAC5E,yDAAgD;AAChD,qDAA+C;AAC/C,+DAAwD;AAGjD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAY;QAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,6BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,aAAa,CAAS,MAAiB,EAAS,OAAY;QAChE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,6BAAY,CAAC,CAAC,YAAY,iCAChE,eAAe,KAClB,SAAS,EAAE;gBACT,QAAQ;gBACR,UAAU;gBACV,UAAU;gBACV,KAAK;gBACL,SAAS;gBACT,eAAe;gBACf,YAAY;gBACZ,kBAAkB;gBAClB,gBAAgB;gBAChB,SAAS;gBACT,SAAS;aACV,IACD,CAAA;QAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CA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C,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAe,6BAAY;;gDAE/C;AAhDU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,6BAAY,CAAC;GACV,iBAAiB,CAiD7B;AAjDY,8CAAiB"}
@@ -0,0 +1,111 @@
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;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.OrderVasItemList = exports.OrderVasItemPatch = exports.NewOrderVasItem = void 0;
14
+ const type_graphql_1 = require("type-graphql");
15
+ const order_vas_item_1 = require("./order-vas-item");
16
+ const shell_1 = require("@things-factory/shell");
17
+ let NewOrderVasItem = class NewOrderVasItem {
18
+ };
19
+ __decorate([
20
+ (0, type_graphql_1.Field)(),
21
+ __metadata("design:type", String)
22
+ ], NewOrderVasItem.prototype, "name", void 0);
23
+ __decorate([
24
+ (0, type_graphql_1.Field)({ nullable: true }),
25
+ __metadata("design:type", String)
26
+ ], NewOrderVasItem.prototype, "description", void 0);
27
+ __decorate([
28
+ (0, type_graphql_1.Field)(type => order_vas_item_1.OrderVasItemStatus, { nullable: true }),
29
+ __metadata("design:type", String)
30
+ ], NewOrderVasItem.prototype, "state", void 0);
31
+ __decorate([
32
+ (0, type_graphql_1.Field)({ nullable: true }),
33
+ __metadata("design:type", Boolean)
34
+ ], NewOrderVasItem.prototype, "active", void 0);
35
+ __decorate([
36
+ (0, type_graphql_1.Field)({ nullable: true }),
37
+ __metadata("design:type", String)
38
+ ], NewOrderVasItem.prototype, "params", void 0);
39
+ NewOrderVasItem = __decorate([
40
+ (0, type_graphql_1.InputType)()
41
+ ], NewOrderVasItem);
42
+ exports.NewOrderVasItem = NewOrderVasItem;
43
+ let OrderVasItemPatch = class OrderVasItemPatch {
44
+ };
45
+ __decorate([
46
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
47
+ __metadata("design:type", String)
48
+ ], OrderVasItemPatch.prototype, "id", void 0);
49
+ __decorate([
50
+ (0, type_graphql_1.Field)({ nullable: true }),
51
+ __metadata("design:type", String)
52
+ ], OrderVasItemPatch.prototype, "name", void 0);
53
+ __decorate([
54
+ (0, type_graphql_1.Field)({ nullable: true }),
55
+ __metadata("design:type", String)
56
+ ], OrderVasItemPatch.prototype, "description", void 0);
57
+ __decorate([
58
+ (0, type_graphql_1.Field)({ nullable: true }),
59
+ __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
60
+ ], OrderVasItemPatch.prototype, "orderVas", void 0);
61
+ __decorate([
62
+ (0, type_graphql_1.Field)({ nullable: true }),
63
+ __metadata("design:type", String)
64
+ ], OrderVasItemPatch.prototype, "orderVasId", void 0);
65
+ __decorate([
66
+ (0, type_graphql_1.Field)({ nullable: true }),
67
+ __metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
68
+ ], OrderVasItemPatch.prototype, "vas", void 0);
69
+ __decorate([
70
+ (0, type_graphql_1.Field)({ nullable: true }),
71
+ __metadata("design:type", String)
72
+ ], OrderVasItemPatch.prototype, "vasId", void 0);
73
+ __decorate([
74
+ (0, type_graphql_1.Field)({ nullable: true }),
75
+ __metadata("design:type", Number)
76
+ ], OrderVasItemPatch.prototype, "vasQty", void 0);
77
+ __decorate([
78
+ (0, type_graphql_1.Field)({ nullable: true }),
79
+ __metadata("design:type", Date)
80
+ ], OrderVasItemPatch.prototype, "executedAt", void 0);
81
+ __decorate([
82
+ (0, type_graphql_1.Field)(type => order_vas_item_1.OrderVasItemStatus, { nullable: true }),
83
+ __metadata("design:type", String)
84
+ ], OrderVasItemPatch.prototype, "state", void 0);
85
+ __decorate([
86
+ (0, type_graphql_1.Field)({ nullable: true }),
87
+ __metadata("design:type", Boolean)
88
+ ], OrderVasItemPatch.prototype, "active", void 0);
89
+ __decorate([
90
+ (0, type_graphql_1.Field)(),
91
+ __metadata("design:type", String)
92
+ ], OrderVasItemPatch.prototype, "cuFlag", void 0);
93
+ OrderVasItemPatch = __decorate([
94
+ (0, type_graphql_1.InputType)()
95
+ ], OrderVasItemPatch);
96
+ exports.OrderVasItemPatch = OrderVasItemPatch;
97
+ let OrderVasItemList = class OrderVasItemList {
98
+ };
99
+ __decorate([
100
+ (0, type_graphql_1.Field)(type => [order_vas_item_1.OrderVasItem]),
101
+ __metadata("design:type", Array)
102
+ ], OrderVasItemList.prototype, "items", void 0);
103
+ __decorate([
104
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
105
+ __metadata("design:type", Number)
106
+ ], OrderVasItemList.prototype, "total", void 0);
107
+ OrderVasItemList = __decorate([
108
+ (0, type_graphql_1.ObjectType)()
109
+ ], OrderVasItemList);
110
+ exports.OrderVasItemList = OrderVasItemList;
111
+ //# sourceMappingURL=order-vas-item-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-vas-item-type.js","sourceRoot":"","sources":["../../../server/service/order-vas-item/order-vas-item-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAsF;AAEtF,qDAAmE;AAEnE,iDAAiD;AAG1C,IAAM,eAAe,GAArB,MAAM,eAAe;CAe3B,CAAA;AAdC;IAAC,IAAA,oBAAK,GAAE;;6CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC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AAI;qDAAA;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mCAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC5B;AAE1B;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACV;AAEhB;IAAC,IAAA,oBAAK,GAAE;;iDACM;AAnCH,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAoC7B;AApCY,8CAAiB;AAuCvB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,6BAAY,CAAC,CAAC;;+CACT;AAErB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;AALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B;AANY,4CAAgB"}
@@ -0,0 +1,146 @@
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;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.OrderVasItem = exports.OrderVasItemStatus = void 0;
14
+ const typeorm_1 = require("typeorm");
15
+ const type_graphql_1 = require("type-graphql");
16
+ const shell_1 = require("@things-factory/shell");
17
+ const auth_base_1 = require("@things-factory/auth-base");
18
+ var OrderVasItemStatus;
19
+ (function (OrderVasItemStatus) {
20
+ OrderVasItemStatus["STATUS_A"] = "STATUS_A";
21
+ OrderVasItemStatus["STATUS_B"] = "STATUS_B";
22
+ })(OrderVasItemStatus = exports.OrderVasItemStatus || (exports.OrderVasItemStatus = {}));
23
+ const order_vas_1 = require("../order-vas/order-vas");
24
+ const vas_1 = require("../vas/vas");
25
+ (0, type_graphql_1.registerEnumType)(OrderVasItemStatus, {
26
+ name: 'OrderVasItemStatus',
27
+ description: 'state enumeration of a orderVasItem'
28
+ });
29
+ let OrderVasItem = class OrderVasItem {
30
+ };
31
+ __decorate([
32
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
33
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
34
+ __metadata("design:type", String)
35
+ ], OrderVasItem.prototype, "id", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
38
+ (0, type_graphql_1.Field)({ nullable: true }),
39
+ __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
40
+ ], OrderVasItem.prototype, "domain", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.RelationId)((orderVasItem) => orderVasItem.domain),
43
+ __metadata("design:type", String)
44
+ ], OrderVasItem.prototype, "domainId", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)(),
47
+ (0, type_graphql_1.Field)(),
48
+ __metadata("design:type", String)
49
+ ], OrderVasItem.prototype, "name", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({
52
+ nullable: true
53
+ }),
54
+ (0, type_graphql_1.Field)({ nullable: true }),
55
+ __metadata("design:type", String)
56
+ ], OrderVasItem.prototype, "description", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.ManyToOne)(type => vas_1.Vas),
59
+ (0, type_graphql_1.Field)(type => vas_1.Vas, { nullable: true }),
60
+ __metadata("design:type", vas_1.Vas)
61
+ ], OrderVasItem.prototype, "vas", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.RelationId)((orderVasItem) => orderVasItem.vas),
64
+ __metadata("design:type", String)
65
+ ], OrderVasItem.prototype, "vasId", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.Column)({ nullable: true }),
68
+ (0, type_graphql_1.Field)({ nullable: true }),
69
+ __metadata("design:type", Number)
70
+ ], OrderVasItem.prototype, "vasQty", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.ManyToOne)(type => order_vas_1.OrderVas),
73
+ (0, type_graphql_1.Field)(type => order_vas_1.OrderVas, { nullable: true }),
74
+ __metadata("design:type", order_vas_1.OrderVas)
75
+ ], OrderVasItem.prototype, "orderVas", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.RelationId)((orderVasItem) => orderVasItem.orderVas),
78
+ __metadata("design:type", String)
79
+ ], OrderVasItem.prototype, "orderVasId", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({
82
+ nullable: true
83
+ }),
84
+ (0, type_graphql_1.Field)({ nullable: true }),
85
+ __metadata("design:type", Boolean)
86
+ ], OrderVasItem.prototype, "active", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.Column)({
89
+ nullable: true
90
+ }),
91
+ (0, type_graphql_1.Field)({ nullable: true }),
92
+ __metadata("design:type", String)
93
+ ], OrderVasItem.prototype, "state", void 0);
94
+ __decorate([
95
+ (0, typeorm_1.Column)({
96
+ nullable: true
97
+ }),
98
+ (0, type_graphql_1.Field)({ nullable: true }),
99
+ __metadata("design:type", String)
100
+ ], OrderVasItem.prototype, "params", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.Column)({ nullable: true }),
103
+ (0, type_graphql_1.Field)({ nullable: true }),
104
+ __metadata("design:type", Date)
105
+ ], OrderVasItem.prototype, "executedAt", void 0);
106
+ __decorate([
107
+ (0, typeorm_1.CreateDateColumn)(),
108
+ (0, type_graphql_1.Field)({ nullable: true }),
109
+ __metadata("design:type", Date)
110
+ ], OrderVasItem.prototype, "createdAt", void 0);
111
+ __decorate([
112
+ (0, typeorm_1.UpdateDateColumn)(),
113
+ (0, type_graphql_1.Field)({ nullable: true }),
114
+ __metadata("design:type", Date)
115
+ ], OrderVasItem.prototype, "updatedAt", void 0);
116
+ __decorate([
117
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
118
+ nullable: true
119
+ }),
120
+ (0, type_graphql_1.Field)({ nullable: true }),
121
+ __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
122
+ ], OrderVasItem.prototype, "creator", void 0);
123
+ __decorate([
124
+ (0, typeorm_1.RelationId)((orderVasItem) => orderVasItem.creator),
125
+ __metadata("design:type", String)
126
+ ], OrderVasItem.prototype, "creatorId", void 0);
127
+ __decorate([
128
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
129
+ nullable: true
130
+ }),
131
+ (0, type_graphql_1.Field)({ nullable: true }),
132
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
133
+ ], OrderVasItem.prototype, "updater", void 0);
134
+ __decorate([
135
+ (0, typeorm_1.RelationId)((orderVasItem) => orderVasItem.creator),
136
+ __metadata("design:type", String)
137
+ ], OrderVasItem.prototype, "updaterId", void 0);
138
+ OrderVasItem = __decorate([
139
+ (0, typeorm_1.Entity)(),
140
+ (0, typeorm_1.Index)('ix_order_vas_item_0', (orderVasItem) => [orderVasItem.domain, orderVasItem.orderVas, orderVasItem.vas], {
141
+ unique: true
142
+ }),
143
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for OrderVasItem' })
144
+ ], OrderVasItem);
145
+ exports.OrderVasItem = OrderVasItem;
146
+ //# sourceMappingURL=order-vas-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-vas-item.js","sourceRoot":"","sources":["../../../server/service/order-vas-item/order-vas-item.ts"],"names":[],"mappings":";;;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AAE,CAAC;8BACd,IAAI;+CAAA;AAEhB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;6CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC;;+CAC/C;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;6CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC;;+CAC/C;AAtFP,YAAY;IATxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,qBAAqB,EACrB,CAAC,YAA0B,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,EAC9F;QACE,MAAM,EAAE,IAAI;KACb,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;GAC1C,YAAY,CAuFxB;AAvFY,oCAAY"}
@@ -44,6 +44,7 @@ const shipping_order_types_1 = require("../shipping-order/shipping-order-types")
44
44
  const vas_1 = require("../vas/vas");
45
45
  const release_good_1 = require("./release-good");
46
46
  const release_good_query_1 = require("./release-good-query");
47
+ const order_vas_item_1 = require("../order-vas-item/order-vas-item");
47
48
  let ReleaseGoodMutation = class ReleaseGoodMutation {
48
49
  async bulkAddReleaseGoods(context, rawReleaseGoods, bizplaceId) {
49
50
  const { domain, user, tx } = context.state;
@@ -361,6 +362,7 @@ async function deleteReleaseGood(tx, name, user, domain) {
361
362
  // 2. delete order vass
362
363
  const vasIds = foundOVs.map((vas) => vas.id);
363
364
  if (vasIds.length) {
365
+ await tx.getRepository(order_vas_item_1.OrderVasItem).delete({ orderVas: (0, typeorm_1.In)(vasIds) });
364
366
  await tx.getRepository(order_vas_1.OrderVas).delete({ id: (0, typeorm_1.In)(vasIds) });
365
367
  }
366
368
  if (foundAttachment) {
@@ -599,6 +601,7 @@ async function generateReleaseGoodFunction(_, releaseGood, shippingOrder, shippi
599
601
  updater: user
600
602
  });
601
603
  }
604
+ // VAS
602
605
  if (orderVass === null || orderVass === void 0 ? void 0 : orderVass.length) {
603
606
  orderVass = await Promise.all(orderVass.map(async (orderVas) => {
604
607
  var _a, _b;
@@ -681,17 +684,17 @@ async function confirmReleaseGood(name, context, tx) {
681
684
  await sellercraftCtrl.updateSellercraftStock(sellercraft, foundOPs, 'CONFIRM_ORDER');
682
685
  }
683
686
  };
684
- // const customerBizplaceId: string = foundReleaseGood.bizplace.id
685
- // const companyBizplace: Bizplace = await getCompanyBizplace(domain, null, customerBizplaceId, tx)
686
- // const powrup: Powrup = await tx
687
- // .getRepository(Application)
688
- // .findOne({ domain: companyBizplace.domain, status: 'ACTIVE' })
689
- // let updatePowrupStock = async powrup => {
690
- // if (powrup) {
691
- // const powrupController: PowrupController = new PowrupController(tx, domain, user)
692
- // await powrupController.updateStock(powrup, foundOPs)
693
- // }
694
- // }
687
+ const customerBizplaceId = foundReleaseGood.bizplace.id;
688
+ const companyBizplace = await (0, biz_base_1.getCompanyBizplace)(domain, null, customerBizplaceId, tx);
689
+ const application = await tx
690
+ .getRepository(auth_base_1.Application)
691
+ .findOne({ domain: companyBizplace.domain, status: 'ACTIVE', type: auth_base_1.ApplicationType.POWRUP });
692
+ let updatePowrupStock = async (powrup) => {
693
+ if (application) {
694
+ const powrupController = new controllers_1.PowrupController();
695
+ await powrupController.updateStock(foundOPs, domain, user, tx);
696
+ }
697
+ };
695
698
  const orderSource = foundReleaseGood.source;
696
699
  switch (orderSource) {
697
700
  case auth_base_1.ApplicationType.MMS:
@@ -764,9 +767,9 @@ async function confirmReleaseGood(name, context, tx) {
764
767
  }
765
768
  updateSCStock(sellercraft);
766
769
  break;
767
- // case ApplicationType.POWRUP:
768
- // updatePowrupStock(powrup)
769
- // break
770
+ case auth_base_1.ApplicationType.POWRUP:
771
+ updatePowrupStock(application);
772
+ break;
770
773
  default:
771
774
  updateSCStock(sellercraft);
772
775
  break;
@@ -939,17 +942,17 @@ async function rejectReleaseGood(tx, context, name, remark) {
939
942
  await sellercraftCtrl.updateSellercraftStock(sellercraft, foundOPs, 'REJECT_ORDER');
940
943
  }
941
944
  break;
942
- // case ApplicationType.POWRUP:
943
- // const customerBizplaceId: string = releaseGood.bizplace.id
944
- // const companyBizplace: Bizplace = await getCompanyBizplace(domain, null, customerBizplaceId, tx)
945
- // const powrup: Powrup = await tx
946
- // .getRepository(Application)
947
- // .findOne({ domain: companyBizplace.domain, status: 'ACTIVE' })
948
- // if (powrup) {
949
- // const powrupController: PowrupController = new PowrupController(tx, domain, user)
950
- // await powrupController.updateStock(powrup, foundOPs)
951
- // }
952
- // break
945
+ case auth_base_1.ApplicationType.POWRUP:
946
+ const customerBizplaceId = releaseGood.bizplace.id;
947
+ const companyBizplace = await (0, biz_base_1.getCompanyBizplace)(domain, null, customerBizplaceId, tx);
948
+ const application = await tx
949
+ .getRepository(auth_base_1.Application)
950
+ .findOne({ domain: companyBizplace.domain, status: 'ACTIVE', type: auth_base_1.ApplicationType.POWRUP });
951
+ if (application) {
952
+ const powrupController = new controllers_1.PowrupController();
953
+ await powrupController.updateStock(foundOPs, companyBizplace.domain, user, tx);
954
+ }
955
+ break;
953
956
  default:
954
957
  break;
955
958
  }