sms-metering-location-link: per-tag SMS credits (allocated/used, admin top-up), short URLs + owner location page (map embed + finder details) — 13/13 scenarios
This commit is contained in:
@@ -85,3 +85,15 @@ WHERE tag_id = $1 AND alert_sent = TRUE AND scanned_at > $2;
|
||||
-- name: CountAlertsByIPSince :one
|
||||
SELECT count(*) FROM scans
|
||||
WHERE ip = $1 AND alert_sent = TRUE AND scanned_at > $2;
|
||||
|
||||
-- name: AddSmsUsed :exec
|
||||
UPDATE tags SET sms_used = sms_used + 1, updated_at = now() WHERE id = $1;
|
||||
|
||||
-- name: InsertShortCode :one
|
||||
INSERT INTO url_shortened (code, scan_id) VALUES ($1, $2) RETURNING *;
|
||||
|
||||
-- name: GetShortCode :one
|
||||
SELECT * FROM url_shortened WHERE code = $1;
|
||||
|
||||
-- name: GetScanByID :one
|
||||
SELECT * FROM scans WHERE id = $1;
|
||||
|
||||
Reference in New Issue
Block a user