plac-micro-common 1.2.33 → 1.2.35
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/customer/customer.entity.d.ts +5 -2
- package/dist/models/customer/customer.entity.js +22 -7
- package/dist/models/customer/customer_individual_profile.entity.d.ts +3 -0
- package/dist/models/customer/customer_individual_profile.entity.js +17 -0
- package/dist/models/customer/index.d.ts +2 -3
- package/dist/models/customer/index.js +1 -4
- package/package.json +1 -1
- package/dist/models/customer/customer_ownership.entity.d.ts +0 -9
- package/dist/models/customer/customer_ownership.entity.js +0 -46
|
@@ -2,10 +2,10 @@ import { _BaseEntity } from "../_base_entity";
|
|
|
2
2
|
import { CustomerStatus, CustomerType } from "../../types";
|
|
3
3
|
import { CustomerIndividualProfileEntity } from "./customer_individual_profile.entity";
|
|
4
4
|
import { CustomerCorporateProfileEntity } from "./customer_corporate_profile.entity";
|
|
5
|
-
import { CustomerOwnershipEntity } from "./customer_ownership.entity";
|
|
6
5
|
import { CustomerContactEntity } from "./customer_contact.entity";
|
|
7
6
|
import { CustomerAddressEntity } from "./customer_address.entity";
|
|
8
7
|
import { CustomerIdentifierEntity } from "./customer_identifier.entity";
|
|
8
|
+
import { OrganizationEntity, OrganizationStaffEntity } from "../core";
|
|
9
9
|
export declare class CustomerEntity extends _BaseEntity {
|
|
10
10
|
id: string;
|
|
11
11
|
cid?: string;
|
|
@@ -17,10 +17,13 @@ export declare class CustomerEntity extends _BaseEntity {
|
|
|
17
17
|
primary_phone?: string | null;
|
|
18
18
|
primary_email?: string | null;
|
|
19
19
|
lead_id?: string | null;
|
|
20
|
+
org_id?: string | null;
|
|
21
|
+
created_by_org_staff_id?: string | null;
|
|
20
22
|
individual_profile?: CustomerIndividualProfileEntity;
|
|
21
23
|
corporate_profile?: CustomerCorporateProfileEntity;
|
|
22
|
-
ownership?: CustomerOwnershipEntity;
|
|
23
24
|
contacts?: CustomerContactEntity[];
|
|
24
25
|
addresses?: CustomerAddressEntity[];
|
|
25
26
|
identifiers?: CustomerIdentifierEntity[];
|
|
27
|
+
org?: OrganizationEntity;
|
|
28
|
+
created_by_org_staff?: OrganizationStaffEntity;
|
|
26
29
|
}
|
|
@@ -15,10 +15,10 @@ const _base_entity_1 = require("../_base_entity");
|
|
|
15
15
|
const types_1 = require("../../types");
|
|
16
16
|
const customer_individual_profile_entity_1 = require("./customer_individual_profile.entity");
|
|
17
17
|
const customer_corporate_profile_entity_1 = require("./customer_corporate_profile.entity");
|
|
18
|
-
const customer_ownership_entity_1 = require("./customer_ownership.entity");
|
|
19
18
|
const customer_contact_entity_1 = require("./customer_contact.entity");
|
|
20
19
|
const customer_address_entity_1 = require("./customer_address.entity");
|
|
21
20
|
const customer_identifier_entity_1 = require("./customer_identifier.entity");
|
|
21
|
+
const core_1 = require("../core");
|
|
22
22
|
let CustomerEntity = class CustomerEntity extends _base_entity_1._BaseEntity {
|
|
23
23
|
};
|
|
24
24
|
exports.CustomerEntity = CustomerEntity;
|
|
@@ -66,6 +66,14 @@ __decorate([
|
|
|
66
66
|
(0, typeorm_1.Column)({ type: "uuid", nullable: true, unique: true }),
|
|
67
67
|
__metadata("design:type", Object)
|
|
68
68
|
], CustomerEntity.prototype, "lead_id", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], CustomerEntity.prototype, "org_id", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], CustomerEntity.prototype, "created_by_org_staff_id", void 0);
|
|
69
77
|
__decorate([
|
|
70
78
|
(0, typeorm_1.OneToOne)(() => customer_individual_profile_entity_1.CustomerIndividualProfileEntity, (p) => p.customer, {
|
|
71
79
|
cascade: true,
|
|
@@ -78,12 +86,6 @@ __decorate([
|
|
|
78
86
|
}),
|
|
79
87
|
__metadata("design:type", customer_corporate_profile_entity_1.CustomerCorporateProfileEntity)
|
|
80
88
|
], CustomerEntity.prototype, "corporate_profile", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
(0, typeorm_1.OneToOne)(() => customer_ownership_entity_1.CustomerOwnershipEntity, (p) => p.customer, {
|
|
83
|
-
cascade: true,
|
|
84
|
-
}),
|
|
85
|
-
__metadata("design:type", customer_ownership_entity_1.CustomerOwnershipEntity)
|
|
86
|
-
], CustomerEntity.prototype, "ownership", void 0);
|
|
87
89
|
__decorate([
|
|
88
90
|
(0, typeorm_1.OneToMany)(() => customer_contact_entity_1.CustomerContactEntity, (c) => c.customer, { cascade: true }),
|
|
89
91
|
__metadata("design:type", Array)
|
|
@@ -98,6 +100,19 @@ __decorate([
|
|
|
98
100
|
}),
|
|
99
101
|
__metadata("design:type", Array)
|
|
100
102
|
], CustomerEntity.prototype, "identifiers", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.ManyToOne)(() => core_1.OrganizationEntity, { nullable: true, onDelete: "RESTRICT" }),
|
|
105
|
+
(0, typeorm_1.JoinColumn)({ name: "org_id" }),
|
|
106
|
+
__metadata("design:type", core_1.OrganizationEntity)
|
|
107
|
+
], CustomerEntity.prototype, "org", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.ManyToOne)(() => core_1.OrganizationStaffEntity, {
|
|
110
|
+
nullable: true,
|
|
111
|
+
onDelete: "SET NULL",
|
|
112
|
+
}),
|
|
113
|
+
(0, typeorm_1.JoinColumn)({ name: "created_by_org_staff_id" }),
|
|
114
|
+
__metadata("design:type", core_1.OrganizationStaffEntity)
|
|
115
|
+
], CustomerEntity.prototype, "created_by_org_staff", void 0);
|
|
101
116
|
exports.CustomerEntity = CustomerEntity = __decorate([
|
|
102
117
|
(0, typeorm_1.Entity)({ schema: "customer", name: "customers" })
|
|
103
118
|
], CustomerEntity);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _BaseEntity } from "../_base_entity";
|
|
2
2
|
import { CustomerEntity } from "./customer.entity";
|
|
3
3
|
import { Gender, MaritalStatus } from "../../types";
|
|
4
|
+
import { MaritalStatusEntity, NationalityEntity } from "../core";
|
|
4
5
|
export declare class CustomerIndividualProfileEntity extends _BaseEntity {
|
|
5
6
|
id: string;
|
|
6
7
|
customer_id: string;
|
|
@@ -14,4 +15,6 @@ export declare class CustomerIndividualProfileEntity extends _BaseEntity {
|
|
|
14
15
|
nationality_id?: string | null;
|
|
15
16
|
occupation_id?: string | null;
|
|
16
17
|
customer: CustomerEntity;
|
|
18
|
+
marital_status?: MaritalStatusEntity;
|
|
19
|
+
nationality?: NationalityEntity;
|
|
17
20
|
}
|
|
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
|
|
|
14
14
|
const _base_entity_1 = require("../_base_entity");
|
|
15
15
|
const customer_entity_1 = require("./customer.entity");
|
|
16
16
|
const types_1 = require("../../types");
|
|
17
|
+
const core_1 = require("../core");
|
|
17
18
|
let CustomerIndividualProfileEntity = class CustomerIndividualProfileEntity extends _base_entity_1._BaseEntity {
|
|
18
19
|
};
|
|
19
20
|
exports.CustomerIndividualProfileEntity = CustomerIndividualProfileEntity;
|
|
@@ -69,6 +70,22 @@ __decorate([
|
|
|
69
70
|
(0, typeorm_1.JoinColumn)({ name: "customer_id" }),
|
|
70
71
|
__metadata("design:type", customer_entity_1.CustomerEntity)
|
|
71
72
|
], CustomerIndividualProfileEntity.prototype, "customer", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.ManyToOne)(() => core_1.MaritalStatusEntity, {
|
|
75
|
+
nullable: true,
|
|
76
|
+
onDelete: "RESTRICT",
|
|
77
|
+
}),
|
|
78
|
+
(0, typeorm_1.JoinColumn)({ name: "marital_status_id" }),
|
|
79
|
+
__metadata("design:type", core_1.MaritalStatusEntity)
|
|
80
|
+
], CustomerIndividualProfileEntity.prototype, "marital_status", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.ManyToOne)(() => core_1.NationalityEntity, {
|
|
83
|
+
nullable: true,
|
|
84
|
+
onDelete: "RESTRICT",
|
|
85
|
+
}),
|
|
86
|
+
(0, typeorm_1.JoinColumn)({ name: "nationality_id" }),
|
|
87
|
+
__metadata("design:type", core_1.NationalityEntity)
|
|
88
|
+
], CustomerIndividualProfileEntity.prototype, "nationality", void 0);
|
|
72
89
|
exports.CustomerIndividualProfileEntity = CustomerIndividualProfileEntity = __decorate([
|
|
73
90
|
(0, typeorm_1.Entity)({ schema: "customer", name: "customer_individual_profiles" })
|
|
74
91
|
], CustomerIndividualProfileEntity);
|
|
@@ -4,6 +4,5 @@ import { CustomerContactEntity } from "./customer_contact.entity";
|
|
|
4
4
|
import { CustomerCorporateProfileEntity } from "./customer_corporate_profile.entity";
|
|
5
5
|
import { CustomerIdentifierEntity } from "./customer_identifier.entity";
|
|
6
6
|
import { CustomerIndividualProfileEntity } from "./customer_individual_profile.entity";
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export { CustomerEntity, CustomerAddressEntity, CustomerContactEntity, CustomerCorporateProfileEntity, CustomerIdentifierEntity, CustomerIndividualProfileEntity, CustomerOwnershipEntity, };
|
|
7
|
+
export declare const CUSTOMER_ENTITIES: readonly [typeof CustomerEntity, typeof CustomerAddressEntity, typeof CustomerContactEntity, typeof CustomerCorporateProfileEntity, typeof CustomerIdentifierEntity, typeof CustomerIndividualProfileEntity];
|
|
8
|
+
export { CustomerEntity, CustomerAddressEntity, CustomerContactEntity, CustomerCorporateProfileEntity, CustomerIdentifierEntity, CustomerIndividualProfileEntity, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CustomerIndividualProfileEntity = exports.CustomerIdentifierEntity = exports.CustomerCorporateProfileEntity = exports.CustomerContactEntity = exports.CustomerAddressEntity = exports.CustomerEntity = exports.CUSTOMER_ENTITIES = void 0;
|
|
4
4
|
const customer_entity_1 = require("./customer.entity");
|
|
5
5
|
Object.defineProperty(exports, "CustomerEntity", { enumerable: true, get: function () { return customer_entity_1.CustomerEntity; } });
|
|
6
6
|
const customer_address_entity_1 = require("./customer_address.entity");
|
|
@@ -13,8 +13,6 @@ const customer_identifier_entity_1 = require("./customer_identifier.entity");
|
|
|
13
13
|
Object.defineProperty(exports, "CustomerIdentifierEntity", { enumerable: true, get: function () { return customer_identifier_entity_1.CustomerIdentifierEntity; } });
|
|
14
14
|
const customer_individual_profile_entity_1 = require("./customer_individual_profile.entity");
|
|
15
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
16
|
exports.CUSTOMER_ENTITIES = [
|
|
19
17
|
customer_entity_1.CustomerEntity,
|
|
20
18
|
customer_address_entity_1.CustomerAddressEntity,
|
|
@@ -22,5 +20,4 @@ exports.CUSTOMER_ENTITIES = [
|
|
|
22
20
|
customer_corporate_profile_entity_1.CustomerCorporateProfileEntity,
|
|
23
21
|
customer_identifier_entity_1.CustomerIdentifierEntity,
|
|
24
22
|
customer_individual_profile_entity_1.CustomerIndividualProfileEntity,
|
|
25
|
-
customer_ownership_entity_1.CustomerOwnershipEntity,
|
|
26
23
|
];
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
partner_id?: string;
|
|
7
|
-
created_by_staff_id?: string;
|
|
8
|
-
customer: CustomerEntity;
|
|
9
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
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.Column)({ type: "uuid", nullable: true }),
|
|
30
|
-
(0, typeorm_1.Index)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], CustomerOwnershipEntity.prototype, "partner_id", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
35
|
-
(0, typeorm_1.Index)(),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], CustomerOwnershipEntity.prototype, "created_by_staff_id", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.OneToOne)(() => customer_entity_1.CustomerEntity, (c) => c.ownership, { onDelete: "CASCADE" }),
|
|
40
|
-
(0, typeorm_1.JoinColumn)({ name: "customer_id" }),
|
|
41
|
-
__metadata("design:type", customer_entity_1.CustomerEntity)
|
|
42
|
-
], CustomerOwnershipEntity.prototype, "customer", void 0);
|
|
43
|
-
exports.CustomerOwnershipEntity = CustomerOwnershipEntity = __decorate([
|
|
44
|
-
(0, typeorm_1.Entity)({ schema: "customer", name: "customer_ownerships" }),
|
|
45
|
-
(0, typeorm_1.Index)(["partner_id", "customer_id"], { unique: true })
|
|
46
|
-
], CustomerOwnershipEntity);
|