Skip to content

Commit 8362c91

Browse files
remove working income vs net income validation
1 parent a6a7d18 commit 8362c91

File tree

4 files changed

+4
-29
lines changed

4 files changed

+4
-29
lines changed

frontend/app/.server/environment/estimator.ts

-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as v from 'valibot';
22

3-
import { stringToBooleanSchema } from '../validation/string-to-boolean-schema';
43
import { stringToIsoDateSchema } from '../validation/string-to-iso-date-schema';
54
import { stringToNumberSchema } from '../validation/string-to-number-schema';
65
import { stringToUrlSchema } from '../validation/string-to-url-schema';
@@ -28,7 +27,6 @@ export const defaults = {
2827
ESTIMATOR_YEARLY_MAX_BENEFITS: '2400',
2928
ESTIMATOR_BENEFIT_REDUCTION_RATE: '0.2',
3029
ESTIMATOR_SPLIT_BENEFIT_REDUCTION_RATE: '0.1',
31-
ESTIMATOR_WORKING_INCOME_SPECIAL_VALIDATION_ENABLED: 'true',
3230
} as const;
3331

3432
// Define schema for the environment variable
@@ -119,14 +117,6 @@ export const estimator = v.object({
119117
* Benefit reduction rate (split)
120118
*/
121119
ESTIMATOR_SPLIT_BENEFIT_REDUCTION_RATE: v.optional(stringToNumberSchema(), defaults.ESTIMATOR_SPLIT_BENEFIT_REDUCTION_RATE),
122-
123-
/**
124-
* Enable or disable working income < net income validation
125-
*/
126-
ESTIMATOR_WORKING_INCOME_SPECIAL_VALIDATION_ENABLED: v.optional(
127-
stringToBooleanSchema(),
128-
defaults.ESTIMATOR_WORKING_INCOME_SPECIAL_VALIDATION_ENABLED,
129-
),
130120
});
131121

132122
export type Estimator = Readonly<v.InferOutput<typeof estimator>>;

frontend/app/.server/locales/estimator-en.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
"working-income": {
5252
"error": {
5353
"invalid": "Your partner's working income is invalid",
54-
"required": "Your partner's working income is required",
55-
"should-not-exceed-net-income": "Your partner's working income should not exceed their net income"
54+
"required": "Your partner's working income is required"
5655
},
5756
"info-label": "How to calculate your partner's working income",
5857
"label": "Your partner's working income"
@@ -61,8 +60,7 @@
6160
"working-income": {
6261
"error": {
6362
"invalid": "Your working income is invalid",
64-
"required": "Your working income is required",
65-
"should-not-exceed-net-income": "Your working income should not exceed your net income"
63+
"required": "Your working income is required"
6664
},
6765
"info-label": "How to calculate your working income",
6866
"label": "Your working income"

frontend/app/.server/locales/estimator-fr.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
"working-income": {
5252
"error": {
5353
"invalid": "Le revenu d'empoi de votre partenaire est invalide",
54-
"required": "Le revenu d'emploi de votre partenaire est requis",
55-
"should-not-exceed-net-income": "Le revenu d'empoi de votre partenaire ne doit pas dépasser leur revenu net"
54+
"required": "Le revenu d'emploi de votre partenaire est requis"
5655
},
5756
"info-label": "Comment calculer le revenu d'emploi de votre partenaire ?",
5857
"label": "Le revenu d'emploi de votre partenaire"
@@ -61,8 +60,7 @@
6160
"working-income": {
6261
"error": {
6362
"invalid": "Votre revenu d'emploi est invalide",
64-
"required": "Votre revenu d'emploi est requis",
65-
"should-not-exceed-net-income": "Votre revenu d'empoi ne doit pas dépasser votre revenu net"
63+
"required": "Votre revenu d'emploi est requis"
6664
},
6765
"info-label": "Comment calculer votre revenu d'emploi ?",
6866
"label": "Votre revenu d'emploi"

frontend/app/routes/estimator/step-income.tsx

-11
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,6 @@ function processIncome(formData: FormData, isMarried: boolean, lang: Language) {
112112
v.minValue(0, 'claimed-repayment.error.invalid'),
113113
),
114114
}),
115-
v.forward(
116-
v.partialCheck(
117-
[['workingIncome'], ['netIncome']],
118-
(input) =>
119-
globalThis.__appEnvironment.ESTIMATOR_WORKING_INCOME_SPECIAL_VALIDATION_ENABLED
120-
? input.workingIncome <= input.netIncome
121-
: true,
122-
'working-income.error.should-not-exceed-net-income',
123-
),
124-
['workingIncome'],
125-
),
126115
);
127116

128117
// Combined schema with variants for single and married

0 commit comments

Comments
 (0)