Open nathanschwarz opened 1 year ago
@yarons when upserting do we need to log the exact changes (fields / new values) ?
Yes fully but I think we should make it clear what exactly is happening:
[INFO] {timestamp - {actor}: Family {family} moved from residence {old_residence} to residence {new_residence}.
[INFO] {timestamp} - {actor}: Family {family} was assigned to {new_residence}.
[WARN] {timestamp} - {actor}: Family {family} was displaced.
[ERROR] {timestamp} - {actor}: Family {family} was not assigned to {new_residence}, Reason: {reason}.
First case informs of a successful transaction where the former house was detached, the new house was assigned and the budget is sufficient. Second case informs of a successful transaction where for some reason this family was previously displaced due to some error (either budget or technical). Third case is a warning since the user was displaced but not reassigned (if it's a UI decision it's intentional and informational but should popup a warning message saying that it wasn't assigned, if it's done by a script it's a warning) these cases happen either when there's insufficient funds or the user is leaving the Kibbutz. Fourth case is clearly an error, since it might be the outcome of insufficient funds or technical error (API inaccessible) etc.
The technical errors may include:
Thanks.
loguru
as dependency