From c2db318bdc74aecc3d0b3a72d0c87631a3b030aa Mon Sep 17 00:00:00 2001 From: naftis Date: Mon, 30 Sep 2024 17:09:18 +0300 Subject: [PATCH] refactor: use defined rejection types --- packages/client/graphql.schema.json | 404 ++++++++++++++++-- .../client/src/i18n/messages/views/reject.ts | 12 - packages/client/src/tests/languages.json | 4 - packages/client/src/utils/gateway.ts | 79 +++- .../src/views/DataProvider/birth/mutations.ts | 2 +- .../src/views/DataProvider/death/mutations.ts | 2 +- .../views/DataProvider/marriage/mutations.ts | 2 +- .../src/views/SearchResult/SearchResult.tsx | 20 +- .../src/features/registration/schema.graphql | 8 +- packages/gateway/src/graphql/schema.d.ts | 14 +- packages/gateway/src/graphql/schema.graphql | 18 +- 11 files changed, 473 insertions(+), 92 deletions(-) diff --git a/packages/client/graphql.schema.json b/packages/client/graphql.schema.json index ab9656a55c9..b99a07a69aa 100644 --- a/packages/client/graphql.schema.json +++ b/packages/client/graphql.schema.json @@ -3978,6 +3978,61 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "ConfirmRegistrationInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "childIdentifiers", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "IdentifierInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "registrationNumber", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trackingId", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ContactPoint", @@ -5299,33 +5354,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "OBJECT", - "name": "Dummy", - "description": null, - "fields": [ - { - "name": "dummy", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, { "kind": "OBJECT", "name": "DuplicatesInfo", @@ -6715,8 +6743,8 @@ "description": null, "args": [], "type": { - "kind": "SCALAR", - "name": "String", + "kind": "ENUM", + "name": "RejectionReason", "ofType": null }, "isDeprecated": false, @@ -6999,6 +7027,49 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "IdentifierInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "type", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SupportedPatientIdentifierCode", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "IdentityInput", @@ -9299,6 +9370,55 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "confirmRegistration", + "description": null, + "args": [ + { + "name": "details", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ConfirmRegistrationInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "createBirthRegistration", "description": null, @@ -10374,8 +10494,8 @@ "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", + "kind": "ENUM", + "name": "RejectionReason", "ofType": null } }, @@ -10667,6 +10787,55 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "rejectRegistration", + "description": null, + "args": [ + { + "name": "details", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RejectRegistrationInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "rejectRegistrationCorrection", "description": null, @@ -16422,6 +16591,72 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "RejectRegistrationInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "comment", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reason", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "RejectionReason", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "RejectionReason", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "duplicate", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "other", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "OBJECT", "name": "RelatedPerson", @@ -17803,6 +18038,113 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "ENUM", + "name": "SupportedPatientIdentifierCode", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ALIEN_NUMBER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BIRTH_CONFIGURABLE_IDENTIFIER_1", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BIRTH_CONFIGURABLE_IDENTIFIER_2", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BIRTH_CONFIGURABLE_IDENTIFIER_3", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BIRTH_PATIENT_ENTRY", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BIRTH_REGISTRATION_NUMBER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DEATH_REGISTRATION_NUMBER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DECEASED_PATIENT_ENTRY", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DRIVING_LICENSE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MARRIAGE_REGISTRATION_NUMBER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MOSIP_PSUT_TOKEN_ID", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NATIONAL_ID", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OTHER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PASSPORT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REFUGEE_NUMBER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SOCIAL_SECURITY_NO", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "OBJECT", "name": "System", diff --git a/packages/client/src/i18n/messages/views/reject.ts b/packages/client/src/i18n/messages/views/reject.ts index 940b1b4e2af..e609214bde9 100644 --- a/packages/client/src/i18n/messages/views/reject.ts +++ b/packages/client/src/i18n/messages/views/reject.ts @@ -17,8 +17,6 @@ interface IRejectMessages rejectionForm: MessageDescriptor rejectionReason: MessageDescriptor rejectionReasonDuplicate: MessageDescriptor - rejectionReasonMisspelling: MessageDescriptor - rejectionReasonMissingSupportingDoc: MessageDescriptor rejectionReasonOther: MessageDescriptor rejectionCommentForHealthWorkerLabel: MessageDescriptor rejectionFormInstruction: MessageDescriptor @@ -63,16 +61,6 @@ const messagesToDefine: IRejectMessages = { defaultMessage: 'Mark as a duplicate', description: 'Label for rejection option duplicate' }, - rejectionReasonMisspelling: { - id: 'review.rejection.form.reasons.misspelling', - defaultMessage: 'Misspelling', - description: 'Label for rejection option misspelling' - }, - rejectionReasonMissingSupportingDoc: { - id: 'review.rej.form.reasons.missSupDoc', - defaultMessage: 'Missing supporting documents', - description: 'Label for rejection option missing supporting doc' - }, rejectionReasonOther: { id: 'review.rejection.form.reasons.other', defaultMessage: 'Other', diff --git a/packages/client/src/tests/languages.json b/packages/client/src/tests/languages.json index e3329737a31..5aeb76b2a41 100644 --- a/packages/client/src/tests/languages.json +++ b/packages/client/src/tests/languages.json @@ -1020,8 +1020,6 @@ "review.rejection.form.commentLabel": "Comments or instructions for health worker to rectify declaration", "review.rejection.form.reasons": "Reason(s) for rejection:", "review.rejection.form.reasons.duplicate": "Duplicate declaration", - "review.rej.form.reasons.missSupDoc": "Missing supporting documents", - "review.rejection.form.reasons.misspelling": "Misspelling", "review.rejection.form.reasons.other": "Other", "review.rejection.form.submitButton": "Submit rejection", "review.rejection.form.title": "What update does the declaration require?", @@ -2169,8 +2167,6 @@ "review.rejection.form.commentLabel": "আবেদন সংশোধন করতে স্বাস্থ্য কর্মীর জন্য নির্দেশাবলী", "review.rejection.form.reasons": "প্রত্যাখ্যানের কারণসমূহ:", "review.rejection.form.reasons.duplicate": "নকল আবেদন", - "review.rej.form.reasons.missSupDoc": "প্রমাণক অনুপস্থিত", - "review.rejection.form.reasons.misspelling": "ভুল বানান", "review.rejection.form.reasons.other": "অন্যান্য", "review.rejection.form.submitButton": "প্রত্যাখ্যান জমা দিন", "review.rejection.form.title": "আবেদনটির কী হালনাগাদ দরকার?", diff --git a/packages/client/src/utils/gateway.ts b/packages/client/src/utils/gateway.ts index a80ee81bdc3..7da92c34a1a 100644 --- a/packages/client/src/utils/gateway.ts +++ b/packages/client/src/utils/gateway.ts @@ -428,6 +428,12 @@ export type ComparisonInput = { nin?: InputMaybe> } +export type ConfirmRegistrationInput = { + childIdentifiers?: InputMaybe> + registrationNumber?: InputMaybe + trackingId?: InputMaybe +} + export type ContactPoint = { __typename?: 'ContactPoint' system?: Maybe @@ -558,11 +564,6 @@ export type DeclarationsStartedMetrics = { officeDeclarations: Scalars['Int'] } -export type Dummy = { - __typename?: 'Dummy' - dummy: Scalars['String'] -} - export type DuplicatesInfo = { __typename?: 'DuplicatesInfo' compositionId?: Maybe @@ -706,7 +707,7 @@ export type History = { output?: Maybe>> payment?: Maybe potentialDuplicates?: Maybe> - reason?: Maybe + reason?: Maybe regStatus?: Maybe requester?: Maybe requesterOther?: Maybe @@ -739,6 +740,11 @@ export type Identifier = { value?: Maybe } +export type IdentifierInput = { + type: SupportedPatientIdentifierCode + value: Scalars['String'] +} + export type IdentityInput = { fieldsModifiedByIdentity?: InputMaybe>> id?: InputMaybe @@ -927,6 +933,7 @@ export type Mutation = { changeEmail?: Maybe changePassword?: Maybe changePhone?: Maybe + confirmRegistration: Scalars['ID'] createBirthRegistration: Scalars['Void'] createBirthRegistrationCorrection: Scalars['ID'] createDeathRegistration: Scalars['Void'] @@ -959,6 +966,7 @@ export type Mutation = { reactivateSystem?: Maybe refreshSystemSecret?: Maybe registerSystem?: Maybe + rejectRegistration: Scalars['ID'] rejectRegistrationCorrection: Scalars['ID'] removeBookmarkedAdvancedSearch?: Maybe requestRegistrationCorrection: Scalars['ID'] @@ -1027,6 +1035,11 @@ export type MutationChangePhoneArgs = { verifyCode: Scalars['String'] } +export type MutationConfirmRegistrationArgs = { + details: ConfirmRegistrationInput + id: Scalars['ID'] +} + export type MutationCreateBirthRegistrationArgs = { details: BirthRegistrationInput } @@ -1145,7 +1158,7 @@ export type MutationMarkEventAsUnassignedArgs = { export type MutationMarkEventAsVoidedArgs = { comment: Scalars['String'] id: Scalars['String'] - reason: Scalars['String'] + reason: RejectionReason } export type MutationMarkMarriageAsCertifiedArgs = { @@ -1180,6 +1193,11 @@ export type MutationRegisterSystemArgs = { system?: InputMaybe } +export type MutationRejectRegistrationArgs = { + details: RejectRegistrationInput + id: Scalars['ID'] +} + export type MutationRejectRegistrationCorrectionArgs = { details: CorrectionRejectionInput id: Scalars['ID'] @@ -1832,6 +1850,16 @@ export type Reinstated = { taskEntryResourceID: Scalars['ID'] } +export type RejectRegistrationInput = { + comment: Scalars['String'] + reason: RejectionReason +} + +export enum RejectionReason { + Duplicate = 'duplicate', + Other = 'other' +} + export type RelatedPerson = { __typename?: 'RelatedPerson' _fhirID?: Maybe @@ -1982,6 +2010,25 @@ export type StatusWiseRegistrationCount = { status: Scalars['String'] } +export enum SupportedPatientIdentifierCode { + AlienNumber = 'ALIEN_NUMBER', + BirthConfigurableIdentifier_1 = 'BIRTH_CONFIGURABLE_IDENTIFIER_1', + BirthConfigurableIdentifier_2 = 'BIRTH_CONFIGURABLE_IDENTIFIER_2', + BirthConfigurableIdentifier_3 = 'BIRTH_CONFIGURABLE_IDENTIFIER_3', + BirthPatientEntry = 'BIRTH_PATIENT_ENTRY', + BirthRegistrationNumber = 'BIRTH_REGISTRATION_NUMBER', + DeathRegistrationNumber = 'DEATH_REGISTRATION_NUMBER', + DeceasedPatientEntry = 'DECEASED_PATIENT_ENTRY', + DrivingLicense = 'DRIVING_LICENSE', + MarriageRegistrationNumber = 'MARRIAGE_REGISTRATION_NUMBER', + MosipPsutTokenId = 'MOSIP_PSUT_TOKEN_ID', + NationalId = 'NATIONAL_ID', + Other = 'OTHER', + Passport = 'PASSPORT', + RefugeeNumber = 'REFUGEE_NUMBER', + SocialSecurityNo = 'SOCIAL_SECURITY_NO' +} + export type System = { __typename?: 'System' _id: Scalars['ID'] @@ -3077,7 +3124,7 @@ export type MarkBirthAsRegisteredMutation = { export type MarkEventAsVoidedMutationVariables = Exact<{ id: Scalars['String'] - reason: Scalars['String'] + reason: RejectionReason comment: Scalars['String'] }> @@ -3373,7 +3420,7 @@ export type FetchBirthRegistrationForReviewQuery = { regStatus?: RegStatus | null dhis2Notification?: boolean | null ipAddress?: string | null - reason?: string | null + reason?: RejectionReason | null duplicateOf?: string | null potentialDuplicates?: Array | null documents: Array<{ @@ -3707,7 +3754,7 @@ export type FetchBirthRegistrationForCertificateQuery = { regStatus?: RegStatus | null dhis2Notification?: boolean | null ipAddress?: string | null - reason?: string | null + reason?: RejectionReason | null otherReason?: string | null duplicateOf?: string | null potentialDuplicates?: Array | null @@ -4169,7 +4216,7 @@ export type FetchDeathRegistrationForReviewQuery = { regStatus?: RegStatus | null dhis2Notification?: boolean | null ipAddress?: string | null - reason?: string | null + reason?: RejectionReason | null duplicateOf?: string | null potentialDuplicates?: Array | null documents: Array<{ @@ -4888,7 +4935,7 @@ export type FetchMarriageRegistrationForReviewQuery = { action?: RegAction | null regStatus?: RegStatus | null dhis2Notification?: boolean | null - reason?: string | null + reason?: RejectionReason | null documents: Array<{ __typename?: 'Attachment' id: string @@ -5242,7 +5289,7 @@ export type FetchMarriageRegistrationForCertificateQuery = { action?: RegAction | null regStatus?: RegStatus | null dhis2Notification?: boolean | null - reason?: string | null + reason?: RejectionReason | null statusReason?: { __typename?: 'StatusReason' text?: string | null @@ -8001,7 +8048,7 @@ export type FetchViewRecordByCompositionQuery = { regStatus?: RegStatus | null dhis2Notification?: boolean | null ipAddress?: string | null - reason?: string | null + reason?: RejectionReason | null statusReason?: { __typename?: 'StatusReason' text?: string | null @@ -8387,7 +8434,7 @@ export type FetchViewRecordByCompositionQuery = { regStatus?: RegStatus | null dhis2Notification?: boolean | null ipAddress?: string | null - reason?: string | null + reason?: RejectionReason | null statusReason?: { __typename?: 'StatusReason' text?: string | null @@ -8705,7 +8752,7 @@ export type FetchViewRecordByCompositionQuery = { regStatus?: RegStatus | null dhis2Notification?: boolean | null ipAddress?: string | null - reason?: string | null + reason?: RejectionReason | null statusReason?: { __typename?: 'StatusReason' text?: string | null diff --git a/packages/client/src/views/DataProvider/birth/mutations.ts b/packages/client/src/views/DataProvider/birth/mutations.ts index a40694cb06a..a964720654b 100644 --- a/packages/client/src/views/DataProvider/birth/mutations.ts +++ b/packages/client/src/views/DataProvider/birth/mutations.ts @@ -35,7 +35,7 @@ const REGISTER_BIRTH_DECLARATION = gql` const REJECT_BIRTH_DECLARATION = gql` mutation markEventAsVoided( $id: String! - $reason: String! + $reason: RejectionReason! $comment: String! ) { markEventAsVoided(id: $id, reason: $reason, comment: $comment) diff --git a/packages/client/src/views/DataProvider/death/mutations.ts b/packages/client/src/views/DataProvider/death/mutations.ts index 53c5b926d50..8e3771d4cb4 100644 --- a/packages/client/src/views/DataProvider/death/mutations.ts +++ b/packages/client/src/views/DataProvider/death/mutations.ts @@ -35,7 +35,7 @@ const REGISTER_DEATH_DECLARATION = gql` const REJECT_DEATH_DECLARATION = gql` mutation markEventAsVoided( $id: String! - $reason: String! + $reason: RejectionReason! $comment: String! ) { markEventAsVoided(id: $id, reason: $reason, comment: $comment) diff --git a/packages/client/src/views/DataProvider/marriage/mutations.ts b/packages/client/src/views/DataProvider/marriage/mutations.ts index 46d7c0988fe..4bc43262e63 100644 --- a/packages/client/src/views/DataProvider/marriage/mutations.ts +++ b/packages/client/src/views/DataProvider/marriage/mutations.ts @@ -36,7 +36,7 @@ const REGISTER_MARRIAGE_DECLARATION = gql` const REJECT_MARRIAGE_DECLARATION = gql` mutation markEventAsVoided( $id: String! - $reason: String! + $reason: RejectionReason! $comment: String! ) { markEventAsVoided(id: $id, reason: $reason, comment: $comment) diff --git a/packages/client/src/views/SearchResult/SearchResult.tsx b/packages/client/src/views/SearchResult/SearchResult.tsx index a218871802f..546df709978 100644 --- a/packages/client/src/views/SearchResult/SearchResult.tsx +++ b/packages/client/src/views/SearchResult/SearchResult.tsx @@ -47,7 +47,11 @@ import { ITheme } from '@opencrvs/components/lib/theme' import { Scope } from '@client/utils/authUtils' import { SEARCH_RESULT_SORT } from '@client/utils/constants' import { getUserLocation, UserDetails } from '@client/utils/userUtils' -import { SearchEventsQuery, SystemRoleType } from '@client/utils/gateway' +import { + SearchEventsQuery, + SystemRoleType, + RejectionReason +} from '@client/utils/gateway' import { ColumnContentAlignment, @@ -86,18 +90,14 @@ const ToolTipContainer = styled.span` text-align: center; ` -export function getRejectionReasonDisplayValue(reason: string) { - switch (reason.toLowerCase()) { - case 'duplicate': +export function getRejectionReasonDisplayValue(reason: RejectionReason) { + switch (reason) { + case RejectionReason.Duplicate: return rejectMessages.rejectionReasonDuplicate - case 'misspelling': - return rejectMessages.rejectionReasonMisspelling - case 'missing_supporting_doc': - return rejectMessages.rejectionReasonMissingSupportingDoc - case 'other': + case RejectionReason.Other: return rejectMessages.rejectionReasonOther default: - return rejectMessages.rejectionReasonOther + return reason satisfies never } } diff --git a/packages/gateway/src/features/registration/schema.graphql b/packages/gateway/src/features/registration/schema.graphql index afdd6585dbf..d7022f2d0d9 100644 --- a/packages/gateway/src/features/registration/schema.graphql +++ b/packages/gateway/src/features/registration/schema.graphql @@ -155,7 +155,7 @@ type History { action: RegAction note: String statusReason: StatusReason - reason: String + reason: RejectionReason requester: String requesterOther: String hasShowedVerifiedDocument: Boolean @@ -645,7 +645,11 @@ type Mutation { markBirthAsRegistered(id: ID!, details: BirthRegistrationInput!): ID! # updates status to 'registered' - registration clerk has accepted the declaration, it is now official - internally call update if details exists markBirthAsCertified(id: ID!, details: BirthRegistrationInput!): ID! # updates status to 'certified' - a printed certificate has been produced - internally call update if details exists markBirthAsIssued(id: ID!, details: BirthRegistrationInput!): ID! # updates status to 'certified' - a printed certificate has been produced - internally call update if details exists - markEventAsVoided(id: String!, reason: String!, comment: String!): ID! # updated status to 'voided' - the registration was captured in error + markEventAsVoided( + id: String! + reason: RejectionReason! + comment: String! + ): ID! # updated status to 'voided' - the registration was captured in error markEventAsReinstated(id: String!): Reinstated # updates status to 'reinstated' markEventAsNotDuplicate(id: String!): ID! # removes duplicates from composition markEventAsArchived( diff --git a/packages/gateway/src/graphql/schema.d.ts b/packages/gateway/src/graphql/schema.d.ts index c2be74a8d6f..7f59302c295 100644 --- a/packages/gateway/src/graphql/schema.d.ts +++ b/packages/gateway/src/graphql/schema.d.ts @@ -606,6 +606,11 @@ export interface GQLMarriageRegistrationInput { export type GQLVoid = any +export const enum GQLRejectionReason { + other = 'other', + duplicate = 'duplicate' +} + export interface GQLReinstated { taskEntryResourceID: string registrationStatus?: GQLRegStatus @@ -769,7 +774,7 @@ export interface GQLHistory { action?: GQLRegAction note?: string statusReason?: GQLStatusReason - reason?: string + reason?: GQLRejectionReason requester?: string requesterOther?: string hasShowedVerifiedDocument?: boolean @@ -1235,11 +1240,6 @@ export interface GQLIdentifierInput { value: string } -export const enum GQLRejectionReason { - other = 'other', - duplicate = 'duplicate' -} - export interface GQLHumanNameInput { use?: string firstNames?: string @@ -2836,7 +2836,7 @@ export interface MutationToMarkBirthAsIssuedResolver< export interface MutationToMarkEventAsVoidedArgs { id: string - reason: string + reason: GQLRejectionReason comment: string } export interface MutationToMarkEventAsVoidedResolver< diff --git a/packages/gateway/src/graphql/schema.graphql b/packages/gateway/src/graphql/schema.graphql index 831a6b71ff8..5bb8d6f8836 100644 --- a/packages/gateway/src/graphql/schema.graphql +++ b/packages/gateway/src/graphql/schema.graphql @@ -192,7 +192,11 @@ type Mutation { markBirthAsRegistered(id: ID!, details: BirthRegistrationInput!): ID! markBirthAsCertified(id: ID!, details: BirthRegistrationInput!): ID! markBirthAsIssued(id: ID!, details: BirthRegistrationInput!): ID! - markEventAsVoided(id: String!, reason: String!, comment: String!): ID! + markEventAsVoided( + id: String! + reason: RejectionReason! + comment: String! + ): ID! markEventAsReinstated(id: String!): Reinstated markEventAsNotDuplicate(id: String!): ID! markEventAsArchived( @@ -721,6 +725,11 @@ input MarriageRegistrationInput { scalar Void +enum RejectionReason { + other + duplicate +} + type Reinstated { taskEntryResourceID: ID! registrationStatus: RegStatus @@ -884,7 +893,7 @@ type History { action: RegAction note: String statusReason: StatusReason - reason: String + reason: RejectionReason requester: String requesterOther: String hasShowedVerifiedDocument: Boolean @@ -1326,11 +1335,6 @@ input IdentifierInput { value: String! } -enum RejectionReason { - other - duplicate -} - input HumanNameInput { use: String firstNames: String