bcgov / entity

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

Integration with LTSA Title Direct #11682

Closed mstanton1 closed 2 years ago

mstanton1 commented 2 years ago

Build a gateway proxy for the LTSA API as a common, simplified service.

Service Endpoints: DEV: https://bcregistry-dev.apigee.net/ltsa/api/v1 TEST: https://bcregistry-test.apigee.net/ltsa/api/v1 PROD: https://bcregistry-prod.apigee.net/ltsa/api/v1

Two endpoints are available:

  1. Get title summary to only validate the PID. PID is passed as a parameter. Example: GET https://bcregistry-dev.apigee.net/ltsa/api/v1/titledirect/search/api/titleSummaries?filter=parcelIdentifier:014597365 Success response example: {"titleSummaries":[{"titleNumber":"BB1181725","landTitleDistrict":"Prince George","landTitleDistrictCode":"PG","parcelIdentifier":"014-597-365","status":"REGISTERED","firstOwner":"DE, A"}]}

  2. Place an LTSA order to get PID information - validate PID and get details. Example: POST https://bcregistry-dev.apigee.net/ltsa/api/v1/titledirect/search/api/orders { "order" : { "productType":"parcelInfo", "fileReference":"folio", "productOrderParameters" : { "parcelIdentifier": "014-597-365" } } } The order property fileReference is required. Success response example: { "orderId" : "0c430270-6893-4f96-9023-223e8afad998", "legalDescription" : "PARCEL B (K30412) LOT 3 BLOCK 5 SECTION 7 TOWNSHIP 84 RANGE 18 WEST OF THE 6TH MERIDIAN PEACE RIVER DISTRICT PLAN 8871", "lot" : "3", "parcel" : "B (K30412)", "block" : "5", "districtLot" : "", "partOf" : "", "section" : "7", "township" : "84", "range" : "18", "meridian" : "", "landDistrict" : "PEACE RIVER", "plan" : "8871" } The orderId is the LTSA request GUID. The legalDescription is the unaltered LTSA value. The other values, with the exception of partOf and meridian, are derived from parsing the legalDescription. partOf example: "THE NORTH WEST 1/4" is stored in the database as "NW 1/4". meridian example: "WEST OF THE 6TH MERIDIAN" is stored in the database as "W6M".

GET title summary not found response example: Response code: 404 Response message: {"errorMessage": "API backend third party service error.", "rootCause": "errorMessages:[Parcel 914597365 not found in any land title district. [50203]]"}

Place order not found response example: Response code: 404 Response message: {"errorMessage": "API backend third party service error.", "rootCause": "errorMessages:[Parcel 914-597-365 not found in any land title district. [50203]]"}

Background The current MHR uses a call to LTSA Title Direct to retrieve a MHR PID (Land Title Parcel ID) when a search is conducted.

Integration is required.

Note: Legacy MHR is using LTSA V3 which has been replaced by V4. V4 now uses OAS based API's with a new authentication model. I have inquired as to whether we can continue to use V3 in the old application until it is replaced in order to avoid additional work.

https://app.zenhub.com/files/157936592/85dfdea2-c322-4f1f-a1c8-04dd91f16ec6/download

*YAML and JSON files were not able to be attached but have been sent to Doug/Thor by email and can be provided to others as needed.

Analysis questions for the legacy application: 1) Under what conditions is the LTSA call made?

2) What data is included in the LTSA request and where does it come from?

3) What data is included in the LTSA response and where does it go?

4) What happens in MHR when there is an api call failure?

doug-lovett commented 2 years ago

@PatrickAHeath is there any more background on how the legacy MHR application calls the LTSA web service: what information does MHR provide, and what does it do with the response?

doug-lovett commented 2 years ago

Provided LTSA specs below (change file type to .yaml). https://app.zenhub.com/files/157936592/ef21f0d8-1960-48d7-87a8-0cc234d74cf7/download

https://app.zenhub.com/files/157936592/5713866d-5d0a-46df-8433-b466eb30f945/download

UAT connection info from email: Title Direct 4.0 Integrator ID for our UAT environment BCREG_TD4_TEST / (Will be sent on a separate email) Endpoints: Title Direct 4.0 UAT - https://tduat-x42b.ltsa.ca/titledirect/

