Initial commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
"""Domain entity: ParentalLeaveFetch.
|
||||
|
||||
Represents a snapshot of a parent's Försäkringskassan data — either scraped via
|
||||
the headless-browser flow or entered manually. The `source` field records the
|
||||
provenance so the UI can display freshness information ("Manually entered on …").
|
||||
|
||||
tier_data is stored as a JSON string in the DB and should be decoded on load.
|
||||
"""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
@dataclass
|
||||
class TierData:
|
||||
"""Breakdown of days by compensation tier."""
|
||||
|
||||
sjukpenning_total: int
|
||||
sjukpenning_used: int
|
||||
sjukpenning_left: int
|
||||
lagsta_niva_total: int
|
||||
lagsta_niva_used: int
|
||||
lagsta_niva_left: int
|
||||
|
||||
|
||||
@dataclass
|
||||
class ParentalLeaveFetch:
|
||||
id: UUID
|
||||
personal_data_uuid: UUID
|
||||
workspace_id: UUID
|
||||
child_id: UUID
|
||||
source: str # 'scraped' | 'manual'
|
||||
fetched_at: datetime
|
||||
total_days: int
|
||||
days_used: int
|
||||
days_left: int
|
||||
reserved_days_total: int
|
||||
reserved_days_left: int
|
||||
transferable_days_left: int
|
||||
dubbeldagar_left: int
|
||||
tier_data: TierData
|
||||
created_at: datetime | None = field(default=None)
|
||||
updated_at: datetime | None = field(default=None)
|
||||
Reference in New Issue
Block a user