@things-factory/pdf 8.0.0-beta.8 → 8.0.0
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/bootstrap.js +6 -0
- package/client/pages/pdf-release/pdf-release-importer.ts +87 -0
- package/client/pages/pdf-release/pdf-release-list-page.ts +398 -0
- package/client/pages/pdf-template/pdf-template-importer.ts +87 -0
- package/client/pages/pdf-template/pdf-template-list-page.ts +491 -0
- package/client/route.ts +11 -0
- package/client/tsconfig.json +13 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/controller/pdf-service.ts +35 -0
- package/server/index.ts +3 -0
- package/server/routers/pdf-private-router.ts +85 -0
- package/server/routers/pdf-public-router.ts +80 -0
- package/server/routers/proxy-router.ts +9 -0
- package/server/routes.ts +19 -0
- package/server/service/index.ts +38 -0
- package/server/service/pdf-generate/pdf-generate-resolver.ts +81 -0
- package/server/service/pdf-release/index.ts +7 -0
- package/server/service/pdf-release/pdf-release-mutation.ts +138 -0
- package/server/service/pdf-release/pdf-release-query.ts +51 -0
- package/server/service/pdf-release/pdf-release-type.ts +55 -0
- package/server/service/pdf-release/pdf-release.ts +103 -0
- package/server/service/pdf-template/index.ts +7 -0
- package/server/service/pdf-template/pdf-template-mutation.ts +138 -0
- package/server/service/pdf-template/pdf-template-query.ts +51 -0
- package/server/service/pdf-template/pdf-template-type.ts +87 -0
- package/server/service/pdf-template/pdf-template.ts +108 -0
- package/server/tsconfig.json +10 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateDateColumn,
|
|
3
|
+
UpdateDateColumn,
|
|
4
|
+
DeleteDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
Index,
|
|
7
|
+
Column,
|
|
8
|
+
RelationId,
|
|
9
|
+
ManyToOne,
|
|
10
|
+
PrimaryGeneratedColumn
|
|
11
|
+
} from 'typeorm'
|
|
12
|
+
import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
|
|
13
|
+
|
|
14
|
+
import { Domain } from '@things-factory/shell'
|
|
15
|
+
import { User } from '@things-factory/auth-base'
|
|
16
|
+
import { PDFTemplate } from '../pdf-template/pdf-template'
|
|
17
|
+
|
|
18
|
+
export enum PDFReleaseStatus {
|
|
19
|
+
published = 'published',
|
|
20
|
+
failed = 'failed'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
registerEnumType(PDFReleaseStatus, {
|
|
24
|
+
name: 'PDFReleaseStatus',
|
|
25
|
+
description: 'state enumeration of a PDFRelease'
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
@Entity()
|
|
29
|
+
@Index('ix_pdf_release_0', (pdfRelease: PDFRelease) => [pdfRelease.domain, pdfRelease.name], {
|
|
30
|
+
where: '"deleted_at" IS NULL',
|
|
31
|
+
unique: true
|
|
32
|
+
})
|
|
33
|
+
@ObjectType({ description: 'Entity for PDFRelease' })
|
|
34
|
+
export class PDFRelease {
|
|
35
|
+
@PrimaryGeneratedColumn('uuid')
|
|
36
|
+
@Field(type => ID)
|
|
37
|
+
readonly id: string
|
|
38
|
+
|
|
39
|
+
@ManyToOne(type => Domain)
|
|
40
|
+
@Field({ nullable: true })
|
|
41
|
+
domain?: Domain
|
|
42
|
+
|
|
43
|
+
@RelationId((pdfRelease: PDFRelease) => pdfRelease.domain)
|
|
44
|
+
domainId?: string
|
|
45
|
+
|
|
46
|
+
@Column()
|
|
47
|
+
@Field({ nullable: true })
|
|
48
|
+
name?: string
|
|
49
|
+
|
|
50
|
+
@Column({ nullable: true })
|
|
51
|
+
@Field({ nullable: true })
|
|
52
|
+
description?: string
|
|
53
|
+
|
|
54
|
+
@Column({ nullable: true })
|
|
55
|
+
@Field({ nullable: true })
|
|
56
|
+
active?: boolean
|
|
57
|
+
|
|
58
|
+
@ManyToOne(type => PDFTemplate, { nullable: false })
|
|
59
|
+
@Field(type => PDFTemplate)
|
|
60
|
+
template?: PDFTemplate
|
|
61
|
+
|
|
62
|
+
@RelationId((release: PDFRelease) => release.template)
|
|
63
|
+
@Field()
|
|
64
|
+
templateId?: string
|
|
65
|
+
|
|
66
|
+
@Column()
|
|
67
|
+
@Field({ nullable: true })
|
|
68
|
+
filePath?: string
|
|
69
|
+
|
|
70
|
+
@Column()
|
|
71
|
+
@Field({ nullable: true })
|
|
72
|
+
fileUrl?: string
|
|
73
|
+
|
|
74
|
+
@Column({ nullable: true })
|
|
75
|
+
@Field({ nullable: true })
|
|
76
|
+
state?: PDFReleaseStatus
|
|
77
|
+
|
|
78
|
+
@CreateDateColumn()
|
|
79
|
+
@Field({ nullable: true })
|
|
80
|
+
createdAt?: Date
|
|
81
|
+
|
|
82
|
+
@UpdateDateColumn()
|
|
83
|
+
@Field({ nullable: true })
|
|
84
|
+
updatedAt?: Date
|
|
85
|
+
|
|
86
|
+
@DeleteDateColumn()
|
|
87
|
+
@Field({ nullable: true })
|
|
88
|
+
deletedAt?: Date
|
|
89
|
+
|
|
90
|
+
@ManyToOne(type => User, { nullable: true })
|
|
91
|
+
@Field(type => User, { nullable: true })
|
|
92
|
+
creator?: User
|
|
93
|
+
|
|
94
|
+
@RelationId((pdfRelease: PDFRelease) => pdfRelease.creator)
|
|
95
|
+
creatorId?: string
|
|
96
|
+
|
|
97
|
+
@ManyToOne(type => User, { nullable: true })
|
|
98
|
+
@Field(type => User, { nullable: true })
|
|
99
|
+
updater?: User
|
|
100
|
+
|
|
101
|
+
@RelationId((pdfRelease: PDFRelease) => pdfRelease.updater)
|
|
102
|
+
updaterId?: string
|
|
103
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PDFTemplate } from './pdf-template'
|
|
2
|
+
import { PDFTemplateQuery } from './pdf-template-query'
|
|
3
|
+
import { PDFTemplateMutation } from './pdf-template-mutation'
|
|
4
|
+
|
|
5
|
+
export const entities = [PDFTemplate]
|
|
6
|
+
export const resolvers = [PDFTemplateQuery, PDFTemplateMutation]
|
|
7
|
+
export const subscribers = []
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
|
|
2
|
+
import { In } from 'typeorm'
|
|
3
|
+
|
|
4
|
+
import { PDFTemplate } from './pdf-template'
|
|
5
|
+
import { NewPDFTemplate, PDFTemplatePatch } from './pdf-template-type'
|
|
6
|
+
|
|
7
|
+
@Resolver(PDFTemplate)
|
|
8
|
+
export class PDFTemplateMutation {
|
|
9
|
+
@Directive('@transaction')
|
|
10
|
+
@Mutation(returns => PDFTemplate, { description: 'To create new PDFTemplate' })
|
|
11
|
+
async createPDFTemplate(
|
|
12
|
+
@Arg('pdfTemplate') pdfTemplate: NewPDFTemplate,
|
|
13
|
+
@Ctx() context: ResolverContext
|
|
14
|
+
): Promise<PDFTemplate> {
|
|
15
|
+
const { domain, user, tx } = context.state
|
|
16
|
+
|
|
17
|
+
const result = await tx.getRepository(PDFTemplate).save({
|
|
18
|
+
...pdfTemplate,
|
|
19
|
+
domain,
|
|
20
|
+
creator: user,
|
|
21
|
+
updater: user
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
return result
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@Directive('@transaction')
|
|
28
|
+
@Mutation(returns => PDFTemplate, { description: 'To modify PDFTemplate information' })
|
|
29
|
+
async updatePDFTemplate(
|
|
30
|
+
@Arg('id') id: string,
|
|
31
|
+
@Arg('patch') patch: PDFTemplatePatch,
|
|
32
|
+
@Ctx() context: ResolverContext
|
|
33
|
+
): Promise<PDFTemplate> {
|
|
34
|
+
const { domain, user, tx } = context.state
|
|
35
|
+
|
|
36
|
+
const repository = tx.getRepository(PDFTemplate)
|
|
37
|
+
const pdfTemplate = await repository.findOne({
|
|
38
|
+
where: { domain: { id: domain.id }, id }
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const result = await repository.save({
|
|
42
|
+
...pdfTemplate,
|
|
43
|
+
...patch,
|
|
44
|
+
updater: user
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return result
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@Directive('@transaction')
|
|
51
|
+
@Mutation(returns => [PDFTemplate], { description: "To modify multiple PDFTemplates' information" })
|
|
52
|
+
async updateMultiplePDFTemplate(
|
|
53
|
+
@Arg('patches', type => [PDFTemplatePatch]) patches: PDFTemplatePatch[],
|
|
54
|
+
@Ctx() context: ResolverContext
|
|
55
|
+
): Promise<PDFTemplate[]> {
|
|
56
|
+
const { domain, user, tx } = context.state
|
|
57
|
+
|
|
58
|
+
let results = []
|
|
59
|
+
const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
|
|
60
|
+
const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
|
|
61
|
+
const pdfTemplateRepo = tx.getRepository(PDFTemplate)
|
|
62
|
+
|
|
63
|
+
if (_createRecords.length > 0) {
|
|
64
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
65
|
+
const newRecord = _createRecords[i]
|
|
66
|
+
|
|
67
|
+
const result = await pdfTemplateRepo.save({
|
|
68
|
+
...newRecord,
|
|
69
|
+
domain,
|
|
70
|
+
creator: user,
|
|
71
|
+
updater: user
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
results.push({ ...result, cuFlag: '+' })
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (_updateRecords.length > 0) {
|
|
79
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
80
|
+
const updateRecord = _updateRecords[i]
|
|
81
|
+
const pdfTemplate = await pdfTemplateRepo.findOneBy({ id: updateRecord.id })
|
|
82
|
+
|
|
83
|
+
const result = await pdfTemplateRepo.save({
|
|
84
|
+
...pdfTemplate,
|
|
85
|
+
...updateRecord,
|
|
86
|
+
updater: user
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
results.push({ ...result, cuFlag: 'M' })
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return results
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@Directive('@transaction')
|
|
97
|
+
@Mutation(returns => Boolean, { description: 'To delete PDFTemplate' })
|
|
98
|
+
async deletePDFTemplate(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
|
|
99
|
+
const { domain, tx } = context.state
|
|
100
|
+
|
|
101
|
+
await tx.getRepository(PDFTemplate).delete({ domain: { id: domain.id }, id })
|
|
102
|
+
|
|
103
|
+
return true
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@Directive('@transaction')
|
|
107
|
+
@Mutation(returns => Boolean, { description: 'To delete multiple PDFTemplates' })
|
|
108
|
+
async deletePDFTemplates(
|
|
109
|
+
@Arg('ids', type => [String]) ids: string[],
|
|
110
|
+
@Ctx() context: ResolverContext
|
|
111
|
+
): Promise<boolean> {
|
|
112
|
+
const { domain, tx } = context.state
|
|
113
|
+
|
|
114
|
+
await tx.getRepository(PDFTemplate).delete({
|
|
115
|
+
domain: { id: domain.id },
|
|
116
|
+
id: In(ids)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
return true
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@Directive('@transaction')
|
|
123
|
+
@Mutation(returns => Boolean, { description: 'To import multiple PDFTemplates' })
|
|
124
|
+
async importPDFTemplates(
|
|
125
|
+
@Arg('pdfTemplates', type => [PDFTemplatePatch]) pdfTemplates: PDFTemplatePatch[],
|
|
126
|
+
@Ctx() context: ResolverContext
|
|
127
|
+
): Promise<boolean> {
|
|
128
|
+
const { domain, tx } = context.state
|
|
129
|
+
|
|
130
|
+
await Promise.all(
|
|
131
|
+
pdfTemplates.map(async (pdfTemplate: PDFTemplatePatch) => {
|
|
132
|
+
const createdPDFTemplate: PDFTemplate = await tx.getRepository(PDFTemplate).save({ domain, ...pdfTemplate })
|
|
133
|
+
})
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
return true
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
|
|
2
|
+
import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
|
|
3
|
+
import { User } from '@things-factory/auth-base'
|
|
4
|
+
import { PDFTemplate } from './pdf-template'
|
|
5
|
+
import { PDFTemplateList } from './pdf-template-type'
|
|
6
|
+
|
|
7
|
+
@Resolver(PDFTemplate)
|
|
8
|
+
export class PDFTemplateQuery {
|
|
9
|
+
@Query(returns => PDFTemplate!, { nullable: true, description: 'To fetch a PDFTemplate' })
|
|
10
|
+
async PDFTemplate(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PDFTemplate> {
|
|
11
|
+
const { domain } = context.state
|
|
12
|
+
|
|
13
|
+
return await getRepository(PDFTemplate).findOne({
|
|
14
|
+
where: { domain: { id: domain.id }, id }
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Query(returns => PDFTemplateList, { description: 'To fetch multiple PDFTemplates' })
|
|
19
|
+
async PDFTemplates(
|
|
20
|
+
@Args(type => ListParam) params: ListParam,
|
|
21
|
+
@Ctx() context: ResolverContext
|
|
22
|
+
): Promise<PDFTemplateList> {
|
|
23
|
+
const { domain } = context.state
|
|
24
|
+
|
|
25
|
+
const queryBuilder = getQueryBuilderFromListParams({
|
|
26
|
+
domain,
|
|
27
|
+
params,
|
|
28
|
+
repository: await getRepository(PDFTemplate),
|
|
29
|
+
searchables: ['name', 'description']
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const [items, total] = await queryBuilder.getManyAndCount()
|
|
33
|
+
|
|
34
|
+
return { items, total }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@FieldResolver(type => Domain)
|
|
38
|
+
async domain(@Root() pdfTemplate: PDFTemplate): Promise<Domain> {
|
|
39
|
+
return pdfTemplate.domainId && (await getRepository(Domain).findOneBy({ id: pdfTemplate.domainId }))
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@FieldResolver(type => User)
|
|
43
|
+
async updater(@Root() pdfTemplate: PDFTemplate): Promise<User> {
|
|
44
|
+
return pdfTemplate.updaterId && (await getRepository(User).findOneBy({ id: pdfTemplate.updaterId }))
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@FieldResolver(type => User)
|
|
48
|
+
async creator(@Root() pdfTemplate: PDFTemplate): Promise<User> {
|
|
49
|
+
return pdfTemplate.creatorId && (await getRepository(User).findOneBy({ id: pdfTemplate.creatorId }))
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
|
|
2
|
+
|
|
3
|
+
import { PDFTemplate, PDFTemplateStatus } from './pdf-template'
|
|
4
|
+
|
|
5
|
+
@InputType()
|
|
6
|
+
export class NewPDFTemplate {
|
|
7
|
+
@Field()
|
|
8
|
+
name: string
|
|
9
|
+
|
|
10
|
+
@Field({ nullable: true })
|
|
11
|
+
description?: string
|
|
12
|
+
|
|
13
|
+
@Field(type => PDFTemplateStatus, { nullable: true })
|
|
14
|
+
state?: PDFTemplateStatus
|
|
15
|
+
|
|
16
|
+
@Field({ nullable: true })
|
|
17
|
+
active?: boolean
|
|
18
|
+
|
|
19
|
+
@Field({ nullable: true })
|
|
20
|
+
content_template?: string
|
|
21
|
+
|
|
22
|
+
@Field({ nullable: true })
|
|
23
|
+
header_template?: string
|
|
24
|
+
|
|
25
|
+
@Field({ nullable: true })
|
|
26
|
+
footer_template?: string
|
|
27
|
+
|
|
28
|
+
@Field({ nullable: true })
|
|
29
|
+
cover_template?: string
|
|
30
|
+
|
|
31
|
+
@Field({ nullable: true })
|
|
32
|
+
last_template?: string
|
|
33
|
+
|
|
34
|
+
@Field({ nullable: true, defaultValue: 'A4' })
|
|
35
|
+
page_size: string
|
|
36
|
+
|
|
37
|
+
@Field({ nullable: true })
|
|
38
|
+
watermark: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@InputType()
|
|
42
|
+
export class PDFTemplatePatch {
|
|
43
|
+
@Field(type => ID, { nullable: true })
|
|
44
|
+
id?: string
|
|
45
|
+
|
|
46
|
+
@Field({ nullable: true })
|
|
47
|
+
name?: string
|
|
48
|
+
|
|
49
|
+
@Field({ nullable: true })
|
|
50
|
+
description?: string
|
|
51
|
+
|
|
52
|
+
@Field(type => PDFTemplateStatus, { nullable: true })
|
|
53
|
+
state?: PDFTemplateStatus
|
|
54
|
+
|
|
55
|
+
@Field({ nullable: true })
|
|
56
|
+
active?: boolean
|
|
57
|
+
|
|
58
|
+
@Field({ nullable: true })
|
|
59
|
+
content_template?: string
|
|
60
|
+
|
|
61
|
+
@Field({ nullable: true })
|
|
62
|
+
header_template?: string
|
|
63
|
+
|
|
64
|
+
@Field({ nullable: true })
|
|
65
|
+
footer_template?: string
|
|
66
|
+
|
|
67
|
+
@Field({ nullable: true })
|
|
68
|
+
cover_template?: string
|
|
69
|
+
|
|
70
|
+
@Field({ nullable: true })
|
|
71
|
+
last_template?: string
|
|
72
|
+
|
|
73
|
+
@Field({ nullable: true, defaultValue: 'A4' })
|
|
74
|
+
page_size?: string
|
|
75
|
+
|
|
76
|
+
@Field({ nullable: true })
|
|
77
|
+
cuFlag?: string
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@ObjectType()
|
|
81
|
+
export class PDFTemplateList {
|
|
82
|
+
@Field(type => [PDFTemplate])
|
|
83
|
+
items: PDFTemplate[]
|
|
84
|
+
|
|
85
|
+
@Field(type => Int)
|
|
86
|
+
total: number
|
|
87
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateDateColumn,
|
|
3
|
+
UpdateDateColumn,
|
|
4
|
+
Entity,
|
|
5
|
+
Index,
|
|
6
|
+
Column,
|
|
7
|
+
RelationId,
|
|
8
|
+
ManyToOne,
|
|
9
|
+
PrimaryGeneratedColumn
|
|
10
|
+
} from 'typeorm'
|
|
11
|
+
import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
|
|
12
|
+
|
|
13
|
+
import { Domain } from '@things-factory/shell'
|
|
14
|
+
import { User } from '@things-factory/auth-base'
|
|
15
|
+
|
|
16
|
+
export enum PDFTemplateStatus {
|
|
17
|
+
draft = 'draft',
|
|
18
|
+
released = 'released'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
registerEnumType(PDFTemplateStatus, {
|
|
22
|
+
name: 'PDFTemplateStatus',
|
|
23
|
+
description: 'state enumeration of a PDF Template'
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
@Entity()
|
|
27
|
+
@Index('ix_pdf_template_0', (pdfTemplate: PDFTemplate) => [pdfTemplate.domain, pdfTemplate.name], {
|
|
28
|
+
unique: true
|
|
29
|
+
})
|
|
30
|
+
@ObjectType({ description: 'Entity for PDFTemplate' })
|
|
31
|
+
export class PDFTemplate {
|
|
32
|
+
@PrimaryGeneratedColumn('uuid')
|
|
33
|
+
@Field(type => ID)
|
|
34
|
+
readonly id: string
|
|
35
|
+
|
|
36
|
+
@ManyToOne(type => Domain)
|
|
37
|
+
@Field({ nullable: true })
|
|
38
|
+
domain?: Domain
|
|
39
|
+
|
|
40
|
+
@RelationId((pdfTemplate: PDFTemplate) => pdfTemplate.domain)
|
|
41
|
+
domainId?: string
|
|
42
|
+
|
|
43
|
+
@Column()
|
|
44
|
+
@Field({ nullable: true })
|
|
45
|
+
name?: string
|
|
46
|
+
|
|
47
|
+
@Column({ nullable: true })
|
|
48
|
+
@Field({ nullable: true })
|
|
49
|
+
description?: string
|
|
50
|
+
|
|
51
|
+
@Column({ nullable: true })
|
|
52
|
+
@Field({ nullable: true })
|
|
53
|
+
active?: boolean
|
|
54
|
+
|
|
55
|
+
@Column({ nullable: true })
|
|
56
|
+
@Field({ nullable: true })
|
|
57
|
+
state?: PDFTemplateStatus
|
|
58
|
+
|
|
59
|
+
@Column({ type: 'text', nullable: true })
|
|
60
|
+
@Field({ nullable: true })
|
|
61
|
+
content_template?: string
|
|
62
|
+
|
|
63
|
+
@Column({ type: 'text', nullable: true })
|
|
64
|
+
@Field({ nullable: true })
|
|
65
|
+
header_template?: string
|
|
66
|
+
|
|
67
|
+
@Column({ type: 'text', nullable: true })
|
|
68
|
+
@Field({ nullable: true })
|
|
69
|
+
footer_template?: string
|
|
70
|
+
|
|
71
|
+
@Column({ type: 'text', nullable: true })
|
|
72
|
+
@Field({ nullable: true })
|
|
73
|
+
cover_template?: string
|
|
74
|
+
|
|
75
|
+
@Column({ type: 'text', nullable: true })
|
|
76
|
+
@Field({ nullable: true })
|
|
77
|
+
last_template?: string
|
|
78
|
+
|
|
79
|
+
@Column({ default: 'A4' })
|
|
80
|
+
@Field({ nullable: true, defaultValue: 'A4' })
|
|
81
|
+
page_size?: string
|
|
82
|
+
|
|
83
|
+
@Column({ type: 'text', nullable: true })
|
|
84
|
+
@Field({ nullable: true })
|
|
85
|
+
watermark?: string
|
|
86
|
+
|
|
87
|
+
@CreateDateColumn()
|
|
88
|
+
@Field({ nullable: true })
|
|
89
|
+
createdAt?: Date
|
|
90
|
+
|
|
91
|
+
@UpdateDateColumn()
|
|
92
|
+
@Field({ nullable: true })
|
|
93
|
+
updatedAt?: Date
|
|
94
|
+
|
|
95
|
+
@ManyToOne(type => User, { nullable: true })
|
|
96
|
+
@Field(type => User, { nullable: true })
|
|
97
|
+
creator?: User
|
|
98
|
+
|
|
99
|
+
@RelationId((pdfTemplate: PDFTemplate) => pdfTemplate.creator)
|
|
100
|
+
creatorId?: string
|
|
101
|
+
|
|
102
|
+
@ManyToOne(type => User, { nullable: true })
|
|
103
|
+
@Field(type => User, { nullable: true })
|
|
104
|
+
updater?: User
|
|
105
|
+
|
|
106
|
+
@RelationId((pdfTemplate: PDFTemplate) => pdfTemplate.updater)
|
|
107
|
+
updaterId?: string
|
|
108
|
+
}
|