Ejemplo n.º 1
0
def fms_user_schema():
    return dict_schema(full_name=null_str_schema(),
                       contact_name=null_str_schema(),
                       address=address_schema(),
                       username=str_schema(),
                       phone=null_str_schema(),
                       email=null_str_schema(),
                       designation=null_str_schema(),
                       id=num_schema())
Ejemplo n.º 2
0
def customer_new_booking_schema():
    return status_msg_extra_schema(
        booking_id=num_schema(gt=0, multiple_of=1),
        vendors=list_schema(schema=dict_schema(
            id=num_schema(),
            name=null_str_schema(),
            phone=null_str_schema(),
        )),
        city_scores=list_schema(schema=list_schema(min_items=2, max_items=2)),
        address_scores=list_schema(
            schema=list_schema(min_items=3, max_items=3)))
Ejemplo n.º 3
0
def address_schema(null=True):
    schema_func = null_dict_schema if null else dict_schema
    return schema_func(required_schema_properties=[],
                       id=num_schema(),
                       line1=null_str_schema(),
                       line2=null_str_schema(),
                       line3=null_str_schema(),
                       landmark=null_str_schema(),
                       pin=null_str_schema(),
                       city=null_dict_schema(id=num_schema(),
                                             name=str_schema(),
                                             state=str_schema()))
Ejemplo n.º 4
0
def fms_app_data_schema():
    return status_msg_extra_schema(
        data=dict_schema(cities=list_schema(schema=dict_schema(
            id=num_schema(), name=str_schema(), state=str_schema())),
                         vehicles=list_schema(
                             schema=dict_schema(id=num_schema(),
                                                vehicle_type=null_str_schema(),
                                                capacity=null_str_schema())),
                         vendors=list_schema(schema=dict_schema(
                             id=num_schema(),
                             name=null_str_schema(),
                             phone=null_str_schema(),
                         )),
                         city_scores=list_schema(schema=dict_schema()),
                         address_scores=list_schema(schema=dict_schema()),
                         user=dict_schema(),
                         accounts_data=list_schema(schema=account_schema())))
Ejemplo n.º 5
0
def customer_app_data_schema():
    return status_msg_extra_schema(data=dict_schema(
        cities=list_schema(schema=dict_schema(
            id=num_schema(), name=str_schema(), state=str_schema())),
        vehicles=list_schema(schema=dict_schema(id=num_schema(),
                                                vehicle_type=null_str_schema(),
                                                capacity=null_str_schema())),
        vendors=list_schema(schema=dict_schema(
            id=num_schema(),
            name=null_str_schema(),
            phone=null_str_schema(),
        )),
        city_scores=list_schema(schema=list_schema(min_items=2, max_items=2)),
        address_scores=list_schema(
            schema=list_schema(min_items=3, max_items=3)),
        user=sme_user_schema(),
    ))
Ejemplo n.º 6
0
def fms_send_quote_schema():
    return status_msg_extra_schema(
        data=dict_schema(id=num_schema(),
                         transaction_id=num_schema(),
                         vehicle_request_id=num_schema(),
                         user_id=num_schema(),
                         quantity=num_schema(gt=0, multiple_of=1),
                         amount=num_schema(gt=0),
                         comments=null_str_schema()))
Ejemplo n.º 7
0
def doc_schema():
    return null_dict_schema(
        required_schema_properties=['url', 'thumb_url', 'doc_id', 'validity'],
        url=null_str_schema(),
        thumb_url=null_str_schema(),
        doc_id=null_str_schema(),
        validity=null_str_schema(),
        manufacture_year=null_str_schema(),
        insurer_name=null_str_schema(),
        permit_type=null_str_schema(),
        issue_location=null_str_schema(),
    )
Ejemplo n.º 8
0
def fms_list_vehicles_schema():
    return status_msg_extra_schema(
        data=list_schema(schema=dict_schema(
            id=num_schema(),
            vehicle_number=str_schema(),
            vehicle_type=null_num_schema(),
            vehicle_model=null_str_schema(),
        )),
        owners_data=list_schema(schema=dict_schema(
            id=num_schema(),
            name=null_str_schema(),
            phone=null_str_schema(),
        )),
        drivers_data=list_schema(
            schema=dict_schema(id=num_schema(),
                               name=str_schema(),
                               phone=str_schema(),
                               driving_licence_number=null_str_schema())),
        accounts_data=list_schema(schema=account_schema()))
