48 lines
2.2 KiB
Python
48 lines
2.2 KiB
Python
import graphene
|
|
from graphene import InputObjectType
|
|
|
|
class LaborCreateInput(InputObjectType):
|
|
"""
|
|
Input type for creating a new labor record.
|
|
"""
|
|
account_id = graphene.ID(required=True, description="ID of the account this labor record belongs to")
|
|
amount = graphene.String(required=True, description="Labor cost amount")
|
|
start_date = graphene.DateTime(required=True, description="Start date of the labor period (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date of the labor period (YYYY-MM-DD)")
|
|
|
|
|
|
class LaborUpdateInput(InputObjectType):
|
|
"""
|
|
Input type for updating an existing labor record.
|
|
"""
|
|
id = graphene.ID(required=True, description="ID of the labor record to update")
|
|
account_id = graphene.ID(description="ID of the account this labor record belongs to")
|
|
amount = graphene.String(description="Labor cost amount")
|
|
start_date = graphene.DateTime(description="Start date of the labor period (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date of the labor period (YYYY-MM-DD)")
|
|
|
|
|
|
class LaborEndInput(InputObjectType):
|
|
"""
|
|
Input type for ending a labor period.
|
|
"""
|
|
id = graphene.ID(required=True, description="ID of the labor record to end")
|
|
end_date = graphene.DateTime(description="End date of the labor period (YYYY-MM-DD), defaults to today if not provided")
|
|
|
|
|
|
class LaborCalculateInput(InputObjectType):
|
|
"""
|
|
Input type for calculating labor costs.
|
|
"""
|
|
account_id = graphene.ID(description="Calculate labor for a specific account")
|
|
start_date = graphene.String(description="Start date for calculation period (YYYY-MM-DD)")
|
|
end_date = graphene.DateTime(description="End date for calculation period (YYYY-MM-DD)")
|
|
|
|
class LaborFilterInput(graphene.InputObjectType):
|
|
"""Input type for filtering labor 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") |