-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add a domain type for customer_id
#4705
feat: add a domain type for customer_id
#4705
Conversation
customer_id
customer_id
e905b18
to
d810206
Compare
self.customer_id | ||
.clone() | ||
.map(|customer_id| ApiEventsType::Customer { customer_id }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can store the new type inside ApiEvents as long as it implements valid serialization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have already added the new type for ApiEvents
customer_id: id_type::CustomerId, |
The change here is that the mandatory field is made optional
33e12d1
Type of Change
Description
This PR adds an id type to validate the reference id that we receive in the api.
Additional Changes
Validations are added to the customer id
Motivation and Context
How did you test it?
customer_id
- Successcustomer_id
with invalid characterscustomer_id
with min lengthcustomer_id
with max lengthUnit test cases
Checklist
cargo +nightly fmt --all
cargo clippy