@merkaly/api 0.2.1-5 → 0.2.1

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.
@@ -1,10 +1,12 @@
1
- import { Id } from '@elastic/elasticsearch/lib/api/types';
2
1
  import { AppDocument } from '../../../config/app.document';
2
+ import { BrandEntity } from '../brands/brand.entity';
3
+ import { CategoryEntity } from '../categories/category.entity';
3
4
  import { ProductEntity } from './product.entity';
4
5
  export declare class ProductDocument extends AppDocument<ProductEntity> {
5
6
  name: string;
6
7
  description: string;
7
- category: Id;
8
- brand: Id;
8
+ category: Pick<CategoryEntity, 'id' | 'name' | 'description'>;
9
+ brand: Pick<BrandEntity, 'id' | 'name' | 'description'>;
10
+ price: number;
9
11
  protected transform?(entity: ProductEntity): this;
10
12
  }
@@ -6,6 +6,7 @@ import { VariantEntity } from '../variants/variant.entity';
6
6
  export declare class ProductEntity extends AppEntity {
7
7
  name: string;
8
8
  description?: string;
9
+ price: number;
9
10
  category?: CategoryEntity;
10
11
  brand?: BrandEntity;
11
12
  variants: VariantEntity[];
@@ -5,6 +5,7 @@ import { ProductEntity } from './product.entity';
5
5
  export declare class CreateProductValidator extends AppValidator<ProductEntity> {
6
6
  name: string;
7
7
  description?: string;
8
+ price: number;
8
9
  category?: string;
9
10
  brand?: string;
10
11
  variants?: CreateVariantValidator[];
@@ -13,6 +14,7 @@ export declare class CreateProductValidator extends AppValidator<ProductEntity>
13
14
  export declare class UpdateProductValidator extends AppValidator<ProductEntity> {
14
15
  name?: string;
15
16
  description?: string;
17
+ price: number;
16
18
  category?: Id;
17
19
  brand?: Id;
18
20
  toEntity?(entity: ProductEntity): ProductEntity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.1-5",
3
+ "version": "0.2.1",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "author": "Randy Tellez Galan <kronhyx@gmail.com>",
6
6
  "license": "UNLICENSED",
@@ -18,7 +18,7 @@
18
18
  "clean": "tsc -b --clean",
19
19
  "start": "nest start --preserveWatchOutput",
20
20
  "dev": "yarn build && yarn start --watch",
21
- "start:debug": "yarn dev -- --debug ",
21
+ "console": "ts-node -r tsconfig-paths/register ./console.ts",
22
22
  "start:prod": "node dist/index.js",
23
23
  "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" . ",
24
24
  "test": "jest",
@@ -71,6 +71,7 @@
71
71
  "husky": "^8.0.1",
72
72
  "jest": "27.5.1",
73
73
  "mysql2": "^2.3.3",
74
+ "nestjs-console": "^7.0.1",
74
75
  "passport": "^0.6.0",
75
76
  "passport-jwt": "^4.0.0",
76
77
  "rimraf": "^3.0.2",