Beispiel #1
0
def samples(request: Response, sample_id: str = '') -> Response:
    """Get, create, or update laboratory samples."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='samples',
        model_type_singular='sample',
        model_id=sample_id,
    )
    return Response(response, status=status_code)
Beispiel #2
0
def areas(request: Response, area_id: str = '') -> Response:
    """Get, create, or update information about organization areas."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='areas',
        model_type_singular='area',
        model_id=area_id,
    )
    return Response(response, status=status_code)
def invoices(request: Response, invoice_id: str = '') -> Response:
    """Get, create, or update invoice data."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='invoices',
        model_type_singular='invoice',
        model_id=invoice_id,
    )
    return Response(response, status=status_code)
def analytes(request: Dict[str, Any], analyte_id: str = '') -> Response:
    """Get, create, or update information about cannabis analyses."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='analytes',
        model_type_singular='analyte',
        model_id=analyte_id,
    )
    return Response(response, status=status_code)
def results(request: Response, result_id: str = '') -> Response:
    """Get, create, or update laboratory results."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='results',
        model_type_singular='result',
        model_id=result_id,
    )
    return Response(response, status=status_code)
def measurements(request: Response, measurement_id: str = '') -> Response:
    """Get, create, or update measurements taken during an analysis."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='measurements',
        model_type_singular='measurement',
        model_id=measurement_id,
    )
    return Response(response, status=status_code)
def instruments(request: Response, instrument_id: str = '') -> Response:
    """Get, create, or update instrument information."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='instruments',
        model_type_singular='instrument',
        model_id=instrument_id,
    )
    return Response(response, status=status_code)
Beispiel #8
0
def vehicles(request: Response, vehicle_id: str = '') -> Response:
    """Get, create, or update information about cannabis analyses."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='vehicles',
        model_type_singular='vehicle',
        model_id=vehicle_id,
    )
    return Response(response, status=status_code)
def templates(request: Response, template_id: str = '') -> Response:
    """Get, create, or update laboratory templates,
    such as for certificates of analysis."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='templates',
        model_type_singular='template',
        model_id=template_id,
    )
    return Response(response, status=status_code)
def projects(request: Response, project_id: str = '') -> Response:
    """Get, create, or update laboratory projects, a group of samples
#     submitted at the same time by a given organization."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='projects',
        model_type_singular='project',
        model_id=project_id,
    )
    return Response(response, status=status_code)
def people(request: Response, person_id: str = '') -> Response:
    """Get, create, update, and delete information for people associated
    with a contact."""
    response, status_code = handle_request(
        request,
        actions=ACTIONS,
        model_type='people',
        model_type_singular='person',
        model_id=person_id,
    )
    return Response(response, status=status_code)
Beispiel #12
0
def transfers(request: Response, transfer_id: str = '') -> Response:
    """Get, create, or update information about cannabis analyses."""
    response, status_code = handle_request(
        request,
        actions={
            **ACTIONS,
            **{
                'POST': _post
            }
        },
        model_type='transfers',
        model_type_singular='transfer',
        model_id=transfer_id,
    )
    return Response(response, status=status_code)