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
Revision9bde0f9a74b89d01980fa658e5253acda7528d0c
Branchper-tenant-routing
Path or archive memberinternal/modules/wages/service.go
Original SHA-25678d44e0af591a5e7f982e84fe72ff09e78fe8cc16044580acb267ccec89c8cf3
Git blob SHA17c019d3d75bc6c6ae6d26255124efb62be37306
Reading-copy SHA-25678d44e0af591a5e7f982e84fe72ff09e78fe8cc16044580acb267ccec89c8cf3

Original source ↗

Every recorded occurrence

These 3 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.goper-tenant-routing9bde0f9a74b89d01980fa658e5253acda7528d0cOpen original
Janady13/missionmatch / internal/modules/wages/service.godeploy-and-opsbdacd9d0b4d5998d25fc74bf4007f4c3ec538c7aOpen original
Janady13/missionmatch / internal/modules/wages/service.goper-tenant-routing9bde0f9a74b89d01980fa658e5253acda7528d0cOpen 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 == nil { return nil, ErrNoDatabase } leaf, release, err := s.db.Acquire(ctx) if err != nil { return nil, err } defer release() if leaf.Pool == nil { return nil, ErrNoDatabase } rows, err := dbgen.New(leaf.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.