Ejemplo n.º 9
0
def account_schema(null=True):
    func = null_dict_schema if null else dict_schema
    return func(required_schema_properties=[
        'id', 'bank', 'account_holder_name', 'account_number', 'account_type',
        'ifsc'
    ],
                id=num_schema(),
                bank=null_str_schema(),
                account_holder_name=str_schema(),
                account_number=str_schema(),
                account_type=str_schema(),
                account_type_verbose=str_schema(),
                ifsc=str_schema())
Ejemplo n.º 10
0
def driver_schema(null=True):
    func = null_dict_schema if null else dict_schema
    return func(
        required_schema_properties=[
            'id', 'name', 'phone', 'driving_licence_number', 'account',
            'dl_doc'
        ],
        id=num_schema(),
        name=str_schema(),
        phone=str_schema(),
        driving_licence_number=null_str_schema(),
        account=account_schema(),
        pan_doc=doc_schema(),
        dl_doc=doc_schema(),
    )
Ejemplo n.º 11
0
def fms_available_loads_schema():
    return status_msg_extra_schema(data=list_schema(schema=dict_schema(
        vehicle_request_id=num_schema(),
        vehicle_category_id=num_schema(),
        vehicle_category=str_schema(),
        vehicle_quantity=num_schema(gt=0, multiple_of=1),
        transaction_id=num_schema(),
        transaction_number=str_schema(),
        shipment_datetime=str_schema(),
        from_city=str_schema(),
        from_state=str_schema(),
        to_city=str_schema(),
        to_state=str_schema(),
        quote=null_dict_schema(id=num_schema(),
                               transaction_id=num_schema(),
                               vehicle_request_id=num_schema(),
                               user_id=num_schema(),
                               quantity=num_schema(gt=0, multiple_of=1),
                               amount=num_schema(),
                               comments=null_str_schema()))))
Ejemplo n.º 12
0
def vehicle_schema(null=True):
    func = null_dict_schema if null else dict_schema
    return func(required_schema_properties=[
        'id', 'vehicle_number', 'rc_doc', 'puc_doc', 'permit_doc',
        'fitness_doc', 'insurance_doc', 'vehicle_type', 'registration_year'
    ],
                id=num_schema(),
                vehicle_number=str_schema(),
                owner=owner_schema(),
                driver=driver_schema(),
                driver_app_user=null_dict_schema(),
                vehicle_type=null_num_schema(),
                registration_year=null_str_schema(),
                rc_doc=doc_schema(),
                puc_doc=doc_schema(),
                fitness_doc=doc_schema(),
                permit_doc=doc_schema(),
                insurance_doc=doc_schema(),
                owner_pan_doc=doc_schema(),
                owner_dec_doc=doc_schema(),
                driver_dl_doc=doc_schema(),
                account=account_schema())
Ejemplo n.º 13
0
def owner_schema(null=True):
    func = null_dict_schema if null else dict_schema
    return func(required_schema_properties=[
        'id', 'user_id', 'username', 'user_fullname', 'name', 'phone',
        'declaration'
    ],
                id=num_schema(),
                user_id=null_num_schema(),
                username=null_str_schema(),
                user_fullname=null_str_schema(),
                name=null_str_schema(),
                phone=null_str_schema(),
                declaration=null_str_schema(),
                declaration_validity=null_str_schema(),
                declaration_doc=null_dict_schema(),
                account_details=account_schema(),
                address=null_dict_schema(),
                vehicles_detail=null_dict_schema(),
                taxation_details=null_dict_schema(id=num_schema(),
                                                  pan=str_schema()))
Ejemplo n.º 14
0
def fms_list_drivers_schema():
    return status_msg_extra_schema(data=list_schema(
        schema=dict_schema(id=num_schema(),
                           name=str_schema(),
                           phone=str_schema(),
                           driving_licence_number=null_str_schema())), )
Ejemplo n.º 15
0
def pod_details_schema():
    return status_msg_extra_schema(can_upload_pod=bool_schema(),
                                   no_pod_reason=null_str_schema(),
                                   pod_details=null_dict_schema())