transitioned from astro to react

This commit is contained in:
Peter Wood
2025-06-04 21:03:32 -04:00
parent 570ed2d1b4
commit 52547578a7
32 changed files with 2631 additions and 4865 deletions

56
server/types.ts Normal file
View File

@@ -0,0 +1,56 @@
import type { Decimal } from '@prisma/client/runtime/library';
export interface Account {
id: string;
bankName: string;
accountNumber: string; // Last 6 digits
name: string; // Friendly name
type?: string; // CHECKING, SAVINGS, etc.
status?: string; // ACTIVE, CLOSED
currency?: string; // Default: USD
balance: number | Decimal; // Current balance - can be Prisma Decimal or number
notes?: string | null; // Optional notes - accepts null for Prisma compatibility
createdAt?: Date;
updatedAt?: Date;
}
export interface Transaction {
id: string;
accountId: string;
date: string | Date; // ISO date string or Date object
description: string;
amount: number | Decimal; // Amount - can be Prisma Decimal or number
category?: string | null; // Optional category - accepts null for Prisma compatibility
status?: string; // PENDING, CLEARED
type?: string; // DEPOSIT, WITHDRAWAL, TRANSFER
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;
}
// Type definitions for Transaction status and type enums to match db.service.ts
export enum TransactionStatus {
PENDING = 'PENDING',
CLEARED = 'CLEARED',
}
export enum TransactionType {
DEPOSIT = 'DEPOSIT',
WITHDRAWAL = 'WITHDRAWAL',
TRANSFER = 'TRANSFER',
UNSPECIFIED = 'UNSPECIFIED',
}
export enum AccountType {
CHECKING = 'CHECKING',
SAVINGS = 'SAVINGS',
CREDIT_CARD = 'CREDIT_CARD',
INVESTMENT = 'INVESTMENT',
OTHER = 'OTHER',
}
export enum AccountStatus {
ACTIVE = 'ACTIVE',
CLOSED = 'CLOSED',
}