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

[WIP] MVJ-610 Setting start point figure for rent's tasotarkistus #799

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

NC-jsAhonen
Copy link
Contributor

When the old_dwellings_in_housing_companies_price_index is updated for the first time, the start_price_index_point_figure is set for that rent as well.

If the last year's index point figure doesn't exist yet, the current logic in this PR uses the latest available point figure. This might need to be changed so that it does not set it at all if the last year's point figure is not available yet.

SUGGESTIONS:

  • If the logic Change the start_price_index_point_figure from number to string, so for example: 100 => "2020 * 100" This would also reveal the year from which the index point figure comes from, not only the number itself.

@juho-kettunen-nc
Copy link
Contributor

juho-kettunen-nc commented Dec 20, 2024

If the last year's index point figure doesn't exist yet, the current logic in this PR uses the latest available point figure. This might need to be changed so that it does not set it at all if the last year's point figure is not available yet.

I agree on latter idea. If the lease begins in 2025, we must not allow 2023 point figure to be used because that would be against the specification.

I think we discussed in some meeting the possibility to leave point figure value empty initially, and fill it in a batchrun (or similar async job) at a later date after the value has been published by StatFi. Two ways to go about it:

  • add a periodic batchrun job that queries the database for the latest point figure, and queries all leases with tasotarkistus, and adds the correct point figure value to rents that don't have it saved yet. Maybe one a month or week.
  • every time a rent is saved without the point figure, schedule some asynchronous job/batchrun to be executed at a later specified date when the value is known to be available. For example, on last week of June (because tasotarkistus calculations are supposed to be performed on 1.7.).

@juho-kettunen-nc
Copy link
Contributor

If the logic Change the start_price_index_point_figure from number to string, so for example: 100 => "2020 * 100" This would also reveal the year from which the index point figure comes from, not only the number itself.

Or instead use the point figure field to save a reference to the point figure object. It contains all the details related to the figure, including value and year.

Copy link
Contributor

@juho-kettunen-nc juho-kettunen-nc left a comment

Choose a reason for hiding this comment

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

I mark this PR as "changes requested", because the topics in my comments are in discussions:

  • filling in the missing index point figures afterwards via a batchrun or similar
  • saving a reference to the index point figure object, instead of only the numeric value.

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.

2 participants