-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bulk-mileage): update errors (#16720)
* fix: display latest reg * feat: add error code map * feat: add errors * fix: csv parse * fix: jobs sorting * fix: remove strip * fix: translations * fix: add sanitization on number * fix: sanitization * fix: add secret from aws paramter store * fix: sanitize bit less powerfully * fix: more handling * Update libs/service-portal/assets/src/screens/VehicleBulkMileageUpload/VehicleBulkMileageUpload.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: coderabbit suggestions --------- Co-authored-by: Ásdís Erna Guðmundsdóttir <disa@hugsmidjan.is> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
Showing
18 changed files
with
382 additions
and
160 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
4 changes: 4 additions & 0 deletions
4
libs/api/domains/vehicles/src/lib/dto/getBulkVehicleMileageRequestOverview.input.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,7 +1,11 @@ | ||
import { Field, ID, InputType } from '@nestjs/graphql' | ||
import type { Locale } from '@island.is/shared/types' | ||
|
||
@InputType() | ||
export class BulkVehicleMileageRequestOverviewInput { | ||
@Field(() => String) | ||
locale!: Locale | ||
|
||
@Field(() => ID) | ||
guid!: string | ||
} |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { defineMessages } from 'react-intl' | ||
|
||
export const m = defineMessages({ | ||
tooManyPermno: { | ||
id: 'api.bulk-vehicle-mileage:too-many-permno', | ||
defaultMessage: 'Sama fastanúmer birtist oft í skjali', | ||
}, | ||
missingPermno: { | ||
id: 'api.bulk-vehicle-mileage:missing-permno', | ||
defaultMessage: 'Fastanúmer vantar', | ||
}, | ||
dateMissing: { | ||
id: 'api.bulk-vehicle-mileage:date-missing', | ||
defaultMessage: 'Dagsetning álesturs vantar', | ||
}, | ||
originMissing: { | ||
id: 'api.bulk-vehicle-mileage:missing-origin', | ||
defaultMessage: 'Uppruna álesturs vantar', | ||
}, | ||
mileageMissing: { | ||
id: 'api.bulk-vehicle-mileage:missing-mileage', | ||
defaultMessage: 'Álestur vantar', | ||
}, | ||
mileageTooLow: { | ||
id: 'api.bulk-vehicle-mileage:mileage-too-low', | ||
defaultMessage: 'Km staða getur ekki verið minna en 0', | ||
}, | ||
mileageLowerThanBefore: { | ||
id: 'api.bulk-vehicle-mileage:mileage-lower-than-before', | ||
defaultMessage: | ||
'Km staða álesturs getur ekki verið minni en síðasta gildi sem skráð hefur verið á ökutækið', | ||
}, | ||
originNotFound: { | ||
id: 'api.bulk-vehicle-mileage:origin-not-found', | ||
defaultMessage: 'Staðartegund í álestri finnst ekki', | ||
}, | ||
carNotFound: { | ||
id: 'api.bulk-vehicle-mileage:car-not-found', | ||
defaultMessage: 'Ökutæki finnst ekki', | ||
}, | ||
dateTooEarly: { | ||
id: 'api.bulk-vehicle-mileage:date-too-early', | ||
defaultMessage: 'Dagsetning færslu minni en nýjasta færsla á ökutæki', | ||
}, | ||
invalidUpdate: { | ||
id: 'api.bulk-vehicle-mileage:invalid-update', | ||
defaultMessage: 'Ekki má breyta færslu sem er ekki innan dagsins í dag', | ||
}, | ||
registerTooEarly: { | ||
id: 'api.bulk-vehicle-mileage:register-too-early', | ||
defaultMessage: | ||
'Villa við skráningu, ekki má skrá innan 30 daga frá síðustu færslu', | ||
}, | ||
forbiddenUpdate: { | ||
id: 'api.bulk-vehicle-mileage:forbidden-update', | ||
defaultMessage: 'Ekki má breyta færslu sem er ekki nýjasta færsla ökutækis', | ||
}, | ||
unauthorizedUpdater: { | ||
id: 'api.bulk-vehicle-mileage:unauthorized-updater', | ||
defaultMessage: | ||
'Tilkynnandi eða innsendur tilkynnandi er hvorki umráðamaður né eigandi ökutækis', | ||
}, | ||
invalidMileage: { | ||
id: 'api.bulk-vehicle-mileage:invalid-mileage', | ||
defaultMessage: 'Tegund álesturs ekki til', | ||
}, | ||
invalidDelete: { | ||
id: 'api.bulk-vehicle-mileage:invalid-delete', | ||
defaultMessage: 'Aðeins er leyfilegt að eyða nýjustu km skráningu', | ||
}, | ||
notFoundDelete: { | ||
id: 'api.bulk-vehicle-mileage:not-found-delete', | ||
defaultMessage: 'Færsla til að eyða finnst ekki', | ||
}, | ||
unnecessaryRegistration: { | ||
id: 'api.bulk-vehicle-mileage:unnecessary-registration', | ||
defaultMessage: 'Ökutæki krefst ekki aflesturs', | ||
}, | ||
tooHighMileage: { | ||
id: 'api.bulk-vehicle-mileage:too-high-mileage', | ||
defaultMessage: 'Km staða fer yfir hámark per dag', | ||
}, | ||
}) |
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MessageDescriptor } from 'react-intl' | ||
import { m } from '../../lib/messages' | ||
|
||
export const errorCodeMessageMap: Record<number, MessageDescriptor> = { | ||
999: m.tooManyPermno, //returned error code is -1, which cant be used to index. Transform to 999 | ||
3: m.missingPermno, | ||
4: m.dateMissing, | ||
5: m.originMissing, | ||
6: m.mileageMissing, | ||
7: m.mileageTooLow, | ||
8: m.mileageLowerThanBefore, | ||
9: m.originNotFound, | ||
10: m.carNotFound, | ||
11: m.dateTooEarly, | ||
12: m.invalidUpdate, | ||
13: m.registerTooEarly, | ||
14: m.forbiddenUpdate, | ||
15: m.unauthorizedUpdater, | ||
16: m.invalidMileage, | ||
17: m.invalidDelete, | ||
18: m.notFoundDelete, | ||
19: m.unnecessaryRegistration, | ||
20: m.tooHighMileage, | ||
} |
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
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
Oops, something went wrong.