refactor: improve notification naming and introduce type-safe enums
- Rename billFwd* to billsNotification* for clarity - Rename rentDueNotification* to rentNotification* for consistency - Rename utilBillsProofOfPayment to billsProofOfPayment - Introduce enums for type safety: - BillsNotificationStrategy (WhenPayed, WhenAttached) - BillsNotificationStatus (Scheduled, Sent, Failed) - RentNotificationStatus (Sent, Failed) - Replace "pending" status with "scheduled" for better semantics - Fix function names to proper camelCase - Fix incorrect import path in web-app/app/lib/format.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,29 @@ export enum EmailStatus {
|
||||
Unsubscribed = "unsubscribed"
|
||||
}
|
||||
|
||||
export enum BillsNotificationStrategy {
|
||||
/** Notify tenant when bill is payed */
|
||||
WhenPayed = "when-payed",
|
||||
/** Notify tenant when bill gets an attachment */
|
||||
WhenAttached = "when-attached"
|
||||
}
|
||||
|
||||
export enum BillsNotificationStatus {
|
||||
/** Bills notification is scheduled to be sent */
|
||||
Scheduled = "scheduled",
|
||||
/** Bills notification has been sent */
|
||||
Sent = "sent",
|
||||
/** Sending of bills notification failed */
|
||||
Failed = "failed"
|
||||
}
|
||||
|
||||
export enum RentNotificationStatus {
|
||||
/** notification has been sent */
|
||||
Sent = "sent",
|
||||
/** Sending of notification failed */
|
||||
Failed = "failed"
|
||||
}
|
||||
|
||||
/** bill object in the form returned by MongoDB */
|
||||
export interface BillingLocation {
|
||||
_id: string;
|
||||
@@ -84,25 +107,25 @@ export interface BillingLocation {
|
||||
/** (optional) language for tenant notification emails */
|
||||
tenantEmailLanguage?: "hr" | "en" | null;
|
||||
/** (optional) whether to automatically notify tenant */
|
||||
billFwdEnabled?: boolean | null;
|
||||
billsNotificationEnabled?: boolean | null;
|
||||
/** (optional) bill forwarding strategy */
|
||||
billFwdStrategy?: "when-payed" | "when-attached" | null;
|
||||
billsNotificationStrategy?: BillsNotificationStrategy | null;
|
||||
/** (optional) bill forwarding status */
|
||||
billFwdStatus?: "pending" | "sent" | "failed" | null;
|
||||
billsNotificationStatus?: BillsNotificationStatus | null;
|
||||
/** (optional) utility bills proof of payment attachment */
|
||||
billsProofOfPayment?: FileAttachment|null;
|
||||
/** (optional) whether to automatically send rent notification */
|
||||
rentDueNotificationEnabled?: boolean | null;
|
||||
rentNotificationEnabled?: boolean | null;
|
||||
/** (optional) when was the rent due notification sent */
|
||||
rentNotificationStatus?: RentNotificationStatus | null;
|
||||
/** (optional) rent proof of payment attachment */
|
||||
rentProofOfPayment?: FileAttachment|null;
|
||||
/** (optional) day of month when rent is due (1-31) */
|
||||
rentDueDay?: number | null;
|
||||
/** (optional) when was the rent due notification sent */
|
||||
rentDueNotificationStatus?: "sent" | "failed" | null;
|
||||
/** (optional) monthly rent amount in cents */
|
||||
rentAmount?: number | null;
|
||||
/** (optional) whether the location has been seen by tenant */
|
||||
seenByTenantAt?: Date | null;
|
||||
/** (optional) utility bills proof of payment attachment */
|
||||
utilBillsProofOfPayment?: FileAttachment|null;
|
||||
/** (optional) rent proof of payment attachment */
|
||||
rentProofOfPayment?: FileAttachment|null;
|
||||
/** (optional) share link expiry timestamp */
|
||||
shareTTL?: Date;
|
||||
/** (optional) when tenant first visited the share link */
|
||||
|
||||
Reference in New Issue
Block a user