feat: add cabinet management functionality

This commit is contained in:
Tran Anh Tuan
2026-05-08 15:26:31 +07:00
parent 459ff6b384
commit 58cfe890a1
14 changed files with 1981 additions and 856 deletions

View File

@@ -112,7 +112,7 @@ func (q *Queries) ListCabinets(ctx context.Context) ([]Cabinet, error) {
const updateCabinet = `-- name: UpdateCabinet :one
UPDATE cabinets
SET name = coalesce($1, name),
SET name = CASE WHEN $1 = '' THEN name ELSE $1 END,
description = coalesce($2, description),
updated_at = $3
WHERE id = $4
@@ -120,7 +120,7 @@ RETURNING id, room_id, name, description, created_at, updated_at
`
type UpdateCabinetParams struct {
Name string `db:"name" json:"name"`
Name interface{} `db:"name" json:"name"`
Description pgtype.Text `db:"description" json:"description"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
ID int64 `db:"id" json:"id"`