@things-factory/tax-invoice 6.2.84 → 6.2.86

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 (30) hide show
  1. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +23 -6
  2. package/client/pages/tax-invoice/tax-invoice-list-page.ts +34 -7
  3. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +22 -5
  4. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
  5. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +29 -4
  6. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
  7. package/dist-client/tsconfig.tsbuildinfo +1 -1
  8. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +12 -21
  9. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
  10. package/dist-server/service/tax-invoice/tax-invoice-query.js +1 -1
  11. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
  12. package/dist-server/service/tax-invoice/tax-invoice.js +0 -8
  13. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
  14. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +0 -8
  15. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
  16. package/dist-server/service/tax-invoice-company/tax-invoice-company.js +0 -8
  17. package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
  18. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +0 -8
  19. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
  20. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -12
  21. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
  22. package/dist-server/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +2 -2
  24. package/server/service/tax-invoice/tax-invoice-mutation.ts +14 -17
  25. package/server/service/tax-invoice/tax-invoice-query.ts +1 -1
  26. package/server/service/tax-invoice/tax-invoice.ts +0 -4
  27. package/server/service/tax-invoice-api/tax-invoice-api.ts +0 -4
  28. package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -4
  29. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +0 -6
  30. package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/tax-invoice",
3
- "version": "6.2.84",
3
+ "version": "6.2.86",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -33,5 +33,5 @@
33
33
  "@things-factory/export-ui-excel": "^6.2.84",
34
34
  "@things-factory/shell": "^6.2.84"
35
35
  },
36
- "gitHead": "3c272e989acc14bbd02f4ec79624dfd7dc4e6acd"
36
+ "gitHead": "f90a5c1ff2a93331bb6e375944972dc68dde8a1f"
37
37
  }
@@ -3,22 +3,33 @@ import { In } from 'typeorm'
3
3
 
4
4
  import { TaxInvoice } from './tax-invoice'
5
5
  import { NewTaxInvoice, TaxInvoicePatch } from './tax-invoice-type'
