rez_core 1.0.9 → 1.0.10
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/module/enterprise/service/organization.service.d.ts +9 -7
- package/dist/module/enterprise/service/organization.service.js +35 -14
- package/dist/module/enterprise/service/organization.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/app.controller.ts +12 -12
- package/src/app.service.ts +8 -8
- package/src/module/enterprise/service/organization.service.ts +46 -14
- package/src/module/user/service/user.service.ts +2 -2
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Repository } from 'typeorm';
|
|
1
|
+
import { EntityManager, Repository } from 'typeorm';
|
|
2
2
|
import { OrganizationData } from '../entity/organization.entity';
|
|
3
|
+
import { ClockIDGenService } from 'src/utils/service/clockIDGenUtil.service';
|
|
3
4
|
export declare class OrganizationService {
|
|
4
5
|
private readonly organizationRepository;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
private readonly idGen;
|
|
7
|
+
constructor(organizationRepository: Repository<OrganizationData>, idGen: ClockIDGenService);
|
|
8
|
+
create(organizationDto: Partial<OrganizationData>, manager?: EntityManager): Promise<OrganizationData>;
|
|
9
|
+
findAll(manager?: EntityManager): Promise<OrganizationData[]>;
|
|
10
|
+
findOne(id: number, manager?: EntityManager): Promise<OrganizationData | null>;
|
|
11
|
+
update(id: number, organizationDto: Partial<OrganizationData>, manager?: EntityManager): Promise<OrganizationData | null>;
|
|
12
|
+
remove(id: number, manager?: EntityManager): Promise<void>;
|
|
11
13
|
}
|
|
@@ -17,32 +17,53 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
19
|
const organization_entity_1 = require("../entity/organization.entity");
|
|
20
|
+
const clockIDGenUtil_service_1 = require("../../../utils/service/clockIDGenUtil.service");
|
|
20
21
|
let OrganizationService = class OrganizationService {
|
|
21
|
-
constructor(organizationRepository) {
|
|
22
|
+
constructor(organizationRepository, idGen) {
|
|
22
23
|
this.organizationRepository = organizationRepository;
|
|
24
|
+
this.idGen = idGen;
|
|
23
25
|
}
|
|
24
|
-
async create(organizationDto) {
|
|
25
|
-
const
|
|
26
|
-
|
|
26
|
+
async create(organizationDto, manager) {
|
|
27
|
+
const repo = manager
|
|
28
|
+
? manager.getRepository(organization_entity_1.OrganizationData)
|
|
29
|
+
: this.organizationRepository;
|
|
30
|
+
organizationDto.code = this.idGen.idGenerator('ORG');
|
|
31
|
+
organizationDto.status = 'ACTIVE';
|
|
32
|
+
organizationDto.created_date = new Date();
|
|
33
|
+
const organization = repo.create(organizationDto);
|
|
34
|
+
return await repo.save(organization);
|
|
27
35
|
}
|
|
28
|
-
async findAll() {
|
|
29
|
-
|
|
36
|
+
async findAll(manager) {
|
|
37
|
+
const repo = manager
|
|
38
|
+
? manager.getRepository(organization_entity_1.OrganizationData)
|
|
39
|
+
: this.organizationRepository;
|
|
40
|
+
return await repo.find();
|
|
30
41
|
}
|
|
31
|
-
async findOne(id) {
|
|
32
|
-
|
|
42
|
+
async findOne(id, manager) {
|
|
43
|
+
const repo = manager
|
|
44
|
+
? manager.getRepository(organization_entity_1.OrganizationData)
|
|
45
|
+
: this.organizationRepository;
|
|
46
|
+
return await repo.findOne({ where: { id } });
|
|
33
47
|
}
|
|
34
|
-
async update(id, organizationDto) {
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
async update(id, organizationDto, manager) {
|
|
49
|
+
const repo = manager
|
|
50
|
+
? manager.getRepository(organization_entity_1.OrganizationData)
|
|
51
|
+
: this.organizationRepository;
|
|
52
|
+
await repo.update(id, organizationDto);
|
|
53
|
+
return await repo.findOne({ where: { id } });
|
|
37
54
|
}
|
|
38
|
-
async remove(id) {
|
|
39
|
-
|
|
55
|
+
async remove(id, manager) {
|
|
56
|
+
const repo = manager
|
|
57
|
+
? manager.getRepository(organization_entity_1.OrganizationData)
|
|
58
|
+
: this.organizationRepository;
|
|
59
|
+
await repo.delete(id);
|
|
40
60
|
}
|
|
41
61
|
};
|
|
42
62
|
exports.OrganizationService = OrganizationService;
|
|
43
63
|
exports.OrganizationService = OrganizationService = __decorate([
|
|
44
64
|
(0, common_1.Injectable)(),
|
|
45
65
|
__param(0, (0, typeorm_1.InjectRepository)(organization_entity_1.OrganizationData)),
|
|
46
|
-
__metadata("design:paramtypes", [typeorm_2.Repository
|
|
66
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
67
|
+
clockIDGenUtil_service_1.ClockIDGenService])
|
|
47
68
|
], OrganizationService);
|
|
48
69
|
//# sourceMappingURL=organization.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../../../src/module/enterprise/service/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../../../src/module/enterprise/service/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAoD;AACpD,uEAAiE;AACjE,0FAA6E;AAGtE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAEmB,sBAAoD,EACpD,KAAwB;QADxB,2BAAsB,GAAtB,sBAAsB,CAA8B;QACpD,UAAK,GAAL,KAAK,CAAmB;IACvC,CAAC;IAEL,KAAK,CAAC,MAAM,CACV,eAA0C,EAC1C,OAAuB;QAEvB,MAAM,IAAI,GAAG,OAAO;YAClB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,sCAAgB,CAAC;YACzC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;QAEhC,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,K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