Skip to content

Commit

Permalink
Increase and unify budget (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
goce-cz authored Jun 28, 2022
1 parent fd8c2a8 commit 97a397e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
32 changes: 25 additions & 7 deletions admin-scripts/lib/budget-updates.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ years.forEach((y) => {
const resultsPart = [];
const resultsFull = [];
let yy;
if (date >= '2021-08-01') {
if (date >= '2022-07-01') {
resultsPart.push({
action: 'initial',
amount: 75000,
date,
});
resultsFull.push({
action: 'initial',
amount: 75000,
date,
});
yy = y + 2;
} else if (date >= '2021-08-01') {
resultsPart.push({
action: 'initial',
amount: 55000,
Expand Down Expand Up @@ -70,14 +82,20 @@ years.forEach((y) => {
const act = `${yy}-${d}`;
if (act >= '2015-04-01') {
let partIncreaseAmount;
if (act >= '2021-08-01') {
partIncreaseAmount = 21000;
} else if (act >= '2019-08-01') {
partIncreaseAmount = 12500;
let fullIncreaseAmount;
if (act >= '2022-07-01') {
partIncreaseAmount = 30000;
fullIncreaseAmount = 30000;
} else {
partIncreaseAmount = 11250;
if (act >= '2021-08-01') {
partIncreaseAmount = 21000;
} else if (act >= '2019-08-01') {
partIncreaseAmount = 12500;
} else {
partIncreaseAmount = 11250;
}
fullIncreaseAmount = act >= '2019-08-01' ? 25000 : 22500;
}
const fullIncreaseAmount = act >= '2019-08-01' ? 25000 : 22500;

resultsPart.push({
action: 'yearly',
Expand Down
16 changes: 16 additions & 0 deletions admin-scripts/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const budgetNames = {
PERIOD1: 'period1',
PERIOD2: 'period2',
PERIOD3: 'period3',
PERIOD4: 'period4',
};

const budgetStartDate = '2015-04-01'; // when the budget calculation starts
Expand Down Expand Up @@ -70,6 +71,21 @@ const config = {
},
name: budgetNames.PERIOD3,
firstIncreaseYears: 2,
validUntil: '2022-07-01',
},
{
initial: {
// initial budget
fullTime: 75000,
partTime: 75000,
},
yearly: {
// yearly increase
fullTime: 30000,
partTime: 30000,
},
name: budgetNames.PERIOD4,
firstIncreaseYears: 2,
validUntil: '2999-12-31',
},
],
Expand Down

0 comments on commit 97a397e

Please sign in to comment.