From 7d8f4222a3e997416ee61798c4e7230f908874c3 Mon Sep 17 00:00:00 2001 From: Max Hohlfeld Date: Sat, 4 Jan 2025 23:47:02 +0100 Subject: [PATCH] doc: design decisions draft --- doc/design-decisions.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/design-decisions.md b/doc/design-decisions.md index 27a82b4f..5133fa4a 100644 --- a/doc/design-decisions.md +++ b/doc/design-decisions.md @@ -14,3 +14,12 @@ ## Testing ### User - CreatingNewUser_AsAdmin_SendsRegistrationMail + +## Data Layer +- use model structs for the exact represenation in databse (maybe sometimes a field is not used in code, then its maybe fine to drop it off the struct e.g. Timestamp at Token tables) +- use changesset struct based on model (wihout ids) + - groups parametres for methods + - allows validation on fields (ecto changeset, elm js data down actions up) + - all fields are as they are on the model, all field must be supplied; no way for "partial updates" +- partial updates for only one or two fields get a special method on the model +- validate using garde and custom context with gives access to database pool