Skip to content

Auto-detect "Packet for" partner from the uploaded file name #446

Description

@zachvazz

Problem

On both the single upload screen and the background batch screen, the user has to manually pick the partner in the "Packet for" dropdown (defaults to "Choose partner"). The partner/company name is already present in the file name, so this can be auto-identified.

Examples

File names from the batch screen include the company name:

  • FAS-01-3002-2001-A B&J.pdf
  • FAS-01-3002-2008-A BJ.pdf
  • FAS-01-3002-3001-A B&J.pdf

All of these should auto-select B&J as the "Packet for" partner.

Expected behavior

  • On file selection/drop, parse the file name and match against known partner names/aliases (e.g., B&J, BJ → B&J).
  • Auto-populate the "Packet for" dropdown with the matched partner.
  • Handle alias/variant matching (e.g., B&J vs BJ).
  • Fall back to "Choose partner" when no confident match is found; never block upload.
  • User can still override the auto-selected partner manually.

Applies to

  • Single upload screen (Component / Assembly).
  • Background batch screen (per-batch "Packet for"). If files in one batch map to different partners, decide behavior (flag mismatch vs. use first match) — see open question.

Open questions

  • Batch currently has one "Packet for" for the whole batch. If file names imply different partners within a batch, do we warn, or keep batch-level selection?
  • Source of partner aliases — derive from the org's partner list (organization_partners / OrgInfo partners) plus a configurable alias map.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions