@things-factory/id-rule-base 6.1.84 → 6.1.87
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/dist-server/service/doc-number/doc-number-mutation.js +112 -0
- package/dist-server/service/doc-number/doc-number-mutation.js.map +1 -0
- package/dist-server/service/doc-number/doc-number-query.js +167 -0
- package/dist-server/service/doc-number/doc-number-query.js.map +1 -0
- package/dist-server/service/doc-number/doc-number-type.js +161 -0
- package/dist-server/service/doc-number/doc-number-type.js.map +1 -0
- package/dist-server/service/doc-number/doc-number.js +175 -0
- package/dist-server/service/doc-number/doc-number.js.map +1 -0
- package/dist-server/service/doc-number/index.js +9 -0
- package/dist-server/service/doc-number/index.js.map +1 -0
- package/dist-server/service/id-rule/id-rule-types.js +0 -1
- package/dist-server/service/id-rule/id-rule-types.js.map +1 -1
- package/dist-server/service/id-rule/id-rule.js +3 -33
- package/dist-server/service/id-rule/id-rule.js.map +1 -1
- package/dist-server/service/index.js +4 -2
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/doc-number/doc-number-mutation.ts +121 -0
- package/server/service/doc-number/doc-number-query.ts +145 -0
- package/server/service/doc-number/doc-number-type.ts +116 -0
- package/server/service/doc-number/doc-number.ts +164 -0
- package/server/service/doc-number/index.ts +7 -0
- package/server/service/id-rule/id-rule-types.ts +2 -3
- package/server/service/id-rule/id-rule.ts +3 -35
- package/server/service/index.ts +4 -2
- package/translations/en.json +15 -0
- package/translations/ja.json +15 -0
- package/translations/ko.json +16 -1
- package/translations/ms.json +16 -1
- package/translations/zh.json +16 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocNumber = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
let DocNumber = class DocNumber {
|
|
10
|
+
updateExpression() {
|
|
11
|
+
if (!this.expression || this.expression.length == 0) {
|
|
12
|
+
if (!this.startNo || this.startNo < 1) {
|
|
13
|
+
this.startNo = 1;
|
|
14
|
+
}
|
|
15
|
+
if (!this.endNo || this.endNo <= 1) {
|
|
16
|
+
let maxNo = '';
|
|
17
|
+
for (let i = 0; i < this.seqDigitNum; i++) {
|
|
18
|
+
maxNo = maxNo + '9';
|
|
19
|
+
}
|
|
20
|
+
this.endNo = Number(maxNo);
|
|
21
|
+
}
|
|
22
|
+
let expr = '';
|
|
23
|
+
if (this.prefix) {
|
|
24
|
+
expr = this.prefix;
|
|
25
|
+
if (this.separator) {
|
|
26
|
+
expr += this.separator;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (this.updateInterval && this.updateInterval != 'NONE') {
|
|
30
|
+
expr += '${' + this.updateInterval + '}';
|
|
31
|
+
if (this.separator) {
|
|
32
|
+
expr += this.separator;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
expr += '${SEQ}';
|
|
36
|
+
if (this.suffix) {
|
|
37
|
+
if (this.separator) {
|
|
38
|
+
expr += this.separator;
|
|
39
|
+
}
|
|
40
|
+
expr += this.suffix;
|
|
41
|
+
}
|
|
42
|
+
this.expression = expr;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
48
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], DocNumber.prototype, "id", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ name: 'code', type: 'character varying', nullable: false, length: 30 }),
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], DocNumber.prototype, "code", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ name: 'description', type: 'character varying', nullable: false, length: 100 }),
|
|
58
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
59
|
+
tslib_1.__metadata("design:type", String)
|
|
60
|
+
], DocNumber.prototype, "description", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ name: 'prefix', type: 'character varying', nullable: true, length: 10 }),
|
|
63
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
64
|
+
tslib_1.__metadata("design:type", String)
|
|
65
|
+
], DocNumber.prototype, "prefix", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ name: 'suffix', type: 'character varying', nullable: true, length: 10 }),
|
|
68
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
+
tslib_1.__metadata("design:type", String)
|
|
70
|
+
], DocNumber.prototype, "suffix", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ name: 'start_no', type: 'integer', nullable: true }),
|
|
73
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
74
|
+
tslib_1.__metadata("design:type", Number)
|
|
75
|
+
], DocNumber.prototype, "startNo", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ name: 'end_no', type: 'integer', nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
79
|
+
tslib_1.__metadata("design:type", Number)
|
|
80
|
+
], DocNumber.prototype, "endNo", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ name: 'current_no', type: 'integer', nullable: true }),
|
|
83
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
84
|
+
tslib_1.__metadata("design:type", Number)
|
|
85
|
+
], DocNumber.prototype, "currentNo", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ name: 'update_interval', type: 'character varying', nullable: true, length: 30 }),
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
89
|
+
tslib_1.__metadata("design:type", String)
|
|
90
|
+
], DocNumber.prototype, "updateInterval", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ name: 'use_db_seq_flag', type: 'boolean', nullable: true, default: false }),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
95
|
+
], DocNumber.prototype, "useDbSeqFlag", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({ name: 'seq_name', type: 'character varying', nullable: true, length: 100 }),
|
|
98
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], DocNumber.prototype, "seqName", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.Column)({ name: 'seq_digit_num', type: 'integer', nullable: false }),
|
|
103
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: false }),
|
|
104
|
+
tslib_1.__metadata("design:type", Number)
|
|
105
|
+
], DocNumber.prototype, "seqDigitNum", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({ name: 'separator', type: 'character varying', nullable: true, length: 10 }),
|
|
108
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
109
|
+
tslib_1.__metadata("design:type", String)
|
|
110
|
+
], DocNumber.prototype, "separator", void 0);
|
|
111
|
+
tslib_1.__decorate([
|
|
112
|
+
(0, typeorm_1.Column)({ name: 'expression', type: 'character varying', nullable: true, length: 100 }),
|
|
113
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
114
|
+
tslib_1.__metadata("design:type", String)
|
|
115
|
+
], DocNumber.prototype, "expression", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({ name: 'last_doc_number', type: 'character varying', nullable: true, length: 100 }),
|
|
118
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
119
|
+
tslib_1.__metadata("design:type", String)
|
|
120
|
+
], DocNumber.prototype, "lastDocNumber", void 0);
|
|
121
|
+
tslib_1.__decorate([
|
|
122
|
+
(0, typeorm_1.Column)({ name: 'active_flag', type: 'boolean', nullable: true, default: false }),
|
|
123
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
124
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
125
|
+
], DocNumber.prototype, "activeFlag", void 0);
|
|
126
|
+
tslib_1.__decorate([
|
|
127
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain, { createForeignKeyConstraints: false, nullable: false }),
|
|
128
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
129
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
130
|
+
], DocNumber.prototype, "domain", void 0);
|
|
131
|
+
tslib_1.__decorate([
|
|
132
|
+
(0, typeorm_1.RelationId)((docNumber) => docNumber.domain),
|
|
133
|
+
tslib_1.__metadata("design:type", String)
|
|
134
|
+
], DocNumber.prototype, "domainId", void 0);
|
|
135
|
+
tslib_1.__decorate([
|
|
136
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { createForeignKeyConstraints: false, nullable: true }),
|
|
137
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
138
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
139
|
+
], DocNumber.prototype, "creator", void 0);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, typeorm_1.RelationId)((docNumber) => docNumber.creator),
|
|
142
|
+
tslib_1.__metadata("design:type", String)
|
|
143
|
+
], DocNumber.prototype, "creatorId", void 0);
|
|
144
|
+
tslib_1.__decorate([
|
|
145
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { createForeignKeyConstraints: false, nullable: true }),
|
|
146
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
147
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
148
|
+
], DocNumber.prototype, "updater", void 0);
|
|
149
|
+
tslib_1.__decorate([
|
|
150
|
+
(0, typeorm_1.RelationId)((docNumber) => docNumber.updater),
|
|
151
|
+
tslib_1.__metadata("design:type", String)
|
|
152
|
+
], DocNumber.prototype, "updaterId", void 0);
|
|
153
|
+
tslib_1.__decorate([
|
|
154
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
155
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
156
|
+
tslib_1.__metadata("design:type", Date)
|
|
157
|
+
], DocNumber.prototype, "createdAt", void 0);
|
|
158
|
+
tslib_1.__decorate([
|
|
159
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
160
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
161
|
+
tslib_1.__metadata("design:type", Date)
|
|
162
|
+
], DocNumber.prototype, "updatedAt", void 0);
|
|
163
|
+
tslib_1.__decorate([
|
|
164
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
165
|
+
tslib_1.__metadata("design:type", Function),
|
|
166
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
167
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
168
|
+
], DocNumber.prototype, "updateExpression", null);
|
|
169
|
+
DocNumber = tslib_1.__decorate([
|
|
170
|
+
(0, typeorm_1.Entity)('doc_numbers'),
|
|
171
|
+
(0, typeorm_1.Index)('ix_doc_number_0', (docNumber) => [docNumber.domain, docNumber.code], { unique: true }),
|
|
172
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for DocNumber' })
|
|
173
|
+
], DocNumber);
|
|
174
|
+
exports.DocNumber = DocNumber;
|
|
175
|
+
//# sourceMappingURL=doc-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-number.js","sourceRoot":"","sources":["../../../server/service/doc-number/doc-number.ts"],"names":[],"mappings":";;;;AACA,qCAYgB;AAChB,+CAAkF;AAElF,yDAAgD;AAChD,iDAA8C;AAKvC,IAAM,SAAS,GAAf,MAAM,SAAS;IAgGpB,gBAAgB;QACd,IAAG,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;YAClD,IAAG,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBACpC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;aACjB;YAED,IAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE;gBACjC,IAAI,KAAK,GAAG,EAAE,CAAA;gBACd,KAAI,IAAI,CAAC,GAAG,CAAC,EAAG,CAAC,GAAG,IAAI,CAAC,WAAW,EAAG,CAAC,EAAE,EAAE;oBAC1C,KAAK,GAAG,KAAK,GAAG,GAAG,CAAA;iBACpB;gBACD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;aAC3B;YAED,IAAI,IAAI,GAAG,EAAE,CAAA;YAEb,IAAG,IAAI,CAAC,MAAM,EAAE;gBACd,IAAI,GAAG,IAAI,CAAC,MAAM,CAAA;gBAElB,IAAG,IAAI,CAAC,SAAS,EAAE;oBACjB,IAAI,IAAI,IAAI,CAAC,SAAS,CAAA;iBACvB;aACF;YAED,IAAG,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,IAAI,MAAM,EAAE;gBACvD,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,cAAc,GAAG,GAAG,CAAA;gBAExC,IAAG,IAAI,CAAC,SAA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6Cd;AA5IU,SAAS;IAHrB,IAAA,gBAAM,EAAC,aAAa,CAAC;IACrB,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,SAAS,CA6IrB;AA7IY,8BAAS","sourcesContent":["\nimport {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn,\n BeforeInsert\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, Float, registerEnumType } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n@Entity('doc_numbers')\n@Index('ix_doc_number_0', (docNumber: DocNumber) => [docNumber.domain,docNumber.code], { unique: true })\n@ObjectType({ description: 'Entity for DocNumber' })\nexport class DocNumber {\n\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ name:'code', type:'character varying', nullable:false , length:30 })\n @Field( { nullable:false })\n code: string\n\n @Column({ name:'description', type:'character varying', nullable:false , length:100 })\n @Field( { nullable:false })\n description: string\n\n @Column({ name:'prefix', type:'character varying', nullable:true , length:10 })\n @Field( { nullable:true })\n prefix?: string\n\n @Column({ name:'suffix', type:'character varying', nullable:true , length:10 })\n @Field( { nullable:true })\n suffix?: string\n\n @Column({ name:'start_no', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n startNo?: number\n\n @Column({ name:'end_no', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n endNo?: number\n\n @Column({ name:'current_no', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n currentNo?: number\n\n @Column({ name:'update_interval', type:'character varying', nullable:true , length:30 })\n @Field( { nullable:true })\n updateInterval?: string\n\n @Column({ name:'use_db_seq_flag', type:'boolean', nullable:true, default: false})\n @Field( { nullable:true })\n useDbSeqFlag?: boolean\n\n @Column({ name:'seq_name', type:'character varying', nullable:true , length:100 })\n @Field( { nullable:true })\n seqName?: string\n\n @Column({ name:'seq_digit_num', type:'integer', nullable:false })\n @Field(type =>Int, { nullable:false })\n seqDigitNum: number\n\n @Column({ name:'separator', type:'character varying', nullable:true , length:10 })\n @Field( { nullable:true })\n separator?: string\n\n @Column({ name:'expression', type:'character varying', nullable:true , length:100 })\n @Field( { nullable:true })\n expression?: string\n\n @Column({ name:'last_doc_number', type:'character varying', nullable:true , length:100 })\n @Field( { nullable:true })\n lastDocNumber?: string\n\n @Column({ name:'active_flag', type:'boolean', nullable:true ,default:false})\n @Field( { nullable:true })\n activeFlag?: boolean\n\n @ManyToOne(type => Domain, {createForeignKeyConstraints: false, nullable: false})\n @Field({ nullable: false })\n domain: Domain\n\n @RelationId((docNumber: DocNumber) => docNumber.domain)\n domainId: string\n\n @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((docNumber: DocNumber) => docNumber.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((docNumber: DocNumber) => docNumber.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @BeforeInsert()\n updateExpression() {\n if(!this.expression || this.expression.length == 0) {\n if(!this.startNo || this.startNo < 1) {\n this.startNo = 1\n }\n\n if(!this.endNo || this.endNo <= 1) {\n let maxNo = ''\n for(let i = 0 ; i < this.seqDigitNum ; i++) {\n maxNo = maxNo + '9'\n }\n this.endNo = Number(maxNo)\n }\n\n let expr = ''\n\n if(this.prefix) {\n expr = this.prefix\n \n if(this.separator) {\n expr += this.separator\n } \n }\n\n if(this.updateInterval && this.updateInterval != 'NONE') {\n expr += '${' + this.updateInterval + '}'\n\n if(this.separator) {\n expr += this.separator\n }\n }\n\n expr += '${SEQ}'\n\n if(this.suffix) {\n if(this.separator) {\n expr += this.separator\n }\n \n expr += this.suffix\n }\n\n this.expression = expr\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const doc_number_1 = require("./doc-number");
|
|
5
|
+
const doc_number_query_1 = require("./doc-number-query");
|
|
6
|
+
const doc_number_mutation_1 = require("./doc-number-mutation");
|
|
7
|
+
exports.entities = [doc_number_1.DocNumber];
|
|
8
|
+
exports.resolvers = [doc_number_query_1.DocNumberQuery, doc_number_mutation_1.DocNumberMutation];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/doc-number/index.ts"],"names":[],"mappings":";;;AACA,6CAAwC;AACxC,yDAAmD;AACnD,+DAAyD;AAE5C,QAAA,QAAQ,GAAG,CAAC,sBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,iCAAc,EAAE,uCAAiB,CAAC,CAAA","sourcesContent":["\nimport { DocNumber } from './doc-number'\nimport { DocNumberQuery } from './doc-number-query'\nimport { DocNumberMutation } from './doc-number-mutation'\n\nexport const entities = [DocNumber]\nexport const resolvers = [DocNumberQuery, DocNumberMutation]\n"]}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NewIdRule = exports.IdRulePatch = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const id_rule_1 = require("./id-rule");
|
|
7
6
|
let IdRulePatch = class IdRulePatch {
|
|
8
7
|
};
|
|
9
8
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-rule-types.js","sourceRoot":"","sources":["../../../server/service/id-rule/id-rule-types.ts"],"names":[],"mappings":";;;;AAAA,+CAA+C;
|
|
1
|
+
{"version":3,"file":"id-rule-types.js","sourceRoot":"","sources":["../../../server/service/id-rule/id-rule-types.ts"],"names":[],"mappings":";;;;AAAA,+CAA+C;AAIxC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACb;AALF,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CAMvB;AANY,kCAAW;AASjB,IAAM,SAAS,GAAf,MAAM,SAAS;CAMrB,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;uCACI;AAEZ;IAAC,IAAA,oBAAK,GAAE;;uCACI;AALD,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CAMrB;AANY,8BAAS","sourcesContent":["import { Field, InputType } from 'type-graphql'\n\n\n@InputType()\nexport class IdRulePatch {\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n rule?: string\n}\n\n@InputType()\nexport class NewIdRule {\n @Field()\n type: string\n\n @Field()\n rule: string\n}\n"]}
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdRule =
|
|
3
|
+
exports.IdRule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
6
|
const typeorm_1 = require("typeorm");
|
|
7
|
-
const env_1 = require("@things-factory/env");
|
|
8
7
|
const shell_1 = require("@things-factory/shell");
|
|
9
|
-
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
10
|
-
const DATABASE_TYPE = ORMCONFIG.type;
|
|
11
|
-
var IdRuleType;
|
|
12
|
-
(function (IdRuleType) {
|
|
13
|
-
IdRuleType["PALLET_ID"] = "pallet_id";
|
|
14
|
-
IdRuleType["ADJUSTMENT_PALLET_ID"] = "adjustment_pallet_id";
|
|
15
|
-
IdRuleType["ADJUSTMENT_CARTON_ID"] = "adjustment_carton_id";
|
|
16
|
-
IdRuleType["INBOUND_PALLET_ID"] = "inbound_pallet_id";
|
|
17
|
-
IdRuleType["INBOUND_CARTON_ID"] = "inbound_carton_id";
|
|
18
|
-
IdRuleType["VAS_PALLET_ID"] = "vas_pallet_id";
|
|
19
|
-
IdRuleType["DO_NUMBER"] = "do_number";
|
|
20
|
-
IdRuleType["TASK_NO"] = "task_number";
|
|
21
|
-
IdRuleType["GAN_NUMBER"] = "gan_number";
|
|
22
|
-
IdRuleType["GRN_NUMBER"] = "grn_number";
|
|
23
|
-
IdRuleType["RO_NUMBER"] = "ro_number";
|
|
24
|
-
IdRuleType["PO_NUMBER"] = "po_number";
|
|
25
|
-
IdRuleType["LOT_NO"] = "lot_no";
|
|
26
|
-
})(IdRuleType = exports.IdRuleType || (exports.IdRuleType = {}));
|
|
27
8
|
let IdRule = class IdRule {
|
|
28
9
|
};
|
|
29
10
|
tslib_1.__decorate([
|
|
@@ -41,17 +22,8 @@ tslib_1.__decorate([
|
|
|
41
22
|
tslib_1.__metadata("design:type", String)
|
|
42
23
|
], IdRule.prototype, "domainId", void 0);
|
|
43
24
|
tslib_1.__decorate([
|
|
44
|
-
(0, typeorm_1.Column)(
|
|
45
|
-
|
|
46
|
-
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
47
|
-
? 'enum'
|
|
48
|
-
: DATABASE_TYPE == 'oracle'
|
|
49
|
-
? 'varchar2'
|
|
50
|
-
: 'smallint',
|
|
51
|
-
enum: IdRuleType,
|
|
52
|
-
default: IdRuleType.PALLET_ID
|
|
53
|
-
}),
|
|
54
|
-
(0, type_graphql_1.Field)(),
|
|
25
|
+
(0, typeorm_1.Column)(),
|
|
26
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
27
|
tslib_1.__metadata("design:type", String)
|
|
56
28
|
], IdRule.prototype, "type", void 0);
|
|
57
29
|
tslib_1.__decorate([
|
|
@@ -71,9 +43,7 @@ tslib_1.__decorate([
|
|
|
71
43
|
], IdRule.prototype, "updatedAt", void 0);
|
|
72
44
|
IdRule = tslib_1.__decorate([
|
|
73
45
|
(0, typeorm_1.Entity)(),
|
|
74
|
-
(0, typeorm_1.Index)('ix_id_rule_0', (idRule) => [idRule.domain, idRule.type], { unique: true }),
|
|
75
46
|
(0, typeorm_1.Index)('ix_id_rule_1', (idRule) => [idRule.domain]),
|
|
76
|
-
(0, typeorm_1.Index)('ix_id_rule_2', (idRule) => [idRule.type]),
|
|
77
47
|
(0, type_graphql_1.ObjectType)()
|
|
78
48
|
], IdRule);
|
|
79
49
|
exports.IdRule = IdRule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-rule.js","sourceRoot":"","sources":["../../../server/service/id-rule/id-rule.ts"],"names":[],"mappings":";;;;AAAA,+CAIqB;AACrB,qCASgB;AAEhB,
|
|
1
|
+
{"version":3,"file":"id-rule.js","sourceRoot":"","sources":["../../../server/service/id-rule/id-rule.ts"],"names":[],"mappings":";;;;AAAA,+CAIqB;AACrB,qCASgB;AAEhB,iDAA8C;AAKvC,IAAM,MAAM,GAAZ,MAAM,MAAM;CA2BlB,CAAA;AA1BC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;kCACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACd,cAAM;sCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;;wCAC9B;AAEhB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oCACd;AAEZ;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;oCACI;AAEZ;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;yCAAA;AAEf;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;yCAAA;AA1BJ,MAAM;IAHlB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAA,yBAAU,GAAE;GACA,MAAM,CA2BlB;AA3BY,wBAAM","sourcesContent":["import {\n Field,\n ID,\n ObjectType\n} from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { Domain } from '@things-factory/shell'\n\n@Entity()\n@Index('ix_id_rule_1', (idRule: IdRule) => [idRule.domain])\n@ObjectType()\nexport class IdRule {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain: Domain\n\n @RelationId((idRule: IdRule) => idRule.domain)\n domainId: string\n\n @Column()\n @Field({ nullable: true })\n type: string\n\n @Column()\n @Field()\n rule: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n}\n"]}
|
|
@@ -4,13 +4,15 @@ exports.schema = exports.entities = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const id_rule_1 = require("./id-rule");
|
|
6
6
|
const sequence_1 = require("./sequence");
|
|
7
|
+
const doc_number_1 = require("./doc-number");
|
|
7
8
|
/* EXPORT ENTITY TYPES */
|
|
8
9
|
tslib_1.__exportStar(require("./id-rule/id-rule"), exports);
|
|
9
10
|
/* EXPORT TYPES */
|
|
10
11
|
tslib_1.__exportStar(require("./id-rule/id-rule-types"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./sequence/sequence"), exports);
|
|
12
|
-
|
|
13
|
+
tslib_1.__exportStar(require("./doc-number/doc-number"), exports);
|
|
14
|
+
exports.entities = [...id_rule_1.entities, ...sequence_1.entities, ...doc_number_1.entities];
|
|
13
15
|
exports.schema = {
|
|
14
|
-
resolverClasses: [...id_rule_1.resolvers, ...sequence_1.resolvers]
|
|
16
|
+
resolverClasses: [...id_rule_1.resolvers, ...sequence_1.resolvers, ...doc_number_1.resolvers]
|
|
15
17
|
};
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAoF;AACpF,yCAAyF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAoF;AACpF,yCAAyF;AACzF,6CAA6F;AAE7F,yBAAyB;AACzB,4DAAiC;AACjC,kBAAkB;AAClB,kEAAuC;AACvC,8DAAmC;AACnC,kEAAuC;AAE1B,QAAA,QAAQ,GAAG,CAAC,GAAG,kBAAc,EAAE,GAAG,mBAAgB,EAAE,GAAG,qBAAiB,CAAC,CAAA;AAEzE,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE,CAAC,GAAG,mBAAe,EAAE,GAAG,oBAAiB,EAAE,GAAG,sBAAkB,CAAC;CACnF,CAAA","sourcesContent":["import { entities as IdRuleEntities, resolvers as IdRuleResolvers } from './id-rule'\nimport { entities as SequenceEntities, resolvers as SequenceResolvers } from './sequence'\nimport { entities as DocNumberEntities, resolvers as DocNumberResolvers } from './doc-number'\n\n/* EXPORT ENTITY TYPES */\nexport * from './id-rule/id-rule'\n/* EXPORT TYPES */\nexport * from './id-rule/id-rule-types'\nexport * from './sequence/sequence'\nexport * from './doc-number/doc-number'\n\nexport const entities = [...IdRuleEntities, ...SequenceEntities, ...DocNumberEntities]\n\nexport const schema = {\n resolverClasses: [...IdRuleResolvers, ...SequenceResolvers, ...DocNumberResolvers]\n}\n"]}
|