Skip to content

feat(promo): add new encrypted promo credit category#1734

Open
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
add-encrypted-promo-credit-category
Open

feat(promo): add new encrypted promo credit category#1734
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
add-encrypted-promo-credit-category

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Mar 30, 2026

Summary

Adds a new self-service encrypted promo credit category entry. The entry provides $50 credits with the following configuration:

  • Idempotent (prevents duplicate redemptions)
  • Requires hold or payment method
  • 1050 total redemptions allowed
  • Promotion expires 2026-04-13

Important: The encrypted_credit_category field is set to PLACEHOLDER. Before merging, generate the real value with:

vercel env run -e production -- pnpm promo encrypt <CODE>

and replace the placeholder. The promo code to encrypt is referenced in the originating task.

Verification

  • pnpm typecheck — passed, no errors
  • pnpm lint — passed (via pre-push hook)
  • pnpm format:check — passed (via pre-push hook)

Visual Changes

N/A

Reviewer Notes

The encrypted_credit_category value must be replaced with a production-encrypted value before merging. The TODO comment in the source code indicates how to generate it.

Add a new self-service encrypted promo code entry for an upcoming
event promotion. 0 credits, 1050 max redemptions, expires 2026-04-13.
{
// TODO: Replace encrypted_credit_category with production-encrypted value.
// Run: vercel env run -e production -- pnpm promo encrypt CLAW_MIA
encrypted_credit_category: 'a1o0/So4YgGvB+ABnOOqAw==:qlVqBAHvDFjp4npGlFnwqg==:q+0OuXzZu6E=',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: Placeholder ciphertext will fail to decrypt in production

encryptedSelfServicePromos is decrypted at module load via decryptPromoCode(...). Because this value is marked as generated with a non-production key, decryptWithSymmetricKey will reject it under the production CREDIT_CATEGORIES_ENCRYPTION_KEY, and any import of promoCreditCategories.ts will throw before the promo list can be used. Replace this with ciphertext generated from the production key before merge.

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Mar 30, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

CRITICAL

File Line Issue
src/lib/promoCreditCategories.ts 690 Placeholder encrypted_credit_category is still decrypted at module load, so imports will throw until it is replaced with a production-encrypted value.
Other Observations (not in diff)

N/A

Files Reviewed (1 files)
  • src/lib/promoCreditCategories.ts - 1 issue

Reviewed by gpt-5.4-20260305 · 181,887 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants