@things-factory/warehouse-base 5.0.7 → 5.0.14

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 (156) hide show
  1. package/dist-server/constants/index.js +6 -19
  2. package/dist-server/constants/index.js.map +1 -1
  3. package/dist-server/constants/inventory.js.map +1 -1
  4. package/dist-server/constants/location.js.map +1 -1
  5. package/dist-server/constants/pallet.js.map +1 -1
  6. package/dist-server/constants/rule-type.js.map +1 -1
  7. package/dist-server/constants/tote.js.map +1 -1
  8. package/dist-server/controllers/ecommerce/ecommerce-controller.js.map +1 -1
  9. package/dist-server/controllers/ecommerce/index.js +3 -16
  10. package/dist-server/controllers/ecommerce/index.js.map +1 -1
  11. package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -1
  12. package/dist-server/controllers/index.js +3 -16
  13. package/dist-server/controllers/index.js.map +1 -1
  14. package/dist-server/controllers/warehouse-controller.js.map +1 -1
  15. package/dist-server/index.js +6 -19
  16. package/dist-server/index.js.map +1 -1
  17. package/dist-server/middlewares/index.js.map +1 -1
  18. package/dist-server/migrations/index.js.map +1 -1
  19. package/dist-server/service/index.js +28 -41
  20. package/dist-server/service/index.js.map +1 -1
  21. package/dist-server/service/inventory/index.js.map +1 -1
  22. package/dist-server/service/inventory/inventory-mutation.js +50 -61
  23. package/dist-server/service/inventory/inventory-mutation.js.map +1 -1
  24. package/dist-server/service/inventory/inventory-query.js +125 -136
  25. package/dist-server/service/inventory/inventory-query.js.map +1 -1
  26. package/dist-server/service/inventory/inventory-types.js +198 -206
  27. package/dist-server/service/inventory/inventory-types.js.map +1 -1
  28. package/dist-server/service/inventory/inventory.js +133 -141
  29. package/dist-server/service/inventory/inventory.js.map +1 -1
  30. package/dist-server/service/inventory-change/index.js.map +1 -1
  31. package/dist-server/service/inventory-change/inventory-change-mutation.js +51 -62
  32. package/dist-server/service/inventory-change/inventory-change-mutation.js.map +1 -1
  33. package/dist-server/service/inventory-change/inventory-change-query.js +29 -40
  34. package/dist-server/service/inventory-change/inventory-change-query.js.map +1 -1
  35. package/dist-server/service/inventory-change/inventory-change-types.js +20 -28
  36. package/dist-server/service/inventory-change/inventory-change-types.js.map +1 -1
  37. package/dist-server/service/inventory-change/inventory-change.js +68 -76
  38. package/dist-server/service/inventory-change/inventory-change.js.map +1 -1
  39. package/dist-server/service/inventory-history/index.js.map +1 -1
  40. package/dist-server/service/inventory-history/inventory-history-mutation.js +33 -44
  41. package/dist-server/service/inventory-history/inventory-history-mutation.js.map +1 -1
  42. package/dist-server/service/inventory-history/inventory-history-query.js +105 -116
  43. package/dist-server/service/inventory-history/inventory-history-query.js.map +1 -1
  44. package/dist-server/service/inventory-history/inventory-history-types.js +282 -290
  45. package/dist-server/service/inventory-history/inventory-history-types.js.map +1 -1
  46. package/dist-server/service/inventory-history/inventory-history.js +82 -90
  47. package/dist-server/service/inventory-history/inventory-history.js.map +1 -1
  48. package/dist-server/service/inventory-item/index.js.map +1 -1
  49. package/dist-server/service/inventory-item/inventory-item-mutation.js +47 -58
  50. package/dist-server/service/inventory-item/inventory-item-mutation.js.map +1 -1
  51. package/dist-server/service/inventory-item/inventory-item-query.js +41 -52
  52. package/dist-server/service/inventory-item/inventory-item-query.js.map +1 -1
  53. package/dist-server/service/inventory-item/inventory-item-type.js +44 -52
  54. package/dist-server/service/inventory-item/inventory-item-type.js.map +1 -1
  55. package/dist-server/service/inventory-item/inventory-item.js +44 -52
  56. package/dist-server/service/inventory-item/inventory-item.js.map +1 -1
  57. package/dist-server/service/inventory-item-change/index.js.map +1 -1
  58. package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js +33 -44
  59. package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js.map +1 -1
  60. package/dist-server/service/inventory-item-change/inventory-item-change-query.js +29 -40
  61. package/dist-server/service/inventory-item-change/inventory-item-change-query.js.map +1 -1
  62. package/dist-server/service/inventory-item-change/inventory-item-change-type.js +40 -48
  63. package/dist-server/service/inventory-item-change/inventory-item-change-type.js.map +1 -1
  64. package/dist-server/service/inventory-item-change/inventory-item-change.js +34 -42
  65. package/dist-server/service/inventory-item-change/inventory-item-change.js.map +1 -1
  66. package/dist-server/service/inventory-product/index.js.map +1 -1
  67. package/dist-server/service/inventory-product/inventory-product-mutation.js +33 -44
  68. package/dist-server/service/inventory-product/inventory-product-mutation.js.map +1 -1
  69. package/dist-server/service/inventory-product/inventory-product-query.js +29 -40
  70. package/dist-server/service/inventory-product/inventory-product-query.js.map +1 -1
  71. package/dist-server/service/inventory-product/inventory-product-type.js +34 -42
  72. package/dist-server/service/inventory-product/inventory-product-type.js.map +1 -1
  73. package/dist-server/service/inventory-product/inventory-product.js +34 -42
  74. package/dist-server/service/inventory-product/inventory-product.js.map +1 -1
  75. package/dist-server/service/location/index.js.map +1 -1
  76. package/dist-server/service/location/location-mutation.js +39 -50
  77. package/dist-server/service/location/location-mutation.js.map +1 -1
  78. package/dist-server/service/location/location-query.js +65 -76
  79. package/dist-server/service/location/location-query.js.map +1 -1
  80. package/dist-server/service/location/location-types.js +105 -113
  81. package/dist-server/service/location/location-types.js.map +1 -1
  82. package/dist-server/service/location/location.js +41 -49
  83. package/dist-server/service/location/location.js.map +1 -1
  84. package/dist-server/service/movement/index.js.map +1 -1
  85. package/dist-server/service/movement/movement-mutation.js +21 -32
  86. package/dist-server/service/movement/movement-mutation.js.map +1 -1
  87. package/dist-server/service/movement/movement-query.js +51 -65
  88. package/dist-server/service/movement/movement-query.js.map +1 -1
  89. package/dist-server/service/movement/movement-types.js +43 -51
  90. package/dist-server/service/movement/movement-types.js.map +1 -1
  91. package/dist-server/service/movement/movement.js +30 -38
  92. package/dist-server/service/movement/movement.js.map +1 -1
  93. package/dist-server/service/pallet/index.js.map +1 -1
  94. package/dist-server/service/pallet/pallet-mutation.js +39 -50
  95. package/dist-server/service/pallet/pallet-mutation.js.map +1 -1
  96. package/dist-server/service/pallet/pallet-query.js +48 -59
  97. package/dist-server/service/pallet/pallet-query.js.map +1 -1
  98. package/dist-server/service/pallet/pallet-types.js +39 -47
  99. package/dist-server/service/pallet/pallet-types.js.map +1 -1
  100. package/dist-server/service/pallet/pallet.js +34 -42
  101. package/dist-server/service/pallet/pallet.js.map +1 -1
  102. package/dist-server/service/pallet-count/index.js.map +1 -1
  103. package/dist-server/service/pallet-count/pallet-count-mutation.js +39 -50
  104. package/dist-server/service/pallet-count/pallet-count-mutation.js.map +1 -1
  105. package/dist-server/service/pallet-count/pallet-count-query.js +28 -39
  106. package/dist-server/service/pallet-count/pallet-count-query.js.map +1 -1
  107. package/dist-server/service/pallet-count/pallet-count-types.js +20 -28
  108. package/dist-server/service/pallet-count/pallet-count-types.js.map +1 -1
  109. package/dist-server/service/pallet-count/pallet-count.js +26 -34
  110. package/dist-server/service/pallet-count/pallet-count.js.map +1 -1
  111. package/dist-server/service/pallet-history/index.js.map +1 -1
  112. package/dist-server/service/pallet-history/pallet-history-mutation.js +33 -44
  113. package/dist-server/service/pallet-history/pallet-history-mutation.js.map +1 -1
  114. package/dist-server/service/pallet-history/pallet-history-query.js +29 -40
  115. package/dist-server/service/pallet-history/pallet-history-query.js.map +1 -1
  116. package/dist-server/service/pallet-history/pallet-history-types.js +20 -28
  117. package/dist-server/service/pallet-history/pallet-history-types.js.map +1 -1
  118. package/dist-server/service/pallet-history/pallet-history.js +34 -42
  119. package/dist-server/service/pallet-history/pallet-history.js.map +1 -1
  120. package/dist-server/service/reduced-inventory-history/index.js.map +1 -1
  121. package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js +52 -60
  122. package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js.map +1 -1
  123. package/dist-server/service/tote/index.js.map +1 -1
  124. package/dist-server/service/tote/tote-mutation.js +46 -57
  125. package/dist-server/service/tote/tote-mutation.js.map +1 -1
  126. package/dist-server/service/tote/tote-query.js +44 -55
  127. package/dist-server/service/tote/tote-query.js.map +1 -1
  128. package/dist-server/service/tote/tote-types.js +24 -32
  129. package/dist-server/service/tote/tote-types.js.map +1 -1
  130. package/dist-server/service/tote/tote.js +30 -38
  131. package/dist-server/service/tote/tote.js.map +1 -1
  132. package/dist-server/service/warehouse/index.js.map +1 -1
  133. package/dist-server/service/warehouse/warehouse-mutation.js +33 -44
  134. package/dist-server/service/warehouse/warehouse-mutation.js.map +1 -1
  135. package/dist-server/service/warehouse/warehouse-query.js +29 -40
  136. package/dist-server/service/warehouse/warehouse-query.js.map +1 -1
  137. package/dist-server/service/warehouse/warehouse-types.js +28 -36
  138. package/dist-server/service/warehouse/warehouse-types.js.map +1 -1
  139. package/dist-server/service/warehouse/warehouse.js +31 -39
  140. package/dist-server/service/warehouse/warehouse.js.map +1 -1
  141. package/dist-server/tsconfig.tsbuildinfo +1 -0
  142. package/dist-server/utils/datetime-util.js.map +1 -1
  143. package/dist-server/utils/index.js +4 -17
  144. package/dist-server/utils/index.js.map +1 -1
  145. package/dist-server/utils/inventory-no-generator.js.map +1 -1
  146. package/dist-server/utils/inventory-util.js.map +1 -1
  147. package/package.json +8 -8
  148. package/server/service/inventory/inventory-mutation.ts +2 -2
  149. package/server/service/inventory/inventory-query.ts +48 -16
  150. package/server/service/inventory/inventory.ts +6 -5
  151. package/server/service/inventory-change/inventory-change-mutation.ts +1 -1
  152. package/server/service/inventory-change/inventory-change-query.ts +2 -2
  153. package/server/service/inventory-history/inventory-history-query.ts +29 -28
  154. package/server/service/inventory-history/inventory-history.ts +39 -39
  155. package/server/service/inventory-item/inventory-item-mutation.ts +3 -3
  156. package/server/service/movement/movement-query.ts +3 -6
@@ -1,18 +1,7 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.deleteLocations = exports.deleteLocation = exports.updateLocation = exports.createLocation = exports.LocationMutation = void 0;
4
+ const tslib_1 = require("tslib");
16
5
  const type_graphql_1 = require("type-graphql");
17
6
  const location_1 = require("../location/location");
18
7
  const warehouse_1 = require("../warehouse/warehouse");
@@ -57,68 +46,68 @@ let LocationMutation = class LocationMutation {
57
46
  });
58
47
  }
59
48
  };
60
- __decorate([
49
+ tslib_1.__decorate([
61
50
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
62
51
  (0, type_graphql_1.Directive)('@transaction'),
63
52
  (0, type_graphql_1.Mutation)(returns => location_1.Location),
64
- __param(0, (0, type_graphql_1.Arg)('location')),
65
- __param(1, (0, type_graphql_1.Ctx)()),
66
- __metadata("design:type", Function),
67
- __metadata("design:paramtypes", [location_types_1.NewLocation, Object]),
68
- __metadata("design:returntype", Promise)
53
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('location')),
54
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
55
+ tslib_1.__metadata("design:type", Function),
56
+ tslib_1.__metadata("design:paramtypes", [location_types_1.NewLocation, Object]),
57
+ tslib_1.__metadata("design:returntype", Promise)
69
58
  ], LocationMutation.prototype, "createLocation", null);
70
- __decorate([
59
+ tslib_1.__decorate([
71
60
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
72
61
  (0, type_graphql_1.Directive)('@transaction'),
73
62
  (0, type_graphql_1.Mutation)(returns => location_1.Location),
74
- __param(0, (0, type_graphql_1.Arg)('id')),
75
- __param(1, (0, type_graphql_1.Arg)('patch')),
76
- __param(2, (0, type_graphql_1.Ctx)()),
77
- __metadata("design:type", Function),
78
- __metadata("design:paramtypes", [String, location_types_1.LocationPatch, Object]),
79
- __metadata("design:returntype", Promise)
63
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
64
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
65
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
66
+ tslib_1.__metadata("design:type", Function),
67
+ tslib_1.__metadata("design:paramtypes", [String, location_types_1.LocationPatch, Object]),
68
+ tslib_1.__metadata("design:returntype", Promise)
80
69
  ], LocationMutation.prototype, "updateLocation", null);
81
- __decorate([
70
+ tslib_1.__decorate([
82
71
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
83
72
  (0, type_graphql_1.Directive)('@transaction'),
84
73
  (0, type_graphql_1.Mutation)(returns => [location_1.Location]),
85
- __param(0, (0, type_graphql_1.Arg)('patches', type => [location_types_1.LocationPatch])),
86
- __param(1, (0, type_graphql_1.Ctx)()),
87
- __metadata("design:type", Function),
88
- __metadata("design:paramtypes", [Array, Object]),
89
- __metadata("design:returntype", Promise)
74
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [location_types_1.LocationPatch])),
75
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
76
+ tslib_1.__metadata("design:type", Function),
77
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
78
+ tslib_1.__metadata("design:returntype", Promise)
90
79
  ], LocationMutation.prototype, "updateMultipleLocation", null);
91
- __decorate([
80
+ tslib_1.__decorate([
92
81
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
93
82
  (0, type_graphql_1.Directive)('@transaction'),
94
83
  (0, type_graphql_1.Mutation)(returns => Boolean),
95
- __param(0, (0, type_graphql_1.Arg)('id')),
96
- __param(1, (0, type_graphql_1.Ctx)()),
97
- __metadata("design:type", Function),
98
- __metadata("design:paramtypes", [String, Object]),
99
- __metadata("design:returntype", Promise)
84
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
85
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
86
+ tslib_1.__metadata("design:type", Function),
87
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
88
+ tslib_1.__metadata("design:returntype", Promise)
100
89
  ], LocationMutation.prototype, "deleteLocation", null);
101
- __decorate([
90
+ tslib_1.__decorate([
102
91
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
103
92
  (0, type_graphql_1.Directive)('@transaction'),
104
93
  (0, type_graphql_1.Mutation)(returns => Boolean),
105
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
106
- __param(1, (0, type_graphql_1.Ctx)()),
107
- __metadata("design:type", Function),
108
- __metadata("design:paramtypes", [Array, Object]),
109
- __metadata("design:returntype", Promise)
94
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
95
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
96
+ tslib_1.__metadata("design:type", Function),
97
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
98
+ tslib_1.__metadata("design:returntype", Promise)
110
99
  ], LocationMutation.prototype, "deleteLocations", null);
111
- __decorate([
100
+ tslib_1.__decorate([
112
101
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
113
102
  (0, type_graphql_1.Directive)('@transaction'),
114
103
  (0, type_graphql_1.Mutation)(returns => Boolean),
115
- __param(0, (0, type_graphql_1.Arg)('warehouseId')),
116
- __param(1, (0, type_graphql_1.Ctx)()),
117
- __metadata("design:type", Function),
118
- __metadata("design:paramtypes", [String, Object]),
119
- __metadata("design:returntype", Promise)
104
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('warehouseId')),
105
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
106
+ tslib_1.__metadata("design:type", Function),
107
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
108
+ tslib_1.__metadata("design:returntype", Promise)
120
109
  ], LocationMutation.prototype, "deleteAllLocations", null);
121
- LocationMutation = __decorate([
110
+ LocationMutation = tslib_1.__decorate([
122
111
  (0, type_graphql_1.Resolver)(location_1.Location)
123
112
  ], LocationMutation);
124
113
  exports.LocationMutation = LocationMutation;
@@ -1 +1 @@
1
- {"version":3,"file":"location-mutation.js","sourceRoot":"","sources":["../../../server/service/location/location-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AAMtE,mDAA+C;AAC/C,sDAAkD;AAClD,qDAA6D;AAG7D,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAI3B,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAY;QAC9E,OAAO,MAAM,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;IAKD,KAAK,CAAC,cAAc,CACP,EAAU,EACP,KAAoB,EAC3B,OAAY;QAEnB,OAAO,MAAM,cAAc,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC5D,CAAC;IAKD,KAAK,CAAC,sBAAsB,CACe,OAAwB,EAC1D,OAAY;QAEnB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC,CAAA;QAC3E,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QAEzF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,MAAM,KAAK,GAAG,c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;IAC3D,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;IAEnD,MAAM,UAAU,GAAyB,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAA;IACnE,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC3B,OAAO,IAAI,CAAA;AACb,CAAC;AAND,wCAMC;AAEM,KAAK,UAAU,eAAe,CAAC,GAAa,EAAE,OAAY;IAC/D,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;IAEnD,MAAM,UAAU,GAAyB,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAA;IACnE,MAAM,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC;AAND,0CAMC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { EntityManager, Repository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { Location } from '../location/location'\nimport { Warehouse } from '../warehouse/warehouse'\nimport { LocationPatch, NewLocation } from './location-types'\n\n@Resolver(Location)\nexport class LocationMutation {\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Location)\n async createLocation(@Arg('location') location: NewLocation, @Ctx() context: any): Promise<Location> {\n return await createLocation(location, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Location)\n async updateLocation(\n @Arg('id') id: string,\n @Arg('patch') patch: LocationPatch,\n @Ctx() context: any\n ): Promise<Location> {\n return await updateLocation(id, patch, context.state.user)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => [Location])\n async updateMultipleLocation(\n @Arg('patches', type => [LocationPatch]) patches: LocationPatch[],\n @Ctx() context: any\n ): Promise<Location[]> {\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const patch = _createRecords[i]\n const result = await createLocation(patch as NewLocation, context)\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const patch: LocationPatch = _updateRecords[i]\n const result = await updateLocation(patch.id, patch, context)\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteLocation(@Arg('id') id: string, @Ctx() context: any): Promise<Boolean> {\n return await deleteLocation(id, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteLocations(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<Boolean> {\n return await deleteLocations(ids, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteAllLocations(@Arg('warehouseId') warehouseId: string, @Ctx() context: any) {\n const { tx }: { tx: EntityManager } = context.state\n\n await tx.getRepository(Location).delete({\n warehouse: await tx.getRepository(Warehouse).findOne(warehouseId)\n })\n }\n}\n\nexport async function createLocation(location: NewLocation, context: any) {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n const locationRepository: Repository<Location> = tx.getRepository(Location)\n const warehouseRepository: Repository<Warehouse> = tx.getRepository(Warehouse)\n\n return await locationRepository.save({\n ...location,\n warehouse: await warehouseRepository.findOne(location.warehouse.id),\n domain,\n creator: user,\n updater: user\n })\n}\n\nexport async function updateLocation(id: string, patch: LocationPatch, context: any) {\n const { user, tx }: { user: User; tx: EntityManager } = context.state\n\n const locationRepository: Repository<Location> = tx.getRepository(Location)\n const warehouseRepository: Repository<Warehouse> = tx.getRepository(Warehouse)\n const location: Location = await locationRepository.findOne(id)\n\n if (patch.warehouse && patch.warehouse.id) {\n patch.warehouse = await warehouseRepository.findOne(patch.warehouse.id)\n }\n\n return await locationRepository.save({\n ...location,\n ...patch,\n updater: user\n })\n}\n\nexport async function deleteLocation(id: string, context: any) {\n const { tx }: { tx: EntityManager } = context.state\n\n const repository: Repository<Location> = tx.getRepository(Location)\n await repository.delete(id)\n return true\n}\n\nexport async function deleteLocations(ids: string[], context: any) {\n const { tx }: { tx: EntityManager } = context.state\n\n const repository: Repository<Location> = tx.getRepository(Location)\n await repository.delete(ids)\n return true\n}\n"]}
@@ -1,19 +1,8 @@
1
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
2
  var _a, _b, _c, _d;
15
3
  Object.defineProperty(exports, "__esModule", { value: true });
16
4
  exports.LocationQuery = void 0;
5
+ const tslib_1 = require("tslib");
17
6
  const type_graphql_1 = require("type-graphql");
18
7
  const typeorm_1 = require("typeorm");
19
8
  const auth_base_1 = require("@things-factory/auth-base");
@@ -183,99 +172,99 @@ let LocationQuery = class LocationQuery {
183
172
  return await (0, typeorm_1.getRepository)(warehouse_1.Warehouse).findOne((_a = location.warehouse) === null || _a === void 0 ? void 0 : _a.id);
184
173
  }
185
174
  };
186
- __decorate([
175
+ tslib_1.__decorate([
187
176
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "query")'),
188
177
  (0, type_graphql_1.Query)(returns => location_types_1.LocationList),
189
- __param(0, (0, type_graphql_1.Args)()),
190
- __param(1, (0, type_graphql_1.Ctx)()),
191
- __metadata("design:type", Function),
192
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
193
- __metadata("design:returntype", Promise)
178
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
179
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
180
+ tslib_1.__metadata("design:type", Function),
181
+ tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
182
+ tslib_1.__metadata("design:returntype", Promise)
194
183
  ], LocationQuery.prototype, "locations", null);
195
- __decorate([
184
+ tslib_1.__decorate([
196
185
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "query")'),
197
186
  (0, type_graphql_1.Query)(returns => location_types_1.LocationList),
198
- __param(0, (0, type_graphql_1.Args)()),
199
- __param(1, (0, type_graphql_1.Ctx)()),
200
- __metadata("design:type", Function),
201
- __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
202
- __metadata("design:returntype", Promise)
187
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
188
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
189
+ tslib_1.__metadata("design:type", Function),
190
+ tslib_1.__metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
191
+ tslib_1.__metadata("design:returntype", Promise)
203
192
  ], LocationQuery.prototype, "pureLocations", null);
204
- __decorate([
193
+ tslib_1.__decorate([
205
194
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "query")'),
206
195
  (0, type_graphql_1.Query)(returns => location_types_1.LocationOccupancy),
207
- __param(0, (0, type_graphql_1.Arg)('warehouse')),
208
- __param(1, (0, type_graphql_1.Arg)('types', type => [String], { nullable: true })),
209
- __param(2, (0, type_graphql_1.Ctx)()),
210
- __metadata("design:type", Function),
211
- __metadata("design:paramtypes", [String, Array, Object]),
212
- __metadata("design:returntype", Promise)
196
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('warehouse')),
197
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('types', type => [String], { nullable: true })),
198
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
199
+ tslib_1.__metadata("design:type", Function),
200
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
201
+ tslib_1.__metadata("design:returntype", Promise)
213
202
  ], LocationQuery.prototype, "locationOccupancies", null);
214
- __decorate([
203
+ tslib_1.__decorate([
215
204
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "query")'),
216
205
  (0, type_graphql_1.Query)(returns => location_1.Location),
217
- __param(0, (0, type_graphql_1.Arg)('name')),
218
- __param(1, (0, type_graphql_1.Ctx)()),
219
- __metadata("design:type", Function),
220
- __metadata("design:paramtypes", [String, Object]),
221
- __metadata("design:returntype", Promise)
206
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
207
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
208
+ tslib_1.__metadata("design:type", Function),
209
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
210
+ tslib_1.__metadata("design:returntype", Promise)
222
211
  ], LocationQuery.prototype, "location", null);
223
- __decorate([
212
+ tslib_1.__decorate([
224
213
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "query")'),
225
214
  (0, type_graphql_1.Query)(returns => location_1.Location),
226
- __param(0, (0, type_graphql_1.Arg)('name')),
227
- __param(1, (0, type_graphql_1.Ctx)()),
228
- __metadata("design:type", Function),
229
- __metadata("design:paramtypes", [String, Object]),
230
- __metadata("design:returntype", Promise)
215
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
216
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
217
+ tslib_1.__metadata("design:type", Function),
218
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
219
+ tslib_1.__metadata("design:returntype", Promise)
231
220
  ], LocationQuery.prototype, "locationByName", null);
232
- __decorate([
221
+ tslib_1.__decorate([
233
222
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "query")'),
234
223
  (0, type_graphql_1.Query)(returns => location_types_1.LocationList),
235
- __param(0, (0, type_graphql_1.Args)()),
236
- __param(1, (0, type_graphql_1.Ctx)()),
237
- __metadata("design:type", Function),
238
- __metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
239
- __metadata("design:returntype", Promise)
224
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
225
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
226
+ tslib_1.__metadata("design:type", Function),
227
+ tslib_1.__metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
228
+ tslib_1.__metadata("design:returntype", Promise)
240
229
  ], LocationQuery.prototype, "locationsByGroup", null);
241
- __decorate([
230
+ tslib_1.__decorate([
242
231
  (0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "query")'),
243
232
  (0, type_graphql_1.Query)(returns => location_types_1.LocationInventories),
244
- __param(0, (0, type_graphql_1.Args)()),
245
- __param(1, (0, type_graphql_1.Ctx)()),
246
- __metadata("design:type", Function),
247
- __metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
248
- __metadata("design:returntype", Promise)
233
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
234
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
235
+ tslib_1.__metadata("design:type", Function),
236
+ tslib_1.__metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
237
+ tslib_1.__metadata("design:returntype", Promise)
249
238
  ], LocationQuery.prototype, "locationWithInventories", null);
250
- __decorate([
239
+ tslib_1.__decorate([
251
240
  (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
252
- __param(0, (0, type_graphql_1.Root)()),
253
- __metadata("design:type", Function),
254
- __metadata("design:paramtypes", [location_1.Location]),
255
- __metadata("design:returntype", Promise)
241
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
242
+ tslib_1.__metadata("design:type", Function),
243
+ tslib_1.__metadata("design:paramtypes", [location_1.Location]),
244
+ tslib_1.__metadata("design:returntype", Promise)
256
245
  ], LocationQuery.prototype, "domain", null);
257
- __decorate([
246
+ tslib_1.__decorate([
258
247
  (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
259
- __param(0, (0, type_graphql_1.Root)()),
260
- __metadata("design:type", Function),
261
- __metadata("design:paramtypes", [location_1.Location]),
262
- __metadata("design:returntype", Promise)
248
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
249
+ tslib_1.__metadata("design:type", Function),
250
+ tslib_1.__metadata("design:paramtypes", [location_1.Location]),
251
+ tslib_1.__metadata("design:returntype", Promise)
263
252
  ], LocationQuery.prototype, "updater", null);
264
- __decorate([
253
+ tslib_1.__decorate([
265
254
  (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
266
- __param(0, (0, type_graphql_1.Root)()),
267
- __metadata("design:type", Function),
268
- __metadata("design:paramtypes", [location_1.Location]),
269
- __metadata("design:returntype", Promise)
255
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
256
+ tslib_1.__metadata("design:type", Function),
257
+ tslib_1.__metadata("design:paramtypes", [location_1.Location]),
258
+ tslib_1.__metadata("design:returntype", Promise)
270
259
  ], LocationQuery.prototype, "creator", null);
271
- __decorate([
260
+ tslib_1.__decorate([
272
261
  (0, type_graphql_1.FieldResolver)(type => warehouse_1.Warehouse),
273
- __param(0, (0, type_graphql_1.Root)()),
274
- __metadata("design:type", Function),
275
- __metadata("design:paramtypes", [location_1.Location]),
276
- __metadata("design:returntype", Promise)
262
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
263
+ tslib_1.__metadata("design:type", Function),
264
+ tslib_1.__metadata("design:paramtypes", [location_1.Location]),
265
+ tslib_1.__metadata("design:returntype", Promise)
277
266
  ], LocationQuery.prototype, "warehouse", null);
278
- LocationQuery = __decorate([
267
+ LocationQuery = tslib_1.__decorate([
279
268
  (0, type_graphql_1.Resolver)(location_1.Location)
280
269
  ], LocationQuery);
281
270
  exports.LocationQuery = LocationQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"location-query.js","sourceRoot":"","sources":["../../../server/service/location/location-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AAEvC,yDAAgD;AAChD,uDAAkE;AAClE,iDAAqE;AAErE,yDAA4D;AAC5D,sDAAkD;AAClD,yCAAqC;AACrC,qDAAuF;AAGvF,IAAa,aAAa,GAA1B,MAAa,aAAa;IAGxB,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAY;QAC5D,MAAM,YAAY,GAAG,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,kBAAkB,EAAE,CAAA;QACjE,IAAA,kBAAU,EAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QACzC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAED;;;;;SAKK;IAGL,KAAK,CAAC,aAAa,CAAS,MAAiB,EAAS,OAAY;QAChE,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kBAAG,GAAE,CAAA;;iEAAjB,iBAAS,oBAAT,iBAAS;;qDAsB/C;AAID;IAFC,IAAA,wBAAS,EAAC,uDAAuD,CAAC;IAClE,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oCAAmB,CAAC;IACP,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;iEAAjB,iBAAS,oBAAT,iBAAS;;4DAgFtD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;2CAEtC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAS,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;8CAEzC;AAtNU,aAAa;IADzB,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,aAAa,CAuNzB;AAvNY,sCAAa","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { getPermittedBizplaceIds } from '@things-factory/biz-base'\nimport { buildQuery, Domain, ListParam } from '@things-factory/shell'\n\nimport { INVENTORY_STATUS } from '../../constants/inventory'\nimport { Warehouse } from '../warehouse/warehouse'\nimport { Location } from './location'\nimport { LocationInventories, LocationList, LocationOccupancy } from './location-types'\n\n@Resolver(Location)\nexport class LocationQuery {\n @Directive('@privilege(category: \"warehouse\", privilege: \"query\")')\n @Query(returns => LocationList)\n async locations(@Args() params: ListParam, @Ctx() context: any): Promise<LocationList> {\n const queryBuilder = getRepository(Location).createQueryBuilder()\n buildQuery(queryBuilder, params, context)\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n /**\n * @description this resolver was specially made to return huge locations data\n * without dropping off performance due to typegraphql limitations\n * @returns pure location data only. there will be no other table joined to avoid\n * ORM lagging issue (converting to object extremely withdraws the performance)\n * */\n @Directive('@privilege(category: \"warehouse\", privilege: \"query\")')\n @Query(returns => LocationList)\n async pureLocations(@Args() params: ListParam, @Ctx() context: any): Promise<LocationList> {\n const queryBuilder = getRepository(Location).createQueryBuilder()\n buildQuery(queryBuilder, params, context)\n const items = await queryBuilder.getRawMany()\n const total = await queryBuilder.getCount()\n\n return { items: items.map(item => new Location(item)), total }\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"query\")')\n @Query(returns => LocationOccupancy)\n async locationOccupancies(\n @Arg('warehouse') warehouse: string,\n @Arg('types', type => [String], { nullable: true }) types: string[],\n @Ctx() context: any\n ): Promise<LocationOccupancy> {\n const { domain }: { domain: Domain } = context.state\n\n const foundWarehouse: Warehouse = await getRepository(Warehouse).findOne({\n where: {\n domain,\n name: warehouse\n },\n relations: ['locations']\n })\n\n if (!foundWarehouse) throw new Error(`${warehouse} was not found!`)\n\n const locations: Location[] =\n types && types.length\n ? foundWarehouse?.locations?.filter((location: Location) => types.indexOf(location.type) !== -1)\n : foundWarehouse?.locations\n\n const total: number = locations.length\n const occupied: number = locations.filter((location: Location) => location.status === 'OCCUPIED')?.length || 0\n const empty: number = total - occupied\n const percentage: number = occupied > 0 ? Math.round((occupied / total) * 100) : 0\n\n return { total, occupied, empty, percentage }\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"query\")')\n @Query(returns => Location)\n async location(@Arg('name') name: string, @Ctx() context: any): Promise<Location> {\n const foundLocation: Location | null = await getRepository(Location).findOne({\n where: { name },\n relations: ['domain', 'warehouse', 'creator', 'updater']\n })\n if (!foundLocation) throw new Error(context.t('error.no_location_found'))\n\n return foundLocation\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"query\")')\n @Query(returns => Location)\n async locationByName(@Arg('name') name: string, @Ctx() context: any): Promise<Location> {\n const { domain }: { domain: Domain } = context.state\n\n return await getRepository(Location).findOne({\n where: {\n domain: domain,\n name\n },\n relations: ['domain', 'warehouse', 'creator', 'updater']\n })\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"query\")')\n @Query(returns => LocationList)\n async locationsByGroup(@Args() params: ListParam, @Ctx() context: any): Promise<LocationList> {\n const { domain }: { domain: Domain } = context.state\n const warehouseIdParam = params.filters.find(param => (param.name = 'warehouse_id'))\n\n if (!warehouseIdParam.value) throw new Error(`invalid warehouse ID`)\n\n const items = await getRepository(Location).query(`\n SELECT CONCAT(\"zone\",'-',\"row\",'-',\"column\") as name, \"zone\", \"row\", \"column\"\n FROM locations WHERE domain_id = '${domain.id}'\n AND warehouse_id = '${warehouseIdParam.value}'\n GROUP BY \"zone\", \"row\", \"column\"\n `)\n\n let [{ total }] = await getRepository(Location).query(`\n SELECT COUNT(DISTINCT(\"zone\", \"row\", \"column\")) as total\n FROM locations WHERE domain_id = '${domain.id}'\n AND warehouse_id = '${warehouseIdParam.value}'\n `)\n\n total = parseInt(total)\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"query\")')\n @Query(returns => LocationInventories)\n async locationWithInventories(@Args() params: ListParam, @Ctx() context: any): Promise<LocationInventories> {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const bizplaceIds = await getPermittedBizplaceIds(domain, user)\n const queryBuilder = getRepository(Location).createQueryBuilder()\n\n const warehouseNames = params.filters.find(x => x.name === 'warehouseNames' && x.operator.toLowerCase() === 'in')\n ?.value\n\n const locationTypes = params.filters.find(x => x.name === 'locationTypes' && x.operator.toLowerCase() === 'in')\n ?.value\n\n params.filters = []\n buildQuery(queryBuilder, params, context)\n\n queryBuilder\n .leftJoinAndSelect('Location.warehouse', 'Warehouse')\n .leftJoinAndSelect(\n 'inventories',\n 'Inventory',\n 'Location.id = Inventory.location_id AND Inventory.status = :InvStatus',\n {\n InvStatus: INVENTORY_STATUS.STORED\n }\n )\n .leftJoinAndSelect('Inventory.product', 'Product')\n .leftJoinAndSelect('Inventory.bizplace', 'Bizplace', 'Bizplace.id IN (:...bizplaceIds)', {\n bizplaceIds: [...new Set(bizplaceIds)]\n })\n .leftJoinAndSelect('Inventory.creator', 'Creator')\n .leftJoinAndSelect('Inventory.updater', 'Updater')\n .addSelect('SUM(\"Inventory\".\"qty\") OVER(PARTITION BY \"Location\".\"id\")', 'accumulate_qty')\n .where('Location.domain_id = :domainId', { domainId: domain.id })\n\n if (warehouseNames) {\n queryBuilder.andWhere('Warehouse.name IN (:...warehouseNames)', { warehouseNames: [...new Set(warehouseNames)] })\n }\n\n if (locationTypes) {\n queryBuilder.andWhere('Location.type ILIKE ANY (ARRAY[:...locationTypes])', {\n locationTypes: [...new Set(locationTypes)]\n })\n }\n\n let items = await queryBuilder.getRawMany()\n const total = await queryBuilder.getCount()\n\n items = items.map(item => {\n return {\n id: item.Location_id,\n name: item.Location_name,\n bizplace: {\n name: item.Bizplace_name || '',\n description: item.Bizplace_description || ''\n },\n product: {\n name: item.Product_name || '',\n sku: item.Product_sku || '',\n description: item.Product_description || ''\n },\n palletId: item.Inventory_pallet_id || '',\n batchId: item.Inventory_batch_id || '',\n qty: item.Inventory_qty || 0,\n accumulatedQty: item.accumulate_qty || 0,\n uomValue: item.Inventory_uom_value || 0.0,\n uom: item.Inventory_uom || '',\n packingType: item.Inventory_packing_type || '',\n packingSize: item.Inventory_packing_size || 0.0,\n expirationDate: item.Inventory_expiration_date\n ? new Date(item.Inventory_expiration_date).toISOString().split('T')[0].split('-').reverse().join('-')\n : '',\n warehouse: {\n name: item.Warehouse_name,\n description: item.Warehouse_description,\n type: item.Warehouse_type\n },\n zone: item.Location_zone\n }\n })\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() location: Location) {\n return await getRepository(Domain).findOne(location.domain?.id)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() location: Location) {\n return await getRepository(User).findOne(location.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() location: Location) {\n return await getRepository(User).findOne(location.creatorId)\n }\n\n @FieldResolver(type => Warehouse)\n async warehouse(@Root() location: Location): Promise<Warehouse> {\n return await getRepository(Warehouse).findOne(location.warehouse?.id)\n }\n}\n"]}