juspay/hyperswitch

[FEATURE] Use the newtype pattern for ZIP/PIN codes

Open

#1,492 创建于 2023年6月21日

在 GitHub 查看
 (5 评论) (0 反应) (1 负责人)Rust (4,676 fork)batch import
A-frameworkC-featuregood first issuehelp wanted

仓库指标

Star
 (42,690 star)
PR 合并指标
 (平均合并 6天 22小时) (30 天内合并 213 个 PR)

描述

Feature Description

This issue covers one of the problems mentioned in #119, about using the newtype pattern for zip/pin codes. We want to make sure that the we have valid zip/pin codes by assigning them to a new type...

This newtype should be validated as part of construction & deserialization, can refer to #851 as an example

Please also include unit tests in your PR.

For external contributors, clarify any questions you may have, and let us know that you're interested in picking this up. We'll assign this issue to you to reduce duplication of effort on the same task.

Possible Implementation

You could use a newtype for ZipCode. Also, implement Serialize and Deserialize on these two types.

You can ask about any external libraries that you think should ease this out in the comments

Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

Have you read the Contributing Guidelines?

Are you willing to submit a PR?

None

贡献者指南