@sendhome/common 1.0.7 → 1.0.9
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/cart-created-event.d.ts +16 -0
- package/build/events/publishers/cart-created-event.js +2 -0
- package/build/events/publishers/cart-item-created-event.d.ts +19 -0
- package/build/events/publishers/cart-item-created-event.js +2 -0
- package/build/events/publishers/cart-item-updated-event.d.ts +19 -0
- package/build/events/publishers/cart-item-updated-event.js +2 -0
- package/build/events/publishers/cart-updated-event.d.ts +16 -0
- package/build/events/publishers/cart-updated-event.js +2 -0
- package/build/events/publishers/company-created-event.d.ts +2 -1
- package/build/events/publishers/company-updated-event.d.ts +2 -1
- package/build/events/publishers/order-created-event.d.ts +4 -2
- package/build/events/publishers/order-updated-event.d.ts +4 -2
- package/build/events/publishers/product-created-event.d.ts +1 -1
- package/build/events/publishers/product-updated-event.d.ts +1 -1
- package/build/events/subjects/subjects.d.ts +4 -0
- package/build/events/subjects/subjects.js +6 -0
- package/build/events/types/cart-item-status.d.ts +5 -0
- package/build/events/types/cart-item-status.js +12 -0
- package/build/events/types/cart-status.d.ts +5 -0
- package/build/events/types/cart-status.js +12 -0
- package/build/events/types/{company-types.d.ts → company-type.d.ts} +1 -1
- package/build/events/types/company-type.js +9 -0
- package/build/index.d.ts +7 -2
- package/build/index.js +7 -2
- package/package.json +1 -1
- package/build/events/types/category-types.d.ts +0 -5
- package/build/events/types/category-types.js +0 -9
- package/build/events/types/company-types.js +0 -9
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Subjects } from "../subjects/subjects";
|
|
2
|
+
import { CartStatus } from "../types/cart-status";
|
|
3
|
+
export interface CartCreatedEvent {
|
|
4
|
+
subject: Subjects.CartCreated;
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
products: string[];
|
|
8
|
+
bill: number;
|
|
9
|
+
user: string;
|
|
10
|
+
company: string;
|
|
11
|
+
status: CartStatus;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
updated_at: Date;
|
|
14
|
+
version: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Subjects } from "../subjects/subjects";
|
|
2
|
+
import { CartItemStatus } from "../types/cart-item-status";
|
|
3
|
+
export interface CartItemCreatedEvent {
|
|
4
|
+
subject: Subjects.CartItemCreated;
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
product: string;
|
|
8
|
+
name: string;
|
|
9
|
+
price: number;
|
|
10
|
+
commission: number;
|
|
11
|
+
count: number;
|
|
12
|
+
user: string;
|
|
13
|
+
company: string;
|
|
14
|
+
status: CartItemStatus;
|
|
15
|
+
created_at: Date;
|
|
16
|
+
updated_at: Date;
|
|
17
|
+
version: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Subjects } from "../subjects/subjects";
|
|
2
|
+
import { CartItemStatus } from "../types/cart-item-status";
|
|
3
|
+
export interface CartItemUpdatedEvent {
|
|
4
|
+
subject: Subjects.CartItemUpdated;
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
product: string;
|
|
8
|
+
name: string;
|
|
9
|
+
price: number;
|
|
10
|
+
commission: number;
|
|
11
|
+
count: number;
|
|
12
|
+
user: string;
|
|
13
|
+
company: string;
|
|
14
|
+
status: CartItemStatus;
|
|
15
|
+
created_at: Date;
|
|
16
|
+
updated_at: Date;
|
|
17
|
+
version: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Subjects } from "../subjects/subjects";
|
|
2
|
+
import { CartStatus } from "../types/cart-status";
|
|
3
|
+
export interface CartUpdatedEvent {
|
|
4
|
+
subject: Subjects.CartUpdated;
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
products: string[];
|
|
8
|
+
bill: number;
|
|
9
|
+
user: string;
|
|
10
|
+
company: string;
|
|
11
|
+
status: CartStatus;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
updated_at: Date;
|
|
14
|
+
version: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Subjects } from "../subjects/subjects";
|
|
2
2
|
import { CompanyStatus } from "../types/company-status";
|
|
3
|
+
import { CompanyType } from "../types/company-type";
|
|
3
4
|
export interface CompanyCreatedEvent {
|
|
4
5
|
subject: Subjects.CompanyCreated;
|
|
5
6
|
data: {
|
|
@@ -11,7 +12,7 @@ export interface CompanyCreatedEvent {
|
|
|
11
12
|
landlines: string[];
|
|
12
13
|
email: string;
|
|
13
14
|
address: string;
|
|
14
|
-
type:
|
|
15
|
+
type: CompanyType;
|
|
15
16
|
status: CompanyStatus;
|
|
16
17
|
version: number;
|
|
17
18
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Subjects } from "../subjects/subjects";
|
|
2
2
|
import { CompanyStatus } from "../types/company-status";
|
|
3
|
+
import { CompanyType } from "../types/company-type";
|
|
3
4
|
export interface CompanyUpdatedEvent {
|
|
4
5
|
subject: Subjects.CompanyUpdated;
|
|
5
6
|
data: {
|
|
@@ -11,7 +12,7 @@ export interface CompanyUpdatedEvent {
|
|
|
11
12
|
landlines: string[];
|
|
12
13
|
email: string;
|
|
13
14
|
address: string;
|
|
14
|
-
type:
|
|
15
|
+
type: CompanyType;
|
|
15
16
|
status: CompanyStatus;
|
|
16
17
|
version: number;
|
|
17
18
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Subjects } from "../subjects/subjects";
|
|
2
2
|
import { OrderStatus } from "../types/order-status";
|
|
3
|
+
import { CompanyType } from "../types/company-type";
|
|
3
4
|
export interface OrderCreatedEvent {
|
|
4
5
|
subject: Subjects.OrderCreated;
|
|
5
6
|
data: {
|
|
6
7
|
id: string;
|
|
7
8
|
order_number: string;
|
|
8
|
-
order_type:
|
|
9
|
+
order_type: CompanyType;
|
|
10
|
+
entity_data: string;
|
|
9
11
|
entity_id: string;
|
|
10
|
-
|
|
12
|
+
bill: string;
|
|
11
13
|
sender: string;
|
|
12
14
|
receiver: string;
|
|
13
15
|
company: string;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Subjects } from "../subjects/subjects";
|
|
2
2
|
import { OrderStatus } from "../types/order-status";
|
|
3
|
+
import { CompanyType } from "../types/company-type";
|
|
3
4
|
export interface OrderUpdatedEvent {
|
|
4
5
|
subject: Subjects.OrderUpdated;
|
|
5
6
|
data: {
|
|
6
7
|
id: string;
|
|
7
8
|
order_number: string;
|
|
8
|
-
order_type:
|
|
9
|
+
order_type: CompanyType;
|
|
10
|
+
entity_data: string;
|
|
9
11
|
entity_id: string;
|
|
10
|
-
|
|
12
|
+
bill: string;
|
|
11
13
|
sender: string;
|
|
12
14
|
receiver: string;
|
|
13
15
|
company: string;
|
|
@@ -8,6 +8,10 @@ export declare enum Subjects {
|
|
|
8
8
|
BranchUpdated = "branch:updated",
|
|
9
9
|
ProductCreated = "product:created",
|
|
10
10
|
ProductUpdated = "product:updated",
|
|
11
|
+
CartItemCreated = "cart-item:created",
|
|
12
|
+
CartItemUpdated = "cart-item:updated",
|
|
13
|
+
CartCreated = "cart:created",
|
|
14
|
+
CartUpdated = "cart:updated",
|
|
11
15
|
OrderCreated = "order:created",
|
|
12
16
|
OrderUpdated = "order:updated"
|
|
13
17
|
}
|
|
@@ -16,6 +16,12 @@ var Subjects;
|
|
|
16
16
|
// products
|
|
17
17
|
Subjects["ProductCreated"] = "product:created";
|
|
18
18
|
Subjects["ProductUpdated"] = "product:updated";
|
|
19
|
+
// cartItem
|
|
20
|
+
Subjects["CartItemCreated"] = "cart-item:created";
|
|
21
|
+
Subjects["CartItemUpdated"] = "cart-item:updated";
|
|
22
|
+
// cart
|
|
23
|
+
Subjects["CartCreated"] = "cart:created";
|
|
24
|
+
Subjects["CartUpdated"] = "cart:updated";
|
|
19
25
|
// Orders
|
|
20
26
|
Subjects["OrderCreated"] = "order:created";
|
|
21
27
|
Subjects["OrderUpdated"] = "order:updated";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CartItemStatus = void 0;
|
|
4
|
+
var CartItemStatus;
|
|
5
|
+
(function (CartItemStatus) {
|
|
6
|
+
// Cart created
|
|
7
|
+
CartItemStatus["Created"] = "created";
|
|
8
|
+
// Cart deleted
|
|
9
|
+
CartItemStatus["Deleted"] = "deleted";
|
|
10
|
+
// Cart expired
|
|
11
|
+
CartItemStatus["Expired"] = "expired";
|
|
12
|
+
})(CartItemStatus = exports.CartItemStatus || (exports.CartItemStatus = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CartStatus = void 0;
|
|
4
|
+
var CartStatus;
|
|
5
|
+
(function (CartStatus) {
|
|
6
|
+
// Cart created
|
|
7
|
+
CartStatus["Created"] = "created";
|
|
8
|
+
// Cart deleted
|
|
9
|
+
CartStatus["Deleted"] = "deleted";
|
|
10
|
+
// Cart expired
|
|
11
|
+
CartStatus["Expired"] = "expired";
|
|
12
|
+
})(CartStatus = exports.CartStatus || (exports.CartStatus = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompanyType = void 0;
|
|
4
|
+
var CompanyType;
|
|
5
|
+
(function (CompanyType) {
|
|
6
|
+
CompanyType["Supermarket"] = "supermarket";
|
|
7
|
+
CompanyType["Hardware"] = "hardware";
|
|
8
|
+
CompanyType["Electricity"] = "electricity";
|
|
9
|
+
})(CompanyType = exports.CompanyType || (exports.CompanyType = {}));
|
package/build/index.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export * from './events/base-publisher';
|
|
|
13
13
|
export * from './events/subjects/subjects';
|
|
14
14
|
export * from './events/publishers/branch-created-event';
|
|
15
15
|
export * from './events/publishers/branch-updated-event';
|
|
16
|
+
export * from './events/publishers/cart-created-event';
|
|
17
|
+
export * from './events/publishers/cart-updated-event';
|
|
18
|
+
export * from './events/publishers/cart-item-created-event';
|
|
19
|
+
export * from './events/publishers/cart-item-updated-event';
|
|
16
20
|
export * from './events/publishers/company-created-event';
|
|
17
21
|
export * from './events/publishers/company-updated-event';
|
|
18
22
|
export * from './events/publishers/order-created-event';
|
|
@@ -22,9 +26,10 @@ export * from './events/publishers/product-updated-event';
|
|
|
22
26
|
export * from './events/publishers/user-created-event';
|
|
23
27
|
export * from './events/publishers/user-updated-event';
|
|
24
28
|
export * from './events/types/branch-status';
|
|
25
|
-
export * from './events/types/
|
|
29
|
+
export * from './events/types/cart-status';
|
|
30
|
+
export * from './events/types/cart-item-status';
|
|
26
31
|
export * from './events/types/company-status';
|
|
27
|
-
export * from './events/types/company-
|
|
32
|
+
export * from './events/types/company-type';
|
|
28
33
|
export * from './events/types/order-status';
|
|
29
34
|
export * from './events/types/product-status';
|
|
30
35
|
export * from './events/types/user-roles';
|
package/build/index.js
CHANGED
|
@@ -26,6 +26,10 @@ __exportStar(require("./events/base-publisher"), exports);
|
|
|
26
26
|
__exportStar(require("./events/subjects/subjects"), exports);
|
|
27
27
|
__exportStar(require("./events/publishers/branch-created-event"), exports);
|
|
28
28
|
__exportStar(require("./events/publishers/branch-updated-event"), exports);
|
|
29
|
+
__exportStar(require("./events/publishers/cart-created-event"), exports);
|
|
30
|
+
__exportStar(require("./events/publishers/cart-updated-event"), exports);
|
|
31
|
+
__exportStar(require("./events/publishers/cart-item-created-event"), exports);
|
|
32
|
+
__exportStar(require("./events/publishers/cart-item-updated-event"), exports);
|
|
29
33
|
__exportStar(require("./events/publishers/company-created-event"), exports);
|
|
30
34
|
__exportStar(require("./events/publishers/company-updated-event"), exports);
|
|
31
35
|
__exportStar(require("./events/publishers/order-created-event"), exports);
|
|
@@ -35,9 +39,10 @@ __exportStar(require("./events/publishers/product-updated-event"), exports);
|
|
|
35
39
|
__exportStar(require("./events/publishers/user-created-event"), exports);
|
|
36
40
|
__exportStar(require("./events/publishers/user-updated-event"), exports);
|
|
37
41
|
__exportStar(require("./events/types/branch-status"), exports);
|
|
38
|
-
__exportStar(require("./events/types/
|
|
42
|
+
__exportStar(require("./events/types/cart-status"), exports);
|
|
43
|
+
__exportStar(require("./events/types/cart-item-status"), exports);
|
|
39
44
|
__exportStar(require("./events/types/company-status"), exports);
|
|
40
|
-
__exportStar(require("./events/types/company-
|
|
45
|
+
__exportStar(require("./events/types/company-type"), exports);
|
|
41
46
|
__exportStar(require("./events/types/order-status"), exports);
|
|
42
47
|
__exportStar(require("./events/types/product-status"), exports);
|
|
43
48
|
__exportStar(require("./events/types/user-roles"), exports);
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CategoryTypes = void 0;
|
|
4
|
-
var CategoryTypes;
|
|
5
|
-
(function (CategoryTypes) {
|
|
6
|
-
CategoryTypes["Mathematics"] = "mathematics";
|
|
7
|
-
CategoryTypes["Science"] = "science";
|
|
8
|
-
CategoryTypes["Geography"] = "geography";
|
|
9
|
-
})(CategoryTypes = exports.CategoryTypes || (exports.CategoryTypes = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompanyTypes = void 0;
|
|
4
|
-
var CompanyTypes;
|
|
5
|
-
(function (CompanyTypes) {
|
|
6
|
-
CompanyTypes["Supermarket"] = "supermarket";
|
|
7
|
-
CompanyTypes["Hardware"] = "hardware";
|
|
8
|
-
CompanyTypes["Electricity"] = "electricity";
|
|
9
|
-
})(CompanyTypes = exports.CompanyTypes || (exports.CompanyTypes = {}));
|