ProofedMesh/services/per-diem-calculator/internal/rates/rates.go
CTO Agent 3f466dfae8
All checks were successful
validate / Rego (opa fmt + opa test) (push) Successful in 11s
validate / JSON Schema (ajv) (push) Successful in 18s
services: add per-diem-calculator Go skeleton (deterministic compute core + 5 unit tests, HTTP wire stubbed); README reflects new layout
2026-10-25 17:07:55 +00:00

24 lines
968 B
Go

// Package rates holds the Data-Source client stub for ds:per-diem-rates.
// Current state: skeleton — no HTTP transport, no Session-Scope-Token
// acquisition. The intent is to document the eventual signature and let
// the calc package compile against it.
package rates
import (
"errors"
"time"
)
// Client exposes the one operation the calculator needs: fetch the applicable
// rate for a country+date. The real implementation will call
// ds:per-diem-rates /rates with a Session-Scope-Token and return the single
// applicable rate (filtering by city if provided).
type Client struct {
// BaseURL, HTTPClient, ScopeTokenFetcher — intentionally omitted in skeleton
}
// RateFor is a stub that always returns a helpful error so tests that need a
// real provider substitute their own.
func (c *Client) RateFor(country string, day time.Time) (interface{}, error) {
return nil, errors.New("rates.Client is a skeleton; substitute a test or real provider")
}