Skip to content

Store column mappings when importing transactions #225

Open

Description

@NotThaDev

Problem

Every import asks the user to map each file column (Description, Amount, Date, Category) from scratch, even when the file comes from the same bank export as last time.

Already in place

  • Import flow: analyze → mapping → preview → confirm (api/transactions/import/*).
  • The mapping lives only in the import dialog state and resets on every analyze.

Scope

Named column mappings saved per user and reused on the next import.

User-facing behavior

  • In the mapping step the user can save the current mapping with a name (e.g. "Fineco export"), update the selected one, or delete it.
  • Mappings are stored by column header name, not by position, and belong to the user (any pocket can use them).
  • After a file is analyzed, if a saved mapping fits the file's headers it is applied automatically and the user sees which one.
    • Fits = every mapped header exists exactly once in the file (trimmed, case-insensitive). Best fit: same header set, then more mapped headers, then most recently updated.
  • A "Saved mapping" picker lets the user switch to another mapping or clear it. Headers of the picked mapping that are not in the file are listed.
  • Limits: name 1–100 chars, unique per user; max 50 mappings per user. Amount and Date must be mapped, no field twice.

Delivery (stacked draft PRs)

  1. Backend: ImportMapping model + migration, api/import-mappings CRUD (owner only), suggestedMappingId on the analyze response, tests, docs.
  2. UI (on top of 1): saved-mapping bar in the mapping step, auto-apply on analyze, save / update / delete.

Out of scope

  • A settings page to manage mappings.
  • Sharing mappings between users.
  • Default pocket / category or date format per mapping.

Activity

  1. changed the title [-]Store column maps when importing transactions[/-] [+]Store column mappings when importing transactions[/+] on Nov 8, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions