mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-08-24 22:45:18 +02:00
feat: add application date to members
This commit is contained in:
@@ -25,6 +25,7 @@ def test_repository_creates_transparent_member_record(tmp_path) -> None:
|
||||
nickname="Enchantress",
|
||||
email="ada@example.org",
|
||||
birth_date="1990-12-10",
|
||||
application_date="30.07.2026",
|
||||
member_number="0042",
|
||||
)
|
||||
|
||||
@@ -38,6 +39,7 @@ def test_repository_creates_transparent_member_record(tmp_path) -> None:
|
||||
raw = json.loads((member_dir / "member.json").read_text(encoding="utf-8"))
|
||||
assert raw["person"]["first_name"] == "Ada"
|
||||
assert raw["person"]["nickname"] == "Enchantress"
|
||||
assert raw["membership"]["application_date"] == "2026-07-30"
|
||||
assert raw["schema_version"] == 1
|
||||
assert raw["membership"]["ended_at"] == ""
|
||||
assert raw["content_hash"]
|
||||
@@ -121,6 +123,18 @@ def test_repository_accepts_local_date_input_and_rejects_invalid_dates(tmp_path)
|
||||
repository.create_member(first_name="Invalid", last_name="Date", birth_date="31.02.2000")
|
||||
|
||||
|
||||
def test_existing_member_without_application_date_stays_empty(tmp_path) -> None:
|
||||
repository = MemberRepository(tmp_path)
|
||||
repository.initialize()
|
||||
member = repository.create_member(first_name="Legacy", last_name="Member")
|
||||
path = repository.members_root / member.member_id / "member.json"
|
||||
raw = json.loads(path.read_text(encoding="utf-8"))
|
||||
raw["membership"].pop("application_date")
|
||||
path.write_text(json.dumps(raw), encoding="utf-8")
|
||||
|
||||
assert repository.get_member(member.member_id).application_date == ""
|
||||
|
||||
|
||||
def test_repository_reports_empty_contributions_file(tmp_path) -> None:
|
||||
repository = MemberRepository(tmp_path)
|
||||
repository.initialize()
|
||||
|
||||
Reference in New Issue
Block a user