class Item(Document): schema = S.object( required=['title'], properties=S.props( ("title", S.string(description="The title of the item")), ("complete", S.boolean(default=False)), ("created", S.datetime()), ))
from sondra.schema import S, deep_merge schema1 = S.object( title="Ticket", description='A work order for Pronto', required=['title', 'creator', 'status', 'open', 'price'], properties=S.props( ("asset", S.fk('api','core','assets', title="Asset")), ("location", S.geo(description="A copy of asset location, for efficient indexing purposes.", geometry_type='Point')), ("title", S.string(title="Title", description="A description of the title")), ("ticket_type", S.fk('api','core','ticket-types', title="Ticket Type")), ("narrative", S.string(title="Narrative", description="Details relevant to fixing the problem.")), ("confirm_before_dispatch", S.boolean(title="Confirm before dispatch", description="True if 365 pronto should confirm with the asset contact before a worker arrives on site", default=False)), ("clock_running", S.boolean(default=False)), ("next_response_due", S.datetime()), ("inconsistencies", S.integer(default=0, description="The number of inconsistencies reported in answers or status changes.")), ("flags", S.integer(default=0, description="A count of out of bounds values reported in worksheets.")), ("requires_review", S.boolean(default=False)), ("designated_reviewer", S.fk('api','auth','users')), ("related", S.array(items=S.string(), description='Any tickets whose body of work relates to the completion of this ticket.')), ("predecessor", S.string(description='The ticket this ticket was raised as a consequence of.')), ("antecedent", S.string(description='The ticket raised as a consequence of this one.')), ("required_professionals", S.integer(description="The number of people required on this ticket", default=1)), ("assigned_professionals", S.array(items=S.ref('assignee'))), ("creator", S.fk('api','auth','users', description="The person who created the ticket")), ("assignee", S.fk('api','auth','users', description="The person who currently is responsible for the ticket")), ("status", S.ref('ticket_status')), ("tech_support_token", S.string( description="Automatically generated. Send this token as part of a URL in email to allow a third party " "tech support access to view this ticket and communicate with the assigned professionals " "through the admin console or third-party app."
("asset", S.fk('api', 'core', 'assets', title="Asset")), ("location", S.geo(description= "A copy of asset location, for efficient indexing purposes.", geometry_type='Point')), ("title", S.string(title="Title", description="A description of the title")), ("ticket_type", S.fk( 'api', 'core', 'ticket-types', title="Ticket Type")), ("narrative", S.string(title="Narrative", description="Details relevant to fixing the problem.")), ("confirm_before_dispatch", S.boolean( title="Confirm before dispatch", description= "True if 365 pronto should confirm with the asset contact before a worker arrives on site", default=False)), ("clock_running", S.boolean(default=False)), ("next_response_due", S.datetime()), ("inconsistencies", S.integer( default=0, description= "The number of inconsistencies reported in answers or status changes." )), ("flags", S.integer(default=0, description= "A count of out of bounds values reported in worksheets.")), ("requires_review", S.boolean(default=False)), ("designated_reviewer", S.fk('api', 'auth', 'users')),