@rentbase/common 1.0.12 → 1.0.14

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.
@@ -4,17 +4,16 @@
4
4
  */
5
5
  export interface ChatSessionCreatedEvent {
6
6
  session_id: string;
7
- session_type: "trip" | "support" | "system";
8
- trip_id?: string;
9
- seat_booking_id?: string;
10
- rider_auth_user_id?: string;
11
- driver_auth_user_id?: string;
7
+ session_type: "property" | "support" | "system";
8
+ property_id?: string;
9
+ tenant_auth_user_id?: string;
10
+ landlord_auth_user_id?: string;
12
11
  participant_count: number;
13
12
  created_at: string;
14
13
  }
15
14
  export interface ChatSessionClosedEvent {
16
15
  session_id: string;
17
- trip_id?: string;
16
+ property_id?: string;
18
17
  closed_by_auth_user_id?: string;
19
18
  reason?: string;
20
19
  total_messages: number;
@@ -23,17 +22,18 @@ export interface ChatSessionClosedEvent {
23
22
  }
24
23
  export interface ChatParticipantMutedEvent {
25
24
  session_id: string;
25
+ property_id?: string;
26
26
  auth_user_id: string;
27
- role: "rider" | "driver" | "support_agent";
27
+ role: "tenant" | "landlord" | "support_agent";
28
28
  muted: boolean;
29
29
  muted_at: string;
30
30
  }
31
31
  export interface MessageSentEvent {
32
32
  message_id: string;
33
33
  session_id: string;
34
- trip_id?: string;
34
+ property_id?: string;
35
35
  sender_auth_user_id: string;
36
- sender_role: "rider" | "driver" | "support_agent";
36
+ sender_role: "tenant" | "landlord" | "support_agent";
37
37
  message_type: "text" | "image" | "audio" | "system";
38
38
  has_attachments: boolean;
39
39
  attachment_count: number;
@@ -41,14 +41,27 @@ export interface MessageSentEvent {
41
41
  system_event_key?: string;
42
42
  sent_at: string;
43
43
  }
44
+ /**
45
+ * ChatPushMessageCreatedEvent
46
+ * Push-friendly event emitted by chat-messaging-service.
47
+ * Includes explicit recipients so notifications-service can send push without extra DB lookups.
48
+ */
49
+ export interface ChatPushMessageCreatedEvent {
50
+ sessionId: string;
51
+ senderAuthUserId: string;
52
+ recipientAuthUserIds: string[];
53
+ previewText?: string;
54
+ }
44
55
  export interface MessageDeliveredEvent {
45
56
  message_id: string;
46
57
  session_id: string;
58
+ property_id?: string;
47
59
  recipient_auth_user_id: string;
48
60
  delivered_at: string;
49
61
  }
50
62
  export interface MessageReadEvent {
51
63
  session_id: string;
64
+ property_id?: string;
52
65
  reader_auth_user_id: string;
53
66
  last_read_message_id: string;
54
67
  unread_count_before: number;
@@ -57,19 +70,19 @@ export interface MessageReadEvent {
57
70
  export interface SystemMessageAddedEvent {
58
71
  message_id: string;
59
72
  session_id: string;
60
- trip_id?: string;
73
+ property_id?: string;
61
74
  system_event_key: string;
62
75
  message_text: string;
63
76
  added_at: string;
64
77
  }
65
78
  export interface CallInitiatedEvent {
66
79
  call_session_id: string;
67
- trip_id?: string;
80
+ property_id?: string;
68
81
  chat_session_id?: string;
69
82
  caller_auth_user_id: string;
70
- caller_role: "rider" | "driver" | "support_agent";
83
+ caller_role: "tenant" | "landlord" | "support_agent";
71
84
  callee_auth_user_id: string;
72
- callee_role: "rider" | "driver" | "support_agent";
85
+ callee_role: "tenant" | "landlord" | "support_agent";
73
86
  call_type: "audio" | "video";
74
87
  provider_name: string;
75
88
  provider_room_id: string;
@@ -77,6 +90,8 @@ export interface CallInitiatedEvent {
77
90
  }
78
91
  export interface CallRingingEvent {
79
92
  call_session_id: string;
93
+ chat_session_id?: string;
94
+ property_id?: string;
80
95
  caller_auth_user_id: string;
81
96
  callee_auth_user_id: string;
82
97
  call_type: "audio" | "video";
@@ -85,6 +100,8 @@ export interface CallRingingEvent {
85
100
  }
86
101
  export interface CallAnsweredEvent {
87
102
  call_session_id: string;
103
+ chat_session_id?: string;
104
+ property_id?: string;
88
105
  caller_auth_user_id: string;
89
106
  callee_auth_user_id: string;
90
107
  call_type: "audio" | "video";
@@ -93,6 +110,8 @@ export interface CallAnsweredEvent {
93
110
  }
94
111
  export interface CallRejectedEvent {
95
112
  call_session_id: string;
113
+ chat_session_id?: string;
114
+ property_id?: string;
96
115
  caller_auth_user_id: string;
97
116
  callee_auth_user_id: string;
98
117
  rejected_by_auth_user_id: string;
@@ -101,6 +120,8 @@ export interface CallRejectedEvent {
101
120
  }
102
121
  export interface CallMissedEvent {
103
122
  call_session_id: string;
123
+ chat_session_id?: string;
124
+ property_id?: string;
104
125
  caller_auth_user_id: string;
105
126
  callee_auth_user_id: string;
106
127
  ring_duration_seconds?: number;
@@ -108,6 +129,8 @@ export interface CallMissedEvent {
108
129
  }
109
130
  export interface CallEndedEvent {
110
131
  call_session_id: string;
132
+ chat_session_id?: string;
133
+ property_id?: string;
111
134
  caller_auth_user_id: string;
112
135
  callee_auth_user_id: string;
113
136
  call_type: "audio" | "video";
@@ -118,6 +141,8 @@ export interface CallEndedEvent {
118
141
  }
119
142
  export interface CallFailedEvent {
120
143
  call_session_id: string;
144
+ chat_session_id?: string;
145
+ property_id?: string;
121
146
  caller_auth_user_id: string;
122
147
  callee_auth_user_id: string;
123
148
  error_code?: string;
@@ -127,6 +152,8 @@ export interface CallFailedEvent {
127
152
  }
128
153
  export interface CallRatedEvent {
129
154
  call_session_id: string;
155
+ chat_session_id?: string;
156
+ property_id?: string;
130
157
  rated_by_auth_user_id: string;
131
158
  rated_as: "caller" | "callee";
132
159
  rating: number;
@@ -135,6 +162,8 @@ export interface CallRatedEvent {
135
162
  }
136
163
  export interface CallProviderStatusUpdateEvent {
137
164
  call_session_id: string;
165
+ chat_session_id?: string;
166
+ property_id?: string;
138
167
  provider_name: string;
139
168
  provider_status: string;
140
169
  previous_status: string;
@@ -5,7 +5,8 @@ import { PropertyCreatedEvent, PropertyUpdatedEvent, PropertyStatusChangedEvent,
5
5
  import { NotificationCreatedEvent, NotificationSentEvent, NotificationDeliveredEvent, NotificationFailedEvent, NotificationReadEvent, NotificationPreferencesUpdatedEvent, NotificationTemplateCreatedEvent, NotificationTemplateUpdatedEvent, NotificationBulkSendInitiatedEvent, NotificationBulkSendCompletedEvent } from "./notification-events";
6
6
  import { IncidentReportCreatedEvent, IncidentReportUpdatedEvent, IncidentReportResolvedEvent, SOSTriggeredEvent, SOSAcknowledgedEvent, SOSRespondingEvent, SOSResolvedEvent, DisciplinaryActionCreatedEvent, DisciplinaryActionActivatedEvent, DisciplinaryActionRevokedEvent, SafetyNoteCreatedEvent, SafetyAuditLogCreatedEvent } from "./safety-events";
7
7
  import { WalletCreatedEvent, WalletAdjustedEvent, WalletBalanceUpdatedEvent, WalletStatusChangedEvent, WalletTransactionCreatedEvent, TransactionStatusChangedEvent, PaymentIntentCreatedEvent, PaymentIntentSucceededEvent, PaymentIntentFailedEvent, PaymentIntentCancelledEvent, PaymentChargeRefundedEvent, PayoutRequestedEvent, PayoutApprovedEvent, PayoutProcessingEvent, PayoutSucceededEvent, PayoutFailedEvent, PayoutCancelledEvent, WebhookReceivedEvent, WebhookProcessedEvent } from "./payment-events";
8
- import { ChatSessionCreatedEvent, ChatSessionClosedEvent, ChatParticipantMutedEvent, MessageSentEvent, MessageDeliveredEvent, MessageReadEvent, SystemMessageAddedEvent, CallInitiatedEvent, CallRingingEvent, CallAnsweredEvent, CallRejectedEvent, CallMissedEvent, CallEndedEvent, CallFailedEvent, CallRatedEvent, CallProviderStatusUpdateEvent } from "./chat-events";
8
+ import { ChatSessionCreatedEvent, ChatSessionClosedEvent, ChatParticipantMutedEvent, ChatPushMessageCreatedEvent, MessageSentEvent, MessageDeliveredEvent, MessageReadEvent, SystemMessageAddedEvent, CallInitiatedEvent, CallRingingEvent, CallAnsweredEvent, CallRejectedEvent, CallMissedEvent, CallEndedEvent, CallFailedEvent, CallRatedEvent, CallProviderStatusUpdateEvent } from "./chat-events";
9
+ import { PropertyEnquiryCreatedEvent, PropertyEnquiryStatusChangedEvent } from "./property-enquiry-events";
9
10
  import { CampaignCreatedEvent, CampaignActivatedEvent, CampaignStatusChangedEvent, CampaignExpiredEvent, PromoCodeCreatedEvent, PromoCodeBulkCreatedEvent, PromoCodeAppliedEvent, PromoCodeStatusChangedEvent, ReferralCodeGeneratedEvent, ReferralClaimedEvent, ReferralQualifiedEvent, ReferralRewardsGrantedEvent, ReferralStatusChangedEvent, RewardCreditIssuedEvent, RewardCreditUsedEvent, RewardCreditExpiredEvent, RewardCreditCancelledEvent, DiscountCalculatedEvent, DiscountAppliedEvent, CampaignRedemptionEvent, ReferralConversionEvent } from "./promotion-events";
10
11
  import { KycDocumentUploadedEvent, KycDocumentVerifiedEvent, KycDocumentRejectedEvent, KycDocumentDeletedEvent, LandlordApplicationCreatedEvent, LandlordApplicationSubmittedEvent, LandlordApplicationUnderReviewEvent, LandlordApplicationNeedsInfoEvent, LandlordApplicationApprovedEvent, LandlordApplicationRejectedEvent, LandlordApplicationUpdatedEvent } from "./kyc-events";
11
12
  export interface EventMap {
@@ -24,6 +25,8 @@ export interface EventMap {
24
25
  "property.status_changed": PropertyStatusChangedEvent;
25
26
  "property.deleted": PropertyDeletedEvent;
26
27
  "property.viewed": PropertyViewedEvent;
28
+ "property.enquiry.created": PropertyEnquiryCreatedEvent;
29
+ "property.enquiry.status.changed": PropertyEnquiryStatusChangedEvent;
27
30
  "property_offer.created": PropertyOfferCreatedEvent;
28
31
  "property_offer.updated": PropertyOfferUpdatedEvent;
29
32
  "property_offer.accepted": PropertyOfferAcceptedEvent;
@@ -89,6 +92,7 @@ export interface EventMap {
89
92
  "chat.session.created": ChatSessionCreatedEvent;
90
93
  "chat.session.closed": ChatSessionClosedEvent;
91
94
  "chat.participant.muted": ChatParticipantMutedEvent;
95
+ "chat.push.message.created": ChatPushMessageCreatedEvent;
92
96
  "message.sent": MessageSentEvent;
93
97
  "message.delivered": MessageDeliveredEvent;
94
98
  "message.read": MessageReadEvent;
@@ -139,6 +143,7 @@ export * from "./request-events";
139
143
  export * from "./geo-config-events";
140
144
  export * from "./user-events";
141
145
  export * from "./property-events";
146
+ export * from "./property-enquiry-events";
142
147
  export * from "./notification-events";
143
148
  export * from "./safety-events";
144
149
  export * from "./payment-events";
@@ -15,6 +15,7 @@ __exportStar(require("./request-events"), exports);
15
15
  __exportStar(require("./geo-config-events"), exports);
16
16
  __exportStar(require("./user-events"), exports);
17
17
  __exportStar(require("./property-events"), exports);
18
+ __exportStar(require("./property-enquiry-events"), exports);
18
19
  __exportStar(require("./notification-events"), exports);
19
20
  __exportStar(require("./safety-events"), exports);
20
21
  __exportStar(require("./payment-events"), exports);
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Property Enquiry Events
3
+ * Custom events emitted by property-service for enquiry/request workflows.
4
+ */
5
+ export declare type PropertyEnquiryRequestType = "viewing" | "offer" | "get";
6
+ export declare type PropertyEnquiryStatus = "pending" | "accepted" | "declined" | "expired" | "cancelled_by_tenant" | "cancelled_by_landlord";
7
+ export interface PropertyEnquiryCreatedEvent {
8
+ enquiryId: string;
9
+ propertyId: string;
10
+ requestType: PropertyEnquiryRequestType;
11
+ tenantAuthUserId: string;
12
+ landlordAuthUserId: string;
13
+ tenantMessage?: string;
14
+ }
15
+ export interface PropertyEnquiryStatusChangedEvent {
16
+ enquiryId: string;
17
+ propertyId: string;
18
+ requestType: PropertyEnquiryRequestType;
19
+ tenantAuthUserId: string;
20
+ landlordAuthUserId: string;
21
+ fromStatus?: PropertyEnquiryStatus;
22
+ toStatus: PropertyEnquiryStatus;
23
+ actorAuthUserId?: string;
24
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Property Enquiry Events
4
+ * Custom events emitted by property-service for enquiry/request workflows.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentbase/common",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "common library for rentbase",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",