@merkaly/api 0.1.11-4 → 0.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.
- package/{src → config}/app.entity.d.ts +0 -0
- package/config/app.entity.d.ts.map +1 -0
- package/config/app.entity.ts +9 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.ts +3 -0
- package/package.json +5 -4
- package/src/account/connections/connection.validator.d.ts +1 -0
- package/src/account/connections/connection.validator.d.ts.map +1 -1
- package/src/account/connections/connection.validator.ts +1 -0
- package/src/account/organizations/connections/connection.validator.d.ts +1 -0
- package/src/account/organizations/connections/connection.validator.d.ts.map +1 -1
- package/src/account/organizations/connections/connection.validator.ts +1 -0
- package/src/account/organizations/members/member.validator.d.ts +1 -0
- package/src/account/organizations/members/member.validator.d.ts.map +1 -1
- package/src/account/organizations/members/member.validator.ts +2 -0
- package/src/account/organizations/organization.validator.d.ts +5 -4
- package/src/account/organizations/organization.validator.d.ts.map +1 -1
- package/src/account/organizations/organization.validator.ts +5 -4
- package/src/account/roles/role.validator.d.ts +1 -0
- package/src/account/roles/role.validator.d.ts.map +1 -1
- package/src/account/roles/role.validator.ts +1 -0
- package/src/account/roles/users/user.validator.d.ts +1 -0
- package/src/account/roles/users/user.validator.d.ts.map +1 -1
- package/src/account/roles/users/user.validator.ts +2 -0
- package/src/account/users/extra/extra.validator.d.ts +1 -0
- package/src/account/users/extra/extra.validator.d.ts.map +1 -1
- package/src/account/users/extra/extra.validator.ts +1 -0
- package/src/account/users/roles/role.validator.d.ts +1 -0
- package/src/account/users/roles/role.validator.d.ts.map +1 -1
- package/src/account/users/roles/role.validator.ts +2 -0
- package/src/account/users/user.validator.d.ts +1 -0
- package/src/account/users/user.validator.d.ts.map +1 -1
- package/src/account/users/user.validator.ts +1 -0
- package/src/auth/auth.validator.d.ts +1 -0
- package/src/auth/auth.validator.d.ts.map +1 -1
- package/src/auth/auth.validator.ts +1 -0
- package/src/inventory/brands/brand.entity.d.ts +1 -1
- package/src/inventory/brands/brand.entity.d.ts.map +1 -1
- package/src/inventory/brands/brand.entity.ts +4 -9
- package/src/inventory/brands/brand.validator.d.ts +1 -0
- package/src/inventory/brands/brand.validator.d.ts.map +1 -1
- package/src/inventory/brands/brand.validator.ts +1 -0
- package/src/inventory/categories/category.entity.d.ts +1 -3
- package/src/inventory/categories/category.entity.d.ts.map +1 -1
- package/src/inventory/categories/category.entity.ts +4 -16
- package/src/inventory/categories/category.validator.d.ts +1 -0
- package/src/inventory/categories/category.validator.d.ts.map +1 -1
- package/src/inventory/categories/category.validator.ts +1 -0
- package/src/inventory/media/media.entity.d.ts +6 -0
- package/src/inventory/media/media.entity.d.ts.map +1 -0
- package/src/inventory/media/media.entity.ts +7 -0
- package/src/inventory/{products/media → media}/media.validator.d.ts +1 -0
- package/src/inventory/media/media.validator.d.ts.map +1 -0
- package/src/inventory/{products/media → media}/media.validator.ts +2 -0
- package/src/inventory/products/product.entity.d.ts +8 -20
- package/src/inventory/products/product.entity.d.ts.map +1 -1
- package/src/inventory/products/product.entity.ts +13 -37
- package/src/inventory/products/product.validator.d.ts +5 -4
- package/src/inventory/products/product.validator.d.ts.map +1 -1
- package/src/inventory/products/product.validator.ts +17 -16
- package/src/inventory/properties/property.entity.d.ts +2 -2
- package/src/inventory/properties/property.entity.d.ts.map +1 -1
- package/src/inventory/properties/property.entity.ts +4 -10
- package/src/inventory/properties/property.validator.d.ts +1 -0
- package/src/inventory/properties/property.validator.d.ts.map +1 -1
- package/src/inventory/properties/property.validator.ts +1 -0
- package/src/inventory/variants/variant.entity.d.ts +12 -0
- package/src/inventory/variants/variant.entity.d.ts.map +1 -0
- package/src/inventory/variants/variant.entity.ts +22 -0
- package/src/inventory/{products/variants → variants}/variant.validator.d.ts +2 -1
- package/src/inventory/variants/variant.validator.d.ts.map +1 -0
- package/src/inventory/{products/variants → variants}/variant.validator.ts +3 -1
- package/src/store/orders/order.entity.d.ts +1 -3
- package/src/store/orders/order.entity.d.ts.map +1 -1
- package/src/store/orders/order.entity.ts +3 -11
- package/src/store/orders/order.validator.d.ts +1 -0
- package/src/store/orders/order.validator.d.ts.map +1 -1
- package/src/store/orders/order.validator.ts +3 -0
- package/src/app.entity.d.ts.map +0 -1
- package/src/app.entity.ts +0 -15
- package/src/index.d.ts +0 -3
- package/src/index.d.ts.map +0 -1
- package/src/index.ts +0 -3
- package/src/inventory/products/media/media.entity.d.ts +0 -7
- package/src/inventory/products/media/media.entity.d.ts.map +0 -1
- package/src/inventory/products/media/media.entity.ts +0 -13
- package/src/inventory/products/media/media.validator.d.ts.map +0 -1
- package/src/inventory/products/variants/variant.entity.d.ts +0 -10
- package/src/inventory/products/variants/variant.entity.d.ts.map +0 -1
- package/src/inventory/products/variants/variant.entity.ts +0 -21
- package/src/inventory/products/variants/variant.validator.d.ts.map +0 -1
- package/src/store/carts/cart.entity.d.ts +0 -17
- package/src/store/carts/cart.entity.d.ts.map +0 -1
- package/src/store/carts/cart.entity.ts +0 -25
- package/src/store/carts/cart.validator.d.ts +0 -7
- package/src/store/carts/cart.validator.d.ts.map +0 -1
- package/src/store/carts/cart.validator.ts +0 -8
- package/src/store/items/item.entity.d.ts +0 -9
- package/src/store/items/item.entity.d.ts.map +0 -1
- package/src/store/items/item.entity.ts +0 -16
- package/src/store/items/item.validator.d.ts +0 -5
- package/src/store/items/item.validator.d.ts.map +0 -1
- package/src/store/items/item.validator.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.validator.d.ts","sourceRoot":"","sources":["product.validator.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"product.validator.d.ts","sourceRoot":"","sources":["product.validator.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,sBAAsB;IAEjC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI3B,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAI1C,aAAa,EAAE,IAAI,CAAA;IAInB,MAAM,UAAO;IAIb,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAK;IAKxC,QAAQ,EAAE,sBAAsB,EAAE,CAAK;IAIvC,OAAO,yBAA+B;CACvC;AAED,qBAAa,sBAAsB;IAGjC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAI1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;CACrC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Type } from 'class-transformer'
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { CreateVariantValidator } from '
|
|
2
|
+
import { IsBoolean, IsDateString, IsOptional, IsPositive, IsString, ValidateNested } from 'class-validator'
|
|
3
|
+
import 'reflect-metadata'
|
|
4
|
+
import { CreateVariantValidator } from '../variants/variant.validator'
|
|
5
|
+
import { ProductEntity } from './product.entity'
|
|
5
6
|
|
|
6
7
|
export class FindProductValidator {
|
|
7
8
|
|
|
@@ -15,6 +16,14 @@ export class CreateProductValidator {
|
|
|
15
16
|
@IsOptional()
|
|
16
17
|
description?: ProductEntity['description']
|
|
17
18
|
|
|
19
|
+
@IsDateString()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
availableFrom: Date
|
|
22
|
+
|
|
23
|
+
@IsBoolean()
|
|
24
|
+
@IsOptional()
|
|
25
|
+
active = true
|
|
26
|
+
|
|
18
27
|
@IsOptional()
|
|
19
28
|
@IsPositive()
|
|
20
29
|
category?: number
|
|
@@ -23,18 +32,18 @@ export class CreateProductValidator {
|
|
|
23
32
|
@IsPositive()
|
|
24
33
|
brand?: number
|
|
25
34
|
|
|
26
|
-
@IsOptional()
|
|
27
|
-
@IsEnum(PRODUCT_UNIT)
|
|
28
|
-
unit: ProductEntity['unit'] = PRODUCT_UNIT.QUANTITY
|
|
29
|
-
|
|
30
35
|
@IsOptional()
|
|
31
36
|
@IsString({ each: true })
|
|
32
37
|
hashtags: ProductEntity['hashtags'] = []
|
|
33
38
|
|
|
34
39
|
@ValidateNested({ each: true })
|
|
35
|
-
@ArrayMinSize(1)
|
|
36
40
|
@Type(() => CreateVariantValidator)
|
|
41
|
+
@IsOptional()
|
|
37
42
|
variants: CreateVariantValidator[] = []
|
|
43
|
+
|
|
44
|
+
@ValidateNested()
|
|
45
|
+
@Type(() => CreateVariantValidator)
|
|
46
|
+
variant = new CreateVariantValidator()
|
|
38
47
|
}
|
|
39
48
|
|
|
40
49
|
export class UpdateProductValidator {
|
|
@@ -54,14 +63,6 @@ export class UpdateProductValidator {
|
|
|
54
63
|
@IsPositive()
|
|
55
64
|
brand?: number
|
|
56
65
|
|
|
57
|
-
@IsOptional()
|
|
58
|
-
@IsEnum(PRODUCT_UNIT)
|
|
59
|
-
unit?: ProductEntity['unit']
|
|
60
|
-
|
|
61
|
-
@IsOptional()
|
|
62
|
-
@IsEnum(PRODUCT_STATUS)
|
|
63
|
-
status?: ProductEntity['status']
|
|
64
|
-
|
|
65
66
|
@IsOptional()
|
|
66
67
|
@IsString({ each: true })
|
|
67
68
|
hashtags?: ProductEntity['hashtags']
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AppEntity } from '
|
|
1
|
+
import { AppEntity } from '@/config/app.entity';
|
|
2
2
|
import { CategoryEntity } from '../categories/category.entity';
|
|
3
3
|
import { ProductEntity } from '../products/product.entity';
|
|
4
4
|
export declare class PropertyEntity extends AppEntity {
|
|
5
5
|
name: string;
|
|
6
6
|
values: string[];
|
|
7
|
-
category
|
|
7
|
+
category: CategoryEntity;
|
|
8
8
|
products: ProductEntity[];
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=property.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.entity.d.ts","sourceRoot":"","sources":["property.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"property.entity.d.ts","sourceRoot":"","sources":["property.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBAAa,cAAe,SAAQ,SAAS;IACpC,IAAI,EAAE,MAAM,CAAA;IAEZ,MAAM,EAAE,MAAM,EAAE,CAAA;IAEhB,QAAQ,EAAE,cAAc,CAAA;IAExB,QAAQ,EAAE,aAAa,EAAE,CAAA;CAEjC"}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppEntity } from '../../app.entity'
|
|
1
|
+
import { AppEntity } from '@/config/app.entity'
|
|
3
2
|
import { CategoryEntity } from '../categories/category.entity'
|
|
4
3
|
import { ProductEntity } from '../products/product.entity'
|
|
5
4
|
|
|
6
|
-
@Entity('inventory_properties')
|
|
7
5
|
export class PropertyEntity extends AppEntity {
|
|
8
|
-
|
|
9
|
-
name: string
|
|
6
|
+
public name: string
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
values: string[]
|
|
8
|
+
public values: string[]
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
public category?: CategoryEntity
|
|
10
|
+
public category: CategoryEntity
|
|
16
11
|
|
|
17
|
-
@ManyToOne(() => ProductEntity, p => p.properties)
|
|
18
12
|
public products: ProductEntity[]
|
|
19
13
|
|
|
20
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.validator.d.ts","sourceRoot":"","sources":["property.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,qBAAa,qBAAqB;CAEjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC;AAED,qBAAa,uBAAuB;IAGlC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI7B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC"}
|
|
1
|
+
{"version":3,"file":"property.validator.d.ts","sourceRoot":"","sources":["property.validator.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,qBAAa,qBAAqB;CAEjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC;AAED,qBAAa,uBAAuB;IAGlC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI7B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppEntity } from '@/config/app.entity';
|
|
2
|
+
import { ProductEntity } from '../products/product.entity';
|
|
3
|
+
export declare class VariantEntity extends AppEntity {
|
|
4
|
+
price: number;
|
|
5
|
+
sku: string;
|
|
6
|
+
quantity: number;
|
|
7
|
+
active: boolean;
|
|
8
|
+
product: ProductEntity;
|
|
9
|
+
get isOutOfStock(): boolean;
|
|
10
|
+
get isDraft(): boolean;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=variant.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant.entity.d.ts","sourceRoot":"","sources":["variant.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBAAa,aAAc,SAAQ,SAAS;IACnC,KAAK,SAAI;IAET,GAAG,EAAE,MAAM,CAAA;IAEX,QAAQ,SAAI;IAEZ,MAAM,UAAO;IAEb,OAAO,EAAE,aAAa,CAAA;IAE7B,IAAW,YAAY,YAEtB;IAED,IAAW,OAAO,YAEjB;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AppEntity } from '@/config/app.entity'
|
|
2
|
+
import { ProductEntity } from '../products/product.entity'
|
|
3
|
+
|
|
4
|
+
export class VariantEntity extends AppEntity {
|
|
5
|
+
public price = 0
|
|
6
|
+
|
|
7
|
+
public sku: string
|
|
8
|
+
|
|
9
|
+
public quantity = 1
|
|
10
|
+
|
|
11
|
+
public active = true
|
|
12
|
+
|
|
13
|
+
public product: ProductEntity
|
|
14
|
+
|
|
15
|
+
public get isOutOfStock () {
|
|
16
|
+
return this.quantity === 0
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public get isDraft () {
|
|
20
|
+
return this.active === true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
1
2
|
import { VariantEntity } from './variant.entity';
|
|
2
3
|
export declare class CreateVariantValidator {
|
|
3
4
|
price: VariantEntity['price'];
|
|
4
5
|
sku: VariantEntity['sku'];
|
|
5
6
|
quantity: VariantEntity['quantity'];
|
|
6
|
-
|
|
7
|
+
active: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare class UpdateVariantValidator {
|
|
9
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant.validator.d.ts","sourceRoot":"","sources":["variant.validator.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,sBAAsB;IAE1B,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAG7B,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;IAIzB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAI;IAI9C,MAAM,UAAO;CACd;AAED,qBAAa,sBAAsB;CAElC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Allow, IsBoolean, IsOptional, IsPositive } from 'class-validator'
|
|
2
|
+
import 'reflect-metadata'
|
|
2
3
|
import { VariantEntity } from './variant.entity'
|
|
3
4
|
|
|
4
5
|
export class CreateVariantValidator {
|
|
@@ -13,7 +14,8 @@ export class CreateVariantValidator {
|
|
|
13
14
|
public quantity: VariantEntity['quantity'] = 1
|
|
14
15
|
|
|
15
16
|
@IsBoolean()
|
|
16
|
-
|
|
17
|
+
@IsOptional()
|
|
18
|
+
active = true
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export class UpdateVariantValidator {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { AppEntity } from '
|
|
2
|
-
import { CartEntity } from '../carts/cart.entity';
|
|
1
|
+
import { AppEntity } from '@/config/app.entity';
|
|
3
2
|
export declare class OrderEntity extends AppEntity {
|
|
4
3
|
number: string;
|
|
5
4
|
price: number;
|
|
6
|
-
cart: CartEntity;
|
|
7
5
|
}
|
|
8
6
|
//# sourceMappingURL=order.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.entity.d.ts","sourceRoot":"","sources":["order.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"order.entity.d.ts","sourceRoot":"","sources":["order.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,qBAAa,WAAY,SAAQ,SAAS;IACjC,MAAM,EAAE,MAAM,CAAA;IAEd,KAAK,EAAE,MAAM,CAAA;CACrB"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppEntity } from '../../app.entity'
|
|
3
|
-
import { CartEntity } from '../carts/cart.entity'
|
|
1
|
+
import { AppEntity } from '@/config/app.entity'
|
|
4
2
|
|
|
5
|
-
@Entity('store_orders')
|
|
6
3
|
export class OrderEntity extends AppEntity {
|
|
7
|
-
|
|
8
|
-
number: string
|
|
4
|
+
public number: string
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
price: number
|
|
12
|
-
|
|
13
|
-
@OneToOne(() => CartEntity, c => c.order, { eager: true })
|
|
14
|
-
cart: CartEntity
|
|
6
|
+
public price: number
|
|
15
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.validator.d.ts","sourceRoot":"","sources":["order.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;CAE9B;AAED,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
|
|
1
|
+
{"version":3,"file":"order.validator.d.ts","sourceRoot":"","sources":["order.validator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,kBAAkB;CAE9B;AAED,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
|
package/src/app.entity.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.entity.d.ts","sourceRoot":"","sources":["app.entity.ts"],"names":[],"mappings":"AAEA,8BAAsB,SAAS;IAEtB,EAAE,EAAE,MAAM,CAAA;IAEjB,SACgB,SAAS,OAAa;IAEtC,SACgB,SAAS,CAAC,EAAE,IAAI,CAAA;IAEhC,SACgB,SAAS,CAAC,EAAE,IAAI,CAAA;CACjC"}
|
package/src/app.entity.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CreateDateColumn, DeleteDateColumn, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export abstract class AppEntity {
|
|
4
|
-
@PrimaryGeneratedColumn()
|
|
5
|
-
public id: number
|
|
6
|
-
|
|
7
|
-
@CreateDateColumn()
|
|
8
|
-
public readonly createdAt = new Date()
|
|
9
|
-
|
|
10
|
-
@UpdateDateColumn()
|
|
11
|
-
public readonly updatedAt?: Date
|
|
12
|
-
|
|
13
|
-
@DeleteDateColumn()
|
|
14
|
-
public readonly deletedAt?: Date
|
|
15
|
-
}
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,MAAM,QAAQ,OAAO,GAAG,OAAO,CAAA"}
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"media.entity.d.ts","sourceRoot":"","sources":["media.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,qBACa,WAAY,SAAQ,SAAS;IAGxC,IAAI,EAAE,MAAM,CAAA;IAGL,QAAQ,EAAE,aAAa,CAAA;CAC/B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, ManyToOne } from 'typeorm'
|
|
2
|
-
import { AppEntity } from '../../../app.entity'
|
|
3
|
-
import { ProductEntity } from '../product.entity'
|
|
4
|
-
|
|
5
|
-
@Entity('inventory_products_media')
|
|
6
|
-
export class MediaEntity extends AppEntity {
|
|
7
|
-
|
|
8
|
-
@Column({})
|
|
9
|
-
name: string
|
|
10
|
-
|
|
11
|
-
@ManyToOne(() => ProductEntity, (p) => p.media)
|
|
12
|
-
public products: ProductEntity
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"media.validator.d.ts","sourceRoot":"","sources":["media.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AppEntity } from '../../../app.entity';
|
|
2
|
-
import { ProductEntity } from '../product.entity';
|
|
3
|
-
export declare class VariantEntity extends AppEntity {
|
|
4
|
-
price: number;
|
|
5
|
-
sku: string;
|
|
6
|
-
quantity: number;
|
|
7
|
-
master: boolean;
|
|
8
|
-
product: ProductEntity;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=variant.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variant.entity.d.ts","sourceRoot":"","sources":["variant.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,qBACa,aAAc,SAAQ,SAAS;IAEnC,KAAK,SAAI;IAGT,GAAG,EAAE,MAAM,CAAA;IAGX,QAAQ,SAAI;IAGZ,MAAM,UAAQ;IAGd,OAAO,EAAE,aAAa,CAAA;CAC9B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, ManyToOne } from 'typeorm'
|
|
2
|
-
import { AppEntity } from '../../../app.entity'
|
|
3
|
-
import { ProductEntity } from '../product.entity'
|
|
4
|
-
|
|
5
|
-
@Entity('inventory_products_variants')
|
|
6
|
-
export class VariantEntity extends AppEntity {
|
|
7
|
-
@Column({ type: 'float', default: 0 })
|
|
8
|
-
public price = 0
|
|
9
|
-
|
|
10
|
-
@Column({ unique: true })
|
|
11
|
-
public sku: string
|
|
12
|
-
|
|
13
|
-
@Column({ type: 'int', default: 1 })
|
|
14
|
-
public quantity = 1
|
|
15
|
-
|
|
16
|
-
@Column({ type: 'boolean', default: false })
|
|
17
|
-
public master = false
|
|
18
|
-
|
|
19
|
-
@ManyToOne(() => ProductEntity, (p) => p.variants)
|
|
20
|
-
public product: ProductEntity
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variant.validator.d.ts","sourceRoot":"","sources":["variant.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,sBAAsB;IAE1B,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAG7B,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;IAIzB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAI;IAGvC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAQ;CAC/C;AAED,qBAAa,sBAAsB;CAElC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AppEntity } from '../../app.entity';
|
|
2
|
-
import { ItemEntity } from '../items/item.entity';
|
|
3
|
-
import { OrderEntity } from '../orders/order.entity';
|
|
4
|
-
export declare enum CART_STATUS {
|
|
5
|
-
EMPTY = "EMPTY",
|
|
6
|
-
SAVED = "SAVED",
|
|
7
|
-
ACTIVE = "ACTIVE",
|
|
8
|
-
DELETED = "DELETED",
|
|
9
|
-
ABANDONED = "ABANDONED",
|
|
10
|
-
FINALIZED = "FINALIZED"
|
|
11
|
-
}
|
|
12
|
-
export declare class CartEntity extends AppEntity {
|
|
13
|
-
status: CART_STATUS;
|
|
14
|
-
items: ItemEntity[];
|
|
15
|
-
order: OrderEntity[];
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=cart.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cart.entity.d.ts","sourceRoot":"","sources":["cart.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED,qBACa,UAAW,SAAQ,SAAS;IAEhC,MAAM,EAAE,WAAW,CAAoB;IAGvC,KAAK,EAAE,UAAU,EAAE,CAAA;IAGnB,KAAK,EAAE,WAAW,EAAE,CAAA;CAC5B"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, OneToMany, OneToOne } from 'typeorm'
|
|
2
|
-
import { AppEntity } from '../../app.entity'
|
|
3
|
-
import { ItemEntity } from '../items/item.entity'
|
|
4
|
-
import { OrderEntity } from '../orders/order.entity'
|
|
5
|
-
|
|
6
|
-
export enum CART_STATUS {
|
|
7
|
-
EMPTY = 'EMPTY',
|
|
8
|
-
SAVED = 'SAVED',
|
|
9
|
-
ACTIVE = 'ACTIVE',
|
|
10
|
-
DELETED = 'DELETED',
|
|
11
|
-
ABANDONED = 'ABANDONED',
|
|
12
|
-
FINALIZED = 'FINALIZED'
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@Entity('store_carts')
|
|
16
|
-
export class CartEntity extends AppEntity {
|
|
17
|
-
@Column({ type: 'enum', enum: CART_STATUS, default: CART_STATUS.EMPTY })
|
|
18
|
-
public status: CART_STATUS = CART_STATUS.EMPTY
|
|
19
|
-
|
|
20
|
-
@OneToMany(() => ItemEntity, i => i.cart, { eager: true })
|
|
21
|
-
public items: ItemEntity[]
|
|
22
|
-
|
|
23
|
-
@OneToOne(() => OrderEntity, o => o.cart)
|
|
24
|
-
public order: OrderEntity[]
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cart.validator.d.ts","sourceRoot":"","sources":["cart.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAiB;CAC7B;AAED,qBAAa,mBAAmB;CAC/B;AAED,qBAAa,mBAAmB;CAC/B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AppEntity } from '../../app.entity';
|
|
2
|
-
import { VariantEntity } from '../../inventory/products/variants/variant.entity';
|
|
3
|
-
import { CartEntity } from '../carts/cart.entity';
|
|
4
|
-
export declare class ItemEntity extends AppEntity {
|
|
5
|
-
quantity: number;
|
|
6
|
-
variant: VariantEntity;
|
|
7
|
-
cart: CartEntity[];
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=item.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.entity.d.ts","sourceRoot":"","sources":["item.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,qBACa,UAAW,SAAQ,SAAS;IAEhC,QAAQ,EAAE,MAAM,CAAA;IAGhB,OAAO,EAAE,aAAa,CAAA;IAGtB,IAAI,EAAE,UAAU,EAAE,CAAA;CAC1B"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, ManyToOne } from 'typeorm'
|
|
2
|
-
import { AppEntity } from '../../app.entity'
|
|
3
|
-
import { VariantEntity } from '../../inventory/products/variants/variant.entity'
|
|
4
|
-
import { CartEntity } from '../carts/cart.entity'
|
|
5
|
-
|
|
6
|
-
@Entity('store_items')
|
|
7
|
-
export class ItemEntity extends AppEntity {
|
|
8
|
-
@Column({ type: 'float', default: 1 })
|
|
9
|
-
public quantity: number
|
|
10
|
-
|
|
11
|
-
@ManyToOne(() => VariantEntity, { eager: true })
|
|
12
|
-
public variant: VariantEntity
|
|
13
|
-
|
|
14
|
-
@ManyToOne(() => CartEntity, c => c.items)
|
|
15
|
-
public cart: CartEntity[]
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.validator.d.ts","sourceRoot":"","sources":["item.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAmB;CAE/B;AAED,qBAAa,mBAAmB;CAE/B"}
|