@things-factory/warehouse-base 8.0.3 → 8.0.6

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 (88) hide show
  1. package/dist-server/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +8 -8
  3. package/server/constants/index.ts +0 -5
  4. package/server/constants/inventory.ts +0 -67
  5. package/server/constants/location.ts +0 -14
  6. package/server/constants/pallet.ts +0 -10
  7. package/server/constants/rule-type.ts +0 -5
  8. package/server/constants/tote.ts +0 -5
  9. package/server/controllers/ecommerce/ecommerce-controller.ts +0 -108
  10. package/server/controllers/ecommerce/index.ts +0 -2
  11. package/server/controllers/ecommerce/sellercraft-controller.ts +0 -100
  12. package/server/controllers/index.ts +0 -2
  13. package/server/controllers/warehouse-controller.ts +0 -181
  14. package/server/index.ts +0 -9
  15. package/server/middlewares/index.ts +0 -0
  16. package/server/migrations/index.ts +0 -9
  17. package/server/service/index.ts +0 -80
  18. package/server/service/inventory/index.ts +0 -6
  19. package/server/service/inventory/inventory-mutation.ts +0 -530
  20. package/server/service/inventory/inventory-query.ts +0 -1263
  21. package/server/service/inventory/inventory-types.ts +0 -367
  22. package/server/service/inventory/inventory.ts +0 -408
  23. package/server/service/inventory-change/index.ts +0 -6
  24. package/server/service/inventory-change/inventory-change-mutation.ts +0 -969
  25. package/server/service/inventory-change/inventory-change-query.ts +0 -93
  26. package/server/service/inventory-change/inventory-change-types.ts +0 -36
  27. package/server/service/inventory-change/inventory-change.ts +0 -164
  28. package/server/service/inventory-history/index.ts +0 -6
  29. package/server/service/inventory-history/inventory-history-mutation.ts +0 -116
  30. package/server/service/inventory-history/inventory-history-query.ts +0 -1845
  31. package/server/service/inventory-history/inventory-history-types.ts +0 -444
  32. package/server/service/inventory-history/inventory-history.ts +0 -203
  33. package/server/service/inventory-item/index.ts +0 -6
  34. package/server/service/inventory-item/inventory-item-mutation.ts +0 -217
  35. package/server/service/inventory-item/inventory-item-query.ts +0 -226
  36. package/server/service/inventory-item/inventory-item-type.ts +0 -74
  37. package/server/service/inventory-item/inventory-item.ts +0 -105
  38. package/server/service/inventory-item-change/index.ts +0 -6
  39. package/server/service/inventory-item-change/inventory-item-change-mutation.ts +0 -119
  40. package/server/service/inventory-item-change/inventory-item-change-query.ts +0 -47
  41. package/server/service/inventory-item-change/inventory-item-change-type.ts +0 -68
  42. package/server/service/inventory-item-change/inventory-item-change.ts +0 -92
  43. package/server/service/inventory-product/index.ts +0 -6
  44. package/server/service/inventory-product/inventory-product-mutation.ts +0 -116
  45. package/server/service/inventory-product/inventory-product-query.ts +0 -47
  46. package/server/service/inventory-product/inventory-product-type.ts +0 -59
  47. package/server/service/inventory-product/inventory-product.ts +0 -88
  48. package/server/service/location/index.ts +0 -6
  49. package/server/service/location/location-mutation.ts +0 -134
  50. package/server/service/location/location-query.ts +0 -244
  51. package/server/service/location/location-types.ts +0 -173
  52. package/server/service/location/location.ts +0 -121
  53. package/server/service/movement/index.ts +0 -6
  54. package/server/service/movement/movement-mutation.ts +0 -60
  55. package/server/service/movement/movement-query.ts +0 -263
  56. package/server/service/movement/movement-types.ts +0 -74
  57. package/server/service/movement/movement.ts +0 -81
  58. package/server/service/pallet/index.ts +0 -6
  59. package/server/service/pallet/pallet-mutation.ts +0 -242
  60. package/server/service/pallet/pallet-query.ts +0 -106
  61. package/server/service/pallet/pallet-types.ts +0 -80
  62. package/server/service/pallet/pallet.ts +0 -92
  63. package/server/service/pallet-count/index.ts +0 -6
  64. package/server/service/pallet-count/pallet-count-mutation.ts +0 -151
  65. package/server/service/pallet-count/pallet-count-query.ts +0 -45
  66. package/server/service/pallet-count/pallet-count-types.ts +0 -36
  67. package/server/service/pallet-count/pallet-count.ts +0 -70
  68. package/server/service/pallet-history/index.ts +0 -6
  69. package/server/service/pallet-history/pallet-history-mutation.ts +0 -114
  70. package/server/service/pallet-history/pallet-history-query.ts +0 -48
  71. package/server/service/pallet-history/pallet-history-types.ts +0 -36
  72. package/server/service/pallet-history/pallet-history.ts +0 -89
  73. package/server/service/reduced-inventory-history/index.ts +0 -3
  74. package/server/service/reduced-inventory-history/reduced-inventory-history.ts +0 -92
  75. package/server/service/tote/index.ts +0 -6
  76. package/server/service/tote/tote-mutation.ts +0 -201
  77. package/server/service/tote/tote-query.ts +0 -106
  78. package/server/service/tote/tote-types.ts +0 -44
  79. package/server/service/tote/tote.ts +0 -77
  80. package/server/service/warehouse/index.ts +0 -6
  81. package/server/service/warehouse/warehouse-mutation.ts +0 -152
  82. package/server/service/warehouse/warehouse-query.ts +0 -58
  83. package/server/service/warehouse/warehouse-types.ts +0 -50
  84. package/server/service/warehouse/warehouse.ts +0 -95
  85. package/server/utils/datetime-util.ts +0 -54
  86. package/server/utils/index.ts +0 -3
  87. package/server/utils/inventory-no-generator.ts +0 -15
  88. package/server/utils/inventory-util.ts +0 -490
