Import one card from a chosen address book as a new company, into an existing company, or as a contact #9
Labels
No labels
bug
documentation
enhancement
performance
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-dav#9
Loading…
Reference in a new issue
No description provided.
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?
The only way a card reaches Postulo today is adoption: each card with a name and no link in the configured address book becomes a new contact, under the company its
ORGnames or a (no company) holding company (src/postulo_dav/sync.py:527-550). Nobody chooses the card, nothing is matched against existing contacts, and a company's card becomes a contact named after the company. The ask:Read here as a one-off copy of one card, started by the person, into a new company, an existing company, or a contact. Decisions 1 and 5 give the alternatives.
What the plugin should do
get_or_create_companywould match: the same name, ignoring case (src/postulo/applications/services.pyin the core; a card has no Wikidata id). The person confirms or picks another; nothing merges silently. That call creates when nothing matches, so offering a match needs companies readable (postulo/postulo#328). Whether the choosing screen also uses the core's duplicate finder (src/postulo/jobs/duplicates.py: legal forms set aside, website domains) is for postulo/postulo#327.FNof aKIND:orgorX-ABShowAs:COMPANYcard, otherwise the firstORGcomponent → name;URL→ website;NOTE→ notes;ADR→ the free-text location, locality and country only (a company is placed at city level); postal addresses once postulo/postulo#329 exists;TELandEMAIL→ the company's numbers and email once postulo/postulo#329 lands; before it, decision 3;LOGOorPHOTO→ decision 4.ORGunit as that company's department andADRas postal addresses. A card with noORGgets no company (Contact.companyis nullable now) rather than the holding company (sync.py:80).Contact.objects.createandsave()itself (sync.py:537,:154), against Writing a plugin's "Never write by saving a model".Decisions
src/postulo/resume/importing.py); a merge keeps the kept record's value and shows the other (src/postulo/jobs/merging.py). Recommended: fill blanks, and list where card and company differ, for the person to take the card's value field by field.TELandEMAILbefore postulo/postulo#329. Into the company's notes as text, or dropped. Recommended: notes, under a line naming the card, so nothing is lost silently.LOGOorPHOTOis inline data or an address. The core decodes, checks and re-encodes every logo it keeps (src/postulo/jobs/logos.py, off the surface). Recommended: inline data only, handed to the core if postulo/postulo#328 offers a call; no fetching an address during an import; until then, no logo.ORGunit; not the person's own profile, which #8 keeps Postulo → card.Needs from the core
get_or_create_company, by name or Wikidata id, setting nothing else.Before they land nothing can be imported card by card: adoption in the configured book is all there is. Depends on #13.
Done when
ORG:Acme;Legalimported as a contact is a contact at Acme in its Legal department (withemployer_structureon); a card with noORG, a contact with no company.uv run postulo-messages extract, fr-fr and pt-pt filled on the commit (the test gates them), the 23 EU catalogues before a tag (uv run pytest -m release). New surface names mean repinning the core (pyproject.toml's dev group pins1d6cdd7e0) and extendingtests/test_surface.py.From the list of DAV plugin improvements of 2026-09-30.
The maintainer's list of 2026-10-02 asks for vCard 4 as the import and export format for contact details. Core issue postulo/postulo#660 covers the reading side with a
.vcfimport (vCard 3.0 and 4.0), through one mapping offered on the plugin surface.Reusable here: reading a card into plain values,
KIND:orgto tell a company from a contact,ORG:Company;Unitfor a department,ADRchecked against its country's rules (postulo/postulo#306),TELthrough postulo/postulo#304, and the rule that an address inPHOTOorLOGOis never fetched (decision 4 here).This issue keeps its own scope: one card at a time from a chosen address book, matching and updating a company, writing through the core's services, and “keep in step”.
From the list of improvements of 2026-10-02.