feat: mark list items as bought on tap and record boughtAt
Tapping an item in the list toggles it via a new PATCH /lists/:listId/items/:itemId endpoint. Marking an item as bought stores boughtAt (for future stats) and clearing it back to pending resets the timestamp. The web app updates optimistically and each row is now a real button with aria-pressed.
This commit is contained in:
@@ -110,15 +110,16 @@ model ShoppingList {
|
||||
}
|
||||
|
||||
model ListItem {
|
||||
id String @id @default(cuid())
|
||||
shoppingListId String @map("shopping_list_id")
|
||||
id String @id @default(cuid())
|
||||
shoppingListId String @map("shopping_list_id")
|
||||
name String
|
||||
completed Boolean @default(false)
|
||||
quantity String? @map("quantity")
|
||||
notes String? @map("notes")
|
||||
order Int @default(0) @map("order")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
completed Boolean @default(false)
|
||||
boughtAt DateTime? @map("bought_at")
|
||||
quantity String? @map("quantity")
|
||||
notes String? @map("notes")
|
||||
order Int @default(0) @map("order")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
shoppingList ShoppingList @relation(fields: [shoppingListId], references: [id], onDelete: Cascade)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user