@mbc-cqrs-serverless/sequence 0.1.35-beta.0 → 0.1.37-beta.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/dist/constants/sequence.constant.d.ts +8 -0
- package/dist/constants/sequence.constant.js +8 -0
- package/dist/constants/sequence.constant.js.map +1 -0
- package/dist/dto/gen-sequence.dto.d.ts +27 -8
- package/dist/dto/gen-sequence.dto.js +52 -16
- package/dist/dto/gen-sequence.dto.js.map +1 -1
- package/dist/entities/sequence.entity.d.ts +7 -0
- package/dist/entities/sequence.entity.js +10 -0
- package/dist/entities/sequence.entity.js.map +1 -0
- package/dist/interfaces/sequence-service.interface.d.ts +23 -2
- package/dist/sequence-master-factory.d.ts +8 -0
- package/dist/sequence-master-factory.js +45 -0
- package/dist/sequence-master-factory.js.map +1 -0
- package/dist/sequence.module.js +10 -1
- package/dist/sequence.module.js.map +1 -1
- package/dist/sequences.service.d.ts +27 -7
- package/dist/sequences.service.js +85 -62
- package/dist/sequences.service.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_VALUE_MASTER_DATA = exports.DEFAULT_MASTER_DATA = void 0;
|
|
4
|
+
exports.DEFAULT_MASTER_DATA = Symbol('DEFAULT_MASTER_DATA');
|
|
5
|
+
exports.DEFAULT_VALUE_MASTER_DATA = {
|
|
6
|
+
format: '%%no%%',
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=sequence.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequence.constant.js","sourceRoot":"","sources":["../../src/constants/sequence.constant.ts"],"names":[],"mappings":";;;AAMa,QAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAA;AAEnD,QAAA,yBAAyB,GAAmB;IACvD,MAAM,EAAE,QAAQ;CACjB,CAAA"}
|
|
@@ -1,27 +1,46 @@
|
|
|
1
1
|
import { RotateByEnum } from '../enums/rotate-by.enum';
|
|
2
2
|
export declare class SequenceParamsDto {
|
|
3
3
|
code1: string;
|
|
4
|
-
code2
|
|
4
|
+
code2?: string;
|
|
5
5
|
code3?: string;
|
|
6
6
|
code4?: string;
|
|
7
7
|
code5?: string;
|
|
8
8
|
constructor(partial: Partial<SequenceParamsDto>);
|
|
9
9
|
}
|
|
10
10
|
export declare class GenSequenceDto {
|
|
11
|
+
/**
|
|
12
|
+
* Date for sequence generation (optional).
|
|
13
|
+
*/
|
|
11
14
|
date?: Date;
|
|
15
|
+
/**
|
|
16
|
+
* Rotation criteria for the sequence (e.g., yearly, fiscal-yearly).
|
|
17
|
+
*/
|
|
12
18
|
rotateBy?: RotateByEnum;
|
|
19
|
+
/**
|
|
20
|
+
* Tenant code for identifying the organization.
|
|
21
|
+
*/
|
|
13
22
|
tenantCode: string;
|
|
14
|
-
params: SequenceParamsDto;
|
|
15
23
|
/**
|
|
16
|
-
*
|
|
24
|
+
* Type code for specific sequence classification.
|
|
25
|
+
*/
|
|
26
|
+
typeCode: string;
|
|
27
|
+
}
|
|
28
|
+
export declare class GenerateFormattedSequenceDto {
|
|
29
|
+
/**
|
|
30
|
+
* Date for sequence generation (optional).
|
|
31
|
+
*/
|
|
32
|
+
date?: Date;
|
|
33
|
+
/**
|
|
34
|
+
* Rotation criteria for the sequence (e.g., yearly, fiscal-yearly).
|
|
17
35
|
*/
|
|
18
|
-
|
|
36
|
+
rotateBy?: RotateByEnum;
|
|
19
37
|
/**
|
|
20
|
-
*
|
|
38
|
+
* Tenant code for identifying the organization.
|
|
21
39
|
*/
|
|
22
|
-
|
|
40
|
+
tenantCode: string;
|
|
41
|
+
typeCode: string;
|
|
23
42
|
/**
|
|
24
|
-
*
|
|
43
|
+
* Type code for specific sequence classification.
|
|
25
44
|
*/
|
|
26
|
-
|
|
45
|
+
params: SequenceParamsDto;
|
|
27
46
|
}
|
|
@@ -9,8 +9,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GenSequenceDto = exports.SequenceParamsDto = void 0;
|
|
12
|
+
exports.GenerateFormattedSequenceDto = exports.GenSequenceDto = exports.SequenceParamsDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
15
|
const class_validator_1 = require("class-validator");
|
|
15
16
|
const rotate_by_enum_1 = require("../enums/rotate-by.enum");
|
|
16
17
|
class SequenceParamsDto {
|
|
@@ -25,6 +26,7 @@ __decorate([
|
|
|
25
26
|
], SequenceParamsDto.prototype, "code1", void 0);
|
|
26
27
|
__decorate([
|
|
27
28
|
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
30
|
__metadata("design:type", String)
|
|
29
31
|
], SequenceParamsDto.prototype, "code2", void 0);
|
|
30
32
|
__decorate([
|
|
@@ -46,9 +48,18 @@ class GenSequenceDto {
|
|
|
46
48
|
}
|
|
47
49
|
exports.GenSequenceDto = GenSequenceDto;
|
|
48
50
|
__decorate([
|
|
49
|
-
(0, class_validator_1.IsString)(),
|
|
50
51
|
(0, class_validator_1.IsOptional)(),
|
|
51
|
-
|
|
52
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
53
|
+
(0, swagger_1.ApiProperty)({
|
|
54
|
+
type: Date,
|
|
55
|
+
required: false,
|
|
56
|
+
description: 'Date for sequence generation.',
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", Date
|
|
59
|
+
/**
|
|
60
|
+
* Rotation criteria for the sequence (e.g., yearly, fiscal-yearly).
|
|
61
|
+
*/
|
|
62
|
+
)
|
|
52
63
|
], GenSequenceDto.prototype, "date", void 0);
|
|
53
64
|
__decorate([
|
|
54
65
|
(0, swagger_1.ApiProperty)({ enum: rotate_by_enum_1.RotateByEnum, example: rotate_by_enum_1.RotateByEnum.FISCAL_YEARLY }),
|
|
@@ -58,29 +69,54 @@ __decorate([
|
|
|
58
69
|
], GenSequenceDto.prototype, "rotateBy", void 0);
|
|
59
70
|
__decorate([
|
|
60
71
|
(0, class_validator_1.IsString)(),
|
|
72
|
+
(0, swagger_1.ApiProperty)({ description: 'Code of the tenant (organization).' }),
|
|
61
73
|
__metadata("design:type", String)
|
|
62
74
|
], GenSequenceDto.prototype, "tenantCode", void 0);
|
|
63
75
|
__decorate([
|
|
64
|
-
(0, class_validator_1.
|
|
65
|
-
|
|
76
|
+
(0, class_validator_1.IsString)(),
|
|
77
|
+
(0, swagger_1.ApiProperty)({
|
|
78
|
+
required: true,
|
|
79
|
+
description: 'Type code for specific classification.',
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], GenSequenceDto.prototype, "typeCode", void 0);
|
|
83
|
+
class GenerateFormattedSequenceDto {
|
|
84
|
+
}
|
|
85
|
+
exports.GenerateFormattedSequenceDto = GenerateFormattedSequenceDto;
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
89
|
+
(0, swagger_1.ApiProperty)({
|
|
90
|
+
type: Date,
|
|
91
|
+
required: false,
|
|
92
|
+
description: 'Date for sequence generation.',
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", Date
|
|
66
95
|
/**
|
|
67
|
-
*
|
|
96
|
+
* Rotation criteria for the sequence (e.g., yearly, fiscal-yearly).
|
|
68
97
|
*/
|
|
69
98
|
)
|
|
70
|
-
],
|
|
99
|
+
], GenerateFormattedSequenceDto.prototype, "date", void 0);
|
|
71
100
|
__decorate([
|
|
72
|
-
(0,
|
|
101
|
+
(0, swagger_1.ApiProperty)({ enum: rotate_by_enum_1.RotateByEnum, example: rotate_by_enum_1.RotateByEnum.FISCAL_YEARLY }),
|
|
73
102
|
(0, class_validator_1.IsOptional)(),
|
|
103
|
+
(0, class_validator_1.IsEnum)(rotate_by_enum_1.RotateByEnum),
|
|
74
104
|
__metadata("design:type", String)
|
|
75
|
-
],
|
|
105
|
+
], GenerateFormattedSequenceDto.prototype, "rotateBy", void 0);
|
|
76
106
|
__decorate([
|
|
77
|
-
(0, class_validator_1.
|
|
78
|
-
(
|
|
79
|
-
|
|
80
|
-
], GenSequenceDto.prototype, "startMonth", void 0);
|
|
107
|
+
(0, class_validator_1.IsString)(),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], GenerateFormattedSequenceDto.prototype, "tenantCode", void 0);
|
|
81
110
|
__decorate([
|
|
82
111
|
(0, class_validator_1.IsString)(),
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], GenerateFormattedSequenceDto.prototype, "typeCode", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, class_validator_1.IsObject)(),
|
|
116
|
+
(0, swagger_1.ApiProperty)({
|
|
117
|
+
type: SequenceParamsDto,
|
|
118
|
+
description: 'Parameters for generating the sequence. code1, code2,code3, code4, code5',
|
|
119
|
+
}),
|
|
120
|
+
__metadata("design:type", SequenceParamsDto)
|
|
121
|
+
], GenerateFormattedSequenceDto.prototype, "params", void 0);
|
|
86
122
|
//# sourceMappingURL=gen-sequence.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gen-sequence.dto.js","sourceRoot":"","sources":["../../src/dto/gen-sequence.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"gen-sequence.dto.js","sourceRoot":"","sources":["../../src/dto/gen-sequence.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,yDAAwC;AACxC,qDAAwE;AAExE,4DAAsD;AA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,IAAI,CAAC;IAChB,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,+BAA+B;KAC7C,CAAC;8BACK,IAAI;IAEX;;OAEG;;0DAJQ;AAQX;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,6BAAY,EAAE,OAAO,EAAE,6BAAY,CAAC,aAAa,EAAE,CAAC;IACxE,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,6BAAY,CAAC;;8DACE;AAMvB;IADC,IAAA,0BAAQ,GAAE;;gEACO;AAGlB;IADC,IAAA,0BAAQ,GAAE;;8DACK;AAWhB;IANC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,0EAA0E;KAC7E,CAAC;8BACM,iBAAiB;4DAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequenceEntity = void 0;
|
|
4
|
+
class SequenceEntity {
|
|
5
|
+
constructor(partial) {
|
|
6
|
+
Object.assign(this, partial);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.SequenceEntity = SequenceEntity;
|
|
10
|
+
//# sourceMappingURL=sequence.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequence.entity.js","sourceRoot":"","sources":["../../src/entities/sequence.entity.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAMzB,YAAY,OAAgC;QAC1C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;CACF;AATD,wCASC"}
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import { DataEntity, DetailKey, IInvoke } from '@mbc-cqrs-serverless/core';
|
|
2
|
-
import { GenSequenceDto } from '../dto/gen-sequence.dto';
|
|
2
|
+
import { GenerateFormattedSequenceDto, GenSequenceDto } from '../dto/gen-sequence.dto';
|
|
3
|
+
import { SequenceEntity } from '../entities/sequence.entity';
|
|
3
4
|
export interface ISequenceService {
|
|
5
|
+
/**
|
|
6
|
+
* Get the current sequence by a specific key.
|
|
7
|
+
* @param key - The key to identify the sequence details.
|
|
8
|
+
* @returns A promise that resolves to the current sequence's data entity.
|
|
9
|
+
*/
|
|
4
10
|
getCurrentSequence(key: DetailKey): Promise<DataEntity>;
|
|
5
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Generate a new sequence based on the provided parameters.
|
|
13
|
+
* @param dto - The data transfer object containing generation parameters.
|
|
14
|
+
* @param opts - Additional options including invocation context.
|
|
15
|
+
* @returns A promise that resolves to the newly generated sequence's data entity.
|
|
16
|
+
*/
|
|
17
|
+
genNewSequence(dto: GenSequenceDto, options: {
|
|
6
18
|
invokeContext: IInvoke;
|
|
7
19
|
}): Promise<DataEntity>;
|
|
20
|
+
/**
|
|
21
|
+
* Generate a new sequence with a specified format.
|
|
22
|
+
* @param dto - The data transfer object containing parameters for formatted sequence generation.
|
|
23
|
+
* @param opts - Additional options including invocation context.
|
|
24
|
+
* @returns A promise that resolves to the newly generated formatted sequence's data entity.
|
|
25
|
+
*/
|
|
26
|
+
generateSequenceItem(dto: GenerateFormattedSequenceDto, options: {
|
|
27
|
+
invokeContext: IInvoke;
|
|
28
|
+
}): Promise<SequenceEntity>;
|
|
8
29
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DetailKey, DynamoDbService, IMasterDataProvider } from '@mbc-cqrs-serverless/core';
|
|
2
|
+
export declare class SequenceMasterDataProvider implements IMasterDataProvider {
|
|
3
|
+
private readonly dynamoDbService;
|
|
4
|
+
private readonly defaultValue;
|
|
5
|
+
private tableName;
|
|
6
|
+
constructor(dynamoDbService: DynamoDbService, defaultValue: Record<string, any>);
|
|
7
|
+
getData(key: DetailKey): Promise<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SequenceMasterDataProvider = void 0;
|
|
16
|
+
const core_1 = require("@mbc-cqrs-serverless/core");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const sequence_constant_1 = require("./constants/sequence.constant");
|
|
19
|
+
(0, common_1.Injectable)();
|
|
20
|
+
let SequenceMasterDataProvider = class SequenceMasterDataProvider {
|
|
21
|
+
constructor(dynamoDbService, defaultValue) {
|
|
22
|
+
this.dynamoDbService = dynamoDbService;
|
|
23
|
+
this.defaultValue = defaultValue;
|
|
24
|
+
this.tableName = dynamoDbService.getTableName('master', 'data');
|
|
25
|
+
}
|
|
26
|
+
async getData(key) {
|
|
27
|
+
try {
|
|
28
|
+
const item = await this.dynamoDbService.getItem(this.tableName, key);
|
|
29
|
+
if (!item) {
|
|
30
|
+
return this.defaultValue;
|
|
31
|
+
}
|
|
32
|
+
return item;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return this.defaultValue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.SequenceMasterDataProvider = SequenceMasterDataProvider;
|
|
40
|
+
exports.SequenceMasterDataProvider = SequenceMasterDataProvider = __decorate([
|
|
41
|
+
__param(1, (0, common_1.Inject)(sequence_constant_1.DEFAULT_MASTER_DATA)),
|
|
42
|
+
__param(1, (0, common_1.Optional)()),
|
|
43
|
+
__metadata("design:paramtypes", [core_1.DynamoDbService, Object])
|
|
44
|
+
], SequenceMasterDataProvider);
|
|
45
|
+
//# sourceMappingURL=sequence-master-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequence-master-factory.js","sourceRoot":"","sources":["../src/sequence-master-factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAIkC;AAClC,2CAA6D;AAE7D,qEAAmE;AAEnE,IAAA,mBAAU,GAAE,CAAA;AACZ,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;IAErC,YACmB,eAAgC,EAGhC,YAAiC;QAHjC,oBAAe,GAAf,eAAe,CAAiB;QAGhC,iBAAY,GAAZ,YAAY,CAAqB;QAElD,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IACjE,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,GAAc;QAC1B,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;YACpE,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,IAAI,CAAC,YAAY,CAAA;YAC1B,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,YAAY,CAAA;QAC1B,CAAC;IACH,CAAC;CACF,CAAA;AArBY,gEAA0B;qCAA1B,0BAA0B;IAIlC,WAAA,IAAA,eAAM,EAAC,uCAAmB,CAAC,CAAA;IAC3B,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAFuB,sBAAe;GAHxC,0BAA0B,CAqBtC"}
|
package/dist/sequence.module.js
CHANGED
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.SequencesModule = void 0;
|
|
10
10
|
const core_1 = require("@mbc-cqrs-serverless/core");
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
|
+
const sequence_constant_1 = require("./constants/sequence.constant");
|
|
13
|
+
const sequence_master_factory_1 = require("./sequence-master-factory");
|
|
12
14
|
const sequences_controller_1 = require("./sequences.controller");
|
|
13
15
|
const sequences_module_definition_1 = require("./sequences.module-definition");
|
|
14
16
|
const sequences_service_1 = require("./sequences.service");
|
|
@@ -30,7 +32,14 @@ exports.SequencesModule = SequencesModule;
|
|
|
30
32
|
exports.SequencesModule = SequencesModule = __decorate([
|
|
31
33
|
(0, common_1.Module)({
|
|
32
34
|
imports: [core_1.DataStoreModule],
|
|
33
|
-
providers: [
|
|
35
|
+
providers: [
|
|
36
|
+
sequences_service_1.SequencesService,
|
|
37
|
+
sequence_master_factory_1.SequenceMasterDataProvider,
|
|
38
|
+
{
|
|
39
|
+
provide: sequence_constant_1.DEFAULT_MASTER_DATA,
|
|
40
|
+
useValue: sequence_constant_1.DEFAULT_VALUE_MASTER_DATA,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
34
43
|
exports: [sequences_service_1.SequencesService],
|
|
35
44
|
})
|
|
36
45
|
], SequencesModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.module.js","sourceRoot":"","sources":["../src/sequence.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAA2D;AAC3D,2CAAsD;AAEtD,iEAA4D;AAC5D,+EAGsC;AACtC,2DAAsD;
|
|
1
|
+
{"version":3,"file":"sequence.module.js","sourceRoot":"","sources":["../src/sequence.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAA2D;AAC3D,2CAAsD;AAEtD,qEAGsC;AACtC,uEAAsE;AACtE,iEAA4D;AAC5D,+EAGsC;AACtC,2DAAsD;AAc/C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,qDAAuB;IAC1D,MAAM,CAAC,QAAQ,CAAC,OAA4B;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAEtC,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBACxB,MAAM,CAAC,WAAW,GAAG,EAAE,CAAA;YACzB,CAAC;YACD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,0CAAmB,CAAC,CAAA;QAC9C,CAAC;QAED,OAAO;YACL,GAAG,MAAM;SACV,CAAA;IACH,CAAC;CACF,CAAA;AAfY,0CAAe;0BAAf,eAAe;IAZ3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,sBAAe,CAAC;QAC1B,SAAS,EAAE;YACT,oCAAgB;YAChB,oDAA0B;YAC1B;gBACE,OAAO,EAAE,uCAAmB;gBAC5B,QAAQ,EAAE,6CAAyB;aACpC;SACF;QACD,OAAO,EAAE,CAAC,oCAAgB,CAAC;KAC5B,CAAC;GACW,eAAe,CAe3B"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { DataEntity, DetailKey, DynamoDbService, IInvoke } from '@mbc-cqrs-serverless/core';
|
|
2
|
-
import { GenSequenceDto, SequenceParamsDto } from './dto/gen-sequence.dto';
|
|
2
|
+
import { GenerateFormattedSequenceDto, GenSequenceDto, SequenceParamsDto } from './dto/gen-sequence.dto';
|
|
3
|
+
import { SequenceEntity } from './entities/sequence.entity';
|
|
3
4
|
import { RotateByEnum } from './enums/rotate-by.enum';
|
|
4
5
|
import { FiscalYearOptions } from './interfaces/fiscal-year.interface';
|
|
5
6
|
import { ISequenceService } from './interfaces/sequence-service.interface';
|
|
7
|
+
import { SequenceMasterDataProvider } from './sequence-master-factory';
|
|
6
8
|
export declare class SequencesService implements ISequenceService {
|
|
7
9
|
private readonly dynamoDbService;
|
|
10
|
+
private readonly masterDataProvider;
|
|
8
11
|
private readonly logger;
|
|
9
12
|
private readonly tableName;
|
|
10
|
-
constructor(dynamoDbService: DynamoDbService);
|
|
13
|
+
constructor(dynamoDbService: DynamoDbService, masterDataProvider: SequenceMasterDataProvider);
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated This method is deprecated at V0.2.
|
|
16
|
+
*/
|
|
11
17
|
getCurrentSequence(key: DetailKey): Promise<DataEntity>;
|
|
12
18
|
/**
|
|
19
|
+
* @deprecated This method is deprecated at V0.2.
|
|
13
20
|
* Seq data structure
|
|
14
21
|
* - pk: SEQ#tenantCode
|
|
15
22
|
* - sk: typeCode#rotateValue ( e.x: `user#20230401` )
|
|
@@ -18,30 +25,43 @@ export declare class SequencesService implements ISequenceService {
|
|
|
18
25
|
* - tenant_code: tenantCode
|
|
19
26
|
* - type: typeCode
|
|
20
27
|
* - seq: sequence value ( atomic counter )
|
|
28
|
+
*/
|
|
29
|
+
genNewSequence(dto: GenSequenceDto, options: {
|
|
30
|
+
invokeContext: IInvoke;
|
|
31
|
+
}): Promise<DataEntity>;
|
|
32
|
+
/**
|
|
33
|
+
* Seq data structure
|
|
34
|
+
* - pk: SEQ#tenantCode
|
|
35
|
+
* - sk: typeCode#code1#code2#code3#code4#code5rotateValue ( e.x: `user#20230401` )
|
|
36
|
+
* - code: typeCode#rotateValue
|
|
37
|
+
* - name: rotateBy ( e.x: `daily` )
|
|
38
|
+
* - tenant_code: tenantCode
|
|
39
|
+
* - type: typeCode
|
|
40
|
+
* - seq: sequence value ( atomic counter )
|
|
21
41
|
* - requestId: requestId
|
|
22
42
|
* - createdAt: createdAt
|
|
23
43
|
* - createdBy: createdBy
|
|
24
44
|
* - createdIp: createdIp
|
|
25
45
|
* - attributes: {
|
|
26
|
-
* formatted_no: formattedNo ( )
|
|
46
|
+
* formatted_no: formattedNo ( e.x: `2023-04-01-0001` )
|
|
27
47
|
* fiscal_year: fiscalYear
|
|
28
48
|
* issued_at: issuedAt
|
|
29
49
|
* }
|
|
30
50
|
*/
|
|
31
|
-
|
|
51
|
+
generateSequenceItem(dto: GenerateFormattedSequenceDto, options: {
|
|
32
52
|
invokeContext: IInvoke;
|
|
33
|
-
}): Promise<
|
|
53
|
+
}): Promise<SequenceEntity>;
|
|
34
54
|
getRotateValue(rotateBy?: RotateByEnum, forDate?: Date): string;
|
|
35
55
|
isIncrementNo(rotateBy: RotateByEnum | undefined, nowFiscalYear: number, fiscalYear: number, issuedAt: Date): boolean;
|
|
36
56
|
getFiscalYear(options: FiscalYearOptions): number;
|
|
37
|
-
createFormatDict(
|
|
57
|
+
createFormatDict(fiscalYear: number, fixNo: number, now: Date, sequenceParams?: SequenceParamsDto): {
|
|
38
58
|
fiscal_year: number;
|
|
39
59
|
no: number;
|
|
40
60
|
month: number;
|
|
41
61
|
day: number;
|
|
42
62
|
date: Date;
|
|
43
63
|
code1: string;
|
|
44
|
-
code2
|
|
64
|
+
code2?: string;
|
|
45
65
|
code3?: string;
|
|
46
66
|
code4?: string;
|
|
47
67
|
code5?: string;
|
|
@@ -13,18 +13,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.SequencesService = void 0;
|
|
14
14
|
const core_1 = require("@mbc-cqrs-serverless/core");
|
|
15
15
|
const common_1 = require("@nestjs/common");
|
|
16
|
+
const sequence_entity_1 = require("./entities/sequence.entity");
|
|
16
17
|
const rotate_by_enum_1 = require("./enums/rotate-by.enum");
|
|
18
|
+
const sequence_master_factory_1 = require("./sequence-master-factory");
|
|
17
19
|
let SequencesService = SequencesService_1 = class SequencesService {
|
|
18
|
-
constructor(dynamoDbService) {
|
|
20
|
+
constructor(dynamoDbService, masterDataProvider) {
|
|
19
21
|
this.dynamoDbService = dynamoDbService;
|
|
22
|
+
this.masterDataProvider = masterDataProvider;
|
|
20
23
|
this.logger = new common_1.Logger(SequencesService_1.name);
|
|
21
24
|
this.tableName = dynamoDbService.getTableName('sequences');
|
|
22
25
|
this.logger.debug('tableName: ' + this.tableName);
|
|
23
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated This method is deprecated at V0.2.
|
|
29
|
+
*/
|
|
24
30
|
async getCurrentSequence(key) {
|
|
25
31
|
return await this.dynamoDbService.getItem(this.tableName, key);
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
34
|
+
* @deprecated This method is deprecated at V0.2.
|
|
28
35
|
* Seq data structure
|
|
29
36
|
* - pk: SEQ#tenantCode
|
|
30
37
|
* - sk: typeCode#rotateValue ( e.x: `user#20230401` )
|
|
@@ -33,25 +40,73 @@ let SequencesService = SequencesService_1 = class SequencesService {
|
|
|
33
40
|
* - tenant_code: tenantCode
|
|
34
41
|
* - type: typeCode
|
|
35
42
|
* - seq: sequence value ( atomic counter )
|
|
43
|
+
*/
|
|
44
|
+
async genNewSequence(dto, options) {
|
|
45
|
+
const rotateVal = this.getRotateValue(dto.rotateBy, dto.date);
|
|
46
|
+
const pk = `SEQ${core_1.KEY_SEPARATOR}${dto.tenantCode}`;
|
|
47
|
+
const sk = `${dto.typeCode}${core_1.KEY_SEPARATOR}${rotateVal}`;
|
|
48
|
+
const sourceIp = options.invokeContext?.event?.requestContext?.http?.sourceIp;
|
|
49
|
+
const userContext = (0, core_1.getUserContext)(options.invokeContext);
|
|
50
|
+
const userId = userContext.userId || 'system';
|
|
51
|
+
const now = new Date();
|
|
52
|
+
const item = await this.dynamoDbService.updateItem(this.tableName, { pk, sk }, {
|
|
53
|
+
set: {
|
|
54
|
+
code: sk,
|
|
55
|
+
name: dto.rotateBy || 'none',
|
|
56
|
+
tenantCode: dto.tenantCode,
|
|
57
|
+
type: dto.typeCode,
|
|
58
|
+
seq: { ifNotExists: 0, incrementBy: 1 },
|
|
59
|
+
requestId: options.invokeContext?.context?.awsRequestId,
|
|
60
|
+
createdAt: { ifNotExists: now },
|
|
61
|
+
createdBy: { ifNotExists: userId },
|
|
62
|
+
createdIp: { ifNotExists: sourceIp },
|
|
63
|
+
updatedAt: now,
|
|
64
|
+
updatedBy: userId,
|
|
65
|
+
updatedIp: sourceIp,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
return item;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Seq data structure
|
|
72
|
+
* - pk: SEQ#tenantCode
|
|
73
|
+
* - sk: typeCode#code1#code2#code3#code4#code5rotateValue ( e.x: `user#20230401` )
|
|
74
|
+
* - code: typeCode#rotateValue
|
|
75
|
+
* - name: rotateBy ( e.x: `daily` )
|
|
76
|
+
* - tenant_code: tenantCode
|
|
77
|
+
* - type: typeCode
|
|
78
|
+
* - seq: sequence value ( atomic counter )
|
|
36
79
|
* - requestId: requestId
|
|
37
80
|
* - createdAt: createdAt
|
|
38
81
|
* - createdBy: createdBy
|
|
39
82
|
* - createdIp: createdIp
|
|
40
83
|
* - attributes: {
|
|
41
|
-
* formatted_no: formattedNo ( )
|
|
84
|
+
* formatted_no: formattedNo ( e.x: `2023-04-01-0001` )
|
|
42
85
|
* fiscal_year: fiscalYear
|
|
43
86
|
* issued_at: issuedAt
|
|
44
87
|
* }
|
|
45
88
|
*/
|
|
46
|
-
async
|
|
47
|
-
const { date, rotateBy,
|
|
48
|
-
const
|
|
89
|
+
async generateSequenceItem(dto, options) {
|
|
90
|
+
const { date, rotateBy, tenantCode, params, typeCode } = dto;
|
|
91
|
+
const generalMasterPk = (0, core_1.masterPk)(tenantCode);
|
|
92
|
+
const generalMasterSk = `SEQ${core_1.KEY_SEPARATOR}${typeCode}`;
|
|
93
|
+
this.logger.log('general master pk: ', generalMasterPk);
|
|
94
|
+
this.logger.log('general master sk: ', generalMasterSk);
|
|
95
|
+
const masterData = await this.masterDataProvider.getData({
|
|
96
|
+
pk: generalMasterPk,
|
|
97
|
+
sk: generalMasterSk,
|
|
98
|
+
});
|
|
99
|
+
// Get master data for the tenant
|
|
100
|
+
const { format, registerDate, startMonth } = masterData;
|
|
101
|
+
const pk = (0, core_1.seqPk)(tenantCode);
|
|
102
|
+
// Construct the sort key for the sequence
|
|
49
103
|
let sk = [
|
|
50
|
-
|
|
51
|
-
params
|
|
52
|
-
params
|
|
53
|
-
params
|
|
54
|
-
params
|
|
104
|
+
typeCode,
|
|
105
|
+
params?.code1,
|
|
106
|
+
params?.code2,
|
|
107
|
+
params?.code3,
|
|
108
|
+
params?.code4,
|
|
109
|
+
params?.code5,
|
|
55
110
|
]
|
|
56
111
|
.filter(Boolean)
|
|
57
112
|
.join(core_1.KEY_SEPARATOR);
|
|
@@ -62,68 +117,35 @@ let SequencesService = SequencesService_1 = class SequencesService {
|
|
|
62
117
|
registerTime: registerDate,
|
|
63
118
|
startMonth,
|
|
64
119
|
});
|
|
65
|
-
const sourceIp =
|
|
66
|
-
const userContext = (0, core_1.getUserContext)(
|
|
120
|
+
const sourceIp = options.invokeContext?.event?.requestContext?.http?.sourceIp;
|
|
121
|
+
const userContext = (0, core_1.getUserContext)(options.invokeContext);
|
|
67
122
|
const userId = userContext.userId || 'system';
|
|
68
|
-
|
|
69
|
-
|
|
123
|
+
const rotateVal = this.getRotateValue(rotateBy, date);
|
|
124
|
+
sk = `${sk}${core_1.KEY_SEPARATOR}${rotateVal}`;
|
|
125
|
+
const item = await this.dynamoDbService.updateItem(this.tableName, { pk, sk }, {
|
|
70
126
|
set: {
|
|
71
127
|
code: sk,
|
|
72
|
-
name: rotateBy || 'none',
|
|
73
|
-
tenantCode,
|
|
74
|
-
type:
|
|
75
|
-
seq,
|
|
76
|
-
requestId:
|
|
128
|
+
name: dto.rotateBy || 'none',
|
|
129
|
+
tenantCode: dto.tenantCode,
|
|
130
|
+
type: typeCode,
|
|
131
|
+
seq: { ifNotExists: 0, incrementBy: 1 },
|
|
132
|
+
requestId: options.invokeContext?.context?.awsRequestId,
|
|
77
133
|
createdAt: { ifNotExists: now },
|
|
78
134
|
createdBy: { ifNotExists: userId },
|
|
79
135
|
createdIp: { ifNotExists: sourceIp },
|
|
80
|
-
attributes: {
|
|
81
|
-
formatted_no: formattedNo,
|
|
82
|
-
fiscal_year: nowFiscalYear,
|
|
83
|
-
issued_at: issuedAt,
|
|
84
|
-
},
|
|
85
136
|
updatedAt: now,
|
|
86
137
|
updatedBy: userId,
|
|
87
138
|
updatedIp: sourceIp,
|
|
88
139
|
},
|
|
89
140
|
});
|
|
90
|
-
const
|
|
91
|
-
pk,
|
|
92
|
-
sk,
|
|
93
|
-
});
|
|
94
|
-
let fixNo = 0;
|
|
95
|
-
let rotateSequenceData = null;
|
|
96
|
-
// Handle rotating sequence data if date is provided
|
|
97
|
-
if (date) {
|
|
98
|
-
const rotateSortKeyVal = this.getRotateValue(rotateBy, date);
|
|
99
|
-
rotateSequenceData = await this.dynamoDbService.getItem(this.tableName, {
|
|
100
|
-
pk,
|
|
101
|
-
sk: `${sk}${core_1.KEY_SEPARATOR}${rotateSortKeyVal}`,
|
|
102
|
-
});
|
|
103
|
-
fixNo = rotateSequenceData ? rotateSequenceData.seq + 1 : 1;
|
|
104
|
-
}
|
|
105
|
-
else if (!date) {
|
|
106
|
-
if (sequenceData) {
|
|
107
|
-
fixNo = this.isIncrementNo(rotateBy, nowFiscalYear, sequenceData.attributes.fiscal_year, new Date(sequenceData.issuedAt))
|
|
108
|
-
? sequenceData.seq + 1
|
|
109
|
-
: 1;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
fixNo = 1;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
const formatDict = this.createFormatDict(params, nowFiscalYear, fixNo, date || now);
|
|
141
|
+
const formatDict = this.createFormatDict(nowFiscalYear, item.seq, date || now, { ...params });
|
|
116
142
|
const formattedNo = this.createFormattedNo(format, formatDict);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const rotateSortKeyVal = this.getRotateValue(rotateBy, date);
|
|
124
|
-
sk = `${sk}${core_1.KEY_SEPARATOR}${rotateSortKeyVal}`;
|
|
125
|
-
}
|
|
126
|
-
return await this.dynamoDbService.updateItem(this.tableName, { pk, sk }, buildUpdateData(fixNo, formattedNo, sk));
|
|
143
|
+
return new sequence_entity_1.SequenceEntity({
|
|
144
|
+
id: (0, core_1.generateId)(item.pk, item.sk),
|
|
145
|
+
no: item.seq,
|
|
146
|
+
formattedNo: formattedNo,
|
|
147
|
+
issuedAt: new Date(issuedAt),
|
|
148
|
+
});
|
|
127
149
|
}
|
|
128
150
|
getRotateValue(rotateBy, forDate) {
|
|
129
151
|
const date = forDate || new Date();
|
|
@@ -203,7 +225,7 @@ let SequencesService = SequencesService_1 = class SequencesService {
|
|
|
203
225
|
// Return the fiscal year number starting from `referenceYear`
|
|
204
226
|
return fiscalYear - referenceYear + 1;
|
|
205
227
|
}
|
|
206
|
-
createFormatDict(
|
|
228
|
+
createFormatDict(fiscalYear, fixNo, now, sequenceParams) {
|
|
207
229
|
return {
|
|
208
230
|
...sequenceParams,
|
|
209
231
|
fiscal_year: fiscalYear,
|
|
@@ -253,6 +275,7 @@ let SequencesService = SequencesService_1 = class SequencesService {
|
|
|
253
275
|
exports.SequencesService = SequencesService;
|
|
254
276
|
exports.SequencesService = SequencesService = SequencesService_1 = __decorate([
|
|
255
277
|
(0, common_1.Injectable)(),
|
|
256
|
-
__metadata("design:paramtypes", [core_1.DynamoDbService
|
|
278
|
+
__metadata("design:paramtypes", [core_1.DynamoDbService,
|
|
279
|
+
sequence_master_factory_1.SequenceMasterDataProvider])
|
|
257
280
|
], SequencesService);
|
|
258
281
|
//# sourceMappingURL=sequences.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequences.service.js","sourceRoot":"","sources":["../src/sequences.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,
|
|
1
|
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AAI,CAAC,EAAE,CAAC;oBACrB,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAA;gBACvC,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,IAAI,CAAA;gBAChB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAED,kBAAkB,CAAC,GAAW;QAC5B,MAAM,KAAK,GAAG,YAAY,CAAA;QAC1B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAE9B,OAAO;YACL,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;YACtB,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SACtC,CAAA;IACH,CAAC;CACF,CAAA;AA9UY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAMyB,sBAAe;QACZ,oDAA0B;GANtD,gBAAgB,CA8U5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mbc-cqrs-serverless/sequence",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37-beta.0",
|
|
4
4
|
"description": "Generate increment sequence with time-rotation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mbc",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@mbc-cqrs-serverless/core": "^0.1.
|
|
44
|
+
"@mbc-cqrs-serverless/core": "^0.1.37-beta.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "63b620e57fba24b4d9a66a314f7968d0327c5574"
|
|
47
47
|
}
|