ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/wages/service.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/modules/wages/service.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/modules/wages/service.go
Original SHA-256c5b32d5d1b1bf2594393a99e0265ef20ef36a694d4e8a2af0c25cfda7fd83b5a
Git blob SHAe75b2959bf33b5c78ff6e8ee2eb739d9ac2d7753
Reading-copy SHA-256c5b32d5d1b1bf2594393a99e0265ef20ef36a694d4e8a2af0c25cfda7fd83b5a

Original source ↗

Every recorded occurrence

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

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/modules/wages/service.gofeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / internal/modules/wages/service.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original

Recovered source transcript

package wages import ( "context" "errors" "time" "github.com/missionworkforce/missionmatch/internal/platform/database/dbgen" "github.com/missionworkforce/missionmatch/internal/platform/tenant" ) // ErrNoDatabase is returned when no pool is configured. var ErrNoDatabase = errors.New("wages: no database configured") // Service reads the cached BLS wage baseline. type Service struct{ db *tenant.DB } // NewService builds the service. db may be nil (then calls return ErrNoDatabase). func NewService(db *tenant.DB) *Service { return &Service{db: db} } // Baseline returns the wage baseline grouped by occupation, each with its Hawaii and New Mexico // annual mean and median wages. func (s *Service) Baseline(ctx context.Context) ([]WageBaseline, error) { if !s.db.Ready() { return nil, ErrNoDatabase } pool, release, perr := s.acquirePool(ctx) if perr != nil { return nil, perr } defer release() rows, err := dbgen.New(pool).ListBlsWages(ctx) if err != nil { return nil, err } order := []string{} // preserve first seen occupation order byOcc := map[string]*WageBaseline{} // occupation_code to baseline areaIdx := map[string]map[string]int{} // occupation_code to area to index in Areas syncedAt := time.Time{} for _, r := range rows { wb, ok := byOcc[r.OccupationCode] if !ok { wb = &WageBaseline{ OccupationCode: r.OccupationCode, OccupationTitle: r.OccupationTitle, Role: r.Role, Year: r.PeriodYear, Source: "BLS OEWS", } byOcc[r.OccupationCode] = wb areaIdx[r.OccupationCode] = map[string]int{} order = append(order, r.OccupationCode) } ai, ok := areaIdx[r.OccupationCode][r.Area] if !ok { wb.Areas = append(wb.Areas, AreaWage{Area: r.Area, AreaName: r.AreaName}) ai = len(wb.Areas) - 1 areaIdx[r.OccupationCode][r.Area] = ai } val := "" if r.Value != nil { val = r.Value.StringFixed(0) } switch r.Metric { case "annual_mean": wb.Areas[ai].AnnualMean = val case "annual_median": wb.Areas[ai].AnnualMedian = val } if r.SyncedAt.After(syncedAt) { syncedAt = r.SyncedAt } } out := make([]WageBaseline, 0, len(order)) for _, code := range order { wb := byOcc[code] if !syncedAt.IsZero() { wb.SyncedAt = syncedAt.Format(time.RFC3339) } out = append(out, *wb) } return out, nil }

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