6
+ import { NewTaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item-type'
7
+ import { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'
6
8
 
7
9
  @Resolver(TaxInvoice)
8
10
  export class TaxInvoiceMutation {
9
11
  @Directive('@transaction')
10
12
  @Mutation(returns => TaxInvoice, { description: 'To create new TaxInvoice' })
11
- async createTaxInvoice(@Arg('taxInvoice') taxInvoice: NewTaxInvoice, @Ctx() context: ResolverContext): Promise<TaxInvoice> {
13
+ async createTaxInvoice(
14
+ @Arg('taxInvoice') taxInvoice: NewTaxInvoice,
15
+ @Arg('taxInvoiceItems', () => [NewTaxInvoiceItem]) taxInvoiceItems: NewTaxInvoiceItem[],
16
+ @Ctx() context: ResolverContext
17
+ ): Promise<TaxInvoice> {
12
18
  const { domain, user, tx } = context.state
13
19
 
14
- const result = await tx.getRepository(TaxInvoice).save({
20
+ const newTaxInvoice = await tx.getRepository(TaxInvoice).save({
15
21
  ...taxInvoice,
16
22
  domain,
17
23
  creator: user,
18
24
  updater: user
19
25
  })
20
26
 
21
- return result
27
+ // 아이템 저장
28
+ for (const item of taxInvoiceItems) {
29
+ await tx.getRepository(TaxInvoiceItem).save({ ...item, taxInvoice: newTaxInvoice, domain, creator: user })
30
+ }
31
+
32
+ return newTaxInvoice
22
33
  }
23
34
 
24
35
  @Directive('@transaction')
@@ -105,18 +116,4 @@ export class TaxInvoiceMutation {
105
116
 
106
117
  return true
107
118
  }
108
-
109
- @Directive('@transaction')
110
- @Mutation(returns => Boolean, { description: 'To import multiple TaxInvoices' })
111
- async importTaxInvoices(@Arg('taxInvoices', type => [TaxInvoicePatch]) taxInvoices: TaxInvoicePatch[], @Ctx() context: ResolverContext): Promise<boolean> {
112
- const { domain, tx } = context.state
113
-
114
- await Promise.all(
115
- taxInvoices.map(async (taxInvoice: TaxInvoicePatch) => {
116
- const createdTaxInvoice: TaxInvoice = await tx.getRepository(TaxInvoice).save({ domain, ...taxInvoice })
117
- })
118
- )
119
-
120
- return true
121
- }
122
119
  }
@@ -34,7 +34,7 @@ export class TaxInvoiceQuery {
34
34
 
35
35
  @FieldResolver(type => [TaxInvoiceItem])
36
36
  async taxInvoiceItems(@Root() taxInvoice: TaxInvoice): Promise<TaxInvoiceItem[]> {
37
- return taxInvoice.id && (await getRepository(TaxInvoiceItem).findBy({ taxInvoiceId: taxInvoice.id }))
37
+ return taxInvoice.id && (await getRepository(TaxInvoiceItem).findBy({ taxInvoice: { id: taxInvoice.id } }))
38
38
  }
39
39
 
40
40
  @FieldResolver(type => Domain)
@@ -94,10 +94,6 @@ export class TaxInvoice {
94
94
  @Field(type => ID)
95
95
  readonly id!: string
96
96
 
97
- @VersionColumn()
98
- @Field({ nullable: true })
99
- version?: number = 1
100
-
101
97
  @ManyToOne(type => Domain)
102
98
  @Field({ nullable: true })
103
99
  domain?: Domain
@@ -26,10 +26,6 @@ export class TaxInvoiceApi {
26
26
  @Field(type => ID)
27
27
  readonly id!: string
28
28
 
29
- @VersionColumn()
30
- @Field({ nullable: true })
31
- version?: number = 1
32
-
33
29
  @ManyToOne(type => Domain)
34
30
  @Field({ nullable: true })
35
31
  domain?: Domain
@@ -39,10 +39,6 @@ export class TaxInvoiceCompany {
39
39
  @Field(type => ID)
40
40
  readonly id!: string
41
41
 
42
- @VersionColumn()
43
- @Field({ nullable: true })
44
- version?: number = 1
45
-
46
42
  @ManyToOne(type => Domain)
47
43
  @Field({ nullable: true })
48
44
  domain?: Domain
@@ -6,9 +6,6 @@ import { TaxInvoiceItem } from './tax-invoice-item'
6
6
 
7
7
  @InputType()
8
8
  export class NewTaxInvoiceItem {
9
- @Field({ nullable: false, description: '세금계산서 번호' })
10
- taxInvoiceId: string
11
-
12
9
  @Field(type => Int, { nullable: false, description: '아이템 일련번호' })
13
10
  sequence: number
14
11
 
@@ -42,9 +39,6 @@ export class TaxInvoiceItemPatch {
42
39
  @Field(type => ID, { nullable: false })
43
40
  id?: string
44
41
 
45
- @Field({ nullable: false, description: '세금계산서 번호' })
46
- taxInvoiceId: string
47
-
48
42
  @Field(type => Int, { nullable: false, description: '아이템 일련번호' })
49
43
  sequence: number
50
44
 
@@ -1,4 +1,4 @@
1
- import { CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Entity, Index, Column, RelationId, ManyToOne, PrimaryGeneratedColumn, VersionColumn } from 'typeorm'
1
+ import { CreateDateColumn, DeleteDateColumn, Entity, Index, Column, JoinColumn, RelationId, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
2
2
  import { ObjectType, Field, ID } from 'type-graphql'
3
3
 
4
4
  import { Domain } from '@things-factory/shell'
@@ -7,17 +7,13 @@ import { TaxInvoice } from '../tax-invoice/tax-invoice'
7
7
 
8
8
  @Entity()
9
9
  @Index('ix_tax_invoice_item_0', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.domain, taxInvoiceItem.id, taxInvoiceItem.deletedAt], { unique: true })
10
- // @Index('ix_tax_invoice_item_1', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.taxInvoiceId])
10
+ @Index('ix_tax_invoice_item_1', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.taxInvoice])
11
11
  @ObjectType({ description: 'Entity for TaxInvoiceItem' })
12
12
  export class TaxInvoiceItem {
13
13
  @PrimaryGeneratedColumn('uuid')
14
14
  @Field(type => ID)
15
15
  readonly id!: string
16
16
 
17
- @VersionColumn()
18
- @Field({ nullable: true })
19
- version?: number = 1
20
-
21
17
  @ManyToOne(type => Domain)
22
18
  @Field({ nullable: true })
23
19
  domain?: Domain
@@ -25,7 +21,7 @@ export class TaxInvoiceItem {
25
21
  @RelationId((taxInvoiceItem: TaxInvoiceItem) => taxInvoiceItem.domain)
26
22
  domainId?: string
27
23
 
28
- @ManyToOne(type => TaxInvoice)
24
+ @ManyToOne(type => TaxInvoice, taxInvoice => taxInvoice.taxInvoiceItems)
29
25
  @Field({ nullable: false })
30
26
  taxInvoice!: TaxInvoice
31
27