Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 09015496d565a172bcaa15cfe9a8e4b072b13df0 |
| Branch | workstream-b-screenmatch |
| Path or archive member | internal/platform/database/dbgen/opportunities.sql.go |
| Original SHA-256 | 9dab6b0ac9935e4b6db4d84982f2c792b18b92aeb1dc81813ff17f6f8fbdebcb |
| Git blob SHA | 81813105e8b96fc1cd8b485fc185b7c9344278be |
| Reading-copy SHA-256 | 9dab6b0ac9935e4b6db4d84982f2c792b18b92aeb1dc81813ff17f6f8fbdebcb |
Every recorded occurrence
These 25 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/opportunities.sql.go | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ws2-alias-relationship | e4dada4601c6eb101830f9d223a9655dfa120616 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
Recovered source transcript
Download complete source text ↓201 lines · 5.3 KB
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
// source: opportunities.sql
package dbgen
import (
"context"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgtype"
)
const createOpportunity = `-- name: CreateOpportunity :one
INSERT INTO opportunities (organization_id, name, solicitation_number, customer_agency, due_date, status)
VALUES ($1,$2,$3,$4,$5,$6)
RETURNING id, organization_id, name, solicitation_number, customer_agency, due_date, status, created_at, updated_at, value, value_source, federal_ref
`
type CreateOpportunityParams struct {
OrganizationID uuid.UUID `json:"organization_id"`
Name string `json:"name"`
SolicitationNumber *string `json:"solicitation_number"`
CustomerAgency *string `json:"customer_agency"`
DueDate pgtype.Date `json:"due_date"`
Status string `json:"status"`
}
func (q *Queries) CreateOpportunity(ctx context.Context, arg CreateOpportunityParams) (Opportunity, error) {
row := q.db.QueryRow(ctx, createOpportunity,
arg.OrganizationID,
arg.Name,
arg.SolicitationNumber,
arg.CustomerAgency,
arg.DueDate,
arg.Status,
)
var i Opportunity
err := row.Scan(
&i.ID,
&i.OrganizationID,
&i.Name,
&i.SolicitationNumber,
&i.CustomerAgency,
&i.DueDate,
&i.Status,
&i.CreatedAt,
&i.UpdatedAt,
&i.Value,
&i.ValueSource,
&i.FederalRef,
)
return i, err
}
const getOpportunity = `-- name: GetOpportunity :one
SELECT id, organization_id, name, solicitation_number, customer_agency, due_date, status, created_at, updated_at, value, value_source, federal_ref FROM opportunities WHERE id = $1
`
func (q *Queries) GetOpportunity(ctx context.Context, id uuid.UUID) (Opportunity, error) {
row := q.db.QueryRow(ctx, getOpportunity, id)
var i Opportunity
err := row.Scan(
&i.ID,
&i.OrganizationID,
&i.Name,
&i.SolicitationNumber,
&i.CustomerAgency,
&i.DueDate,
&i.Status,
&i.CreatedAt,
&i.UpdatedAt,
&i.Value,
&i.ValueSource,
&i.FederalRef,
)
return i, err
}
const listOpportunities = `-- name: ListOpportunities :many
SELECT id, organization_id, name, solicitation_number, customer_agency, due_date, status, created_at, updated_at, value, value_source, federal_ref FROM opportunities ORDER BY created_at DESC, id DESC LIMIT $1 OFFSET $2
`
type ListOpportunitiesParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
func (q *Queries) ListOpportunities(ctx context.Context, arg ListOpportunitiesParams) ([]Opportunity, error) {
rows, err := q.db.Query(ctx, listOpportunities, arg.Limit, arg.Offset)
if err != nil {
return nil, err
}
defer rows.Close()
items := []Opportunity{}
for rows.Next() {
var i Opportunity
if err := rows.Scan(
&i.ID,
&i.OrganizationID,
&i.Name,
&i.SolicitationNumber,
&i.CustomerAgency,
&i.DueDate,
&i.Status,
&i.CreatedAt,
&i.UpdatedAt,
&i.Value,
&i.ValueSource,
&i.FederalRef,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listRequirementsForOpportunity = `-- name: ListRequirementsForOpportunity :many
SELECT id, organization_id, opportunity_id, title, customer_agency, required_level, required_poly, required_years, work_location, remote_allowed, key_personnel, created_at, updated_at, deleted_at, labor_category, quantity FROM requirements WHERE opportunity_id = $1 AND deleted_at IS NULL ORDER BY created_at DESC, id DESC
`
func (q *Queries) ListRequirementsForOpportunity(ctx context.Context, opportunityID *uuid.UUID) ([]Requirement, error) {
rows, err := q.db.Query(ctx, listRequirementsForOpportunity, opportunityID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []Requirement{}
for rows.Next() {
var i Requirement
if err := rows.Scan(
&i.ID,
&i.OrganizationID,
&i.OpportunityID,
&i.Title,
&i.CustomerAgency,
&i.RequiredLevel,
&i.RequiredPoly,
&i.RequiredYears,
&i.WorkLocation,
&i.RemoteAllowed,
&i.KeyPersonnel,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.LaborCategory,
&i.Quantity,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const proposalReadiness = `-- name: ProposalReadiness :many
SELECT sm.band, sm.decision, COUNT(*) AS n
FROM requirements r
JOIN slates s ON s.requirement_id = r.id
JOIN slate_members sm ON sm.slate_id = s.id
WHERE r.opportunity_id = $1
GROUP BY sm.band, sm.decision
ORDER BY sm.band, sm.decision
`
type ProposalReadinessRow struct {
Band string `json:"band"`
Decision string `json:"decision"`
N int64 `json:"n"`
}
// Band/decision rollup across every slate member under one opportunity's requirements, the source
// for GET /proposal-readiness [review COMPL-2]. RLS scopes all three tables to the caller's org.
func (q *Queries) ProposalReadiness(ctx context.Context, opportunityID *uuid.UUID) ([]ProposalReadinessRow, error) {
rows, err := q.db.Query(ctx, proposalReadiness, opportunityID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []ProposalReadinessRow{}
for rows.Next() {
var i ProposalReadinessRow
if err := rows.Scan(&i.Band, &i.Decision, &i.N); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}