@things-factory/id-rule-base 6.2.177 → 6.2.178
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/constants/index.d.ts +1 -0
- package/dist-server/constants/sequence-type.d.ts +3 -0
- package/dist-server/controllers/id-generator.d.ts +13 -0
- package/dist-server/controllers/id-generator.js +2 -3
- package/dist-server/controllers/id-generator.js.map +1 -1
- package/dist-server/controllers/index.d.ts +1 -0
- package/dist-server/index.d.ts +5 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/service/doc-number/doc-number-mutation.d.ts +9 -0
- package/dist-server/service/doc-number/doc-number-mutation.js +2 -2
- package/dist-server/service/doc-number/doc-number-mutation.js.map +1 -1
- package/dist-server/service/doc-number/doc-number-query.d.ts +13 -0
- package/dist-server/service/doc-number/doc-number-query.js +2 -2
- package/dist-server/service/doc-number/doc-number-query.js.map +1 -1
- package/dist-server/service/doc-number/doc-number-type.d.ts +41 -0
- package/dist-server/service/doc-number/doc-number-type.js +6 -6
- package/dist-server/service/doc-number/doc-number-type.js.map +1 -1
- package/dist-server/service/doc-number/doc-number.d.ts +29 -0
- package/dist-server/service/doc-number/doc-number.js +2 -2
- package/dist-server/service/doc-number/doc-number.js.map +1 -1
- package/dist-server/service/doc-number/index.d.ts +5 -0
- package/dist-server/service/id-rule/id-rule-mutation.d.ts +10 -0
- package/dist-server/service/id-rule/id-rule-mutation.js +2 -2
- package/dist-server/service/id-rule/id-rule-mutation.js.map +1 -1
- package/dist-server/service/id-rule/id-rule-query.d.ts +6 -0
- package/dist-server/service/id-rule/id-rule-query.js +2 -2
- package/dist-server/service/id-rule/id-rule-query.js.map +1 -1
- package/dist-server/service/id-rule/id-rule-types.d.ts +8 -0
- package/dist-server/service/id-rule/id-rule-types.js +4 -4
- package/dist-server/service/id-rule/id-rule-types.js.map +1 -1
- package/dist-server/service/id-rule/id-rule.d.ts +10 -0
- package/dist-server/service/id-rule/id-rule.js +2 -2
- package/dist-server/service/id-rule/id-rule.js.map +1 -1
- package/dist-server/service/id-rule/index.d.ts +5 -0
- package/dist-server/service/index.d.ts +8 -0
- package/dist-server/service/sequence/index.d.ts +4 -0
- package/dist-server/service/sequence/sequence-mutation.d.ts +4 -0
- package/dist-server/service/sequence/sequence-mutation.js +2 -2
- package/dist-server/service/sequence/sequence-mutation.js.map +1 -1
- package/dist-server/service/sequence/sequence.d.ts +12 -0
- package/dist-server/service/sequence/sequence.js +2 -2
- package/dist-server/service/sequence/sequence.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -7,6 +7,7 @@ const typeorm_1 = require("typeorm");
|
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
|
8
8
|
let IdRule = class IdRule {
|
|
9
9
|
};
|
|
10
|
+
exports.IdRule = IdRule;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
12
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
12
13
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -41,10 +42,9 @@ tslib_1.__decorate([
|
|
|
41
42
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
43
|
tslib_1.__metadata("design:type", Date)
|
|
43
44
|
], IdRule.prototype, "updatedAt", void 0);
|
|
44
|
-
IdRule = tslib_1.__decorate([
|
|
45
|
+
exports.IdRule = IdRule = tslib_1.__decorate([
|
|
45
46
|
(0, typeorm_1.Entity)(),
|
|
46
47
|
(0, typeorm_1.Index)('ix_id_rule_1', (idRule) => [idRule.domain]),
|
|
47
48
|
(0, type_graphql_1.ObjectType)()
|
|
48
49
|
], IdRule);
|
|
49
|
-
exports.IdRule = IdRule;
|
|
50
50
|
//# sourceMappingURL=id-rule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-rule.js","sourceRoot":"","sources":["../../../server/service/id-rule/id-rule.ts"],"names":[],"mappings":";;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,CA2BlB","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"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IdRule } from './id-rule';
|
|
2
|
+
import { IdRuleMutation } from './id-rule-mutation';
|
|
3
|
+
import { IdRuleQuery } from './id-rule-query';
|
|
4
|
+
export declare const entities: (typeof IdRule)[];
|
|
5
|
+
export declare const resolvers: (typeof IdRuleMutation | typeof IdRuleQuery)[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './id-rule/id-rule';
|
|
2
|
+
export * from './id-rule/id-rule-types';
|
|
3
|
+
export * from './sequence/sequence';
|
|
4
|
+
export * from './doc-number/doc-number';
|
|
5
|
+
export declare const entities: (typeof import("./id-rule/id-rule").IdRule | typeof import("./sequence/sequence").Sequence | typeof import("./doc-number/doc-number").DocNumber)[];
|
|
6
|
+
export declare const schema: {
|
|
7
|
+
resolverClasses: (typeof import("./id-rule/id-rule-mutation").IdRuleMutation | typeof import("./id-rule/id-rule-query").IdRuleQuery | typeof import("./sequence/sequence-mutation").SequenceMutation | typeof import("./doc-number/doc-number-query").DocNumberQuery | typeof import("./doc-number/doc-number-mutation").DocNumberMutation)[];
|
|
8
|
+
};
|
|
@@ -41,6 +41,7 @@ let SequenceMutation = class SequenceMutation {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
+
exports.SequenceMutation = SequenceMutation;
|
|
44
45
|
tslib_1.__decorate([
|
|
45
46
|
(0, type_graphql_1.Mutation)(returns => sequence_1.Sequence),
|
|
46
47
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('type')),
|
|
@@ -51,8 +52,7 @@ tslib_1.__decorate([
|
|
|
51
52
|
tslib_1.__metadata("design:paramtypes", [String, Number, String, Object]),
|
|
52
53
|
tslib_1.__metadata("design:returntype", Promise)
|
|
53
54
|
], SequenceMutation.prototype, "upsertSequence", null);
|
|
54
|
-
SequenceMutation = tslib_1.__decorate([
|
|
55
|
+
exports.SequenceMutation = SequenceMutation = tslib_1.__decorate([
|
|
55
56
|
(0, type_graphql_1.Resolver)(sequence_1.Sequence)
|
|
56
57
|
], SequenceMutation);
|
|
57
|
-
exports.SequenceMutation = SequenceMutation;
|
|
58
58
|
//# sourceMappingURL=sequence-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence-mutation.js","sourceRoot":"","sources":["../../../server/service/sequence/sequence-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAE3D,iDAAqD;AAErD,+CAA+C;AAC/C,yCAAqC;AAG9B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,AAAN,KAAK,CAAC,cAAc,CACL,IAAY,EACT,OAAe,EACZ,UAAkB,EAC9B,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAA;QACvC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,Q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AAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CA+C5B","sourcesContent":["import { Arg, Ctx, Mutation, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { SEQUENCE_TYPE } from '../../constants'\nimport { Sequence } from './sequence'\n\n@Resolver(Sequence)\nexport class SequenceMutation {\n @Mutation(returns => Sequence)\n async upsertSequence(\n @Arg('type') type: string,\n @Arg('counter') counter: number,\n @Arg('bizplaceId') bizplaceId: string,\n @Ctx() context: any\n ) {\n const { domain } = context.state\n const seqRepo = getRepository(Sequence)\n const now = new Date()\n const expiresAt = new Date(now.setMonth(now.getMonth() + 12))\n\n const patternObj: any = {\n type,\n date: new Date().toISOString().split('T')[0],\n bizplaceId\n }\n\n const pattern: string = JSON.stringify(patternObj)\n\n const foundSeq = await seqRepo.findOne({\n where: { pattern, type: SEQUENCE_TYPE.PRODUCT_LABEL_COUNTER, domain: { id: domain.id } }\n })\n\n if (foundSeq) {\n await seqRepo.update(\n { id: foundSeq.id },\n {\n pattern,\n seq: counter ? foundSeq.seq + counter : foundSeq.seq + 1,\n expiresAt,\n updatedAt: now\n }\n )\n\n return await seqRepo.findOneBy({ id: foundSeq.id })\n } else {\n return await seqRepo.save({\n domain,\n pattern,\n seq: counter || 1,\n expiresAt,\n type: SEQUENCE_TYPE.PRODUCT_LABEL_COUNTER\n })\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
export declare class Sequence {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
domain: Domain;
|
|
5
|
+
domainId?: string;
|
|
6
|
+
pattern: string;
|
|
7
|
+
seq: number;
|
|
8
|
+
type: string;
|
|
9
|
+
expiresAt: Date;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
@@ -7,6 +7,7 @@ const typeorm_1 = require("typeorm");
|
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
|
8
8
|
let Sequence = class Sequence {
|
|
9
9
|
};
|
|
10
|
+
exports.Sequence = Sequence;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
12
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
12
13
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -53,12 +54,11 @@ tslib_1.__decorate([
|
|
|
53
54
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
55
|
tslib_1.__metadata("design:type", Date)
|
|
55
56
|
], Sequence.prototype, "updatedAt", void 0);
|
|
56
|
-
Sequence = tslib_1.__decorate([
|
|
57
|
+
exports.Sequence = Sequence = tslib_1.__decorate([
|
|
57
58
|
(0, typeorm_1.Entity)(),
|
|
58
59
|
(0, typeorm_1.Index)('ix_sequence_0', (seq) => [seq.domain, seq.pattern], { unique: true }),
|
|
59
60
|
(0, typeorm_1.Index)('ix_sequence_1', (seq) => [seq.pattern]),
|
|
60
61
|
(0, typeorm_1.Index)('ix_sequence_2', (seq) => [seq.expiresAt]),
|
|
61
62
|
(0, type_graphql_1.ObjectType)()
|
|
62
63
|
], Sequence);
|
|
63
|
-
exports.Sequence = Sequence;
|
|
64
64
|
//# sourceMappingURL=sequence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.js","sourceRoot":"","sources":["../../../server/service/sequence/sequence.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,iDAA8C;AAOvC,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAsCpB,CAAA;
|
|
1
|
+
{"version":3,"file":"sequence.js","sourceRoot":"","sources":["../../../server/service/sequence/sequence.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,iDAA8C;AAOvC,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAsCpB,CAAA;AAtCY,4BAAQ;AAGV;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9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AE,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1D,IAAA,yBAAU,GAAE;GACA,QAAQ,CAsCpB","sourcesContent":["import { Field, ID, ObjectType } 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_sequence_0', (seq: Sequence) => [seq.domain, seq.pattern], { unique: true })\n@Index('ix_sequence_1', (seq: Sequence) => [seq.pattern])\n@Index('ix_sequence_2', (seq: Sequence) => [seq.expiresAt])\n@ObjectType()\nexport class Sequence {\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((sequence: Sequence) => sequence.domain)\n domainId?: string\n\n @Column()\n @Field()\n pattern: string\n\n @Column({\n type: 'smallint'\n })\n @Field()\n seq: number\n\n //// to differentiate between normal pattern sequence VS label counter ////\n @Column({ nullable: true })\n @Field()\n type: string\n\n @Column()\n @Field()\n expiresAt: Date\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n}\n"]}
|