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 | 09015496d565a172bcaa15cfe9a8e4b072b13df0 |
| Branch | workstream-b-screenmatch |
| Path or archive member | internal/platform/database/dbgen/requirements.sql.go |
| Original SHA-256 | 578d560995e7e934614831d7eefba81b2d9519219c99de2b53825eeccb699708 |
| Git blob SHA | ca0bf586f47b54a5cf5ecfec8070e9000cae83de |
| Reading-copy SHA-256 | 578d560995e7e934614831d7eefba81b2d9519219c99de2b53825eeccb699708 |
Every recorded occurrence
These 33 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 | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-a-opportunity-intelligence | 1675031db74316e100782d063e9eda1a597fe3a1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-d-command-center | 255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-e-commercial-stubs | 4437da660539284a400ee380b9b427a300c369ee | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-b-sam-contract-awards | d5101cceb98e70000cebb31d3e7ac73d747d3a6d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws2-alias-relationship | e4dada4601c6eb101830f9d223a9655dfa120616 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-d-command-center | 255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-a-opportunity-intelligence | 1675031db74316e100782d063e9eda1a597fe3a1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-e-commercial-stubs | 4437da660539284a400ee380b9b427a300c369ee | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/requirements.sql.go | workstream-b-sam-contract-awards | d5101cceb98e70000cebb31d3e7ac73d747d3a6d | Open original |
Recovered source transcript
Download complete source text ↓302 lines · 8.6 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
`
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,
)
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 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,
)
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 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,
); 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 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,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}