feeef 0.0.24 → 0.0.25
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/package.json +1 -1
- package/src/core/entities/product.ts +57 -56
package/package.json
CHANGED
|
@@ -1,107 +1,108 @@
|
|
|
1
|
-
import { EmbaddedCategory } from
|
|
2
|
-
import { ShippingMethodEntity } from
|
|
3
|
-
import { StoreEntity } from
|
|
1
|
+
import { EmbaddedCategory } from "../embadded/category.js";
|
|
2
|
+
import { ShippingMethodEntity } from "./shipping_method.js";
|
|
3
|
+
import { StoreEntity } from "./store.js";
|
|
4
4
|
|
|
5
5
|
export interface ProductEntity {
|
|
6
|
-
id: string
|
|
6
|
+
id: string;
|
|
7
7
|
|
|
8
|
-
slug: string
|
|
8
|
+
slug: string;
|
|
9
9
|
|
|
10
|
-
decoration: ProductDecoration | null
|
|
10
|
+
decoration: ProductDecoration | null;
|
|
11
11
|
|
|
12
|
-
name: string | null
|
|
12
|
+
name: string | null;
|
|
13
13
|
|
|
14
|
-
photoUrl: string | null
|
|
14
|
+
photoUrl: string | null;
|
|
15
15
|
|
|
16
|
-
media: string[]
|
|
16
|
+
media: string[];
|
|
17
17
|
|
|
18
|
-
storeId: string
|
|
18
|
+
storeId: string;
|
|
19
19
|
|
|
20
|
-
shippingMethodId?: string | null
|
|
20
|
+
shippingMethodId?: string | null;
|
|
21
21
|
|
|
22
|
-
category: EmbaddedCategory
|
|
22
|
+
category: EmbaddedCategory;
|
|
23
23
|
|
|
24
|
-
title: string | null
|
|
24
|
+
title: string | null;
|
|
25
25
|
|
|
26
|
-
description: string | null
|
|
26
|
+
description: string | null;
|
|
27
27
|
|
|
28
|
-
body: string | null
|
|
28
|
+
body: string | null;
|
|
29
29
|
|
|
30
30
|
// sku
|
|
31
|
-
sku: string | null
|
|
31
|
+
sku: string | null;
|
|
32
32
|
|
|
33
|
-
price: number
|
|
33
|
+
price: number;
|
|
34
34
|
|
|
35
|
-
discount: number | null
|
|
35
|
+
discount: number | null;
|
|
36
36
|
|
|
37
|
-
stock: number
|
|
37
|
+
stock: number;
|
|
38
38
|
|
|
39
|
-
sold: number
|
|
39
|
+
sold: number;
|
|
40
40
|
|
|
41
|
-
views: number
|
|
41
|
+
views: number;
|
|
42
42
|
|
|
43
|
-
likes: number
|
|
43
|
+
likes: number;
|
|
44
44
|
|
|
45
|
-
dislikes: number
|
|
45
|
+
dislikes: number;
|
|
46
46
|
|
|
47
|
-
variant?: ProductVariant | null
|
|
47
|
+
variant?: ProductVariant | null;
|
|
48
48
|
|
|
49
|
-
metadata: Record<string, any
|
|
49
|
+
metadata: Record<string, any>;
|
|
50
50
|
|
|
51
|
-
status: ProductStatus
|
|
51
|
+
status: ProductStatus;
|
|
52
52
|
|
|
53
|
-
type: ProductType
|
|
53
|
+
type: ProductType;
|
|
54
54
|
|
|
55
|
-
verifiedAt: any | null
|
|
55
|
+
verifiedAt: any | null;
|
|
56
56
|
|
|
57
|
-
blockedAt: any | null
|
|
57
|
+
blockedAt: any | null;
|
|
58
58
|
|
|
59
|
-
createdAt: any
|
|
59
|
+
createdAt: any;
|
|
60
60
|
|
|
61
|
-
updatedAt: any
|
|
61
|
+
updatedAt: any;
|
|
62
62
|
|
|
63
63
|
// relations
|
|
64
|
-
store?: StoreEntity
|
|
65
|
-
shippingMethod?: ShippingMethodEntity
|
|
64
|
+
store?: StoreEntity;
|
|
65
|
+
shippingMethod?: ShippingMethodEntity;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export enum ProductStatus {
|
|
69
|
-
draft =
|
|
70
|
-
published =
|
|
71
|
-
archived =
|
|
72
|
-
deleted =
|
|
69
|
+
draft = "draft",
|
|
70
|
+
published = "published",
|
|
71
|
+
archived = "archived",
|
|
72
|
+
deleted = "deleted",
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export interface ProductDecoration {
|
|
76
|
-
metadata: Record<string, any
|
|
76
|
+
metadata: Record<string, any>;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface ProductVariant {
|
|
80
|
-
name: string
|
|
81
|
-
options: ProductVariantOption[]
|
|
80
|
+
name: string;
|
|
81
|
+
options: ProductVariantOption[];
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export interface ProductVariantOption {
|
|
85
|
-
name: string
|
|
86
|
-
sku?: string | null
|
|
87
|
-
price?: number | null
|
|
88
|
-
discount?: number | null
|
|
89
|
-
stock?: number | null
|
|
90
|
-
sold?: number | null
|
|
91
|
-
type?: VariantOptionType
|
|
92
|
-
child?: ProductVariant | null
|
|
93
|
-
mediaIndex?: number | null
|
|
94
|
-
hint?: string | null
|
|
85
|
+
name: string;
|
|
86
|
+
sku?: string | null;
|
|
87
|
+
price?: number | null;
|
|
88
|
+
discount?: number | null;
|
|
89
|
+
stock?: number | null;
|
|
90
|
+
sold?: number | null;
|
|
91
|
+
type?: VariantOptionType;
|
|
92
|
+
child?: ProductVariant | null;
|
|
93
|
+
mediaIndex?: number | null;
|
|
94
|
+
hint?: string | null;
|
|
95
|
+
value?: any;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
export enum VariantOptionType {
|
|
98
|
-
color =
|
|
99
|
-
image =
|
|
100
|
-
text =
|
|
99
|
+
color = "color",
|
|
100
|
+
image = "image",
|
|
101
|
+
text = "text",
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
export enum ProductType {
|
|
104
|
-
physical =
|
|
105
|
-
digital =
|
|
106
|
-
service =
|
|
105
|
+
physical = "physical",
|
|
106
|
+
digital = "digital",
|
|
107
|
+
service = "service",
|
|
107
108
|
}
|