(item)
| 1696 | } |
| 1697 | |
| 1698 | function getCardPoolResolvedStatus(item) { |
| 1699 | if (!item) return "used"; |
| 1700 | const rawStatus = String(item.status || "").trim().toLowerCase(); |
| 1701 | if (rawStatus === "used") return "used"; |
| 1702 | const expiresRaw = String(item.expires_at || "").trim(); |
| 1703 | if (expiresRaw) { |
| 1704 | const expiresAt = Date.parse(expiresRaw); |
| 1705 | if (Number.isFinite(expiresAt) && expiresAt <= Date.now()) { |
| 1706 | return "expired"; |
| 1707 | } |
| 1708 | } |
| 1709 | if (rawStatus === "expired") return "expired"; |
| 1710 | return "unused"; |
| 1711 | } |
| 1712 | |
| 1713 | function loadCardPoolRedeemCodes() { |
| 1714 | const parsed = safeJsonParse(localStorage.getItem(CARD_POOL_REDEEM_STORAGE_KEY) || "[]", []); |
no outgoing calls
no test coverage detected