I'm modeling the sales part of my system and I came across the following situation. I have created a payment method record and the MONEY payment method is standard and can not be changed, deleted, etc. I use this form of payment in opening cash for example. I create this form of payment in the application installation.
The system allows the user to create new forms of payment according to need. These new forms of payment can be changed.
How should I treat this situation?
Should I add a property in the class FormPaying that enables the class to be deleted and changed?
class FormaPagamento {
private Boolean podeSerAlterado;
}
Should I make a check whenever an operation is performed and if it is MONEY prohibit the operation?
Should I remove the options for changing any form of payment and only allow new forms of payment to be created? Having the option to enable and disable forms of payment.
class FormaPagamento {
private Boolean ativo;
}
[EDITED]
This is my class diagram for forms of payment.
When the user registers the payment method I display the options so that he can indicate the payment conditions he wants to make available, type 2 x interest in the VISA card would be a condition with 2 installments, 30 days recurrence and first installment in 30 days.
In the case of the MONEY payment method I have a default condition that is Vista, but the user may want to register a new payment condition in MONEY . So I kept this form of payment in the registry and not hardcoded.