Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/platform/database/dbgen/requirements.sql.go |
| Original SHA-256 | 65f4000c318a2240c5f7c9df043fa68a8ff989cf83b28cee5c621d73a46385d1 |
| Git blob SHA | 4b3052c5e84e1657101057fa4413f3e5256f7d04 |
| Reading-copy SHA-256 | 65f4000c318a2240c5f7c9df043fa68a8ff989cf83b28cee5c621d73a46385d1 |
Every recorded occurrence
These 18 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/requirements.sql.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws6-retrieval | 6c56e29231ec05735927fa265c97d517499dfeaf | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | m5-price-to-win | 41000ad30fff4129fdaf5ec84e15ba14c27d4890 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws8-teaching-loop | c823f0fb6bb2aba0f39001eb6de96f4000d9321f | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | mag-substrate | b82c7100a492dec67dfd1eda6b3f53def859be35 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws3-clearance | 4b8e7ce594c068621867f9c9deed0ec64ae6c553 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | phase2-eval-fairness | d361af254701975fe239927656ababb56374655e | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | graphrag-foundation | b0ddeb9f633fd138d09309d1a17b7d13bc3a67f7 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws9-bench-ingestion | f585a9ef32fa554663ce1fba9a414a54b6e49cf0 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws7-federal-signal | 6a9f6ce9cfb13345ffb47770d4960e7c2d9c17c2 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓306 lines · 8.8 KB
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
// source: requirements.sql
package dbgen
import (
"context"
"github.com/google/uuid"
)
const addRequiredCertification = `-- name: AddRequiredCertification :exec
INSERT INTO required_certifications (organization_id, requirement_id, name)
VALUES ($1,$2,$3)
ON CONFLICT (requirement_id, name) DO NOTHING
`
type AddRequiredCertificationParams struct {
OrganizationID uuid.UUID `json:"organization_id"`
RequirementID uuid.UUID `json:"requirement_id"`
Name string `json:"name"`
}
func (q *Queries) AddRequiredCertification(ctx context.Context, arg AddRequiredCertificationParams) error {
_, err := q.db.Exec(ctx, addRequiredCertification, arg.OrganizationID, arg.RequirementID, arg.Name)
return err
}
const addRequiredSkill = `-- name: AddRequiredSkill :exec
INSERT INTO required_skills (organization_id, requirement_id, skill_id, mandatory)
VALUES ($1,$2,$3,$4)
ON CONFLICT (requirement_id, skill_id) DO UPDATE SET mandatory = EXCLUDED.mandatory
`
type AddRequiredSkillParams struct {
OrganizationID uuid.UUID `json:"organization_id"`
RequirementID uuid.UUID `json:"requirement_id"`
SkillID uuid.UUID `json:"skill_id"`
Mandatory bool `json:"mandatory"`
}
func (q *Queries) AddRequiredSkill(ctx context.Context, arg AddRequiredSkillParams) error {
_, err := q.db.Exec(ctx, addRequiredSkill,
arg.OrganizationID,
arg.RequirementID,
arg.SkillID,
arg.Mandatory,
)
return err
}
const createRequirement = `-- name: CreateRequirement :one
INSERT INTO requirements (
organization_id, opportunity_id, title, customer_agency,
required_level, required_poly, required_years,
work_location, remote_allowed, key_personnel
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)
RETURNING 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, required_compartments
`
type CreateRequirementParams struct {
OrganizationID uuid.UUID `json:"organization_id"`
OpportunityID *uuid.UUID `json:"opportunity_id"`
Title string `json:"title"`
CustomerAgency *string `json:"customer_agency"`
RequiredLevel string `json:"required_level"`
RequiredPoly string `json:"required_poly"`
RequiredYears int32 `json:"required_years"`
WorkLocation *string `json:"work_location"`
RemoteAllowed bool `json:"remote_allowed"`
KeyPersonnel bool `json:"key_personnel"`
}
func (q *Queries) CreateRequirement(ctx context.Context, arg CreateRequirementParams) (Requirement, error) {
row := q.db.QueryRow(ctx, createRequirement,
arg.OrganizationID,
arg.OpportunityID,
arg.Title,
arg.CustomerAgency,
arg.RequiredLevel,
arg.RequiredPoly,
arg.RequiredYears,
arg.WorkLocation,
arg.RemoteAllowed,
arg.KeyPersonnel,
)
var i Requirement
err := row.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,
&i.RequiredCompartments,
)
return i, err
}
const getRequirement = `-- name: GetRequirement :one
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, required_compartments FROM requirements WHERE id = $1 AND deleted_at IS NULL
`
func (q *Queries) GetRequirement(ctx context.Context, id uuid.UUID) (Requirement, error) {
row := q.db.QueryRow(ctx, getRequirement, id)
var i Requirement
err := row.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,
&i.RequiredCompartments,
)
return i, err
}
const listOpenRequirements = `-- name: ListOpenRequirements :many
SELECT r.id, r.organization_id, r.opportunity_id, r.title, r.customer_agency, r.required_level, r.required_poly, r.required_years, r.work_location, r.remote_allowed, r.key_personnel, r.created_at, r.updated_at, r.deleted_at, r.labor_category, r.quantity, r.required_compartments FROM requirements r
LEFT JOIN opportunities o
ON o.organization_id = r.organization_id AND o.id = r.opportunity_id
WHERE r.deleted_at IS NULL
AND (o.id IS NULL OR o.status = 'open')
ORDER BY r.created_at DESC, r.id DESC
LIMIT $1 OFFSET $2
`
type ListOpenRequirementsParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
// Only requirements whose opportunity is open, plus standalone requirements (NULL opportunity_id),
// mirroring the Command Center predicate (o.id IS NULL OR o.status='open'). The LEFT JOIN selects r.*
// so the row type stays Requirement. Used by the Opportunity Fit Engine, which scores only OPEN ones.
func (q *Queries) ListOpenRequirements(ctx context.Context, arg ListOpenRequirementsParams) ([]Requirement, error) {
rows, err := q.db.Query(ctx, listOpenRequirements, arg.Limit, arg.Offset)
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,
&i.RequiredCompartments,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listRequiredCertifications = `-- name: ListRequiredCertifications :many
SELECT name FROM required_certifications WHERE requirement_id = $1 ORDER BY name
`
func (q *Queries) ListRequiredCertifications(ctx context.Context, requirementID uuid.UUID) ([]string, error) {
rows, err := q.db.Query(ctx, listRequiredCertifications, requirementID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []string{}
for rows.Next() {
var name string
if err := rows.Scan(&name); err != nil {
return nil, err
}
items = append(items, name)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listRequiredSkills = `-- name: ListRequiredSkills :many
SELECT s.id, s.name, rs.mandatory
FROM required_skills rs
JOIN skills s ON s.id = rs.skill_id
WHERE rs.requirement_id = $1
ORDER BY s.name
`
type ListRequiredSkillsRow struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Mandatory bool `json:"mandatory"`
}
func (q *Queries) ListRequiredSkills(ctx context.Context, requirementID uuid.UUID) ([]ListRequiredSkillsRow, error) {
rows, err := q.db.Query(ctx, listRequiredSkills, requirementID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []ListRequiredSkillsRow{}
for rows.Next() {
var i ListRequiredSkillsRow
if err := rows.Scan(&i.ID, &i.Name, &i.Mandatory); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listRequirements = `-- name: ListRequirements :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, required_compartments FROM requirements
WHERE deleted_at IS NULL
ORDER BY created_at DESC, id DESC
LIMIT $1 OFFSET $2
`
type ListRequirementsParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
// id is a unique trailing sort key so the order is total: ties on created_at no longer leave the
// LIMIT/OFFSET cut and the downstream Best Fit pick nondeterministic.
func (q *Queries) ListRequirements(ctx context.Context, arg ListRequirementsParams) ([]Requirement, error) {
rows, err := q.db.Query(ctx, listRequirements, arg.Limit, arg.Offset)
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,
&i.RequiredCompartments,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}