@things-factory/tax-invoice 6.2.88 → 6.2.90
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/client/pages/tax-invoice-api/tax-invoice-api-page.ts +47 -110
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +2 -4
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +47 -101
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +13 -21
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +4 -25
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js +7 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +19 -33
- package/server/service/tax-invoice-api/tax-invoice-api-query.ts +4 -21
- package/server/service/tax-invoice-api/tax-invoice-api.ts +7 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/tax-invoice",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.90",
|
|
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.88",
|
|
34
34
|
"@things-factory/shell": "^6.2.88"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "e3320460fa6f015851f8dc1d6d45ab3298c00ebc"
|
|
37
37
|
}
|
|
@@ -7,46 +7,32 @@ import { TaxInvoiceApiPatch } from './tax-invoice-api-type'
|
|
|
7
7
|
@Resolver(TaxInvoiceApi)
|
|
8
8
|
export class TaxInvoiceApiMutation {
|
|
9
9
|
@Directive('@transaction')
|
|
10
|
-
@Mutation(returns =>
|
|
11
|
-
async
|
|
12
|
-
@Arg('patches', type => [TaxInvoiceApiPatch]) patches: TaxInvoiceApiPatch[],
|
|
13
|
-
@Ctx() context: ResolverContext
|
|
14
|
-
): Promise<TaxInvoiceApi[]> {
|
|
10
|
+
@Mutation(returns => TaxInvoiceApi, { description: 'To modify Tax Invoice Api information' })
|
|
11
|
+
async updateMultipleTaxInvoiceApi(@Arg('patch', type => TaxInvoiceApiPatch) patch: TaxInvoiceApiPatch, @Ctx() context: ResolverContext): Promise<TaxInvoiceApi> {
|
|
15
12
|
const { domain, user, tx } = context.state
|
|
16
|
-
|
|
17
|
-
let results = []
|
|
18
|
-
const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
|
|
19
|
-
const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
|
|
20
13
|
const taxInvoiceApiRepo = tx.getRepository(TaxInvoiceApi)
|
|
14
|
+
let results
|
|
21
15
|
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
creator: user,
|
|
30
|
-
updater: user
|
|
31
|
-
})
|
|
16
|
+
if (patch.cuFlag.toUpperCase() === '+') {
|
|
17
|
+
const result = await taxInvoiceApiRepo.save({
|
|
18
|
+
...patch,
|
|
19
|
+
domain,
|
|
20
|
+
creator: user,
|
|
21
|
+
updater: user
|
|
22
|
+
})
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
}
|
|
24
|
+
results = { ...result, cuFlag: '+' }
|
|
35
25
|
}
|
|
36
26
|
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
...updateRecord,
|
|
45
|
-
updater: user
|
|
46
|
-
})
|
|
27
|
+
if (patch.cuFlag.toUpperCase() === 'M') {
|
|
28
|
+
const taxInvoiceApi = await taxInvoiceApiRepo.findOneBy({ id: patch.id })
|
|
29
|
+
const result = await taxInvoiceApiRepo.save({
|
|
30
|
+
...taxInvoiceApi,
|
|
31
|
+
...patch,
|
|
32
|
+
updater: user
|
|
33
|
+
})
|
|
47
34
|
|
|
48
|
-
|
|
49
|
-
}
|
|
35
|
+
results = { ...result, cuFlag: 'M' }
|
|
50
36
|
}
|
|
51
37
|
|
|
52
38
|
return results
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
-
import { Resolver, Query, FieldResolver, Root,
|
|
2
|
-
import { Domain,
|
|
1
|
+
import { Resolver, Query, FieldResolver, Root, Ctx } from 'type-graphql'
|
|
2
|
+
import { Domain, getRepository } from '@things-factory/shell'
|
|
3
3
|
import { User } from '@things-factory/auth-base'
|
|
4
4
|
import { TaxInvoiceApi } from './tax-invoice-api'
|
|
5
|
-
import { TaxInvoiceApiList } from './tax-invoice-api-type'
|
|
6
5
|
|
|
7
6
|
@Resolver(TaxInvoiceApi)
|
|
8
7
|
export class TaxInvoiceApiQuery {
|
|
9
8
|
@Query(returns => TaxInvoiceApi!, { nullable: true, description: 'To fetch a Tax Invoice Api' })
|
|
10
|
-
async taxInvoiceApi(@
|
|
9
|
+
async taxInvoiceApi(@Ctx() context: ResolverContext): Promise<TaxInvoiceApi> {
|
|
11
10
|
const { domain } = context.state
|
|
12
11
|
|
|
13
12
|
return await getRepository(TaxInvoiceApi).findOne({
|
|
14
|
-
where: { domain: { id: domain.id }
|
|
13
|
+
where: { domain: { id: domain.id } }
|
|
15
14
|
})
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
@Query(returns => TaxInvoiceApiList, { description: 'To fetch multiple Tax Invoice Api' })
|
|
19
|
-
async taxInvoiceApis(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceApiList> {
|
|
20
|
-
const { domain } = context.state
|
|
21
|
-
|
|
22
|
-
const queryBuilder = getQueryBuilderFromListParams({
|
|
23
|
-
domain,
|
|
24
|
-
params,
|
|
25
|
-
repository: await getRepository(TaxInvoiceApi),
|
|
26
|
-
searchables: ['name', 'description']
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const [items, total] = await queryBuilder.getManyAndCount()
|
|
30
|
-
|
|
31
|
-
return { items, total }
|
|
32
|
-
}
|
|
33
|
-
|
|
34
17
|
@FieldResolver(type => Domain)
|
|
35
18
|
async domain(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<Domain> {
|
|
36
19
|
return taxInvoiceApi.domainId && (await getRepository(Domain).findOneBy({ id: taxInvoiceApi.domainId }))
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CreateDateColumn,
|
|
3
|
-
UpdateDateColumn,
|
|
4
|
-
DeleteDateColumn,
|
|
5
|
-
Entity,
|
|
6
|
-
Index,
|
|
7
|
-
OneToOne,
|
|
8
|
-
Column,
|
|
9
|
-
RelationId,
|
|
10
|
-
ManyToOne,
|
|
11
|
-
PrimaryGeneratedColumn,
|
|
12
|
-
VersionColumn,
|
|
13
|
-
JoinColumn
|
|
14
|
-
} from 'typeorm'
|
|
1
|
+
import { CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Entity, Index, Column, RelationId, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
15
2
|
import { ObjectType, Field, ID } from 'type-graphql'
|
|
16
3
|
|
|
17
4
|
import { Domain, ScalarObject, encryptTransformer } from '@things-factory/shell'
|
|
18
5
|
import { User } from '@things-factory/auth-base'
|
|
19
6
|
|
|
20
|
-
@Entity()
|
|
7
|
+
@Entity('tax_invoice_api') // api는 한개만 존재해야함.
|
|
21
8
|
@Index('ix_tax_invoice_api_0', (taxInvoiceApi: TaxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.name, taxInvoiceApi.deletedAt])
|
|
22
9
|
@Index('ix_tax_invoice_api_1', (taxInvoiceApi: TaxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.description, taxInvoiceApi.deletedAt])
|
|
23
10
|
@ObjectType({ description: 'Entity for Tax Invoice Api' })
|
|
@@ -33,6 +20,11 @@ export class TaxInvoiceApi {
|
|
|
33
20
|
@RelationId((taxInvoiceApi: TaxInvoiceApi) => taxInvoiceApi.domain)
|
|
34
21
|
domainId?: string
|
|
35
22
|
|
|
23
|
+
// 2개 이상 들어가는 것을 방지하는 플래그
|
|
24
|
+
@Field({ nullable: false })
|
|
25
|
+
@Column({ nullable: false, default: 1, unique: true })
|
|
26
|
+
uniqueSequence!: number
|
|
27
|
+
|
|
36
28
|
@Field({ nullable: false })
|
|
37
29
|
@Column({ nullable: false })
|
|
38
30
|
name!: string
|