plac-micro-common 1.3.48 → 1.3.49
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/http/modules/auth_client/auth_client.constant.d.ts +1 -0
- package/dist/http/modules/auth_client/auth_client.constant.js +4 -0
- package/dist/http/modules/auth_client/auth_client.module.d.ts +5 -0
- package/dist/http/modules/auth_client/auth_client.module.js +34 -0
- package/dist/http/modules/auth_client/auth_client.service.d.ts +12 -0
- package/dist/http/modules/auth_client/auth_client.service.js +77 -0
- package/dist/http/modules/auth_client/auth_client.type.d.ts +22 -0
- package/dist/http/modules/auth_client/auth_client.type.js +2 -0
- package/dist/http/modules/auth_client/index.d.ts +4 -0
- package/dist/http/modules/auth_client/index.js +20 -0
- package/dist/http/modules/index.d.ts +1 -0
- package/dist/http/modules/index.js +1 -0
- package/dist/models/application/application.entity.d.ts +3 -1
- package/dist/models/application/application.entity.js +10 -0
- package/dist/models/core/index.d.ts +3 -2
- package/dist/models/core/index.js +4 -1
- package/dist/models/core/org_referral.entity.d.ts +17 -0
- package/dist/models/core/org_referral.entity.js +74 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AUTH_CLIENT_OPTIONS = "AUTH_CLIENT_OPTIONS";
|
|
@@ -0,0 +1,34 @@
|
|
|
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 AuthClientModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.AuthClientModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const auth_client_service_1 = require("./auth_client.service");
|
|
13
|
+
const auth_client_constant_1 = require("./auth_client.constant");
|
|
14
|
+
const axios_1 = require("@nestjs/axios");
|
|
15
|
+
let AuthClientModule = AuthClientModule_1 = class AuthClientModule {
|
|
16
|
+
static register(options) {
|
|
17
|
+
return {
|
|
18
|
+
module: AuthClientModule_1,
|
|
19
|
+
imports: [axios_1.HttpModule],
|
|
20
|
+
providers: [
|
|
21
|
+
{
|
|
22
|
+
provide: auth_client_constant_1.AUTH_CLIENT_OPTIONS,
|
|
23
|
+
useValue: options,
|
|
24
|
+
},
|
|
25
|
+
auth_client_service_1.AuthClientService,
|
|
26
|
+
],
|
|
27
|
+
exports: [auth_client_service_1.AuthClientService],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.AuthClientModule = AuthClientModule;
|
|
32
|
+
exports.AuthClientModule = AuthClientModule = AuthClientModule_1 = __decorate([
|
|
33
|
+
(0, common_1.Module)({})
|
|
34
|
+
], AuthClientModule);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpService } from "@nestjs/axios";
|
|
2
|
+
import { AuthClientModuleOptions, ResolvedUserInfo } from "./auth_client.type";
|
|
3
|
+
export declare class AuthClientService {
|
|
4
|
+
private readonly httpService;
|
|
5
|
+
private readonly options;
|
|
6
|
+
private readonly logger;
|
|
7
|
+
constructor(httpService: HttpService, options: AuthClientModuleOptions);
|
|
8
|
+
resolveUserInfoById(userId: string): Promise<ResolvedUserInfo | null>;
|
|
9
|
+
resolveUserInfoByIds(ids: string[]): Promise<(ResolvedUserInfo | null)[]>;
|
|
10
|
+
private getHeaders;
|
|
11
|
+
private handleError;
|
|
12
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
var AuthClientService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.AuthClientService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const axios_1 = require("@nestjs/axios");
|
|
19
|
+
const rxjs_1 = require("rxjs");
|
|
20
|
+
const axios_2 = require("axios");
|
|
21
|
+
const auth_client_constant_1 = require("./auth_client.constant");
|
|
22
|
+
let AuthClientService = AuthClientService_1 = class AuthClientService {
|
|
23
|
+
constructor(httpService, options) {
|
|
24
|
+
this.httpService = httpService;
|
|
25
|
+
this.options = options;
|
|
26
|
+
this.logger = new common_1.Logger(AuthClientService_1.name);
|
|
27
|
+
}
|
|
28
|
+
async resolveUserInfoById(userId) {
|
|
29
|
+
try {
|
|
30
|
+
const response = await (0, rxjs_1.firstValueFrom)(this.httpService.get(`${this.options.base_url}/auth-user/resolve/${userId}`, {
|
|
31
|
+
headers: this.getHeaders(),
|
|
32
|
+
timeout: this.options.timeout_ms ?? 5000,
|
|
33
|
+
}));
|
|
34
|
+
return response.data;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
this.handleError(error, `Failed to resolve user by id: ${userId}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async resolveUserInfoByIds(ids) {
|
|
41
|
+
if (!ids?.length)
|
|
42
|
+
return [];
|
|
43
|
+
try {
|
|
44
|
+
const response = await (0, rxjs_1.firstValueFrom)(this.httpService.post(`${this.options.base_url}/auth-user/resolve-many`, { ids }, {
|
|
45
|
+
headers: this.getHeaders(),
|
|
46
|
+
timeout: this.options.timeout_ms ?? 5000,
|
|
47
|
+
}));
|
|
48
|
+
return response.data;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
this.handleError(error, `Failed to resolve users by ids: ${ids.join(", ")}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
getHeaders() {
|
|
55
|
+
return {
|
|
56
|
+
"x-internal-secret": this.options.internal_api_key,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
handleError(error, message) {
|
|
60
|
+
if (error instanceof axios_2.AxiosError) {
|
|
61
|
+
this.logger.error(message, {
|
|
62
|
+
status: error.response?.status,
|
|
63
|
+
response_data: error.response?.data,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
this.logger.error(message, error);
|
|
68
|
+
}
|
|
69
|
+
throw new common_1.BadGatewayException("Auth service request failed");
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.AuthClientService = AuthClientService;
|
|
73
|
+
exports.AuthClientService = AuthClientService = AuthClientService_1 = __decorate([
|
|
74
|
+
(0, common_1.Injectable)(),
|
|
75
|
+
__param(1, (0, common_1.Inject)(auth_client_constant_1.AUTH_CLIENT_OPTIONS)),
|
|
76
|
+
__metadata("design:paramtypes", [axios_1.HttpService, Object])
|
|
77
|
+
], AuthClientService);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ResolvedUserRole {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ResolvedUserInfo {
|
|
6
|
+
id: string;
|
|
7
|
+
username: string;
|
|
8
|
+
email: string;
|
|
9
|
+
is_active: boolean;
|
|
10
|
+
full_name?: string | null;
|
|
11
|
+
full_name_kh?: string | null;
|
|
12
|
+
gender?: string | null;
|
|
13
|
+
roles: ResolvedUserRole[];
|
|
14
|
+
}
|
|
15
|
+
export interface ResolveUserInfoByIdsDto {
|
|
16
|
+
ids: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface AuthClientModuleOptions {
|
|
19
|
+
base_url: string;
|
|
20
|
+
internal_api_key: string;
|
|
21
|
+
timeout_ms?: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auth_client.service"), exports);
|
|
18
|
+
__exportStar(require("./auth_client.constant"), exports);
|
|
19
|
+
__exportStar(require("./auth_client.module"), exports);
|
|
20
|
+
__exportStar(require("./auth_client.type"), exports);
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./request_context.module"), exports);
|
|
18
18
|
__exportStar(require("./jwt_auth.module"), exports);
|
|
19
|
+
__exportStar(require("./auth_client"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _BaseEntity } from "../_base_entity";
|
|
2
2
|
import { AppFormType, ApplicationStatus, AppPhLaRelation } from "../../types";
|
|
3
|
-
import { OrganizationBranchEntity, OrganizationEntity, OrganizationStaffEntity } from "../core";
|
|
3
|
+
import { OrganizationBranchEntity, OrganizationEntity, OrganizationStaffEntity, OrgReferralEntity } from "../core";
|
|
4
4
|
import { AppCoverageEntity } from "./app_coverage.entity";
|
|
5
5
|
import { AppPersonEntity } from "./app_person.entity";
|
|
6
6
|
import { AppBeneficiaryEntity } from "./app_beneficiary.entity";
|
|
@@ -21,6 +21,7 @@ export declare class ApplicationEntity extends _BaseEntity {
|
|
|
21
21
|
org_id: string;
|
|
22
22
|
org_branch_id?: string | null;
|
|
23
23
|
channel_id?: string | null;
|
|
24
|
+
org_referral_id?: string | null;
|
|
24
25
|
owner_org_staff_id: string;
|
|
25
26
|
assigned_org_staff_id?: string | null;
|
|
26
27
|
status: ApplicationStatus;
|
|
@@ -53,6 +54,7 @@ export declare class ApplicationEntity extends _BaseEntity {
|
|
|
53
54
|
owner_org_staff: OrganizationStaffEntity;
|
|
54
55
|
assigned_org_staff?: OrganizationStaffEntity | null;
|
|
55
56
|
org_branch?: OrganizationBranchEntity | null;
|
|
57
|
+
org_referral?: OrgReferralEntity | null;
|
|
56
58
|
app_coverages?: AppCoverageEntity[];
|
|
57
59
|
app_persons?: AppPersonEntity[];
|
|
58
60
|
app_beneficiaries?: AppBeneficiaryEntity[];
|
|
@@ -87,6 +87,11 @@ __decorate([
|
|
|
87
87
|
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
88
88
|
__metadata("design:type", Object)
|
|
89
89
|
], ApplicationEntity.prototype, "channel_id", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.Index)(),
|
|
92
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
93
|
+
__metadata("design:type", Object)
|
|
94
|
+
], ApplicationEntity.prototype, "org_referral_id", void 0);
|
|
90
95
|
__decorate([
|
|
91
96
|
(0, typeorm_1.Index)(),
|
|
92
97
|
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
@@ -247,6 +252,11 @@ __decorate([
|
|
|
247
252
|
(0, typeorm_1.JoinColumn)({ name: "org_branch_id" }),
|
|
248
253
|
__metadata("design:type", Object)
|
|
249
254
|
], ApplicationEntity.prototype, "org_branch", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, typeorm_1.ManyToOne)(() => core_1.OrgReferralEntity, { onDelete: "SET NULL" }),
|
|
257
|
+
(0, typeorm_1.JoinColumn)({ name: "org_referral_id" }),
|
|
258
|
+
__metadata("design:type", Object)
|
|
259
|
+
], ApplicationEntity.prototype, "org_referral", void 0);
|
|
250
260
|
__decorate([
|
|
251
261
|
(0, typeorm_1.OneToMany)(() => app_coverage_entity_1.AppCoverageEntity, (c) => c.application, { nullable: true }),
|
|
252
262
|
__metadata("design:type", Array)
|
|
@@ -17,7 +17,8 @@ import { OccupationEntity } from "./occupation.entity";
|
|
|
17
17
|
import { RelationshipEntity } from "./relationship.entity";
|
|
18
18
|
import { StaffEntity } from "./staffs.entity";
|
|
19
19
|
import { PaymentMethodEntity } from "./payment_method.entity";
|
|
20
|
-
|
|
21
|
-
export
|
|
20
|
+
import { OrgReferralEntity } from "./org_referral.entity";
|
|
21
|
+
export declare const CORE_ENTITIES: readonly [typeof GeoProvinceEntity, typeof GeoDistrictEntity, typeof GeoCommuneEntity, typeof GeoVillageEntity, typeof MaritalStatusEntity, typeof NationalityEntity, typeof NumberSeriesEntity, typeof OrganizationEntity, typeof OrganizationBranchEntity, typeof OrganizationChannelEntity, typeof OrganizationDepartmentEntity, typeof OrganizationPositionEntity, typeof OrganizationStaffEntity, typeof OrganizationStaffBranchEntity, typeof OrganizationStaffReportingLineEntity, typeof OrgReferralEntity, typeof OccupationEntity, typeof PaymentMethodEntity, typeof RelationshipEntity, typeof StaffEntity, typeof import("./product").CashValueEntity, typeof import("./product").PaymentModeEntity, typeof import("./product").PremiumRateConditionEntity, typeof import("./product").PremiumRateValueEntity, typeof import("./product").ProductEntity, typeof import("./product").ProductOrgEntity, typeof import("./product").ProductTypeEntity, typeof import("./product").ProductPaymentModeEntity, typeof import("./product").ProductRiderEntity, typeof import("./product").ProductTermEntity, typeof import("./product").ProductPlanEntity, typeof import("./product").PromotionEntity, typeof import("./product").PromotionOrgEntity, typeof import("./product").PromotionProductEntity, typeof import("./product").RiderEntity, typeof import("./product").TermEntity, typeof import("./finance").ExchangeRateEntity, typeof import("./finance").ExchangeRateLogEntity];
|
|
22
|
+
export { GeoProvinceEntity, GeoDistrictEntity, GeoCommuneEntity, GeoVillageEntity, MaritalStatusEntity, NationalityEntity, NumberSeriesEntity, OrganizationEntity, OrganizationBranchEntity, OrganizationChannelEntity, OrganizationDepartmentEntity, OrganizationPositionEntity, OrganizationStaffEntity, OrganizationStaffBranchEntity, OrganizationStaffReportingLineEntity, OrgReferralEntity, OccupationEntity, PaymentMethodEntity, RelationshipEntity, StaffEntity, };
|
|
22
23
|
export * from "./product";
|
|
23
24
|
export * from "./finance";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.StaffEntity = exports.RelationshipEntity = exports.PaymentMethodEntity = exports.OccupationEntity = exports.OrganizationStaffReportingLineEntity = exports.OrganizationStaffBranchEntity = exports.OrganizationStaffEntity = exports.OrganizationPositionEntity = exports.OrganizationDepartmentEntity = exports.OrganizationChannelEntity = exports.OrganizationBranchEntity = exports.OrganizationEntity = exports.NumberSeriesEntity = exports.NationalityEntity = exports.MaritalStatusEntity = exports.GeoVillageEntity = exports.GeoCommuneEntity = exports.GeoDistrictEntity = exports.GeoProvinceEntity = exports.CORE_ENTITIES = void 0;
|
|
17
|
+
exports.StaffEntity = exports.RelationshipEntity = exports.PaymentMethodEntity = exports.OccupationEntity = exports.OrgReferralEntity = exports.OrganizationStaffReportingLineEntity = exports.OrganizationStaffBranchEntity = exports.OrganizationStaffEntity = exports.OrganizationPositionEntity = exports.OrganizationDepartmentEntity = exports.OrganizationChannelEntity = exports.OrganizationBranchEntity = exports.OrganizationEntity = exports.NumberSeriesEntity = exports.NationalityEntity = exports.MaritalStatusEntity = exports.GeoVillageEntity = exports.GeoCommuneEntity = exports.GeoDistrictEntity = exports.GeoProvinceEntity = exports.CORE_ENTITIES = void 0;
|
|
18
18
|
const geo_province_entity_1 = require("./geo_province.entity");
|
|
19
19
|
Object.defineProperty(exports, "GeoProvinceEntity", { enumerable: true, get: function () { return geo_province_entity_1.GeoProvinceEntity; } });
|
|
20
20
|
const geo_district_entity_1 = require("./geo_district.entity");
|
|
@@ -55,6 +55,8 @@ const product_1 = require("./product");
|
|
|
55
55
|
const payment_method_entity_1 = require("./payment_method.entity");
|
|
56
56
|
Object.defineProperty(exports, "PaymentMethodEntity", { enumerable: true, get: function () { return payment_method_entity_1.PaymentMethodEntity; } });
|
|
57
57
|
const finance_1 = require("./finance");
|
|
58
|
+
const org_referral_entity_1 = require("./org_referral.entity");
|
|
59
|
+
Object.defineProperty(exports, "OrgReferralEntity", { enumerable: true, get: function () { return org_referral_entity_1.OrgReferralEntity; } });
|
|
58
60
|
exports.CORE_ENTITIES = [
|
|
59
61
|
geo_province_entity_1.GeoProvinceEntity,
|
|
60
62
|
geo_district_entity_1.GeoDistrictEntity,
|
|
@@ -73,6 +75,7 @@ exports.CORE_ENTITIES = [
|
|
|
73
75
|
org_staff_entity_1.OrganizationStaffEntity,
|
|
74
76
|
org_staff_branches_entity_1.OrganizationStaffBranchEntity,
|
|
75
77
|
org_staff_reporting_lines_entity_1.OrganizationStaffReportingLineEntity,
|
|
78
|
+
org_referral_entity_1.OrgReferralEntity,
|
|
76
79
|
occupation_entity_1.OccupationEntity,
|
|
77
80
|
//
|
|
78
81
|
payment_method_entity_1.PaymentMethodEntity,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { OrganizationEntity } from "./organization.entity";
|
|
3
|
+
import { OrganizationStaffEntity } from "./org_staff.entity";
|
|
4
|
+
import { Gender } from "../../types";
|
|
5
|
+
export declare class OrgReferralEntity extends _BaseEntity {
|
|
6
|
+
id: string;
|
|
7
|
+
org_id: string;
|
|
8
|
+
org_staff_id?: string | null;
|
|
9
|
+
referral_code: string;
|
|
10
|
+
full_name: string;
|
|
11
|
+
full_name_kh?: string;
|
|
12
|
+
gender?: Gender;
|
|
13
|
+
phone_number?: string;
|
|
14
|
+
is_active: boolean;
|
|
15
|
+
org: OrganizationEntity;
|
|
16
|
+
org_staff?: OrganizationStaffEntity | null;
|
|
17
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OrgReferralEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _base_entity_1 = require("../_base_entity");
|
|
15
|
+
const organization_entity_1 = require("./organization.entity");
|
|
16
|
+
const org_staff_entity_1 = require("./org_staff.entity");
|
|
17
|
+
const types_1 = require("../../types");
|
|
18
|
+
let OrgReferralEntity = class OrgReferralEntity extends _base_entity_1._BaseEntity {
|
|
19
|
+
};
|
|
20
|
+
exports.OrgReferralEntity = OrgReferralEntity;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], OrgReferralEntity.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Index)(),
|
|
27
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], OrgReferralEntity.prototype, "org_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Index)(),
|
|
32
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], OrgReferralEntity.prototype, "org_staff_id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Index)(),
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30 }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], OrgReferralEntity.prototype, "referral_code", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 150 }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], OrgReferralEntity.prototype, "full_name", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 150, nullable: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], OrgReferralEntity.prototype, "full_name_kh", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], OrgReferralEntity.prototype, "gender", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], OrgReferralEntity.prototype, "phone_number", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
58
|
+
__metadata("design:type", Boolean)
|
|
59
|
+
], OrgReferralEntity.prototype, "is_active", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.OrganizationEntity, { onDelete: "CASCADE" }),
|
|
62
|
+
(0, typeorm_1.JoinColumn)({ name: "org_id" }),
|
|
63
|
+
__metadata("design:type", organization_entity_1.OrganizationEntity)
|
|
64
|
+
], OrgReferralEntity.prototype, "org", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.ManyToOne)(() => org_staff_entity_1.OrganizationStaffEntity, { onDelete: "SET NULL" }),
|
|
67
|
+
(0, typeorm_1.JoinColumn)({ name: "org_staff_id" }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], OrgReferralEntity.prototype, "org_staff", void 0);
|
|
70
|
+
exports.OrgReferralEntity = OrgReferralEntity = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_referrals" }),
|
|
72
|
+
(0, typeorm_1.Unique)("uq_org_referral_org_code", ["org_id", "referral_code"]),
|
|
73
|
+
(0, typeorm_1.Unique)("uq_org_referral_org_staff", ["org_id", "org_staff_id"])
|
|
74
|
+
], OrgReferralEntity);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plac-micro-common",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.49",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"rxjs": "^7.8.2"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
+
"@nestjs/axios": "^4.0.1",
|
|
30
31
|
"@nestjs/common": "^11.1.9",
|
|
31
32
|
"@nestjs/config": "^4.0.2",
|
|
32
33
|
"@nestjs/core": "^11.1.9",
|