plac-micro-common 1.2.45 → 1.2.46

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.
@@ -19,6 +19,7 @@ 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
21
  const core_1 = require("../core");
22
+ const utils_1 = require("../../utils");
22
23
  let CustomerEntity = class CustomerEntity extends _base_entity_1._BaseEntity {
23
24
  };
24
25
  exports.CustomerEntity = CustomerEntity;
@@ -43,12 +44,21 @@ __decorate([
43
44
  __metadata("design:type", Object)
44
45
  ], CustomerEntity.prototype, "full_name_kh", void 0);
45
46
  __decorate([
46
- (0, typeorm_1.Column)({ type: "varchar", length: 20 }),
47
+ (0, typeorm_1.Column)({
48
+ type: "varchar",
49
+ length: 20,
50
+ comment: (0, utils_1.enumToCommentString)(types_1.CustomerType),
51
+ }),
47
52
  (0, typeorm_1.Index)(),
48
53
  __metadata("design:type", String)
49
54
  ], CustomerEntity.prototype, "type", void 0);
50
55
  __decorate([
51
- (0, typeorm_1.Column)({ type: "varchar", length: 20, default: types_1.CustomerStatus.Active }),
56
+ (0, typeorm_1.Column)({
57
+ type: "varchar",
58
+ length: 20,
59
+ default: types_1.CustomerStatus.Active,
60
+ comment: (0, utils_1.enumToCommentString)(types_1.CustomerStatus),
61
+ }),
52
62
  (0, typeorm_1.Index)(),
53
63
  __metadata("design:type", String)
54
64
  ], CustomerEntity.prototype, "status", void 0);
@@ -1,10 +1,11 @@
1
1
  import { _BaseEntity } from "../_base_entity";
2
2
  import { CustomerEntity } from "./customer.entity";
3
3
  import { GeoCommuneEntity, GeoDistrictEntity, GeoProvinceEntity, GeoVillageEntity } from "../core";
