ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision1675031db74316e100782d063e9eda1a597fe3a1
Branchworkstream-a-opportunity-intelligence
Path or archive memberinternal/platform/database/dbgen/opportunities.sql.go
Original SHA-256618c0da5f389cf18f6ff0ca6e04edf48e55b7b22338c872e0bc1015e93100d09
Git blob SHAe209f3ebeb70ad1a757a4b5314e3866c2894dd5e
Reading-copy SHA-256618c0da5f389cf18f6ff0ca6e04edf48e55b7b22338c872e0bc1015e93100d09

Original source ↗

Every recorded occurrence

These 7 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.goworkstream-a-opportunity-intelligence1675031db74316e100782d063e9eda1a597fe3a1Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.goworkstream-d-command-center255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.goworkstream-e-commercial-stubs4437da660539284a400ee380b9b427a300c369eeOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.goworkstream-b-sam-contract-awardsd5101cceb98e70000cebb31d3e7ac73d747d3a6dOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.goworkstream-d-command-center255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.goworkstream-a-opportunity-intelligence1675031db74316e100782d063e9eda1a597fe3a1Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunities.sql.goworkstream-e-commercial-stubs4437da660539284a400ee380b9b427a300c369eeOpen original

Recovered source transcript

// 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 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 ` 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 }

Search equations, builds, manuscript text, and recovered sources.