A common interface for calculating taxes across the world.
This should export a valid JSON schema
that defines the input values that the user should enter.
For example:
{
title: 'Some country',
type: 'object',
required: [],
properties: {
grossSalary: {
type: 'number',
title: 'Base salary'
},
status: {
type: 'string',
title: 'Context',
enum: [ 'single', 'married' ]
}
}
}
This should export a function
that takes a value
compliant with the schema
and a callback(err, annualIncome)
that is called after the calculations are made.
For example:
function (value, callback) {
if (value.status === 'single') {
return callback(null, value * 0.7)
} else {
return callback(null, value * 0.6)
}
}