80 lines
4.2 KiB
Python
80 lines
4.2 KiB
Python
import graphene
|
|
from graphene import InputObjectType
|
|
|
|
|
|
class AccountCreateInput(InputObjectType):
|
|
"""
|
|
Input type for creating a new account.
|
|
"""
|
|
customer_id = graphene.ID(required=True, description="ID of the customer this account belongs to")
|
|
name = graphene.String(required=True, description="Name of the account")
|
|
|
|
# Address fields
|
|
street_address = graphene.String(required=True, description="Street address of the account")
|
|
city = graphene.String(required=True, description="City of the account")
|
|
state = graphene.String(required=True, description="State of the account")
|
|
zip_code = graphene.String(required=True, description="ZIP code of the account")
|
|
|
|
# Primary contact fields
|
|
primary_contact_first_name = graphene.String(required=True, description="First name of primary contact")
|
|
primary_contact_last_name = graphene.String(required=True, description="Last name of primary contact")
|
|
primary_contact_phone = graphene.String(required=True, description="Phone number of primary contact")
|
|
primary_contact_email = graphene.String(required=True, description="Email of primary contact")
|
|
|
|
# Secondary contact fields (optional)
|
|
secondary_contact_first_name = graphene.String(description="First name of secondary contact")
|
|
secondary_contact_last_name = graphene.String(description="Last name of secondary contact")
|
|
secondary_contact_phone = graphene.String(description="Phone number of secondary contact")
|
|
secondary_contact_email = graphene.String(description="Email of secondary contact")
|
|
|
|
# Date fields
|
|
start_date = graphene.DateTime(required=True, description="Start date of the account (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date of the account (YYYY-MM-DD)")
|
|
|
|
|
|
class AccountUpdateInput(InputObjectType):
|
|
"""
|
|
Input type for updating an existing account.
|
|
"""
|
|
id = graphene.ID(required=True, description="ID of the account to update")
|
|
name = graphene.String(description="Name of the account")
|
|
|
|
# Address fields
|
|
street_address = graphene.String(description="Street address of the account")
|
|
city = graphene.String(description="City of the account")
|
|
state = graphene.String(description="State of the account")
|
|
zip_code = graphene.String(description="ZIP code of the account")
|
|
|
|
# Primary contact fields
|
|
primary_contact_first_name = graphene.String(description="First name of primary contact")
|
|
primary_contact_last_name = graphene.String(description="Last name of primary contact")
|
|
primary_contact_phone = graphene.String(description="Phone number of primary contact")
|
|
primary_contact_email = graphene.String(description="Email of primary contact")
|
|
|
|
# Secondary contact fields
|
|
secondary_contact_first_name = graphene.String(description="First name of secondary contact")
|
|
secondary_contact_last_name = graphene.String(description="Last name of secondary contact")
|
|
secondary_contact_phone = graphene.String(description="Phone number of secondary contact")
|
|
secondary_contact_email = graphene.String(description="Email of secondary contact")
|
|
|
|
# Date fields
|
|
start_date = graphene.DateTime(description="Start date of the account (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date of the account (YYYY-MM-DD)")
|
|
|
|
|
|
class AccountFilterInput(InputObjectType):
|
|
"""
|
|
Input type for filtering accounts.
|
|
"""
|
|
customer_id = graphene.ID(description="Filter by customer ID")
|
|
name = graphene.String(description="Filter by account name (partial match)")
|
|
city = graphene.String(description="Filter by city")
|
|
state = graphene.String(description="Filter by state")
|
|
zip_code = graphene.String(description="Filter by ZIP code")
|
|
is_active = graphene.Boolean(description="Filter by active status")
|
|
has_services = graphene.Boolean(description="Filter by whether the account has services")
|
|
has_projects = graphene.Boolean(description="Filter by whether the account has projects")
|
|
start_date_after = graphene.String(description="Filter by start date after (YYYY-MM-DD)")
|
|
start_date_before = graphene.String(description="Filter by start date before (YYYY-MM-DD)")
|
|
contact_email = graphene.String(description="Filter by contact email (partial match)")
|