package queries

// ======================================================
// 🔐 UPDATE USER PASSWORD (RESET / CHANGE)
// ======================================================
const UpdateUserPassword = `
UPDATE dfusr
SET
  upass = $2,
  last_updated_date = NOW()
WHERE id = $1
  AND is_active = true
`

// Reset token yaz
const SetUserResetToken = `
UPDATE dfusr
SET
  fpass = $2,
  fpass_id = NOW()
WHERE id = $1
  AND is_active = true
`

// Reset token kontrol
const CheckUserResetToken = `
SELECT id
FROM dfusr
WHERE
  fpass = $1
  AND is_active = true
`

// Reset sonrası temizle
const ClearUserResetToken = `
UPDATE dfusr
SET
  fpass = NULL,
  fpass_id = NULL
WHERE id = $1
`
