Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/modules/matching/service_test.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 09015496d565a172bcaa15cfe9a8e4b072b13df0 |
| Branch | workstream-b-screenmatch |
| Path or archive member | internal/modules/matching/service_test.go |
| Original SHA-256 | ecf3ce5aa46813815ccd585a4f23565defee237654b65c315dbe74af5644c41c |
| Git blob SHA | d2b5b5d1ae1b35029413f68684524937f0498444 |
| Reading-copy SHA-256 | ecf3ce5aa46813815ccd585a4f23565defee237654b65c315dbe74af5644c41c |
Every recorded occurrence
These 37 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/modules/matching/service_test.go | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-a-opportunity-intelligence | 1675031db74316e100782d063e9eda1a597fe3a1 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-d-command-center | 255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | w0-aedt-compliance | 39df94f92b2a33f852481fe1954dabed841524bb | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-e-commercial-stubs | 4437da660539284a400ee380b9b427a300c369ee | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ws3-clearance | 4b8e7ce594c068621867f9c9deed0ec64ae6c553 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-b-sam-contract-awards | d5101cceb98e70000cebb31d3e7ac73d747d3a6d | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ws2-alias-relationship | e4dada4601c6eb101830f9d223a9655dfa120616 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | per-tenant-routing | 9bde0f9a74b89d01980fa658e5253acda7528d0c | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-a-shared-core | e0de03ac3a1ec826bd15d0e048e3b02baa23eeff | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-c-slatematch | 5cd60c918301b46ecd6ed3e03e20c395da0062e2 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ws1-ontology-sync | b596f449a32a1016fbd403c36505cc00a1ac9ee6 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | w3-ai-staffing-recommendations | 43d56387270ef4da4cabd794d97ca6a49909bc7d | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ws3-clearance | 4b8e7ce594c068621867f9c9deed0ec64ae6c553 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-d-command-center | 255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-e-dataflow-deploy | 433815a042f9741411e60fa553fe72143e9b10db | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ruthless-debug-sweep | b7d742f8f032984be3817efffa3eb8b13b651c1f | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ai-intelligence-layer | 5d5ddff70393a197c5f54a45280bb5dd42b24755 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-a-opportunity-intelligence | 1675031db74316e100782d063e9eda1a597fe3a1 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | deploy-and-ops | bdacd9d0b4d5998d25fc74bf4007f4c3ec538c7a | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-b-screenmatch | 09015496d565a172bcaa15cfe9a8e4b072b13df0 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-e-commercial-stubs | 4437da660539284a400ee380b9b427a300c369ee | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | ai-brain-live | aac32fc49c878cc5bca099459307611562d0bac1 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-d-missionmatch | 3be46ba89edb737182075a2b320509b42dc916f8 | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | workstream-b-sam-contract-awards | d5101cceb98e70000cebb31d3e7ac73d747d3a6d | Open original |
| Janady13/missionmatch / internal/modules/matching/service_test.go | w0-aedt-compliance | 39df94f92b2a33f852481fe1954dabed841524bb | Open original |
Recovered source transcript
Download complete source text ↓106 lines · 4.0 KB
package matching
import (
"context"
"testing"
"time"
"github.com/google/uuid"
"github.com/shopspring/decimal"
"github.com/missionworkforce/missionmatch/internal/platform/database/dbgen"
)
// fakeQ implements just the Querier methods generateSlate touches; the rest panic via the nil embed.
type fakeQ struct {
dbgen.Querier
req dbgen.Requirement
cands []dbgen.Candidate
slateID uuid.UUID
added []dbgen.AddSlateMemberParams
}
func (f *fakeQ) GetRequirement(context.Context, uuid.UUID) (dbgen.Requirement, error) {
return f.req, nil
}
func (f *fakeQ) ListRequiredSkills(context.Context, uuid.UUID) ([]dbgen.ListRequiredSkillsRow, error) {
return nil, nil
}
func (f *fakeQ) ListRequiredCertifications(context.Context, uuid.UUID) ([]string, error) {
return nil, nil
}
func (f *fakeQ) ListCandidates(context.Context, dbgen.ListCandidatesParams) ([]dbgen.Candidate, error) {
return f.cands, nil
}
func (f *fakeQ) ListCandidateSkills(context.Context, uuid.UUID) ([]dbgen.ListCandidateSkillsRow, error) {
return nil, nil
}
func (f *fakeQ) ListCandidateCertifications(context.Context, uuid.UUID) ([]string, error) {
return nil, nil
}
func (f *fakeQ) ListCandidateCustomerExperience(context.Context, uuid.UUID) ([]string, error) {
return nil, nil
}
func (f *fakeQ) CreateSlate(_ context.Context, arg dbgen.CreateSlateParams) (dbgen.Slate, error) {
return dbgen.Slate{ID: f.slateID, OrganizationID: arg.OrganizationID, RequirementID: arg.RequirementID, Name: arg.Name, Status: arg.Status}, nil
}
func (f *fakeQ) AddSlateMember(_ context.Context, arg dbgen.AddSlateMemberParams) (dbgen.SlateMember, error) {
f.added = append(f.added, arg)
return dbgen.SlateMember{}, nil
}
func TestGenerateSlateRanksBandsAndPersists(t *testing.T) {
orgID, reqID := uuid.New(), uuid.New()
// Requirement needs Secret; everything else open.
req := dbgen.Requirement{ID: reqID, RequiredLevel: "secret", RequiredPoly: "none", RequiredYears: 0}
// cA: meets Secret, available -> 100 (green)
// cB: only Confidential (clearance 0) -> 75 (yellow)
// cC: Confidential + NOT available -> 70 (red)
cA := dbgen.Candidate{ID: uuid.New(), OrganizationID: orgID, ClearanceLevel: "secret", ClearancePoly: "none", ClearanceStatus: "active", Available: true}
cB := dbgen.Candidate{ID: uuid.New(), OrganizationID: orgID, ClearanceLevel: "confidential", ClearancePoly: "none", ClearanceStatus: "active", Available: true}
cC := dbgen.Candidate{ID: uuid.New(), OrganizationID: orgID, ClearanceLevel: "confidential", ClearancePoly: "none", ClearanceStatus: "active", Available: false}
f := &fakeQ{req: req, cands: []dbgen.Candidate{cC, cA, cB}, slateID: uuid.New()} // intentionally unsorted
in := GenerateSlateInput{RequirementID: reqID, Name: "Engineer Slate", MaxCandidates: 10}
res, err := generateSlate(context.Background(), f, orgID, in, nil, time.Now())
if err != nil {
t.Fatalf("generateSlate: %v", err)
}
if res.SlateID != f.slateID || len(res.Members) != 3 {
t.Fatalf("unexpected result: %+v", res)
}
want := []struct {
id uuid.UUID
total string
band string
rank int
}{
{cA.ID, "100.00", "green", 1},
{cB.ID, "75.00", "yellow", 2},
{cC.ID, "70.00", "red", 3},
}
for i, w := range want {
m := res.Members[i]
if m.CandidateID != w.id.String() || m.Total != w.total || m.Band != w.band || m.Rank != w.rank {
t.Fatalf("member %d = %+v, want id=%s total=%s band=%s rank=%d", i, m, w.id, w.total, w.band, w.rank)
}
}
// Persisted in rank order, with DB band codes and the perfect 100 fitting numeric(7,4).
if len(f.added) != 3 {
t.Fatalf("want 3 persisted members, got %d", len(f.added))
}
if f.added[0].Band != "green" || f.added[1].Band != "yellow" || f.added[2].Band != "red" {
t.Fatalf("persisted bands wrong: %q %q %q", f.added[0].Band, f.added[1].Band, f.added[2].Band)
}
if !f.added[0].TotalScore.Equal(decimal.NewFromInt(100)) {
t.Fatalf("rank-1 total should be exactly 100, got %s", f.added[0].TotalScore)
}
if *f.added[0].Rank != 1 || *f.added[2].Rank != 3 {
t.Fatalf("persisted ranks wrong")
}
}