Skip to content
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

Model Validation - custom business logic #4600

Closed
mastermunj opened this issue Feb 10, 2020 · 4 comments
Closed

Model Validation - custom business logic #4600

mastermunj opened this issue Feb 10, 2020 · 4 comments

Comments

@mastermunj
Copy link
Contributor

Hi,

I need help with Model validations. Is there anything similar to LB3 Model.validateAsync?

E.g. When someone is trying to register with a mobile number, I want to check whether mobile is on the blocked list.

@achrinza
Copy link
Member

achrinza commented Feb 10, 2020

Hi @mastermunj; AFAIK models are meant to only provide data structure (as part of the LB4 redesign). However, a similar validation can be accomplished by adding custom repository methods or processing validation at the controller level (e.g. validate before calling repository CRUD functions).

@mastermunj
Copy link
Contributor Author

Hi @achrinza, #1872 is more or less similar to my query. As of now, LB4 doesn't seem to have the direct support of the validation at the data access layer.

@achrinza
Copy link
Member

achrinza commented Feb 11, 2020

Seems like it! In that case, we can close this a a duplicate of #1872 and continue discussion there.

@achrinza
Copy link
Member

achrinza commented Feb 11, 2020

Duplicate of #1872

@achrinza achrinza marked this as a duplicate and then as not a duplicate of #4187 Feb 11, 2020
@achrinza achrinza marked this as a duplicate of #1872 Feb 15, 2020
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

No branches or pull requests

2 participants