Skip to content

Commit

Permalink
Merge branch 'main' into native-app-ci-cd-typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
busla authored May 17, 2024
2 parents 8c6ba68 + c83a658 commit 7c4c288
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ const RealEstateNumberField = ({
label={formatMessage(m.propertyNumber)}
defaultValue={propertyNumberInput}
error={error ? formatMessage(m.errorPropertyNumber) : undefined}
placeholder={propertyNumberInput > 0 ? '' : props.field.placeholder}
{...props}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ const validateDeceasedShare = ({
}

const validateAssetNumber = (assetNumber: string) => {
const assetNumberPattern = /^(F\d{3}-\d{4}|\d{7}|\d{3}-\d{4}|F\d{7})$/
const assetNumberPattern = /^[Ff]{0,1}\d{7}$|^[Ll]{0,1}\d{6}$/
return assetNumberPattern.test(assetNumber)
}

const validateDebtBankAccount = (assetNumber: string) => {
const assetNumberPattern = /^\d{4}-\d{2}-\d{6}|\d{12}$/
return assetNumberPattern.test(assetNumber)
}

Expand Down Expand Up @@ -313,7 +318,7 @@ export const inheritanceReportSchema = z.object({
.object({
description: z.string(),
nationalId: z.string(),
assetNumber: z.string(),
assetNumber: z.string().refine((v) => validateDebtBankAccount(v)),
propertyValuation: z.string(),
})
.refine(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,8 @@ export const m = defineMessages({
// Error messages
errorPropertyNumber: {
id: 'es.application:error.errorPropertyNumber',
defaultMessage: 'Verður að innihalda L og 6 tölustafi eða F og 7 tölustafi',
defaultMessage:
'Verður að innihalda 6 tölustafi eða L + 6 fyrir landeignanúmeri, 7 tölustafi, F + 7 fyrir fasteignanúmeri',
description: 'Property number is invalid',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const valueToNumber = (value: unknown, delimiter = '.'): number => {
}

export const isValidRealEstate = (value: string) => {
const assetNumberPattern = /^(F\d{3}-\d{4}|\d{7}|\d{3}-\d{4}|F\d{7})$/
const assetNumberPattern = /^[Ff]{0,1}\d{7}$|^[Ll]{0,1}\d{6}$/
return assetNumberPattern.test(value)
}

Expand Down
2 changes: 1 addition & 1 deletion libs/clients/university-careers/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"yarn openapi-generator -o libs/clients/university-careers/src/lib/clients/university-of-iceland/gen/fetch -i libs/clients/university-careers/src/lib/clients/university-of-iceland/clientConfig.yaml"
]
},
"outputs": ["{projectRoot}/gen/fetch"]
"outputs": ["{projectRoot}/**/gen/fetch"]
}
},
"tags": ["lib:client", "scope:client"]
Expand Down

0 comments on commit 7c4c288

Please sign in to comment.