lukas-kratochvil / mafil-proband-safety-questionnaire

MAFIL - Proband Safety Questionnaire
https://mafil-proband-safety-questionnaire.vercel.app
The Unlicense
2 stars 0 forks source link

Check DTOs for MAFILDB entities againts the MAFILDB model - nullable fields #19

Closed lukas-kratochvil closed 2 months ago

lukas-kratochvil commented 5 months ago

Deal with nullable fields. This is important primarily when fetching recent visits.

We have 2 choices how to deal with visits that contain null in fields our app requires:

  1. show all visits in the recent visits table and disable actions (duplication, visit detail (???)) for those that cannot be further manipulated by the operator
  2. filter out these visits and in the recent visits table display only those that can be further manipulated by the operator
lukas-kratochvil commented 5 months ago

MAFILDB is led by Django convention for a value of CharField/TextField if null=true: https://docs.djangoproject.com/en/5.0/ref/models/fields/#null

This attribute is never NULL and always contains "" (empty string) for no value: models.CharField("StringOnly", max_length=20, blank=True, null=True)

There is an exception if the CharField/TextField attribute is both unique and null, then it can contain NULL values: models.CharField("CanBeNull", max_length=20, blank=True, null=True, unique=True)

lukas-kratochvil commented 2 months ago

First option is chosen: "show all visits in the recent visits table and disable action buttons for those that cannot be further manipulated by the operator".