@rentbase/common 1.0.18 → 1.0.20

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,6 @@
1
+ import { PropertyListingExpireRequestedEvent } from "../types/monetization-events";
2
+ /**
3
+ * Publish property_listing.expire.requested event
4
+ * Worker uses this to request property-service to expire the listing.
5
+ */
6
+ export declare const publishPropertyListingExpireRequested: (data: PropertyListingExpireRequestedEvent) => Promise<void>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.publishPropertyListingExpireRequested = void 0;
13
+ const producer_1 = require("../producer");
14
+ /**
15
+ * Publish property_listing.expire.requested event
16
+ * Worker uses this to request property-service to expire the listing.
17
+ */
18
+ const publishPropertyListingExpireRequested = (data) => __awaiter(void 0, void 0, void 0, function* () {
19
+ yield (0, producer_1.publishEvent)("property_listing.expire.requested", data);
20
+ });
21
+ exports.publishPropertyListingExpireRequested = publishPropertyListingExpireRequested;
@@ -0,0 +1,5 @@
1
+ import { PropertyListingExpiringSoonEvent } from "../types/monetization-events";
2
+ /**
3
+ * Publish property_listing.expiring_soon event
4
+ */
5
+ export declare const publishPropertyListingExpiringSoon: (data: PropertyListingExpiringSoonEvent) => Promise<void>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.publishPropertyListingExpiringSoon = void 0;
13
+ const producer_1 = require("../producer");
14
+ /**
15
+ * Publish property_listing.expiring_soon event
16
+ */
17
+ const publishPropertyListingExpiringSoon = (data) => __awaiter(void 0, void 0, void 0, function* () {
18
+ yield (0, producer_1.publishEvent)("property_listing.expiring_soon", data);
19
+ });
20
+ exports.publishPropertyListingExpiringSoon = publishPropertyListingExpiringSoon;
@@ -0,0 +1,6 @@
1
+ import { SavedSearchDigestReadyEvent } from "../types/saved-search-events";
2
+ /**
3
+ * Publish saved_search.digest.ready event
4
+ * Emitted by property-service when a daily digest is ready for a user.
5
+ */
6
+ export declare const publishSavedSearchDigestReady: (data: SavedSearchDigestReadyEvent) => Promise<void>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.publishSavedSearchDigestReady = void 0;
13
+ const producer_1 = require("../producer");
14
+ /**
15
+ * Publish saved_search.digest.ready event
16
+ * Emitted by property-service when a daily digest is ready for a user.
17
+ */
18
+ const publishSavedSearchDigestReady = (data) => __awaiter(void 0, void 0, void 0, function* () {
19
+ yield (0, producer_1.publishEvent)("saved_search.digest.ready", data);
20
+ });
21
+ exports.publishSavedSearchDigestReady = publishSavedSearchDigestReady;
@@ -0,0 +1,6 @@
1
+ import { TenantAccessPassExpireRequestedEvent } from "../types/monetization-events";
2
+ /**
3
+ * Publish tenant_access_pass.expire.requested event
4
+ * Worker uses this to request property-service to expire the pass.
5
+ */
6
+ export declare const publishTenantAccessPassExpireRequested: (data: TenantAccessPassExpireRequestedEvent) => Promise<void>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.publishTenantAccessPassExpireRequested = void 0;
13
+ const producer_1 = require("../producer");
14
+ /**
15
+ * Publish tenant_access_pass.expire.requested event
16
+ * Worker uses this to request property-service to expire the pass.
17
+ */
18
+ const publishTenantAccessPassExpireRequested = (data) => __awaiter(void 0, void 0, void 0, function* () {
19
+ yield (0, producer_1.publishEvent)("tenant_access_pass.expire.requested", data);
20
+ });
21
+ exports.publishTenantAccessPassExpireRequested = publishTenantAccessPassExpireRequested;
@@ -0,0 +1,5 @@
1
+ import { TenantAccessPassExpiringSoonEvent } from "../types/monetization-events";
2
+ /**
3
+ * Publish tenant_access_pass.expiring_soon event
4
+ */
5
+ export declare const publishTenantAccessPassExpiringSoon: (data: TenantAccessPassExpiringSoonEvent) => Promise<void>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.publishTenantAccessPassExpiringSoon = void 0;
13
+ const producer_1 = require("../producer");
14
+ /**
15
+ * Publish tenant_access_pass.expiring_soon event
16
+ */
17
+ const publishTenantAccessPassExpiringSoon = (data) => __awaiter(void 0, void 0, void 0, function* () {
18
+ yield (0, producer_1.publishEvent)("tenant_access_pass.expiring_soon", data);
19
+ });
20
+ exports.publishTenantAccessPassExpiringSoon = publishTenantAccessPassExpiringSoon;
@@ -7,10 +7,11 @@ import { IncidentReportCreatedEvent, IncidentReportUpdatedEvent, IncidentReportR
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
8
  import { ChatSessionCreatedEvent, ChatSessionClosedEvent, ChatParticipantMutedEvent, ChatPushMessageCreatedEvent, MessageSentEvent, MessageDeliveredEvent, MessageReadEvent, SystemMessageAddedEvent, CallInitiatedEvent, CallRingingEvent, CallAnsweredEvent, CallRejectedEvent, CallMissedEvent, CallEndedEvent, CallFailedEvent, CallRatedEvent, CallProviderStatusUpdateEvent } from "./chat-events";
9
9
  import { PropertyEnquiryCreatedEvent, PropertyEnquiryStatusChangedEvent } from "./property-enquiry-events";
10
- import { TenantAccessPassPurchasedEvent, TenantAccessPassConsumedEvent, TenantAccessPassExpiredEvent, PropertyListingExpiredEvent, PropertyListingRenewedEvent, PropertyListingFeeMarkedPaidEvent } from "./monetization-events";
10
+ import { TenantAccessPassPurchasedEvent, TenantAccessPassConsumedEvent, TenantAccessPassExpiringSoonEvent, TenantAccessPassExpireRequestedEvent, TenantAccessPassExpiredEvent, PropertyListingExpiringSoonEvent, PropertyListingExpireRequestedEvent, PropertyListingExpiredEvent, PropertyListingRenewedEvent, PropertyListingFeeMarkedPaidEvent } from "./monetization-events";
11
11
  import { MonetizationPricingUpsertedEvent, MonetizationPricingActivatedEvent, MonetizationPricingDeactivatedEvent } from "./monetization-settings-events";
12
12
  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";
13
13
  import { KycDocumentUploadedEvent, KycDocumentVerifiedEvent, KycDocumentRejectedEvent, KycDocumentDeletedEvent, LandlordApplicationCreatedEvent, LandlordApplicationSubmittedEvent, LandlordApplicationUnderReviewEvent, LandlordApplicationNeedsInfoEvent, LandlordApplicationApprovedEvent, LandlordApplicationRejectedEvent, LandlordApplicationUpdatedEvent } from "./kyc-events";
14
+ import { SavedSearchDigestReadyEvent } from "./saved-search-events";
14
15
  export interface EventMap {
15
16
  "request.created": RequestCreatedEvent;
16
17
  "request.updated": RequestUpdatedEvent;
@@ -42,7 +43,11 @@ export interface EventMap {
42
43
  "property_viewing.no_show": PropertyViewingNoShowEvent;
43
44
  "tenant_access_pass.purchased": TenantAccessPassPurchasedEvent;
44
45
  "tenant_access_pass.consumed": TenantAccessPassConsumedEvent;
46
+ "tenant_access_pass.expiring_soon": TenantAccessPassExpiringSoonEvent;
47
+ "tenant_access_pass.expire.requested": TenantAccessPassExpireRequestedEvent;
45
48
  "tenant_access_pass.expired": TenantAccessPassExpiredEvent;
49
+ "property_listing.expiring_soon": PropertyListingExpiringSoonEvent;
50
+ "property_listing.expire.requested": PropertyListingExpireRequestedEvent;
46
51
  "property_listing.expired": PropertyListingExpiredEvent;
47
52
  "property_listing.renewed": PropertyListingRenewedEvent;
48
53
  "property_listing.fee.marked_paid": PropertyListingFeeMarkedPaidEvent;
@@ -59,6 +64,7 @@ export interface EventMap {
59
64
  "property_report.created": PropertyReportCreatedEvent;
60
65
  "property_report.updated": PropertyReportUpdatedEvent;
61
66
  "property_report.resolved": PropertyReportResolvedEvent;
67
+ "saved_search.digest.ready": SavedSearchDigestReadyEvent;
62
68
  "notification.created": NotificationCreatedEvent;
63
69
  "notification.sent": NotificationSentEvent;
64
70
  "notification.delivered": NotificationDeliveredEvent;
@@ -21,12 +21,46 @@ export interface TenantAccessPassConsumedEvent {
21
21
  consumedPropertyId?: string;
22
22
  expiresAt?: string | Date;
23
23
  }
24
+ export interface TenantAccessPassExpiringSoonEvent {
25
+ passId: string;
26
+ tenantAuthUserId: string;
27
+ warnedAt: string | Date;
28
+ expiresAt: string | Date;
29
+ warningDays: number;
30
+ }
31
+ /**
32
+ * Command-style event: worker asks property-service to expire a pass.
33
+ * Property-service should mark it expired and then publish tenant_access_pass.expired.
34
+ */
35
+ export interface TenantAccessPassExpireRequestedEvent {
36
+ passId: string;
37
+ tenantAuthUserId: string;
38
+ requestedAt: string | Date;
39
+ expiresAt: string | Date;
40
+ }
24
41
  export interface TenantAccessPassExpiredEvent {
25
42
  passId: string;
26
43
  tenantAuthUserId: string;
27
44
  expiredAt: string | Date;
28
45
  expiresAt: string | Date;
29
46
  }
47
+ export interface PropertyListingExpiringSoonEvent {
48
+ propertyId: string;
49
+ ownerAuthUserId?: string;
50
+ warnedAt: string | Date;
51
+ expiresAt: string | Date;
52
+ warningDays: number;
53
+ }
54
+ /**
55
+ * Command-style event: worker asks property-service to expire a listing.
56
+ * Property-service should mark it expired and then publish property_listing.expired.
57
+ */
58
+ export interface PropertyListingExpireRequestedEvent {
59
+ propertyId: string;
60
+ ownerAuthUserId?: string;
61
+ requestedAt: string | Date;
62
+ expiresAt: string | Date;
63
+ }
30
64
  export interface PropertyListingExpiredEvent {
31
65
  propertyId: string;
32
66
  ownerAuthUserId?: string;
@@ -11,6 +11,8 @@ export interface PropertyEnquiryCreatedEvent {
11
11
  tenantAuthUserId: string;
12
12
  landlordAuthUserId: string;
13
13
  tenantMessage?: string;
14
+ offeredAmount?: number;
15
+ offeredCurrency?: string;
14
16
  }
15
17
  export interface PropertyEnquiryStatusChangedEvent {
16
18
  enquiryId: string;
@@ -10,7 +10,6 @@ export declare enum PropertyType {
10
10
  SHORT_STAY = "short_stay",
11
11
  RESIDENTIAL_STAND = "residential_stand",
12
12
  COMMERCIAL_STAND = "commercial_stand",
13
- HOUSE_FOR_SALE = "house_for_sale",
14
13
  FARM = "farm",
15
14
  PLOT = "plot",
16
15
  INDUSTRIAL_PROPERTY = "industrial_property",
@@ -16,7 +16,6 @@ var PropertyType;
16
16
  // Sales / Land
17
17
  PropertyType["RESIDENTIAL_STAND"] = "residential_stand";
18
18
  PropertyType["COMMERCIAL_STAND"] = "commercial_stand";
19
- PropertyType["HOUSE_FOR_SALE"] = "house_for_sale";
20
19
  PropertyType["FARM"] = "farm";
21
20
  PropertyType["PLOT"] = "plot";
22
21
  PropertyType["INDUSTRIAL_PROPERTY"] = "industrial_property";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Saved Search Events
3
+ * Events for recommendation/digest notifications based on saved searches.
4
+ */
5
+ export interface SavedSearchDigestReadyEvent {
6
+ authUserId: string;
7
+ digestDate: string;
8
+ totalNewCount: number;
9
+ url?: string;
10
+ topSearch?: {
11
+ id: string;
12
+ name?: string;
13
+ filters?: Record<string, any>;
14
+ newCount: number;
15
+ };
16
+ searches?: Array<{
17
+ id: string;
18
+ name?: string;
19
+ newCount: number;
20
+ }>;
21
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Saved Search Events
4
+ * Events for recommendation/digest notifications based on saved searches.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
package/build/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from "./events/types/promotion-events";
23
23
  export * from "./events/types/kyc-events";
24
24
  export * from "./events/types/monetization-events";
25
25
  export * from "./events/types/monetization-settings-events";
26
+ export * from "./events/types/saved-search-events";
26
27
  export * from "./events/types";
27
28
  export * from "./events/publishers/country-created-publisher";
28
29
  export * from "./events/publishers/country-updated-publisher";
@@ -70,6 +71,15 @@ export * from "./events/publishers/notification-template-created-publisher";
70
71
  export * from "./events/publishers/notification-template-updated-publisher";
71
72
  export * from "./events/publishers/notification-bulk-send-initiated-publisher";
72
73
  export * from "./events/publishers/notification-bulk-send-completed-publisher";
74
+ export * from "./events/publishers/saved-search-digest-ready-publisher";
75
+ export * from "./events/publishers/tenant-access-pass-expiring-soon-publisher";
76
+ export * from "./events/publishers/tenant-access-pass-expire-requested-publisher";
77
+ export * from "./events/publishers/property-listing-expiring-soon-publisher";
78
+ export * from "./events/publishers/property-listing-expire-requested-publisher";
79
+ export * from "./events/publishers/tenant-access-pass-expiring-soon-publisher";
80
+ export * from "./events/publishers/tenant-access-pass-expire-requested-publisher";
81
+ export * from "./events/publishers/property-listing-expiring-soon-publisher";
82
+ export * from "./events/publishers/property-listing-expire-requested-publisher";
73
83
  export * from "./events/publishers/incident-created-publisher";
74
84
  export * from "./events/publishers/incident-updated-publisher";
75
85
  export * from "./events/publishers/incident-resolved-publisher";
package/build/index.js CHANGED
@@ -36,6 +36,7 @@ __exportStar(require("./events/types/promotion-events"), exports);
36
36
  __exportStar(require("./events/types/kyc-events"), exports);
37
37
  __exportStar(require("./events/types/monetization-events"), exports);
38
38
  __exportStar(require("./events/types/monetization-settings-events"), exports);
39
+ __exportStar(require("./events/types/saved-search-events"), exports);
39
40
  __exportStar(require("./events/types"), exports);
40
41
  // Geo Config / Location event publishers
41
42
  __exportStar(require("./events/publishers/country-created-publisher"), exports);
@@ -93,6 +94,18 @@ __exportStar(require("./events/publishers/notification-template-created-publishe
93
94
  __exportStar(require("./events/publishers/notification-template-updated-publisher"), exports);
94
95
  __exportStar(require("./events/publishers/notification-bulk-send-initiated-publisher"), exports);
95
96
  __exportStar(require("./events/publishers/notification-bulk-send-completed-publisher"), exports);
97
+ // Saved search digest event publishers
98
+ __exportStar(require("./events/publishers/saved-search-digest-ready-publisher"), exports);
99
+ // Monetization expiry event publishers
100
+ __exportStar(require("./events/publishers/tenant-access-pass-expiring-soon-publisher"), exports);
101
+ __exportStar(require("./events/publishers/tenant-access-pass-expire-requested-publisher"), exports);
102
+ __exportStar(require("./events/publishers/property-listing-expiring-soon-publisher"), exports);
103
+ __exportStar(require("./events/publishers/property-listing-expire-requested-publisher"), exports);
104
+ // Monetization expiry (worker-driven) publishers
105
+ __exportStar(require("./events/publishers/tenant-access-pass-expiring-soon-publisher"), exports);
106
+ __exportStar(require("./events/publishers/tenant-access-pass-expire-requested-publisher"), exports);
107
+ __exportStar(require("./events/publishers/property-listing-expiring-soon-publisher"), exports);
108
+ __exportStar(require("./events/publishers/property-listing-expire-requested-publisher"), exports);
96
109
  // Safety & Reporting event publishers
97
110
  __exportStar(require("./events/publishers/incident-created-publisher"), exports);
98
111
  __exportStar(require("./events/publishers/incident-updated-publisher"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentbase/common",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "common library for rentbase",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",