From 4f858fc686f642417b72b8b46fa63826e16a8995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Trevi=C3=B1o?= Date: Tue, 24 Nov 2026 22:35:13 -0600 Subject: [PATCH] Regenerate the API client for person review and corrections --- openapi.json | 166 +++++++++++++++++- src/app/api/fn/review/correct.ts | 36 ++++ src/app/api/fn/review/decide-persons.ts | 36 ++++ .../api/fn/review/{links.ts => persons.ts} | 18 +- src/app/api/functions.ts | 8 +- src/app/api/models.ts | 2 + src/app/api/models/correction.ts | 8 + src/app/api/models/person-decision.ts | 8 + 8 files changed, 264 insertions(+), 18 deletions(-) create mode 100644 src/app/api/fn/review/correct.ts create mode 100644 src/app/api/fn/review/decide-persons.ts rename src/app/api/fn/review/{links.ts => persons.ts} (66%) create mode 100644 src/app/api/models/correction.ts create mode 100644 src/app/api/models/person-decision.ts diff --git a/openapi.json b/openapi.json index 4b1c97c..8865f3f 100644 --- a/openapi.json +++ b/openapi.json @@ -44,6 +44,38 @@ "title": "Condition", "type": "object" }, + "Correction": { + "properties": { + "field": { + "enum": [ + "record_number", + "full_name", + "curp", + "nss", + "birth_date", + "sex", + "postal_code" + ], + "title": "Field", + "type": "string" + }, + "record": { + "title": "Record", + "type": "string" + }, + "value": { + "title": "Value", + "type": "string" + } + }, + "required": [ + "record", + "field", + "value" + ], + "title": "Correction", + "type": "object" + }, "Domain": { "enum": [ "cacu", @@ -363,6 +395,29 @@ "title": "Map", "type": "object" }, + "PersonDecision": { + "properties": { + "candidate": { + "title": "Candidate", + "type": "string" + }, + "person": { + "title": "Person", + "type": "string" + }, + "same": { + "title": "Same", + "type": "boolean" + } + }, + "required": [ + "person", + "candidate", + "same" + ], + "title": "PersonDecision", + "type": "object" + }, "Pipeline": { "properties": { "nodes": { @@ -1327,6 +1382,52 @@ ] } }, + "/review/corrections": { + "post": { + "description": "A corrected identity field of one record (e.g. a mistyped record number); linking\nuses it on the next run. Fixing the source too is still worth it.", + "operationId": "correct", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Correction" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "title": "Response Correct", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Correct", + "tags": [ + "review" + ] + } + }, "/review/held": { "get": { "description": "Rows a rule held, with the reasons and the values as they came.", @@ -1384,10 +1485,10 @@ ] } }, - "/review/links": { + "/review/persons": { "get": { - "description": "Records that may be the same person but were left apart.", - "operationId": "links", + "description": "Persons to settle (with their possible owners) and torn persons (with their\nrecords) left by a pipeline's link node.", + "operationId": "persons", "parameters": [ { "in": "query", @@ -1417,12 +1518,15 @@ "content": { "application/json": { "schema": { - "items": { - "additionalProperties": true, - "type": "object" + "additionalProperties": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" }, - "title": "Response Links", - "type": "array" + "title": "Response Persons", + "type": "object" } } }, @@ -1439,7 +1543,51 @@ "description": "Validation Error" } }, - "summary": "Links", + "summary": "Persons", + "tags": [ + "review" + ] + }, + "post": { + "description": "Whether a person and a possible owner are one patient; applied on the next run.", + "operationId": "decide_persons", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonDecision" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "title": "Response Decide Persons", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Decide Persons", "tags": [ "review" ] diff --git a/src/app/api/fn/review/correct.ts b/src/app/api/fn/review/correct.ts new file mode 100644 index 0000000..dc53e6d --- /dev/null +++ b/src/app/api/fn/review/correct.ts @@ -0,0 +1,36 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { filter, map } from 'rxjs/operators'; +import { StrictHttpResponse } from '../../strict-http-response'; +import { RequestBuilder } from '../../request-builder'; + +import { Correction } from '../../models/correction'; + +export interface Correct$Params { + body: Correction +} + +export function correct(http: HttpClient, rootUrl: string, params: Correct$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, correct.PATH, 'post'); + if (params) { + rb.body(params.body, 'application/json'); + } + + return http.request( + rb.build({ responseType: 'json', accept: 'application/json', context }) + ).pipe( + filter((r: any): r is HttpResponse => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse<{ + [key: string]: string; + }>; + }) + ); +} + +correct.PATH = '/review/corrections'; diff --git a/src/app/api/fn/review/decide-persons.ts b/src/app/api/fn/review/decide-persons.ts new file mode 100644 index 0000000..752b6ea --- /dev/null +++ b/src/app/api/fn/review/decide-persons.ts @@ -0,0 +1,36 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { filter, map } from 'rxjs/operators'; +import { StrictHttpResponse } from '../../strict-http-response'; +import { RequestBuilder } from '../../request-builder'; + +import { PersonDecision } from '../../models/person-decision'; + +export interface DecidePersons$Params { + body: PersonDecision +} + +export function decidePersons(http: HttpClient, rootUrl: string, params: DecidePersons$Params, context?: HttpContext): Observable> { + const rb = new RequestBuilder(rootUrl, decidePersons.PATH, 'post'); + if (params) { + rb.body(params.body, 'application/json'); + } + + return http.request( + rb.build({ responseType: 'json', accept: 'application/json', context }) + ).pipe( + filter((r: any): r is HttpResponse => r instanceof HttpResponse), + map((r: HttpResponse) => { + return r as StrictHttpResponse<{ + [key: string]: string; + }>; + }) + ); +} + +decidePersons.PATH = '/review/persons'; diff --git a/src/app/api/fn/review/links.ts b/src/app/api/fn/review/persons.ts similarity index 66% rename from src/app/api/fn/review/links.ts rename to src/app/api/fn/review/persons.ts index c7038e7..db265fc 100644 --- a/src/app/api/fn/review/links.ts +++ b/src/app/api/fn/review/persons.ts @@ -8,15 +8,17 @@ import { StrictHttpResponse } from '../../strict-http-response'; import { RequestBuilder } from '../../request-builder'; -export interface Links$Params { +export interface Persons$Params { pipeline: string; node: string; } -export function links(http: HttpClient, rootUrl: string, params: Links$Params, context?: HttpContext): Observable>> { - const rb = new RequestBuilder(rootUrl, links.PATH, 'get'); +}>; +}>> { + const rb = new RequestBuilder(rootUrl, persons.PATH, 'get'); if (params) { rb.query('pipeline', params.pipeline, {}); rb.query('node', params.node, {}); @@ -27,11 +29,13 @@ export function links(http: HttpClient, rootUrl: string, params: Links$Params, c ).pipe( filter((r: any): r is HttpResponse => r instanceof HttpResponse), map((r: HttpResponse) => { - return r as StrictHttpResponse>; + }>; + }>; }) ); } -links.PATH = '/review/links'; +persons.PATH = '/review/persons'; diff --git a/src/app/api/functions.ts b/src/app/api/functions.ts index 09e8eca..aefed93 100644 --- a/src/app/api/functions.ts +++ b/src/app/api/functions.ts @@ -25,10 +25,14 @@ export type { Upload$Params as Upload$Params } from './fn/ingest/upload'; export { upload as upload } from './fn/ingest/upload'; export type { Conflicts$Params as Conflicts$Params } from './fn/review/conflicts'; export { conflicts as conflicts } from './fn/review/conflicts'; +export type { Correct$Params as Correct$Params } from './fn/review/correct'; +export { correct as correct } from './fn/review/correct'; export type { Held$Params as Held$Params } from './fn/review/held'; export { held as held } from './fn/review/held'; -export type { Links$Params as Links$Params } from './fn/review/links'; -export { links as links } from './fn/review/links'; +export type { Persons$Params as Persons$Params } from './fn/review/persons'; +export { persons as persons } from './fn/review/persons'; +export type { DecidePersons$Params as DecidePersons$Params } from './fn/review/decide-persons'; +export { decidePersons as decidePersons } from './fn/review/decide-persons'; export type { Reject$Params as Reject$Params } from './fn/review/reject'; export { reject as reject } from './fn/review/reject'; export type { RunStatus$Params as RunStatus$Params } from './fn/runs/run-status'; diff --git a/src/app/api/models.ts b/src/app/api/models.ts index 724418c..bd0e9a3 100644 --- a/src/app/api/models.ts +++ b/src/app/api/models.ts @@ -3,12 +3,14 @@ export type { BodyUpload } from './models/body-upload'; export type { Condition } from './models/condition'; +export type { Correction } from './models/correction'; export type { Domain } from './models/domain'; export type { Extract } from './models/extract'; export type { HttpValidationError } from './models/http-validation-error'; export type { Join } from './models/join'; export type { Link } from './models/link'; export type { Map } from './models/map'; +export type { PersonDecision } from './models/person-decision'; export type { Pipeline } from './models/pipeline'; export type { Read } from './models/read'; export type { Rejection } from './models/rejection'; diff --git a/src/app/api/models/correction.ts b/src/app/api/models/correction.ts new file mode 100644 index 0000000..c5aa7a5 --- /dev/null +++ b/src/app/api/models/correction.ts @@ -0,0 +1,8 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +export interface Correction { + field: 'record_number' | 'full_name' | 'curp' | 'nss' | 'birth_date' | 'sex' | 'postal_code'; + record: string; + value: string; +} diff --git a/src/app/api/models/person-decision.ts b/src/app/api/models/person-decision.ts new file mode 100644 index 0000000..5b0316c --- /dev/null +++ b/src/app/api/models/person-decision.ts @@ -0,0 +1,8 @@ +/* eslint-disable */ +/* Code generated by ng-openapi-gen DO NOT EDIT. */ + +export interface PersonDecision { + candidate: string; + person: string; + same: boolean; +}