4
+ import { AddressType } from "../../types";
4
5
  export declare class CustomerAddressEntity extends _BaseEntity {
5
6
  id: string;
6
7
  customer_id: string;
7
- address_type: string;
8
+ address_type: AddressType;
8
9
  label?: string | null;
9
10
  full_address: string;
10
11
  full_address_kh?: string;
@@ -14,6 +14,8 @@ 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 core_1 = require("../core");
17
+ const types_1 = require("../../types");
18
+ const utils_1 = require("../../utils");
17
19
  let CustomerAddressEntity = class CustomerAddressEntity extends _base_entity_1._BaseEntity {
18
20
  };
19
21
  exports.CustomerAddressEntity = CustomerAddressEntity;
@@ -27,7 +29,11 @@ __decorate([
27
29
  __metadata("design:type", String)
28
30
  ], CustomerAddressEntity.prototype, "customer_id", void 0);
29
31
  __decorate([
30
- (0, typeorm_1.Column)({ type: "varchar", length: 30 }),
32
+ (0, typeorm_1.Column)({
33
+ type: "varchar",
34
+ length: 30,
35
+ comment: (0, utils_1.enumToCommentString)(types_1.AddressType),
36
+ }),
31
37
  __metadata("design:type", String)
32
38
  ], CustomerAddressEntity.prototype, "address_type", void 0);
33
39
  __decorate([
@@ -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 utils_1 = require("../../utils");
17
18
  let CustomerContactEntity = class CustomerContactEntity extends _base_entity_1._BaseEntity {
18
19
  };
19
20
  exports.CustomerContactEntity = CustomerContactEntity;
@@ -27,7 +28,11 @@ __decorate([
27
28
  __metadata("design:type", String)
28
29
  ], CustomerContactEntity.prototype, "customer_id", void 0);
29
30
  __decorate([
30
- (0, typeorm_1.Column)({ type: "varchar", length: 20 }),
31
+ (0, typeorm_1.Column)({
32
+ type: "varchar",
33
+ length: 20,
34
+ comment: (0, utils_1.enumToCommentString)(types_1.ContactType),
35
+ }),
31
36
  __metadata("design:type", String)
32
37
  ], CustomerContactEntity.prototype, "contact_type", void 0);
33
38
  __decorate([
@@ -8,6 +8,6 @@ export declare class CustomerCorporateProfileEntity extends _BaseEntity {
8
8
  company_registration_no?: string | null;
9
9
  tax_id?: string | null;
10
10
  industry?: string | null;
11
- incorporation_date?: Date | null;
11
+ incorporation_date?: string | null;
12
12
  customer: CustomerEntity;
13
13
  }
@@ -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 utils_1 = require("../../utils");
17
18
  let CustomerIdentifierEntity = class CustomerIdentifierEntity extends _base_entity_1._BaseEntity {
18
19
  };
19
20
  exports.CustomerIdentifierEntity = CustomerIdentifierEntity;
@@ -27,7 +28,11 @@ __decorate([
27
28
  __metadata("design:type", String)
28
29
  ], CustomerIdentifierEntity.prototype, "customer_id", void 0);
29
30
  __decorate([
30
- (0, typeorm_1.Column)({ type: "varchar", length: 30 }),
31
+ (0, typeorm_1.Column)({
32
+ type: "varchar",
33
+ length: 30,
34
+ comment: (0, utils_1.enumToCommentString)(types_1.IdentifierType),
35
+ }),
31
36
  __metadata("design:type", String)
32
37
  ], CustomerIdentifierEntity.prototype, "identifier_type", void 0);
33
38
  __decorate([
@@ -15,6 +15,7 @@ const _base_entity_1 = require("../_base_entity");
15
15
  const customer_entity_1 = require("./customer.entity");
16
16
  const types_1 = require("../../types");
17
17
  const core_1 = require("../core");
18
+ const utils_1 = require("../../utils");
18
19
  let CustomerIndividualProfileEntity = class CustomerIndividualProfileEntity extends _base_entity_1._BaseEntity {
19
20
  };
20
21
  exports.CustomerIndividualProfileEntity = CustomerIndividualProfileEntity;
@@ -48,7 +49,12 @@ __decorate([
48
49
  __metadata("design:type", Object)
49
50
  ], CustomerIndividualProfileEntity.prototype, "date_of_birth", void 0);
50
51
  __decorate([
51
- (0, typeorm_1.Column)({ type: "varchar", length: 5, nullable: true }),
52
+ (0, typeorm_1.Column)({
53
+ type: "varchar",
54
+ length: 5,
55
+ nullable: true,
56
+ comment: (0, utils_1.enumToCommentString)(types_1.Gender),
57
+ }),
52
58
  __metadata("design:type", String)
53
59
  ], CustomerIndividualProfileEntity.prototype, "gender", void 0);
54
60
  __decorate([
@@ -0,0 +1 @@
1
+ export declare function enumToCommentString(enumObj: Record<string, string | number>): string;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.enumToCommentString = enumToCommentString;
4
+ function enumToCommentString(enumObj) {
5
+ const entries = [];
6
+ for (const [key, value] of Object.entries(enumObj)) {
7
+ if (typeof value === "number") {
8
+ entries.push(`${value}=${key}`);
9
+ }
10
+ }
11
+ return entries.join(", ");
12
+ }
@@ -1,4 +1,5 @@
1
- export * from './frontend';
1
+ export * from "./frontend";
2
+ export * from "./general.util";
2
3
  export * from "./http.util";
3
4
  export * from "./query.util";
4
5
  export * from "./pagination.util";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./frontend"), exports);
18
+ __exportStar(require("./general.util"), exports);
18
19
  __exportStar(require("./http.util"), exports);
19
20
  __exportStar(require("./query.util"), exports);
20
21
  __exportStar(require("./pagination.util"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.2.45",
3
+ "version": "1.2.46",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {