@tabletennisshop/common 1.0.83 → 1.0.85

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.
@@ -1,8 +1,7 @@
1
- import { Types } from "mongoose";
2
1
  import { SubjectsEnum } from "../enums/event-subject.enum";
3
2
  interface InventoryAttrs {
4
- _id: Types.ObjectId;
5
- product_id: Types.ObjectId;
3
+ _id: string;
4
+ product_id: string;
6
5
  total_quantity: number;
7
6
  version: number;
8
7
  }
@@ -13,6 +13,7 @@ class ListenerAbstract {
13
13
  .setManualAckMode(true) // Handle ACK Mode Manually
14
14
  .setAckWait(this.ackWait) // Wait 5 seconds before resending the message
15
15
  // Assigns a durable name to the subscription.
16
+ // Durable name can be shared among replicas
16
17
  // This allows the server to remember the last acknowledged message for this listener,
17
18
  // so if it disconnects and reconnects,
18
19
  // it will only receive new messages (not ones it already processed).
@@ -1,10 +1,9 @@
1
- import { Types } from "mongoose";
2
1
  import { SubjectsEnum } from "../enums/event-subject.enum";
3
2
  import { OrderStatusEnum } from "../enums/order-status.enum";
4
3
  import { PaymentMethodEnum } from "../enums/payment-method.enum";
5
4
  interface OrderAttrs {
6
- _id: Types.ObjectId;
7
- user_id: Types.ObjectId;
5
+ _id: string;
6
+ user_id: string;
8
7
  status: OrderStatusEnum;
9
8
  payment_method: PaymentMethodEnum;
10
9
  total_price: number;
@@ -21,7 +20,7 @@ export interface OrderUpdatedEventInterface {
21
20
  export interface OrderCancelledEventInterface {
22
21
  subject: SubjectsEnum.OrderCancelled;
23
22
  data: {
24
- id: Types.ObjectId;
23
+ id: string;
25
24
  version: number;
26
25
  };
27
26
  }
@@ -1,9 +1,8 @@
1
- import { Types } from "mongoose";
2
1
  import { SubjectsEnum } from "../enums/event-subject.enum";
3
2
  import { PaymentStatus } from "../enums/payment-status.enum";
4
3
  interface PaymentAttrs {
5
- _id: Types.ObjectId;
6
- order_id: Types.ObjectId;
4
+ _id: string;
5
+ order_id: string;
7
6
  status: PaymentStatus;
8
7
  version: string;
9
8
  }
@@ -1,14 +1,9 @@
1
- import { Types } from "mongoose";
2
1
  import { SubjectsEnum } from "../enums/event-subject.enum";
3
- import { OrderStatusEnum } from "../enums/order-status.enum";
4
- import { PaymentMethodEnum } from "../enums/payment-method.enum";
2
+ import { ProductStatusEnum } from "../enums/product-status.enum";
5
3
  interface ProductAttrs {
6
- _id: Types.ObjectId;
7
- user_id: Types.ObjectId;
8
- status: OrderStatusEnum;
9
- payment_method: PaymentMethodEnum;
10
- total_price: number;
11
- version: number;
4
+ _id: string;
5
+ status: ProductStatusEnum;
6
+ price: number;
12
7
  }
13
8
  export interface ProductUpdatedEventInterface {
14
9
  subject: SubjectsEnum.ProductUpdated;
@@ -21,7 +16,7 @@ export interface ProductCreatedEventInterface {
21
16
  export interface ProductDeletedEventInterface {
22
17
  subject: SubjectsEnum.ProductDeleted;
23
18
  data: {
24
- _id: Types.ObjectId;
19
+ _id: string;
25
20
  };
26
21
  }
27
22
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tabletennisshop/common",
3
- "version": "1.0.83",
3
+ "version": "1.0.85",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "build/index.d.ts",