Authentication Endpoint: https://appsuat.ltsa.ca/iam/api/auth/login/integrator

doug-lovett commented 2 years ago

Auth call to get a token successful: POST https://appsuat.ltsa.ca/iam/api/auth/login/integrator

POST data: { "integratorUsername": "BCREG_TD4_TEST", "integratorPassword": "masked", "myLtsaUserName": "BCREG_TD4_TEST", "myLtsaUserPassword": "masked" }

[no cookies]

Request Headers: Connection: keep-alive Content-Type: application/json

PatrickAHeath commented 2 years ago

Info from Melanie:

MHR makes a soap call to LTSA. There are some technical details in incident INC0154307 as the last DB2 upgrade caused the soap calls to stop working. INC0154307 | SBC Incident | ServiceNow (service-now.com) I believe that LTSA has new web services that will be used in the modernization programs so please don’t base any specs on the calls below.
Bob had contacts at LTSA that he worked with and David Roberts is likely able to provide some insight on both the process and the contacts as well. Ali also will have knowledge and I can ask him when he gets back on Monday.

This is our test call for LTSA to ensure that the web services within MHR are working. The actual calls in the MHR programs use a db2 control table (LTSACNTL) to get the various pieces – systemid, userid, pw, soap_url, soap_act and version_no

I’ve found about 18 submodules with references to ltsa so let me chase those down and see if we can come up with a module list.

BROWSE AMHRP.DB2SRCE(LTSATEST) - 01.35 Line 0000000000 Col 001 080 Command ===> Scroll ===> CSR ***** Top of Data ** SELECT substr(DB2XML.SOAPHTTPNV( 'https://td-x42b.ltsa.ca/tdefilingv30/services/TitleDirect', 'getParcelInfo', ' <soapenv:Envelope ' CONCAT ' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' CONCAT ' xmlns:tit="http://www.ltsa.ca/TitleDirect/"> ' CONCAT ' ' CONCAT ' <wsse:Security soapenv:mustUnderstand="1" ' CONCAT ' xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/' CONCAT 'oasis-200401-wss-wssecurity-secext-1.0.xsd"> ' CONCAT ' ' CONCAT ' MHLTSA </wsse:Username> ' CONCAT ' ****</wsse:Password> ' CONCAT ' </wsse:UsernameToken> ' CONCAT ' </wsse:Security> ' CONCAT ' <td:System soapenv:actor="http://schemas.xmlsoap.org/' CONCAT 'soap/actor/next" ' CONCAT ' soapenv:MustUnderstand="0" ' CONCAT ' xmlns:td="http://service.td.webservice.ltsa.ca"> ' CONCAT ' BCREGISTRY</td:SystemId> ' CONCAT ' </td:System> ' CONCAT ' </soapenv:Header> ' CONCAT ' ' CONCAT ' ' CONCAT ' 3.0 ' CONCAT ' FOLIO ' CONCAT ' 007-851-936 ' CONCAT ' </tit:ParcelInformationRequest> ' CONCAT ' </soapenv:Body> ' CONCAT '</soapenv:Envelope>'),600) FROM SYSIBM.SYSDUMMY1;

jinghualicgi commented 2 years ago

Hey team! Please add your planning poker estimate with ZenHub @cameron-freshworks @dimak1 @doug-lovett @garyfan1

jinghualicgi commented 2 years ago

Please add your planning poker estimate with ZenHub @thorwolpert

mstanton1 commented 2 years ago

@doug-lovett I've added responses in the body of this ticket about how the LTSA call is used. It is specific to Registration and Transport Permits and based upon the fact we don't need it for search I'll pulled it back into the backlog. Please review the answers and identify if anything further is needed for when this is picked up in the coming weeks.

doug-lovett commented 2 years ago

UAT get title summary to verify PID is working: GET https://tduat-x42b.ltsa.ca/titledirect/search/api/titleSummaries?filter=parcelIdentifier:014-597-365

To get location information use the Place Order endpoint:

  1. Place an order POST https://tduat-x42b.ltsa.ca/titledirect/search/api/orders { "order" : { "productType":"parcelInfo", "fileReference":"folio", "productOrderParameters" : { "parcelIdentifier": "014-597-365" } } }

Response: { "order": { "productType": "parcelInfo", "fileReference": "folio", "productOrderParameters": {"parcelIdentifier": "014-597-365"}, "orderId": "294a419b-011f-4edb-bb45-d988cd093121", "status": "Processing", "orderedProduct": { "fieldedData": { "parcelIdentifier": "014-597-365", "status": "ACTIVE", "registeredTitlesCount": 1, "pendingApplicationCount": 0, "miscellaneousNotes": "CG 4779M\nRW PL A2158\nRW PL 19689\nEXPL PL 19858\nSRW PL PGP43721\nSRW PLAN EPP32210\n", "tombstone": { "taxAuthorities": [ {"authorityName": "Peace River Assessment District"} ] }, "legalDescription": { "fullLegalDescription": "THE NORTH WEST 1/4 OF SECTION 8 TOWNSHIP 79 RANGE 15 WEST OF THE 6TH\nMERIDIAN PEACE RIVER DISTRICT", "subdividedShortLegals": [], "unsubdividedShortLegals": [ { "landDistrict1": "PEACE RIVER", "meridian2": "", "range3": "015", "townshipOrIsland4": "00000000000000000079", "group5": "", "block6": "", "districtLotOrLotOrSection7": "000008", "section8": "", "quadrant9": "NW4", "blockOrSection10": "", "subdivision11": "", "lotOrSubLotOrParcel12": "", "lotOrParcel13": "", "mineralClaimIOrIndianReserveName14": "", "mineralClaimOrIndianReserveNumber15": "", "concatShortLegal": "U/PEACE RIVER//15/79///8//NW4", "marginalNotes": "*" } ] }, "associatedPlans": [ { "planType": "PLAN", "planNumber": "PGP19858" }, { "planType": "STATUTORY RIGHT OF WAY PLAN", "planNumber": "PGP43721" }, { "planType": "STATUTORY RIGHT OF WAY PLAN", "planNumber": "EPP32210" } ] } } } }

doug-lovett commented 2 years ago

Here are some place order response legal description examples: 019-053-410 "fullLegalDescription": "LOT 1 DISTRICT LOT 16 QUEEN CHARLOTTE DISTRICT PLAN PRP14213" 002-155-168 "fullLegalDescription": "STRATA LOT 98 SECTION 14 TOWNSHIP 1 NEW WESTMINSTER DISTRICT STRATA PLAN\nNW2144 TOGETHER WITH AN INTEREST IN THE COMMON PROPERTY IN PROPORTION TO THE\nUNIT ENTITLEMENT OF THE STRATA LOT AS SHOWN ON FORM 1." 014-648-342 "fullLegalDescription": "PARCEL A (N33545) OF THE SOUTH 1/2 OF SECTION 35 TOWNSHIP 84 RANGE 20\nWEST OF THE 6TH MERIDIAN PEACE RIVER DISTRICT" 024-761-192 "fullLegalDescription": "PARCEL A (PP13274) OF SECTION 32 TOWNSHIP 77 RANGE 14 WEST OF THE 6TH \nMERIDIAN PEACE RIVER DISTRICT PLAN 24903 " 014-330-164 "fullLegalDescription": "PARCEL A (G8543) OF THE NORTH WEST 1/4 OF SECTION 2 TOWNSHIP 78 RANGE 16\nWEST OF THE 6TH MERIDIAN PEACE RIVER DISTRICT" 013-858-882 "fullLegalDescription": "PARCEL C (O3806) OF LOT 10 DISTRICT LOT 9778 CARIBOO DISTRICT PLAN 2289" 012-991-635 "fullLegalDescription" : "PARCEL B (K30412) LOT 3 BLOCK 5 SECTION 7 TOWNSHIP 84 RANGE 18 WEST OF THE 6TH MERIDIAN PEACE RIVER DISTRICT PLAN 8871" 014-3300-431 "fullLegalDescription" : "PARCEL A (69860M) OF THE NORTH WEST 1/4 OF SECTION 34 TOWNSHIP 78 RANGE 16 WEST OF THE 6TH MERIDIAN PEACE RIVER DISTRICT",