@sendhome/common 1.0.87 → 1.0.88
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/build/events/publishers/product-created-event.d.ts +27 -0
- package/build/events/publishers/product-updated-event.d.ts +27 -0
- package/build/events/types/company-type.d.ts +2 -2
- package/build/events/types/company-type.js +2 -2
- package/build/events/types/unit-type.d.ts +7 -0
- package/build/events/types/unit-type.js +11 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { Subjects } from "../subjects/subjects";
|
|
2
2
|
import { ProductStatus } from "../types/product-status";
|
|
3
3
|
import { CompanyType } from "../types/company-type";
|
|
4
|
+
import { UnitType } from "../types/unit-type";
|
|
4
5
|
import { Country } from "../types/country";
|
|
6
|
+
interface IGroceriesFields {
|
|
7
|
+
expiration_date?: Date;
|
|
8
|
+
brand?: string;
|
|
9
|
+
weight?: number;
|
|
10
|
+
}
|
|
11
|
+
interface IHardwareFields {
|
|
12
|
+
brand?: string;
|
|
13
|
+
model?: string;
|
|
14
|
+
warranty_period?: string;
|
|
15
|
+
specifications?: string;
|
|
16
|
+
}
|
|
17
|
+
interface IClothingFields {
|
|
18
|
+
size?: string;
|
|
19
|
+
color?: string;
|
|
20
|
+
material?: string;
|
|
21
|
+
care_instructions?: string;
|
|
22
|
+
}
|
|
23
|
+
interface IFuelCouponFields {
|
|
24
|
+
discount_percentage?: number;
|
|
25
|
+
expiration_date?: Date;
|
|
26
|
+
usage_restrictions?: string;
|
|
27
|
+
}
|
|
5
28
|
export interface ProductCreatedEvent {
|
|
6
29
|
subject: Subjects.ProductCreated;
|
|
7
30
|
data: {
|
|
@@ -15,6 +38,9 @@ export interface ProductCreatedEvent {
|
|
|
15
38
|
category: string;
|
|
16
39
|
brand: string;
|
|
17
40
|
price: number;
|
|
41
|
+
unit?: UnitType;
|
|
42
|
+
unitValue?: number;
|
|
43
|
+
properties: IGroceriesFields | IHardwareFields | IClothingFields | IFuelCouponFields | {};
|
|
18
44
|
status: ProductStatus;
|
|
19
45
|
company: string;
|
|
20
46
|
country: Country;
|
|
@@ -23,3 +49,4 @@ export interface ProductCreatedEvent {
|
|
|
23
49
|
version: number;
|
|
24
50
|
};
|
|
25
51
|
}
|
|
52
|
+
export {};
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { Subjects } from "../subjects/subjects";
|
|
2
2
|
import { ProductStatus } from "../types/product-status";
|
|
3
3
|
import { CompanyType } from "../types/company-type";
|
|
4
|
+
import { UnitType } from "../types/unit-type";
|
|
4
5
|
import { Country } from "../types/country";
|
|
6
|
+
interface IGroceriesFields {
|
|
7
|
+
expiration_date?: Date;
|
|
8
|
+
brand?: string;
|
|
9
|
+
weight?: number;
|
|
10
|
+
}
|
|
11
|
+
interface IHardwareFields {
|
|
12
|
+
brand?: string;
|
|
13
|
+
model?: string;
|
|
14
|
+
warranty_period?: string;
|
|
15
|
+
specifications?: string;
|
|
16
|
+
}
|
|
17
|
+
interface IClothingFields {
|
|
18
|
+
size?: string;
|
|
19
|
+
color?: string;
|
|
20
|
+
material?: string;
|
|
21
|
+
care_instructions?: string;
|
|
22
|
+
}
|
|
23
|
+
interface IFuelCouponFields {
|
|
24
|
+
discount_percentage?: number;
|
|
25
|
+
expiration_date?: Date;
|
|
26
|
+
usage_restrictions?: string;
|
|
27
|
+
}
|
|
5
28
|
export interface ProductUpdatedEvent {
|
|
6
29
|
subject: Subjects.ProductUpdated;
|
|
7
30
|
data: {
|
|
@@ -15,6 +38,9 @@ export interface ProductUpdatedEvent {
|
|
|
15
38
|
category: string;
|
|
16
39
|
brand: string;
|
|
17
40
|
price: number;
|
|
41
|
+
unit?: UnitType;
|
|
42
|
+
unitValue?: number;
|
|
43
|
+
properties: IGroceriesFields | IHardwareFields | IClothingFields | IFuelCouponFields | {};
|
|
18
44
|
status: ProductStatus;
|
|
19
45
|
company: string;
|
|
20
46
|
country: Country;
|
|
@@ -23,3 +49,4 @@ export interface ProductUpdatedEvent {
|
|
|
23
49
|
version: number;
|
|
24
50
|
};
|
|
25
51
|
}
|
|
52
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare enum CompanyType {
|
|
2
|
-
|
|
2
|
+
Groceries = "groceries",
|
|
3
3
|
Hardware = "hardware",
|
|
4
4
|
Electricity = "electricity",
|
|
5
5
|
Clothing = "clothing",
|
|
6
6
|
Fuel = "fuel",
|
|
7
7
|
Furniture = "furniture",
|
|
8
|
-
|
|
8
|
+
Transfer = "transfer",
|
|
9
9
|
Farming = "farming",
|
|
10
10
|
Pharmacy = "pharmacy"
|
|
11
11
|
}
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CompanyType = void 0;
|
|
4
4
|
var CompanyType;
|
|
5
5
|
(function (CompanyType) {
|
|
6
|
-
CompanyType["
|
|
6
|
+
CompanyType["Groceries"] = "groceries";
|
|
7
7
|
CompanyType["Hardware"] = "hardware";
|
|
8
8
|
CompanyType["Electricity"] = "electricity";
|
|
9
9
|
CompanyType["Clothing"] = "clothing";
|
|
10
10
|
CompanyType["Fuel"] = "fuel";
|
|
11
11
|
CompanyType["Furniture"] = "furniture";
|
|
12
|
-
CompanyType["
|
|
12
|
+
CompanyType["Transfer"] = "transfer";
|
|
13
13
|
CompanyType["Farming"] = "farming";
|
|
14
14
|
CompanyType["Pharmacy"] = "pharmacy";
|
|
15
15
|
})(CompanyType = exports.CompanyType || (exports.CompanyType = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnitType = void 0;
|
|
4
|
+
var UnitType;
|
|
5
|
+
(function (UnitType) {
|
|
6
|
+
UnitType["Kilogram"] = "kg";
|
|
7
|
+
UnitType["Gram"] = "g";
|
|
8
|
+
UnitType["Litre"] = "l";
|
|
9
|
+
UnitType["Piece"] = "pc";
|
|
10
|
+
UnitType["Meter"] = "m";
|
|
11
|
+
})(UnitType = exports.UnitType || (exports.UnitType = {}));
|
package/build/index.d.ts
CHANGED
|
@@ -63,5 +63,6 @@ export * from './events/types/product-status';
|
|
|
63
63
|
export * from './events/types/receive-country';
|
|
64
64
|
export * from './events/types/recipient-status';
|
|
65
65
|
export * from './events/types/send-country';
|
|
66
|
+
export * from './events/types/unit-type';
|
|
66
67
|
export * from './events/types/user-roles';
|
|
67
68
|
export * from './events/types/user-status';
|
package/build/index.js
CHANGED
|
@@ -76,5 +76,6 @@ __exportStar(require("./events/types/product-status"), exports);
|
|
|
76
76
|
__exportStar(require("./events/types/receive-country"), exports);
|
|
77
77
|
__exportStar(require("./events/types/recipient-status"), exports);
|
|
78
78
|
__exportStar(require("./events/types/send-country"), exports);
|
|
79
|
+
__exportStar(require("./events/types/unit-type"), exports);
|
|
79
80
|
__exportStar(require("./events/types/user-roles"), exports);
|
|
80
81
|
__exportStar(require("./events/types/user-status"), exports);
|