Skip to content

Commit

Permalink
Child Disability Allowance calculation and api_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
verbman committed Mar 9, 2024
1 parent 64ab6af commit 21688c5
Show file tree
Hide file tree
Showing 32 changed files with 1,171 additions and 201 deletions.
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
# Changelog

### 21.0.0 - [60](https://github.com/digitalaotearoa/openfisca-aotearoa/pull/60)

* Tax and benefit system evolution.
* Impacted periods: all.
* Impacted areas:
- `variables/acts/social_security`
- `variables/acts/parental_leave`
- `variables/acts/immigration`
- `variables/demographics`
- `variables/regulation/social_security/childcare_assistance`
- `variables/regulation/student_allowance`
* Details:
- Add calculation for child disability allowance

* Added variables:
- `immigration__temporary_entry_class_visa`
- `social_security__general_limitation`
- `social_security__unlawfully_resident_or_present`
- `social_security__compelled_to_remain`
- `social_security__refugee_or_protected_person`
- `social_security__awaiting_refugee`
- `social_security__awaiting_protected_person`
- `child_disability_allowance__payment`
- `child_disability_allowance__payment_to`
- `child_disability_allowance__child_with_serious_disability`
- `child_disability_allowance__care_in_home`
- `child_disability_allowance__approved_weekly_accomodation`
- `child_disability_allowance__granted`
- `social_security__temporary_ob_or_ucb_caregiver`
- `social_security__care_and_control`
- `has_disability`

* Breaking changes:
- `immigration__recognised_refugee` period changed from month to day
- `child_disability_allowance__eligible` formula and period changed
- `child_disability_allowance__family_has_eligible_child` formula and period changed
- `child_disability_allowance__allowance_criteria` formula and period changed
- `child_disability_allowance__constant_care_exceeding_12_months`

* Renamed variables:
- `income_tax__principal_caregiver` renamed to `social_security__principal_caregiver` this affects:
- `orphans_benefit__entitled`
- `supported_living_payment__entitled`
- `unsupported_child__entitled`
- `childcare_assistance__eligible_childcare_subsidy`
- `social_security__disability_self_inflicted` renamed to `supported_living_payment__disability_self_inflicted`

Added new feature in folder `ōpenfisca_aotearoa/api_examples`. This is a space for example http calls to help illustrate how to call the API.
Added example calls for entities, parameters, variables and then `acts/social_security/child_disability_allowance` as per project structure

### 20.1.1 - [48](https://github.com/digitalaotearoa/openfisca-aotearoa/pull/48)

* Test case.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $~$

# Pull requests

