@things-factory/sales-base 8.0.2 → 8.0.5

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 (178) hide show
  1. package/dist-server/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +12 -12
  3. package/server/constants/attachment-type.ts +0 -9
  4. package/server/constants/index.ts +0 -7
  5. package/server/constants/load-type.ts +0 -4
  6. package/server/constants/order.ts +0 -203
  7. package/server/constants/product-group-type.ts +0 -4
  8. package/server/constants/release-good.ts +0 -9
  9. package/server/constants/transfer-order-type.ts +0 -6
  10. package/server/constants/validation-error-code.ts +0 -3
  11. package/server/constants/vas-target-type.ts +0 -25
  12. package/server/controllers/ecommerce/ecommerce-controller.ts +0 -122
  13. package/server/controllers/ecommerce/index.ts +0 -2
  14. package/server/controllers/ecommerce/sellercraft-controller.ts +0 -182
  15. package/server/controllers/index.ts +0 -2
  16. package/server/controllers/order-controller.ts +0 -296
  17. package/server/errors/index.ts +0 -1
  18. package/server/errors/validation-error.ts +0 -25
  19. package/server/index.ts +0 -5
  20. package/server/migrations/index.ts +0 -9
  21. package/server/service/arrival-notice/arrival-notice-mutation.ts +0 -1152
  22. package/server/service/arrival-notice/arrival-notice-query.ts +0 -549
  23. package/server/service/arrival-notice/arrival-notice-types.ts +0 -310
  24. package/server/service/arrival-notice/arrival-notice.ts +0 -202
  25. package/server/service/arrival-notice/index.ts +0 -9
  26. package/server/service/claim/claim-mutation.ts +0 -308
  27. package/server/service/claim/claim-query.ts +0 -122
  28. package/server/service/claim/claim-types.ts +0 -130
  29. package/server/service/claim/claim.ts +0 -140
  30. package/server/service/claim/index.ts +0 -9
  31. package/server/service/claim-detail/claim-detail-mutation.ts +0 -102
  32. package/server/service/claim-detail/claim-detail-query.ts +0 -55
  33. package/server/service/claim-detail/claim-detail-types.ts +0 -47
  34. package/server/service/claim-detail/claim-detail.ts +0 -69
  35. package/server/service/claim-detail/index.ts +0 -9
  36. package/server/service/claim-order/claim-order-mutation.ts +0 -101
  37. package/server/service/claim-order/claim-order-query.ts +0 -47
  38. package/server/service/claim-order/claim-order-types.ts +0 -35
  39. package/server/service/claim-order/claim-order.ts +0 -81
  40. package/server/service/claim-order/index.ts +0 -9
  41. package/server/service/collection-order/collection-order-mutation.ts +0 -245
  42. package/server/service/collection-order/collection-order-query.ts +0 -97
  43. package/server/service/collection-order/collection-order-types.ts +0 -165
  44. package/server/service/collection-order/collection-order.ts +0 -135
  45. package/server/service/collection-order/index.ts +0 -9
  46. package/server/service/delivery-order/delivery-order-mutation.ts +0 -967
  47. package/server/service/delivery-order/delivery-order-query.ts +0 -631
  48. package/server/service/delivery-order/delivery-order-types.ts +0 -268
  49. package/server/service/delivery-order/delivery-order.ts +0 -258
  50. package/server/service/delivery-order/index.ts +0 -9
  51. package/server/service/draft-release-good/draft-release-good-mutation.ts +0 -765
  52. package/server/service/draft-release-good/draft-release-good-query.ts +0 -354
  53. package/server/service/draft-release-good/draft-release-good-type.ts +0 -261
  54. package/server/service/draft-release-good/draft-release-good.ts +0 -284
  55. package/server/service/draft-release-good/index.ts +0 -9
  56. package/server/service/goods-receival-note/goods-receival-note-mutation.ts +0 -129
  57. package/server/service/goods-receival-note/goods-receival-note-query.ts +0 -280
  58. package/server/service/goods-receival-note/goods-receival-note-types.ts +0 -105
  59. package/server/service/goods-receival-note/goods-receival-note.ts +0 -127
  60. package/server/service/goods-receival-note/index.ts +0 -9
  61. package/server/service/index.ts +0 -238
  62. package/server/service/inventory-check/index.ts +0 -9
  63. package/server/service/inventory-check/inventory-check-mutation.ts +0 -149
  64. package/server/service/inventory-check/inventory-check-query.ts +0 -48
  65. package/server/service/inventory-check/inventory-check-types.ts +0 -48
  66. package/server/service/inventory-check/inventory-check.ts +0 -90
  67. package/server/service/invoice/index.ts +0 -9
  68. package/server/service/invoice/invoice-mutation.ts +0 -95
  69. package/server/service/invoice/invoice-query.ts +0 -53
  70. package/server/service/invoice/invoice-types.ts +0 -279
  71. package/server/service/invoice/invoice.ts +0 -230
  72. package/server/service/invoice-product/index.ts +0 -9
  73. package/server/service/invoice-product/invoice-product-mutation.ts +0 -54
  74. package/server/service/invoice-product/invoice-product-query.ts +0 -54
  75. package/server/service/invoice-product/invoice-product-types.ts +0 -84
  76. package/server/service/invoice-product/invoice-product.ts +0 -92
  77. package/server/service/job-sheet/index.ts +0 -9
  78. package/server/service/job-sheet/job-sheet-mutation.ts +0 -92
  79. package/server/service/job-sheet/job-sheet-query.ts +0 -112
  80. package/server/service/job-sheet/job-sheet-types.ts +0 -78
  81. package/server/service/job-sheet/job-sheet.ts +0 -102
  82. package/server/service/manifest/index.ts +0 -6
  83. package/server/service/manifest/manifest-mutation.ts +0 -190
  84. package/server/service/manifest/manifest-query.ts +0 -149
  85. package/server/service/manifest/manifest-type.ts +0 -84
  86. package/server/service/manifest/manifest.ts +0 -114
  87. package/server/service/order-inventory/index.ts +0 -9
  88. package/server/service/order-inventory/order-inventory-mutation.ts +0 -54
  89. package/server/service/order-inventory/order-inventory-query.ts +0 -722
  90. package/server/service/order-inventory/order-inventory-types.ts +0 -238
  91. package/server/service/order-inventory/order-inventory.ts +0 -401
  92. package/server/service/order-product/index.ts +0 -9
  93. package/server/service/order-product/order-product-mutation.ts +0 -48
  94. package/server/service/order-product/order-product-query.ts +0 -89
  95. package/server/service/order-product/order-product-types.ts +0 -335
  96. package/server/service/order-product/order-product.ts +0 -362
  97. package/server/service/order-tote/index.ts +0 -9
  98. package/server/service/order-tote/order-tote-mutation.ts +0 -31
  99. package/server/service/order-tote/order-tote-query.ts +0 -112
  100. package/server/service/order-tote/order-tote-types.ts +0 -47
  101. package/server/service/order-tote/order-tote.ts +0 -73
  102. package/server/service/order-tote-item/index.ts +0 -9
  103. package/server/service/order-tote-item/order-tote-item-mutation.ts +0 -31
  104. package/server/service/order-tote-item/order-tote-item-query.ts +0 -82
  105. package/server/service/order-tote-item/order-tote-item-types.ts +0 -56
  106. package/server/service/order-tote-item/order-tote-item.ts +0 -72
  107. package/server/service/order-tote-seal/index.ts +0 -9
  108. package/server/service/order-tote-seal/order-tote-seal-mutation.ts +0 -31
  109. package/server/service/order-tote-seal/order-tote-seal-query.ts +0 -59
  110. package/server/service/order-tote-seal/order-tote-seal-types.ts +0 -41
  111. package/server/service/order-tote-seal/order-tote-seal.ts +0 -46
  112. package/server/service/order-vas/index.ts +0 -9
  113. package/server/service/order-vas/order-vas-mutation.ts +0 -20
  114. package/server/service/order-vas/order-vas-query.ts +0 -72
  115. package/server/service/order-vas/order-vas-types.ts +0 -159
  116. package/server/service/order-vas/order-vas.ts +0 -207
  117. package/server/service/others/index.ts +0 -5
  118. package/server/service/others/other-query.ts +0 -563
  119. package/server/service/others/other-types.ts +0 -115
  120. package/server/service/purchase-order/index.ts +0 -9
  121. package/server/service/purchase-order/purchase-order-mutation.ts +0 -458
  122. package/server/service/purchase-order/purchase-order-query.ts +0 -90
  123. package/server/service/purchase-order/purchase-order-types.ts +0 -154
  124. package/server/service/purchase-order/purchase-order.ts +0 -172
  125. package/server/service/purchase-order-other-charge/index.ts +0 -9
  126. package/server/service/purchase-order-other-charge/purchase-order-other-charge-mutation.ts +0 -31
  127. package/server/service/purchase-order-other-charge/purchase-order-other-charge-query.ts +0 -52
  128. package/server/service/purchase-order-other-charge/purchase-order-other-charge-types.ts +0 -44
  129. package/server/service/purchase-order-other-charge/purchase-order-other-charge.ts +0 -68
  130. package/server/service/release-good/index.ts +0 -9
  131. package/server/service/release-good/release-good-mutation.ts +0 -1686
  132. package/server/service/release-good/release-good-query.ts +0 -980
  133. package/server/service/release-good/release-good-types.ts +0 -662
  134. package/server/service/release-good/release-good.ts +0 -490
  135. package/server/service/retail-replenishment-order/index.ts +0 -9
  136. package/server/service/retail-replenishment-order/retail-replenishment-order-mutation.ts +0 -382
  137. package/server/service/retail-replenishment-order/retail-replenishment-order-query.ts +0 -54
  138. package/server/service/retail-replenishment-order/retail-replenishment-order-types.ts +0 -101
  139. package/server/service/retail-replenishment-order/retail-replenishment-order.ts +0 -115
  140. package/server/service/return-order/index.ts +0 -9
  141. package/server/service/return-order/return-order-mutation.ts +0 -516
  142. package/server/service/return-order/return-order-query.ts +0 -226
  143. package/server/service/return-order/return-order-types.ts +0 -196
  144. package/server/service/return-order/return-order.ts +0 -127
  145. package/server/service/reverse-kitting-order/index.ts +0 -9
  146. package/server/service/reverse-kitting-order/reverse-kitting-order-mutation.ts +0 -500
  147. package/server/service/reverse-kitting-order/reverse-kitting-order-query.ts +0 -197
  148. package/server/service/reverse-kitting-order/reverse-kitting-order-type.ts +0 -173
  149. package/server/service/reverse-kitting-order/reverse-kitting-order.ts +0 -121
  150. package/server/service/reverse-kitting-order-inventory/index.ts +0 -9
  151. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory-mutation.ts +0 -129
  152. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory-query.ts +0 -52
  153. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory-type.ts +0 -95
  154. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory.ts +0 -143
  155. package/server/service/shipping-order/index.ts +0 -9
  156. package/server/service/shipping-order/shipping-order-mutation.ts +0 -61
  157. package/server/service/shipping-order/shipping-order-query.ts +0 -61
  158. package/server/service/shipping-order/shipping-order-types.ts +0 -89
  159. package/server/service/shipping-order/shipping-order.ts +0 -129
  160. package/server/service/transfer-order/index.ts +0 -9
  161. package/server/service/transfer-order/transfer-order-mutation.ts +0 -309
  162. package/server/service/transfer-order/transfer-order-query.ts +0 -66
  163. package/server/service/transfer-order/transfer-order-types.ts +0 -97
  164. package/server/service/transfer-order/transfer-order.ts +0 -117
  165. package/server/service/vas/index.ts +0 -9
  166. package/server/service/vas/vas-mutation.ts +0 -106
  167. package/server/service/vas/vas-query.ts +0 -60
  168. package/server/service/vas/vas-types.ts +0 -71
  169. package/server/service/vas/vas.ts +0 -77
  170. package/server/service/vas-order/index.ts +0 -9
  171. package/server/service/vas-order/vas-order-mutation.ts +0 -259
  172. package/server/service/vas-order/vas-order-query.ts +0 -119
  173. package/server/service/vas-order/vas-order-types.ts +0 -49
  174. package/server/service/vas-order/vas-order.ts +0 -81
  175. package/server/utils/datetime-util.ts +0 -54
  176. package/server/utils/index.ts +0 -3
  177. package/server/utils/inventory-util.ts +0 -1155
  178. package/server/utils/order-no-generator.ts +0 -146
