Skip to content

Commit afe7cc9

Browse files
feat(occupational-licenses): Add license number to health directorate license (#15396)
Co-authored-by: Þorkell Máni Þorkelsson <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 44d6d0d commit afe7cc9

File tree

8 files changed

+17
-9
lines changed

8 files changed

+17
-9
lines changed

libs/api/domains/occupational-licenses-v2/src/lib/models/license.model.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export class License {
88
@Field()
99
licenseId!: string
1010

11-
@Field()
12-
licenseNumber!: string
13-
1411
@Field(() => LicenseType)
1512
type!: LicenseType
1613

14+
@Field({ nullable: true })
15+
licenseNumber?: string
16+
1717
@Field({ nullable: true })
1818
legalEntityId?: string
1919

libs/api/domains/occupational-licenses-v2/src/lib/models/licenseResult.model.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const LicenseResult = createUnionType({
66
name: 'OccupationalLicensesV2LicenseResult',
77
types: () => [License, LicenseError] as const,
88
resolveType(value) {
9-
if (value.licenseNumber) {
9+
if (value.licenseId) {
1010
return License
1111
}
1212

libs/api/domains/occupational-licenses-v2/src/lib/occupationalLicensesV2.service.ts

-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export class OccupationalLicensesV2Service {
6969
}
7070
return {
7171
licenseId: addLicenseTypePrefix(l.id, 'DistrictCommissioners'),
72-
licenseNumber: l.id,
7372
type: LicenseType.DISTRICT_COMMISSIONERS,
7473
issuer: l.issuerId,
7574
issuerTitle: l.issuerTitle,
@@ -110,7 +109,6 @@ export class OccupationalLicensesV2Service {
110109
),
111110
type: LicenseType.DISTRICT_COMMISSIONERS,
112111
licenseHolderName: license.holderName,
113-
licenseNumber: license.licenseInfo.id,
114112
issuer: license.licenseInfo.issuerId,
115113
profession: license.licenseInfo.title,
116114
dateOfBirth: info(user.nationalId).birthday,
@@ -283,7 +281,6 @@ export class OccupationalLicensesV2Service {
283281
const issuer: OrganizationSlugType = 'haskoli-islands'
284282
return {
285283
licenseId: addLicenseTypePrefix(data.id, 'Education'),
286-
licenseNumber: data.id,
287284
type: LicenseType.EDUCATION,
288285
issuer,
289286
issuerTitle: data.issuer,
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { OccupationalLicensesModule } from './lib/occupationalLicenses.module'
1+
export * from './lib/occupationalLicenses.module'

libs/service-portal/occupational-licenses/src/lib/messages.ts

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ export const olMessage = defineMessages({
8787
id: 'sp.occupational-licenses:name-of-individual',
8888
defaultMessage: 'Nafn einstaklings',
8989
},
90+
licenseNumber: {
91+
id: 'sp.occupational-licenses:license-number',
92+
defaultMessage: 'Skírteinisnúmer',
93+
},
9094
dateOfBirth: {
9195
id: 'sp.occupational-licenses:date-of-birth',
9296
defaultMessage: 'Fæðingardagur',

libs/service-portal/occupational-licenses/src/screens/v2/OccupationalLicensesDetail/OccupationalLicensesDetail.graphql

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ query getOccupationalLicenseById($input: OccupationalLicensesV2LicenseInput!) {
55
__typename
66
type
77
licenseId
8+
licenseNumber
89
profession
910
licenseHolderName
1011
dateOfBirth

libs/service-portal/occupational-licenses/src/screens/v2/OccupationalLicensesDetail/OccupationalLicensesDetail.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ const OccupationalLicenseDetail = () => {
134134
label={formatMessage(om.nameOfIndividual)}
135135
content={license?.licenseHolderName ?? ''}
136136
/>
137+
{license?.licenseNumber && (
138+
<UserInfoLine
139+
loading={loading}
140+
label={formatMessage(om.licenseNumber)}
141+
content={license?.licenseNumber ?? ''}
142+
/>
143+
)}
137144
{(license?.dateOfBirth || loading) && (
138145
<UserInfoLine
139146
loading={loading}

libs/service-portal/occupational-licenses/src/screens/v2/OccupationalLicensesOverview/OccupationalLicensesOverview.graphql

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ query getOccupationalLicenses {
55
... on OccupationalLicenseV2 {
66
__typename
77
licenseId
8-
licenseNumber
98
legalEntityId
109
issuer
1110
type

0 commit comments

Comments
 (0)