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

MVJ-550 override_receivable_type in Rent (API) #772

Merged
merged 7 commits into from
Nov 21, 2024

Conversation

juho-kettunen-nc
Copy link
Contributor

@juho-kettunen-nc juho-kettunen-nc commented Nov 14, 2024

This implements the API part of override receivable type, where it is a property of Rent, instead of ContractRent like the other implementation in #771

@juho-kettunen-nc juho-kettunen-nc force-pushed the MVJ-550-override-receivable-type-rent branch 2 times, most recently from 3dbb4ec to 151fb8e Compare November 15, 2024 15:03
@juho-kettunen-nc juho-kettunen-nc marked this pull request as ready for review November 18, 2024 13:19
@juho-kettunen-nc
Copy link
Contributor Author

Still requires customer blessing to use this Rent version instead of the ContractRent, but this is the best version of the logic we have right now.

leasing/enums.py Outdated Show resolved Hide resolved
Copy link
Contributor

@henrinie-nc henrinie-nc left a comment

Choose a reason for hiding this comment

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

It looks good so I am approving, however two things could be improved if you agree:

  • validate_override_receivable_type_value() could be refactored slightly to simplify it
  • is_akv_or_kuva_service_unit_id() might be possible to replace by adding an attribute on ServiceUnit model for enablding and disabling override receivable type on rents.

@juho-kettunen-nc juho-kettunen-nc force-pushed the MVJ-550-override-receivable-type-rent branch from b745cae to 9e4c041 Compare November 20, 2024 12:17
@juho-kettunen-nc
Copy link
Contributor Author

juho-kettunen-nc commented Nov 20, 2024

The CI build fails due to some migration 0082 that was present at some time in my feature branch, but has since been removed. I don't think there's even a commit for that anymore here. I wonder how to fix that in this pipeline, besides creating a new PR which would lose the comment history

EDIT: fixed by reverting formatting changes to service unit model help text

@henrinie-nc
Copy link
Contributor

It (still) seems good, we could see if the validation logic can be simplified. The logic to validate seems quite complex, and if there is room for improvement it would make it easier to understand later on

@juho-kettunen-nc juho-kettunen-nc force-pushed the MVJ-550-override-receivable-type-rent branch from 1984213 to d772e49 Compare November 21, 2024 14:04
@juho-kettunen-nc juho-kettunen-nc merged commit d772e49 into develop Nov 21, 2024
2 checks passed
@juho-kettunen-nc juho-kettunen-nc deleted the MVJ-550-override-receivable-type-rent branch November 21, 2024 14:34
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.

3 participants