59 lines
2.6 KiB
Python
59 lines
2.6 KiB
Python
import graphene
|
|
from graphene import InputObjectType
|
|
|
|
class RevenueCreateInput(InputObjectType):
|
|
"""
|
|
Input type for creating a new revenue record.
|
|
"""
|
|
account_id = graphene.ID(required=True, description="ID of the account this revenue belongs to")
|
|
amount = graphene.String(required=True, description="Revenue amount")
|
|
start_date = graphene.DateTime(required=True, description="Start date of the revenue period (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date of the revenue period (YYYY-MM-DD)")
|
|
|
|
|
|
class RevenueUpdateInput(InputObjectType):
|
|
"""
|
|
Input type for updating an existing revenue record.
|
|
"""
|
|
id = graphene.ID(required=True, description="ID of the revenue record to update")
|
|
account_id = graphene.ID(description="ID of the account this revenue belongs to")
|
|
amount = graphene.String(description="Revenue amount")
|
|
start_date = graphene.DateTime(description="Start date of the revenue period (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date of the revenue period (YYYY-MM-DD)")
|
|
|
|
|
|
class RevenueEndInput(InputObjectType):
|
|
"""
|
|
Input type for ending a revenue period.
|
|
"""
|
|
id = graphene.ID(required=True, description="ID of the revenue record to end")
|
|
end_date = graphene.DateTime(description="End date of the revenue period (YYYY-MM-DD), defaults to today if not provided")
|
|
|
|
|
|
class RevenueByDateRangeInput(InputObjectType):
|
|
"""
|
|
Input type for retrieving revenues by date range.
|
|
"""
|
|
start_date = graphene.DateTime(description="Start date for the period (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date for the period (YYYY-MM-DD)")
|
|
account_id = graphene.ID(description="Filter by account ID")
|
|
|
|
|
|
class CalculateTotalRevenueInput(InputObjectType):
|
|
"""
|
|
Input type for calculating total revenue.
|
|
"""
|
|
account_id = graphene.ID(description="Calculate revenue for a specific account")
|
|
start_date = graphene.DateTime(description="Start date for calculation period (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date for calculation period (YYYY-MM-DD)")
|
|
|
|
|
|
class RevenueFilterInput(graphene.InputObjectType):
|
|
"""Input type for filtering revenue records"""
|
|
account_id = graphene.ID(description="Filter by account ID")
|
|
is_active = graphene.Boolean(description="Filter by active status")
|
|
start_date = graphene.DateTime(description="Filter by start date")
|
|
end_date = graphene.DateTime(description="Filter by end date")
|
|
amount_min = graphene.Float(description="Filter by minimum amount")
|
|
amount_max = graphene.Float(description="Filter by maximum amount")
|