Skip to content

Commit

Permalink
OM-239 Added missing check
Browse files Browse the repository at this point in the history
  • Loading branch information
malinowskikam committed Sep 3, 2024
1 parent 302b211 commit 10fef74
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion worker_voucher/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def validate_assign_vouchers(user: User, eu_code: str, workers: List[str], date_
dates = _check_dates(date_ranges)
vouchers_per_insuree_count = len(dates)
for insuree in insurees:
_check_voucher_limit(insuree, user, ph, vouchers_per_insuree_count)
years = {date.year for date in dates}
for year in years:
count = sum(1 for d in dates if d.year == year)
_check_voucher_limit(insuree, user, ph, year, count)
check_existing_active_vouchers(ph, insurees, dates)
count = insurees_count * vouchers_per_insuree_count
unassigned_vouchers = _check_unassigned_vouchers(ph, dates, count)
Expand Down

0 comments on commit 10fef74

Please sign in to comment.