Refactor types to support per-bill proof of payment
- Renamed BillAttachment to FileAttachment for better generalization - Added uploadedAt field to FileAttachment (consolidates timestamp) - Renamed utilBillsProofOfPaymentAttachment to utilBillsProofOfPayment - Removed separate utilBillsProofOfPaymentUploadedAt field (now in FileAttachment) - Added rentProofOfPayment field to BillingLocation for rent-specific proof - Added proofOfPayment field to Bill interface for per-bill attachments - Removed unused imports (ObjectId, inter) This refactoring enables both "combined" (location-level) and "per-bill" proof of payment attachment strategies. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { ObjectId } from "mongodb";
|
||||
import { inter } from "../ui/fonts";
|
||||
|
||||
export interface BillAttachment {
|
||||
export interface FileAttachment {
|
||||
fileName: string;
|
||||
fileSize: number;
|
||||
fileType: string;
|
||||
fileLastModified: number;
|
||||
fileContentsBase64: string;
|
||||
uploadedAt: Date;
|
||||
};
|
||||
|
||||
export interface YearMonth {
|
||||
@@ -79,9 +78,9 @@ export interface BillingLocation {
|
||||
/** (optional) whether the location has been seen by tenant */
|
||||
seenByTenantAt?: Date | null;
|
||||
/** (optional) utility bills proof of payment attachment */
|
||||
utilBillsProofOfPaymentAttachment?: BillAttachment|null;
|
||||
/** (optional) date when utility bills proof of payment was uploaded */
|
||||
utilBillsProofOfPaymentUploadedAt?: Date|null;
|
||||
utilBillsProofOfPayment?: FileAttachment|null;
|
||||
/** (optional) rent proof of payment attachment */
|
||||
rentProofOfPayment?: FileAttachment|null;
|
||||
};
|
||||
|
||||
export enum BilledTo {
|
||||
@@ -101,7 +100,7 @@ export interface Bill {
|
||||
/** payed amount amount in cents */
|
||||
payedAmount?: number | null;
|
||||
/** attached document (optional) */
|
||||
attachment?: BillAttachment|null;
|
||||
attachment?: FileAttachment|null;
|
||||
/**
|
||||
* true if there an attachment
|
||||
* @description this field enables us to send this info to the client without sending large attachment - it's an optimization
|
||||
@@ -116,4 +115,6 @@ export interface Bill {
|
||||
barcodeImage?:string;
|
||||
/** (optional) HUB-3A text for generating PDF417 bar code */
|
||||
hub3aText?:string;
|
||||
/** (optional) proof of payment attachment */
|
||||
proofOfPayment?: FileAttachment|null;
|
||||
};
|
||||
Reference in New Issue
Block a user