plac-micro-common 1.3.61 → 1.3.63

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.
@@ -5,6 +5,7 @@ import { CustomerCorporateProfileEntity } from "./customer_corporate_profile.ent
5
5
  import { CustomerContactEntity } from "./customer_contact.entity";
6
6
  import { CustomerAddressEntity } from "./customer_address.entity";
7
7
  import { CustomerIdentifierEntity } from "./customer_identifier.entity";
8
+ import { CustomerEmploymentEntity } from "./customer_employment.entity";
8
9
  import { OrganizationEntity, OrganizationStaffEntity } from "../core";
9
10
  export declare class CustomerEntity extends _BaseEntity {
10
11
  id: string;
@@ -24,6 +25,7 @@ export declare class CustomerEntity extends _BaseEntity {
24
25
  contacts?: CustomerContactEntity[];
25
26
  addresses?: CustomerAddressEntity[];
26
27
  identifiers?: CustomerIdentifierEntity[];
28
+ employments?: CustomerEmploymentEntity[];
27
29
  org?: OrganizationEntity;
28
30
  created_by_org_staff?: OrganizationStaffEntity;
29
31
  }
@@ -18,6 +18,7 @@ const customer_corporate_profile_entity_1 = require("./customer_corporate_profil
18
18
  const customer_contact_entity_1 = require("./customer_contact.entity");
19
19
  const customer_address_entity_1 = require("./customer_address.entity");
20
20
  const customer_identifier_entity_1 = require("./customer_identifier.entity");
21
+ const customer_employment_entity_1 = require("./customer_employment.entity");
21
22
  const core_1 = require("../core");
22
23
  const utils_1 = require("../../utils");
23
24
  let CustomerEntity = class CustomerEntity extends _base_entity_1._BaseEntity {
@@ -110,6 +111,12 @@ __decorate([
110
111
  }),
111
112
  __metadata("design:type", Array)
112
113
  ], CustomerEntity.prototype, "identifiers", void 0);
114
+ __decorate([
115
+ (0, typeorm_1.OneToMany)(() => customer_employment_entity_1.CustomerEmploymentEntity, (e) => e.customer, {
116
+ cascade: true,
117
+ }),
118
+ __metadata("design:type", Array)
119
+ ], CustomerEntity.prototype, "employments", void 0);
113
120
  __decorate([
114
121
  (0, typeorm_1.ManyToOne)(() => core_1.OrganizationEntity, { nullable: true, onDelete: "RESTRICT" }),
115
122
  (0, typeorm_1.JoinColumn)({ name: "org_id" }),
@@ -0,0 +1,27 @@
1
+ import { _BaseEntity } from "../_base_entity";
2
+ import { CustomerEntity } from "./customer.entity";
3
+ import { GeoCommuneEntity, GeoDistrictEntity, GeoProvinceEntity, GeoVillageEntity, OccupationEntity } from "../core";
4
+ export declare class CustomerEmploymentEntity extends _BaseEntity {
5
+ id: string;
6
+ customer_id: string;
7
+ occupation_id?: string | null;
8
+ occupation_detail?: string | null;
9
+ employer_full_name?: string | null;
10
+ employer_full_name_kh?: string | null;
11
+ employer_full_address?: string | null;
12
+ employer_full_address_kh?: string | null;
13
+ address_line?: string | null;
14
+ address_line_kh?: string | null;
15
+ province_id?: string | null;
16
+ district_id?: string | null;
17
+ commune_id?: string | null;
18
+ village_id?: string | null;
19
+ phone?: string | null;
20
+ is_primary: boolean;
21
+ customer: CustomerEntity;
22
+ occupation?: OccupationEntity | null;
23
+ province?: GeoProvinceEntity | null;
24
+ district?: GeoDistrictEntity | null;
25
+ commune?: GeoCommuneEntity | null;
26
+ village?: GeoVillageEntity | null;
27
+ }
@@ -0,0 +1,119 @@
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.CustomerEmploymentEntity = 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 core_1 = require("../core");
17
+ let CustomerEmploymentEntity = class CustomerEmploymentEntity extends _base_entity_1._BaseEntity {
18
+ };
19
+ exports.CustomerEmploymentEntity = CustomerEmploymentEntity;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
22
+ __metadata("design:type", String)
23
+ ], CustomerEmploymentEntity.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: "uuid" }),
26
+ (0, typeorm_1.Index)(),
27
+ __metadata("design:type", String)
28
+ ], CustomerEmploymentEntity.prototype, "customer_id", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
31
+ __metadata("design:type", Object)
32
+ ], CustomerEmploymentEntity.prototype, "occupation_id", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
35
+ __metadata("design:type", Object)
36
+ ], CustomerEmploymentEntity.prototype, "occupation_detail", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ type: "varchar", length: 300, nullable: true }),
39
+ __metadata("design:type", Object)
40
+ ], CustomerEmploymentEntity.prototype, "employer_full_name", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: "varchar", length: 300, nullable: true }),
43
+ __metadata("design:type", Object)
44
+ ], CustomerEmploymentEntity.prototype, "employer_full_name_kh", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
47
+ __metadata("design:type", Object)
48
+ ], CustomerEmploymentEntity.prototype, "employer_full_address", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
51
+ __metadata("design:type", Object)
52
+ ], CustomerEmploymentEntity.prototype, "employer_full_address_kh", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: "varchar", length: 250, nullable: true }),
55
+ __metadata("design:type", Object)
56
+ ], CustomerEmploymentEntity.prototype, "address_line", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ type: "varchar", length: 250, nullable: true }),
59
+ __metadata("design:type", Object)
60
+ ], CustomerEmploymentEntity.prototype, "address_line_kh", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
63
+ __metadata("design:type", Object)
64
+ ], CustomerEmploymentEntity.prototype, "province_id", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
67
+ __metadata("design:type", Object)
68
+ ], CustomerEmploymentEntity.prototype, "district_id", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
71
+ __metadata("design:type", Object)
72
+ ], CustomerEmploymentEntity.prototype, "commune_id", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
75
+ __metadata("design:type", Object)
76
+ ], CustomerEmploymentEntity.prototype, "village_id", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
79
+ __metadata("design:type", Object)
80
+ ], CustomerEmploymentEntity.prototype, "phone", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({ type: "bool", default: false }),
83
+ __metadata("design:type", Boolean)
84
+ ], CustomerEmploymentEntity.prototype, "is_primary", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (c) => c.employments, {
87
+ onDelete: "CASCADE",
88
+ }),
89
+ (0, typeorm_1.JoinColumn)({ name: "customer_id" }),
90
+ __metadata("design:type", customer_entity_1.CustomerEntity)
91
+ ], CustomerEmploymentEntity.prototype, "customer", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.ManyToOne)(() => core_1.OccupationEntity, { nullable: true, onDelete: "RESTRICT" }),
94
+ (0, typeorm_1.JoinColumn)({ name: "occupation_id" }),
95
+ __metadata("design:type", Object)
96
+ ], CustomerEmploymentEntity.prototype, "occupation", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.ManyToOne)(() => core_1.GeoProvinceEntity, { nullable: true, onDelete: "SET NULL" }),
99
+ (0, typeorm_1.JoinColumn)({ name: "province_id" }),
100
+ __metadata("design:type", Object)
101
+ ], CustomerEmploymentEntity.prototype, "province", void 0);
102
+ __decorate([
103
+ (0, typeorm_1.ManyToOne)(() => core_1.GeoDistrictEntity, { nullable: true, onDelete: "SET NULL" }),
104
+ (0, typeorm_1.JoinColumn)({ name: "district_id" }),
105
+ __metadata("design:type", Object)
106
+ ], CustomerEmploymentEntity.prototype, "district", void 0);
107
+ __decorate([
108
+ (0, typeorm_1.ManyToOne)(() => core_1.GeoCommuneEntity, { nullable: true, onDelete: "SET NULL" }),
109
+ (0, typeorm_1.JoinColumn)({ name: "commune_id" }),
110
+ __metadata("design:type", Object)
111
+ ], CustomerEmploymentEntity.prototype, "commune", void 0);
112
+ __decorate([
113
+ (0, typeorm_1.ManyToOne)(() => core_1.GeoVillageEntity, { nullable: true, onDelete: "SET NULL" }),
114
+ (0, typeorm_1.JoinColumn)({ name: "village_id" }),
115
+ __metadata("design:type", Object)
116
+ ], CustomerEmploymentEntity.prototype, "village", void 0);
117
+ exports.CustomerEmploymentEntity = CustomerEmploymentEntity = __decorate([
118
+ (0, typeorm_1.Entity)({ schema: "customer", name: "customer_employments" })
119
+ ], CustomerEmploymentEntity);
@@ -4,5 +4,6 @@ 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
- 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, };
7
+ import { CustomerEmploymentEntity } from "./customer_employment.entity";
8
+ export declare const CUSTOMER_ENTITIES: readonly [typeof CustomerEntity, typeof CustomerAddressEntity, typeof CustomerContactEntity, typeof CustomerCorporateProfileEntity, typeof CustomerIdentifierEntity, typeof CustomerIndividualProfileEntity, typeof CustomerEmploymentEntity];
9
+ export { CustomerEntity, CustomerAddressEntity, CustomerContactEntity, CustomerCorporateProfileEntity, CustomerIdentifierEntity, CustomerIndividualProfileEntity, CustomerEmploymentEntity, };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomerIndividualProfileEntity = exports.CustomerIdentifierEntity = exports.CustomerCorporateProfileEntity = exports.CustomerContactEntity = exports.CustomerAddressEntity = exports.CustomerEntity = exports.CUSTOMER_ENTITIES = void 0;
3
+ exports.CustomerEmploymentEntity = 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,6 +13,8 @@ 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_employment_entity_1 = require("./customer_employment.entity");
17
+ Object.defineProperty(exports, "CustomerEmploymentEntity", { enumerable: true, get: function () { return customer_employment_entity_1.CustomerEmploymentEntity; } });
16
18
  exports.CUSTOMER_ENTITIES = [
17
19
  customer_entity_1.CustomerEntity,
18
20
  customer_address_entity_1.CustomerAddressEntity,
@@ -20,4 +22,5 @@ exports.CUSTOMER_ENTITIES = [
20
22
  customer_corporate_profile_entity_1.CustomerCorporateProfileEntity,
21
23
  customer_identifier_entity_1.CustomerIdentifierEntity,
22
24
  customer_individual_profile_entity_1.CustomerIndividualProfileEntity,
25
+ customer_employment_entity_1.CustomerEmploymentEntity,
23
26
  ];
@@ -20,6 +20,8 @@ export declare const PermissionResource: {
20
20
  readonly Channel: "channel";
21
21
  readonly Customer: "customer";
22
22
  readonly Department: "department";
23
+ readonly ExchangeRate: "exchange_rate";
24
+ readonly Finance: "finance";
23
25
  readonly Dashboard: "dashboard";
24
26
  readonly Menu: "menu";
25
27
  readonly Organization: "organization";
@@ -24,6 +24,8 @@ exports.PermissionResource = {
24
24
  Channel: "channel",
25
25
  Customer: "customer",
26
26
  Department: "department",
27
+ ExchangeRate: "exchange_rate",
28
+ Finance: "finance",
27
29
  Dashboard: "dashboard",
28
30
  Menu: "menu",
29
31
  Organization: "organization",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.61",
3
+ "version": "1.3.63",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {