Files
descrybe/apps/api/internal/platformsettings/doc.go
T

22 lines
997 B
Go
Raw Normal View History

// Package platformsettings is the durable store for platform-level product and
// integration config (OpenAI, SMTP, OAuth, Stripe, EPREL, Pinecone, feed allowlist,
// generic KV) managed from the admin dashboard — so these values need not live
// only in process env.
//
// Storage (reuse, no new migration): company_settings JSONB for a reserved
// system company (SystemCompanyID). Secrets are AES-GCM enc:v1: blobs, same
// pattern as aiprovider/email/woocommerce. Integration tunables live in Values
// (see keys.go); secret Value keys are encrypted on write.
//
// Runtime reads (prefer DB, fall back to EnvConfig / process env):
//
// svc := platformsettings.NewService(pool, env)
// oi, err := svc.ResolveOpenAI(ctx)
// smtp, err := svc.ResolveSMTP(ctx)
// stripe, err := svc.ResolveStripe(ctx, base)
// eprel, err := svc.ResolveEPREL(ctx)
// pc, err := svc.ResolvePinecone(ctx)
// g, err := svc.ResolveOAuthGoogle(ctx)
// v, ok, err := svc.GetKV(ctx, "my.key")
package platformsettings