Skip to content

feat: update Entity flag field types to bool (Tango #2377) #32

Description

@infinityplusone

Companion to Tango #2377 (serializer + shaping parity for retyped Entity fields).

Tango's 0064_lakehouse_consumer_cleanup booleanizes nine Entity flag fields and drops source_type. After it ships, /api/entities/ and webhook alerts.entity.match payloads serialize those flags as JSON true / false / null instead of the legacy string tokens. tango-python should update its Entity Pydantic model to match.

Field type changes (str → bool)

Field Old (str tokens) New (bool)
registered "Y" true
registration_status "Active" / "Inactive" true / false
uei_status "Active" / "Not Active" true / false
public_display_flag "Y" / "NPDY" true / false
bonding_flag "YES" / "NO" true / false
disaster_registry_flag "YES" / "NO" true / false
debt_subject_to_offset "Y" / "N" true / false
credit_card_usage "Y" / "N" true / false
edi_information_flag "Y" / "N" true / false

All nine should be Optional[bool] — pre-0064 tokens outside the known set (or NULL) map to None. The NPDYfalse mapping for public_display_flag is the one non-obvious one; literal interpretation is "Not Publicly DisplaYed".

Other changes from the same migration

  • source_type: removed entirely from the API response. Remove it from the Pydantic model. Consumers that read entity.source_type should switch to entity.source (already populated, same semantic).
  • Seven *_desc top-level fields (purpose_of_registration_desc, entity_structure_desc, entity_type_desc, profit_structure_desc, organization_structure_desc, state_of_incorporation_desc, country_of_incorporation_desc) are removed from the default entity payload. They were already accessible via ?shape=…(*) expansion, which now derives {code, description} at render time and is unchanged in shape. If the SDK's Entity model has any of those top-level keys, drop them.
  • evs_source and exclusion_status_flag are now strictly enforced enums on the server ({"D&B", "E&Y"} and {"Y", "N", "D"} respectively). They still come back as strings; no SDK type change needed beyond optionally narrowing the field to a Literal[...].

Action items

  • Update Entity model field types in tango/models.py.
  • Bump record cassettes if any tests assert string values on the renamed fields.
  • CHANGELOG entry on the SDK side flagging the breaking change for downstream Python consumers.

~ Hal

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions