@rytass/wms-module-core 0.9.1 → 0.10.0
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.
- package/README.md +15 -2
- package/docs/README.md +2 -2
- package/docs/api-reference.md +129 -10
- package/docs/host-integration.md +172 -0
- package/docs/integration-guide.md +84 -43
- package/index.cjs.js +2454 -1658
- package/index.d.ts +2 -0
- package/lib/events/inventory-count-lock.subscriber.d.ts +17 -5
- package/lib/models/metadata/index.d.ts +1 -0
- package/lib/models/metadata/sequence.entity.d.ts +9 -0
- package/lib/models/models.module.d.ts +7 -0
- package/lib/services/allocate-inventory-order.service.d.ts +3 -3
- package/lib/services/batch.service.d.ts +13 -1
- package/lib/services/consumption-order.service.d.ts +6 -6
- package/lib/services/helper.service.d.ts +10 -4
- package/lib/services/hold-inventory-order.service.d.ts +3 -3
- package/lib/services/index.d.ts +1 -0
- package/lib/services/inventory-count-order.service.d.ts +28 -9
- package/lib/services/loader.service.d.ts +11 -3
- package/lib/services/material.service.d.ts +1 -1
- package/lib/services/merge-batch-order.service.d.ts +2 -2
- package/lib/services/quality-inspection-order.service.d.ts +1 -1
- package/lib/services/receive-inventory-order.service.d.ts +4 -4
- package/lib/services/reclassify-inventory-order.service.d.ts +2 -2
- package/lib/services/scrape.service.d.ts +1 -1
- package/lib/services/sequence.service.d.ts +58 -0
- package/lib/services/ship-inventory-order.service.d.ts +6 -6
- package/lib/services/split-batch-order.service.d.ts +2 -2
- package/lib/services/stock.service.d.ts +48 -2
- package/lib/services/transfer-customer-order.service.d.ts +3 -3
- package/lib/services/transfer-order.service.d.ts +7 -5
- package/lib/services/transfer-vendor-order.service.d.ts +3 -3
- package/lib/table-prefix/logical-table-name.d.ts +21 -0
- package/lib/table-prefix/table-prefix.d.ts +30 -0
- package/lib/typings/core-module-options.d.ts +31 -0
- package/lib/typings/create-transfer-order.input.d.ts +2 -0
- package/lib/typings/index.d.ts +20 -0
- package/lib/utils/run-in-transaction.d.ts +23 -0
- package/lib/utils/table-path.d.ts +13 -0
- package/package.json +3 -12
- package/index.d.mts +0 -6
- package/index.mjs +0 -98
- package/lib/constants/consumption-change-kind.mjs +0 -20
- package/lib/constants/inventory-count-status.mjs +0 -22
- package/lib/constants/operations.mjs +0 -76
- package/lib/constants/order-type.mjs +0 -33
- package/lib/constants/stock-status.mjs +0 -61
- package/lib/core.module.mjs +0 -287
- package/lib/events/dispatch-scope.mjs +0 -29
- package/lib/events/inventory-count-lock.subscriber.mjs +0 -98
- package/lib/events/stock-change.subscriber.mjs +0 -252
- package/lib/events/wms-event.collector.mjs +0 -22
- package/lib/events/wms-event.dispatcher.mjs +0 -63
- package/lib/events/wms-event.tokens.mjs +0 -12
- package/lib/events/wms-operation-runner.mjs +0 -101
- package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-change.entity.mjs +0 -40
- package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-item.entity.mjs +0 -104
- package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order.entity.mjs +0 -33
- package/lib/models/extensions/consumption-order/consumption-order-change.entity.mjs +0 -59
- package/lib/models/extensions/consumption-order/consumption-order-item.entity.mjs +0 -114
- package/lib/models/extensions/consumption-order/consumption-order.entity.mjs +0 -69
- package/lib/models/extensions/hold-inventory-order/hold-inventory-order-change.entity.mjs +0 -40
- package/lib/models/extensions/hold-inventory-order/hold-inventory-order-item.entity.mjs +0 -98
- package/lib/models/extensions/hold-inventory-order/hold-inventory-order.entity.mjs +0 -43
- package/lib/models/extensions/inventory-count-order/inventory-count-order-change.entity.mjs +0 -50
- package/lib/models/extensions/inventory-count-order/inventory-count-order-item.entity.mjs +0 -191
- package/lib/models/extensions/inventory-count-order/inventory-count-order.entity.mjs +0 -155
- package/lib/models/extensions/merge-batch-order/merge-batch-order-change.entity.mjs +0 -40
- package/lib/models/extensions/merge-batch-order/merge-batch-order-item.entity.mjs +0 -75
- package/lib/models/extensions/merge-batch-order/merge-batch-order.entity.mjs +0 -33
- package/lib/models/extensions/order-reference/order-reference.entity.mjs +0 -95
- package/lib/models/extensions/quality-inspection-order/quality-inspection-order-change.entity.mjs +0 -45
- package/lib/models/extensions/quality-inspection-order/quality-inspection-order-item.entity.mjs +0 -94
- package/lib/models/extensions/quality-inspection-order/quality-inspection-order.entity.mjs +0 -38
- package/lib/models/extensions/receive-inventory-order/receive-inventory-order-change.entity.mjs +0 -46
- package/lib/models/extensions/receive-inventory-order/receive-inventory-order-item.entity.mjs +0 -89
- package/lib/models/extensions/receive-inventory-order/receive-inventory-order.entity.mjs +0 -57
- package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order-change.entity.mjs +0 -40
- package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order-item.entity.mjs +0 -75
- package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order.entity.mjs +0 -33
- package/lib/models/extensions/scrape-order/scrape-order-change.entity.mjs +0 -40
- package/lib/models/extensions/scrape-order/scrape-order-item.entity.mjs +0 -94
- package/lib/models/extensions/scrape-order/scrape-order.entity.mjs +0 -33
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order-change.entity.mjs +0 -46
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order-item.entity.mjs +0 -90
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order-reference.entity.mjs +0 -65
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order.entity.mjs +0 -56
- package/lib/models/extensions/split-batch-order/split-batch-order-change.entity.mjs +0 -40
- package/lib/models/extensions/split-batch-order/split-batch-order-item.entity.mjs +0 -75
- package/lib/models/extensions/split-batch-order/split-batch-order.entity.mjs +0 -33
- package/lib/models/extensions/transfer-customer-order/transfer-customer-order-change.entity.mjs +0 -40
- package/lib/models/extensions/transfer-customer-order/transfer-customer-order-item.entity.mjs +0 -99
- package/lib/models/extensions/transfer-customer-order/transfer-customer-order.entity.mjs +0 -33
- package/lib/models/extensions/transfer-order/transfer-order-change.entity.mjs +0 -40
- package/lib/models/extensions/transfer-order/transfer-order-item.entity.mjs +0 -109
- package/lib/models/extensions/transfer-order/transfer-order.entity.mjs +0 -53
- package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order-change.entity.mjs +0 -40
- package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order-item.entity.mjs +0 -99
- package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order.entity.mjs +0 -33
- package/lib/models/metadata/batch-group.entity.mjs +0 -31
- package/lib/models/metadata/batch.entity.mjs +0 -131
- package/lib/models/metadata/loader-type.entity.mjs +0 -43
- package/lib/models/metadata/loader-unit.entity.mjs +0 -21
- package/lib/models/metadata/loader.entity.mjs +0 -98
- package/lib/models/metadata/location.entity.mjs +0 -28
- package/lib/models/metadata/material-unit.entity.mjs +0 -51
- package/lib/models/metadata/material.entity.mjs +0 -28
- package/lib/models/metadata/order.entity.mjs +0 -5
- package/lib/models/metadata/sale-order.entity.mjs +0 -21
- package/lib/models/metadata/stock.entity.mjs +0 -29
- package/lib/models/metadata/unit.entity.mjs +0 -21
- package/lib/models/models.module.mjs +0 -158
- package/lib/models/wms-entities.mjs +0 -82
- package/lib/services/allocate-inventory-order.service.mjs +0 -310
- package/lib/services/base-order.service.mjs +0 -76
- package/lib/services/batch.service.mjs +0 -272
- package/lib/services/consumption-order.service.mjs +0 -504
- package/lib/services/helper.service.mjs +0 -28
- package/lib/services/hold-inventory-order.service.mjs +0 -296
- package/lib/services/inventory-count-order.service.mjs +0 -648
- package/lib/services/loader.service.mjs +0 -291
- package/lib/services/location.service.mjs +0 -139
- package/lib/services/material.service.mjs +0 -181
- package/lib/services/merge-batch-order.service.mjs +0 -206
- package/lib/services/order-reference.service.mjs +0 -136
- package/lib/services/quality-inspection-order.service.mjs +0 -146
- package/lib/services/receive-inventory-order.service.mjs +0 -468
- package/lib/services/reclassify-inventory-order.service.mjs +0 -192
- package/lib/services/sale-order.service.mjs +0 -20
- package/lib/services/scrape.service.mjs +0 -150
- package/lib/services/ship-inventory-order.service.mjs +0 -610
- package/lib/services/split-batch-order.service.mjs +0 -191
- package/lib/services/stock.service.mjs +0 -559
- package/lib/services/transfer-customer-order.service.mjs +0 -290
- package/lib/services/transfer-order.service.mjs +0 -641
- package/lib/services/transfer-vendor-order.service.mjs +0 -290
- package/lib/services/unit.service.mjs +0 -76
- package/lib/services/warehouse-map.service.mjs +0 -50
- package/lib/typings/core-module-options.mjs +0 -3
- package/lib/typings/find-receive-inventory-order.input.mjs +0 -9
- package/lib/typings/find-ship-inventory-order.input.mjs +0 -9
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { Injectable } from '@nestjs/common';
|
|
3
|
-
import { collectToScope } from './dispatch-scope.mjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Injected into core services so they can record stock domain events at the
|
|
7
|
-
* point a `*_order_change` / state transition is written. Events are buffered
|
|
8
|
-
* in the current dispatch scope and flushed post-commit by the graphql
|
|
9
|
-
* interceptor. Outside a scope (the service called directly as a plain library)
|
|
10
|
-
* this is a silent no-op.
|
|
11
|
-
*/
|
|
12
|
-
let WmsEventCollector = class WmsEventCollector {
|
|
13
|
-
collect(name, payload) {
|
|
14
|
-
const event = { name, payload };
|
|
15
|
-
collectToScope(event);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
WmsEventCollector = __decorate([
|
|
19
|
-
Injectable()
|
|
20
|
-
], WmsEventCollector);
|
|
21
|
-
|
|
22
|
-
export { WmsEventCollector };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Injectable, Inject, Optional, Logger } from '@nestjs/common';
|
|
3
|
-
import { WMS_EVENT_OPTIONS, WMS_EVENT_EMITTER_BRIDGE } from './wms-event.tokens.mjs';
|
|
4
|
-
|
|
5
|
-
var WmsEventDispatcher_1;
|
|
6
|
-
/**
|
|
7
|
-
* Central event dispatcher. Runs consumer before-hooks (which may veto) and,
|
|
8
|
-
* post-commit, flushes collected events to consumer after-listeners and the
|
|
9
|
-
* optional emitter bridge. Listener errors are isolated so one failing listener
|
|
10
|
-
* never blocks the others or the already-committed mutation.
|
|
11
|
-
*/
|
|
12
|
-
let WmsEventDispatcher = WmsEventDispatcher_1 = class WmsEventDispatcher {
|
|
13
|
-
options;
|
|
14
|
-
bridge;
|
|
15
|
-
logger = new Logger(WmsEventDispatcher_1.name);
|
|
16
|
-
constructor(options, bridge = null) {
|
|
17
|
-
this.options = options;
|
|
18
|
-
this.bridge = bridge;
|
|
19
|
-
}
|
|
20
|
-
/** Whether any hook, listener or bridge is wired (lets the interceptor skip overhead entirely). */
|
|
21
|
-
isActive() {
|
|
22
|
-
const { beforeHooks, afterListeners } = this.options;
|
|
23
|
-
return (!!this.bridge ||
|
|
24
|
-
(!!beforeHooks && Object.keys(beforeHooks).length > 0) ||
|
|
25
|
-
(!!afterListeners && Object.keys(afterListeners).length > 0));
|
|
26
|
-
}
|
|
27
|
-
/** Invoke the before-hook for an event. A thrown error vetoes the mutation. */
|
|
28
|
-
async runBeforeHook(context) {
|
|
29
|
-
const hook = this.options.beforeHooks?.[context.event];
|
|
30
|
-
if (hook) {
|
|
31
|
-
await hook(context);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/** Flush collected events to after-listeners and the emitter bridge (post-commit). */
|
|
35
|
-
async flush(events) {
|
|
36
|
-
for (const event of events) {
|
|
37
|
-
const listener = this.options.afterListeners?.[event.name];
|
|
38
|
-
if (listener) {
|
|
39
|
-
try {
|
|
40
|
-
await listener({ event: event.name, payload: event.payload });
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
this.logger.error(`WMS after-listener for "${event.name}" threw: ${error instanceof Error ? error.message : String(error)}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
this.bridge?.forward(event);
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
this.logger.error(`WMS emitter bridge for "${event.name}" threw: ${error instanceof Error ? error.message : String(error)}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
WmsEventDispatcher = WmsEventDispatcher_1 = __decorate([
|
|
56
|
-
Injectable(),
|
|
57
|
-
__param(0, Inject(WMS_EVENT_OPTIONS)),
|
|
58
|
-
__param(1, Optional()),
|
|
59
|
-
__param(1, Inject(WMS_EVENT_EMITTER_BRIDGE)),
|
|
60
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
61
|
-
], WmsEventDispatcher);
|
|
62
|
-
|
|
63
|
-
export { WmsEventDispatcher };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** DI token holding the resolved {@link WmsEventModuleOptions}. */
|
|
2
|
-
const WMS_EVENT_OPTIONS = Symbol('WMS_EVENT_OPTIONS');
|
|
3
|
-
/** DI token for an optional external emitter bridge (e.g. @nestjs/event-emitter). */
|
|
4
|
-
const WMS_EVENT_EMITTER_BRIDGE = Symbol('WMS_EVENT_EMITTER_BRIDGE');
|
|
5
|
-
/** DI token for the optional host-neutral actor extractor. */
|
|
6
|
-
const WMS_ACTOR_EXTRACTOR = Symbol('WMS_ACTOR_EXTRACTOR');
|
|
7
|
-
/** DI token holding the boolean "enrich stock events" flag (default false). */
|
|
8
|
-
const WMS_STOCK_ENRICH = Symbol('WMS_STOCK_ENRICH');
|
|
9
|
-
/** DI token holding the host's registered custom change tables (default none). */
|
|
10
|
-
const WMS_CUSTOM_CHANGE_TABLES = Symbol('WMS_CUSTOM_CHANGE_TABLES');
|
|
11
|
-
|
|
12
|
-
export { WMS_ACTOR_EXTRACTOR, WMS_CUSTOM_CHANGE_TABLES, WMS_EVENT_EMITTER_BRIDGE, WMS_EVENT_OPTIONS, WMS_STOCK_ENRICH };
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Injectable } from '@nestjs/common';
|
|
3
|
-
import { runInDispatchScope, collectToScope } from './dispatch-scope.mjs';
|
|
4
|
-
import { WmsEventDispatcher } from './wms-event.dispatcher.mjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Derive the operation event's correlation id from whatever the operation
|
|
8
|
-
* returned, falling back to an `id` argument. Action operations that return a
|
|
9
|
-
* bare `boolean` land on the argument.
|
|
10
|
-
*/
|
|
11
|
-
const defaultResolveId = (result, args) => {
|
|
12
|
-
if (result &&
|
|
13
|
-
typeof result === 'object' &&
|
|
14
|
-
'id' in result &&
|
|
15
|
-
typeof result.id === 'string') {
|
|
16
|
-
return result.id;
|
|
17
|
-
}
|
|
18
|
-
const argId = args['id'];
|
|
19
|
-
return typeof argId === 'string' ? argId : null;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Runs one WMS operation with the full event guarantee, from any caller.
|
|
23
|
-
*
|
|
24
|
-
* The four steps — before-hook (a throw vetoes, before any DB work), the
|
|
25
|
-
* operation itself, the operation event, and a single post-commit flush of
|
|
26
|
-
* everything the services collected on the way — used to live inside
|
|
27
|
-
* `WmsMutationInterceptor`, which meant they only happened for callers coming
|
|
28
|
-
* in through GraphQL. A host driving the warehouse from its own code path got
|
|
29
|
-
* no hooks, no actor and no events: `StockChangeSubscriber` still collected
|
|
30
|
-
* them, but with no scope open there was nothing to collect into and nobody to
|
|
31
|
-
* flush.
|
|
32
|
-
*
|
|
33
|
-
* That is the case that matters. A host with its own inbound flow calls the
|
|
34
|
-
* domain services directly, and `InventoryCountLockSubscriber` already goes out
|
|
35
|
-
* of its way to cover exactly that caller.
|
|
36
|
-
*
|
|
37
|
-
* The interceptor now delegates here, so the two paths cannot drift.
|
|
38
|
-
*
|
|
39
|
-
* ```ts
|
|
40
|
-
* await runner.run(
|
|
41
|
-
* { event: 'transfer-order.transferred', args: { orderId }, actor },
|
|
42
|
-
* () => transferOrderService.transfer(orderId),
|
|
43
|
-
* );
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* Nesting is safe: an inner call joins the outer scope and only the outermost
|
|
47
|
-
* one flushes, so a host may wrap a service that itself runs operations.
|
|
48
|
-
*/
|
|
49
|
-
let WmsOperationRunner = class WmsOperationRunner {
|
|
50
|
-
dispatcher;
|
|
51
|
-
constructor(dispatcher) {
|
|
52
|
-
this.dispatcher = dispatcher;
|
|
53
|
-
}
|
|
54
|
-
async run(options, operation) {
|
|
55
|
-
// Nothing wired: run the operation and skip the machinery entirely, the way
|
|
56
|
-
// the interceptor always has. `collectToScope` is already a no-op outside a
|
|
57
|
-
// scope, so the services behave identically.
|
|
58
|
-
if (!this.dispatcher.isActive()) {
|
|
59
|
-
return operation();
|
|
60
|
-
}
|
|
61
|
-
const args = options.args ?? {};
|
|
62
|
-
const actor = options.actor ?? null;
|
|
63
|
-
if (options.event) {
|
|
64
|
-
// Before any DB work, so a throw vetoes with zero side effects.
|
|
65
|
-
await this.dispatcher.runBeforeHook({
|
|
66
|
-
event: options.event,
|
|
67
|
-
args,
|
|
68
|
-
executionContext: options.executionContext ?? null,
|
|
69
|
-
source: options.executionContext ? 'graphql' : 'host',
|
|
70
|
-
actor,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
const { result, events } = await runInDispatchScope(async () => {
|
|
74
|
-
const operationResult = await operation();
|
|
75
|
-
if (options.event) {
|
|
76
|
-
const resolveId = options.resolveId ?? defaultResolveId;
|
|
77
|
-
const operationEvent = {
|
|
78
|
-
name: options.event,
|
|
79
|
-
payload: {
|
|
80
|
-
id: resolveId(operationResult, args),
|
|
81
|
-
result: operationResult,
|
|
82
|
-
args,
|
|
83
|
-
actor,
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
collectToScope(operationEvent);
|
|
87
|
-
}
|
|
88
|
-
return operationResult;
|
|
89
|
-
});
|
|
90
|
-
if (events) {
|
|
91
|
-
await this.dispatcher.flush(events);
|
|
92
|
-
}
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
WmsOperationRunner = __decorate([
|
|
97
|
-
Injectable(),
|
|
98
|
-
__metadata("design:paramtypes", [WmsEventDispatcher])
|
|
99
|
-
], WmsOperationRunner);
|
|
100
|
-
|
|
101
|
-
export { WmsOperationRunner };
|
package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-change.entity.mjs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { OrderEntity } from '@rytass/wms-base-nestjs-module';
|
|
3
|
-
import { PrimaryGeneratedColumn, Column, OneToOne, JoinColumn, ManyToOne, Entity } from 'typeorm';
|
|
4
|
-
import { AllocateInventoryOrderItemEntityClass } from './allocate-inventory-order-item.entity.mjs';
|
|
5
|
-
|
|
6
|
-
const AllocateInventoryOrderChangeEntity = Symbol('AllocateInventoryOrderChangeEntity');
|
|
7
|
-
let AllocateInventoryOrderChangeEntityClass = class AllocateInventoryOrderChangeEntityClass {
|
|
8
|
-
id;
|
|
9
|
-
itemId;
|
|
10
|
-
quantityChanged;
|
|
11
|
-
order;
|
|
12
|
-
item;
|
|
13
|
-
};
|
|
14
|
-
__decorate([
|
|
15
|
-
PrimaryGeneratedColumn('uuid'),
|
|
16
|
-
__metadata("design:type", String)
|
|
17
|
-
], AllocateInventoryOrderChangeEntityClass.prototype, "id", void 0);
|
|
18
|
-
__decorate([
|
|
19
|
-
Column({ type: 'uuid' }),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], AllocateInventoryOrderChangeEntityClass.prototype, "itemId", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
Column({ type: 'numeric' }),
|
|
24
|
-
__metadata("design:type", Number)
|
|
25
|
-
], AllocateInventoryOrderChangeEntityClass.prototype, "quantityChanged", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
OneToOne('orders'),
|
|
28
|
-
JoinColumn({ name: 'id', referencedColumnName: 'id' }),
|
|
29
|
-
__metadata("design:type", OrderEntity)
|
|
30
|
-
], AllocateInventoryOrderChangeEntityClass.prototype, "order", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
ManyToOne('allocate_inventory_order_items', (item) => item.changes),
|
|
33
|
-
JoinColumn({ name: 'itemId', referencedColumnName: 'id' }),
|
|
34
|
-
__metadata("design:type", AllocateInventoryOrderItemEntityClass)
|
|
35
|
-
], AllocateInventoryOrderChangeEntityClass.prototype, "item", void 0);
|
|
36
|
-
AllocateInventoryOrderChangeEntityClass = __decorate([
|
|
37
|
-
Entity('allocate_inventory_order_changes')
|
|
38
|
-
], AllocateInventoryOrderChangeEntityClass);
|
|
39
|
-
|
|
40
|
-
export { AllocateInventoryOrderChangeEntity, AllocateInventoryOrderChangeEntityClass };
|
package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-item.entity.mjs
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { PrimaryGeneratedColumn, Column, Index, ManyToOne, JoinColumn, Entity, TableInheritance } from 'typeorm';
|
|
3
|
-
import '../../metadata/batch.entity.mjs';
|
|
4
|
-
import '../../metadata/batch-group.entity.mjs';
|
|
5
|
-
import { LoadersEntityClass } from '../../metadata/loader.entity.mjs';
|
|
6
|
-
import '../../metadata/loader-type.entity.mjs';
|
|
7
|
-
import '../../metadata/loader-unit.entity.mjs';
|
|
8
|
-
import { LocationEntityClass } from '../../metadata/location.entity.mjs';
|
|
9
|
-
import '../../metadata/material.entity.mjs';
|
|
10
|
-
import '../../metadata/material-unit.entity.mjs';
|
|
11
|
-
import '@rytass/wms-base-nestjs-module';
|
|
12
|
-
import '../../metadata/sale-order.entity.mjs';
|
|
13
|
-
import '../../metadata/stock.entity.mjs';
|
|
14
|
-
import '../../metadata/unit.entity.mjs';
|
|
15
|
-
import { AllocateInventoryOrderEntityClass } from './allocate-inventory-order.entity.mjs';
|
|
16
|
-
|
|
17
|
-
const AllocateInventoryOrderItemEntity = Symbol('AllocateInventoryOrderItemEntity');
|
|
18
|
-
let AllocateInventoryOrderItemEntityClass = class AllocateInventoryOrderItemEntityClass {
|
|
19
|
-
id;
|
|
20
|
-
materialId;
|
|
21
|
-
batchId;
|
|
22
|
-
unitId;
|
|
23
|
-
locationId;
|
|
24
|
-
loaderId;
|
|
25
|
-
targetAllocatedQuantity;
|
|
26
|
-
orderId;
|
|
27
|
-
saleId;
|
|
28
|
-
saleSerialId;
|
|
29
|
-
location;
|
|
30
|
-
loader;
|
|
31
|
-
order;
|
|
32
|
-
changes;
|
|
33
|
-
};
|
|
34
|
-
__decorate([
|
|
35
|
-
PrimaryGeneratedColumn('uuid'),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "id", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
Column({ type: 'uuid' }),
|
|
40
|
-
Index(),
|
|
41
|
-
__metadata("design:type", String)
|
|
42
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "materialId", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
Column({ type: 'uuid' }),
|
|
45
|
-
Index(),
|
|
46
|
-
__metadata("design:type", String)
|
|
47
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "batchId", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
Column({ type: 'uuid', nullable: true }),
|
|
50
|
-
Index(),
|
|
51
|
-
__metadata("design:type", Object)
|
|
52
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "unitId", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
Column({ type: 'uuid', nullable: true }),
|
|
55
|
-
Index(),
|
|
56
|
-
__metadata("design:type", Object)
|
|
57
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "locationId", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
Column({ type: 'uuid', nullable: true }),
|
|
60
|
-
Index(),
|
|
61
|
-
__metadata("design:type", Object)
|
|
62
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "loaderId", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
Column({ type: 'numeric' }),
|
|
65
|
-
__metadata("design:type", Number)
|
|
66
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "targetAllocatedQuantity", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
Column({ type: 'uuid' }),
|
|
69
|
-
Index(),
|
|
70
|
-
__metadata("design:type", String)
|
|
71
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "orderId", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
Column({ type: 'varchar' }),
|
|
74
|
-
__metadata("design:type", String)
|
|
75
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "saleId", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
Column({ type: 'varchar' }),
|
|
78
|
-
__metadata("design:type", String)
|
|
79
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "saleSerialId", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
ManyToOne('locations'),
|
|
82
|
-
JoinColumn({ name: 'locationId', referencedColumnName: 'id' }),
|
|
83
|
-
__metadata("design:type", LocationEntityClass)
|
|
84
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "location", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
ManyToOne('loaders'),
|
|
87
|
-
JoinColumn({ name: 'loaderId', referencedColumnName: 'id' }),
|
|
88
|
-
__metadata("design:type", LoadersEntityClass)
|
|
89
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "loader", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
ManyToOne('allocate_inventory_orders', (entity) => entity.items),
|
|
92
|
-
JoinColumn({ name: 'orderId', referencedColumnName: 'id' }),
|
|
93
|
-
__metadata("design:type", AllocateInventoryOrderEntityClass)
|
|
94
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "order", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
ManyToOne('allocate_inventory_order_changes', (change) => change.item),
|
|
97
|
-
__metadata("design:type", Array)
|
|
98
|
-
], AllocateInventoryOrderItemEntityClass.prototype, "changes", void 0);
|
|
99
|
-
AllocateInventoryOrderItemEntityClass = __decorate([
|
|
100
|
-
Entity('allocate_inventory_order_items'),
|
|
101
|
-
TableInheritance({ column: { type: 'varchar', name: 'entityName' } })
|
|
102
|
-
], AllocateInventoryOrderItemEntityClass);
|
|
103
|
-
|
|
104
|
-
export { AllocateInventoryOrderItemEntity, AllocateInventoryOrderItemEntityClass };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { PrimaryGeneratedColumn, Column, Index, CreateDateColumn, OneToMany, Entity, TableInheritance } from 'typeorm';
|
|
3
|
-
|
|
4
|
-
const AllocateInventoryOrderEntity = Symbol('AllocateInventoryOrderEntity');
|
|
5
|
-
let AllocateInventoryOrderEntityClass = class AllocateInventoryOrderEntityClass {
|
|
6
|
-
id;
|
|
7
|
-
key;
|
|
8
|
-
createdAt;
|
|
9
|
-
items;
|
|
10
|
-
};
|
|
11
|
-
__decorate([
|
|
12
|
-
PrimaryGeneratedColumn('uuid'),
|
|
13
|
-
__metadata("design:type", String)
|
|
14
|
-
], AllocateInventoryOrderEntityClass.prototype, "id", void 0);
|
|
15
|
-
__decorate([
|
|
16
|
-
Column({ type: 'varchar', unique: true }),
|
|
17
|
-
Index(),
|
|
18
|
-
__metadata("design:type", String)
|
|
19
|
-
], AllocateInventoryOrderEntityClass.prototype, "key", void 0);
|
|
20
|
-
__decorate([
|
|
21
|
-
CreateDateColumn({ type: 'timestamptz' }),
|
|
22
|
-
__metadata("design:type", Date)
|
|
23
|
-
], AllocateInventoryOrderEntityClass.prototype, "createdAt", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
OneToMany('allocate_inventory_order_items', (entity) => entity.order),
|
|
26
|
-
__metadata("design:type", Array)
|
|
27
|
-
], AllocateInventoryOrderEntityClass.prototype, "items", void 0);
|
|
28
|
-
AllocateInventoryOrderEntityClass = __decorate([
|
|
29
|
-
Entity('allocate_inventory_orders'),
|
|
30
|
-
TableInheritance({ column: { type: 'varchar', name: 'entityName' } })
|
|
31
|
-
], AllocateInventoryOrderEntityClass);
|
|
32
|
-
|
|
33
|
-
export { AllocateInventoryOrderEntity, AllocateInventoryOrderEntityClass };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { OrderEntity } from '@rytass/wms-base-nestjs-module';
|
|
3
|
-
import { PrimaryGeneratedColumn, Column, Index, CreateDateColumn, OneToOne, JoinColumn, ManyToOne, Entity } from 'typeorm';
|
|
4
|
-
import '../../../constants/consumption-change-kind.mjs';
|
|
5
|
-
import { ConsumptionOrderItemEntityClass } from './consumption-order-item.entity.mjs';
|
|
6
|
-
|
|
7
|
-
const ConsumptionOrderChangeEntity = Symbol('ConsumptionOrderChangeEntity');
|
|
8
|
-
let ConsumptionOrderChangeEntityClass = class ConsumptionOrderChangeEntityClass {
|
|
9
|
-
id;
|
|
10
|
-
itemId;
|
|
11
|
-
/** Positive for an issue, negative for a return or a settlement. */
|
|
12
|
-
quantityChanged;
|
|
13
|
-
/**
|
|
14
|
-
* Which of the three actions wrote this row. A return and a settlement are
|
|
15
|
-
* both negative, so the sign cannot carry it -- see
|
|
16
|
-
* {@link ConsumptionChangeKind}.
|
|
17
|
-
*/
|
|
18
|
-
kind;
|
|
19
|
-
createdAt;
|
|
20
|
-
order;
|
|
21
|
-
item;
|
|
22
|
-
};
|
|
23
|
-
__decorate([
|
|
24
|
-
PrimaryGeneratedColumn('uuid'),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], ConsumptionOrderChangeEntityClass.prototype, "id", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
Column({ type: 'uuid' }),
|
|
29
|
-
Index(),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], ConsumptionOrderChangeEntityClass.prototype, "itemId", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
Column({ type: 'numeric' }),
|
|
34
|
-
__metadata("design:type", Number)
|
|
35
|
-
], ConsumptionOrderChangeEntityClass.prototype, "quantityChanged", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
Column({ type: 'varchar' }),
|
|
38
|
-
Index(),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], ConsumptionOrderChangeEntityClass.prototype, "kind", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
CreateDateColumn({ type: 'timestamptz' }),
|
|
43
|
-
__metadata("design:type", Date)
|
|
44
|
-
], ConsumptionOrderChangeEntityClass.prototype, "createdAt", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
OneToOne('orders'),
|
|
47
|
-
JoinColumn({ name: 'id', referencedColumnName: 'id' }),
|
|
48
|
-
__metadata("design:type", OrderEntity)
|
|
49
|
-
], ConsumptionOrderChangeEntityClass.prototype, "order", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
ManyToOne('consumption_order_items', (item) => item.changes),
|
|
52
|
-
JoinColumn({ name: 'itemId', referencedColumnName: 'id' }),
|
|
53
|
-
__metadata("design:type", ConsumptionOrderItemEntityClass)
|
|
54
|
-
], ConsumptionOrderChangeEntityClass.prototype, "item", void 0);
|
|
55
|
-
ConsumptionOrderChangeEntityClass = __decorate([
|
|
56
|
-
Entity('consumption_order_changes')
|
|
57
|
-
], ConsumptionOrderChangeEntityClass);
|
|
58
|
-
|
|
59
|
-
export { ConsumptionOrderChangeEntity, ConsumptionOrderChangeEntityClass };
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { PrimaryGeneratedColumn, Column, Index, ManyToOne, JoinColumn, OneToMany, Entity, TableInheritance } from 'typeorm';
|
|
3
|
-
import '../../metadata/batch.entity.mjs';
|
|
4
|
-
import '../../metadata/batch-group.entity.mjs';
|
|
5
|
-
import { LoadersEntityClass } from '../../metadata/loader.entity.mjs';
|
|
6
|
-
import '../../metadata/loader-type.entity.mjs';
|
|
7
|
-
import '../../metadata/loader-unit.entity.mjs';
|
|
8
|
-
import { LocationEntityClass } from '../../metadata/location.entity.mjs';
|
|
9
|
-
import '../../metadata/material.entity.mjs';
|
|
10
|
-
import '../../metadata/material-unit.entity.mjs';
|
|
11
|
-
import '@rytass/wms-base-nestjs-module';
|
|
12
|
-
import '../../metadata/sale-order.entity.mjs';
|
|
13
|
-
import '../../metadata/stock.entity.mjs';
|
|
14
|
-
import '../../metadata/unit.entity.mjs';
|
|
15
|
-
import { ConsumptionOrderEntityClass } from './consumption-order.entity.mjs';
|
|
16
|
-
|
|
17
|
-
const ConsumptionOrderItemEntity = Symbol('ConsumptionOrderItemEntity');
|
|
18
|
-
let ConsumptionOrderItemEntityClass = class ConsumptionOrderItemEntityClass {
|
|
19
|
-
id;
|
|
20
|
-
materialId;
|
|
21
|
-
batchId;
|
|
22
|
-
/** Where the material is issued from. */
|
|
23
|
-
locationId;
|
|
24
|
-
loaderId;
|
|
25
|
-
unitId;
|
|
26
|
-
targetConsumedQuantity;
|
|
27
|
-
/**
|
|
28
|
-
* Where the material sits while the process holds it. An ordinary location;
|
|
29
|
-
* the host decides which of its own means "in the hands of a process".
|
|
30
|
-
*/
|
|
31
|
-
targetLocationId;
|
|
32
|
-
targetLoaderId;
|
|
33
|
-
orderId;
|
|
34
|
-
removedAt;
|
|
35
|
-
location;
|
|
36
|
-
loader;
|
|
37
|
-
order;
|
|
38
|
-
changes;
|
|
39
|
-
};
|
|
40
|
-
__decorate([
|
|
41
|
-
PrimaryGeneratedColumn('uuid'),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], ConsumptionOrderItemEntityClass.prototype, "id", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
Column({ type: 'uuid' }),
|
|
46
|
-
Index(),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], ConsumptionOrderItemEntityClass.prototype, "materialId", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
Column({ type: 'uuid' }),
|
|
51
|
-
Index(),
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], ConsumptionOrderItemEntityClass.prototype, "batchId", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
Column({ type: 'uuid' }),
|
|
56
|
-
Index(),
|
|
57
|
-
__metadata("design:type", String)
|
|
58
|
-
], ConsumptionOrderItemEntityClass.prototype, "locationId", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
Column({ type: 'uuid', nullable: true }),
|
|
61
|
-
__metadata("design:type", Object)
|
|
62
|
-
], ConsumptionOrderItemEntityClass.prototype, "loaderId", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
Column({ type: 'uuid', nullable: true }),
|
|
65
|
-
__metadata("design:type", Object)
|
|
66
|
-
], ConsumptionOrderItemEntityClass.prototype, "unitId", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
Column({ type: 'numeric' }),
|
|
69
|
-
__metadata("design:type", Number)
|
|
70
|
-
], ConsumptionOrderItemEntityClass.prototype, "targetConsumedQuantity", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
Column({ type: 'uuid', nullable: true }),
|
|
73
|
-
Index(),
|
|
74
|
-
__metadata("design:type", Object)
|
|
75
|
-
], ConsumptionOrderItemEntityClass.prototype, "targetLocationId", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
Column({ type: 'uuid', nullable: true }),
|
|
78
|
-
Index(),
|
|
79
|
-
__metadata("design:type", Object)
|
|
80
|
-
], ConsumptionOrderItemEntityClass.prototype, "targetLoaderId", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
Column({ type: 'uuid' }),
|
|
83
|
-
Index(),
|
|
84
|
-
__metadata("design:type", String)
|
|
85
|
-
], ConsumptionOrderItemEntityClass.prototype, "orderId", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
Column({ type: 'timestamptz', nullable: true }),
|
|
88
|
-
__metadata("design:type", Object)
|
|
89
|
-
], ConsumptionOrderItemEntityClass.prototype, "removedAt", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
ManyToOne('locations'),
|
|
92
|
-
JoinColumn({ name: 'locationId', referencedColumnName: 'id' }),
|
|
93
|
-
__metadata("design:type", LocationEntityClass)
|
|
94
|
-
], ConsumptionOrderItemEntityClass.prototype, "location", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
ManyToOne('loaders'),
|
|
97
|
-
JoinColumn({ name: 'loaderId', referencedColumnName: 'id' }),
|
|
98
|
-
__metadata("design:type", LoadersEntityClass)
|
|
99
|
-
], ConsumptionOrderItemEntityClass.prototype, "loader", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
ManyToOne('consumption_orders', (entity) => entity.items),
|
|
102
|
-
JoinColumn({ name: 'orderId', referencedColumnName: 'id' }),
|
|
103
|
-
__metadata("design:type", ConsumptionOrderEntityClass)
|
|
104
|
-
], ConsumptionOrderItemEntityClass.prototype, "order", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
OneToMany('consumption_order_changes', (change) => change.item),
|
|
107
|
-
__metadata("design:type", Array)
|
|
108
|
-
], ConsumptionOrderItemEntityClass.prototype, "changes", void 0);
|
|
109
|
-
ConsumptionOrderItemEntityClass = __decorate([
|
|
110
|
-
Entity('consumption_order_items'),
|
|
111
|
-
TableInheritance({ column: { type: 'varchar', name: 'entityName' } })
|
|
112
|
-
], ConsumptionOrderItemEntityClass);
|
|
113
|
-
|
|
114
|
-
export { ConsumptionOrderItemEntity, ConsumptionOrderItemEntityClass };
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { PrimaryGeneratedColumn, Column, Index, CreateDateColumn, OneToMany, Entity, TableInheritance } from 'typeorm';
|
|
3
|
-
|
|
4
|
-
const ConsumptionOrderEntity = Symbol('ConsumptionOrderEntity');
|
|
5
|
-
/**
|
|
6
|
-
* Material handed to a process that consumes it.
|
|
7
|
-
*
|
|
8
|
-
* One order covers the whole life of that handover: issue material out to a
|
|
9
|
-
* consuming location, take back what was not used, and settle what was. Three
|
|
10
|
-
* actions on one document rather than three documents, which is the grammar
|
|
11
|
-
* every other stateful order here already uses -- hold/release, allocate/
|
|
12
|
-
* deallocate and transfer/cancel are each a single order too.
|
|
13
|
-
*
|
|
14
|
-
* Nothing about it is specific to manufacturing. "Give stock to a process that
|
|
15
|
-
* eats some of it, possibly returns the rest, and may produce something else"
|
|
16
|
-
* is equally a subcontract, a repair job, a teardown, or a kitchen prep list.
|
|
17
|
-
* What the process *is* belongs in `order_references`.
|
|
18
|
-
*
|
|
19
|
-
* The consuming location is an ordinary location, and material sitting there is
|
|
20
|
-
* ordinary `FREE` stock. There is no work-in-progress status: status in this
|
|
21
|
-
* model is a flag on the batch, so a status would force every partial issue to
|
|
22
|
-
* split a child batch off, and a batch key per issue is a worse answer than a
|
|
23
|
-
* location. `excludeLocationIds` is how a stock report leaves that location
|
|
24
|
-
* out.
|
|
25
|
-
*/
|
|
26
|
-
let ConsumptionOrderEntityClass = class ConsumptionOrderEntityClass {
|
|
27
|
-
id;
|
|
28
|
-
key;
|
|
29
|
-
description;
|
|
30
|
-
createdBy;
|
|
31
|
-
removedAt;
|
|
32
|
-
createdAt;
|
|
33
|
-
items;
|
|
34
|
-
};
|
|
35
|
-
__decorate([
|
|
36
|
-
PrimaryGeneratedColumn('uuid'),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
|
-
], ConsumptionOrderEntityClass.prototype, "id", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
Column({ type: 'varchar', unique: true }),
|
|
41
|
-
Index(),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], ConsumptionOrderEntityClass.prototype, "key", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
Column({ type: 'text', nullable: true }),
|
|
46
|
-
__metadata("design:type", Object)
|
|
47
|
-
], ConsumptionOrderEntityClass.prototype, "description", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
Column({ type: 'varchar', nullable: true }),
|
|
50
|
-
__metadata("design:type", Object)
|
|
51
|
-
], ConsumptionOrderEntityClass.prototype, "createdBy", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
Column({ type: 'timestamptz', nullable: true }),
|
|
54
|
-
__metadata("design:type", Object)
|
|
55
|
-
], ConsumptionOrderEntityClass.prototype, "removedAt", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
CreateDateColumn({ type: 'timestamptz' }),
|
|
58
|
-
__metadata("design:type", Date)
|
|
59
|
-
], ConsumptionOrderEntityClass.prototype, "createdAt", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
OneToMany('consumption_order_items', (entity) => entity.order),
|
|
62
|
-
__metadata("design:type", Array)
|
|
63
|
-
], ConsumptionOrderEntityClass.prototype, "items", void 0);
|
|
64
|
-
ConsumptionOrderEntityClass = __decorate([
|
|
65
|
-
Entity('consumption_orders'),
|
|
66
|
-
TableInheritance({ column: { type: 'varchar', name: 'entityName' } })
|
|
67
|
-
], ConsumptionOrderEntityClass);
|
|
68
|
-
|
|
69
|
-
export { ConsumptionOrderEntity, ConsumptionOrderEntityClass };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { OrderEntity } from '@rytass/wms-base-nestjs-module';
|
|
3
|
-
import { PrimaryGeneratedColumn, Column, OneToOne, JoinColumn, ManyToOne, Entity } from 'typeorm';
|
|
4
|
-
import { HoldInventoryOrderItemEntityClass } from './hold-inventory-order-item.entity.mjs';
|
|
5
|
-
|
|
6
|
-
const HoldInventoryOrderChangeEntity = Symbol('HoldInventoryOrderChangeEntity');
|
|
7
|
-
let HoldInventoryOrderChangeEntityClass = class HoldInventoryOrderChangeEntityClass {
|
|
8
|
-
id;
|
|
9
|
-
itemId;
|
|
10
|
-
quantityChanged;
|
|
11
|
-
order;
|
|
12
|
-
item;
|
|
13
|
-
};
|
|
14
|
-
__decorate([
|
|
15
|
-
PrimaryGeneratedColumn('uuid'),
|
|
16
|
-
__metadata("design:type", String)
|
|
17
|
-
], HoldInventoryOrderChangeEntityClass.prototype, "id", void 0);
|
|
18
|
-
__decorate([
|
|
19
|
-
Column({ type: 'uuid' }),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], HoldInventoryOrderChangeEntityClass.prototype, "itemId", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
Column({ type: 'numeric' }),
|
|
24
|
-
__metadata("design:type", Number)
|
|
25
|
-
], HoldInventoryOrderChangeEntityClass.prototype, "quantityChanged", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
OneToOne('orders'),
|
|
28
|
-
JoinColumn({ name: 'id', referencedColumnName: 'id' }),
|
|
29
|
-
__metadata("design:type", OrderEntity)
|
|
30
|
-
], HoldInventoryOrderChangeEntityClass.prototype, "order", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
ManyToOne('hold_inventory_order_items', (item) => item.changes, { onDelete: 'CASCADE', orphanedRowAction: 'delete' }),
|
|
33
|
-
JoinColumn({ name: 'itemId', referencedColumnName: 'id' }),
|
|
34
|
-
__metadata("design:type", HoldInventoryOrderItemEntityClass)
|
|
35
|
-
], HoldInventoryOrderChangeEntityClass.prototype, "item", void 0);
|
|
36
|
-
HoldInventoryOrderChangeEntityClass = __decorate([
|
|
37
|
-
Entity('hold_inventory_order_changes')
|
|
38
|
-
], HoldInventoryOrderChangeEntityClass);
|
|
39
|
-
|
|
40
|
-
export { HoldInventoryOrderChangeEntity, HoldInventoryOrderChangeEntityClass };
|