rez_core 1.0.8 → 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/module/meta/service/entity-service-impl.service.d.ts +2 -1
- package/dist/module/meta/service/entity-service-impl.service.js +6 -4
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/module/meta/service/entity.service.d.ts +2 -1
- package/dist/module/user/service/user.service.d.ts +2 -1
- package/dist/module/user/service/user.service.js +1 -1
- package/dist/module/user/service/user.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
- package/dist/app.module.d.ts +0 -2
- package/dist/app.module.js +0 -32
- package/dist/app.module.js.map +0 -1
package/package.json
CHANGED
package/src/app.controller.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Controller, Get } from '@nestjs/common';
|
|
2
|
-
import { AppService } from './app.service';
|
|
3
|
-
|
|
4
|
-
@Controller()
|
|
5
|
-
export class AppController {
|
|
6
|
-
constructor(private readonly appService: AppService) {}
|
|
7
|
-
|
|
8
|
-
@Get()
|
|
9
|
-
getHello(): string {
|
|
10
|
-
return this.appService.getHello();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
import { Controller, Get } from '@nestjs/common';
|
|
2
|
+
import { AppService } from './app.service';
|
|
3
|
+
|
|
4
|
+
@Controller()
|
|
5
|
+
export class AppController {
|
|
6
|
+
constructor(private readonly appService: AppService) {}
|
|
7
|
+
|
|
8
|
+
@Get()
|
|
9
|
+
getHello(): string {
|
|
10
|
+
return this.appService.getHello();
|
|
11
|
+
}
|
|
12
|
+
}
|
package/src/app.service.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
|
|
3
|
-
@Injectable()
|
|
4
|
-
export class AppService {
|
|
5
|
-
getHello(): string {
|
|
6
|
-
return 'Hello World!';
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
|
|
3
|
+
@Injectable()
|
|
4
|
+
export class AppService {
|
|
5
|
+
getHello(): string {
|
|
6
|
+
return 'Hello World!';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1,34 +1,66 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import { Repository } from 'typeorm';
|
|
3
|
+
import { EntityManager, Repository } from 'typeorm';
|
|
4
4
|
import { OrganizationData } from '../entity/organization.entity';
|
|
5
|
+
import { ClockIDGenService } from 'src/utils/service/clockIDGenUtil.service';
|
|
5
6
|
|
|
6
7
|
@Injectable()
|
|
7
8
|
export class OrganizationService {
|
|
8
9
|
constructor(
|
|
9
10
|
@InjectRepository(OrganizationData)
|
|
10
11
|
private readonly organizationRepository: Repository<OrganizationData>,
|
|
11
|
-
|
|
12
|
+
private readonly idGen: ClockIDGenService
|
|
13
|
+
) { }
|
|
12
14
|
|
|
13
|
-
async create(
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
async create(
|
|
16
|
+
organizationDto: Partial<OrganizationData>,
|
|
17
|
+
manager?: EntityManager,
|
|
18
|
+
): Promise<OrganizationData> {
|
|
19
|
+
const repo = manager
|
|
20
|
+
? manager.getRepository(OrganizationData)
|
|
21
|
+
: this.organizationRepository;
|
|
22
|
+
|
|
23
|
+
organizationDto.code = this.idGen.idGenerator('ORG');
|
|
24
|
+
organizationDto.status = 'ACTIVE'
|
|
25
|
+
organizationDto.created_date = new Date();
|
|
26
|
+
const organization = repo.create(organizationDto);
|
|
27
|
+
return await repo.save(organization);
|
|
16
28
|
}
|
|
17
29
|
|
|
18
|
-
async findAll(): Promise<OrganizationData[]> {
|
|
19
|
-
|
|
30
|
+
async findAll(manager?: EntityManager): Promise<OrganizationData[]> {
|
|
31
|
+
const repo = manager
|
|
32
|
+
? manager.getRepository(OrganizationData)
|
|
33
|
+
: this.organizationRepository;
|
|
34
|
+
|
|
35
|
+
return await repo.find();
|
|
20
36
|
}
|
|
21
37
|
|
|
22
|
-
async findOne(id: number): Promise<OrganizationData | null> {
|
|
23
|
-
|
|
38
|
+
async findOne(id: number, manager?: EntityManager): Promise<OrganizationData | null> {
|
|
39
|
+
const repo = manager
|
|
40
|
+
? manager.getRepository(OrganizationData)
|
|
41
|
+
: this.organizationRepository;
|
|
42
|
+
|
|
43
|
+
return await repo.findOne({ where: { id } });
|
|
24
44
|
}
|
|
25
45
|
|
|
26
|
-
async update(
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
async update(
|
|
47
|
+
id: number,
|
|
48
|
+
organizationDto: Partial<OrganizationData>,
|
|
49
|
+
manager?: EntityManager,
|
|
50
|
+
): Promise<OrganizationData | null> {
|
|
51
|
+
const repo = manager
|
|
52
|
+
? manager.getRepository(OrganizationData)
|
|
53
|
+
: this.organizationRepository;
|
|
54
|
+
|
|
55
|
+
await repo.update(id, organizationDto);
|
|
56
|
+
return await repo.findOne({ where: { id } });
|
|
29
57
|
}
|
|
30
58
|
|
|
31
|
-
async remove(id: number): Promise<void> {
|
|
32
|
-
|
|
59
|
+
async remove(id: number, manager?: EntityManager): Promise<void> {
|
|
60
|
+
const repo = manager
|
|
61
|
+
? manager.getRepository(OrganizationData)
|
|
62
|
+
: this.organizationRepository;
|
|
63
|
+
|
|
64
|
+
await repo.delete(id);
|
|
33
65
|
}
|
|
34
66
|
}
|
|
@@ -17,7 +17,7 @@ import { UserRoleMapping } from '../entity/user-role-mapping.entity';
|
|
|
17
17
|
import { plainToInstance } from 'class-transformer';
|
|
18
18
|
import { EntityListService } from '../../meta/service/entity-list.service';
|
|
19
19
|
import { EntityManager } from 'typeorm';
|
|
20
|
-
import {UpdateUserDto} from "../dto/update-user.dto";
|
|
20
|
+
import { UpdateUserDto } from "../dto/update-user.dto";
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -151,7 +151,7 @@ export class UserService extends EntityServiceImpl {
|
|
|
151
151
|
return await this.userRepository.findByEmailId(email_id);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
async findByMobile(mobile: string){
|
|
154
|
+
async findByMobile(mobile: string) {
|
|
155
155
|
return await this.userRepository.findByMobile(mobile);
|
|
156
156
|
}
|
|
157
157
|
}
|
package/dist/app.module.d.ts
DELETED
package/dist/app.module.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AppModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const config_module_1 = require("./config/config.module");
|
|
12
|
-
const enterprise_module_1 = require("./module/enterprise/enterprise.module");
|
|
13
|
-
const utils_module_1 = require("./utils/utils.module");
|
|
14
|
-
const user_module_1 = require("./module/user/user.module");
|
|
15
|
-
const entity_module_1 = require("./module/meta/entity.module");
|
|
16
|
-
const module_module_1 = require("./module/module/module.module");
|
|
17
|
-
let AppModule = class AppModule {
|
|
18
|
-
};
|
|
19
|
-
exports.AppModule = AppModule;
|
|
20
|
-
exports.AppModule = AppModule = __decorate([
|
|
21
|
-
(0, common_1.Module)({
|
|
22
|
-
imports: [
|
|
23
|
-
entity_module_1.EntityModule,
|
|
24
|
-
config_module_1.DatabaseModule,
|
|
25
|
-
enterprise_module_1.EnterpriseModule,
|
|
26
|
-
utils_module_1.UtilsModule,
|
|
27
|
-
user_module_1.UserModule,
|
|
28
|
-
module_module_1.ModuleModule,
|
|
29
|
-
],
|
|
30
|
-
})
|
|
31
|
-
], AppModule);
|
|
32
|
-
//# sourceMappingURL=app.module.js.map
|
package/dist/app.module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,0DAAwD;AACxD,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAYtD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAVrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,4BAAY;YACZ,8BAAc;YACd,oCAAgB;YAChB,0BAAW;YACX,wBAAU;YACV,4BAAY;SACb;KACF,CAAC;GACW,SAAS,CAAG"}
|