Skip to content

New trips and several currency inputs default to USD regardless of the user's default currency #4

Description

@Houtek

Every new trip is stored with base currency USD, even when the user's (and the instance's) default currency is something else. The new-trip form has no currency field, so the user can't avoid it; they have to fix the base currency afterwards on the edit page.

  • src/lib/server/repositories/tripsRepo.ts:243: createTrip stores base_currency: input.baseCurrency ?? 'USD', and none of the creation paths (form, import, email ingestion, templates, copy, MCP) pass a currency. The column default is also 'USD' (src/lib/server/db/mongrelSchema.ts:625).
  • Several inputs prefill a hardcoded 'USD' instead of the user's defaultCurrency:
    • add expense on the trip page (src/routes/trips/[id]/+page.svelte:1043, value="USD")
    • new insurance policy (src/routes/insurance/new/+page.svelte:82)
    • add card benefit (src/routes/cards/[id]/edit/+page.svelte:264)
    • trip edit fallback (src/routes/trips/[id]/edit/+page.svelte:113)

Steps: set Profile → Default currency to EUR, create a trip, open its edit page → base currency is USD.

Suggestion: fall back to the owner's default_currency in createTrip, and prefill the inputs from the signed-in user's default currency. Note: the root layout currently only passes { id, email, displayName, role } of the user to pages, so defaultCurrency would need to be added there, or loaded per page. Happy to send a PR; I've been running this change locally.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions