Some checks failed
- Add Portfolio + Position models (Prisma + migrations) - Backend: PortfolioModule with CRUD, enrichment, type detection - Backend: enrichBondPosition returns 13 financial fields (YTM, duration, coupon, NCD, accrued interest, bid/offer, bondType, offerDate, etc.) - Frontend: portfolio pages, 4 TanStack Query hooks, split share/bond tables - Fix: MOEX bond marketdata board fallback (TQCB → TQOB for OFZ) - Frontend: clickable ticker links to /stocks/:secid and /bonds/:secid - Remove: target allocation, deviation, tags display from Phase 1 - Docs: ADR-009 (domain model), ADR-010 (price computation), portfolio backend doc, superpowers spec + plan
52 lines
1.2 KiB
Plaintext
52 lines
1.2 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
}
|
|
|
|
model Portfolio {
|
|
id Int @id @default(autoincrement())
|
|
userId Int
|
|
name String
|
|
description String?
|
|
currency String @default("RUB")
|
|
targets String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
positions Position[]
|
|
|
|
@@unique([userId, name])
|
|
}
|
|
|
|
model Position {
|
|
id Int @id @default(autoincrement())
|
|
portfolioId Int
|
|
secid String
|
|
type String @default("share")
|
|
quantity Int
|
|
notes String?
|
|
tags String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
portfolio Portfolio @relation(fields: [portfolioId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([portfolioId, secid])
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
email String @unique
|
|
password String
|
|
name String?
|
|
role String @default("user")
|
|
refreshToken String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
portfolios Portfolio[]
|
|
}
|