Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/modules/commandcenter/service_federal_signal_test.go |
| Original SHA-256 | da475707c7329baa7082b680cbe31fb95cb93d491e583dcac31e4d14b7d82726 |
| Git blob SHA | 84b7ce7720852a00f8ea4afddedfc8c6ac887018 |
| Reading-copy SHA-256 | da475707c7329baa7082b680cbe31fb95cb93d491e583dcac31e4d14b7d82726 |
Every recorded occurrence
These 15 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/commandcenter/service_federal_signal_test.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | m5-price-to-win | 41000ad30fff4129fdaf5ec84e15ba14c27d4890 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | ws8-teaching-loop | c823f0fb6bb2aba0f39001eb6de96f4000d9321f | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | mag-substrate | b82c7100a492dec67dfd1eda6b3f53def859be35 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | graphrag-foundation | b0ddeb9f633fd138d09309d1a17b7d13bc3a67f7 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | ws9-bench-ingestion | f585a9ef32fa554663ce1fba9a414a54b6e49cf0 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | ws7-federal-signal | 6a9f6ce9cfb13345ffb47770d4960e7c2d9c17c2 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / internal/modules/commandcenter/service_federal_signal_test.go | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓93 lines · 3.6 KB
package commandcenter
import (
"testing"
"time"
"github.com/jackc/pgx/v5/pgtype"
"github.com/shopspring/decimal"
"github.com/missionworkforce/missionmatch/internal/platform/database/dbgen"
"github.com/missionworkforce/missionmatch/internal/platform/missionclass"
)
func dateVal(s string) pgtype.Date {
t, _ := time.Parse("2006-01-02", s)
return pgtype.Date{Time: t, Valid: true}
}
func amt(s string) *decimal.Decimal {
d := decimal.RequireFromString(s)
return &d
}
// TestGroupIncumbentMix proves the pure grouping folds the flat (award, role) rows into one entry per
// award, preserves the query's pop_end_date ordering, carries the evidence on every role, and renders the
// award value at two decimal places. The query already sorts by award id within a pop_end_date, so the
// grouping is a single ordered pass.
func TestGroupIncumbentMix(t *testing.T) {
rows := []dbgen.ListIncumbentRolesByRecompeteRow{
{RecordID: "AWD-1", RecipientName: "Acme Defense", AwardingAgency: "DoD", NaicsCode: "541512",
AwardAmount: amt("1000000"), PopEndDate: dateVal("2026-09-30"),
LaborCategory: "SIGINT Analyst", RoleCount: 3, Evidence: "SIGINT Analyst x3"},
{RecordID: "AWD-1", RecipientName: "Acme Defense", AwardingAgency: "DoD", NaicsCode: "541512",
AwardAmount: amt("1000000"), PopEndDate: dateVal("2026-09-30"),
LaborCategory: "Systems Engineer", RoleCount: 2, Evidence: "Systems Engineer x2"},
{RecordID: "AWD-2", RecipientName: "Beta Corp", AwardingAgency: "USAF", NaicsCode: "541330",
AwardAmount: nil, PopEndDate: dateVal("2026-12-31"),
LaborCategory: "COMSEC Custodian", RoleCount: 1, Evidence: "COMSEC Custodian"},
}
got := groupIncumbentMix(rows)
if len(got) != 2 {
t.Fatalf("expected 2 grouped awards, got %d", len(got))
}
if got[0].RecordID != "AWD-1" || got[1].RecordID != "AWD-2" {
t.Fatalf("award order not preserved: %q then %q", got[0].RecordID, got[1].RecordID)
}
if len(got[0].Roles) != 2 {
t.Fatalf("AWD-1 should carry 2 roles, got %d", len(got[0].Roles))
}
if got[0].Roles[0].LaborCategory != "SIGINT Analyst" || got[0].Roles[0].RoleCount != 3 ||
got[0].Roles[0].Evidence != "SIGINT Analyst x3" {
t.Fatalf("AWD-1 first role wrong: %+v", got[0].Roles[0])
}
if got[0].AwardValue == nil || *got[0].AwardValue != "1000000.00" {
t.Fatalf("AWD-1 value not rendered at two decimals: %v", got[0].AwardValue)
}
if got[0].PopEndDate != "2026-09-30" {
t.Fatalf("AWD-1 pop_end_date wrong: %q", got[0].PopEndDate)
}
if got[1].AwardValue != nil {
t.Fatalf("AWD-2 has a null award amount, value should stay nil, got %v", *got[1].AwardValue)
}
if len(got[1].Roles) != 1 || got[1].Roles[0].Evidence != "COMSEC Custodian" {
t.Fatalf("AWD-2 role wrong: %+v", got[1].Roles)
}
}
// TestGroupIncumbentMixEmpty proves the grouping returns a non nil empty slice so the JSON renders [].
func TestGroupIncumbentMixEmpty(t *testing.T) {
got := groupIncumbentMix(nil)
if got == nil {
t.Fatal("groupIncumbentMix(nil) returned nil, want an empty non nil slice")
}
if len(got) != 0 {
t.Fatalf("expected 0 awards, got %d", len(got))
}
}
// TestValidMissionCode pins the panel mission filter to the shared controlled vocabulary so an unknown
// code is rejected rather than silently running an empty filter, and every real code is accepted.
func TestValidMissionCode(t *testing.T) {
for _, c := range missionclass.Codes {
if !validMissionCode(c) {
t.Fatalf("controlled code %q rejected by validMissionCode", c)
}
}
for _, bad := range []string{"", "NOPE", "sigint", "SIGINT ", "EWX"} {
if validMissionCode(bad) {
t.Fatalf("invalid code %q accepted by validMissionCode", bad)
}
}
}