@@ -1,119 +0,0 @@
1
- import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
- import { In } from 'typeorm'
3
-
4
- import { InventoryNoGenerator } from '../../utils'
5
- import { InventoryItemChange } from './inventory-item-change'
6
- import { InventoryItemChangePatch, NewInventoryItemChange } from './inventory-item-change-type'
7
-
8
- @Resolver(InventoryItemChange)
9
- export class InventoryItemChangeMutation {
10
- @Directive('@transaction')
11
- @Mutation(returns => InventoryItemChange, { description: 'To create new InventoryItemChange' })
12
- async createInventoryItemChange(
13
- @Arg('inventoryItemChange') inventoryItemChange: NewInventoryItemChange,
14
- @Ctx() context: ResolverContext
15
- ): Promise<InventoryItemChange> {
16
- const { domain, user, tx } = context.state
17
-
18
- return await tx.getRepository(InventoryItemChange).save({
19
- ...inventoryItemChange,
20
- name: InventoryNoGenerator.inventoryName(),
21
- status: 'PENDING_SUBMISSION',
22
- domain,
23
- creator: user,
24
- updater: user
25
- })
26
- }
27
-
28
- @Directive('@transaction')
29
- @Mutation(returns => InventoryItemChange, { description: 'To modify InventoryItemChange information' })
30
- async updateInventoryItemChange(
31
- @Arg('id') id: string,
32
- @Arg('patch') patch: InventoryItemChangePatch,
33
- @Ctx() context: ResolverContext
34
- ): Promise<InventoryItemChange> {
35
- const { domain, user, tx } = context.state
36
-
37
- const repository = tx.getRepository(InventoryItemChange)
38
- const inventoryItemChange = await repository.findOne({
39
- where: { domain: { id: domain.id }, id }
40
- })
41
-
42
- return await repository.save({
43
- ...inventoryItemChange,
44
- ...patch,
45
- updater: user
46
- })
47
- }
48
-
49
- @Directive('@transaction')
50
- @Mutation(returns => [InventoryItemChange], { description: "To modify multiple InventoryItemChanges' information" })
51
- async updateMultipleInventoryItemChange(
52
- @Arg('patches', type => [InventoryItemChangePatch]) patches: InventoryItemChangePatch[],
53
- @Ctx() context: ResolverContext
54
- ): Promise<InventoryItemChange[]> {
55
- const { domain, user, tx } = context.state
56
-
57
- let results = []
58
- const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
59
- const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
60
- const inventoryItemChangeRepo = tx.getRepository(InventoryItemChange)
61
-
62
- if (_createRecords.length > 0) {
63
- for (let i = 0; i < _createRecords.length; i++) {
64
- const newRecord = _createRecords[i]
65
-
66
- const result = await inventoryItemChangeRepo.save({
67
- ...newRecord,
68
- domain,
69
- creator: user,
70
- updater: user
71
- })
72
-
73
- results.push({ ...result, cuFlag: '+' })
74
- }
75
- }
76
-
77
- if (_updateRecords.length > 0) {
78
- for (let i = 0; i < _updateRecords.length; i++) {
79
- const newRecord = _updateRecords[i]
80
- const inventoryItemChange = await inventoryItemChangeRepo.findOneBy({ id: newRecord.id })
81
-
82
- const result = await inventoryItemChangeRepo.save({
83
- ...inventoryItemChange,
84
- ...newRecord,
85
- updater: user
86
- })
87
-
88
- results.push({ ...result, cuFlag: 'M' })
89
- }
90
- }
91
-
92
- return results
93
- }
94
-
95
- @Directive('@transaction')
96
- @Mutation(returns => Boolean, { description: 'To delete InventoryItemChange' })
97
- async deleteInventoryItemChange(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
98
- const { domain, tx } = context.state
99
-
100
- await tx.getRepository(InventoryItemChange).delete({ domain: { id: domain.id }, id })
101
- return true
102
- }
103
-
104
- @Directive('@transaction')
105
- @Mutation(returns => Boolean, { description: 'To delete multiple inventoryItemChanges' })
106
- async deleteInventoryItemChanges(
107
- @Arg('ids', type => [String]) ids: string[],
108
- @Ctx() context: ResolverContext
109
- ): Promise<boolean> {
110
- const { domain, tx } = context.state
111
-
112
- await tx.getRepository(InventoryItemChange).delete({
113
- domain: { id: domain.id },
114
- id: In(ids)
115
- })
116
-
117
- return true
118
- }
119
- }
@@ -1,47 +0,0 @@
1
- import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
-
3
- import { User } from '@things-factory/auth-base'
4
- import { convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'
5
-
6
- import { InventoryItemChange } from './inventory-item-change'
7
- import { InventoryItemChangeList } from './inventory-item-change-type'
8
-
9
- @Resolver(InventoryItemChange)
10
- export class InventoryItemChangeQuery {
11
- @Query(returns => InventoryItemChange, { description: 'To fetch a InventoryItemChange' })
12
- async inventoryItemChange(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<InventoryItemChange> {
13
- const { domain } = context.state
14
-
15
- return await getRepository(InventoryItemChange).findOne({
16
- where: { domain: { id: domain.id }, id }
17
- })
18
- }
19
-
20
- @Query(returns => InventoryItemChangeList, { description: 'To fetch multiple InventoryItemChanges' })
21
- async inventoryItemChanges(
22
- @Args(type => ListParam) params: ListParam,
23
- @Ctx() context: ResolverContext
24
- ): Promise<InventoryItemChangeList> {
25
- const { domain } = context.state
26
-
27
- const convertedParams = convertListParams(params, { domain })
28
- const [items, total] = await getRepository(InventoryItemChange).findAndCount(convertedParams)
29
-
30
- return { items, total }
31
- }
32
-
33
- @FieldResolver(type => Domain)
34
- async domain(@Root() inventoryItemChange: InventoryItemChange): Promise<Domain> {
35
- return await getRepository(Domain).findOneBy({ id: inventoryItemChange.domainId })
36
- }
37
-
38
- @FieldResolver(type => User)
39
- async updater(@Root() inventoryItemChange: InventoryItemChange): Promise<User> {
40
- return await getRepository(User).findOneBy({ id: inventoryItemChange.updaterId })
41
- }
42
-
43
- @FieldResolver(type => User)
44
- async creator(@Root() inventoryItemChange: InventoryItemChange): Promise<User> {
45
- return await getRepository(User).findOneBy({ id: inventoryItemChange.creatorId })
46
- }
47
- }
@@ -1,68 +0,0 @@
1
- import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'
2
-
3
- import { ObjectRef } from '@things-factory/shell'
4
-
5
- import { InventoryItemChange } from './inventory-item-change'
6
-
7
- @InputType()
8
- export class NewInventoryItemChange {
9
- @Field({ nullable: true })
10
- name: string
11
-
12
- @Field({ nullable: true })
13
- serialNumber?: string
14
-
15
- @Field({ nullable: true })
16
- type?: string
17
-
18
- @Field({ nullable: true })
19
- status?: string
20
-
21
- @Field(type => ObjectRef, { nullable: true })
22
- inventory?: ObjectRef
23
-
24
- @Field(type => ObjectRef, { nullable: true })
25
- inventoryItem?: ObjectRef
26
-
27
- @Field(type => ObjectRef, { nullable: true })
28
- inventoryChange?: ObjectRef
29
- }
30
-
31
- @InputType()
32
- export class InventoryItemChangePatch {
33
- @Field(type => ID, { nullable: true })
34
- id?: string
35
-
36
- @Field({ nullable: true })
37
- name?: string
38
-
39
- @Field({ nullable: true })
40
- serialNumber?: string
41
-
42
- @Field({ nullable: true })
43
- type?: string
44
-
45
- @Field({ nullable: true })
46
- status?: string
47
-
48
- @Field(type => ObjectRef, { nullable: true })
49
- inventory?: ObjectRef
50
-
51
- @Field(type => ObjectRef, { nullable: true })
52
- inventoryItem?: ObjectRef
53
-
54
- @Field(type => ObjectRef, { nullable: true })
55
- inventoryChange?: ObjectRef
56
-
57
- @Field({ nullable: true })
58
- cuFlag: string
59
- }
60
-
61
- @ObjectType()
62
- export class InventoryItemChangeList {
63
- @Field(type => [InventoryItemChange])
64
- items: InventoryItemChange[]
65
-
66
- @Field(type => Int)
67
- total: number
68
- }
@@ -1,92 +0,0 @@
1
- import { Field, ID, ObjectType } from 'type-graphql'
2
- import {
3
- Column,
4
- CreateDateColumn,
5
- Entity,
6
- Index,
7
- ManyToOne,
8
- PrimaryGeneratedColumn,
9
- RelationId,
10
- UpdateDateColumn
11
- } from 'typeorm'
12
-
13
- import { User } from '@things-factory/auth-base'
14
- import { Domain } from '@things-factory/shell'
15
-
16
- import { InventoryChange } from '../inventory-change/inventory-change'
17
- import { InventoryItem } from '../inventory-item/inventory-item'
18
- import { Inventory } from '../inventory/inventory'
19
-
20
- @Entity()
21
- @Index(
22
- 'ix_inventory_item_change_0',
23
- (inventoryItemChange: InventoryItemChange) => [inventoryItemChange.domain, inventoryItemChange.name],
24
- { unique: true }
25
- )
26
- @ObjectType({ description: 'Entity for InventoryItemChange' })
27
- export class InventoryItemChange {
28
- @PrimaryGeneratedColumn('uuid')
29
- @Field(type => ID)
30
- readonly id: string
31
-
32
- @ManyToOne(type => Domain)
33
- @Field(type => Domain)
34
- domain?: Domain
35
-
36
- @RelationId((inventoryItemChange: InventoryItemChange) => inventoryItemChange.domain)
37
- domainId?: string
38
-
39
- @ManyToOne(type => InventoryItem, { nullable: true })
40
- @Field(type => InventoryItem, { nullable: true })
41
- inventoryItem: InventoryItem
42
-
43
- @ManyToOne(type => Inventory, { nullable: true })
44
- @Field(type => Inventory, { nullable: true })
45
- inventory: Inventory
46
-
47
- @ManyToOne(type => InventoryChange, { nullable: true })
48
- @Field(type => InventoryChange, { nullable: true })
49
- inventoryChange: InventoryChange
50
-
51
- @Column()
52
- @Field()
53
- name: string
54
-
55
- @Column({ nullable: true })
56
- @Field({ nullable: true })
57
- serialNumber?: string
58
-
59
- @Column({ nullable: true })
60
- @Field({ nullable: true })
61
- type?: string
62
-
63
- @Column({ nullable: true })
64
- @Field({ nullable: true })
65
- status?: string
66
-
67
- @CreateDateColumn()
68
- @Field({ nullable: true })
69
- createdAt?: Date
70
-
71
- @UpdateDateColumn()
72
- @Field({ nullable: true })
73
- updatedAt?: Date
74
-
75
- @ManyToOne(type => User, {
76
- nullable: true
77
- })
78
- @Field(type => User, { nullable: true })
79
- creator?: User
80
-
81
- @RelationId((inventoryItemChange: InventoryItemChange) => inventoryItemChange.creator)
82
- creatorId?: string
83
-
84
- @ManyToOne(type => User, {
85
- nullable: true
86
- })
87
- @Field(type => User, { nullable: true })
88
- updater?: User
89
-
90
- @RelationId((inventoryItemChange: InventoryItemChange) => inventoryItemChange.updater)
91
- updaterId?: string
92
- }
@@ -1,6 +0,0 @@
1
- import { InventoryProduct } from './inventory-product'
2
- import { InventoryProductQuery } from './inventory-product-query'
3
- import { InventoryProductMutation } from './inventory-product-mutation'
4
-
5
- export const entities = [InventoryProduct]
6
- export const resolvers = [InventoryProductQuery, InventoryProductMutation]
@@ -1,116 +0,0 @@
1
- import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
- import { In } from 'typeorm'
3
-
4
- import { InventoryProduct } from './inventory-product'
5
- import { InventoryProductPatch, NewInventoryProduct } from './inventory-product-type'
6
-
7
- @Resolver(InventoryProduct)
8
- export class InventoryProductMutation {
9
- @Directive('@transaction')
10
- @Mutation(returns => InventoryProduct, { description: 'To create new InventoryProduct' })
11
- async createInventoryProduct(
12
- @Arg('inventoryProduct') inventoryProduct: NewInventoryProduct,
13
- @Ctx() context: ResolverContext
14
- ): Promise<InventoryProduct> {
15
- const { domain, user, tx } = context.state
16
-
17
- return await tx.getRepository(InventoryProduct).save({
18
- ...inventoryProduct,
19
- domain,
20
- creator: user,
21
- updater: user
22
- })
23
- }
24
-
25
- @Directive('@transaction')
26
- @Mutation(returns => InventoryProduct, { description: 'To modify InventoryProduct information' })
27
- async updateInventoryProduct(
28
- @Arg('id') id: string,
29
- @Arg('patch') patch: InventoryProductPatch,
30
- @Ctx() context: ResolverContext
31
- ): Promise<InventoryProduct> {
32
- const { domain, user, tx } = context.state
33
-
34
- const repository = tx.getRepository(InventoryProduct)
35
- const inventoryProduct = await repository.findOne({
36
- where: { domain: { id: domain.id }, id }
37
- })
38
-
39
- return await repository.save({
40
- ...inventoryProduct,
41
- ...patch,
42
- updater: user
43
- })
44
- }
45
-
46
- @Directive('@transaction')
47
- @Mutation(returns => [InventoryProduct], { description: "To modify multiple InventoryProducts' information" })
48
- async updateMultipleInventoryProduct(
49
- @Arg('patches', type => [InventoryProductPatch]) patches: InventoryProductPatch[],
50
- @Ctx() context: ResolverContext
51
- ): Promise<InventoryProduct[]> {
52
- const { domain, user, tx } = context.state
53
-
54
- let results = []
55
- const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
56
- const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
57
- const inventoryProductRepo = tx.getRepository(InventoryProduct)
58
-
59
- if (_createRecords.length > 0) {
60
- for (let i = 0; i < _createRecords.length; i++) {
61
- const newRecord = _createRecords[i]
62
-
63
- const result = await inventoryProductRepo.save({
64
- ...newRecord,
65
- domain,
66
- creator: user,
67
- updater: user
68
- })
69
-
70
- results.push({ ...result, cuFlag: '+' })
71
- }
72
- }
73
-
74
- if (_updateRecords.length > 0) {
75
- for (let i = 0; i < _updateRecords.length; i++) {
76
- const newRecord = _updateRecords[i]
77
- const inventoryProduct = await inventoryProductRepo.findOneBy({ id: newRecord.id })
78
-
79
- const result = await inventoryProductRepo.save({
80
- ...inventoryProduct,
81
- ...newRecord,
82
- updater: user
83
- })
84
-
85
- results.push({ ...result, cuFlag: 'M' })
86
- }
87
- }
88
-
89
- return results
90
- }
91
-
92
- @Directive('@transaction')
93
- @Mutation(returns => Boolean, { description: 'To delete InventoryProduct' })
94
- async deleteInventoryProduct(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
95
- const { domain, tx } = context.state
96
-
97
- await tx.getRepository(InventoryProduct).delete({ domain: { id: domain.id }, id })
98
- return true
99
- }
100
-
101
- @Directive('@transaction')
102
- @Mutation(returns => Boolean, { description: 'To delete multiple inventoryProducts' })
103
- async deleteInventoryProducts(
104
- @Arg('ids', type => [String]) ids: string[],
105
- @Ctx() context: ResolverContext
106
- ): Promise<boolean> {
107
- const { domain, tx } = context.state
108
-
109
- await tx.getRepository(InventoryProduct).delete({
110
- domain: { id: domain.id },
111
- id: In(ids)
112
- })
113
-
114
- return true
115
- }
116
- }
@@ -1,47 +0,0 @@
1
- import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'
2
-
3
- import { User } from '@things-factory/auth-base'
4
- import { convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'
5
-
6
- import { InventoryProduct } from './inventory-product'
7
- import { InventoryProductList } from './inventory-product-type'
8
-
9
- @Resolver(InventoryProduct)
10
- export class InventoryProductQuery {
11
- @Query(returns => InventoryProduct, { description: 'To fetch a InventoryProduct' })
12
- async inventoryProduct(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<InventoryProduct> {
13
- const { domain } = context.state
14
-
15
- return await getRepository(InventoryProduct).findOne({
16
- where: { domain: { id: domain.id }, id }
17
- })
18
- }
19
-
20
- @Query(returns => InventoryProductList, { description: 'To fetch multiple InventoryProducts' })
21
- async inventoryProducts(
22
- @Args(type => ListParam) params: ListParam,
23
- @Ctx() context: ResolverContext
24
- ): Promise<InventoryProductList> {
25
- const { domain } = context.state
26
-
27
- const convertedParams = convertListParams(params, { domain })
28
- const [items, total] = await getRepository(InventoryProduct).findAndCount(convertedParams)
29
-
30
- return { items, total }
31
- }
32
-
33
- @FieldResolver(type => Domain)
34
- async domain(@Root() inventoryProduct: InventoryProduct): Promise<Domain> {
35
- return await getRepository(Domain).findOneBy({ id: inventoryProduct.domainId })
36
- }
37
-
38
- @FieldResolver(type => User)
39
- async updater(@Root() inventoryProduct: InventoryProduct): Promise<User> {
40
- return await getRepository(User).findOneBy({ id: inventoryProduct.updaterId })
41
- }
42
-
43
- @FieldResolver(type => User)
44
- async creator(@Root() inventoryProduct: InventoryProduct): Promise<User> {
45
- return await getRepository(User).findOneBy({ id: inventoryProduct.creatorId })
46
- }
47
- }
@@ -1,59 +0,0 @@
1
- import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'
2
-
3
- import { ObjectRef } from '@things-factory/shell'
4
-
5
- import { InventoryProduct } from './inventory-product'
6
-
7
- @InputType()
8
- export class NewInventoryProduct {
9
- @Field()
10
- name: string
11
-
12
- @Field({ nullable: true })
13
- serialNumber?: string
14
-
15
- @Field({ nullable: true })
16
- status?: string
17
-
18
- @Field(type => ObjectRef, { nullable: true })
19
- product?: ObjectRef
20
-
21
- @Field({ nullable: true })
22
- arrivalNoticeId?: string
23
-
24
- @Field({ nullable: true })
25
- releaseGoodId?: string
26
- }
27
-
28
- @InputType()
29
- export class InventoryProductPatch {
30
- @Field(type => ID, { nullable: true })
31
- id?: string
32
-
33
- @Field({ nullable: true })
34
- name?: string
35
-
36
- @Field({ nullable: true })
37
- serialNumber?: string
38
-
39
- @Field({ nullable: true })
40
- status?: string
41
-
42
- @Field({ nullable: true })
43
- arrivalNoticeId?: string
44
-
45
- @Field({ nullable: true })
46
- releaseGoodId?: string
47
-
48
- @Field()
49
- cuFlag: string
50
- }
51
-
52
- @ObjectType()
53
- export class InventoryProductList {
54
- @Field(type => [InventoryProduct])
55
- items: InventoryProduct[]
56
-
57
- @Field(type => Int)
58
- total: number
59
- }
@@ -1,88 +0,0 @@
1
- import { Field, ID, ObjectType } from 'type-graphql'
2
- import {
3
- Column,
4
- CreateDateColumn,
5
- Entity,
6
- Index,
7
- ManyToOne,
8
- PrimaryGeneratedColumn,
9
- RelationId,
10
- UpdateDateColumn
11
- } from 'typeorm'
12
-
13
- import { User } from '@things-factory/auth-base'
14
- import { Product } from '@things-factory/product-base'
15
- import { Domain } from '@things-factory/shell'
16
-
17
- @Entity()
18
- @Index(
19
- 'ix_inventory_product_0',
20
- (inventoryProduct: InventoryProduct) => [inventoryProduct.domain, inventoryProduct.name],
21
- { unique: true }
22
- )
23
- @ObjectType({ description: 'Entity for InventoryProduct' })
24
- export class InventoryProduct {
25
- @PrimaryGeneratedColumn('uuid')
26
- @Field(type => ID)
27
- readonly id: string
28
-
29
- @ManyToOne(type => Domain)
30
- @Field(type => Domain)
31
- domain?: Domain
32
-
33
- @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.domain)
34
- domainId?: string
35
-
36
- @Column()
37
- @Field()
38
- name: string
39
-
40
- @Column({ nullable: true })
41
- @Field({ nullable: true })
42
- serialNumber?: string
43
-
44
- @Column({ nullable: true })
45
- @Field({ nullable: true })
46
- status?: string
47
-
48
- @Column({ nullable: true })
49
- @Field({ nullable: true })
50
- arrivalNoticeId: string
51
-
52
- @Column({ nullable: true })
53
- @Field({ nullable: true })
54
- releaseGoodId: string
55
-
56
- @ManyToOne(type => Product)
57
- @Field({ nullable: true })
58
- product?: Product
59
-
60
- @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.product)
61
- productId?: string
62
-
63
- @CreateDateColumn()
64
- @Field({ nullable: true })
65
- createdAt?: Date
66
-
67
- @UpdateDateColumn()
68
- @Field({ nullable: true })
69
- updatedAt?: Date
70
-
71
- @ManyToOne(type => User, {
72
- nullable: true
73
- })
74
- @Field(type => User, { nullable: true })
75
- creator?: User
76
-
77
- @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.creator)
78
- creatorId?: string
79
-
80
- @ManyToOne(type => User, {
81
- nullable: true
82
- })
83
- @Field(type => User, { nullable: true })
84
- updater?: User
85
-
86
- @RelationId((inventoryProduct: InventoryProduct) => inventoryProduct.updater)
87
- updaterId?: string
88
- }
@@ -1,6 +0,0 @@
1
- import { Location } from './location'
2
- import { LocationMutation } from './location-mutation'
3
- import { LocationQuery } from './location-query'
4
-
5
- export const entities = [Location]
6
- export const resolvers = [LocationQuery, LocationMutation]