Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 09015496d565a172bcaa15cfe9a8e4b072b13df0 |
| Branch | workstream-b-screenmatch |
| Path or archive member | internal/platform/database/dbgen/opportunity_records.sql.go |
| Original SHA-256 | 4517cef9d2395f6ee067a67b2ef1645c3785197b1749ba395652d673014aabf1 |
| Git blob SHA | bbf587d07ab539a726e903b5c0713135cb70c7f2 |
| Reading-copy SHA-256 | 4517cef9d2395f6ee067a67b2ef1645c3785197b1749ba395652d673014aabf1 |
Every recorded occurrence
These 39 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-a-opportunity-intelligence | 1675031db74316e100782d063e9eda1a597fe3a1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-d-command-center | 255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-e-commercial-stubs | 4437da660539284a400ee380b9b427a300c369ee | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ws3-clearance | 4b8e7ce594c068621867f9c9deed0ec64ae6c553 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ws6-retrieval | 6c56e29231ec05735927fa265c97d517499dfeaf | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | phase2-eval-fairness | d361af254701975fe239927656ababb56374655e | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-b-sam-contract-awards | d5101cceb98e70000cebb31d3e7ac73d747d3a6d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ws2-alias-relationship | e4dada4601c6eb101830f9d223a9655dfa120616 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ws6-retrieval | 6c56e29231ec05735927fa265c97d517499dfeaf | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ws3-clearance | 4b8e7ce594c068621867f9c9deed0ec64ae6c553 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-d-command-center | 255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | phase2-eval-fairness | d361af254701975fe239927656ababb56374655e | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-a-opportunity-intelligence | 1675031db74316e100782d063e9eda1a597fe3a1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-e-commercial-stubs | 4437da660539284a400ee380b9b427a300c369ee | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go | workstream-b-sam-contract-awards | d5101cceb98e70000cebb31d3e7ac73d747d3a6d | Open original |
Recovered source transcript
Download complete source text ↓279 lines · 9.4 KB
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
// source: opportunity_records.sql
package dbgen
import (
"context"
"time"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgtype"
"github.com/shopspring/decimal"
)
const getOpportunityRecord = `-- name: GetOpportunityRecord :one
SELECT id, source_name, source_record_id, dedupe_key, record_kind, title, agency, sub_agency, naics, psc, pop_city, pop_state, pop_country, pop_zip, set_aside, set_aside_code, contract_vehicle, estimated_value, value_source, incumbent_name, incumbent_uei, posted_date, response_deadline, award_date, estimated_award_date, pop_start_date, pop_end_date, ui_link, is_planning, raw_object_key, raw_sha256, fetched_at, synced_at FROM opportunity_records WHERE id = $1
`
func (q *Queries) GetOpportunityRecord(ctx context.Context, id uuid.UUID) (OpportunityRecord, error) {
row := q.db.QueryRow(ctx, getOpportunityRecord, id)
var i OpportunityRecord
err := row.Scan(
&i.ID,
&i.SourceName,
&i.SourceRecordID,
&i.DedupeKey,
&i.RecordKind,
&i.Title,
&i.Agency,
&i.SubAgency,
&i.Naics,
&i.Psc,
&i.PopCity,
&i.PopState,
&i.PopCountry,
&i.PopZip,
&i.SetAside,
&i.SetAsideCode,
&i.ContractVehicle,
&i.EstimatedValue,
&i.ValueSource,
&i.IncumbentName,
&i.IncumbentUei,
&i.PostedDate,
&i.ResponseDeadline,
&i.AwardDate,
&i.EstimatedAwardDate,
&i.PopStartDate,
&i.PopEndDate,
&i.UiLink,
&i.IsPlanning,
&i.RawObjectKey,
&i.RawSha256,
&i.FetchedAt,
&i.SyncedAt,
)
return i, err
}
const listOpportunityRecords = `-- name: ListOpportunityRecords :many
SELECT id, source_name, source_record_id, dedupe_key, record_kind, title, agency, sub_agency, naics, psc, pop_city, pop_state, pop_country, pop_zip, set_aside, set_aside_code, contract_vehicle, estimated_value, value_source, incumbent_name, incumbent_uei, posted_date, response_deadline, award_date, estimated_award_date, pop_start_date, pop_end_date, ui_link, is_planning, raw_object_key, raw_sha256, fetched_at, synced_at FROM opportunity_records
WHERE ($1::text[] IS NULL OR record_kind = ANY($1::text[]))
AND ($2::text[] IS NULL OR naics = ANY($2::text[]))
AND ($3::text[] IS NULL OR upper(agency) = ANY($3::text[]))
AND ($4::text[] IS NULL OR upper(pop_state) = ANY($4::text[]))
ORDER BY (response_deadline IS NULL OR response_deadline < now()), response_deadline ASC, posted_date DESC NULLS LAST, id
LIMIT $5::int
`
type ListOpportunityRecordsParams struct {
Kinds []string `json:"kinds"`
Naics []string `json:"naics"`
Agencies []string `json:"agencies"`
States []string `json:"states"`
Lim int32 `json:"lim"`
}
// Optional filters (NULL array = no filter). Soonest closing first, then most recently posted, then id
// as a unique tiebreaker so the order is deterministic. Text equality filters compare upper() on both
// sides; the service upper cases the params so casing drift cannot silently zero out results.
func (q *Queries) ListOpportunityRecords(ctx context.Context, arg ListOpportunityRecordsParams) ([]OpportunityRecord, error) {
rows, err := q.db.Query(ctx, listOpportunityRecords,
arg.Kinds,
arg.Naics,
arg.Agencies,
arg.States,
arg.Lim,
)
if err != nil {
return nil, err
}
defer rows.Close()
items := []OpportunityRecord{}
for rows.Next() {
var i OpportunityRecord
if err := rows.Scan(
&i.ID,
&i.SourceName,
&i.SourceRecordID,
&i.DedupeKey,
&i.RecordKind,
&i.Title,
&i.Agency,
&i.SubAgency,
&i.Naics,
&i.Psc,
&i.PopCity,
&i.PopState,
&i.PopCountry,
&i.PopZip,
&i.SetAside,
&i.SetAsideCode,
&i.ContractVehicle,
&i.EstimatedValue,
&i.ValueSource,
&i.IncumbentName,
&i.IncumbentUei,
&i.PostedDate,
&i.ResponseDeadline,
&i.AwardDate,
&i.EstimatedAwardDate,
&i.PopStartDate,
&i.PopEndDate,
&i.UiLink,
&i.IsPlanning,
&i.RawObjectKey,
&i.RawSha256,
&i.FetchedAt,
&i.SyncedAt,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const opportunityRecordMeta = `-- name: OpportunityRecordMeta :one
SELECT COUNT(*)::bigint AS total, MAX(synced_at) AS last_synced FROM opportunity_records
`
type OpportunityRecordMetaRow struct {
Total int64 `json:"total"`
LastSynced interface{} `json:"last_synced"`
}
func (q *Queries) OpportunityRecordMeta(ctx context.Context) (OpportunityRecordMetaRow, error) {
row := q.db.QueryRow(ctx, opportunityRecordMeta)
var i OpportunityRecordMetaRow
err := row.Scan(&i.Total, &i.LastSynced)
return i, err
}
const upsertOpportunityRecord = `-- name: UpsertOpportunityRecord :exec
INSERT INTO opportunity_records (
source_name, source_record_id, dedupe_key, record_kind, title, agency, sub_agency,
naics, psc, pop_city, pop_state, pop_country, pop_zip, set_aside, set_aside_code,
contract_vehicle, estimated_value, value_source, incumbent_name, incumbent_uei,
posted_date, response_deadline, award_date, estimated_award_date, pop_start_date, pop_end_date,
ui_link, is_planning, raw_object_key, raw_sha256, fetched_at, synced_at
) VALUES (
$1, $2, $3, $4, $5, $6, $7,
$8, $9, $10, $11, $12, $13, $14, $15,
$16, $17, $18, $19, $20,
$21, $22, $23, $24, $25, $26,
$27, $28, $29, $30, $31, now()
)
ON CONFLICT (source_name, source_record_id) DO UPDATE SET
dedupe_key = EXCLUDED.dedupe_key,
record_kind = EXCLUDED.record_kind,
title = EXCLUDED.title,
agency = EXCLUDED.agency,
sub_agency = EXCLUDED.sub_agency,
naics = EXCLUDED.naics,
psc = EXCLUDED.psc,
pop_city = EXCLUDED.pop_city,
pop_state = EXCLUDED.pop_state,
pop_country = EXCLUDED.pop_country,
pop_zip = EXCLUDED.pop_zip,
set_aside = EXCLUDED.set_aside,
set_aside_code = EXCLUDED.set_aside_code,
contract_vehicle = EXCLUDED.contract_vehicle,
estimated_value = EXCLUDED.estimated_value,
value_source = EXCLUDED.value_source,
incumbent_name = EXCLUDED.incumbent_name,
incumbent_uei = EXCLUDED.incumbent_uei,
posted_date = EXCLUDED.posted_date,
response_deadline = EXCLUDED.response_deadline,
award_date = EXCLUDED.award_date,
estimated_award_date = EXCLUDED.estimated_award_date,
pop_start_date = EXCLUDED.pop_start_date,
pop_end_date = EXCLUDED.pop_end_date,
ui_link = EXCLUDED.ui_link,
is_planning = EXCLUDED.is_planning,
raw_object_key = EXCLUDED.raw_object_key,
raw_sha256 = EXCLUDED.raw_sha256,
fetched_at = EXCLUDED.fetched_at,
synced_at = now()
`
type UpsertOpportunityRecordParams struct {
SourceName string `json:"source_name"`
SourceRecordID string `json:"source_record_id"`
DedupeKey string `json:"dedupe_key"`
RecordKind string `json:"record_kind"`
Title string `json:"title"`
Agency string `json:"agency"`
SubAgency string `json:"sub_agency"`
Naics string `json:"naics"`
Psc string `json:"psc"`
PopCity string `json:"pop_city"`
PopState string `json:"pop_state"`
PopCountry string `json:"pop_country"`
PopZip string `json:"pop_zip"`
SetAside string `json:"set_aside"`
SetAsideCode string `json:"set_aside_code"`
ContractVehicle string `json:"contract_vehicle"`
EstimatedValue *decimal.Decimal `json:"estimated_value"`
ValueSource string `json:"value_source"`
IncumbentName string `json:"incumbent_name"`
IncumbentUei string `json:"incumbent_uei"`
PostedDate pgtype.Date `json:"posted_date"`
ResponseDeadline *time.Time `json:"response_deadline"`
AwardDate pgtype.Date `json:"award_date"`
EstimatedAwardDate pgtype.Date `json:"estimated_award_date"`
PopStartDate pgtype.Date `json:"pop_start_date"`
PopEndDate pgtype.Date `json:"pop_end_date"`
UiLink string `json:"ui_link"`
IsPlanning bool `json:"is_planning"`
RawObjectKey string `json:"raw_object_key"`
RawSha256 string `json:"raw_sha256"`
FetchedAt time.Time `json:"fetched_at"`
}
// Opportunity Intelligence unified records. Global public catalog (no organization_id, outside RLS):
// reads run straight off the pool, writes come from cmd/opp-sync as the migrator role.
func (q *Queries) UpsertOpportunityRecord(ctx context.Context, arg UpsertOpportunityRecordParams) error {
_, err := q.db.Exec(ctx, upsertOpportunityRecord,
arg.SourceName,
arg.SourceRecordID,
arg.DedupeKey,
arg.RecordKind,
arg.Title,
arg.Agency,
arg.SubAgency,
arg.Naics,
arg.Psc,
arg.PopCity,
arg.PopState,
arg.PopCountry,
arg.PopZip,
arg.SetAside,
arg.SetAsideCode,
arg.ContractVehicle,
arg.EstimatedValue,
arg.ValueSource,
arg.IncumbentName,
arg.IncumbentUei,
arg.PostedDate,
arg.ResponseDeadline,
arg.AwardDate,
arg.EstimatedAwardDate,
arg.PopStartDate,
arg.PopEndDate,
arg.UiLink,
arg.IsPlanning,
arg.RawObjectKey,
arg.RawSha256,
arg.FetchedAt,
)
return err
}