bcgov / parks-data-register

Apache License 2.0
6 stars 4 forks source link

[L] Search by Legal Name or ParkID - API #134

Open ashley-dhillon opened 11 months ago

ashley-dhillon commented 11 months ago

Developer who picks up #26 to add Acceptance Criteria details to this ticket - as well as a t-shirt size/estimate.

Note - this ticket blocks #26 and needs to be completed in parallel.

T-shirt size:

Acceptance Criteria / Dev Tasks:

Testing:

Example request (dev)

Headers Required:

URI: HTTP GET https://zloys5cfvf.execute-api.ca-central-1.amazonaws.com/api/search?text=Taku

Returns:

{
    "code": 200,
    "data": {
        "total": {
            "value": 1,
            "relation": "eq"
        },
        "max_score": 0.66301036,
        "hits": [
            {
                "_index": "main-index",
                "_id": "9522#Details",
                "_score": 0.66301036,
                "_source": {
                    "legalName": "Taku River/T’aḵú Téix̱ Conservancy",
                    "updateDate": "2023-09-18T16:54:12.574Z",
                    "phoneticName": "",
                    "displayName": "Taku River/T’aḵú Téix̱ Conservancy",
                    "sk": "Details",
                    "pk": "9522",
                    "effectiveDate": "2012-06-22",
                    "createDate": "2023-09-15T17:13:14.633Z",
                    "status": "current"
                }
            }
        ]
    },
    "msg": "Success",
    "error": null
}
manuji commented 10 months ago

Tested on Dev & TEST: Failed

FYI @marklise

marklise commented 10 months ago

You have omitted the required header flag as specified in the description:

Headers Required:

Authorization: None
manuji commented 10 months ago

@marklise could you please be kind enough to let me know how to add that header details from my browser? I understand how to pass that from the Postman, but not from the browser. I am sorry for the inconvieneice.

manuji commented 10 months ago

Tested on both TEST and Dev using Postman: Failed

Image

@marklise , when you are sending this back to QA please be kind enough to add a comment about your fix. Also please add notes about anything that I should do to get this right if I am doing this wrong.

marklise commented 10 months ago

This hasn't been deployed to TEST.. so your testing there will be invalid for sure. When testing the DEV environment, can you paste the null response? I'm not sure exactly what you're seeing. @manuji

manuji commented 10 months ago

Until I do the deployment to TEST here is what I see on the DEV environment.

When I try the exact same link provided by you @marklise , as the example it works on Dev, but if I search for another park name, like "Golden" I get a null response like below. I made sure that park is there on Dev DynamoDB.

Image

marklise commented 10 months ago

This is a successful api call, returning you NO results. Expected.

manuji commented 10 months ago

But if there should be results for this search?

Image

manuji commented 10 months ago

Tested on Dev: passed

JLWade commented 10 months ago

Thanks Manuji! WIll move this one to done and track error in #191