@@ -1,82 +0,0 @@
1
- import { Arg, Ctx, Query, Resolver } from 'type-graphql'
2
-
3
- import { buildQuery, getRepository, Sorting } from '@things-factory/shell'
4
-
5
- import { ReleaseGood } from '../release-good/release-good'
6
- import { OrderToteItem } from './order-tote-item'
7
- import { OrderToteItemList } from './order-tote-item-types'
8
-
9
- @Resolver(OrderToteItem)
10
- export class OrderToteItemQuery {
11
- @Query(returns => OrderToteItemList)
12
- async orderToteItems(
13
- @Ctx() context: ResolverContext,
14
- @Arg('toteNo', type => String) toteNo: string,
15
- @Arg('orderNo', type => String) orderNo: string,
16
- @Arg('sortings', type => [Sorting], { nullable: true }) sortings?: Sorting[]
17
- ): Promise<OrderToteItemList> {
18
- try {
19
- const { domain } = context.state
20
-
21
- const foundOrder: ReleaseGood = await getRepository(ReleaseGood).findOne({
22
- where: { domain: { id: domain.id }, name: orderNo }
23
- })
24
-
25
- const queryBuilder = getRepository(OrderToteItem).createQueryBuilder()
26
- buildQuery(queryBuilder, { sortings }, context)
27
-
28
- queryBuilder
29
- .select('OrderToteItem.id', 'id')
30
- .addSelect('OrderToteItem.name', 'name')
31
- .addSelect('OrderProduct.id', 'orderProductId')
32
- .addSelect('OrderProduct.name', 'orderProductName')
33
- .addSelect('Domain.id', 'domainId')
34
- .addSelect('Domain.name', 'domainName')
35
- .addSelect('SUM(OrderToteItem.qty)', 'pickedQty')
36
- .addSelect('Product.id', 'productId')
37
- .addSelect('Product.sku', 'productSku')
38
- .addSelect('Product.packingType', 'packingType')
39
- .leftJoin('OrderToteItem.domain', 'Domain')
40
- .leftJoin('OrderToteItem.orderProduct', 'OrderProduct')
41
- .leftJoin('OrderProduct.product', 'Product')
42
- .leftJoin('OrderToteItem.orderTote', 'OrderTote')
43
- .where('"OrderTote"."release_good_id" = :foundOrderId', { foundOrderId: foundOrder.id })
44
- .andWhere('Domain.id = :domainId', { domainId: domain.id })
45
- .andWhere('"OrderTote"."name" = :toteName', { toteName: toteNo })
46
- .groupBy('Product.id')
47
- .addGroupBy('OrderToteItem.id')
48
- .addGroupBy('Domain.id')
49
- .addGroupBy('OrderProduct.id')
50
-
51
- const items = await queryBuilder.getRawMany()
52
-
53
- return {
54
- items: items.map(itm => {
55
- return {
56
- ...itm,
57
- orderProduct: {
58
- id: itm.orderProductId,
59
- name: itm.orderProductName,
60
- product: { id: itm.productId, sku: itm.productSku, packingType: itm.packingType }
61
- },
62
- domain: { id: itm.domainId, name: itm.domainName },
63
- qty: itm.pickedQty
64
- }
65
- }),
66
- total: items.length
67
- }
68
- } catch (e) {
69
- throw new Error(e)
70
- }
71
- }
72
-
73
- @Query(returns => OrderToteItem)
74
- async orderToteItem(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<OrderToteItem> {
75
- const { domain } = context.state
76
-
77
- return await getRepository(OrderToteItem).findOne({
78
- where: { domain: { id: domain.id }, id },
79
- relations: ['domain', 'orderProduct', 'orderInventory', 'orderTote', 'updater']
80
- })
81
- }
82
- }
@@ -1,56 +0,0 @@
1
- import { Field, InputType, Int, ObjectType } from 'type-graphql'
2
-
3
- import { ObjectRef } from '@things-factory/shell'
4
-
5
- import { OrderToteItem } from './order-tote-item'
6
-
7
- @ObjectType()
8
- export class OrderToteItemList {
9
- @Field(type => [OrderToteItem], { nullable: true })
10
- items: OrderToteItem[]
11
-
12
- @Field(type => Int, { nullable: true })
13
- total: number
14
- }
15
-
16
- @InputType()
17
- export class NewOrderToteItem {
18
- @Field({ nullable: true })
19
- name: string
20
-
21
- @Field({ nullable: true })
22
- description: string
23
-
24
- @Field(type => ObjectRef, { nullable: true })
25
- orderProduct: ObjectRef
26
-
27
- @Field(type => ObjectRef, { nullable: true })
28
- orderInventory: ObjectRef
29
-
30
- @Field(type => ObjectRef, { nullable: true })
31
- orderTote: ObjectRef
32
-
33
- @Field(type => Int)
34
- qty: number
35
- }
36
-
37
- @InputType()
38
- export class OrderToteItemPatch {
39
- @Field({ nullable: true })
40
- id: string
41
-
42
- @Field({ nullable: true })
43
- name: string
44
-
45
- @Field({ nullable: true })
46
- description: string
47
-
48
- @Field(type => ObjectRef, { nullable: true })
49
- orderProduct: ObjectRef
50
-
51
- @Field(type => ObjectRef, { nullable: true })
52
- orderTote: ObjectRef
53
-
54
- @Field(type => Int)
55
- qty: number
56
- }
@@ -1,72 +0,0 @@
1
- import { Field, Int, ObjectType } from 'type-graphql'
2
- import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
3
-
4
- import { User } from '@things-factory/auth-base'
5
- import { Domain } from '@things-factory/shell'
6
- import { OrderTote } from '../order-tote/order-tote'
7
- import { OrderProduct } from '../order-product/order-product'
8
- import { OrderInventory } from '../order-inventory/order-inventory'
9
-
10
- @Entity()
11
- @Index('ix_order_tote_item_0', (orderToteItem: OrderToteItem) => [orderToteItem.name], { unique: true })
12
- @ObjectType()
13
- export class OrderToteItem {
14
- @PrimaryGeneratedColumn('uuid')
15
- @Field()
16
- id: string
17
-
18
- @ManyToOne(type => Domain)
19
- @Field(type => Domain)
20
- domain: Domain
21
-
22
- @RelationId((orderToteItem: OrderToteItem) => orderToteItem.domain)
23
- domainId: string
24
-
25
- @Column()
26
- @Field()
27
- name: string
28
-
29
- @ManyToOne(type => OrderInventory)
30
- @Field(type => OrderInventory)
31
- orderInventory?: OrderInventory
32
-
33
- @RelationId((orderToteItem: OrderToteItem) => orderToteItem.orderInventory)
34
- orderInventoryId: string
35
-
36
- @ManyToOne(type => OrderProduct)
37
- @Field(type => OrderProduct)
38
- orderProduct?: OrderProduct
39
-
40
- @RelationId((orderToteItem: OrderToteItem) => orderToteItem.orderProduct)
41
- orderProductId: string
42
-
43
- @ManyToOne(type => OrderTote)
44
- @Field(type => OrderTote, { nullable: true })
45
- orderTote?: OrderTote
46
-
47
- @RelationId((orderToteItem: OrderToteItem) => orderToteItem.orderTote)
48
- orderToteId: string
49
-
50
- @Column('int')
51
- @Field({ nullable: true })
52
- qty?: number
53
-
54
- @Field({ nullable: true })
55
- sku?: string
56
-
57
- @Field({ nullable: true })
58
- packingType?: string
59
-
60
- @UpdateDateColumn()
61
- @Field({ nullable: true })
62
- updatedAt: Date
63
-
64
- @ManyToOne(type => User, {
65
- nullable: true
66
- })
67
- @Field({ nullable: true })
68
- updater: User
69
-
70
- @RelationId((orderToteItem: OrderTote) => orderToteItem.updater)
71
- updaterId: string
72
- }
@@ -1,9 +0,0 @@
1
- import { OrderToteSeal } from './order-tote-seal'
2
- import { OrderToteSealMutation } from './order-tote-seal-mutation'
3
- import { OrderToteSealQuery } from './order-tote-seal-query'
4
-
5
- export const entities = [OrderToteSeal]
6
- export const resolvers = [OrderToteSealQuery, OrderToteSealMutation]
7
-
8
- export * from './order-tote-seal-mutation'
9
- export * from './order-tote-seal-query'
@@ -1,31 +0,0 @@
1
- import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
- import { In } from 'typeorm'
3
-
4
- import { OrderToteSeal } from './order-tote-seal'
5
-
6
- @Resolver(OrderToteSeal)
7
- export class OrderToteSealMutation {
8
- @Directive('@transaction')
9
- @Mutation(returns => Boolean)
10
- async deleteOrderToteSeal(@Arg('name') id: string, @Ctx() context: ResolverContext): Promise<Boolean> {
11
- const { domain, tx } = context.state
12
-
13
- await tx.getRepository(OrderToteSeal).delete({ domain: { id: domain.id }, id })
14
- return true
15
- }
16
-
17
- @Directive('@transaction')
18
- @Mutation(returns => Boolean)
19
- async deleteOrderToteSeals(
20
- @Arg('ids', type => [String]) ids: string[],
21
- @Ctx() context: ResolverContext
22
- ): Promise<Boolean> {
23
- const { domain, tx } = context.state
24
-
25
- await tx.getRepository(OrderToteSeal).delete({
26
- domain: { id: domain.id },
27
- id: In(ids)
28
- })
29
- return true
30
- }
31
- }
@@ -1,59 +0,0 @@
1
- import { Arg, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
-
3
- import { User } from '@things-factory/auth-base'
4
- import { buildQuery, Domain, Filter, getRepository, Pagination, Sorting } from '@things-factory/shell'
5
-
6
- import { OrderTote } from '../order-tote/order-tote'
7
- import { OrderToteSeal } from './order-tote-seal'
8
- import { OrderToteSealList } from './order-tote-seal-types'
9
-
10
- @Resolver(OrderToteSeal)
11
- export class OrderToteSealQuery {
12
- @Query(returns => OrderToteSealList)
13
- async orderToteSeals(
14
- @Ctx() context: ResolverContext,
15
- @Arg('filters', type => [Filter], { nullable: true }) filters?: Filter[],
16
- @Arg('pagination', type => Pagination, { nullable: true }) pagination?: Pagination,
17
- @Arg('sortings', type => [Sorting], { nullable: true }) sortings?: Sorting[]
18
- ): Promise<OrderToteSealList> {
19
- const { domain } = context.state
20
-
21
- const queryBuilder = getRepository(OrderToteSeal).createQueryBuilder()
22
- buildQuery(queryBuilder, { filters, pagination, sortings }, context)
23
-
24
- queryBuilder
25
- .leftJoinAndSelect('OrderToteSeal.domain', 'Domain')
26
- .leftJoinAndSelect('OrderToteSeal.orderTote', 'OrderTote')
27
- .leftJoinAndSelect('OrderToteSeal.updater', 'Updater')
28
- .where('Domain.id = :domainId', { domainId: domain.id })
29
-
30
- const [items, total] = await queryBuilder.getManyAndCount()
31
-
32
- return { items, total }
33
- }
34
-
35
- @Query(returns => OrderToteSeal)
36
- async orderToteSeal(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<OrderToteSeal> {
37
- const { domain } = context.state
38
-
39
- return await getRepository(OrderToteSeal).findOne({
40
- where: { domain: { id: domain.id }, name },
41
- relations: ['domain', 'orderTote', 'updater']
42
- })
43
- }
44
-
45
- @FieldResolver()
46
- async domain(@Root() orderToteSeal: OrderToteSeal) {
47
- return await getRepository(Domain).findOneBy({ id: orderToteSeal.domainId })
48
- }
49
-
50
- @FieldResolver()
51
- async updater(@Root() orderToteSeal: OrderToteSeal) {
52
- return await getRepository(User).findOneBy({ id: orderToteSeal.updaterId })
53
- }
54
-
55
- @FieldResolver()
56
- async orderTote(@Root() orderToteSeal: OrderToteSeal) {
57
- return await getRepository(OrderTote).findOneBy({ id: orderToteSeal.orderToteId })
58
- }
59
- }
@@ -1,41 +0,0 @@
1
- import { Field, InputType, Int, ObjectType } from 'type-graphql'
2
-
3
- import { ObjectRef } from '@things-factory/shell'
4
-
5
- import { OrderToteSeal } from './order-tote-seal'
6
-
7
- @ObjectType()
8
- export class OrderToteSealList {
9
- @Field(type => [OrderToteSeal], { nullable: true })
10
- items: OrderToteSeal[]
11
-
12
- @Field(type => Int, { nullable: true })
13
- total: number
14
- }
15
-
16
- @InputType()
17
- export class NewOrderToteSeal {
18
- @Field({ nullable: true })
19
- name: string
20
-
21
- @Field({ nullable: true })
22
- description: string
23
-
24
- @Field(type => ObjectRef, { nullable: true })
25
- orderTote: ObjectRef
26
- }
27
-
28
- @InputType()
29
- export class OrderToteSealPatch {
30
- @Field({ nullable: true })
31
- id: string
32
-
33
- @Field({ nullable: true })
34
- name: string
35
-
36
- @Field({ nullable: true })
37
- description: string
38
-
39
- @Field(type => ObjectRef, { nullable: true })
40
- orderTote: ObjectRef
41
- }
@@ -1,46 +0,0 @@
1
- import { Field, ObjectType } from 'type-graphql'
2
- import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
3
-
4
- import { User } from '@things-factory/auth-base'
5
- import { Domain } from '@things-factory/shell'
6
- import { OrderTote } from '../order-tote/order-tote'
7
-
8
- @Entity()
9
- @Index('ix_order_tote_seal_0', (orderToteSeal: OrderToteSeal) => [orderToteSeal.name], { unique: true })
10
- @ObjectType()
11
- export class OrderToteSeal {
12
- @PrimaryGeneratedColumn('uuid')
13
- @Field()
14
- id: string
15
-
16
- @ManyToOne(type => Domain)
17
- @Field(type => Domain)
18
- domain: Domain
19
-
20
- @RelationId((orderToteSeal: OrderToteSeal) => orderToteSeal.domain)
21
- domainId: string
22
-
23
- @Column()
24
- @Field()
25
- name: string
26
-
27
- @ManyToOne(type => OrderTote)
28
- @Field(type => OrderTote, { nullable: true })
29
- orderTote?: OrderTote
30
-
31
- @RelationId((orderToteSeal: OrderToteSeal) => orderToteSeal.orderTote)
32
- orderToteId: string
33
-
34
- @UpdateDateColumn()
35
- @Field({ nullable: true })
36
- updatedAt: Date
37
-
38
- @ManyToOne(type => User, {
39
- nullable: true
40
- })
41
- @Field({ nullable: true })
42
- updater: User
43
-
44
- @RelationId((orderToteSeal: OrderToteSeal) => orderToteSeal.updater)
45
- updaterId: string
46
- }
@@ -1,9 +0,0 @@
1
- import { OrderVas } from './order-vas'
2
- import { OrderVasQuery } from './order-vas-query'
3
- import { OrderVasMutation } from './order-vas-mutation'
4
-
5
- export const entities = [OrderVas]
6
- export const resolvers = [OrderVasQuery, OrderVasMutation]
7
-
8
- export * from './order-vas-mutation'
9
- export * from './order-vas-query'
@@ -1,20 +0,0 @@
1
- import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
-
3
- import { OrderVasPatch } from '../'
4
- import { OrderVas } from './order-vas'
5
-
6
- @Resolver(OrderVas)
7
- export class OrderVasMutation {
8
- @Directive('@transaction')
9
- @Mutation(returns => OrderVas)
10
- async updateOrderVas(
11
- @Arg('id') id: string,
12
- @Arg('patch', type => OrderVasPatch) patch: OrderVasPatch,
13
- @Ctx() context: ResolverContext
14
- ): Promise<OrderVas> {
15
- const { tx, domain } = context.state
16
-
17
- let orderVas = await tx.getRepository(OrderVas).findOneBy({ id })
18
- return await tx.getRepository(OrderVas).save({ orderVas, ...patch })
19
- }
20
- }
@@ -1,72 +0,0 @@
1
- import { Arg, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
-
3
- import { User } from '@things-factory/auth-base'
4
- import { convertListParams, Domain, Filter, getRepository, Pagination, Sorting } from '@things-factory/shell'
5
-
6
- import { OrderVasList } from '../'
7
- import { OrderVas } from './order-vas'
8
-
9
- @Resolver(OrderVas)
10
- export class OrderVasQuery {
11
- @Query(returns => OrderVasList)
12
- async orderVass(
13
- @Arg('filters', type => [Filter], { nullable: true }) filters?: [Filter],
14
- @Arg('pagination', type => Pagination, { nullable: true }) pagination?: Pagination,
15
- @Arg('sortings', type => [Sorting], { nullable: true }) sortings?: [Sorting]
16
- ): Promise<OrderVasList> {
17
- const convertedParams = convertListParams({ filters, pagination, sortings })
18
- const [items, total] = await getRepository(OrderVas).findAndCount({
19
- ...convertedParams,
20
- relations: [
21
- 'domain',
22
- 'arrivalNotice',
23
- 'releaseGood',
24
- 'vasOrder',
25
- 'shippingOrder',
26
- 'vas',
27
- 'inventory',
28
- 'creator',
29
- 'updater'
30
- ]
31
- })
32
- return { items, total }
33
- }
34
-
35
- @Query(returns => OrderVas)
36
- async orderVas(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<OrderVas> {
37
- const { domain } = context.state
38
-
39
- return await getRepository(OrderVas).findOne({
40
- where: {
41
- domain: { id: domain.id },
42
- name
43
- },
44
- relations: [
45
- 'domain',
46
- 'arrivalNotice',
47
- 'releaseGood',
48
- 'vasOrder',
49
- 'shippingOrder',
50
- 'vas',
51
- 'inventory',
52
- 'creator',
53
- 'updater'
54
- ]
55
- })
56
- }
57
-
58
- @FieldResolver(type => Domain)
59
- async domain(@Root() orderVas: OrderVas): Promise<Domain> {
60
- return await getRepository(Domain).findOneBy({ id: orderVas.domainId })
61
- }
62
-
63
- @FieldResolver(type => User)
64
- async creator(@Root() orderVas: OrderVas): Promise<User> {
65
- return await getRepository(User).findOneBy({ id: orderVas.creatorId })
66
- }
67
-
68
- @FieldResolver(type => User)
69
- async updater(@Root() orderVas: OrderVas): Promise<User> {
70
- return await getRepository(User).findOneBy({ id: orderVas.updaterId })
71
- }
72
- }
@@ -1,159 +0,0 @@
1
- import { ObjectRef } from '@things-factory/shell'
2
- import { Field, Float, InputType, Int, ObjectType } from 'type-graphql'
3
- import { OrderVas } from './order-vas'
4
-
5
- @ObjectType()
6
- export class OrderVasList {
7
- @Field(type => [OrderVas], { nullable: true })
8
- items: OrderVas[]
9
-
10
- @Field(type => Int, { nullable: true })
11
- total: number
12
- }
13
-
14
- @InputType()
15
- export class NewOrderVas {
16
- @Field({ nullable: true })
17
- name: string
18
-
19
- @Field(type => Int, { nullable: true })
20
- set: number
21
-
22
- @Field({ nullable: true })
23
- targetType: string
24
-
25
- @Field({ nullable: true })
26
- targetBatchId: string
27
-
28
- @Field(type => ObjectRef, { nullable: true })
29
- targetProduct: ObjectRef
30
-
31
- @Field({ nullable: true })
32
- otherTarget: string
33
-
34
- @Field(type => Int, { nullable: true })
35
- qty: number
36
-
37
- @Field(type => Float, { nullable: true })
38
- uomValue: number
39
-
40
- @Field({ nullable: true })
41
- batchId: string
42
-
43
- @Field({ nullable: true })
44
- productName: string
45
-
46
- @Field({ nullable: true })
47
- packingType: string
48
-
49
- @Field(type => ObjectRef, { nullable: true })
50
- arrivalNotice: ObjectRef
51
-
52
- @Field(type => ObjectRef, { nullable: true })
53
- releaseGood: ObjectRef
54
-
55
- @Field(type => ObjectRef, { nullable: true })
56
- shippingOrder: ObjectRef
57
-
58
- @Field(type => ObjectRef, { nullable: true })
59
- transferOrder: ObjectRef
60
-
61
- @Field(type => ObjectRef, { nullable: true })
62
- retailReplenishmentOrder: ObjectRef
63
-
64
- @Field(type => ObjectRef, { nullable: true })
65
- inventory: ObjectRef
66
-
67
- @Field(type => ObjectRef, { nullable: true })
68
- vas: ObjectRef
69
-
70
- @Field({ nullable: true })
71
- type: string
72
-
73
- @Field({ nullable: true })
74
- operationGuide: string
75
-
76
- @Field({ nullable: true })
77
- remark: string
78
-
79
- @Field({ nullable: true })
80
- description: string
81
-
82
- @Field({ nullable: true })
83
- status: string
84
- }
85
-
86
- @InputType()
87
- export class OrderVasPatch {
88
- @Field({ nullable: true })
89
- id: string
90
-
91
- @Field({ nullable: true })
92
- name: string
93
-
94
- @Field(type => Int, { nullable: true })
95
- set: number
96
-
97
- @Field({ nullable: true })
98
- targetType: string
99
-
100
- @Field({ nullable: true })
101
- targetBatchId: string
102
-
103
- @Field(type => ObjectRef, { nullable: true })
104
- targetProduct: ObjectRef
105
-
106
- @Field({ nullable: true })
107
- otherTarget: string
108
-
109
- @Field(type => Int, { nullable: true })
110
- qty: number
111
-
112
- @Field(type => Float, { nullable: true })
113
- uomValue: number
114
-
115
- @Field({ nullable: true })
116
- batchId: string
117
-
118
- @Field({ nullable: true })
119
- productName: string
120
-
121
- @Field({ nullable: true })
122
- packingType: string
123
-
124
- @Field(type => ObjectRef, { nullable: true })
125
- arrivalNotice: ObjectRef
126
-
127
- @Field(type => ObjectRef, { nullable: true })
128
- releaseGood: ObjectRef
129
-
130
- @Field(type => ObjectRef, { nullable: true })
131
- shippingOrder: ObjectRef
132
-
133
- @Field(type => ObjectRef, { nullable: true })
134
- retailReplenishmentOrder: ObjectRef
135
-
136
- @Field(type => ObjectRef, { nullable: true })
137
- transferOrder: ObjectRef
138
-
139
- @Field(type => ObjectRef, { nullable: true })
140
- inventory: ObjectRef
141
-
142
- @Field(type => ObjectRef, { nullable: true })
143
- vas: ObjectRef
144
-
145
- @Field({ nullable: true })
146
- operationGuide: string
147
-
148
- @Field({ nullable: true })
149
- remark: string
150
-
151
- @Field({ nullable: true })
152
- description: string
153
-
154
- @Field({ nullable: true })
155
- status: string
156
-
157
- @Field({ nullable: true })
158
- cuFlag: string
159
- }