Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace existing method of obtaining standing data with SDRS API call #292

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

Harriet-Hall
Copy link
Collaborator

@Harriet-Hall Harriet-Hall commented Jul 30, 2024

This PR replaces the old method of creating, updating and maintaining our standing data. Previously we used Puppeteer to interact with a browser to download the data.

This PR allows us to retire the old method and call the SDRS API maintained by CGI, calling the getOffence endpoint to get an up to date json object of offence codes standing-data-api-offences.json. This file is the equivalent of pnld-offences.json which is produced using the old method.

We have decided to omit a few keys as they seemed unnecessary/unused

`pnld-offences.json`

{
    "cjsCode": "AA06006", 
    "description": "AA06006",
    "homeOfficeClassification": "099/96",
    "notifiableToHo": true,
    "offenceCategory": "CE",
    "offenceTitle": "Furnish false / misleading information - Animals and Animal Products (Import and Export) Regulations 2006",
    "recordableOnPnc": true
  }

`standing-data-api-offences.json`
{
    "cjsCode": "AA06001",
    "notifiableToHo": false,
    "offenceCategory": "CE",
    "offenceTitle": "Fail to wear protective clothing/footwear and meets other criteria when entering quarantine centre/facility",
    "recordableOnPnc": false
  }

It appears that we were using the `cjsCode` as the `description` 
so we obmitted that value and also `homeOfficeClassification` is 
something that is not used in the core logic of Bichard.

This PR also removes reference to the method of creating the other file cjs-offences.json that was processed at the same time when we produces the old input file pnld-offences.json. We get all the data from the new API call so have removed as redundant.

@joe-fol joe-fol marked this pull request as ready for review August 15, 2024 11:08
@joe-fol joe-fol marked this pull request as draft August 15, 2024 14:53
@joe-fol joe-fol changed the title add missing attributes to zod parsing Replace existing method of obtaining standing data and replace with A Aug 20, 2024
@joe-fol joe-fol changed the title Replace existing method of obtaining standing data and replace with A Replace existing method of obtaining standing data and replace with SDRS API call Aug 20, 2024
@joe-fol joe-fol force-pushed the standing-data-api branch 3 times, most recently from 4c77ed6 to 3038d8c Compare August 21, 2024 08:39
@joe-fol joe-fol marked this pull request as ready for review September 5, 2024 14:43
@joe-fol joe-fol force-pushed the standing-data-api branch 3 times, most recently from 6d2651d to 5979a13 Compare September 9, 2024 11:40
@joe-fol joe-fol changed the title Replace existing method of obtaining standing data and replace with SDRS API call Replace existing method of obtaining standing data with SDRS API call Sep 9, 2024
@joe-fol joe-fol marked this pull request as draft September 10, 2024 12:06
@joe-fol joe-fol force-pushed the standing-data-api branch 7 times, most recently from 7dbe144 to 7009abf Compare October 1, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants