@epztickets/common 1.67.0 → 1.69.0

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.
@@ -15,6 +15,8 @@ export interface OrderCreatedEvent {
15
15
  noiseLevel?: number;
16
16
  timezone?: string;
17
17
  commissionRate?: number;
18
+ selfBooking?: boolean;
19
+ selfBookingFee?: number;
18
20
  expiresAt: Date;
19
21
  sellableUnit: {
20
22
  id: string;
@@ -31,7 +31,8 @@ export declare enum Subjects {
31
31
  UserEmailVerificationRequested = "events.user.email-verification-requested",
32
32
  ConnectDisconnectRequested = "events.user.connect-disconnect-requested",
33
33
  ConnectDisconnectApproved = "events.user.connect-disconnect-approved",
34
- ConnectDisconnectRejected = "events.user.connect-disconnect-rejected"
34
+ ConnectDisconnectRejected = "events.user.connect-disconnect-rejected",
35
+ UserSelfBookingRecorded = "events.user.self-booking-recorded"
35
36
  }
36
37
  export declare enum Streams {
37
38
  Events = "events",
@@ -60,6 +60,16 @@ var Subjects;
60
60
  Subjects["ConnectDisconnectRequested"] = "events.user.connect-disconnect-requested";
61
61
  Subjects["ConnectDisconnectApproved"] = "events.user.connect-disconnect-approved";
62
62
  Subjects["ConnectDisconnectRejected"] = "events.user.connect-disconnect-rejected";
63
+ // Published by orders when an owner self-books a slot on their own
64
+ // room (buyer === owner). Auth consumes to (a) insert a SelfBooking
65
+ // row that accrues toward the monthly Venmo bill, (b) bump the
66
+ // owner's lifetime selfBookingCount surfaced on /currentuser, and
67
+ // (c) publish UserUpdated downstream so other replicas see the new
68
+ // count. The fee snapshot rides on the event — $0 during the
69
+ // owner's free trial, otherwise the per-owner override or platform
70
+ // default ($1). Snapshotting at publish time means rate changes
71
+ // never retroactively affect past bookings.
72
+ Subjects["UserSelfBookingRecorded"] = "events.user.self-booking-recorded";
63
73
  })(Subjects || (exports.Subjects = Subjects = {}));
64
74
  var Streams;
65
75
  (function (Streams) {
@@ -0,0 +1,15 @@
1
+ import { Subjects } from "./subjects";
2
+ export interface UserSelfBookingRecordedEvent {
3
+ subject: Subjects.UserSelfBookingRecorded;
4
+ data: {
5
+ userId: string;
6
+ /** The owning Order's id. Used by auth's OrderCancelled listener
7
+ * to find + cancel the matching SelfBooking row. */
8
+ orderId: string;
9
+ /** Per-booking fee at the moment this booking was created, in
10
+ * cents. 0 during trial; otherwise override or platform default. */
11
+ feeAmount: number;
12
+ /** ISO timestamp of when orders-srv created the booking. */
13
+ recordedAt: string;
14
+ };
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/build/index.d.ts CHANGED
@@ -49,6 +49,7 @@ export * from "./events/user-deleted-event";
49
49
  export * from "./events/user-deletion-requested-event";
50
50
  export * from "./events/user-deletion-rejected-event";
51
51
  export * from "./events/user-email-verification-requested-event";
52
+ export * from "./events/user-self-booking-recorded-event";
52
53
  export * from "./events/connect-disconnect-requested-event";
53
54
  export * from "./events/connect-disconnect-approved-event";
54
55
  export * from "./events/connect-disconnect-rejected-event";
package/build/index.js CHANGED
@@ -69,6 +69,7 @@ __exportStar(require("./events/user-deleted-event"), exports);
69
69
  __exportStar(require("./events/user-deletion-requested-event"), exports);
70
70
  __exportStar(require("./events/user-deletion-rejected-event"), exports);
71
71
  __exportStar(require("./events/user-email-verification-requested-event"), exports);
72
+ __exportStar(require("./events/user-self-booking-recorded-event"), exports);
72
73
  __exportStar(require("./events/connect-disconnect-requested-event"), exports);
73
74
  __exportStar(require("./events/connect-disconnect-approved-event"), exports);
74
75
  __exportStar(require("./events/connect-disconnect-rejected-event"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epztickets/common",
3
- "version": "1.67.0",
3
+ "version": "1.69.0",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [