-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [#188339189] remove DUPLICATE_LICENSE_TYPE_ERROR logic
- Loading branch information
Showing
6 changed files
with
17 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 6 additions & 11 deletions
17
api/src/client/dynamics/license-status/formatRegulatedBusinessDynamicsApplications.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
import { LicenseChecklistResponse, LicenseStatusResults } from "@api/types"; | ||
import { DUPLICATE_LICENSE_TYPE_ERROR } from "@client/dynamics/license-status/regulatedBusinessDynamicsLicenseStatusTypes"; | ||
import { LicenseName } from "@shared/license"; | ||
|
||
export const formatRegulatedBusinessDynamicsApplications = ( | ||
applications: LicenseChecklistResponse[] | ||
): LicenseStatusResults => { | ||
return applications.reduce((result: LicenseStatusResults, app) => { | ||
if (app.professionNameAndLicenseType in result) { | ||
throw new Error(DUPLICATE_LICENSE_TYPE_ERROR); | ||
} else { | ||
const key = app.professionNameAndLicenseType as LicenseName; | ||
result[key] = { | ||
licenseStatus: app.licenseStatus, | ||
expirationDateISO: app.expirationDateISO, | ||
checklistItems: app.checklistItems, | ||
}; | ||
} | ||
const key = app.professionNameAndLicenseType as LicenseName; | ||
result[key] = { | ||
licenseStatus: app.licenseStatus, | ||
expirationDateISO: app.expirationDateISO, | ||
checklistItems: app.checklistItems, | ||
}; | ||
return result; | ||
}, {}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters