plac-micro-common 1.2.24 → 1.2.25
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/models/core/index.d.ts +11 -2
- package/dist/models/core/index.js +29 -1
- package/dist/models/core/org_branch.entity.d.ts +13 -0
- package/dist/models/core/org_branch.entity.js +61 -0
- package/dist/models/core/org_channel.entity.d.ts +14 -0
- package/dist/models/core/org_channel.entity.js +63 -0
- package/dist/models/core/org_department.entity.d.ts +14 -0
- package/dist/models/core/org_department.entity.js +66 -0
- package/dist/models/core/org_position.entity.d.ts +16 -0
- package/dist/models/core/org_position.entity.js +72 -0
- package/dist/models/core/org_staff.entity.d.ts +17 -0
- package/dist/models/core/org_staff.entity.js +76 -0
- package/dist/models/core/org_staff_branches.entity.d.ts +14 -0
- package/dist/models/core/org_staff_branches.entity.js +63 -0
- package/dist/models/core/org_staff_reporting_lines.entity.d.ts +15 -0
- package/dist/models/core/org_staff_reporting_lines.entity.js +77 -0
- package/dist/models/core/organization.entity.d.ts +11 -0
- package/dist/models/core/organization.entity.js +50 -0
- package/dist/models/core/staffs.entity.d.ts +18 -0
- package/dist/models/core/staffs.entity.js +80 -0
- package/dist/types/business.type.d.ts +17 -0
- package/dist/types/business.type.js +22 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/staff.type.d.ts +16 -0
- package/dist/types/staff.type.js +22 -0
- package/package.json +1 -1
|
@@ -4,5 +4,14 @@ import { GeoCommuneEntity } from "./geo_commune.entity";
|
|
|
4
4
|
import { GeoVillageEntity } from "./geo_village.entity";
|
|
5
5
|
import { MaritalStatusEntity } from "./marital_status.entity";
|
|
6
6
|
import { NationalityEntity } from "./nationality.entity";
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { Organization } from "./organization.entity";
|
|
8
|
+
import { OrganizationBranch } from "./org_branch.entity";
|
|
9
|
+
import { OrganizationChannel } from "./org_channel.entity";
|
|
10
|
+
import { OrganizationDepartment } from "./org_department.entity";
|
|
11
|
+
import { OrganizationPosition } from "./org_position.entity";
|
|
12
|
+
import { OrganizationStaff } from "./org_staff.entity";
|
|
13
|
+
import { OrganizationStaffBranch } from "./org_staff_branches.entity";
|
|
14
|
+
import { OrganizationStaffReportingLine } from "./org_staff_reporting_lines.entity";
|
|
15
|
+
import { Staff } from "./staffs.entity";
|
|
16
|
+
export declare const CORE_ENTITIES: readonly [typeof GeoProvinceEntity, typeof GeoDistrictEntity, typeof GeoCommuneEntity, typeof GeoVillageEntity, typeof MaritalStatusEntity, typeof NationalityEntity, typeof Organization, typeof OrganizationBranch, typeof OrganizationChannel, typeof OrganizationDepartment, typeof OrganizationPosition, typeof OrganizationStaff, typeof OrganizationStaffBranch, typeof OrganizationStaffReportingLine, typeof Staff];
|
|
17
|
+
export { GeoProvinceEntity, GeoDistrictEntity, GeoCommuneEntity, GeoVillageEntity, MaritalStatusEntity, NationalityEntity, Organization, OrganizationBranch, OrganizationChannel, OrganizationDepartment, OrganizationPosition, OrganizationStaff, OrganizationStaffBranch, OrganizationStaffReportingLine, Staff, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NationalityEntity = exports.MaritalStatusEntity = exports.GeoVillageEntity = exports.GeoCommuneEntity = exports.GeoDistrictEntity = exports.GeoProvinceEntity = exports.CORE_ENTITIES = void 0;
|
|
3
|
+
exports.Staff = exports.OrganizationStaffReportingLine = exports.OrganizationStaffBranch = exports.OrganizationStaff = exports.OrganizationPosition = exports.OrganizationDepartment = exports.OrganizationChannel = exports.OrganizationBranch = exports.Organization = exports.NationalityEntity = exports.MaritalStatusEntity = exports.GeoVillageEntity = exports.GeoCommuneEntity = exports.GeoDistrictEntity = exports.GeoProvinceEntity = exports.CORE_ENTITIES = void 0;
|
|
4
4
|
const geo_province_entity_1 = require("./geo_province.entity");
|
|
5
5
|
Object.defineProperty(exports, "GeoProvinceEntity", { enumerable: true, get: function () { return geo_province_entity_1.GeoProvinceEntity; } });
|
|
6
6
|
const geo_district_entity_1 = require("./geo_district.entity");
|
|
@@ -13,6 +13,24 @@ const marital_status_entity_1 = require("./marital_status.entity");
|
|
|
13
13
|
Object.defineProperty(exports, "MaritalStatusEntity", { enumerable: true, get: function () { return marital_status_entity_1.MaritalStatusEntity; } });
|
|
14
14
|
const nationality_entity_1 = require("./nationality.entity");
|
|
15
15
|
Object.defineProperty(exports, "NationalityEntity", { enumerable: true, get: function () { return nationality_entity_1.NationalityEntity; } });
|
|
16
|
+
const organization_entity_1 = require("./organization.entity");
|
|
17
|
+
Object.defineProperty(exports, "Organization", { enumerable: true, get: function () { return organization_entity_1.Organization; } });
|
|
18
|
+
const org_branch_entity_1 = require("./org_branch.entity");
|
|
19
|
+
Object.defineProperty(exports, "OrganizationBranch", { enumerable: true, get: function () { return org_branch_entity_1.OrganizationBranch; } });
|
|
20
|
+
const org_channel_entity_1 = require("./org_channel.entity");
|
|
21
|
+
Object.defineProperty(exports, "OrganizationChannel", { enumerable: true, get: function () { return org_channel_entity_1.OrganizationChannel; } });
|
|
22
|
+
const org_department_entity_1 = require("./org_department.entity");
|
|
23
|
+
Object.defineProperty(exports, "OrganizationDepartment", { enumerable: true, get: function () { return org_department_entity_1.OrganizationDepartment; } });
|
|
24
|
+
const org_position_entity_1 = require("./org_position.entity");
|
|
25
|
+
Object.defineProperty(exports, "OrganizationPosition", { enumerable: true, get: function () { return org_position_entity_1.OrganizationPosition; } });
|
|
26
|
+
const org_staff_entity_1 = require("./org_staff.entity");
|
|
27
|
+
Object.defineProperty(exports, "OrganizationStaff", { enumerable: true, get: function () { return org_staff_entity_1.OrganizationStaff; } });
|
|
28
|
+
const org_staff_branches_entity_1 = require("./org_staff_branches.entity");
|
|
29
|
+
Object.defineProperty(exports, "OrganizationStaffBranch", { enumerable: true, get: function () { return org_staff_branches_entity_1.OrganizationStaffBranch; } });
|
|
30
|
+
const org_staff_reporting_lines_entity_1 = require("./org_staff_reporting_lines.entity");
|
|
31
|
+
Object.defineProperty(exports, "OrganizationStaffReportingLine", { enumerable: true, get: function () { return org_staff_reporting_lines_entity_1.OrganizationStaffReportingLine; } });
|
|
32
|
+
const staffs_entity_1 = require("./staffs.entity");
|
|
33
|
+
Object.defineProperty(exports, "Staff", { enumerable: true, get: function () { return staffs_entity_1.Staff; } });
|
|
16
34
|
exports.CORE_ENTITIES = [
|
|
17
35
|
geo_province_entity_1.GeoProvinceEntity,
|
|
18
36
|
geo_district_entity_1.GeoDistrictEntity,
|
|
@@ -21,4 +39,14 @@ exports.CORE_ENTITIES = [
|
|
|
21
39
|
//
|
|
22
40
|
marital_status_entity_1.MaritalStatusEntity,
|
|
23
41
|
nationality_entity_1.NationalityEntity,
|
|
42
|
+
//
|
|
43
|
+
organization_entity_1.Organization,
|
|
44
|
+
org_branch_entity_1.OrganizationBranch,
|
|
45
|
+
org_channel_entity_1.OrganizationChannel,
|
|
46
|
+
org_department_entity_1.OrganizationDepartment,
|
|
47
|
+
org_position_entity_1.OrganizationPosition,
|
|
48
|
+
org_staff_entity_1.OrganizationStaff,
|
|
49
|
+
org_staff_branches_entity_1.OrganizationStaffBranch,
|
|
50
|
+
org_staff_reporting_lines_entity_1.OrganizationStaffReportingLine,
|
|
51
|
+
staffs_entity_1.Staff,
|
|
24
52
|
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { Organization } from "./organization.entity";
|
|
3
|
+
export declare class OrganizationBranch extends _BaseEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
org_id: string;
|
|
6
|
+
code: string;
|
|
7
|
+
name: string;
|
|
8
|
+
name_kh?: string;
|
|
9
|
+
parent_branch_id?: string | null;
|
|
10
|
+
address?: string;
|
|
11
|
+
is_active: boolean;
|
|
12
|
+
org: Organization;
|
|
13
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.OrganizationBranch = 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
|
+
let OrganizationBranch = class OrganizationBranch extends _base_entity_1._BaseEntity {
|
|
17
|
+
};
|
|
18
|
+
exports.OrganizationBranch = OrganizationBranch;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], OrganizationBranch.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Index)(),
|
|
25
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], OrganizationBranch.prototype, "org_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], OrganizationBranch.prototype, "code", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200 }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], OrganizationBranch.prototype, "name", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], OrganizationBranch.prototype, "name_kh", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Index)(),
|
|
42
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], OrganizationBranch.prototype, "parent_branch_id", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], OrganizationBranch.prototype, "address", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
51
|
+
__metadata("design:type", Boolean)
|
|
52
|
+
], OrganizationBranch.prototype, "is_active", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: "CASCADE" }),
|
|
55
|
+
(0, typeorm_1.JoinColumn)({ name: "org_id" }),
|
|
56
|
+
__metadata("design:type", organization_entity_1.Organization)
|
|
57
|
+
], OrganizationBranch.prototype, "org", void 0);
|
|
58
|
+
exports.OrganizationBranch = OrganizationBranch = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_branches" }),
|
|
60
|
+
(0, typeorm_1.Unique)("uq_org_branch_code", ["org_id", "code"])
|
|
61
|
+
], OrganizationBranch);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { Organization } from "./organization.entity";
|
|
3
|
+
import { ChannelType } from "../../types";
|
|
4
|
+
export declare class OrganizationChannel extends _BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
org_id: string;
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
name_kh?: string;
|
|
10
|
+
type: ChannelType;
|
|
11
|
+
branch_id?: string | null;
|
|
12
|
+
is_active: boolean;
|
|
13
|
+
org: Organization;
|
|
14
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.OrganizationChannel = 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 types_1 = require("../../types");
|
|
17
|
+
let OrganizationChannel = class OrganizationChannel extends _base_entity_1._BaseEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.OrganizationChannel = OrganizationChannel;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], OrganizationChannel.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Index)(),
|
|
26
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], OrganizationChannel.prototype, "org_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30 }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], OrganizationChannel.prototype, "code", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], OrganizationChannel.prototype, "name", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], OrganizationChannel.prototype, "name_kh", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Index)(),
|
|
43
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30, default: types_1.ChannelType.Other }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], OrganizationChannel.prototype, "type", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Index)(),
|
|
48
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], OrganizationChannel.prototype, "branch_id", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
53
|
+
__metadata("design:type", Boolean)
|
|
54
|
+
], OrganizationChannel.prototype, "is_active", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: "CASCADE" }),
|
|
57
|
+
(0, typeorm_1.JoinColumn)({ name: "org_id" }),
|
|
58
|
+
__metadata("design:type", organization_entity_1.Organization)
|
|
59
|
+
], OrganizationChannel.prototype, "org", void 0);
|
|
60
|
+
exports.OrganizationChannel = OrganizationChannel = __decorate([
|
|
61
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_channels" }),
|
|
62
|
+
(0, typeorm_1.Unique)("uq_org_channel_code", ["org_id", "code"])
|
|
63
|
+
], OrganizationChannel);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { Organization } from "./organization.entity";
|
|
3
|
+
export declare class OrganizationDepartment extends _BaseEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
org_id: string;
|
|
6
|
+
code: string;
|
|
7
|
+
name: string;
|
|
8
|
+
name_kh?: string;
|
|
9
|
+
branch_id?: string | null;
|
|
10
|
+
parent_department_id?: string | null;
|
|
11
|
+
level?: number | null;
|
|
12
|
+
is_active: boolean;
|
|
13
|
+
org: Organization;
|
|
14
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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.OrganizationDepartment = 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
|
+
let OrganizationDepartment = class OrganizationDepartment extends _base_entity_1._BaseEntity {
|
|
17
|
+
};
|
|
18
|
+
exports.OrganizationDepartment = OrganizationDepartment;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], OrganizationDepartment.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Index)(),
|
|
25
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], OrganizationDepartment.prototype, "org_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], OrganizationDepartment.prototype, "code", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200 }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], OrganizationDepartment.prototype, "name", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], OrganizationDepartment.prototype, "name_kh", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Index)(),
|
|
42
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], OrganizationDepartment.prototype, "branch_id", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Index)(),
|
|
47
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], OrganizationDepartment.prototype, "parent_department_id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], OrganizationDepartment.prototype, "level", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], OrganizationDepartment.prototype, "is_active", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: "CASCADE" }),
|
|
60
|
+
(0, typeorm_1.JoinColumn)({ name: "org_id" }),
|
|
61
|
+
__metadata("design:type", organization_entity_1.Organization)
|
|
62
|
+
], OrganizationDepartment.prototype, "org", void 0);
|
|
63
|
+
exports.OrganizationDepartment = OrganizationDepartment = __decorate([
|
|
64
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_departments" }),
|
|
65
|
+
(0, typeorm_1.Unique)("uq_org_department_code", ["org_id", "code"])
|
|
66
|
+
], OrganizationDepartment);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { Organization } from "./organization.entity";
|
|
3
|
+
import { OrganizationDepartment } from "./org_department.entity";
|
|
4
|
+
export declare class OrganizationPosition extends _BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
org_id: string;
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
name_kh?: string;
|
|
10
|
+
parent_position_id?: string | null;
|
|
11
|
+
department_id?: string | null;
|
|
12
|
+
level?: number | null;
|
|
13
|
+
is_active: boolean;
|
|
14
|
+
org: Organization;
|
|
15
|
+
department?: OrganizationDepartment | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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.OrganizationPosition = 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_department_entity_1 = require("./org_department.entity");
|
|
17
|
+
let OrganizationPosition = class OrganizationPosition extends _base_entity_1._BaseEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.OrganizationPosition = OrganizationPosition;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], OrganizationPosition.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Index)(),
|
|
26
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], OrganizationPosition.prototype, "org_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30 }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], OrganizationPosition.prototype, "code", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], OrganizationPosition.prototype, "name", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], OrganizationPosition.prototype, "name_kh", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Index)(),
|
|
43
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], OrganizationPosition.prototype, "parent_position_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Index)(),
|
|
48
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], OrganizationPosition.prototype, "department_id", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], OrganizationPosition.prototype, "level", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
57
|
+
__metadata("design:type", Boolean)
|
|
58
|
+
], OrganizationPosition.prototype, "is_active", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: "CASCADE" }),
|
|
61
|
+
(0, typeorm_1.JoinColumn)({ name: "org_id" }),
|
|
62
|
+
__metadata("design:type", organization_entity_1.Organization)
|
|
63
|
+
], OrganizationPosition.prototype, "org", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.ManyToOne)(() => org_department_entity_1.OrganizationDepartment, { onDelete: "SET NULL" }),
|
|
66
|
+
(0, typeorm_1.JoinColumn)({ name: "department_id" }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], OrganizationPosition.prototype, "department", void 0);
|
|
69
|
+
exports.OrganizationPosition = OrganizationPosition = __decorate([
|
|
70
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_positions" }),
|
|
71
|
+
(0, typeorm_1.Unique)("uq_org_position_code", ["org_id", "code"])
|
|
72
|
+
], OrganizationPosition);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { Organization } from "./organization.entity";
|
|
3
|
+
import { Staff } from "./staffs.entity";
|
|
4
|
+
import { StaffStatus, StaffType } from "../../types";
|
|
5
|
+
export declare class OrganizationStaff extends _BaseEntity {
|
|
6
|
+
id: string;
|
|
7
|
+
org_id: string;
|
|
8
|
+
staff_id: string;
|
|
9
|
+
staff_code: string;
|
|
10
|
+
staff_type: StaffType;
|
|
11
|
+
status: StaffStatus;
|
|
12
|
+
join_date?: string | null;
|
|
13
|
+
end_date?: string | null;
|
|
14
|
+
is_active: boolean;
|
|
15
|
+
org: Organization;
|
|
16
|
+
staff: Staff;
|
|
17
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.OrganizationStaff = 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 staffs_entity_1 = require("./staffs.entity");
|
|
17
|
+
const types_1 = require("../../types");
|
|
18
|
+
let OrganizationStaff = class OrganizationStaff extends _base_entity_1._BaseEntity {
|
|
19
|
+
};
|
|
20
|
+
exports.OrganizationStaff = OrganizationStaff;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], OrganizationStaff.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Index)(),
|
|
27
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], OrganizationStaff.prototype, "org_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Index)(),
|
|
32
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], OrganizationStaff.prototype, "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
|
+
], OrganizationStaff.prototype, "staff_code", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Index)(),
|
|
42
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20, default: types_1.StaffType.Employee }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], OrganizationStaff.prototype, "staff_type", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Index)(),
|
|
47
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20, default: types_1.StaffStatus.Active }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], OrganizationStaff.prototype, "status", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], OrganizationStaff.prototype, "join_date", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], OrganizationStaff.prototype, "end_date", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], OrganizationStaff.prototype, "is_active", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: "CASCADE" }),
|
|
64
|
+
(0, typeorm_1.JoinColumn)({ name: "org_id" }),
|
|
65
|
+
__metadata("design:type", organization_entity_1.Organization)
|
|
66
|
+
], OrganizationStaff.prototype, "org", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.ManyToOne)(() => staffs_entity_1.Staff, { onDelete: "RESTRICT" }),
|
|
69
|
+
(0, typeorm_1.JoinColumn)({ name: "staff_id" }),
|
|
70
|
+
__metadata("design:type", staffs_entity_1.Staff)
|
|
71
|
+
], OrganizationStaff.prototype, "staff", void 0);
|
|
72
|
+
exports.OrganizationStaff = OrganizationStaff = __decorate([
|
|
73
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_staffs" }),
|
|
74
|
+
(0, typeorm_1.Unique)("uq_org_staff_staff_code", ["org_id", "staff_code"]),
|
|
75
|
+
(0, typeorm_1.Unique)("uq_org_staff_org_staff", ["org_id", "staff_id"])
|
|
76
|
+
], OrganizationStaff);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { OrganizationStaff } from "./org_staff.entity";
|
|
3
|
+
import { OrganizationBranch } from "./org_branch.entity";
|
|
4
|
+
export declare class OrganizationStaffBranch extends _BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
org_staff_id: string;
|
|
7
|
+
branch_id: string;
|
|
8
|
+
is_primary: boolean;
|
|
9
|
+
effective_from?: string | null;
|
|
10
|
+
effective_to?: string | null;
|
|
11
|
+
is_active: boolean;
|
|
12
|
+
org_staff: OrganizationStaff;
|
|
13
|
+
branch: OrganizationBranch;
|
|
14
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.OrganizationStaffBranch = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _base_entity_1 = require("../_base_entity");
|
|
15
|
+
const org_staff_entity_1 = require("./org_staff.entity");
|
|
16
|
+
const org_branch_entity_1 = require("./org_branch.entity");
|
|
17
|
+
let OrganizationStaffBranch = class OrganizationStaffBranch extends _base_entity_1._BaseEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.OrganizationStaffBranch = OrganizationStaffBranch;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], OrganizationStaffBranch.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Index)(),
|
|
26
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], OrganizationStaffBranch.prototype, "org_staff_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Index)(),
|
|
31
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], OrganizationStaffBranch.prototype, "branch_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "boolean", default: false }),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], OrganizationStaffBranch.prototype, "is_primary", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], OrganizationStaffBranch.prototype, "effective_from", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], OrganizationStaffBranch.prototype, "effective_to", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
48
|
+
__metadata("design:type", Boolean)
|
|
49
|
+
], OrganizationStaffBranch.prototype, "is_active", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToOne)(() => org_staff_entity_1.OrganizationStaff, { onDelete: "CASCADE" }),
|
|
52
|
+
(0, typeorm_1.JoinColumn)({ name: "org_staff_id" }),
|
|
53
|
+
__metadata("design:type", org_staff_entity_1.OrganizationStaff)
|
|
54
|
+
], OrganizationStaffBranch.prototype, "org_staff", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.ManyToOne)(() => org_branch_entity_1.OrganizationBranch, { onDelete: "RESTRICT" }),
|
|
57
|
+
(0, typeorm_1.JoinColumn)({ name: "branch_id" }),
|
|
58
|
+
__metadata("design:type", org_branch_entity_1.OrganizationBranch)
|
|
59
|
+
], OrganizationStaffBranch.prototype, "branch", void 0);
|
|
60
|
+
exports.OrganizationStaffBranch = OrganizationStaffBranch = __decorate([
|
|
61
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_staff_branches" }),
|
|
62
|
+
(0, typeorm_1.Unique)("uq_org_staff_branch", ["org_staff_id", "branch_id"])
|
|
63
|
+
], OrganizationStaffBranch);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { OrganizationStaff } from "./org_staff.entity";
|
|
3
|
+
import { ReportingLineType } from "../../types";
|
|
4
|
+
export declare class OrganizationStaffReportingLine extends _BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
org_staff_id: string;
|
|
7
|
+
manager_org_staff_id: string;
|
|
8
|
+
line_type: ReportingLineType;
|
|
9
|
+
is_active: boolean;
|
|
10
|
+
effective_from?: string | null;
|
|
11
|
+
effective_to?: string | null;
|
|
12
|
+
is_primary: boolean;
|
|
13
|
+
org_staff: OrganizationStaff;
|
|
14
|
+
manager_org_staff: OrganizationStaff;
|
|
15
|
+
}
|
|
@@ -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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OrganizationStaffReportingLine = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _base_entity_1 = require("../_base_entity");
|
|
15
|
+
const org_staff_entity_1 = require("./org_staff.entity");
|
|
16
|
+
const types_1 = require("../../types");
|
|
17
|
+
let OrganizationStaffReportingLine = class OrganizationStaffReportingLine extends _base_entity_1._BaseEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.OrganizationStaffReportingLine = OrganizationStaffReportingLine;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], OrganizationStaffReportingLine.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Index)(),
|
|
26
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], OrganizationStaffReportingLine.prototype, "org_staff_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Index)(),
|
|
31
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], OrganizationStaffReportingLine.prototype, "manager_org_staff_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Index)(),
|
|
36
|
+
(0, typeorm_1.Column)({
|
|
37
|
+
type: "varchar",
|
|
38
|
+
length: 10,
|
|
39
|
+
default: types_1.ReportingLineType.Solid,
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], OrganizationStaffReportingLine.prototype, "line_type", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], OrganizationStaffReportingLine.prototype, "is_active", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], OrganizationStaffReportingLine.prototype, "effective_from", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], OrganizationStaffReportingLine.prototype, "effective_to", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
57
|
+
__metadata("design:type", Boolean)
|
|
58
|
+
], OrganizationStaffReportingLine.prototype, "is_primary", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.ManyToOne)(() => org_staff_entity_1.OrganizationStaff, { onDelete: "CASCADE" }),
|
|
61
|
+
(0, typeorm_1.JoinColumn)({ name: "org_staff_id" }),
|
|
62
|
+
__metadata("design:type", org_staff_entity_1.OrganizationStaff)
|
|
63
|
+
], OrganizationStaffReportingLine.prototype, "org_staff", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.ManyToOne)(() => org_staff_entity_1.OrganizationStaff, { onDelete: "RESTRICT" }),
|
|
66
|
+
(0, typeorm_1.JoinColumn)({ name: "manager_org_staff_id" }),
|
|
67
|
+
__metadata("design:type", org_staff_entity_1.OrganizationStaff)
|
|
68
|
+
], OrganizationStaffReportingLine.prototype, "manager_org_staff", void 0);
|
|
69
|
+
exports.OrganizationStaffReportingLine = OrganizationStaffReportingLine = __decorate([
|
|
70
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "org_staff_reporting_lines" }),
|
|
71
|
+
(0, typeorm_1.Unique)("uq_org_staff_reporting_line", [
|
|
72
|
+
"org_staff_id",
|
|
73
|
+
"manager_org_staff_id",
|
|
74
|
+
"line_type",
|
|
75
|
+
]),
|
|
76
|
+
(0, typeorm_1.Check)(`"org_staff_id" <> "manager_org_staff_id"`)
|
|
77
|
+
], OrganizationStaffReportingLine);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { OrgType } from "../../types";
|
|
3
|
+
export declare class Organization extends _BaseEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
code: string;
|
|
6
|
+
name: string;
|
|
7
|
+
name_kh?: string;
|
|
8
|
+
org_type: OrgType;
|
|
9
|
+
auth_partner_id?: string | null;
|
|
10
|
+
is_active: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.Organization = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _base_entity_1 = require("../_base_entity");
|
|
15
|
+
const types_1 = require("../../types");
|
|
16
|
+
let Organization = class Organization extends _base_entity_1._BaseEntity {
|
|
17
|
+
};
|
|
18
|
+
exports.Organization = Organization;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], Organization.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 30, unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Organization.prototype, "code", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, unique: true }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], Organization.prototype, "name", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Organization.prototype, "name_kh", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Index)(),
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20 }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Organization.prototype, "org_type", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: "uuid", unique: true, nullable: true }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], Organization.prototype, "auth_partner_id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], Organization.prototype, "is_active", void 0);
|
|
48
|
+
exports.Organization = Organization = __decorate([
|
|
49
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "organizations" })
|
|
50
|
+
], Organization);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _BaseEntity } from "../_base_entity";
|
|
2
|
+
import { Gender } from "../../types";
|
|
3
|
+
export declare class Staff extends _BaseEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
first_name: string;
|
|
6
|
+
last_name: string;
|
|
7
|
+
first_name_kh?: string;
|
|
8
|
+
last_name_kh?: string;
|
|
9
|
+
full_name: string;
|
|
10
|
+
full_name_kh?: string | null;
|
|
11
|
+
gender?: Gender | null;
|
|
12
|
+
date_of_birth?: string | null;
|
|
13
|
+
phone_number?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
national_id?: string;
|
|
16
|
+
passport_id?: string;
|
|
17
|
+
is_active: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.Staff = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _base_entity_1 = require("../_base_entity");
|
|
15
|
+
let Staff = class Staff extends _base_entity_1._BaseEntity {
|
|
16
|
+
};
|
|
17
|
+
exports.Staff = Staff;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], Staff.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200 }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], Staff.prototype, "first_name", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200 }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], Staff.prototype, "last_name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], Staff.prototype, "first_name_kh", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Staff.prototype, "last_name_kh", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200 }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Staff.prototype, "full_name", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], Staff.prototype, "full_name_kh", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Index)(),
|
|
48
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1, nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], Staff.prototype, "gender", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], Staff.prototype, "date_of_birth", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Index)(),
|
|
57
|
+
(0, typeorm_1.Column)({ length: 50, nullable: true }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], Staff.prototype, "phone_number", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Index)(),
|
|
62
|
+
(0, typeorm_1.Column)({ unique: true, length: 100, nullable: true }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], Staff.prototype, "email", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Index)(),
|
|
67
|
+
(0, typeorm_1.Column)({ unique: true, length: 50, nullable: true }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], Staff.prototype, "national_id", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({ unique: true, length: 50, nullable: true }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], Staff.prototype, "passport_id", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
76
|
+
__metadata("design:type", Boolean)
|
|
77
|
+
], Staff.prototype, "is_active", void 0);
|
|
78
|
+
exports.Staff = Staff = __decorate([
|
|
79
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "staffs" })
|
|
80
|
+
], Staff);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum OrgType {
|
|
2
|
+
Internal = "internal",
|
|
3
|
+
Bank = "bank",
|
|
4
|
+
MicroFinance = "micro-finance",
|
|
5
|
+
Agency = "agency",
|
|
6
|
+
Broker = "broker"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ChannelType {
|
|
9
|
+
Direct = "direct",
|
|
10
|
+
Agency = "agency",
|
|
11
|
+
Broker = "broker",
|
|
12
|
+
Bank = "bank",
|
|
13
|
+
Online = "online",
|
|
14
|
+
Partner = "partner",
|
|
15
|
+
Telesales = "telesales",
|
|
16
|
+
Other = "other"
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChannelType = exports.OrgType = void 0;
|
|
4
|
+
var OrgType;
|
|
5
|
+
(function (OrgType) {
|
|
6
|
+
OrgType["Internal"] = "internal";
|
|
7
|
+
OrgType["Bank"] = "bank";
|
|
8
|
+
OrgType["MicroFinance"] = "micro-finance";
|
|
9
|
+
OrgType["Agency"] = "agency";
|
|
10
|
+
OrgType["Broker"] = "broker";
|
|
11
|
+
})(OrgType || (exports.OrgType = OrgType = {}));
|
|
12
|
+
var ChannelType;
|
|
13
|
+
(function (ChannelType) {
|
|
14
|
+
ChannelType["Direct"] = "direct";
|
|
15
|
+
ChannelType["Agency"] = "agency";
|
|
16
|
+
ChannelType["Broker"] = "broker";
|
|
17
|
+
ChannelType["Bank"] = "bank";
|
|
18
|
+
ChannelType["Online"] = "online";
|
|
19
|
+
ChannelType["Partner"] = "partner";
|
|
20
|
+
ChannelType["Telesales"] = "telesales";
|
|
21
|
+
ChannelType["Other"] = "other";
|
|
22
|
+
})(ChannelType || (exports.ChannelType = ChannelType = {}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./_base.type";
|
|
2
2
|
export * from "./auth.type";
|
|
3
3
|
export * from "./auth_info.type";
|
|
4
|
+
export * from "./business.type";
|
|
4
5
|
export * from "./customer.type";
|
|
5
6
|
export * from "./general.type";
|
|
6
7
|
export * from "./http.type";
|
|
@@ -8,4 +9,5 @@ export * from "./pagination.type";
|
|
|
8
9
|
export * from "./permission.type";
|
|
9
10
|
export * from "./product.type";
|
|
10
11
|
export * from "./promotion.type";
|
|
12
|
+
export * from "./staff.type";
|
|
11
13
|
export * from "./quotation.type";
|
package/dist/types/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./_base.type"), exports);
|
|
18
18
|
__exportStar(require("./auth.type"), exports);
|
|
19
19
|
__exportStar(require("./auth_info.type"), exports);
|
|
20
|
+
__exportStar(require("./business.type"), exports);
|
|
20
21
|
__exportStar(require("./customer.type"), exports);
|
|
21
22
|
__exportStar(require("./general.type"), exports);
|
|
22
23
|
__exportStar(require("./http.type"), exports);
|
|
@@ -24,4 +25,5 @@ __exportStar(require("./pagination.type"), exports);
|
|
|
24
25
|
__exportStar(require("./permission.type"), exports);
|
|
25
26
|
__exportStar(require("./product.type"), exports);
|
|
26
27
|
__exportStar(require("./promotion.type"), exports);
|
|
28
|
+
__exportStar(require("./staff.type"), exports);
|
|
27
29
|
__exportStar(require("./quotation.type"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum StaffType {
|
|
2
|
+
Employee = "employee",
|
|
3
|
+
Contractor = "contractor",
|
|
4
|
+
Intern = "intern",
|
|
5
|
+
Other = "other"
|
|
6
|
+
}
|
|
7
|
+
export declare enum StaffStatus {
|
|
8
|
+
Active = "active",
|
|
9
|
+
Suspended = "suspended",
|
|
10
|
+
Resigned = "resigned",
|
|
11
|
+
Terminated = "terminated"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ReportingLineType {
|
|
14
|
+
Solid = "solid",
|
|
15
|
+
Dotted = "dotted"
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportingLineType = exports.StaffStatus = exports.StaffType = void 0;
|
|
4
|
+
var StaffType;
|
|
5
|
+
(function (StaffType) {
|
|
6
|
+
StaffType["Employee"] = "employee";
|
|
7
|
+
StaffType["Contractor"] = "contractor";
|
|
8
|
+
StaffType["Intern"] = "intern";
|
|
9
|
+
StaffType["Other"] = "other";
|
|
10
|
+
})(StaffType || (exports.StaffType = StaffType = {}));
|
|
11
|
+
var StaffStatus;
|
|
12
|
+
(function (StaffStatus) {
|
|
13
|
+
StaffStatus["Active"] = "active";
|
|
14
|
+
StaffStatus["Suspended"] = "suspended";
|
|
15
|
+
StaffStatus["Resigned"] = "resigned";
|
|
16
|
+
StaffStatus["Terminated"] = "terminated";
|
|
17
|
+
})(StaffStatus || (exports.StaffStatus = StaffStatus = {}));
|
|
18
|
+
var ReportingLineType;
|
|
19
|
+
(function (ReportingLineType) {
|
|
20
|
+
ReportingLineType["Solid"] = "solid";
|
|
21
|
+
ReportingLineType["Dotted"] = "dotted";
|
|
22
|
+
})(ReportingLineType || (exports.ReportingLineType = ReportingLineType = {}));
|