Writing in Regira Entities
The write side of the same API: where the rules that hold on every save belong, the two silent traps of a PUT and a DELETE, and what sending a child list to the API really means.
-
Rules That Hold on Every Save
One place for each rule a save must obey, so it holds whether a user, an import or a nightly job did the saving. Required fields, timestamps and a code that never changes stop being scattered across controllers.
-
An Update That Blanks a Field the Form Never Showed
Keep an update from blanking a field the form never showed, such as a reference code, a close date or a total. What causes it, why every line involved passes review, and the one-line declaration that prevents it.
-
Omitted Is Not Empty
Saving a record from a small form should never wipe the items attached to it, while the full edit screen can still remove them all. How an API tells an omitted list from an empty one, and what a form sends for a row the user removed.
-
When Two People Edit the Same Record
When two people save the same record, the second save is refused instead of quietly erasing the first, whichever database the application runs on. The second user reloads and re-applies their change.