Skip to content

Commit

Permalink
Remove NID field from the user details form
Browse files Browse the repository at this point in the history
Remove the question that asks the user for a national ID number in this form as it is not required

#6830
  • Loading branch information
Siyasanga committed Oct 3, 2024
1 parent 025b867 commit 38704ec
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 10,675 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const MOCK_USER: IUserModelData = {
}
],
username: 'd.bulaya',
identifiers: [],
email: '',
device: 'Samsung Galaxy S9',
emailForNotification: '[email protected]',
Expand Down
2 changes: 0 additions & 2 deletions packages/gateway/src/features/user/root-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
GQLHumanNameInput,
GQLResolver,
GQLSearchFieldAgentResponse,
GQLUserIdentifierInput,
GQLUserInput
} from '@gateway/graphql/schema'
import { logger, isBase64FileString } from '@opencrvs/commons'
Expand Down Expand Up @@ -640,7 +639,6 @@ function createOrUpdateUserPayload(user: GQLUserInput): IUserPayload {
role: user.role as string,
...(user.password && { password: user.password }),
...(user.status && { status: user.status }),
identifiers: (user.identifier as GQLUserIdentifierInput[]) || [],
primaryOfficeId: user.primaryOffice as string,
email: '',
...(user.email && { emailForNotification: user.email }), //instead of saving data in email, we want to store it in emailForNotification property
Expand Down
8 changes: 0 additions & 8 deletions packages/gateway/src/features/user/type-resolvers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ describe('User type resolvers', () => {
username: 'tamim.iqlbal',
mobile: '+8801711111111',
email: '[email protected]',
identifiers: [{ system: 'NATIONAL_ID', value: '1010101010' }],
systemRole: 'REGISTRATION_AGENT',
scope: ['certify'],
status: 'active',
Expand Down Expand Up @@ -90,13 +89,6 @@ describe('User type resolvers', () => {
const res = userTypeResolvers.User!.underInvestigation(mockResponse)
expect(res).toBeTruthy()
})
it('return user identifier', () => {
const res = userTypeResolvers.User!.identifier(mockResponse)
expect(res).toEqual({
system: mockResponse.identifiers[0].system,
value: mockResponse.identifiers[0].value
})
})
it('return primaryOffice type', async () => {
const mockOffice = {
resourceType: 'Location',
Expand Down
12 changes: 1 addition & 11 deletions packages/gateway/src/features/user/type-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@

import { IAuthHeader, UUID } from '@opencrvs/commons'

import {
GQLIdentifier,
GQLResolver,
GQLSignatureInput,
GQLUserIdentifierInput
} from '@gateway/graphql/schema'
import { GQLResolver, GQLSignatureInput } from '@gateway/graphql/schema'
import {
Bundle,
Extension,
Expand Down Expand Up @@ -67,7 +62,6 @@ export interface IUserModelData {
creationDate?: string
practitionerId: string
primaryOfficeId: string
identifiers: GQLIdentifier[]
device: string
auditHistory?: IAuditHistory[]
avatar?: IAvatar
Expand Down Expand Up @@ -100,7 +94,6 @@ export interface IUserPayload
'_id' | 'status' | 'practitionerId' | 'username' | 'identifiers' | 'role'
> {
id?: string
identifiers: GQLUserIdentifierInput[]
systemRole: string
status?: string
username?: string
Expand Down Expand Up @@ -178,9 +171,6 @@ export const userTypeResolvers: GQLResolver = {
'SUSPICIOUS'
)
},
identifier(userModel: IUserModelData) {
return userModel.identifiers && userModel.identifiers[0]
},
email(userModel: IUserModelData) {
return userModel.emailForNotification
},
Expand Down
Loading

0 comments on commit 38704ec

Please sign in to comment.