add:order notes crud

This commit is contained in:
derrick
2026-09-24 21:07:19 +09:00
parent 2e2694354d
commit 97438aaa56
5 changed files with 85 additions and 2 deletions
+5
View File
@@ -98,6 +98,7 @@ export async function findOrderDetail(context: DatabaseContext, orderId: string)
status: header.order.status as OrderDetail["status"],
createdAt: header.order.createdAt,
updatedAt: header.order.updatedAt,
notes: header.order.notes,
customer: {
id: header.customer.id,
name: header.customer.name,
@@ -123,6 +124,10 @@ export async function updateOrderItemQuantity(context: DatabaseContext, itemId:
await context.db.update(orderItems).set({ quantity }).where(eq(orderItems.id, itemId));
}
export async function updateOrderNotes(context: DatabaseContext, orderId: string, notes: string) {
await context.db.update(orders).set({ notes }).where(eq(orders.id, orderId));
}
export async function updateOrderTimestamp(context: DatabaseContext, orderId: string, updatedAt: string) {
await context.db.update(orders).set({ updatedAt }).where(eq(orders.id, orderId));
}