Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HL-737 | Calculator changes #2021

Merged
merged 14 commits into from
Aug 22, 2023
Merged

HL-737 | Calculator changes #2021

merged 14 commits into from
Aug 22, 2023

Conversation

rikuke
Copy link
Collaborator

@rikuke rikuke commented May 9, 2023

Description ✨

This PR updates the calculator with the changes mandated by the new legislation coming into effect 1.7.2023.
The changes in a nutshell:

  • the pay subsidy percentages that can be selected are changed from 30%, 40%, 50% and 100% to 50%, 70% and 100%
  • a new 70% option is added for the state aid maximum percentage
  • new maximum pay subsidies are added for 100% (2020€), 70% (1770€) and 50% (1260€)
  • any vacation money reported by the employer is calculated per month by default
  • pay subsidy is calculated using the new formula min(2020, (monthly_pay / work_time_fraction * 0.65) * 1.23 when pay subsidy max_percentage is 100%
  • update the excel test cases for the new percentages and amounts and fix some decimal roundings that were found during testing
  • add some AI-generated comments and examples for the utility functions in utils.py

Testing ⚗️

pytest calculator/tests/test_handler_excel_examples.py
or create a new application through the UI using the any of the test cases in the excel.

Screenshots 📸

Screenshot 2023-08-21 at 11 08 45 Screenshot 2023-08-21 at 13 13 57

Additional notes 🗒️

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2023

Codecov Report

Merging #2021 (3d1e4ee) into develop (767b239) will decrease coverage by 20.02%.
Report is 2 commits behind head on develop.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           develop    #2021       +/-   ##
============================================
- Coverage    34.20%   14.18%   -20.02%     
============================================
  Files          599      286      -313     
  Lines        11029     7501     -3528     
  Branches      2343     1889      -454     
============================================
- Hits          3772     1064     -2708     
+ Misses        6858     6151      -707     
+ Partials       399      286      -113     

see 641 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

Helsinkibenefit-bf-hdlr is deployed to: https://helsinkibenefit-bf-hdlr-2021.test.kuva.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://kesaseteli-pr2021.api.dev.hel.ninja/healthz 🚀🚀🚀

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

Helsinkibenefit-bf-appl is deployed to: https://helsinkibenefit-bf-appl-2021.test.kuva.hel.ninja 🚀🚀🚀

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

Helsinkibenefit-bf-bknd is deployed to: https://helsinkibenefit-bf-bknd-2021.test.kuva.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

YOUTH branch is deployed to platta: https://youth-pr2021.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

EMPLOYER branch is deployed to platta: https://kesaseteli-pr2021.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://handler-pr2021.dev.hel.ninja 🚀🚀🚀

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

TestCafe result is success for https://helsinkibenefit-bf-appl-2021.test.kuva.hel.ninja! 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://handler-pr2021.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-pr2021.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://youth-pr2021.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://kesaseteli-pr2021.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://handler-pr2021.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

EMPLOYER branch is deployed to platta: https://kesaseteli-pr2021.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://handler-pr2021.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-pr2021.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

YOUTH branch is deployed to platta: https://youth-pr2021.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://youth-pr2021.dev.hel.ninja 😆🎉🎉🎉

@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

[yjdh-kesaseteli-handler] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 5 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

84.7% 84.7% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

[yjdh-kesaseteli-shared] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

[yjdh-kesaseteli-api] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 51 Code Smells

94.3% 94.3% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

[yjdh-kesaseteli-employer] SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 6 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 10 Code Smells

81.1% 81.1% Coverage
0.0% 0.0% Duplication

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://kesaseteli-pr2021.api.dev.hel.ninja/healthz 🚀🚀🚀

@sonarcloud
Copy link

sonarcloud bot commented May 12, 2023

[yjdh-kesaseteli-youth] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

91.8% 91.8% Coverage
0.0% 0.0% Duplication

@sirtawast sirtawast changed the title Hl 737 calculator HL-737 | Calculator changes May 22, 2023
@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2021.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2021.dev.hel.ninja 🚀🚀🚀

@rikuke rikuke marked this pull request as ready for review August 21, 2023 11:39
@sonarcloud
Copy link

sonarcloud bot commented Aug 21, 2023

[yjdh-helsinkilisa-shared] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Aug 21, 2023

[yjdh-helsinkilisa-applicant] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 8 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 56 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Aug 21, 2023

[yjdh-helsinkilisa-handler] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 57 Code Smells

No Coverage information No Coverage information
0.2% 0.2% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Aug 21, 2023

[yjdh-helsinkilisa-api] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 4 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 17 Code Smells

92.3% 92.3% Coverage
0.0% 0.0% Duplication

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2021.api.dev.hel.ninja/healthz 🚀🚀🚀

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2021.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2021.dev.hel.ninja 🚀🚀🚀

Copy link
Collaborator

@mjturt mjturt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the last line endings in json files, otherwise very OK 👍

@@ -143,7 +321,9 @@ def days360(start_date, end_date):
)


def duration_in_months(start_date, end_date, decimal_places=None):
def duration_in_months(
start_date: date, end_date: date, decimal_places: Union[int, None] = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also Optional from typing for these cases. Doesn't really matter, as I hope we can upgrade to python 3.10 soon.

@@ -1044,4 +1047,4 @@
},
"keyword": "Hakusana"
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the editors should be configured so that they don't mess up the line endings.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is green now, not worth waiting for builds. Maybe merge and do a hotfix to address the line change issues?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix the line endings in a separate PR.

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2021.dev.hel.ninja 😆🎉🎉🎉

@rikuke rikuke merged commit 15481ef into develop Aug 22, 2023
70 checks passed
@rikuke rikuke deleted the HL-737-calculator branch August 22, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants