-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,285 additions
and
422 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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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,83 @@ | ||
import { | ||
BngVariant, | ||
InvalidArgument, | ||
NotImplementedError, | ||
VehicleType, | ||
validateBngVariant, | ||
validateMileage, | ||
validatePropulsions, | ||
type Model, | ||
type ModelOutput, | ||
} from "@motorrijtuigenbelasting/core"; | ||
import { | ||
V1a, | ||
V1a_alt1, | ||
V1a_alt2, | ||
V1b, | ||
V2, | ||
V2_alt1, | ||
V2_alt2, | ||
V3, | ||
} from "./rules/index.js"; | ||
|
||
const model: Model = (params) => { | ||
const { propulsions, mileage, vehicleType, bngVariant } = params; | ||
const output: ModelOutput = []; | ||
|
||
validateBngVariant(bngVariant); | ||
validateMileage(mileage); | ||
validatePropulsions(propulsions); | ||
|
||
switch (vehicleType) { | ||
case VehicleType.Personenauto: | ||
case VehicleType["Bestelauto gehandicapte"]: | ||
case VehicleType["Bestelauto particulier"]: | ||
case VehicleType["Bestelauto ondernemer"]: | ||
break; | ||
default: | ||
throw new NotImplementedError( | ||
"BNG is only available for Personenauto en Bestelauto" | ||
); | ||
} | ||
|
||
switch (params.bngVariant) { | ||
case BngVariant.V1a: | ||
V1a(output, params); | ||
break; | ||
|
||
case BngVariant.V1b: | ||
V1b(output, params); | ||
break; | ||
|
||
case BngVariant.V1a_alt1: | ||
V1a_alt1(output, params); | ||
break; | ||
|
||
case BngVariant.V1a_alt2: | ||
V1a_alt2(output, params); | ||
break; | ||
|
||
case BngVariant.V2: | ||
V2(output, params); | ||
break; | ||
|
||
case BngVariant.V2_alt1: | ||
V2_alt1(output, params); | ||
break; | ||
|
||
case BngVariant.V2_alt2: | ||
V2_alt2(output, params); | ||
break; | ||
|
||
case BngVariant.V3: | ||
V3(output, params); | ||
break; | ||
|
||
default: | ||
throw new InvalidArgument("bngVariant has an invalid value"); | ||
} | ||
|
||
return output; | ||
}; | ||
|
||
export default model; |
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,194 @@ | ||
import { PropulsionType, VehicleType } from "@motorrijtuigenbelasting/core"; | ||
import type { Rate } from "@motorrijtuigenbelasting/mrb1995"; | ||
|
||
type RateMap = Record<VehicleType, Record<PropulsionType, Rate[]>>; | ||
|
||
/** | ||
* Varianten voor tariefstructuur Betalen naar Gebruik | ||
* https://www.rijksoverheid.nl/documenten/rapporten/2022/10/27/varianten-voor-tariefstructuur-betalen-naar-gebruik | ||
*/ | ||
export const rateMap_V2 = { | ||
[VehicleType.Personenauto]: { | ||
[PropulsionType.Benzine]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.027, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.047, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.065, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.083, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.109, | ||
}, | ||
], | ||
[PropulsionType.Diesel]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.068, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.078, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.089, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.098, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.117, | ||
}, | ||
], | ||
[PropulsionType.Hybride]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.029, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.048, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.066, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.084, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.12, | ||
}, | ||
], | ||
[PropulsionType.Elektrisch]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.03, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.046, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.063, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.08, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.113, | ||
}, | ||
], | ||
}, | ||
} as RateMap; | ||
|
||
export const rateMap_V2_alt1 = { | ||
[VehicleType.Personenauto]: { | ||
[PropulsionType.Benzine]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.029, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.048, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.065, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.082, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.107, | ||
}, | ||
], | ||
[PropulsionType.Diesel]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.06, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.067, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.082, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.098, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.129, | ||
}, | ||
], | ||
[PropulsionType.Hybride]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.015, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.015, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.018, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.027, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.061, | ||
}, | ||
], | ||
[PropulsionType.Elektrisch]: [ | ||
{ | ||
threshold: 0, | ||
fixedAmount: 0.014, | ||
}, | ||
{ | ||
threshold: 950, | ||
fixedAmount: 0.017, | ||
}, | ||
{ | ||
threshold: 1150, | ||
fixedAmount: 0.025, | ||
}, | ||
{ | ||
threshold: 1350, | ||
fixedAmount: 0.039, | ||
}, | ||
{ | ||
threshold: 1550, | ||
fixedAmount: 0.071, | ||
}, | ||
], | ||
}, | ||
} as RateMap; |
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 { | ||
VehicleType, | ||
validateBngVariant, | ||
type ModelOutput, | ||
type Params, | ||
} from "@motorrijtuigenbelasting/core"; | ||
import { kmRateComponent } from "./utils.js"; | ||
|
||
export function V1a(output: ModelOutput, params: Params) { | ||
/** | ||
* de mrb en de provinciale opcenten worden gevariabiliseerd en | ||
* budgetneutraal omgezet in een kilometertarief gelijk voor alle | ||
* personenauto’s en een tarief gelijk voor alle bestelauto’s. | ||
*/ | ||
const { vehicleType, bngVariant } = params; | ||
|
||
validateBngVariant(bngVariant); | ||
|
||
const kmRate = kmRateComponent(bngVariant); | ||
|
||
output.push( | ||
kmRate(vehicleType === VehicleType.Personenauto ? 0.0682 : 0.0416) | ||
); | ||
} |
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 { | ||
VehicleType, | ||
validateBngVariant, | ||
type ModelOutput, | ||
type Params, | ||
} from "@motorrijtuigenbelasting/core"; | ||
import { kmRateComponent } from "./utils.js"; | ||
|
||
export function V1a_alt1(output: ModelOutput, params: Params) { | ||
/** | ||
* gelijk aan variant V1a maar het tarief is dusdanig verhoogd dat in 2030 | ||
* 2,5 Mton reductie aan CO2 resulteert t.o.v. de basispad. Er is dan geen | ||
* sprake meer van budgetneutraliteit. | ||
*/ | ||
const { vehicleType, bngVariant } = params; | ||
|
||
validateBngVariant(bngVariant); | ||
|
||
const kmRate = kmRateComponent(bngVariant); | ||
|
||
output.push( | ||
kmRate(vehicleType === VehicleType.Personenauto ? 0.1086 : 0.078) | ||
); | ||
} |
Oops, something went wrong.