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

Add more DB/model check on "Contract" entity #4254

Open
Atala opened this issue May 13, 2024 · 0 comments
Open

Add more DB/model check on "Contract" entity #4254

Atala opened this issue May 13, 2024 · 0 comments

Comments

@Atala
Copy link
Member

Atala commented May 13, 2024

It seems to me that the the Contract entity :

  • is linked one to one either to a business restaurant group or to a restaurant
  • not both business restaurant group and restaurant at the same time

actually it seems to me that it is just an intermediary table to link PricingRuleSet with other items to apply it

So we should

  • make the linkS between Contract and other entities one to one
  • add a check that it is link to exactly one entity

I dont know how to do it in doctrine, but that is how to do it in postgres directly CHECK (email is not null OR phone is not null) (ref https://www.postgresql.org/docs/current/ddl-constraints.html )

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

No branches or pull requests

1 participant