fix: gift card admin notification uses NULL booking_id (not cardID), use tx not db.Conn
CI / Secrets scan (push) Failing after 26s
CI / Frontend major deps (push) Successful in 39s
CI / Nginx config check (push) Successful in 43s
CI / Docker compose check (push) Successful in 43s
CI / Env docs check (push) Successful in 46s
CI / Frontend deps check (push) Successful in 45s
CI / Go build (push) Successful in 54s
CI / Frontend build (push) Successful in 56s
CI / Knip (push) Successful in 1m42s
CI / Go vet (prod) (push) Successful in 1m49s
CI / Go vet (dev) (push) Successful in 1m50s
CI / Frontend a11y check (push) Successful in 2m5s
CI / go mod tidy (push) Successful in 31s
CI / Frontend QC (audit) (push) Successful in 51s
CI / Staticcheck (prod) (push) Successful in 3m15s
CI / Go vulnerabilities (push) Successful in 1m41s
CI / Staticcheck (dev) (push) Successful in 3m41s
CI / Frontend QC (typecheck) (push) Successful in 1m34s
CI / golangci-lint (push) Has been cancelled
CI / Security scan (dev) (push) Has been cancelled
CI / Security scan (prod) (push) Has been cancelled
CI / Tests (prod) (push) Has been cancelled
CI / Tests (dev) (push) Has been cancelled
CI / Race (prod) (push) Has been cancelled
CI / Race (dev) (push) Has been cancelled
CI / Svelte strict check (push) Has been cancelled
CI / Frontend QC (lint) (push) Has been cancelled

This commit is contained in:
2026-07-11 14:59:09 +01:00
parent ac104e19c5
commit df325487cf
+3 -3
View File
@@ -1081,10 +1081,10 @@ func BuyGiftCard(w http.ResponseWriter, r *http.Request) {
recipient = userEmail recipient = userEmail
} }
// Notify admin about the friend gift card (email delivery not yet implemented — admin must send manually) // Notify admin about the friend gift card (email delivery not yet implemented — admin must send manually)
if _, err := db.Conn.Exec(ctx, ` if _, err := tx.Exec(ctx, `
INSERT INTO admin_notifications (reason, booking_id, user_id) INSERT INTO admin_notifications (reason, booking_id, user_id)
VALUES ('gift_card_purchased_for_friend', $1, $2) VALUES ('gift_card_purchased_for_friend', NULL, $1)
`, cardID, userID); err != nil { `, userID); err != nil {
log.Printf("ALERT: failed to create admin notification for gift card %s: %v", cardID, err) log.Printf("ALERT: failed to create admin notification for gift card %s: %v", cardID, err)
} }
log.Printf("GIFT CARD FOR FRIEND — code: %s, value: £%.2f, intended for: %s", cardID, amountPounds, recipient) log.Printf("GIFT CARD FOR FRIEND — code: %s, value: £%.2f, intended for: %s", cardID, amountPounds, recipient)