bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 59 forks source link

API - Code change to implement query parameters and feature flag #11267

Closed mstanton1 closed 2 years ago

mstanton1 commented 2 years ago

Feature flagged for release to a limited set of API users.

Test Notes: Testing only available via the API: 1 No filtering GET https://bcregistry-dev.apigee.net/ppr/api/v1/financing-statements/registrations?collapse=true

2 Filtering by date range: GET https://bcregistry-dev.apigee.net/ppr/api/v1/financing-statements/registrations?startDateTime=2021-11-04T00:00:00-08:00&endDateTime=2021-11-10T00:00:00-08:00

  1. Filtering by registration number: GET https://bcregistry-dev.apigee.net/ppr/api/v1/financing-statements/registrations?registrationNumber=256331N

  2. Filtering by registration number and date range: GET https://bcregistry-dev.apigee.net/ppr/api/v1/financing-statements/registrations?registrationNumber=100338B&startDateTime=2021-11-04T16:00:00+00:00&endDateTime=2021-11-10T16:00:00+00:00

  3. Filtering by client reference ID /folio number: GET https://bcregistry-dev.apigee.net/ppr/api/v1/financing-statements/registrations?clientReferenceId=T-FS-RL-0012

chdivyareddy commented 2 years ago

Hey @doug-lovett , Filtering by date range from 2022-02-28T00:00:00-08:00 to 2022-03-05T00:00:00-08:00 in DEV is not giving the correct results. (account id 2753 in DEV)

Get: https://bcregistry-dev.apigee.net/ppr/api/v1/financing-statements/registrations?startDateTime=2022-02-28T00:00:00-08:00&endDateTime=2022-03-05T00:00:00-08:00

Eg: Base reg no: 256458N, Renewal 256475N was done on March 4, 2022 at 4:40:09 pm Pacific time (last updated and created time displays as 2022-03-05T00:40:09+00:00) { "baseRegistrationNumber": "256458N", "clientReferenceId": "", "createDateTime": "2022-03-05T00:40:09+00:00", "expireDays": 2552, "lastUpdateDateTime": "2022-03-05T00:40:09+00:00", "path": "/ppr/api/v1/financing-statements/256458N/renewals/256475N", "registeringName": "BCREGTEST HUBERT FIFTYSEVEN", "registeringParty": "DIVYA DEV PAD", "registrationClass": "RENEWAL", "registrationDescription": "RENEWAL", "registrationNumber": "256475N", "registrationType": "RE", "securedParties": "MICHAEL HENSLEY, JASMINE JAMES", "statusType": "ACT" }

doug-lovett commented 2 years ago

Fix verified locally and in DEV testing with DEV account id 2753. @chdivyareddy ready to retest. Please also verify UI registration table filter by registration date still works as the change impacts this query as well (which was working because the UI adjusts to UTC).

chdivyareddy commented 2 years ago

@doug-lovett ,

Question - Does No filtering returns only Base Registrations of the top 1000? because the last Registration from my account displays 287666L GET: https://bcregistry-dev.apigee.net/ppr/api/v1/financing-statements/registrations?collapse=true

{ "baseRegistrationNumber": "287666L", "clientReferenceId": "", "createDateTime": "2019-01-29T15:54:54+00:00", "expireDays": 690, "lastUpdateDateTime": "2019-01-29T15:54:54+00:00", "path": "/ppr/api/v1/financing-statements/287666L", "registeringName": "", "registeringParty": "(REGISTRY=RECOVERY) TM INC.", "registrationClass": "PPSALIEN", "registrationDescription": "PPSA SECURITY AGREEMENT", "registrationNumber": "287666L", "registrationType": "SA", "securedParties": "TD AUTO FINANCE (CANADA) INC. / FINANCEMENT AUTO TD (CANADA) INC.", "statusType": "ACT" }

doug-lovett commented 2 years ago

Divya, the first registration I see in DEV for 2753 is: { "baseRegistrationNumber": "256596N", "clientReferenceId": "", "createDateTime": "2022-03-10T21:43:18+00:00", "expand": false, "expireDays": 365, "lastUpdateDateTime": "2022-03-10T21:43:18+00:00", "path": "/ppr/api/v1/financing-statements/256596N", "registeringName": "BCREGTEST HUBERT FIFTYSEVEN", "registeringParty": "DIVYA DEV PAD", "registrationClass": "PPSALIEN", "registrationDescription": "PPSA SECURITY AGREEMENT", "registrationNumber": "256596N", "registrationType": "SA", "securedParties": "JASMINE JAMES, JANE TEST", "statusType": "ACT", "totalRegistrationCount": 1214, "vehicleCount": 0 },

chdivyareddy commented 2 years ago

Yeah, that's correct @doug-lovett , what is the last registration you see in DEV?

It should be 3009016, but I see 287675L

{ "baseRegistrationNumber": "287675L", "changes": [ { "baseRegistrationNumber": "287675L", "clientReferenceId": "", "createDateTime": "2020-05-20T16:07:18+00:00", "expireDays": 690, "lastUpdateDateTime": "2020-05-20T16:07:18+00:00", "path": "/ppr/api/v1/financing-statements/287675L/amendments/224776M", "registeringName": "", "registeringParty": "CLE CAPITAL INC.", "registrationClass": "AMENDMENT", "registrationDescription": "AMENDMENT/OTHER CHANGE", "registrationNumber": "224776M", "registrationType": "AM", "securedParties": "CLE CAPITAL INC.", "statusType": "ACT" } ], "clientReferenceId": "", "createDateTime": "2019-01-29T15:56:22+00:00", "expireDays": 690, "lastUpdateDateTime": "2020-05-20T16:07:18+00:00", "path": "/ppr/api/v1/financing-statements/287675L", "registeringName": "", "registeringParty": "CLE CAPITAL INC.", "registrationClass": "PPSALIEN", "registrationDescription": "PPSA SECURITY AGREEMENT", "registrationNumber": "287675L", "registrationType": "SA", "securedParties": "CLE CAPITAL INC.", "statusType": "ACT" }

doug-lovett commented 2 years ago

This query limit of 1000 is all registrations, not base registrations. 2753 has more than 1000 registrations so some have been dropped. Remove collapse=true to see the most recent 1000. We are adding the filter for users that have such a high volume.

chdivyareddy commented 2 years ago

Okay, got it...Thanks Doug:)