Date and Timezone become load-bearing #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Implements ADR 0001.
Datebecomes the single day boundary in the system, resolved by converting an instant into the User'sTimezone.Today there are two contradictory definitions of "day": calendar grouping uses the local date implied by the offset the client sent, while streak calculation uses
Utc::now(). For a User in a far-eastern offset these disagree for a large part of every day, and their streak silently breaks. Both must flow through one rule.Timezonecurrently only checks that the string contains a/, so"Foo/Bar"stores fine and then fails at parse time in the application layer. Once the day boundary depends on it, an unparseable timezone means unjoinable data — validate against the real IANA database at construction. Domain already pullsemail_addressto validate theEmailvalue object, so a validation crate in domain has precedent.Timezonestops being decorative. Clients set it from the platform at register and login. Requests that need a day boundary are rejected with an explicit error when it is unset, rather than defaulting silently — misfiled data produces analytics that look correct and are not.Acceptance criteria
Timezone::newrejects anything not in the IANA databaseDateusing the User'sTimezoneTimezonefails with a clear, actionable errorUserentry no longer describes timezone as optional for analytics displayBlocked by
None - can start immediately.