Recovered source transcript
1// Code generated by sqlc. DO NOT EDIT.
2// versions:
3// sqlc v1.31.1
4
5package dbgen
6
7import (
8 "context"
9
10 "github.com/google/uuid"
11)
12
13type Querier interface {
14 AddCandidateCertification(ctx context.Context, arg AddCandidateCertificationParams) error
15 AddCandidateCustomerExperience(ctx context.Context, arg AddCandidateCustomerExperienceParams) error
16 AddCandidateSkill(ctx context.Context, arg AddCandidateSkillParams) error
17 AddRequiredCertification(ctx context.Context, arg AddRequiredCertificationParams) error
18 AddRequiredSkill(ctx context.Context, arg AddRequiredSkillParams) error
19 AddSlateMember(ctx context.Context, arg AddSlateMemberParams) (SlateMember, error)
20 // Right to erasure as anonymize in place: wipe the identifying PII while KEEPING the row so the de
21 // identified scored outcomes (slate_members) and the demographic bucket survive for the adverse impact
22 // record. Once the name, email, contact, and resume vector are gone the row is no longer personal data,
23 // so erasure is satisfied and the compliance history is preserved. Idempotent on anonymized_at.
24 AnonymizeCandidate(ctx context.Context, id uuid.UUID) (int64, error)
25 AwardsSyncMeta(ctx context.Context) (AwardsSyncMetaRow, error)
26 CreateCandidate(ctx context.Context, arg CreateCandidateParams) (Candidate, error)
27 CreateOpportunity(ctx context.Context, arg CreateOpportunityParams) (Opportunity, error)
28 CreateRequirement(ctx context.Context, arg CreateRequirementParams) (Requirement, error)
29 CreateSlate(ctx context.Context, arg CreateSlateParams) (Slate, error)
30 CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
31 DeleteExternalCandidate(ctx context.Context, id uuid.UUID) (int64, error)
32 // Erasure must also remove slate placements of the sourced person; slate_members has no ON DELETE rule
33 // so the candidate delete would otherwise fail. RLS scopes this to the caller's org.
34 DeleteSlateMembersForCandidate(ctx context.Context, candidateID uuid.UUID) error
35 DetachSourcingLog(ctx context.Context, candidateID *uuid.UUID) error
36 // Identity resolution blocking key 1: an exact (case insensitive) email match in the same org. Email is
37 // the strongest identity signal, so a sourced lead with a known email merges into the existing person.
38 FindCandidateByEmail(ctx context.Context, arg FindCandidateByEmailParams) (uuid.UUID, error)
39 // Identity resolution blocking key 2: same normalized full name AND same normalized location in the org.
40 // Name alone is too weak (two John Smiths); name plus location is a defensible second signal. The caller
41 // only invokes this with a non empty location.
42 FindCandidateByNameLocation(ctx context.Context, arg FindCandidateByNameLocationParams) (uuid.UUID, error)
43 GetCandidate(ctx context.Context, id uuid.UUID) (Candidate, error)
44 GetOpportunity(ctx context.Context, id uuid.UUID) (Opportunity, error)
45 GetOpportunityRecord(ctx context.Context, id uuid.UUID) (OpportunityRecord, error)
46 GetOrganization(ctx context.Context, id uuid.UUID) (Organization, error)
47 GetRequirement(ctx context.Context, id uuid.UUID) (Requirement, error)
48 GetSamOpportunity(ctx context.Context, noticeID string) (SamOpportunity, error)
49 GetSkillByName(ctx context.Context, name string) (Skill, error)
50 GetSlate(ctx context.Context, id uuid.UUID) (Slate, error)
51 // PK tiebreaker => total order [review SQLC-5]
52 // The frozen decision record for one member: the full per component trace, rationale, and gap summary
53 // for the audit and candidate facing explanation.
54 GetSlateMember(ctx context.Context, arg GetSlateMemberParams) (SlateMember, error)
55 GetUser(ctx context.Context, id uuid.UUID) (User, error)
56 GetUserByEmail(ctx context.Context, lower string) (User, error)
57 // audit_logs is append-only (enforced by trigger); only INSERT/SELECT are granted.
58 InsertAuditLog(ctx context.Context, arg InsertAuditLogParams) (InsertAuditLogRow, error)
59 InsertCandidateNotice(ctx context.Context, arg InsertCandidateNoticeParams) (AedtCandidateNotice, error)
60 InsertSourcingLog(ctx context.Context, arg InsertSourcingLogParams) error
61 // Identity resolution merge: link a sourced lead to an existing candidate. Sets the external id and
62 // backfills headline and years ONLY where the existing row is empty or lower, never clobbering curated
63 // bench data. Source is intentionally left unchanged so a verified bench person stays a bench person.
64 LinkSourcedCandidate(ctx context.Context, arg LinkSourcedCandidateParams) error
65 ListAedtInventory(ctx context.Context) ([]AedtInventory, error)
66 // audit_logs has NO RLS policy by design. Bind the read to the validated session GUC (NOT a
67 // caller supplied org param) so it inherits the same fail closed default deny as every RLS table,
68 // a missing or wrong org can no longer leak another tenant's trail. Run inside RunInTenantTx so the GUC
69 // is set [review AUDIT-2/RLS-3].
70 ListAuditLogsForOrg(ctx context.Context, arg ListAuditLogsForOrgParams) ([]AuditLog, error)
71 // Incumbents and similar awards for a NAICS, largest first (excludes Galapagos own awards).
72 ListAwardsByNaics(ctx context.Context, arg ListAwardsByNaicsParams) ([]UsaspendingAward, error)
73 ListBlsWages(ctx context.Context) ([]BlsWage, error)
74 ListCandidateCertifications(ctx context.Context, candidateID uuid.UUID) ([]string, error)
75 ListCandidateCustomerExperience(ctx context.Context, candidateID uuid.UUID) ([]string, error)
76 ListCandidateSkills(ctx context.Context, candidateID uuid.UUID) ([]ListCandidateSkillsRow, error)
77 // id is a unique trailing sort key so created_at ties give a total order and stable LIMIT/OFFSET paging.
78 ListCandidates(ctx context.Context, arg ListCandidatesParams) ([]Candidate, error)
79 // Available (staffable) candidates first, most recently updated next, so the workforce intelligence
80 // surface leads with the talent you can deploy and newly staffed or sourced people are always scored.
81 // The trailing id makes the order total, so the same set is selected before the LIMIT cut every run.
82 ListCandidatesForIntel(ctx context.Context, limit int32) ([]Candidate, error)
83 // id is the unique trailing sort key so created_at ties leave a total order and the LIMIT cut is stable.
84 ListExternalCandidates(ctx context.Context, limit int32) ([]ListExternalCandidatesRow, error)
85 // Galapagos own past performance, largest first.
86 ListGalapagosAwards(ctx context.Context, lim int32) ([]UsaspendingAward, error)
87 // AEDT governance: model version registry, the org AEDT inventory, candidate notices, and the
88 // retention sweep. All on the app pool under RLS (the eeo schema is reached only by the compliance
89 // pool, never here).
90 ListModelVersions(ctx context.Context) ([]AedtModelVersion, error)
91 // Only requirements whose opportunity is open, plus standalone requirements (NULL opportunity_id),
92 // mirroring the Command Center predicate (o.id IS NULL OR o.status='open'). The LEFT JOIN selects r.*
93 // so the row type stays Requirement. Used by the Opportunity Fit Engine, which scores only OPEN ones.
94 ListOpenRequirements(ctx context.Context, arg ListOpenRequirementsParams) ([]Requirement, error)
95 ListOpportunities(ctx context.Context, arg ListOpportunitiesParams) ([]Opportunity, error)
96 // Optional filters (NULL array = no filter). Soonest closing first, then most recently posted, then id
97 // as a unique tiebreaker so the order is deterministic. Text equality filters compare upper() on both
98 // sides; the service upper cases the params so casing drift cannot silently zero out results.
99 ListOpportunityRecords(ctx context.Context, arg ListOpportunityRecordsParams) ([]OpportunityRecord, error)
100 ListRequiredCertifications(ctx context.Context, requirementID uuid.UUID) ([]string, error)
101 ListRequiredSkills(ctx context.Context, requirementID uuid.UUID) ([]ListRequiredSkillsRow, error)
102 // id is a unique trailing sort key so the order is total: ties on created_at no longer leave the
103 // LIMIT/OFFSET cut and the downstream Best Fit pick nondeterministic.
104 ListRequirements(ctx context.Context, arg ListRequirementsParams) ([]Requirement, error)
105 ListRequirementsForOpportunity(ctx context.Context, opportunityID *uuid.UUID) ([]Requirement, error)
106 // All filters are optional (NULL array / NULL scalar = "no filter"). active_only defaults true at the
107 // handler. Soonest-closing first, then most-recently-posted.
108 // Text equality filters are case-insensitive (upper() both sides; the service upper-cases the params)
109 // so casing drift from SAM's path text can't silently zero out results [review COR-3]. The title search
110 // is a literal substring (position()), NOT a LIKE pattern, so q's %/_/\ are matched literally and a
111 // trailing backslash can't 500 the request [review COR-1]. Past-deadline / null-deadline notices sort
112 // to the bottom so the feed leads with what's still open [review COR-2].
113 ListSamOpportunities(ctx context.Context, arg ListSamOpportunitiesParams) ([]SamOpportunity, error)
114 ListSkills(ctx context.Context, arg ListSkillsParams) ([]Skill, error)
115 ListSlateMembers(ctx context.Context, slateID uuid.UUID) ([]SlateMember, error)
116 ListSlatesForRequirement(ctx context.Context, requirementID uuid.UUID) ([]Slate, error)
117 // id is the unique trailing sort key so collected_at ties leave a total order and the LIMIT cut is stable.
118 ListSourcingLog(ctx context.Context, limit int32) ([]ListSourcingLogRow, error)
119 // Platform/security events with NO org (e.g. failed logins before org resolution). Privileged read
120 // path only, never the per-tenant app path, so these events are not a black hole [review AUDIT-3].
121 ListSystemAuditLogs(ctx context.Context, arg ListSystemAuditLogsParams) ([]AuditLog, error)
122 ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
123 OpportunityRecordMeta(ctx context.Context) (OpportunityRecordMetaRow, error)
124 // Band/decision rollup across every slate member under one opportunity's requirements, the source
125 // for GET /proposal-readiness [review COMPL-2]. RLS scopes all three tables to the caller's org.
126 ProposalReadiness(ctx context.Context, opportunityID *uuid.UUID) ([]ProposalReadinessRow, error)
127 // Candidates whose most recent recorded decision is older than the retention window and whose PII is
128 // not yet anonymized. The de identified slate_members outcomes are retained; only the candidate PII is
129 // wiped (by AnonymizeCandidate). RLS scopes this to the caller's org.
130 RetentionDueCandidates(ctx context.Context, dollar_1 int32) ([]uuid.UUID, error)
131 SamSyncMeta(ctx context.Context) (SamSyncMetaRow, error)
132 // Hybrid retrieval: pgvector cosine kNN fused with full-text rank via Reciprocal Rank Fusion (k=60).
133 // RLS already scopes both legs to the caller's org. $1=query embedding, $2=limit, $3=text query.
134 // Every ORDER BY carries a unique tiebreaker (id) so results are byte-stable for fixed inputs, the
135 // AEDT reproducibility mandate [review SQLC-2/PGV-1/PGV-2]. Caller SETs LOCAL hnsw.ef_search first.
136 SearchCandidatesHybrid(ctx context.Context, arg SearchCandidatesHybridParams) ([]SearchCandidatesHybridRow, error)
137 // Cosine nearest-neighbor over the skills ontology (powers semantic skill adjacency).
138 SearchSkillsSemantic(ctx context.Context, arg SearchSkillsSemanticParams) ([]SearchSkillsSemanticRow, error)
139 // An org FSO records HOW a candidate's clearance is known. RLS scopes this to the caller's own org.
140 // verified_at is the date the FSO confirmed it; it is NULL for a self reported indicator. The platform
141 // never verifies a clearance itself, it records the org's authoritative assertion.
142 SetCandidateClearanceProvenance(ctx context.Context, arg SetCandidateClearanceProvenanceParams) (int64, error)
143 // Human-in-the-loop: a person approves/rejects each member. Never auto-decided.
144 SetSlateMemberDecision(ctx context.Context, arg SetSlateMemberDecisionParams) (SlateMember, error)
145 SoftDeleteCandidate(ctx context.Context, id uuid.UUID) error
146 TouchUserLogin(ctx context.Context, id uuid.UUID) error
147 UpdateSlateStatus(ctx context.Context, arg UpdateSlateStatusParams) (Slate, error)
148 UpsertAedtInventory(ctx context.Context, arg UpsertAedtInventoryParams) (AedtInventory, error)
149 // USASpending awards cache. Global public catalog (no organization_id, outside RLS): reads run off
150 // the pool, writes come from the daily sync (cmd/awards-sync) as the migrator role.
151 UpsertAward(ctx context.Context, arg UpsertAwardParams) error
152 // BLS OEWS wage baseline cache. Global public catalog (no organization_id, outside RLS): reads run
153 // off the pool, writes come from the weekly rates sync (cmd/rates-sync) as the migrator role.
154 UpsertBlsWage(ctx context.Context, arg UpsertBlsWageParams) error
155 // External candidate sourcing. The import command (cmd/import-candidates) writes as the migrator role
156 // with an explicit organization_id; the delete path runs as the app role inside a tenant tx (RLS).
157 UpsertExternalCandidate(ctx context.Context, arg UpsertExternalCandidateParams) (uuid.UUID, error)
158 // Opportunity Intelligence unified records. Global public catalog (no organization_id, outside RLS):
159 // reads run straight off the pool, writes come from cmd/opp-sync as the migrator role.
160 UpsertOpportunityRecord(ctx context.Context, arg UpsertOpportunityRecordParams) error
161 // SAM.gov opportunities cache. Global public catalog (no organization_id, outside RLS): reads run
162 // straight off the pool, writes come from the daily sync (cmd/sam-sync) as the migrator role.
163 UpsertSamOpportunity(ctx context.Context, arg UpsertSamOpportunityParams) error
164 // COALESCE keeps an existing category or embedding when a caller upserts by name only (for example the
165 // ingest and mission check paths that pass just a skill name), so a later name only upsert never nulls a
166 // category that was set before and an embedding can still be backfilled once it is supplied.
167 UpsertSkill(ctx context.Context, arg UpsertSkillParams) (Skill, error)
168 WagesSyncMeta(ctx context.Context) (WagesSyncMetaRow, error)
169}
170
171var _ Querier = (*Queries)(nil)
172