@sendhome/common 1.0.100 → 1.0.102

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.
@@ -0,0 +1,41 @@
1
+ import { Subjects } from "../subjects/subjects";
2
+ import { PaymentStatus } from "../types/payment-status";
3
+ import { SendCountry } from "../types/send-country";
4
+ import { ReceiveCountry } from "../types/receive-country";
5
+ interface CardDetails {
6
+ card_number: string;
7
+ expiration_date: string;
8
+ cvv: string;
9
+ }
10
+ interface PaypalDetails {
11
+ email: string;
12
+ }
13
+ interface ApplePayDetails {
14
+ apple_id: string;
15
+ }
16
+ interface BankTransferDetails {
17
+ account_number: string;
18
+ bank_name: string;
19
+ }
20
+ declare type PaymentDetails = CardDetails | PaypalDetails | ApplePayDetails | BankTransferDetails;
21
+ export interface PaymentCreatedEvent {
22
+ subject: Subjects.PaymentCreated;
23
+ data: {
24
+ id: string;
25
+ payment_id: number;
26
+ payment_method: "card" | "paypal" | "applePay" | "bankTransfer";
27
+ amount: number;
28
+ company: string;
29
+ module: string;
30
+ user: string;
31
+ order: string;
32
+ send_country: SendCountry;
33
+ receive_country: ReceiveCountry;
34
+ details: PaymentDetails;
35
+ created_at: Date;
36
+ updated_at: Date;
37
+ status: PaymentStatus;
38
+ version: number;
39
+ };
40
+ }
41
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,41 @@
1
+ import { Subjects } from "../subjects/subjects";
2
+ import { PaymentStatus } from "../types/payment-status";
3
+ import { SendCountry } from "../types/send-country";
4
+ import { ReceiveCountry } from "../types/receive-country";
5
+ interface CardDetails {
6
+ card_number: string;
7
+ expiration_date: string;
8
+ cvv: string;
9
+ }
10
+ interface PaypalDetails {
11
+ email: string;
12
+ }
13
+ interface ApplePayDetails {
14
+ apple_id: string;
15
+ }
16
+ interface BankTransferDetails {
17
+ account_number: string;
18
+ bank_name: string;
19
+ }
20
+ declare type PaymentDetails = CardDetails | PaypalDetails | ApplePayDetails | BankTransferDetails;
21
+ export interface PaymentUpdatedEvent {
22
+ subject: Subjects.PaymentUpdated;
23
+ data: {
24
+ id: string;
25
+ payment_id: number;
26
+ payment_method: "card" | "paypal" | "applePay" | "bankTransfer";
27
+ amount: number;
28
+ company: string;
29
+ module: string;
30
+ user: string;
31
+ order: string;
32
+ send_country: SendCountry;
33
+ receive_country: ReceiveCountry;
34
+ details: PaymentDetails;
35
+ created_at: Date;
36
+ updated_at: Date;
37
+ status: PaymentStatus;
38
+ version: number;
39
+ };
40
+ }
41
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -36,5 +36,7 @@ export declare enum Subjects {
36
36
  CouponUpdated = "coupon:updated",
37
37
  CouponExpired = "coupon:Expired",
38
38
  CollectionCreated = "collection:created",
39
- CollectionUpdated = "collection:updated"
39
+ CollectionUpdated = "collection:updated",
40
+ PaymentCreated = "payment:created",
41
+ PaymentUpdated = "payment:updated"
40
42
  }
@@ -56,4 +56,7 @@ var Subjects;
56
56
  // Collection
57
57
  Subjects["CollectionCreated"] = "collection:created";
58
58
  Subjects["CollectionUpdated"] = "collection:updated";
59
+ // Payment
60
+ Subjects["PaymentCreated"] = "payment:created";
61
+ Subjects["PaymentUpdated"] = "payment:updated";
59
62
  })(Subjects = exports.Subjects || (exports.Subjects = {}));
@@ -1,5 +1,6 @@
1
1
  export declare enum OrderStatus {
2
2
  Created = "created",
3
+ Pending = "pending",
3
4
  Declined = "declined",
4
5
  Partial = "partial",
5
6
  Collected = "collected",
@@ -5,6 +5,8 @@ var OrderStatus;
5
5
  (function (OrderStatus) {
6
6
  // order created
7
7
  OrderStatus["Created"] = "created";
8
+ // order pending
9
+ OrderStatus["Pending"] = "pending";
8
10
  // order declined
9
11
  OrderStatus["Declined"] = "declined";
10
12
  // order partially collected
@@ -0,0 +1,5 @@
1
+ export declare enum PaymentStatus {
2
+ Pending = "pending",
3
+ Completed = "completed",
4
+ Failed = "failed"
5
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentStatus = void 0;
4
+ var PaymentStatus;
5
+ (function (PaymentStatus) {
6
+ // order pending
7
+ PaymentStatus["Pending"] = "pending";
8
+ // order completed
9
+ PaymentStatus["Completed"] = "completed";
10
+ // order failed
11
+ PaymentStatus["Failed"] = "failed";
12
+ })(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
package/build/index.d.ts CHANGED
@@ -40,6 +40,9 @@ export * from './events/publishers/order-expiration-completed';
40
40
  export * from './events/publishers/order-expiration-event';
41
41
  export * from './events/publishers/order-expiration-warning';
42
42
  export * from './events/publishers/order-updated-event';
43
+ export * from './events/publishers/payment-created-event';
44
+ export * from './events/publishers/payment-updated-event';
45
+ export * from './events/publishers/order-updated-event';
43
46
  export * from './events/publishers/product-created-event';
44
47
  export * from './events/publishers/product-updated-event';
45
48
  export * from './events/publishers/recipient-created-event';
@@ -60,6 +63,7 @@ export * from './events/types/coupon-status';
60
63
  export * from './events/types/media-status';
61
64
  export * from './events/types/module-status';
62
65
  export * from './events/types/order-status';
66
+ export * from './events/types/payment-status';
63
67
  export * from './events/types/product-status';
64
68
  export * from './events/types/receive-country';
65
69
  export * from './events/types/recipient-status';
package/build/index.js CHANGED
@@ -53,6 +53,9 @@ __exportStar(require("./events/publishers/order-expiration-completed"), exports)
53
53
  __exportStar(require("./events/publishers/order-expiration-event"), exports);
54
54
  __exportStar(require("./events/publishers/order-expiration-warning"), exports);
55
55
  __exportStar(require("./events/publishers/order-updated-event"), exports);
56
+ __exportStar(require("./events/publishers/payment-created-event"), exports);
57
+ __exportStar(require("./events/publishers/payment-updated-event"), exports);
58
+ __exportStar(require("./events/publishers/order-updated-event"), exports);
56
59
  __exportStar(require("./events/publishers/product-created-event"), exports);
57
60
  __exportStar(require("./events/publishers/product-updated-event"), exports);
58
61
  __exportStar(require("./events/publishers/recipient-created-event"), exports);
@@ -73,6 +76,7 @@ __exportStar(require("./events/types/coupon-status"), exports);
73
76
  __exportStar(require("./events/types/media-status"), exports);
74
77
  __exportStar(require("./events/types/module-status"), exports);
75
78
  __exportStar(require("./events/types/order-status"), exports);
79
+ __exportStar(require("./events/types/payment-status"), exports);
76
80
  __exportStar(require("./events/types/product-status"), exports);
77
81
  __exportStar(require("./events/types/receive-country"), exports);
78
82
  __exportStar(require("./events/types/recipient-status"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendhome/common",
3
- "version": "1.0.100",
3
+ "version": "1.0.102",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",