Compare commits

...

2 Commits

Author SHA1 Message Date
fa7f3004fa DB schema updates 2025-03-09 23:07:26 +01:00
42f6e0b22d TODO: replace parseDynamicSortBy 2025-03-09 23:07:02 +01:00
2 changed files with 5 additions and 4 deletions

View File

@ -22,7 +22,7 @@ model user {
// TODO: Prüfen ob nötig, erstmal vorbereitet.
transactions transactions[]
@@fulltext([name])
@@fulltext([name, email])
}
model transactions {
@ -33,9 +33,9 @@ model transactions {
user user @relation(fields: [userId], references: [id])
userId Int
total Float
total Decimal @db.Decimal(5,2)
paid Boolean @default(false)
paidAt Boolean?
paidAt DateTime?
createdAt DateTime @default(now())
}
@ -55,7 +55,7 @@ model products {
id Int @id @unique @default(autoincrement())
gtin String @unique // Dont try to use BigInt -> https://github.com/prisma/studio/issues/614
name String @unique
price Decimal @db.Decimal(5,2) // FIXME: input: 77.80 -> output: 77.8
price Decimal @db.Decimal(5,2)
stock Int
visible Boolean @default(true)

View File

@ -7,6 +7,7 @@
* @returns {object}
*/
export function parseDynamicSortBy(SortField: string, Order: string) {
// TODO: { [value.sort.toString()]: value.order.toString() }
return JSON.parse(`{ "${SortField}": "${Order}" }`);
}