feat(placements): v0.11 P5 learner placement visibility (REQ-11-005) [1/10] — wave 5-1: learner status-read contracts (LearnerApplicationSummary / LearnerApplicationStatusResponse / MineApplicationResponse)
This commit is contained in:
@@ -335,3 +335,46 @@ class EmployerPlacementsResponse(BaseModel):
|
||||
|
||||
placements: list[PlacementRead] = Field(default_factory=list)
|
||||
total: int = 0
|
||||
|
||||
|
||||
class LearnerApplicationSummary(BaseModel):
|
||||
"""The application row on the learner status read (D-104,
|
||||
REQ-11-005): the mine-visible fields only — ids + status + the
|
||||
apply timestamp (nullable per the v0.6 row shape — honest
|
||||
absence); references resolve at render (G-302), never
|
||||
denormalized copies."""
|
||||
|
||||
model_config = ConfigDict(frozen=True)
|
||||
|
||||
id: str = Field(min_length=1)
|
||||
posting_id: str = Field(min_length=1)
|
||||
learner_id: str = Field(min_length=1)
|
||||
status: ApplicationStatus
|
||||
created_at: datetime | None = None
|
||||
|
||||
|
||||
class LearnerApplicationStatusResponse(BaseModel):
|
||||
"""GET /v1/marketplace/applications/{application_id}?learner_id=
|
||||
response (REQ-11-005, D-104): current status + the FULL id-ordered
|
||||
timestamped event history for THIS application (a scoped query —
|
||||
never another learner's events) + the placement record when hired
|
||||
(the honest null otherwise — never a fabricated placement, A-304)."""
|
||||
|
||||
model_config = ConfigDict(frozen=True)
|
||||
|
||||
application: LearnerApplicationSummary
|
||||
events: list[PlacementEventRead] = Field(default_factory=list)
|
||||
placement: PlacementRead | None = None
|
||||
|
||||
|
||||
class MineApplicationResponse(BaseModel):
|
||||
"""GET /v1/marketplace/applications/mine?posting_id=&learner_id=
|
||||
response (G-322, binding): {application_id, status} — the status
|
||||
panel's application DISCOVERY read on revisit; 404 = no application
|
||||
on this posting (the surface renders the apply CTA — the panel
|
||||
NEVER depends on client-persisted application_ids)."""
|
||||
|
||||
model_config = ConfigDict(frozen=True)
|
||||
|
||||
application_id: str = Field(min_length=1)
|
||||
status: ApplicationStatus
|
||||
|
||||
Reference in New Issue
Block a user