-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Model Design Guidelines
No business logic should be based on hard coded roles. Either make it a configuration or set a property in User / Employee whether user has the permission to do the action.
Sometimes to change the default behaviour of a transaction, a developer adds a global setting to allow it to behave in one way or another. These settings are hard to discover and hence must be avoided. Either these settings must be changeable at the transaction level with a Check type field, in the context.
Example if you want to allow Orders and Invoice of different Currencies, don't make a global "Allow Invoice in a Separate Currency". The better design is to make a Check in the Sales Order to allow an invoice in a different currency. Even better, just ask the user to make a duplicate Sales Order and change the older one if the customer demands the invoice in another currency.