mirror of
https://github.com/acedanger/finance.git
synced 2025-12-06 07:00:13 -08:00
- Added package.json with necessary dependencies and scripts for development and production. - Created Prisma schema for BankAccount model with fields: id, name, bankName, accountNumber, createdAt, and updatedAt. - Implemented Fastify server with CRUD operations for bank accounts, including validation using Zod. - Added graceful shutdown handling for server and Prisma client.
21 lines
577 B
Plaintext
21 lines
577 B
Plaintext
// prisma/schema.prisma
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model BankAccount {
|
|
id Int @id @default(autoincrement())
|
|
name String // e.g., "Checking Account", "Savings XYZ"
|
|
bankName String // e.g., "Chase", "Wells Fargo"
|
|
accountNumber String @unique // Consider encryption in a real app
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("bank_accounts") // Optional: specify table name in snake_case
|
|
} |