@merkaly/api 0.2.2-4 → 0.2.2-7

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,8 +1,8 @@
1
- import { Document, Types } from 'mongoose';
2
- export declare type ObjectRef<T> = T | Types.ObjectId;
1
+ import { Document } from 'mongoose';
3
2
  export declare abstract class AppEntity extends Document {
4
3
  static $index: string;
4
+ readonly _id = "";
5
5
  readonly createdAt: Date;
6
- updatedAt?: Date;
7
- deletedAt?: Date;
6
+ readonly updatedAt?: Date;
7
+ readonly deletedAt?: Date;
8
8
  }
@@ -1,4 +1,4 @@
1
- import { AppEntity, ObjectRef } from '../../../configs/app.entity';
1
+ import { AppEntity } from '../../../configs/app.entity';
2
2
  import { AssetEntity } from '../../assets/asset.entity';
3
3
  import { BrandEntity } from '../brands/brand.entity';
4
4
  import { CategoryEntity } from '../categories/category.entity';
@@ -7,7 +7,7 @@ export declare class ProductEntity extends AppEntity {
7
7
  name: string;
8
8
  description: string;
9
9
  price: number;
10
- category?: ObjectRef<CategoryEntity>;
11
- brand?: ObjectRef<BrandEntity>;
10
+ category?: CategoryEntity;
11
+ brand?: BrandEntity;
12
12
  files: AssetEntity[];
13
13
  }
@@ -1,10 +1,11 @@
1
+ import { AssetEntity } from '../../assets/asset.entity';
1
2
  export declare class CreateProductValidator {
2
3
  name: string;
3
4
  description?: string;
4
5
  price: number;
5
6
  category?: string;
6
7
  brand?: string;
7
- files: any[];
8
+ files: AssetEntity[];
8
9
  }
9
10
  export declare class UpdateProductValidator {
10
11
  name?: string;
@@ -0,0 +1,13 @@
1
+ import { AppEntity } from '../../../configs/app.entity';
2
+ import { ProductEntity } from '../../inventory/products/product.entity';
3
+ import { CartStatus } from './cart.validator';
4
+ export declare class CartItemEntity {
5
+ quantity: number;
6
+ product: ProductEntity;
7
+ }
8
+ export declare class CartEntity extends AppEntity {
9
+ static readonly $index = "store_carts";
10
+ user: string;
11
+ status: CartStatus;
12
+ items: CartItemEntity[];
13
+ }
@@ -1,3 +1,9 @@
1
+ export declare enum CartStatus {
2
+ EMPTY = "EMPTY",
3
+ FILLED = "FILLED",
4
+ FINISHED = "FINISHED",
5
+ ABANDONED = "ABANDONED"
6
+ }
1
7
  export declare class CreateCartValidator {
2
8
  user: string;
3
9
  }
@@ -1,6 +1,12 @@
1
1
  import { AppEntity } from '../../../configs/app.entity';
2
+ import { CartEntity } from '../cart/cart.entity';
3
+ import { BillingValidator, OrderStatus } from './order.validator';
2
4
  export declare class OrderEntity extends AppEntity {
3
5
  static readonly $index = "store_orders";
6
+ status: OrderStatus;
4
7
  number: string;
5
- price: number;
8
+ cart?: CartEntity;
9
+ user: string;
10
+ subtotal: number;
11
+ billing?: BillingValidator;
6
12
  }
@@ -1,4 +1,22 @@
1
+ export declare enum OrderStatus {
2
+ PROCESSING = "PROCESSING",
3
+ APPROVED = "APPROVED",
4
+ IN_PROGRESS = "IN_PROGRESS",
5
+ COMPLETED = "COMPLETED",
6
+ CANCELED = "CANCELED"
7
+ }
8
+ export declare class BillingValidator {
9
+ firstName: string;
10
+ lastName: string;
11
+ emailAddress: string;
12
+ phoneNumber: string;
13
+ lineAddress: string;
14
+ zipCode: string;
15
+ notes: string;
16
+ }
1
17
  export declare class CreateOrderValidator {
18
+ cart: string;
19
+ billing: any;
2
20
  }
3
21
  export declare class UpdateOrderValidator {
4
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.2-4",
3
+ "version": "0.2.2-7",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,12 +34,12 @@
34
34
  "@types/auth0": "^2.35.2",
35
35
  "class-transformer": "^0.5.1",
36
36
  "class-validator": "^0.13.1",
37
- "mongoose": "^6.5.1",
38
37
  "reflect-metadata": "^0.1.13",
39
- "short-uuid": "^4.2.0"
38
+ "short-unique-id": "^4.4.4"
40
39
  },
41
40
  "devDependencies": {
42
41
  "@commitlint/config-conventional": "^17.0.0",
42
+ "@faker-js/faker": "^7.5.0",
43
43
  "@google-cloud/storage": "^6.4.1",
44
44
  "@nestjs/cli": "^9.1.1",
45
45
  "@nestjs/common": "^9.0.11",
@@ -54,7 +54,6 @@
54
54
  "@nestjs/testing": "^9.0.11",
55
55
  "@types/cache-manager": "^4.0.1",
56
56
  "@types/express": "^4.17.12",
57
- "@types/faker": "^5.5.9",
58
57
  "@types/jest": "^27.0.0",
59
58
  "@types/multer": "^1.4.7",
60
59
  "@types/node": "^18.0.0",
@@ -70,9 +69,9 @@
70
69
  "eslint": "7.32.0",
71
70
  "eslint-plugin-import": "^2.23.4",
72
71
  "express": "^4.17.3",
73
- "faker": "^5.5.3",
74
72
  "husky": "^8.0.1",
75
73
  "jest": "27.5.1",
74
+ "mongoose": "^6.5.1",
76
75
  "nestjs-console": "^8.0.0",
77
76
  "passport": "^0.6.0",
78
77
  "passport-jwt": "^4.0.0",
@@ -1,8 +0,0 @@
1
- import { AppEntity } from '../../../configs/app.entity';
2
- import { AddItemValidator } from './cart.validator';
3
- export declare class CartEntity extends AppEntity {
4
- static readonly $index = "store_carts";
5
- user: string;
6
- number: string;
7
- items: AddItemValidator[];
8
- }