@things-factory/warehouse-base 8.0.0-beta.9 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/service/inventory/inventory-mutation.js +15 -4
- package/dist-server/service/inventory/inventory-mutation.js.map +1 -1
- package/dist-server/service/inventory/inventory-query.d.ts +2 -0
- package/dist-server/service/inventory/inventory-query.js +5 -1
- package/dist-server/service/inventory/inventory-query.js.map +1 -1
- package/dist-server/service/inventory/inventory-types.d.ts +4 -0
- package/dist-server/service/inventory/inventory-types.js +16 -0
- package/dist-server/service/inventory/inventory-types.js.map +1 -1
- package/dist-server/service/inventory/inventory.d.ts +2 -0
- package/dist-server/service/inventory/inventory.js +12 -0
- package/dist-server/service/inventory/inventory.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-mutation.js +24 -0
- package/dist-server/service/warehouse/warehouse-mutation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/server/constants/index.ts +5 -0
- package/server/constants/inventory.ts +67 -0
- package/server/constants/location.ts +14 -0
- package/server/constants/pallet.ts +10 -0
- package/server/constants/rule-type.ts +5 -0
- package/server/constants/tote.ts +5 -0
- package/server/controllers/ecommerce/ecommerce-controller.ts +108 -0
- package/server/controllers/ecommerce/index.ts +2 -0
- package/server/controllers/ecommerce/sellercraft-controller.ts +100 -0
- package/server/controllers/index.ts +2 -0
- package/server/controllers/warehouse-controller.ts +181 -0
- package/server/index.ts +9 -0
- package/server/middlewares/index.ts +0 -0
- package/server/migrations/index.ts +9 -0
- package/server/service/index.ts +80 -0
- package/server/service/inventory/index.ts +6 -0
- package/server/service/inventory/inventory-mutation.ts +530 -0
- package/server/service/inventory/inventory-query.ts +1263 -0
- package/server/service/inventory/inventory-types.ts +367 -0
- package/server/service/inventory/inventory.ts +408 -0
- package/server/service/inventory-change/index.ts +6 -0
- package/server/service/inventory-change/inventory-change-mutation.ts +969 -0
- package/server/service/inventory-change/inventory-change-query.ts +93 -0
- package/server/service/inventory-change/inventory-change-types.ts +36 -0
- package/server/service/inventory-change/inventory-change.ts +164 -0
- package/server/service/inventory-history/index.ts +6 -0
- package/server/service/inventory-history/inventory-history-mutation.ts +116 -0
- package/server/service/inventory-history/inventory-history-query.ts +1845 -0
- package/server/service/inventory-history/inventory-history-types.ts +444 -0
- package/server/service/inventory-history/inventory-history.ts +203 -0
- package/server/service/inventory-item/index.ts +6 -0
- package/server/service/inventory-item/inventory-item-mutation.ts +217 -0
- package/server/service/inventory-item/inventory-item-query.ts +226 -0
- package/server/service/inventory-item/inventory-item-type.ts +74 -0
- package/server/service/inventory-item/inventory-item.ts +105 -0
- package/server/service/inventory-item-change/index.ts +6 -0
- package/server/service/inventory-item-change/inventory-item-change-mutation.ts +119 -0
- package/server/service/inventory-item-change/inventory-item-change-query.ts +47 -0
- package/server/service/inventory-item-change/inventory-item-change-type.ts +68 -0
- package/server/service/inventory-item-change/inventory-item-change.ts +92 -0
- package/server/service/inventory-product/index.ts +6 -0
- package/server/service/inventory-product/inventory-product-mutation.ts +116 -0
- package/server/service/inventory-product/inventory-product-query.ts +47 -0
- package/server/service/inventory-product/inventory-product-type.ts +59 -0
- package/server/service/inventory-product/inventory-product.ts +88 -0
- package/server/service/location/index.ts +6 -0
- package/server/service/location/location-mutation.ts +134 -0
- package/server/service/location/location-query.ts +244 -0
- package/server/service/location/location-types.ts +173 -0
- package/server/service/location/location.ts +121 -0
- package/server/service/movement/index.ts +6 -0
- package/server/service/movement/movement-mutation.ts +60 -0
- package/server/service/movement/movement-query.ts +263 -0
- package/server/service/movement/movement-types.ts +74 -0
- package/server/service/movement/movement.ts +81 -0
- package/server/service/pallet/index.ts +6 -0
- package/server/service/pallet/pallet-mutation.ts +242 -0
- package/server/service/pallet/pallet-query.ts +106 -0
- package/server/service/pallet/pallet-types.ts +80 -0
- package/server/service/pallet/pallet.ts +92 -0
- package/server/service/pallet-count/index.ts +6 -0
- package/server/service/pallet-count/pallet-count-mutation.ts +151 -0
- package/server/service/pallet-count/pallet-count-query.ts +45 -0
- package/server/service/pallet-count/pallet-count-types.ts +36 -0
- package/server/service/pallet-count/pallet-count.ts +70 -0
- package/server/service/pallet-history/index.ts +6 -0
- package/server/service/pallet-history/pallet-history-mutation.ts +114 -0
- package/server/service/pallet-history/pallet-history-query.ts +48 -0
- package/server/service/pallet-history/pallet-history-types.ts +36 -0
- package/server/service/pallet-history/pallet-history.ts +89 -0
- package/server/service/reduced-inventory-history/index.ts +3 -0
- package/server/service/reduced-inventory-history/reduced-inventory-history.ts +92 -0
- package/server/service/tote/index.ts +6 -0
- package/server/service/tote/tote-mutation.ts +201 -0
- package/server/service/tote/tote-query.ts +106 -0
- package/server/service/tote/tote-types.ts +44 -0
- package/server/service/tote/tote.ts +77 -0
- package/server/service/warehouse/index.ts +6 -0
- package/server/service/warehouse/warehouse-mutation.ts +152 -0
- package/server/service/warehouse/warehouse-query.ts +58 -0
- package/server/service/warehouse/warehouse-types.ts +50 -0
- package/server/service/warehouse/warehouse.ts +95 -0
- package/server/utils/datetime-util.ts +54 -0
- package/server/utils/index.ts +3 -0
- package/server/utils/inventory-no-generator.ts +15 -0
- package/server/utils/inventory-util.ts +490 -0
|
@@ -61,6 +61,8 @@ let Inventory = class Inventory {
|
|
|
61
61
|
this.creatorId = obj.inventory_creator_id;
|
|
62
62
|
this.updaterId = obj.inventory_updater_id;
|
|
63
63
|
this.lot = obj.inventory_lot;
|
|
64
|
+
this.isMachineFiltering = obj.is_machine_filtering;
|
|
65
|
+
this.origin = obj.origin;
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
};
|
|
@@ -445,6 +447,16 @@ tslib_1.__decorate([
|
|
|
445
447
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
446
448
|
tslib_1.__metadata("design:type", String)
|
|
447
449
|
], Inventory.prototype, "lot", void 0);
|
|
450
|
+
tslib_1.__decorate([
|
|
451
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '기계 선별 여부', default: false }),
|
|
452
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
453
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
454
|
+
], Inventory.prototype, "isMachineFiltering", void 0);
|
|
455
|
+
tslib_1.__decorate([
|
|
456
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '원산지' }),
|
|
457
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
458
|
+
tslib_1.__metadata("design:type", String)
|
|
459
|
+
], Inventory.prototype, "origin", void 0);
|
|
448
460
|
tslib_1.__decorate([
|
|
449
461
|
(0, typeorm_1.ManyToOne)(type => Inventory, { nullable: true }),
|
|
450
462
|
(0, type_graphql_1.Field)(type => Inventory, { nullable: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../../server/service/inventory/inventory.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,qCAUgB;AAEhB,yDAAgD;AAChD,uDAAmD;AACnD,+DAAqE;AACrE,iDAA4E;AAE5E,2EAAsE;AACtE,qEAAgE;AAChE,mDAA+C;AAC/C,6CAAyC;AACzC,sDAAkD;AAM3C,IAAM,SAAS,GAAf,MAAM,SAAS;IAgUpB,YAAY,GAAI;QACd,IAAI,GAAG,EAAE,CAAC;YACR,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,YAAY,CAAA;YAC1B,IAAI,CAAC,QAAQ,GAAG;gBACd,EAAE,EAAE,GAAG,CAAC,WAAW;gBACnB,IAAI,EAAE,GAAG,CAAC,aAAa;gBACvB,WAAW,EAAE,GAAG,CAAC,oBAAoB;aAC/B,CAAA;YACR,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAO,CAAC,GAAG,CAAC,CAAA;YAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,CAAC,GAAG,CAAC,CAAA;YACjC,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,CAAC,GAAG,CAAC,CAAA;YACnC,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graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace } from '@things-factory/biz-base'\nimport { Product, ProductDetail } from '@things-factory/product-base'\nimport { Domain, ScalarDate, roundTransformer } from '@things-factory/shell'\n\nimport { InventoryChange } from '../inventory-change/inventory-change'\nimport { InventoryItem } from '../inventory-item/inventory-item'\nimport { Location } from '../location/location'\nimport { Pallet } from '../pallet/pallet'\nimport { Warehouse } from '../warehouse/warehouse'\n\n@Entity()\n@Index('ix_inventory_0', (inventory: Inventory) => [inventory.domain, inventory.palletId], { unique: true })\n@Index('inventories_product_id_and_status', (inventory: Inventory) => [inventory.product, inventory.status])\n@ObjectType()\nexport class Inventory {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain: Domain\n\n @RelationId((inventory: Inventory) => inventory.domain)\n domainId: string\n\n @ManyToOne(type => Bizplace, { nullable: true })\n @Field(type => Bizplace, { nullable: true })\n bizplace: Bizplace\n\n @ManyToOne(type => Inventory)\n @Field(type => Inventory)\n refInventory: Inventory\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n palletId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n cartonId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n batchId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n batchIdRef: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n refOrderId: string\n\n /**\n * Expected: Putting ManyToOne relation with OrderProduct to find out unloaded inventories within unloading process\n * Because if there's inventory which has same batch id with others but different product id\n * then can't find out exact same inventory by batch id as a condition to find\n *\n * Problem: Because of circular dependency problem.\n * OrderProduct entity comes from sales-base module and the module is looking for warehouse-base module\n *\n * Solution: Putting plain orderProductId field instead of ManyToOne relation for this release (2.2.0-beta)\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n orderProductId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n orderInventoryId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n orderVasId: string\n\n @ManyToOne(type => Pallet, { nullable: true })\n @Field(type => Pallet, { nullable: true })\n reusablePallet: Pallet\n\n @ManyToOne(type => Product, { nullable: true })\n @Field({ nullable: true })\n product: Product\n\n /**\n * To be updated to remove nullable. once all process that links to inventory has been updated to use product detail instead of product\n */\n @ManyToOne(type => ProductDetail, { nullable: true })\n @Field({ nullable: true })\n productDetail: ProductDetail\n\n @ManyToOne(type => Warehouse, { nullable: true })\n @Field(type => Warehouse, { nullable: true })\n warehouse: Warehouse\n\n @ManyToOne(type => Location)\n @Field(type => Location, { nullable: true })\n location: Location\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n zone: string\n\n @Column('int', { nullable: true })\n @Field({ nullable: true })\n manufactureYear: number\n\n @Column('date', { nullable: true })\n @Field(type => ScalarDate, { nullable: true })\n manufactureDate: Date\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n costPrice: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n sellPrice: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n packingType: string\n\n @Column('float', { nullable: true, default: 1, transformer: roundTransformer })\n @Field({ nullable: true })\n packingSize: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n unit: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n uom: string\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n uomValue: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n lockedUomValue: number\n\n @Column('float', { transformer: roundTransformer })\n @Field({ nullable: true })\n qty: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n lockedQty: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n unitCost: number\n\n @Column({ default: 0 })\n @Field()\n lastSeq: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n status: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n otherRef: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n remark: string\n\n @OneToMany(type => InventoryChange, inventoryChanges => inventoryChanges.inventory)\n @Field(type => [InventoryChange], { nullable: true })\n inventoryChanges: InventoryChange[]\n\n @OneToMany(type => InventoryItem, inventoryItems => inventoryItems.inventory)\n @Field(type => [InventoryItem], { nullable: true })\n inventoryItems: InventoryItem[]\n\n @Field({ nullable: true })\n serialNumbers?: string\n\n @Column('date', { nullable: true })\n @Field(type => ScalarDate, { nullable: true })\n expirationDate: Date\n\n @Field({ nullable: true })\n productId: string\n\n @Field({ nullable: true })\n productName: string\n\n @Field({ nullable: true })\n productSKU: string\n\n @Field({ nullable: true })\n productType: string\n\n @Field({ nullable: true })\n primaryValue: string\n\n @Field({ nullable: true })\n primaryUnit: string\n\n @Field({ nullable: true })\n auxUnit1: string\n\n @Field({ nullable: true })\n productBrand: string\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n productColor?: string\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n productQuality?: string\n\n // 작업 구분\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n workCategory?: string\n\n // 제품 상태 (불량/반품)\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n productStatus?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n auxInfo1?: string\n\n // 자호\n @Column({ nullable: true })\n @Field({ nullable: true })\n auxInfo2?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n auxInfo3?: string\n\n @Field(type => Float, { nullable: true })\n averageUnitCost: number\n\n @Field(type => Float, { nullable: true })\n remainQty: number\n\n @Field(type => Int, { nullable: true })\n nonLoadedQty: number\n\n @Field(type => Float, { nullable: true })\n nonLoadedUomValue: number\n\n @Field({ nullable: true })\n initialInboundAt: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((inventory: Inventory) => inventory.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((inventory: Inventory) => inventory.updater)\n updaterId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @Field({ nullable: true })\n remainUomValueWithUom?: string\n\n @Field({ nullable: true })\n remainUomValue?: number\n\n @Field({ nullable: true })\n changeCount?: number\n\n @Field({ nullable: true })\n binLocation?: string\n\n @Field({ nullable: true })\n orderNo?: string\n\n @Field({ nullable: true })\n inventoryItemCount: number\n\n @Field({ nullable: true })\n availableQty: number\n\n @Field({ nullable: true })\n releaseQty: number\n\n @Field({ nullable: true })\n quarantineQty: number\n\n @Field({ nullable: true })\n reserveQty: number\n\n @Field({ nullable: true })\n warehouseQty: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n lot?: string\n\n @ManyToOne(type => Inventory, { nullable: true })\n @Field(type => Inventory, { nullable: true })\n originInventory?: Inventory\n\n @RelationId((inventory: Inventory) => inventory.originInventory)\n originInventoryId?: string\n\n constructor(obj?) {\n if (obj) {\n this.id = obj.inventory_id\n this.bizplace = {\n id: obj.bizplace_id,\n name: obj.bizplace_name,\n description: obj.bizplace_description\n } as any\n this.product = new Product(obj)\n this.location = new Location(obj)\n this.warehouse = new Warehouse(obj)\n this.name = obj.inventory_name\n this.palletId = obj.inventory_pallet_id\n this.batchId = obj.inventory_batch_id\n this.refOrderId = obj.inventory_ref_order_id\n this.orderProductId = obj.inventory_order_product_id\n this.zone = obj.inventory_zone\n this.costPrice = obj.inventory_cost_price\n this.sellPrice = obj.inventory_sell_price\n this.packingType = obj.inventory_packing_type\n this.unit = obj.inventory_unit\n this.uom = obj.inventory_uom\n this.uomValue = obj.inventory_uom_value\n this.lockedUomValue = obj.inventory_locked_uom_value\n this.qty = obj.inventory_qty\n this.lockedQty = obj.inventory_locked_qty\n this.lastSeq = obj.inventory_last_seq\n this.description = obj.inventory_description\n this.status = obj.inventory_status\n this.otherRef = obj.inventory_other_ref\n this.remark = obj.inventory_remark\n this.createdAt = obj.inventory_created_at\n this.updatedAt = obj.inventory_updated_at\n this.expirationDate = obj.inventory_expiration_date\n this.unitCost = obj.inventory_unit_cost\n this.manufactureYear = obj.inventory_manufacture_year\n this.manufactureDate = obj.inventory_manufacture_date\n this.batchIdRef = obj.inventory_batch_id_ref\n this.cartonId = obj.inventory_carton_id\n this.packingSize = obj.inventory_packing_size\n this.productColor = obj.inventory_product_color\n this.productQuality = obj.inventory_product_quality\n this.workCategory = obj.inventory_work_category\n this.productStatus = obj.inventory_product_status\n this.creatorId = obj.inventory_creator_id\n this.updaterId = obj.inventory_updater_id\n this.lot = obj.inventory_lot\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../../server/service/inventory/inventory.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,qCAUgB;AAEhB,yDAAgD;AAChD,uDAAmD;AACnD,+DAAqE;AACrE,iDAA4E;AAE5E,2EAAsE;AACtE,qEAAgE;AAChE,mDAA+C;AAC/C,6CAAyC;AACzC,sDAAkD;AAM3C,IAAM,SAAS,GAAf,MAAM,SAAS;IAwUpB,YAAY,GAAI;QACd,IAAI,GAAG,EAAE,CAAC;YACR,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,YAAY,CAAA;YAC1B,IAAI,CAAC,QAAQ,GAAG;gBACd,EAAE,EAAE,GAAG,CAAC,WAAW;gBACnB,IAAI,EAAE,GAAG,CAAC,aAAa;gBACvB,WAAW,EAAE,GAAG,CAAC,oBAAoB;aAC/B,CAAA;YACR,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAO,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IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC3B,SAAS;kDAAA;AAG3B;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC;;oDACtC;oBAtUf,SAAS;IAJrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC3G,IAAA,eAAK,EAAC,mCAAmC,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3G,IAAA,yBAAU,GAAE;;GACA,SAAS,CA2XrB","sourcesContent":["import { Field, Float, ID, Int, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace } from '@things-factory/biz-base'\nimport { Product, ProductDetail } from '@things-factory/product-base'\nimport { Domain, ScalarDate, roundTransformer } from '@things-factory/shell'\n\nimport { InventoryChange } from '../inventory-change/inventory-change'\nimport { InventoryItem } from '../inventory-item/inventory-item'\nimport { Location } from '../location/location'\nimport { Pallet } from '../pallet/pallet'\nimport { Warehouse } from '../warehouse/warehouse'\n\n@Entity()\n@Index('ix_inventory_0', (inventory: Inventory) => [inventory.domain, inventory.palletId], { unique: true })\n@Index('inventories_product_id_and_status', (inventory: Inventory) => [inventory.product, inventory.status])\n@ObjectType()\nexport class Inventory {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain: Domain\n\n @RelationId((inventory: Inventory) => inventory.domain)\n domainId: string\n\n @ManyToOne(type => Bizplace, { nullable: true })\n @Field(type => Bizplace, { nullable: true })\n bizplace: Bizplace\n\n @ManyToOne(type => Inventory)\n @Field(type => Inventory)\n refInventory: Inventory\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n palletId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n cartonId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n batchId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n batchIdRef: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n refOrderId: string\n\n /**\n * Expected: Putting ManyToOne relation with OrderProduct to find out unloaded inventories within unloading process\n * Because if there's inventory which has same batch id with others but different product id\n * then can't find out exact same inventory by batch id as a condition to find\n *\n * Problem: Because of circular dependency problem.\n * OrderProduct entity comes from sales-base module and the module is looking for warehouse-base module\n *\n * Solution: Putting plain orderProductId field instead of ManyToOne relation for this release (2.2.0-beta)\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n orderProductId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n orderInventoryId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n orderVasId: string\n\n @ManyToOne(type => Pallet, { nullable: true })\n @Field(type => Pallet, { nullable: true })\n reusablePallet: Pallet\n\n @ManyToOne(type => Product, { nullable: true })\n @Field({ nullable: true })\n product: Product\n\n /**\n * To be updated to remove nullable. once all process that links to inventory has been updated to use product detail instead of product\n */\n @ManyToOne(type => ProductDetail, { nullable: true })\n @Field({ nullable: true })\n productDetail: ProductDetail\n\n @ManyToOne(type => Warehouse, { nullable: true })\n @Field(type => Warehouse, { nullable: true })\n warehouse: Warehouse\n\n @ManyToOne(type => Location)\n @Field(type => Location, { nullable: true })\n location: Location\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n zone: string\n\n @Column('int', { nullable: true })\n @Field({ nullable: true })\n manufactureYear: number\n\n @Column('date', { nullable: true })\n @Field(type => ScalarDate, { nullable: true })\n manufactureDate: Date\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n costPrice: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n sellPrice: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n packingType: string\n\n @Column('float', { nullable: true, default: 1, transformer: roundTransformer })\n @Field({ nullable: true })\n packingSize: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n unit: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n uom: string\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n uomValue: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n lockedUomValue: number\n\n @Column('float', { transformer: roundTransformer })\n @Field({ nullable: true })\n qty: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n lockedQty: number\n\n @Column('float', { nullable: true, transformer: roundTransformer })\n @Field({ nullable: true })\n unitCost: number\n\n @Column({ default: 0 })\n @Field()\n lastSeq: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n status: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n otherRef: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n remark: string\n\n @OneToMany(type => InventoryChange, inventoryChanges => inventoryChanges.inventory)\n @Field(type => [InventoryChange], { nullable: true })\n inventoryChanges: InventoryChange[]\n\n @OneToMany(type => InventoryItem, inventoryItems => inventoryItems.inventory)\n @Field(type => [InventoryItem], { nullable: true })\n inventoryItems: InventoryItem[]\n\n @Field({ nullable: true })\n serialNumbers?: string\n\n @Column('date', { nullable: true })\n @Field(type => ScalarDate, { nullable: true })\n expirationDate: Date\n\n @Field({ nullable: true })\n productId: string\n\n @Field({ nullable: true })\n productName: string\n\n @Field({ nullable: true })\n productSKU: string\n\n @Field({ nullable: true })\n productType: string\n\n @Field({ nullable: true })\n primaryValue: string\n\n @Field({ nullable: true })\n primaryUnit: string\n\n @Field({ nullable: true })\n auxUnit1: string\n\n @Field({ nullable: true })\n productBrand: string\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n productColor?: string\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n productQuality?: string\n\n // 작업 구분\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n workCategory?: string\n\n // 제품 상태 (불량/반품)\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n productStatus?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n auxInfo1?: string\n\n // 자호\n @Column({ nullable: true })\n @Field({ nullable: true })\n auxInfo2?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n auxInfo3?: string\n\n @Field(type => Float, { nullable: true })\n averageUnitCost: number\n\n @Field(type => Float, { nullable: true })\n remainQty: number\n\n @Field(type => Int, { nullable: true })\n nonLoadedQty: number\n\n @Field(type => Float, { nullable: true })\n nonLoadedUomValue: number\n\n @Field({ nullable: true })\n initialInboundAt: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((inventory: Inventory) => inventory.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((inventory: Inventory) => inventory.updater)\n updaterId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @Field({ nullable: true })\n remainUomValueWithUom?: string\n\n @Field({ nullable: true })\n remainUomValue?: number\n\n @Field({ nullable: true })\n changeCount?: number\n\n @Field({ nullable: true })\n binLocation?: string\n\n @Field({ nullable: true })\n orderNo?: string\n\n @Field({ nullable: true })\n inventoryItemCount: number\n\n @Field({ nullable: true })\n availableQty: number\n\n @Field({ nullable: true })\n releaseQty: number\n\n @Field({ nullable: true })\n quarantineQty: number\n\n @Field({ nullable: true })\n reserveQty: number\n\n @Field({ nullable: true })\n warehouseQty: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n lot?: string\n\n @Column({ nullable: true, comment: '기계 선별 여부', default: false })\n @Field({ nullable: true })\n isMachineFiltering?: boolean\n\n @Column({ nullable: true, comment: '원산지' })\n @Field({ nullable: true })\n origin?: string\n\n @ManyToOne(type => Inventory, { nullable: true })\n @Field(type => Inventory, { nullable: true })\n originInventory?: Inventory\n\n @RelationId((inventory: Inventory) => inventory.originInventory)\n originInventoryId?: string\n\n constructor(obj?) {\n if (obj) {\n this.id = obj.inventory_id\n this.bizplace = {\n id: obj.bizplace_id,\n name: obj.bizplace_name,\n description: obj.bizplace_description\n } as any\n this.product = new Product(obj)\n this.location = new Location(obj)\n this.warehouse = new Warehouse(obj)\n this.name = obj.inventory_name\n this.palletId = obj.inventory_pallet_id\n this.batchId = obj.inventory_batch_id\n this.refOrderId = obj.inventory_ref_order_id\n this.orderProductId = obj.inventory_order_product_id\n this.zone = obj.inventory_zone\n this.costPrice = obj.inventory_cost_price\n this.sellPrice = obj.inventory_sell_price\n this.packingType = obj.inventory_packing_type\n this.unit = obj.inventory_unit\n this.uom = obj.inventory_uom\n this.uomValue = obj.inventory_uom_value\n this.lockedUomValue = obj.inventory_locked_uom_value\n this.qty = obj.inventory_qty\n this.lockedQty = obj.inventory_locked_qty\n this.lastSeq = obj.inventory_last_seq\n this.description = obj.inventory_description\n this.status = obj.inventory_status\n this.otherRef = obj.inventory_other_ref\n this.remark = obj.inventory_remark\n this.createdAt = obj.inventory_created_at\n this.updatedAt = obj.inventory_updated_at\n this.expirationDate = obj.inventory_expiration_date\n this.unitCost = obj.inventory_unit_cost\n this.manufactureYear = obj.inventory_manufacture_year\n this.manufactureDate = obj.inventory_manufacture_date\n this.batchIdRef = obj.inventory_batch_id_ref\n this.cartonId = obj.inventory_carton_id\n this.packingSize = obj.inventory_packing_size\n this.productColor = obj.inventory_product_color\n this.productQuality = obj.inventory_product_quality\n this.workCategory = obj.inventory_work_category\n this.productStatus = obj.inventory_product_status\n this.creatorId = obj.inventory_creator_id\n this.updaterId = obj.inventory_updater_id\n this.lot = obj.inventory_lot\n this.isMachineFiltering = obj.is_machine_filtering\n this.origin = obj.origin\n }\n }\n}\n"]}
|
|
@@ -7,8 +7,10 @@ exports.deleteWarehouse = deleteWarehouse;
|
|
|
7
7
|
exports.deleteWarehouses = deleteWarehouses;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const type_graphql_1 = require("type-graphql");
|
|
10
|
+
const typeorm_1 = require("typeorm");
|
|
10
11
|
const warehouse_1 = require("./warehouse");
|
|
11
12
|
const warehouse_types_1 = require("./warehouse-types");
|
|
13
|
+
const product_base_1 = require("@things-factory/product-base");
|
|
12
14
|
let WarehouseMutation = class WarehouseMutation {
|
|
13
15
|
async createWarehouse(warehouse, context) {
|
|
14
16
|
return await createWarehouse(warehouse, context);
|
|
@@ -37,9 +39,31 @@ let WarehouseMutation = class WarehouseMutation {
|
|
|
37
39
|
return results;
|
|
38
40
|
}
|
|
39
41
|
async deleteWarehouse(id, context) {
|
|
42
|
+
const { domain, user, tx } = context.state;
|
|
43
|
+
const product = await tx.getRepository(product_base_1.Product).findOne({
|
|
44
|
+
where: {
|
|
45
|
+
domain: { id: domain.id },
|
|
46
|
+
warehouseId: (0, typeorm_1.Equal)(id)
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
if (product === null || product === void 0 ? void 0 : product.id) {
|
|
50
|
+
await tx.getRepository(product_base_1.Product).save(Object.assign(Object.assign({}, product), { warehouseId: null }));
|
|
51
|
+
}
|
|
40
52
|
return await deleteWarehouse(id, context);
|
|
41
53
|
}
|
|
42
54
|
async deleteWarehouses(ids, context) {
|
|
55
|
+
const { domain, user, tx } = context.state;
|
|
56
|
+
const products = await tx.getRepository(product_base_1.Product).find({
|
|
57
|
+
where: {
|
|
58
|
+
domain: { id: domain.id },
|
|
59
|
+
warehouseId: (0, typeorm_1.In)(ids)
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
if (products === null || products === void 0 ? void 0 : products.length) {
|
|
63
|
+
await tx.getRepository(product_base_1.Product).save(products.map(i => {
|
|
64
|
+
return Object.assign(Object.assign({}, i), { warehouseId: null });
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
43
67
|
return await deleteWarehouses(ids, context);
|
|
44
68
|
}
|
|
45
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warehouse-mutation.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse-mutation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"warehouse-mutation.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse-mutation.ts"],"names":[],"mappings":";;;AAgHA,0CAUC;AAED,0CAWC;AAED,0CAMC;AAED,4CAMC;;AAvJD,+CAAsE;AACtE,qCAA+C;AAE/C,2CAAuC;AACvC,uDAAgE;AAChE,+DAAsD;AAG/C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAItB,AAAN,KAAK,CAAC,eAAe,CACD,SAAuB,EAClC,OAAwB;QAE/B,OAAO,MAAM,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAKK,AAAN,KAAK,CAAC,eAAe,CACR,EAAU,EACP,KAAqB,EAC5B,OAAwB;QAE/B,OAAO,MAAM,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAKK,AAAN,KAAK,CAAC,uBAAuB,CACe,OAAyB,EAC5D,OAAwB;QAE/B,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,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O,CAAC,KAAK,CAAA;IAE5B,MAAM,UAAU,GAA0B,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAA;IACrE,MAAM,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { Repository, In, Equal } from 'typeorm'\n\nimport { Warehouse } from './warehouse'\nimport { NewWarehouse, WarehousePatch } from './warehouse-types'\nimport { Product } from '@things-factory/product-base'\n\n@Resolver(Warehouse)\nexport class WarehouseMutation {\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Warehouse)\n async createWarehouse(\n @Arg('warehouse') warehouse: NewWarehouse,\n @Ctx() context: ResolverContext\n ): Promise<Warehouse> {\n return await createWarehouse(warehouse, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Warehouse)\n async updateWarehouse(\n @Arg('id') id: string,\n @Arg('patch') patch: WarehousePatch,\n @Ctx() context: ResolverContext\n ): Promise<Warehouse> {\n return await updateWarehouse(id, patch, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => [Warehouse])\n async updateMultipleWarehouse(\n @Arg('patches', type => [WarehousePatch]) patches: WarehousePatch[],\n @Ctx() context: ResolverContext\n ): Promise<Warehouse[]> {\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 createWarehouse(patch as NewWarehouse, 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: WarehousePatch = _updateRecords[i]\n const result = await updateWarehouse(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 deleteWarehouse(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Boolean> {\n const { domain, user, tx } = context.state\n const product = await tx.getRepository(Product).findOne({\n where: {\n domain: { id: domain.id },\n warehouseId: Equal(id)\n }\n })\n\n if (product?.id) {\n await tx.getRepository(Product).save({\n ...product,\n warehouseId: null\n })\n }\n\n return await deleteWarehouse(id, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteWarehouses(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<Boolean> {\n const { domain, user, tx } = context.state\n const products = await tx.getRepository(Product).find({\n where: {\n domain: { id: domain.id },\n warehouseId: In(ids)\n }\n })\n\n if (products?.length) {\n await tx.getRepository(Product).save(\n products.map(i => {\n return {\n ...i,\n warehouseId: null\n }\n })\n )\n }\n\n return await deleteWarehouses(ids, context)\n }\n}\n\nexport async function createWarehouse(warehouse: NewWarehouse, context: ResolverContext): Promise<Warehouse> {\n const { domain, user, tx } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n return await repository.save({\n ...warehouse,\n domain,\n creator: user,\n updater: user\n })\n}\n\nexport async function updateWarehouse(id: string, patch: WarehousePatch, context: ResolverContext): Promise<Warehouse> {\n const { domain, user, tx } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n const warehouse = await repository.findOneBy({ id })\n\n return await repository.save({\n ...warehouse,\n ...patch,\n updater: user\n })\n}\n\nexport async function deleteWarehouse(id: string, context: ResolverContext) {\n const { tx } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n await repository.delete(id)\n return true\n}\n\nexport async function deleteWarehouses(ids: string[], context: ResolverContext) {\n const { tx } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n await repository.delete(ids)\n return true\n}\n"]}
|