feat(placements): v0.11 P5 learner placement visibility (REQ-11-005) [2/10] — wave 5-1: get_application_by_posting_learner mine point-read (G-322)
This commit is contained in:
@@ -353,6 +353,16 @@ class MarketplaceStore(Protocol):
|
||||
shape)."""
|
||||
...
|
||||
|
||||
def get_application_by_posting_learner(
|
||||
self, posting_id: str, learner_id: str
|
||||
) -> Application | None:
|
||||
"""v0.11 P5 (G-322, binding): the mine point-read over the
|
||||
(posting_id, learner_id) unique key — the status panel's
|
||||
application DISCOVERY on revisit; None = no application (the
|
||||
surface renders the apply CTA — never client-persisted
|
||||
application_ids)."""
|
||||
...
|
||||
|
||||
def list_applications_by_postings(
|
||||
self, posting_ids: list[str], status: str | None = None
|
||||
) -> list[Application]:
|
||||
@@ -926,6 +936,24 @@ class SQLiteMarketplaceStore:
|
||||
session.refresh(row)
|
||||
return row.to_application()
|
||||
|
||||
def get_application_by_posting_learner(
|
||||
self, posting_id: str, learner_id: str
|
||||
) -> Application | None:
|
||||
"""v0.11 P5 (G-322): the mine point-read — one row over the
|
||||
insert_application unique key (the get_posting point-read
|
||||
discipline)."""
|
||||
with Session(self._engine) as session:
|
||||
row = session.exec(
|
||||
select(ApplicationRow).where(
|
||||
ApplicationRow.posting_id == posting_id,
|
||||
ApplicationRow.learner_id == learner_id,
|
||||
)
|
||||
).one_or_none()
|
||||
if row is None:
|
||||
return None
|
||||
session.refresh(row)
|
||||
return row.to_application()
|
||||
|
||||
def list_applications_by_postings(
|
||||
self, posting_ids: list[str], status: str | None = None
|
||||
) -> list[Application]:
|
||||
|
||||
Reference in New Issue
Block a user