mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-08-25 06:55:17 +02:00
feat: extend inventory and administration workflows
This commit is contained in:
@@ -87,6 +87,11 @@ def test_housekeeper_claim_actions_are_idempotent(tmp_path) -> None:
|
||||
amounts = {claim["claim_key"]: claim["amount"] for claim in first_claims}
|
||||
assert amounts["membership-fee:2026:first-half"] == "37.50"
|
||||
assert amounts["membership-fee:2026:second-half"] == "75.00"
|
||||
descriptions = {
|
||||
claim["claim_key"]: claim["items"][0]["description"] for claim in first_claims
|
||||
}
|
||||
assert descriptions["membership-fee:2026:first-half"].endswith("(3 Monate)")
|
||||
assert descriptions["membership-fee:2026:second-half"] == "Mitgliedsbeitrag 2. Halbjahr 2026"
|
||||
assert state["run_counter"] == 2
|
||||
assert state["last_completed_run"] == "2026-04-15:000002"
|
||||
|
||||
@@ -121,6 +126,9 @@ def test_housekeeper_creates_membership_claims_retroactively_since_entry(tmp_pat
|
||||
"membership-fee:2026:annual",
|
||||
}
|
||||
assert claims_by_key["membership-fee:2024:annual"]["amount"] == "112.50"
|
||||
assert claims_by_key["membership-fee:2024:annual"]["items"][0]["description"].endswith(
|
||||
"(9 Monate)"
|
||||
)
|
||||
|
||||
|
||||
def test_housekeeper_uses_pre_2022_contribution_amounts_for_legacy_years(tmp_path) -> None:
|
||||
@@ -169,6 +177,23 @@ def test_housekeeper_does_not_create_retroactive_membership_claims_by_default(tm
|
||||
}
|
||||
|
||||
|
||||
def test_housekeeper_does_not_create_claims_due_after_membership_end(tmp_path) -> None:
|
||||
repository = MemberRepository(tmp_path)
|
||||
repository.initialize()
|
||||
member = repository.create_member(first_name="Former", last_name="Member", birth_date="1990-01-01")
|
||||
member.status = "resigned_end_of_year"
|
||||
member.accepted_at = "2024-01-01"
|
||||
member.membership_started_at = "2024-01-01"
|
||||
member.membership_ended_at = "2026-12-31"
|
||||
repository.save_member(member)
|
||||
|
||||
Housekeeper(repository).run(today=date(2026, 6, 21))
|
||||
|
||||
claim_keys = {claim["claim_key"] for claim in repository.get_contributions(member.member_id).claims}
|
||||
assert "membership-fee:2026:annual" in claim_keys
|
||||
assert "membership-fee:2027:annual" not in claim_keys
|
||||
|
||||
|
||||
def test_housekeeper_resolves_tasks_not_seen_in_current_run(tmp_path) -> None:
|
||||
repository = MemberRepository(tmp_path)
|
||||
repository.initialize()
|
||||
|
||||
Reference in New Issue
Block a user