Skip to content

Add currency_iso validation#185

Open
heymide wants to merge 2 commits intozendvolabs:mainfrom
heymide:add-currency-iso
Open

Add currency_iso validation#185
heymide wants to merge 2 commits intozendvolabs:mainfrom
heymide:add-currency-iso

Conversation

@heymide
Copy link
Copy Markdown

@heymide heymide commented Mar 28, 2026

Summary

Added strict currency validation so only NGN and USD are accepted, and invalid values now return 400 with a stable error message.

Related Issue

Closes #167

The shared whitelist lives in [schema.ts] and is enforced by the runtime validator in [validation.ts]. Gift creation now uses that validator directly in [route.ts], and public gift creation rejects unsupported currencies with 400 in [route.ts]. I also changed the old unsupported default away from USDC to NGN, including the legacy schema mirror in [schema.ts].

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code follows the [Zendvo Five Principles]
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@heymide Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@heymide
Copy link
Copy Markdown
Author

heymide commented Mar 28, 2026

Done, Close: #185

@Emrys02 Emrys02 self-requested a review March 28, 2026 15:36
Copy link
Copy Markdown
Contributor

@Emrys02 Emrys02 left a comment

Choose a reason for hiding this comment

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

@heymide PR reviewed

@Emrys02
Copy link
Copy Markdown
Contributor

Emrys02 commented Mar 28, 2026

@heymide please resolve conflicts

@heymide
Copy link
Copy Markdown
Author

heymide commented Mar 30, 2026

@heymide please resolve conflicts

Done

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.

Add currency_iso validation

3 participants