Skip to content

Commit

Permalink
chore: add certifier field for querying certificate property
Browse files Browse the repository at this point in the history
  • Loading branch information
Nil20 committed Sep 25, 2024
1 parent cd72467 commit 89e6466
Show file tree
Hide file tree
Showing 10 changed files with 504 additions and 1 deletion.
167 changes: 167 additions & 0 deletions packages/client/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4139,6 +4139,18 @@
"name": "Certificate",
"description": null,
"fields": [
{
"name": "certifier",
"description": null,
"args": [],
"type": {
"kind": "OBJECT",
"name": "Practitioner",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "collector",
"description": null,
Expand Down Expand Up @@ -14460,6 +14472,161 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Practitioner",
"description": null,
"fields": [
{
"name": "active",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "address",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Address",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "birthDate",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "gender",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "identifier",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Identifier",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "name",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "HumanName",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "photo",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Attachment",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "resourceType",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "telecom",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "ContactPoint",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Query",
Expand Down
16 changes: 16 additions & 0 deletions packages/client/src/utils/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ export type BookmarkedSeachItem = {

export type Certificate = {
__typename?: 'Certificate'
certifier?: Maybe<Practitioner>
collector?: Maybe<RelatedPerson>
data?: Maybe<Scalars['String']>
hasShowedVerifiedDocument?: Maybe<Scalars['Boolean']>
Expand Down Expand Up @@ -1693,6 +1694,20 @@ export type PersonInput = {
telecom?: InputMaybe<Array<InputMaybe<ContactPointInput>>>
}

export type Practitioner = {
__typename?: 'Practitioner'
active?: Maybe<Scalars['Boolean']>
address?: Maybe<Array<Maybe<Address>>>
birthDate?: Maybe<Scalars['String']>
gender?: Maybe<Scalars['String']>
id: Scalars['ID']
identifier?: Maybe<Array<Maybe<Identifier>>>
name?: Maybe<Array<Maybe<HumanName>>>
photo?: Maybe<Array<Maybe<Attachment>>>
resourceType?: Maybe<Scalars['String']>
telecom?: Maybe<Array<Maybe<ContactPoint>>>
}

export type Query = {
__typename?: 'Query'
fetchBirthRegistration?: Maybe<BirthRegistration>
Expand Down Expand Up @@ -2677,6 +2692,7 @@ export type GetUserRolesQuery = {
getUserRoles: Array<{
__typename?: 'UserRole'
id: string
scopes: Array<string>
label: {
__typename?: 'I18nMessage'
id: string
Expand Down
24 changes: 24 additions & 0 deletions packages/client/src/views/DataProvider/birth/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,18 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = gql`
use
}
}
certifier {
name {
use
firstNames
familyName
}
telecom {
system
value
use
}
}
}
duplicateOf
potentialDuplicates
Expand Down Expand Up @@ -585,6 +597,18 @@ export const GET_BIRTH_REGISTRATION_FOR_CERTIFICATE = gql`
use
}
}
certifier {
name {
use
firstNames
familyName
}
telecom {
system
value
use
}
}
}
duplicateOf
potentialDuplicates
Expand Down
26 changes: 26 additions & 0 deletions packages/client/src/views/DataProvider/death/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,18 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = gql`
use
}
}
certifier {
name {
use
firstNames
familyName
}
telecom {
system
value
use
}
}
}
duplicateOf
potentialDuplicates
Expand Down Expand Up @@ -643,6 +655,20 @@ export const GET_DEATH_REGISTRATION_FOR_CERTIFICATION = gql`
use
}
}
certifier {
identifier
name {
use
firstNames
familyName
}
address
telecom {
system
value
use
}
}
}
duplicateOf
potentialDuplicates
Expand Down
26 changes: 25 additions & 1 deletion packages/client/src/views/DataProvider/marriage/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,18 @@ const GET_MARRIAGE_REGISTRATION_FOR_REVIEW = gql`
use
}
}
certifier {
name {
use
firstNames
familyName
}
telecom {
system
value
use
}
}
}
}
}
Expand Down Expand Up @@ -593,7 +605,19 @@ const GET_MARRIAGE_REGISTRATION_FOR_CERTIFICATE = gql`
collector {
relationship
otherRelationship
name {
use
firstNames
familyName
}
telecom {
system
value
use
}
}
certifier {
identifier
name {
use
firstNames
Expand Down
1 change: 1 addition & 0 deletions packages/gateway/src/features/registration/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ input CertificateInput {

type Certificate { # -> Document Reference
collector: RelatedPerson # -> .extension
certifier: Practitioner # -> .extension
hasShowedVerifiedDocument: Boolean # -> .extension
payments: [Payment] # -> .extension
data: String # -> .content.attachment.data base64
Expand Down
39 changes: 39 additions & 0 deletions packages/gateway/src/features/registration/type-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,39 @@ export const typeResolvers: GQLResolver = {
return person?.address
}
},
// incomplete
Practitioner: {
id: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
active: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
address: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
birthDate: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
gender: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
identifier: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
name: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
photo: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
telecom: (practitioner: Saved<Practitioner>) => {
return practitioner.id
},
resourceType: (practitioner: Saved<Practitioner>) => {
return practitioner.id
}
},
Deceased: {
deceased: (person) => {
return person && person.deceasedBoolean
Expand Down Expand Up @@ -1244,6 +1277,12 @@ export const typeResolvers: GQLResolver = {
}

return false
},
async certifier(docRef: any, _, context) {
console.log('docref=>')

Check warning on line 1282 in packages/gateway/src/features/registration/type-resolvers.ts

View workflow job for this annotation

GitHub Actions / test (packages/gateway)

Unexpected console statement
console.log(JSON.stringify(docRef, null, 2))

Check warning on line 1283 in packages/gateway/src/features/registration/type-resolvers.ts

View workflow job for this annotation

GitHub Actions / test (packages/gateway)

Unexpected console statement
console.log('context')

Check warning on line 1284 in packages/gateway/src/features/registration/type-resolvers.ts

View workflow job for this annotation

GitHub Actions / test (packages/gateway)

Unexpected console statement
console.log(context)

Check warning on line 1285 in packages/gateway/src/features/registration/type-resolvers.ts

View workflow job for this annotation

GitHub Actions / test (packages/gateway)

Unexpected console statement
}
},
Identifier: {
Expand Down
Loading

0 comments on commit 89e6466

Please sign in to comment.