Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / frontend/src/tools/slatematch/captureApi.ts |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | frontend/src/tools/slatematch/captureApi.ts |
| Original SHA-256 | 188164f6f30732c73b5df311ddeb244d1a89215192ac66404202001292e7bc31 |
| Git blob SHA | 26e2844f7a97f32c9459f01ddcc43e9466363ad3 |
| Reading-copy SHA-256 | 188164f6f30732c73b5df311ddeb244d1a89215192ac66404202001292e7bc31 |
Recovered source transcript
Download complete source text ↓44 lines · 1.5 KB
import { request } from '../../lib/api'
// TrackedOpportunity is the app facing view of a tenant tracked opportunity, snake_case to match the Go DTO.
export interface TrackedOpportunity {
id: string
source_type: string
title: string
agency_name: string
office_name: string
solicitation_number: string
notice_type: string
response_deadline: string
prime_or_sub: string
status: string
capture_owner_user_id: string
naics_code: string
psc_code: string
set_aside_code: string
place_of_performance: string
incumbent_name: string
source_url: string
created_at: string
updated_at: string
}
// The capture surface sits under /opportunities/tracked because the public SAM cache read owns
// /opportunities/{noticeID}. request auto prefixes /api and attaches the session cookie and CSRF token.
const NS = '/opportunities/tracked'
const body = (v: unknown) => ({ body: JSON.stringify(v) })
export const captureApi = {
list: (p: { status?: string; limit?: number }) => {
const s = new URLSearchParams()
if (p.status) s.set('status', p.status)
if (p.limit) s.set('limit', String(p.limit))
const qs = s.toString()
return request<TrackedOpportunity[]>(`${NS}${qs ? `?${qs}` : ''}`)
},
get: (id: string) => request<TrackedOpportunity>(`${NS}/${encodeURIComponent(id)}`),
create: (v: Record<string, unknown>) => request<TrackedOpportunity>(NS, { method: 'POST', ...body(v) }),
update: (id: string, v: Record<string, unknown>) =>
request<TrackedOpportunity>(`${NS}/${encodeURIComponent(id)}`, { method: 'PATCH', ...body(v) }),
}