@merkaly/api 0.2.2-6 → 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.
- package/.output/configs/app.entity.d.ts +1 -2
- package/.output/modules/inventory/products/product.validator.d.ts +2 -1
- package/.output/modules/store/cart/cart.entity.d.ts +14 -0
- package/.output/modules/store/cart/cart.validator.d.ts +11 -0
- package/.output/modules/store/orders/billing/billing.entity.d.ts +7 -0
- package/.output/modules/store/orders/billing/billing.validator.d.ts +7 -0
- package/.output/modules/store/orders/item/item.entity.d.ts +32 -0
- package/.output/modules/store/orders/item/item.validator.d.ts +4 -0
- package/.output/modules/store/orders/order.entity.d.ts +9 -1
- package/.output/modules/store/orders/order.validator.d.ts +6 -0
- package/.output/modules/store/orders/shipping/shipping.entity.d.ts +7 -0
- package/.output/modules/store/orders/shipping/shipping.validator.d.ts +7 -0
- package/.output/modules/store/orders/status/status.entity.d.ts +13 -0
- package/package.json +4 -5
- package/.output/modules/store/carts/cart.entity.d.ts +0 -12
- package/.output/modules/store/carts/cart.validator.d.ts +0 -9
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
|
-
export declare type ObjectRef<T> = T;
|
|
3
2
|
export declare abstract class AppEntity extends Document {
|
|
4
3
|
static $index: string;
|
|
5
|
-
readonly _id
|
|
4
|
+
readonly _id = "";
|
|
6
5
|
readonly createdAt: Date;
|
|
7
6
|
readonly updatedAt?: Date;
|
|
8
7
|
readonly deletedAt?: Date;
|
|
@@ -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:
|
|
8
|
+
files: AssetEntity[];
|
|
8
9
|
}
|
|
9
10
|
export declare class UpdateProductValidator {
|
|
10
11
|
name?: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
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"
|
|
8
|
+
}
|
|
9
|
+
export declare class CartEntity extends AppEntity {
|
|
10
|
+
static readonly $index = "store_carts";
|
|
11
|
+
user: string;
|
|
12
|
+
status: CartStatus;
|
|
13
|
+
items: ItemEntity[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
7
|
+
}
|
|
8
|
+
export declare class AddItemValidator {
|
|
9
|
+
product: string;
|
|
10
|
+
quantity: number;
|
|
11
|
+
}
|
|
@@ -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>;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { AppEntity } from '../../../configs/app.entity';
|
|
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';
|
|
2
6
|
export declare class OrderEntity extends AppEntity {
|
|
3
7
|
static readonly $index = "store_orders";
|
|
4
8
|
number: string;
|
|
5
|
-
|
|
9
|
+
amount: number;
|
|
10
|
+
status: StatusEntity[];
|
|
11
|
+
items: ItemEntity[];
|
|
12
|
+
billing: BillingEntity;
|
|
13
|
+
shipping: ShippingEntity;
|
|
6
14
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { CreateBillingValidator } from './billing/billing.validator';
|
|
2
|
+
import { CreateItemValidator } from './item/item.validator';
|
|
3
|
+
import { CreateShippingValidator } from './shipping/shipping.validator';
|
|
1
4
|
export declare class CreateOrderValidator {
|
|
5
|
+
items: CreateItemValidator[];
|
|
6
|
+
billing: CreateBillingValidator;
|
|
7
|
+
shipping: CreateShippingValidator;
|
|
2
8
|
}
|
|
3
9
|
export declare class UpdateOrderValidator {
|
|
4
10
|
}
|
|
@@ -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-
|
|
3
|
+
"version": "0.2.2-8",
|
|
4
4
|
"description": "NestJS Backend ApiRest Service",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
"class-transformer": "^0.5.1",
|
|
36
36
|
"class-validator": "^0.13.1",
|
|
37
37
|
"reflect-metadata": "^0.1.13",
|
|
38
|
-
"short-
|
|
38
|
+
"short-unique-id": "^4.4.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@commitlint/config-conventional": "^17.0.0",
|
|
42
|
+
"@faker-js/faker": "^7.5.0",
|
|
42
43
|
"@google-cloud/storage": "^6.4.1",
|
|
43
44
|
"@nestjs/cli": "^9.1.1",
|
|
44
45
|
"@nestjs/common": "^9.0.11",
|
|
@@ -53,7 +54,6 @@
|
|
|
53
54
|
"@nestjs/testing": "^9.0.11",
|
|
54
55
|
"@types/cache-manager": "^4.0.1",
|
|
55
56
|
"@types/express": "^4.17.12",
|
|
56
|
-
"@types/faker": "^5.5.9",
|
|
57
57
|
"@types/jest": "^27.0.0",
|
|
58
58
|
"@types/multer": "^1.4.7",
|
|
59
59
|
"@types/node": "^18.0.0",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"eslint": "7.32.0",
|
|
70
70
|
"eslint-plugin-import": "^2.23.4",
|
|
71
71
|
"express": "^4.17.3",
|
|
72
|
-
"faker": "^5.5.3",
|
|
73
72
|
"husky": "^8.0.1",
|
|
74
73
|
"jest": "27.5.1",
|
|
75
74
|
"mongoose": "^6.5.1",
|
|
@@ -85,7 +84,7 @@
|
|
|
85
84
|
"ts-loader": "^9.2.3",
|
|
86
85
|
"ts-node": "^10.0.0",
|
|
87
86
|
"tsconfig-paths": "^4.0.0",
|
|
88
|
-
"typescript": "
|
|
87
|
+
"typescript": "4.4.4",
|
|
89
88
|
"webpack": "^5"
|
|
90
89
|
},
|
|
91
90
|
"engines": {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AppEntity, ObjectRef } from '../../../configs/app.entity';
|
|
2
|
-
import { ProductEntity } from '../../inventory/products/product.entity';
|
|
3
|
-
export declare class CartItemEntity extends AppEntity {
|
|
4
|
-
quantity: number;
|
|
5
|
-
product: ObjectRef<ProductEntity>;
|
|
6
|
-
}
|
|
7
|
-
export declare class CartEntity extends AppEntity {
|
|
8
|
-
static readonly $index = "store_carts";
|
|
9
|
-
user: string;
|
|
10
|
-
number: string;
|
|
11
|
-
items: CartItemEntity[];
|
|
12
|
-
}
|