We follow the [GitHub Flow](https://guides.github.com/introduction/flow/): all code contributions are submitted via a pull request towards the `master` branch.
We follow the [GitHub Flow](https://guides.github.com/introduction/flow/): all code contributions are submitted via a pull request towards the `main` branch.

Opening a Pull Request means you want that code to be merged. If you want to only discuss it, send a link to your branch along with your questions through whichever communication channel you prefer.

Expand Down
7 changes: 7 additions & 0 deletions openfisca_aotearoa/api_examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example API calls

The *.http files in this directory and sub directories store example calls against the OpenFisca API.

If you are utilising VSCode you can easily run these files by installing the `humao.rest-client` (vscode extension)[https://marketplace.visualstudio.com/items?itemName=humao.rest-client]

Before running them you will need to ensure the API is running with `make serve`
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
POST http://localhost:5000/calculate HTTP/1.1
content-type: application/json

{
"persons": {
"Mama": {
"social_security__principal_caregiver" : {
"2019-01": true
},
"child_disability_allowance__eligible" : {
"2019-W02": null
},
"child_disability_allowance__payment" : {
"2019-W02": null
}
},
"Papa": {
"social_security__temporary_ob_or_ucb_caregiver" : {
"2019-W02": true
},
"child_disability_allowance__eligible" : {
"2019-W02": null
},
"child_disability_allowance__payment" : {
"2019-W02": null
}
},
"Tama_disabled_child": {
"age" : {
"day:2019-01-07:7": 5
},
"has_disability" : {
"2019-01": true
},
"child_disability_allowance__constant_care_exceeding_12_months" : {
"2019-W02": true
},
"child_disability_allowance__care_in_home" : {
"2019-W02": true
},
"child_disability_allowance__eligible" : {
"2019-W02": null
},
"child_disability_allowance__payment" : {
"2019-W02": null
}
},
"Tamahine_able_bodied_teenager": {
"age" : {
"day:2019-01-07:7": 19
},
"child_disability_allowance__eligible" : {
"2019-W02": null
},
"child_disability_allowance__payment" : {
"2019-W02": null
}
}
},
"families": {
"Whanau_tahi": {
"principal": "Mama",
"children": [
"Tama_disabled_child", "Tamahine_able_bodied_teenager"
],
"others" : "Papa"
}
}
}
1 change: 1 addition & 0 deletions openfisca_aotearoa/api_examples/entities.http
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GET http://localhost:5000/entities HTTP/1.1
1 change: 1 addition & 0 deletions openfisca_aotearoa/api_examples/parameters.http
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GET http://localhost:5000/parameters HTTP/1.1
1 change: 1 addition & 0 deletions openfisca_aotearoa/api_examples/variables.http
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GET http://localhost:5000/variables HTTP/1.1

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
description: Child Disability Allowance
metadata:
# currency or /1 (rate) or year (never used)
unit: currency
# single_amount or marginal_rate or marginal_amount or value?
type: value
reference:
2013-07-15:
title: Social Security Act 1964
href:
- https://www.legislation.govt.nz/act/public/1964/0136/latest/DLM5478527.html#DLM5478527,
- https://www.legislation.govt.nz/act/public/2013/0013/latest/DLM4542346.html
# TODO - requires old act calculation
2007-03-05:
title: Social Security (Rates of Benefits and Allowances) Order 2007
href: https://www.legislation.govt.nz/regulation/public/2007/0060/latest/DLM428373.html
# TODO - requires old act calculation
2008-03-03:
title: Social Security (Rates of Benefits and Allowances) Order 2008
href: https://www.legislation.govt.nz/regulation/public/2008/0053/latest/DLM1161407.html
# TODO - requires old act calculation
2009-02-23:
title: Social Security (Rates of Benefits and Allowances) Order 2009
href: https://www.legislation.govt.nz/regulation/public/2009/0027/latest/DLM1841301.html
# TODO - requires old act calculation
2010-02-22:
title: Social Security (Rates of Benefits and Allowances) Order 2010
href: https://www.legislation.govt.nz/regulation/public/2010/0021/latest/DLM2748958.html
# TODO - requires old act calculation
2010-08-30:
title: Social Security (Rates of Benefits and Allowances) Order (No 2) 2010
href: https://www.legislation.govt.nz/regulation/public/2010/0289/latest/DLM3185601.html
# TODO - requires old act calculation
2011-02-21:
title: Social Security (Rates of Benefits and Allowances) Order 2011
href: https://www.legislation.govt.nz/regulation/public/2011/0016/latest/DLM3561401.html
# TODO - requires old act calculation
2012-02-27:
title: Social Security (Rates of Benefits and Allowances) Order 2012
href: https://www.legislation.govt.nz/regulation/public/2012/0021/latest/DLM4299301.html
# TODO - requires old act calculation
2013-02-25:
title: Social Security (Rates of Benefits and Allowances) Order 2013
href: https://www.legislation.govt.nz/regulation/public/2013/0019/latest/DLM5032541.html
# TODO - requires old act calculation
2014-02-24:
title: Social Security (Rates of Benefits and Allowances) Order 2014
href: https://www.legislation.govt.nz/regulation/public/2014/0039/latest/DLM5941010.html
# TODO - requires old act calculation
2015-02-23:
title: Social Security (Rates of Benefits and Allowances) Order 2015
href: https://www.legislation.govt.nz/regulation/public/2015/0033/latest/DLM6387601.html
# TODO - requires old act calculation
2016-03-07:
title: Social Security (Rates of Benefits and Allowances) Order 2016
href: https://www.legislation.govt.nz/regulation/public/2016/0053/latest/DLM6746223.html
# TODO - requires old act calculation
2017-02-27:
title: Social Security (Rates of Benefits and Allowances) Order 2017
href: https://www.legislation.govt.nz/regulation/public/2017/0030/latest/DLM7118101.html
# TODO - requires old act calculation
2018-02-26:
title: Social Security (Rates of Benefits and Allowances) Order 2018
href: https://www.legislation.govt.nz/regulation/public/2018/0019/latest/whole.html
# TODO - requires old act calculation
2018-11-26:
title: Social Security Act 2018 (As Enacted)
href: https://www.legislation.govt.nz/act/public/2018/0032/59.0/DLM6784850.html
2019-02-25:
title: Social Security (Rates of Benefits and Allowances) Order 2019
href: https://www.legislation.govt.nz/regulation/public/2019/0027/latest/LMS156275.html
2020-02-24:
title: Social Security (Rates of Benefits and Allowances) Order 2020
href: https://www.legislation.govt.nz/regulation/public/2020/0013/latest/whole.html
2021-02-22:
title: Social Security (Rates of Benefits and Allowances) Order 2021
href: https://www.legislation.govt.nz/regulation/public/2021/0015/latest/whole.html
2022-02-21:
title: Social Security (Rates of Benefits and Allowances) Order 2022
href: https://www.legislation.govt.nz/regulation/public/2022/0028/latest/whole.html
2023-02-20:
title: Social Security (Rates of Benefits and Allowances) Order 2023
href: https://www.legislation.govt.nz/regulation/public/2023/0038/latest/whole.html
clauses:
clause_1:
values:
2018-11-26:
value: 47.64
metadata:
reference:
title: Schedule 4, Part 9, Clause 1 (Child disability allowance and disability allowance)
href: https://www.legislation.govt.nz/act/public/2018/0032/59.0/DLM6784880.html
2019-04-01:
value: 48.45
metadata:
reference:
title: Schedule 2, Part 1, Clause 1 (Child disability allowance and disability allowance)
href: https://www.legislation.govt.nz/regulation/public/2019/0027/latest/whole.html
2020-04-01:
value: 49.26
metadata:
reference:
title: Schedule 2, Part 1, Clause 1 (Child disability allowance and disability allowance)
href: https://www.legislation.govt.nz/regulation/public/2020/0013/11.0/whole.html
2021-04-01:
value: 49.83
metadata:
reference:
title: Schedule 2, Part 1, Clause 1 (Child disability allowance and disability allowance)
href: https://www.legislation.govt.nz/regulation/public/2021/0015/latest/whole.html
2022-04-01:
value: 52.79
metadata:
reference:
title: Schedule 2, Part 3, Clause 1 (Child disability allowance and disability allowance)
href: https://www.legislation.govt.nz/regulation/public/2022/0028/latest/whole.html
2023-04-01:
value: 56.60
metadata:
reference:
title: Schedule 2, Part 2, Clause 1 (Child disability allowance and disability allowance)
href: https://www.legislation.govt.nz/regulation/public/2023/0038/latest/whole.html
Loading

0 comments on commit 21688c5

Please sign in to comment.