Skip to content

Commit

Permalink
chore(application-system): Stop populating club info which duplicates…
Browse files Browse the repository at this point in the history
… employer info (#16861)

* chore(application-system): Stop populating club info which duplicates employer info

* Cleanup

* Correct log method

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
norda-gunni and kodiakhq[bot] authored Nov 14, 2024
1 parent 3835de5 commit 4acfbd4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class AccidentNotificationService {
auth: Auth,
ihiDocumentID: number,
): Promise<AccidentNotificationStatus | null> {
this.logger.log('starting call to get accident', ihiDocumentID)
this.logger.debug('starting call to get accident', ihiDocumentID)

const accidentStatus = await this.accidentsReportsApiWithAuth(
auth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
MinarsidurAPIModelsAccidentReportsInjuredDTO,
MinarsidurAPIModelsAccidentReportsAccidentDTO,
MinarsidurAPIModelsAccidentReportsEmployerDTO,
MinarsidurAPIModelsAccidentReportsClubDTO,
MinarsidurAPIModelsAccidentReportsAccidentReportAttachmentDTO,
MinarsidurAPIModelsAccidentReportsReporterDTOReportingForEnum,
MinarsidurAPIModelsAccidentReportsAccidentReportAttachmentTypeEnum,
Expand All @@ -43,7 +42,6 @@ export const applicationToAccidentReport = (
injured: getInjured(answers),
accident: getAccident(answers),
employer: getEmployer(answers),
club: getClub(answers),
attachments: getAttachments(attachments),
}
}
Expand Down Expand Up @@ -399,27 +397,6 @@ const getEmployer = (
}
}

const getClub = (
answers: AccidentNotificationAnswers,
): MinarsidurAPIModelsAccidentReportsClubDTO | undefined => {
const accidentType = getValueViaPath<AccidentTypeEnum>(
answers,
'accidentType.radioButton',
)
if (accidentType !== AccidentTypeEnum.SPORTS) return

const club = getValueViaPath<CompanyInfoV2>(answers, 'companyInfo')
const accidentLocation = getValueViaPath<string>(
answers,
'accidentLocation.answer',
)
return {
nationalId: club?.nationalRegistrationId ?? '',
name: club?.name ?? '',
accidentType: accidentLocation ?? '',
}
}

const getAttachments = (
attachments: Array<AccidentNotificationAttachment>,
): Array<MinarsidurAPIModelsAccidentReportsAccidentReportAttachmentDTO> => {
Expand Down

0 comments on commit 4acfbd4

Please sign in to comment.