senaite / senaite.jsonapi

RESTful JSON API for SENAITE
https://www.senaite.com
GNU General Public License v2.0
11 stars 19 forks source link

Catalogs route #35

Closed xispa closed 4 years ago

xispa commented 4 years ago

Description of the issue/feature this PR addresses

This Pull Requests adds the route catalogs:

http://localhost:8080/senaite/@@API/senaite/v1/catalogs/

If no catalog id is provided, this route returns a list with the catalogs registered in the system. If catalog id is provided, senaite.jsonapi returns the information for the catalog specified only.

For each catalog, the following information is displayed:

E.g.: http://localhost:8080/senaite/@@API/senaite/v1/catalogs/bika_catalog


{
    _runtime: 0.0061838626861572266,
    id: "bika_catalog",
    schema: [
        "Created",
        "Description",
        "Title",
        "Type",
        "UID",
        "creator",
        "getClientBatchID",
        "getClientID",
        "getClientTitle",
        "getDateReceived",
        "getDateSampled",
        "getId",
        "getProgress",
        "id",
        "inactive_state",
        "path",
        "portal_type",
        "review_state",
        "sortable_title"
    ],
    portal_types: [
        "Batch",
        "ReferenceSample",
        "Sample",
        "SamplePartition"
    ],
    indexes: [
        "BatchDate",
        "Creator",
        "Description",
        "SearchableText",
        "Title",
        "Type",
        "UID",
        "allowedRolesAndUsers",
        "created",
        "description",
        "getAnalysesUIDs",
        "getBlank",
        "getClientBatchID",
        "getClientID",
        "getClientPatientID",
        "getClientTitle",
        "getClientUID",
        "getDateReceived",
        "getDateSampled",
        "getDueDate",
        "getExpiryDate",
        "getId",
        "getObjPositionInParent",
        "getReferenceDefinitionUID",
        "getSupportedServices",
        "id",
        "inactive_state",
        "isValid",
        "is_active",
        "listing_searchable_text",
        "path",
        "portal_type",
        "review_state",
        "sortable_title",
        "title",
        "worksheetanalysis_review_state"
    ]
}

Current behavior before PR

Non-existing catalogs route

Desired behavior after PR is merged

Existing catalogs route

-- I confirm I have tested the PR thoroughly and coded it according to PEP8 standards.