"""
Predefined SelectionSets for Lead entity.
Based on the Lead GraphQL schema output type: GqlLead
"""
from ace.core.graphql import SelectionSet
from ace.centralize.graphql.selections.opportunity import OpportunitySelections
from ace.centralize.graphql.selections.entity_link import EntityLinkSelections
[docs]
class LeadSelections:
"""Reusable selection sets for Lead fields."""
MINIMAL = SelectionSet(
"leadId",
"leadNumber",
"name",
)
STANDARD = SelectionSet(
"leadId",
"leadGuid",
"leadNumber",
"name",
"leadTypeId",
"referralSourceId",
"estimatedValue",
"priorityId",
"referenceNumber",
"isArchived",
"statusId",
"subStatusId",
)
FULL = SelectionSet(
"leadId",
"leadGuid",
"leadNumber",
"name",
"leadTypeId",
"referralSourceId",
"estimatedValue",
"contactedDate",
"qualifiedDate",
"convertedDate",
"closedDate",
"priorityId",
"referenceNumber",
"isArchived",
"statusId",
"statusChangeDate",
"subStatusId",
"subStatusChangeDate",
)
WITH_OPPORTUNITIES = SelectionSet(
"leadId",
"leadNumber",
"name",
nested={
"opportunities": OpportunitySelections.MINIMAL,
}
)
WITH_OPPORTUNITIES_FULL = SelectionSet(
"leadId",
"leadGuid",
"leadNumber",
"name",
"leadTypeId",
"referralSourceId",
"estimatedValue",
"contactedDate",
"qualifiedDate",
"convertedDate",
"closedDate",
"priorityId",
"referenceNumber",
"isArchived",
"statusId",
"statusChangeDate",
"subStatusId",
"subStatusChangeDate",
nested={
"opportunities": OpportunitySelections.FULL,
}
)