Somebody please give me an example of how to write good validation rules and scenarios
Let’s consider this table:
id - primary key, set by db
parent_id - foreign key, set by form
owner_id - foreign key, set by script, w/o form
field_1, field_2, ..., field_n - some data, required, set by form
another_field_1, another_field_2, ..., another_field_n - some data, can be empty/null, set by form
is_disabled - active flag, set by form during administration process
and these scenarios: update by user, update by admin, delete.