Source code for ace.centralize.graphql.selections.party

"""
Predefined SelectionSets for Party and related entities.

Based on the Party GraphQL schema output types:
    GqlPartyDetail, GqlPerson, GqlOrganization, GqlContactDetail,
    GqlAddress, GqlEmail, GqlPhone, GqlBankAccount, GqlCreditScore,
    GqlDisplayNameDetail, GqlTranslationDetail, GqlEmployment,
    GqlParticipantDetail, GqlPartyRole, GqlBeneficiaryRole, GqlTrusteeRole
"""

from ace.core.graphql import SelectionSet


[docs] class DisplayNameSelections: """Reusable selection sets for GqlDisplayNameDetail fields.""" MINIMAL = SelectionSet("default") WITH_TRANSLATIONS = SelectionSet( "default", nested={ "translations": SelectionSet("id", "translation"), } )
[docs] class ContactSelections: """Reusable selection sets for GqlContactDetail and nested fields.""" ADDRESSES = SelectionSet( "id", "street", "city", "stateId", "countryId", "postalCode", "addressTypeId", "additionalInfo", "main", ) ADDRESSES_FULL = SelectionSet( "id", "street", "city", "stateId", "countryId", "postalCode", "addressTypeId", "addressTypeOtherDesc", "additionalInfo", "main", "partyId", "startDate", "endDate", "isInvalid", "isVerified", ) EMAILS = SelectionSet( "id", "emailAddress", "emailTypeId", "isInvalid", "main", ) EMAILS_FULL = SelectionSet( "id", "emailAddress", "emailTypeId", "isInvalid", "main", "partyId", "terminatedDate", ) PHONES = SelectionSet( "id", "extension", "phoneTypeId", "phoneValue", "main", ) PHONES_FULL = SelectionSet( "id", "extension", "phoneTypeId", "phoneValue", "isInvalid", "main", "partyId", "terminatedDate", ) STANDARD = SelectionSet( "preferredCommunicationMethodId", nested={ "addresses": ADDRESSES, "emails": EMAILS, "phones": PHONES, } ) FULL = SelectionSet( "preferredCommunicationMethodId", nested={ "addresses": ADDRESSES_FULL, "emails": EMAILS_FULL, "phones": PHONES_FULL, } )
[docs] class EmploymentSelections: """Reusable selection sets for GqlEmployment fields.""" STANDARD = SelectionSet( "id", "employerName", "employmentStatusId", "industryTypeId", "occupation", ) FULL = SelectionSet( "id", "employerName", "employmentStatusId", "industryTypeId", "occupation", "creationDateTimeUTC", "creationUserId", "lastUpdateDateTimeUTC", "lastUpdateUserId", "deletionDateTimeUTC", "deletionUserId", )
[docs] class IndividualSelections: """Reusable selection sets for GqlPerson fields.""" MINIMAL = SelectionSet( "birthDate", "firstName", "lastName", nested={ "displayName": DisplayNameSelections.MINIMAL, } ) STANDARD = SelectionSet( "id", "birthDate", "deathDate", "firstName", "lastName", "middleName", "suffix", "title", "genderId", "citizenshipId", "maritalStatusId", "occupation", "occupationTitle", "preferredLanguageId", nested={ "displayName": DisplayNameSelections.MINIMAL, } ) FULL = SelectionSet( "id", "birthDate", "deathDate", "firstName", "lastName", "middleName", "suffix", "title", "genderId", "citizenshipId", "maritalStatusId", "occupation", "occupationTitle", "origName", "preferredLanguageId", "residencyStatusId", "employeeNumber", nested={ "displayName": DisplayNameSelections.WITH_TRANSLATIONS, "employment": EmploymentSelections.FULL, } )
[docs] class OrganizationSelections: """Reusable selection sets for GqlOrganization fields.""" MINIMAL = SelectionSet( "id", nested={ "displayName": DisplayNameSelections.MINIMAL, } ) STANDARD = SelectionSet( "id", "preferredLanguageId", "website", "establishedDate", "dissolvedDate", "organizationTypeId", "organizationNumber", nested={ "displayName": DisplayNameSelections.MINIMAL, "name": DisplayNameSelections.MINIMAL, } ) FULL = SelectionSet( "id", "annualRevenue", "dissolvedDate", "employeeCount", "establishedDate", "financialEndDay", "financialEndMonth", "industryTypeId", "organizationLegalFormId", "organizationNumber", "organizationTypeId", "preferredLanguageId", "website", nested={ "displayName": DisplayNameSelections.WITH_TRANSLATIONS, "name": DisplayNameSelections.WITH_TRANSLATIONS, } )
[docs] class BankAccountSelections: """Reusable selection sets for GqlBankAccount fields.""" STANDARD = SelectionSet( "id", "accountNumber", "bankAccountTypeId", "branchCode", "countryId", "financialInstitutionNumber", "partyId", )
[docs] class CreditScoreSelections: """Reusable selection sets for GqlCreditScore fields.""" STANDARD = SelectionSet( "id", "value", "ratingAgencyId", "description", "effectiveDate", "partyId", ) FULL = SelectionSet( "id", "value", "ratingAgencyId", "description", "effectiveDate", "partyId", "creationDateTimeUTC", "creationUserId", "lastUpdateDateTimeUTC", "lastUpdateUserId", "deletionDateTimeUTC", "deletionUserId", )
[docs] class BeneficiaryRoleSelections: """Reusable selection sets for GqlBeneficiaryRole fields.""" STANDARD = SelectionSet( "id", "beneficiaryTypeId", "relationshipToInsuredId", ) FULL = SelectionSet( "id", "beneficiaryTypeId", "relationshipToInsuredId", "creationDateTimeUTC", "creationUserId", "lastUpdateDateTimeUTC", "lastUpdateUserId", "deletionDateTimeUTC", "deletionUserId", )
[docs] class TrusteeRoleSelections: """Reusable selection sets for GqlTrusteeRole fields.""" STANDARD = SelectionSet( "id", "trustTypeId", ) FULL = SelectionSet( "id", "trustTypeId", "creationDateTimeUTC", "creationUserId", "lastUpdateDateTimeUTC", "lastUpdateUserId", "deletionDateTimeUTC", "deletionUserId", )
[docs] class PartyRoleSelections: """Reusable selection sets for GqlPartyRole fields.""" MINIMAL = SelectionSet( "id", "partyRoleId", "statusId", ) STANDARD = SelectionSet( "id", "partyRoleId", "sharedPercent", "effectiveDate", "terminationDate", "terminationReasonId", "statusId", "agentContractId", "entityId", "entityTypeId", "isIrrevocable", "participantId", ) FULL = SelectionSet( "id", "partyRoleId", "sharedPercent", "effectiveDate", "terminationDate", "terminationReasonId", "statusId", "agentContractId", "entityId", "entityTypeId", "isIrrevocable", "participantId", "creationDateTimeUTC", "creationUserId", "lastUpdateDateTimeUTC", "lastUpdateUserId", "deletionDateTimeUTC", "deletionUserId", nested={ "beneficiary": BeneficiaryRoleSelections.FULL, "trustee": TrusteeRoleSelections.FULL, } )
[docs] class ParticipantSelections: """Reusable selection sets for GqlParticipantDetail fields.""" MINIMAL = SelectionSet( "id", nested={ "party": SelectionSet("id"), "roles": PartyRoleSelections.MINIMAL, } ) STANDARD = SelectionSet( "id", "entityId", "entityTypeId", nested={ "party": SelectionSet( "id", "partyEntityTypeId", "partyTypeId", ), "roles": PartyRoleSelections.STANDARD, } ) FULL = SelectionSet( "id", "entityId", "entityTypeId", "creationDateTimeUTC", "creationUserId", "lastUpdateDateTimeUTC", "lastUpdateUserId", "deletionDateTimeUTC", "deletionUserId", nested={ "party": SelectionSet( "id", "partyEntityTypeId", "partyTypeId", "externalIdentifier", "referenceNumber", nested={ "contact": ContactSelections.FULL, "individual": IndividualSelections.FULL, "organization": OrganizationSelections.FULL, "bankAccounts": BankAccountSelections.STANDARD, "creditScores": CreditScoreSelections.FULL, } ), "roles": PartyRoleSelections.FULL, } )
[docs] class PartySelections: """Reusable selection sets for GqlPartyDetail fields.""" MINIMAL = SelectionSet( "id", "partyTypeId", "partyEntityTypeId", ) STANDARD = SelectionSet( "id", "partyTypeId", "partyEntityTypeId", "externalIdentifier", "referenceNumber", nested={ "contact": ContactSelections.STANDARD, "individual": IndividualSelections.STANDARD, "organization": OrganizationSelections.STANDARD, "bankAccounts": BankAccountSelections.STANDARD, "creditScores": CreditScoreSelections.STANDARD, } ) FULL = SelectionSet( "id", "partyTypeId", "partyEntityTypeId", "externalIdentifier", "referenceNumber", nested={ "contact": ContactSelections.FULL, "individual": IndividualSelections.FULL, "organization": OrganizationSelections.FULL, "bankAccounts": BankAccountSelections.STANDARD, "creditScores": CreditScoreSelections.FULL, } ) # ── Mutation output selections ──────────────────────────────────────────── CREATE = SelectionSet( "partyId", "uuid", "partyEntityTypeId", nested={ "info": SelectionSet( "id", "partyTypeId", "partyEntityTypeId", "externalIdentifier", "referenceNumber", nested={ "individual": IndividualSelections.STANDARD, "organization": OrganizationSelections.STANDARD, "bankAccounts": BankAccountSelections.STANDARD, "creditScores": CreditScoreSelections.STANDARD, } ) } ) UPDATE = SelectionSet( "partyId", "partyEntityTypeId", nested={ "info": SelectionSet( "id", "partyTypeId", "partyEntityTypeId", "externalIdentifier", "referenceNumber", nested={ "contact": ContactSelections.STANDARD, "individual": IndividualSelections.STANDARD, "organization": OrganizationSelections.STANDARD, "bankAccounts": BankAccountSelections.STANDARD, "creditScores": CreditScoreSelections.STANDARD, } ) } ) BATCH = UPDATE