"""
Predefined SelectionSets for Finance entities (Transaction, Statement).
Based on the Finance GraphQL schema output types:
GqlFinanceTransactionDetail, GqlStatement, FinanceStatus,
StatementType, TranslationDataName
"""
from ace.core.graphql import SelectionSet
[docs]
class FinanceStatusSelections:
"""Reusable selection sets for FinanceStatus fields."""
STANDARD = SelectionSet(
"id",
"name",
"resourceStringKey",
)
[docs]
class StatementTypeSelections:
"""Reusable selection sets for StatementType fields."""
STANDARD = SelectionSet(
"statementTypeId",
"statementTypeGuid",
"statementTypeIdentifier",
"displayName",
)
[docs]
class TransactionSelections:
"""Reusable selection sets for Transaction fields."""
MINIMAL = SelectionSet(
"transactionDetailId",
)
STANDARD = SelectionSet(
"transactionDetailId",
"transactionDetailGuid",
"transactionTypeGuid",
"transactionTypeId",
"transactionDate",
"amount",
"amountTypeId",
"basisAmount",
"currencyId",
"rate",
"sharedPercent",
"statusId",
"description",
"partyId",
"statementId",
)
FULL = SelectionSet(
"transactionDetailId",
"transactionDetailGuid",
"transactionTypeGuid",
"transactionTypeId",
"transactionDate",
"amount",
"amountTypeId",
"basisAmount",
"currencyId",
"rate",
"sharedPercent",
"statusId",
"description",
"partyId",
"referenceEntityId",
"referenceEntityTypeId",
"statementId",
"statementGuid",
nested={
"status": FinanceStatusSelections.STANDARD,
}
)
# Mutation output selections (for CreateTransactionOutput)
WITH_AGENT_LINK = SelectionSet(
"transactionDetailId",
nested={
"linkToAgent": SelectionSet(
"accreditedAgentContractId",
"baseAgentContractId",
)
}
)
WITH_POLICY_LINK = SelectionSet(
"transactionDetailId",
nested={
"linkToAgent": SelectionSet(
"accreditedAgentContractId",
"baseAgentContractId",
),
"linkToPolicy": SelectionSet(
"policyId",
"coverageId",
)
}
)
[docs]
class StatementSelections:
"""Reusable selection sets for Statement fields."""
MINIMAL = SelectionSet(
"statementId",
)
STANDARD = SelectionSet(
"statementId",
"guid",
"currencyId",
"description",
"issuerPartyId",
"recipientPartyId",
"referenceNumber",
"startDate",
"endDate",
"totalAmount",
nested={
"status": FinanceStatusSelections.STANDARD,
"statementType": StatementTypeSelections.STANDARD,
}
)
FULL = SelectionSet(
"statementId",
"guid",
"currencyId",
"description",
"issuerPartyId",
"recipientPartyId",
"referenceNumber",
"startDate",
"endDate",
"totalAmount",
nested={
"status": FinanceStatusSelections.STANDARD,
"statementType": StatementTypeSelections.STANDARD,
"transactions": TransactionSelections.STANDARD,
}
)