@sendhome/common 1.0.171 → 1.0.172
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.
|
@@ -2,52 +2,6 @@ import { Subjects } from "../subjects/subjects";
|
|
|
2
2
|
import { ProductStatus } from "../types/product-status";
|
|
3
3
|
import { ReceiveCountry } from "../types/receive-country";
|
|
4
4
|
import { Category } from "../types/category";
|
|
5
|
-
import { UnitType } from "../types/unit-type";
|
|
6
|
-
interface IGroceriesFields {
|
|
7
|
-
expiration_date?: Date;
|
|
8
|
-
organic?: boolean;
|
|
9
|
-
calories?: Number;
|
|
10
|
-
ingredients?: string[];
|
|
11
|
-
allergens?: string[];
|
|
12
|
-
}
|
|
13
|
-
interface IHardwareFields {
|
|
14
|
-
brand?: string;
|
|
15
|
-
model?: string;
|
|
16
|
-
warranty_period?: string;
|
|
17
|
-
specifications?: string;
|
|
18
|
-
}
|
|
19
|
-
interface IClothingFields {
|
|
20
|
-
size?: string;
|
|
21
|
-
color?: string;
|
|
22
|
-
material?: string;
|
|
23
|
-
care_instructions?: string;
|
|
24
|
-
}
|
|
25
|
-
interface IFuelFields {
|
|
26
|
-
discount_percentage?: number;
|
|
27
|
-
expiration_date?: Date;
|
|
28
|
-
usage_restrictions?: string;
|
|
29
|
-
}
|
|
30
|
-
interface IGasFields {
|
|
31
|
-
discount_percentage?: number;
|
|
32
|
-
expiration_date?: Date;
|
|
33
|
-
usage_restrictions?: string;
|
|
34
|
-
}
|
|
35
|
-
interface ProductAttrs {
|
|
36
|
-
images: string[];
|
|
37
|
-
videos: string[];
|
|
38
|
-
product_id: number;
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
product_category: Category;
|
|
42
|
-
brand?: string;
|
|
43
|
-
unit?: UnitType;
|
|
44
|
-
unit_value?: number;
|
|
45
|
-
properties: IGroceriesFields | IHardwareFields | IClothingFields | IFuelFields | IFuelFields | IGasFields | {};
|
|
46
|
-
status: ProductStatus;
|
|
47
|
-
country: ReceiveCountry;
|
|
48
|
-
created_at: Date;
|
|
49
|
-
updated_at: Date;
|
|
50
|
-
}
|
|
51
5
|
export interface ProductItemCreatedEvent {
|
|
52
6
|
subject: Subjects.ProductItemCreated;
|
|
53
7
|
data: {
|
|
@@ -56,7 +10,7 @@ export interface ProductItemCreatedEvent {
|
|
|
56
10
|
product_category: Category;
|
|
57
11
|
category: string;
|
|
58
12
|
brand: string;
|
|
59
|
-
product:
|
|
13
|
+
product: string;
|
|
60
14
|
company: string;
|
|
61
15
|
module: string;
|
|
62
16
|
country: ReceiveCountry;
|
|
@@ -66,4 +20,3 @@ export interface ProductItemCreatedEvent {
|
|
|
66
20
|
version: number;
|
|
67
21
|
};
|
|
68
22
|
}
|
|
69
|
-
export {};
|
|
@@ -2,52 +2,6 @@ import { Subjects } from "../subjects/subjects";
|
|
|
2
2
|
import { ProductStatus } from "../types/product-status";
|
|
3
3
|
import { ReceiveCountry } from "../types/receive-country";
|
|
4
4
|
import { Category } from "../types/category";
|
|
5
|
-
import { UnitType } from "../types/unit-type";
|
|
6
|
-
interface IGroceriesFields {
|
|
7
|
-
expiration_date?: Date;
|
|
8
|
-
organic?: boolean;
|
|
9
|
-
calories?: Number;
|
|
10
|
-
ingredients?: string[];
|
|
11
|
-
allergens?: string[];
|
|
12
|
-
}
|
|
13
|
-
interface IHardwareFields {
|
|
14
|
-
brand?: string;
|
|
15
|
-
model?: string;
|
|
16
|
-
warranty_period?: string;
|
|
17
|
-
specifications?: string;
|
|
18
|
-
}
|
|
19
|
-
interface IClothingFields {
|
|
20
|
-
size?: string;
|
|
21
|
-
color?: string;
|
|
22
|
-
material?: string;
|
|
23
|
-
care_instructions?: string;
|
|
24
|
-
}
|
|
25
|
-
interface IFuelFields {
|
|
26
|
-
discount_percentage?: number;
|
|
27
|
-
expiration_date?: Date;
|
|
28
|
-
usage_restrictions?: string;
|
|
29
|
-
}
|
|
30
|
-
interface IGasFields {
|
|
31
|
-
discount_percentage?: number;
|
|
32
|
-
expiration_date?: Date;
|
|
33
|
-
usage_restrictions?: string;
|
|
34
|
-
}
|
|
35
|
-
interface ProductAttrs {
|
|
36
|
-
images: string[];
|
|
37
|
-
videos: string[];
|
|
38
|
-
product_id: number;
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
product_category: Category;
|
|
42
|
-
brand?: string;
|
|
43
|
-
unit?: UnitType;
|
|
44
|
-
unit_value?: number;
|
|
45
|
-
properties: IGroceriesFields | IHardwareFields | IClothingFields | IFuelFields | IFuelFields | IGasFields | {};
|
|
46
|
-
status: ProductStatus;
|
|
47
|
-
country: ReceiveCountry;
|
|
48
|
-
created_at: Date;
|
|
49
|
-
updated_at: Date;
|
|
50
|
-
}
|
|
51
5
|
export interface ProductItemUpdatedEvent {
|
|
52
6
|
subject: Subjects.ProductItemUpdated;
|
|
53
7
|
data: {
|
|
@@ -56,7 +10,7 @@ export interface ProductItemUpdatedEvent {
|
|
|
56
10
|
product_category: Category;
|
|
57
11
|
category: string;
|
|
58
12
|
brand: string;
|
|
59
|
-
product:
|
|
13
|
+
product: string;
|
|
60
14
|
company: string;
|
|
61
15
|
module: string;
|
|
62
16
|
country: ReceiveCountry;
|
|
@@ -66,4 +20,3 @@ export interface ProductItemUpdatedEvent {
|
|
|
66
20
|
version: number;
|
|
67
21
|
};
|
|
68
22
|
}
|
|
69
|
-
export {};
|
|
@@ -14,7 +14,7 @@ const checkUserAccess = (allowedRoles) => {
|
|
|
14
14
|
else {
|
|
15
15
|
return res
|
|
16
16
|
.status(403)
|
|
17
|
-
.send({ error: "
|
|
17
|
+
.send({ error: "Client level not authorized for this resource" });
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
// Check for provider access if account_type is 'provider' and provider level is in allowedRoles.provider
|