@merkaly/api 0.2.2-7 → 0.2.2-8

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,13 +1,14 @@
1
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;
2
+ import { ItemEntity } from '../orders/item/item.entity';
3
+ export declare enum CartStatus {
4
+ EMPTY = "EMPTY",
5
+ FILLED = "FILLED",
6
+ FINISHED = "FINISHED",
7
+ ABANDONED = "ABANDONED"
7
8
  }
8
9
  export declare class CartEntity extends AppEntity {
9
10
  static readonly $index = "store_carts";
10
11
  user: string;
11
12
  status: CartStatus;
12
- items: CartItemEntity[];
13
+ items: ItemEntity[];
13
14
  }
@@ -1,13 +1,9 @@
1
- export declare enum CartStatus {
2
- EMPTY = "EMPTY",
3
- FILLED = "FILLED",
4
- FINISHED = "FINISHED",
5
- ABANDONED = "ABANDONED"
6
- }
7
- export declare class CreateCartValidator {
8
- user: string;
9
- }
10
- export declare class UpdateCartValidator {
1
+ import { CreateBillingValidator } from '../orders/billing/billing.validator';
2
+ import { CreateShippingValidator } from '../orders/shipping/shipping.validator';
3
+ export declare class CheckoutCartValidator {
4
+ cart: string;
5
+ billing: CreateBillingValidator;
6
+ shipping: CreateShippingValidator;
11
7
  }
12
8
  export declare class AddItemValidator {
13
9
  product: string;
@@ -0,0 +1,7 @@
1
+ export declare class BillingEntity {
2
+ name: string;
3
+ email: string;
4
+ phone: string;
5
+ address: string;
6
+ code: string;
7
+ }
@@ -0,0 +1,7 @@
1
+ export declare class CreateBillingValidator {
2
+ name: string;
3
+ email: string;
4
+ phone: string;
5
+ address: string;
6
+ code: string;
7
+ }
@@ -0,0 +1,32 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Schema } from 'mongoose';
26
+ import { AppEntity } from '../../../../configs/app.entity';
27
+ import { ProductEntity } from '../../../inventory/products/product.entity';
28
+ export declare class ItemEntity extends AppEntity {
29
+ quantity: number;
30
+ product: ProductEntity;
31
+ }
32
+ export declare const ItemSchema: Schema<ItemEntity, import("mongoose").Model<ItemEntity, any, any, any, any>, {}, {}, {}, {}, "type", ItemEntity>;
@@ -0,0 +1,4 @@
1
+ export declare class CreateItemValidator {
2
+ quantity: number;
3
+ product: string;
4
+ }
@@ -1,12 +1,14 @@
1
1
  import { AppEntity } from '../../../configs/app.entity';
2
- import { CartEntity } from '../cart/cart.entity';
3
- import { BillingValidator, OrderStatus } from './order.validator';
2
+ import { BillingEntity } from './billing/billing.entity';
3
+ import { ItemEntity } from './item/item.entity';
4
+ import { ShippingEntity } from './shipping/shipping.entity';
5
+ import { StatusEntity } from './status/status.entity';
4
6
  export declare class OrderEntity extends AppEntity {
5
7
  static readonly $index = "store_orders";
6
- status: OrderStatus;
7
8
  number: string;
8
- cart?: CartEntity;
9
- user: string;
10
- subtotal: number;
11
- billing?: BillingValidator;
9
+ amount: number;
10
+ status: StatusEntity[];
11
+ items: ItemEntity[];
12
+ billing: BillingEntity;
13
+ shipping: ShippingEntity;
12
14
  }
@@ -1,22 +1,10 @@
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
+ import { CreateBillingValidator } from './billing/billing.validator';
2
+ import { CreateItemValidator } from './item/item.validator';
3
+ import { CreateShippingValidator } from './shipping/shipping.validator';
17
4
  export declare class CreateOrderValidator {
18
- cart: string;
19
- billing: any;
5
+ items: CreateItemValidator[];
6
+ billing: CreateBillingValidator;
7
+ shipping: CreateShippingValidator;
20
8
  }
21
9
  export declare class UpdateOrderValidator {
22
10
  }
@@ -0,0 +1,7 @@
1
+ export declare class ShippingEntity {
2
+ name: string;
3
+ email: string;
4
+ phone: string;
5
+ address: string;
6
+ code: string;
7
+ }
@@ -0,0 +1,7 @@
1
+ export declare class CreateShippingValidator {
2
+ name: string;
3
+ email: string;
4
+ phone: string;
5
+ address: string;
6
+ code: string;
7
+ }
@@ -0,0 +1,13 @@
1
+ export declare enum StatusType {
2
+ CREATED = "CREATED",
3
+ APPROVED = "APPROVED",
4
+ ON_HOLD = "ON_HOLD",
5
+ IN_PROGRESS = "IN_PROGRESS",
6
+ COMPLETED = "COMPLETED",
7
+ CANCELED = "CANCELED"
8
+ }
9
+ export declare class StatusEntity {
10
+ status: StatusType;
11
+ user: string;
12
+ readonly date: Date;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.2-7",
3
+ "version": "0.2.2-8",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "repository": {
6
6
  "type": "git",
@@ -84,7 +84,7 @@
84
84
  "ts-loader": "^9.2.3",
85
85
  "ts-node": "^10.0.0",
86
86
  "tsconfig-paths": "^4.0.0",
87
- "typescript": "^4.8.2",
87
+ "typescript": "4.4.4",
88
88
  "webpack": "^5"
89
89
  },
90
90
  "engines": {