mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 14:40:13 -08:00
Update types.ts to support Prisma database integration
- Add support for Prisma Decimal type in numeric fields - Update interfaces to handle both number and Decimal types - Add proper handling for null values in optional fields - Define explicit enum types for transaction and account statuses - Ensure type compatibility between TypeScript interfaces and Prisma models - Improve type safety throughout database interactions
This commit is contained in:
@@ -9,7 +9,7 @@ export interface Account {
|
||||
status?: string; // ACTIVE, CLOSED
|
||||
currency?: string; // Default: USD
|
||||
balance: number | Decimal; // Current balance - can be Prisma Decimal or number
|
||||
notes?: string; // Optional notes
|
||||
notes?: string | null; // Optional notes - accepts null for Prisma compatibility
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
}
|
||||
@@ -20,11 +20,11 @@ export interface Transaction {
|
||||
date: string | Date; // ISO date string or Date object
|
||||
description: string;
|
||||
amount: number | Decimal; // Amount - can be Prisma Decimal or number
|
||||
category?: string; // Optional category
|
||||
category?: string | null; // Optional category - accepts null for Prisma compatibility
|
||||
status?: string; // PENDING, CLEARED
|
||||
type?: string; // DEPOSIT, WITHDRAWAL, TRANSFER
|
||||
notes?: string; // Optional notes
|
||||
tags?: string; // Optional comma-separated tags
|
||||
notes?: string | null; // Optional notes - accepts null for Prisma compatibility
|
||||
tags?: string | null; // Optional comma-separated tags - accepts null for Prisma compatibility
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user