Skip to content

refactor(mobile): make SERVICE_MOMENTS timezone dynamic per project #223

Description

@masch

Context

Currently, in moments.ts, SERVICE_MOMENTS contains hardcoded timezone values pointing to "America/Argentina/Buenos_Aires".

export const SERVICE_MOMENTS: {
  ...
  timezone: Timezone;
}[] = [
  {
    zzz_id: "BREAKFAST",
    ...
    timezone: "America/Argentina/Buenos_Aires",
  },
  ...
];

We recently made project timezones dynamic so they are loaded from the database (zzz_timezone on the project schema) and consumed dynamically in the client via Zustand useProjectStore.getState().selectedProject?.zzz_timezone.

However, the static list of SERVICE_MOMENTS and the getMomentConfig helper still contain the hardcoded "America/Argentina/Buenos_Aires" timezone fallback.

Proposed Change

Refactor SERVICE_MOMENTS or how it's consumed in components (e.g., booking, order calendar) to resolve the timezone dynamically from the active project.

  • Transform SERVICE_MOMENTS into a function/hook, or dynamically map it at runtime when listing/rendering.
  • Ensure all screens relying on SERVICE_MOMENTS use the correct timezone from the active project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions