diff --git a/field-mapping.md b/field-mapping.md index 615abc8..a1f46b1 100644 --- a/field-mapping.md +++ b/field-mapping.md @@ -23,7 +23,7 @@ Source: Adobe Sign UI "Change field type" dropdown (all 15 types) + API field da | Image | INLINE_IMAGE | DATA | — | (skipped) | No DocuSign equivalent | | Company | TEXT_FIELD | COMPANY or SIGNER_COMPANY | — | companyTabs | Auto-populated from signer profile. API returns `SIGNER_COMPANY` when set via UI. | | Title | TEXT_FIELD | TITLE or SIGNER_TITLE | — | titleTabs | Auto-populated from signer profile. API returns `SIGNER_TITLE` when set via UI. | -| Stamp | STAMP | — | — | (skipped) | No DocuSign equivalent | +| Stamp | STAMP | — | — | stampTabs | DocuSign stampTabs — signer uploads/selects a stamp image (hanko/seal). Requires stamp feature enabled on account. | | Signature block | BLOCK | SIGNATURE_BLOCK | — | signHereTabs | Composite block — mapped to sign-here | ## Role/Recipient Mapping @@ -76,7 +76,7 @@ Tab types that support merging (one tab emitted per location): `emailAddressTabs`, `companyTabs`, `titleTabs`, `listTabs`, `checkboxTabs` Tab types that do not merge (only first location used or handled specially): -`signHereTabs`, `initialHereTabs` — each location is an independent signing action +`signHereTabs`, `initialHereTabs`, `stampTabs` — each location is an independent signing/stamping action `radioGroupTabs` — each location is one radio button within the group `signerAttachmentTabs` — each location is an independent attachment request @@ -90,6 +90,9 @@ Tab types that do not merge (only first location used or handled specially): best-effort via standard DocuSign validation types only. - **Radio group flattening**: Adobe radios with `radioGroup` are merged into a single DocuSign `radioGroupTabs` entry with per-location radio button coordinates. +- **Stamp tab account feature**: `stampTabs` requires the stamp/hanko feature to be + enabled on the DocuSign account. Verify before migrating templates that contain + Adobe Sign STAMP fields. ## To Do - Add conditional logic/rule mapping table diff --git a/src/compose_docusign_template.py b/src/compose_docusign_template.py index 0f66d95..36ef65a 100644 --- a/src/compose_docusign_template.py +++ b/src/compose_docusign_template.py @@ -19,9 +19,10 @@ Key rules applied: - No top-level "status" field (belongs on envelope sends, not templates) Field type coverage: - Mapped: TEXT_FIELD, SIGNATURE, CHECKBOX, DATE, DROP_DOWN, RADIO, BLOCK + Mapped: TEXT_FIELD, SIGNATURE, CHECKBOX, DATE, DROP_DOWN, RADIO, BLOCK, STAMP Partial: FILE_CHOOSER → signerAttachmentTabs (with warning) - Skipped: INLINE_IMAGE (no DocuSign equivalent — warning logged) + STAMP → stampTabs (requires stamp feature enabled on DocuSign account — warning logged) + Skipped: INLINE_IMAGE, PARTICIPATION_STAMP (no DocuSign equivalent — warning logged) """ import base64 @@ -229,8 +230,14 @@ def build_tabs_for_field(field: dict, warnings: list) -> dict: warnings.append(f"INLINE_IMAGE '{label}' → skipped (no DocuSign equivalent)") return {} - elif input_type in ("STAMP", "PARTICIPATION_STAMP"): - warnings.append(f"{input_type} '{label}' → skipped (no DocuSign equivalent)") + elif input_type == "STAMP": + # DocuSign stampTabs — signer uploads or selects a hanko/seal stamp image. + # Requires the stamp feature to be enabled on the DocuSign account. + warnings.append(f"STAMP '{label}' → stampTabs (verify stamp feature is enabled on your DocuSign account)") + return {"stampTabs": [_make_base_tab(loc, label) for loc in locations]} + + elif input_type == "PARTICIPATION_STAMP": + warnings.append(f"PARTICIPATION_STAMP '{label}' → skipped (no DocuSign equivalent)") return {} else: