plac-micro-common 1.2.11 → 1.2.12

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.
@@ -0,0 +1,25 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerStatus, CustomerType } from "../../types";
3
+ import { CustomerIndividualProfileEntity } from "./customer_individual_profile.entity";
4
+ import { CustomerCorporateProfileEntity } from "./customer_corporate_profile.entity";
5
+ import { CustomerOwnershipEntity } from "./customer_ownership.entity";
6
+ import { CustomerContactEntity } from "./customer_contact.entity";
7
+ import { CustomerAddressEntity } from "./customer_address.entity";
8
+ import { CustomerIdentifierEntity } from "./customer_identifier.entity";
9
+ export declare class CustomerEntity extends _BaseEntity {
10
+ id: string;
11
+ code?: string | null;
12
+ full_name?: string | null;
13
+ full_name_kh?: string | null;
14
+ type: CustomerType;
15
+ status: CustomerStatus;
16
+ primary_phone?: string | null;
17
+ primary_email?: string | null;
18
+ lead_id?: string | null;
19
+ individual_profile?: CustomerIndividualProfileEntity;
20
+ corporate_profile?: CustomerCorporateProfileEntity;
21
+ ownership?: CustomerOwnershipEntity;
22
+ contacts?: CustomerContactEntity[];
23
+ addresses?: CustomerAddressEntity[];
24
+ identifiers?: CustomerIdentifierEntity[];
25
+ }
@@ -0,0 +1,99 @@
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.CustomerEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const types_1 = require("../../types");
16
+ const customer_individual_profile_entity_1 = require("./customer_individual_profile.entity");
17
+ const customer_corporate_profile_entity_1 = require("./customer_corporate_profile.entity");
18
+ const customer_ownership_entity_1 = require("./customer_ownership.entity");
19
+ const customer_contact_entity_1 = require("./customer_contact.entity");
20
+ const customer_address_entity_1 = require("./customer_address.entity");
21
+ const customer_identifier_entity_1 = require("./customer_identifier.entity");
22
+ let CustomerEntity = class CustomerEntity extends _base_entity_1._BaseEntity {
23
+ };
24
+ exports.CustomerEntity = CustomerEntity;
25
+ __decorate([
26
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
27
+ __metadata("design:type", String)
28
+ ], CustomerEntity.prototype, "id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ length: 30, unique: true, nullable: true }),
31
+ __metadata("design:type", Object)
32
+ ], CustomerEntity.prototype, "code", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ length: 200, nullable: true }),
35
+ __metadata("design:type", Object)
36
+ ], CustomerEntity.prototype, "full_name", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ length: 200, nullable: true }),
39
+ __metadata("design:type", Object)
40
+ ], CustomerEntity.prototype, "full_name_kh", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: "varchar", length: 20 }),
43
+ (0, typeorm_1.Index)(),
44
+ __metadata("design:type", String)
45
+ ], CustomerEntity.prototype, "type", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: "varchar", length: 20, default: types_1.CustomerStatus.Active }),
48
+ (0, typeorm_1.Index)(),
49
+ __metadata("design:type", String)
50
+ ], CustomerEntity.prototype, "status", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ length: 50, nullable: true }),
53
+ (0, typeorm_1.Index)(),
54
+ __metadata("design:type", Object)
55
+ ], CustomerEntity.prototype, "primary_phone", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ length: 255, nullable: true }),
58
+ (0, typeorm_1.Index)(),
59
+ __metadata("design:type", Object)
60
+ ], CustomerEntity.prototype, "primary_email", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true, unique: true }),
63
+ __metadata("design:type", Object)
64
+ ], CustomerEntity.prototype, "lead_id", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.OneToOne)(() => customer_individual_profile_entity_1.CustomerIndividualProfileEntity, (p) => p.customer, {
67
+ cascade: true,
68
+ }),
69
+ __metadata("design:type", customer_individual_profile_entity_1.CustomerIndividualProfileEntity)
70
+ ], CustomerEntity.prototype, "individual_profile", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.OneToOne)(() => customer_corporate_profile_entity_1.CustomerCorporateProfileEntity, (p) => p.customer, {
73
+ cascade: true,
74
+ }),
75
+ __metadata("design:type", customer_corporate_profile_entity_1.CustomerCorporateProfileEntity)
76
+ ], CustomerEntity.prototype, "corporate_profile", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.OneToOne)(() => customer_ownership_entity_1.CustomerOwnershipEntity, (p) => p.customer, {
79
+ cascade: true,
80
+ }),
81
+ __metadata("design:type", customer_ownership_entity_1.CustomerOwnershipEntity)
82
+ ], CustomerEntity.prototype, "ownership", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.OneToMany)(() => customer_contact_entity_1.CustomerContactEntity, (c) => c.customer, { cascade: true }),
85
+ __metadata("design:type", Array)
86
+ ], CustomerEntity.prototype, "contacts", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.OneToMany)(() => customer_address_entity_1.CustomerAddressEntity, (a) => a.customer, { cascade: true }),
89
+ __metadata("design:type", Array)
90
+ ], CustomerEntity.prototype, "addresses", void 0);
91
+ __decorate([
92
+ (0, typeorm_1.OneToMany)(() => customer_identifier_entity_1.CustomerIdentifierEntity, (i) => i.customer, {
93
+ cascade: true,
94
+ }),
95
+ __metadata("design:type", Array)
96
+ ], CustomerEntity.prototype, "identifiers", void 0);
97
+ exports.CustomerEntity = CustomerEntity = __decorate([
98
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customers" })
99
+ ], CustomerEntity);
@@ -0,0 +1,11 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerEntity } from "./customer.entity";
3
+ export declare class CustomerAddressEntity extends _BaseEntity {
4
+ id: string;
5
+ customer_id: string;
6
+ customer: CustomerEntity;
7
+ address_type: string;
8
+ full_address: string;
9
+ full_address_kh?: string;
10
+ is_primary: boolean;
11
+ }
@@ -0,0 +1,52 @@
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.CustomerAddressEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const customer_entity_1 = require("./customer.entity");
16
+ let CustomerAddressEntity = class CustomerAddressEntity extends _base_entity_1._BaseEntity {
17
+ };
18
+ exports.CustomerAddressEntity = CustomerAddressEntity;
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
21
+ __metadata("design:type", String)
22
+ ], CustomerAddressEntity.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: "uuid" }),
25
+ (0, typeorm_1.Index)(),
26
+ __metadata("design:type", String)
27
+ ], CustomerAddressEntity.prototype, "customer_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (c) => c.addresses, { onDelete: "CASCADE" }),
30
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
31
+ __metadata("design:type", customer_entity_1.CustomerEntity)
32
+ ], CustomerAddressEntity.prototype, "customer", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ length: 30 }),
35
+ __metadata("design:type", String)
36
+ ], CustomerAddressEntity.prototype, "address_type", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ length: 500 }),
39
+ __metadata("design:type", String)
40
+ ], CustomerAddressEntity.prototype, "full_address", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ length: 500, nullable: true }),
43
+ __metadata("design:type", String)
44
+ ], CustomerAddressEntity.prototype, "full_address_kh", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ default: false }),
47
+ __metadata("design:type", Boolean)
48
+ ], CustomerAddressEntity.prototype, "is_primary", void 0);
49
+ exports.CustomerAddressEntity = CustomerAddressEntity = __decorate([
50
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_addresses" }),
51
+ (0, typeorm_1.Index)(["customer_id", "address_type"])
52
+ ], CustomerAddressEntity);
@@ -0,0 +1,12 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerEntity } from "./customer.entity";
3
+ import { ContactType } from "../../types";
4
+ export declare class CustomerContactEntity extends _BaseEntity {
5
+ id: string;
6
+ customer_id: string;
7
+ customer: CustomerEntity;
8
+ contact_type: ContactType;
9
+ value: string;
10
+ label?: string | null;
11
+ is_primary: boolean;
12
+ }
@@ -0,0 +1,53 @@
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.CustomerContactEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const customer_entity_1 = require("./customer.entity");
16
+ const types_1 = require("../../types");
17
+ let CustomerContactEntity = class CustomerContactEntity extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.CustomerContactEntity = CustomerContactEntity;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
22
+ __metadata("design:type", String)
23
+ ], CustomerContactEntity.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: "uuid" }),
26
+ (0, typeorm_1.Index)(),
27
+ __metadata("design:type", String)
28
+ ], CustomerContactEntity.prototype, "customer_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (c) => c.contacts, { onDelete: "CASCADE" }),
31
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
32
+ __metadata("design:type", customer_entity_1.CustomerEntity)
33
+ ], CustomerContactEntity.prototype, "customer", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: "varchar", length: 20 }),
36
+ __metadata("design:type", String)
37
+ ], CustomerContactEntity.prototype, "contact_type", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ length: 255 }),
40
+ __metadata("design:type", String)
41
+ ], CustomerContactEntity.prototype, "value", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ length: 50, nullable: true }),
44
+ __metadata("design:type", Object)
45
+ ], CustomerContactEntity.prototype, "label", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ default: false }),
48
+ __metadata("design:type", Boolean)
49
+ ], CustomerContactEntity.prototype, "is_primary", void 0);
50
+ exports.CustomerContactEntity = CustomerContactEntity = __decorate([
51
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_contacts" }),
52
+ (0, typeorm_1.Index)(["customer_id", "is_primary"])
53
+ ], CustomerContactEntity);
@@ -0,0 +1,13 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerEntity } from "./customer.entity";
3
+ export declare class CustomerCorporateProfileEntity extends _BaseEntity {
4
+ id: string;
5
+ customer_id: string;
6
+ customer: CustomerEntity;
7
+ company_name: string;
8
+ company_name_kh?: string;
9
+ company_registration_no?: string | null;
10
+ tax_id?: string | null;
11
+ industry?: string | null;
12
+ incorporation_date?: Date | null;
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.CustomerCorporateProfileEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const customer_entity_1 = require("./customer.entity");
16
+ let CustomerCorporateProfileEntity = class CustomerCorporateProfileEntity extends _base_entity_1._BaseEntity {
17
+ };
18
+ exports.CustomerCorporateProfileEntity = CustomerCorporateProfileEntity;
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
21
+ __metadata("design:type", String)
22
+ ], CustomerCorporateProfileEntity.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: "uuid", unique: true }),
25
+ (0, typeorm_1.Index)(),
26
+ __metadata("design:type", String)
27
+ ], CustomerCorporateProfileEntity.prototype, "customer_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.OneToOne)(() => customer_entity_1.CustomerEntity, (c) => c.corporate_profile, {
30
+ onDelete: "CASCADE",
31
+ }),
32
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
33
+ __metadata("design:type", customer_entity_1.CustomerEntity)
34
+ ], CustomerCorporateProfileEntity.prototype, "customer", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ length: 255 }),
37
+ __metadata("design:type", String)
38
+ ], CustomerCorporateProfileEntity.prototype, "company_name", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ length: 255, nullable: true }),
41
+ __metadata("design:type", String)
42
+ ], CustomerCorporateProfileEntity.prototype, "company_name_kh", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ length: 100, nullable: true }),
45
+ __metadata("design:type", Object)
46
+ ], CustomerCorporateProfileEntity.prototype, "company_registration_no", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ length: 100, nullable: true }),
49
+ __metadata("design:type", Object)
50
+ ], CustomerCorporateProfileEntity.prototype, "tax_id", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ length: 50, nullable: true }),
53
+ __metadata("design:type", Object)
54
+ ], CustomerCorporateProfileEntity.prototype, "industry", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({ type: "date", nullable: true }),
57
+ __metadata("design:type", Object)
58
+ ], CustomerCorporateProfileEntity.prototype, "incorporation_date", void 0);
59
+ exports.CustomerCorporateProfileEntity = CustomerCorporateProfileEntity = __decorate([
60
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_corporate_profiles" })
61
+ ], CustomerCorporateProfileEntity);
@@ -0,0 +1,14 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerEntity } from "./customer.entity";
3
+ import { IdentifierType } from "../../types";
4
+ export declare class CustomerIdentifierEntity extends _BaseEntity {
5
+ id: string;
6
+ customer_id: string;
7
+ customer: CustomerEntity;
8
+ identifier_type: IdentifierType;
9
+ value: string;
10
+ issued_date?: Date | null;
11
+ expiry_date?: Date | null;
12
+ issued_place?: string | null;
13
+ is_primary: boolean;
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.CustomerIdentifierEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const customer_entity_1 = require("./customer.entity");
16
+ const types_1 = require("../../types");
17
+ let CustomerIdentifierEntity = class CustomerIdentifierEntity extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.CustomerIdentifierEntity = CustomerIdentifierEntity;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
22
+ __metadata("design:type", String)
23
+ ], CustomerIdentifierEntity.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: "uuid" }),
26
+ (0, typeorm_1.Index)(),
27
+ __metadata("design:type", String)
28
+ ], CustomerIdentifierEntity.prototype, "customer_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (c) => c.identifiers, {
31
+ onDelete: "CASCADE",
32
+ }),
33
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
34
+ __metadata("design:type", customer_entity_1.CustomerEntity)
35
+ ], CustomerIdentifierEntity.prototype, "customer", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: "varchar", length: 30 }),
38
+ __metadata("design:type", String)
39
+ ], CustomerIdentifierEntity.prototype, "identifier_type", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ length: 120 }),
42
+ __metadata("design:type", String)
43
+ ], CustomerIdentifierEntity.prototype, "value", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: "date", nullable: true }),
46
+ __metadata("design:type", Object)
47
+ ], CustomerIdentifierEntity.prototype, "issued_date", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: "date", nullable: true }),
50
+ __metadata("design:type", Object)
51
+ ], CustomerIdentifierEntity.prototype, "expiry_date", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ length: 100, nullable: true }),
54
+ __metadata("design:type", Object)
55
+ ], CustomerIdentifierEntity.prototype, "issued_place", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ default: false }),
58
+ __metadata("design:type", Boolean)
59
+ ], CustomerIdentifierEntity.prototype, "is_primary", void 0);
60
+ exports.CustomerIdentifierEntity = CustomerIdentifierEntity = __decorate([
61
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_identifiers" }),
62
+ (0, typeorm_1.Index)(["identifier_type", "value"])
63
+ ], CustomerIdentifierEntity);
@@ -0,0 +1,17 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerEntity } from "./customer.entity";
3
+ import { Gender, MaritalStatus } from "../../types";
4
+ export declare class CustomerIndividualProfileEntity extends _BaseEntity {
5
+ id: string;
6
+ customer_id: string;
7
+ customer: CustomerEntity;
8
+ first_name: string;
9
+ last_name: string;
10
+ first_name_kh?: string;
11
+ last_name_kh?: string;
12
+ date_of_birth?: Date | null;
13
+ gender?: Gender;
14
+ marital_status?: MaritalStatus;
15
+ nationality?: string | null;
16
+ occupation?: string | 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.CustomerIndividualProfileEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const customer_entity_1 = require("./customer.entity");
16
+ const types_1 = require("../../types");
17
+ let CustomerIndividualProfileEntity = class CustomerIndividualProfileEntity extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.CustomerIndividualProfileEntity = CustomerIndividualProfileEntity;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
22
+ __metadata("design:type", String)
23
+ ], CustomerIndividualProfileEntity.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: "uuid", unique: true }),
26
+ (0, typeorm_1.Index)(),
27
+ __metadata("design:type", String)
28
+ ], CustomerIndividualProfileEntity.prototype, "customer_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.OneToOne)(() => customer_entity_1.CustomerEntity, (c) => c.individual_profile, {
31
+ onDelete: "CASCADE",
32
+ }),
33
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
34
+ __metadata("design:type", customer_entity_1.CustomerEntity)
35
+ ], CustomerIndividualProfileEntity.prototype, "customer", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ length: 100 }),
38
+ __metadata("design:type", String)
39
+ ], CustomerIndividualProfileEntity.prototype, "first_name", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ length: 100 }),
42
+ __metadata("design:type", String)
43
+ ], CustomerIndividualProfileEntity.prototype, "last_name", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ length: 100, nullable: true }),
46
+ __metadata("design:type", String)
47
+ ], CustomerIndividualProfileEntity.prototype, "first_name_kh", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ length: 100, nullable: true }),
50
+ __metadata("design:type", String)
51
+ ], CustomerIndividualProfileEntity.prototype, "last_name_kh", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ type: "date", nullable: true }),
54
+ __metadata("design:type", Object)
55
+ ], CustomerIndividualProfileEntity.prototype, "date_of_birth", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ length: 5, nullable: true }),
58
+ __metadata("design:type", String)
59
+ ], CustomerIndividualProfileEntity.prototype, "gender", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ length: 50, nullable: true }),
62
+ __metadata("design:type", String)
63
+ ], CustomerIndividualProfileEntity.prototype, "marital_status", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ length: 50, nullable: true }),
66
+ __metadata("design:type", Object)
67
+ ], CustomerIndividualProfileEntity.prototype, "nationality", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ length: 50, nullable: true }),
70
+ __metadata("design:type", Object)
71
+ ], CustomerIndividualProfileEntity.prototype, "occupation", void 0);
72
+ exports.CustomerIndividualProfileEntity = CustomerIndividualProfileEntity = __decorate([
73
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_individual_profiles" })
74
+ ], CustomerIndividualProfileEntity);
@@ -0,0 +1,9 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerEntity } from "./customer.entity";
3
+ export declare class CustomerOwnershipEntity extends _BaseEntity {
4
+ id: string;
5
+ customer_id: string;
6
+ customer: CustomerEntity;
7
+ partner_id: string;
8
+ created_by_staff_id?: string;
9
+ }
@@ -0,0 +1,48 @@
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.CustomerOwnershipEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("../_base_entity");
15
+ const customer_entity_1 = require("./customer.entity");
16
+ let CustomerOwnershipEntity = class CustomerOwnershipEntity extends _base_entity_1._BaseEntity {
17
+ };
18
+ exports.CustomerOwnershipEntity = CustomerOwnershipEntity;
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
21
+ __metadata("design:type", String)
22
+ ], CustomerOwnershipEntity.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: "uuid" }),
25
+ (0, typeorm_1.Index)(),
26
+ __metadata("design:type", String)
27
+ ], CustomerOwnershipEntity.prototype, "customer_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.OneToOne)(() => customer_entity_1.CustomerEntity, (c) => c.ownership, {
30
+ onDelete: "CASCADE",
31
+ }),
32
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
33
+ __metadata("design:type", customer_entity_1.CustomerEntity)
34
+ ], CustomerOwnershipEntity.prototype, "customer", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: "uuid" }),
37
+ (0, typeorm_1.Index)(),
38
+ __metadata("design:type", String)
39
+ ], CustomerOwnershipEntity.prototype, "partner_id", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
42
+ (0, typeorm_1.Index)(),
43
+ __metadata("design:type", String)
44
+ ], CustomerOwnershipEntity.prototype, "created_by_staff_id", void 0);
45
+ exports.CustomerOwnershipEntity = CustomerOwnershipEntity = __decorate([
46
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_ownerships" }),
47
+ (0, typeorm_1.Index)(["partner_id", "customer_id"], { unique: true })
48
+ ], CustomerOwnershipEntity);
@@ -0,0 +1,9 @@
1
+ import { CustomerEntity } from "./customer.entity";
2
+ import { CustomerAddressEntity } from "./customer_address.entity";
3
+ import { CustomerContactEntity } from "./customer_contact.entity";
4
+ import { CustomerCorporateProfileEntity } from "./customer_corporate_profile.entity";
5
+ import { CustomerIdentifierEntity } from "./customer_identifier.entity";
6
+ import { CustomerIndividualProfileEntity } from "./customer_individual_profile.entity";
7
+ import { CustomerOwnershipEntity } from "./customer_ownership.entity";
8
+ export declare const CUSTOMER_ENTITIES: readonly [typeof CustomerEntity, typeof CustomerAddressEntity, typeof CustomerContactEntity, typeof CustomerCorporateProfileEntity, typeof CustomerIdentifierEntity, typeof CustomerIndividualProfileEntity, typeof CustomerOwnershipEntity];
9
+ export { CustomerEntity, CustomerAddressEntity, CustomerContactEntity, CustomerCorporateProfileEntity, CustomerIdentifierEntity, CustomerIndividualProfileEntity, CustomerOwnershipEntity, };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerOwnershipEntity = exports.CustomerIndividualProfileEntity = exports.CustomerIdentifierEntity = exports.CustomerCorporateProfileEntity = exports.CustomerContactEntity = exports.CustomerAddressEntity = exports.CustomerEntity = exports.CUSTOMER_ENTITIES = void 0;
4
+ const customer_entity_1 = require("./customer.entity");
5
+ Object.defineProperty(exports, "CustomerEntity", { enumerable: true, get: function () { return customer_entity_1.CustomerEntity; } });
6
+ const customer_address_entity_1 = require("./customer_address.entity");
7
+ Object.defineProperty(exports, "CustomerAddressEntity", { enumerable: true, get: function () { return customer_address_entity_1.CustomerAddressEntity; } });
8
+ const customer_contact_entity_1 = require("./customer_contact.entity");
9
+ Object.defineProperty(exports, "CustomerContactEntity", { enumerable: true, get: function () { return customer_contact_entity_1.CustomerContactEntity; } });
10
+ const customer_corporate_profile_entity_1 = require("./customer_corporate_profile.entity");
11
+ Object.defineProperty(exports, "CustomerCorporateProfileEntity", { enumerable: true, get: function () { return customer_corporate_profile_entity_1.CustomerCorporateProfileEntity; } });
12
+ const customer_identifier_entity_1 = require("./customer_identifier.entity");
13
+ Object.defineProperty(exports, "CustomerIdentifierEntity", { enumerable: true, get: function () { return customer_identifier_entity_1.CustomerIdentifierEntity; } });
14
+ const customer_individual_profile_entity_1 = require("./customer_individual_profile.entity");
15
+ Object.defineProperty(exports, "CustomerIndividualProfileEntity", { enumerable: true, get: function () { return customer_individual_profile_entity_1.CustomerIndividualProfileEntity; } });
16
+ const customer_ownership_entity_1 = require("./customer_ownership.entity");
17
+ Object.defineProperty(exports, "CustomerOwnershipEntity", { enumerable: true, get: function () { return customer_ownership_entity_1.CustomerOwnershipEntity; } });
18
+ exports.CUSTOMER_ENTITIES = [
19
+ customer_entity_1.CustomerEntity,
20
+ customer_address_entity_1.CustomerAddressEntity,
21
+ customer_contact_entity_1.CustomerContactEntity,
22
+ customer_corporate_profile_entity_1.CustomerCorporateProfileEntity,
23
+ customer_identifier_entity_1.CustomerIdentifierEntity,
24
+ customer_individual_profile_entity_1.CustomerIndividualProfileEntity,
25
+ customer_ownership_entity_1.CustomerOwnershipEntity,
26
+ ];
@@ -2,3 +2,4 @@ export * from "./_base_entity";
2
2
  export * from "./_base_general_entity";
3
3
  export * from "./_base_ownership_entity";
4
4
  export * from "./core";
5
+ export * from "./customer";
@@ -18,3 +18,4 @@ __exportStar(require("./_base_entity"), exports);
18
18
  __exportStar(require("./_base_general_entity"), exports);
19
19
  __exportStar(require("./_base_ownership_entity"), exports);
20
20
  __exportStar(require("./core"), exports);
21
+ __exportStar(require("./customer"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {