plac-micro-common 1.1.10 → 1.1.11

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.
@@ -8,7 +8,7 @@ function flattenValidationErrors(validationErrors = []) {
8
8
  const walk = (err, parentPath = "") => {
9
9
  const path = parentPath ? `${parentPath}.${err.property}` : err.property;
10
10
  if (err.constraints) {
11
- errors[path] ?? (errors[path] = []);
11
+ errors[path] ??= [];
12
12
  errors[path].push(...Object.values(err.constraints));
13
13
  }
14
14
  if (err.children?.length) {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./http";
2
+ export * from "./models";
2
3
  export * from "./types";
3
4
  export * from "./utils";
package/dist/index.js CHANGED
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./http"), exports);
18
+ __exportStar(require("./models"), exports);
18
19
  __exportStar(require("./types"), exports);
19
20
  __exportStar(require("./utils"), exports);
@@ -0,0 +1,6 @@
1
+ export declare abstract class _BaseEntity {
2
+ created_by?: string | null;
3
+ updated_by?: string | null;
4
+ created_at: Date;
5
+ updated_at: Date;
6
+ }
@@ -0,0 +1,32 @@
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._BaseEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ class _BaseEntity {
15
+ }
16
+ exports._BaseEntity = _BaseEntity;
17
+ __decorate([
18
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
19
+ __metadata("design:type", Object)
20
+ ], _BaseEntity.prototype, "created_by", void 0);
21
+ __decorate([
22
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
23
+ __metadata("design:type", Object)
24
+ ], _BaseEntity.prototype, "updated_by", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.CreateDateColumn)(),
27
+ __metadata("design:type", Date)
28
+ ], _BaseEntity.prototype, "created_at", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.UpdateDateColumn)(),
31
+ __metadata("design:type", Date)
32
+ ], _BaseEntity.prototype, "updated_at", void 0);
@@ -0,0 +1,8 @@
1
+ import { _BaseEntity } from "./_base_entity";
2
+ export declare abstract class _BaseGeneralEntity extends _BaseEntity {
3
+ id: string;
4
+ name: string;
5
+ name_kh?: string | null;
6
+ description?: string | null;
7
+ is_active: boolean;
8
+ }
@@ -0,0 +1,37 @@
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._BaseGeneralEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("./_base_entity");
15
+ class _BaseGeneralEntity extends _base_entity_1._BaseEntity {
16
+ }
17
+ exports._BaseGeneralEntity = _BaseGeneralEntity;
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
20
+ __metadata("design:type", String)
21
+ ], _BaseGeneralEntity.prototype, "id", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ type: "varchar", length: 255 }),
24
+ __metadata("design:type", String)
25
+ ], _BaseGeneralEntity.prototype, "name", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
28
+ __metadata("design:type", Object)
29
+ ], _BaseGeneralEntity.prototype, "name_kh", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
32
+ __metadata("design:type", Object)
33
+ ], _BaseGeneralEntity.prototype, "description", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: "boolean", default: true }),
36
+ __metadata("design:type", Boolean)
37
+ ], _BaseGeneralEntity.prototype, "is_active", void 0);
@@ -0,0 +1,6 @@
1
+ import { _BaseEntity } from "./_base_entity";
2
+ export declare abstract class _baseOwnershipEntity extends _BaseEntity {
3
+ partner_id?: string;
4
+ staff_id?: string | null;
5
+ branch_id?: string | null;
6
+ }
@@ -0,0 +1,32 @@
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._baseOwnershipEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const _base_entity_1 = require("./_base_entity");
15
+ class _baseOwnershipEntity extends _base_entity_1._BaseEntity {
16
+ }
17
+ exports._baseOwnershipEntity = _baseOwnershipEntity;
18
+ __decorate([
19
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
20
+ (0, typeorm_1.Index)(),
21
+ __metadata("design:type", String)
22
+ ], _baseOwnershipEntity.prototype, "partner_id", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
25
+ (0, typeorm_1.Index)(),
26
+ __metadata("design:type", Object)
27
+ ], _baseOwnershipEntity.prototype, "staff_id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: "uuid", nullable: true }),
30
+ (0, typeorm_1.Index)(),
31
+ __metadata("design:type", Object)
32
+ ], _baseOwnershipEntity.prototype, "branch_id", void 0);
@@ -0,0 +1,3 @@
1
+ export * from "./_base_entity";
2
+ export * from "./_base_general_entity";
3
+ export * from "./_base_ownership_entity";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./_base_entity"), exports);
18
+ __exportStar(require("./_base_general_entity"), exports);
19
+ __exportStar(require("./_base_ownership_entity"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -30,6 +30,7 @@
30
30
  "@nestjs/common": "^11.1.9",
31
31
  "@nestjs/core": "^11.1.9",
32
32
  "express": "^5.2.1",
33
- "jsonwebtoken": "^9.0.3"
33
+ "jsonwebtoken": "^9.0.3",
34
+ "typeorm": "^0.3.28"
34
35
  }
35
36
  }