142 Commits

Author SHA1 Message Date
8e707b4abb Add operator plan ladder management UI and backend 2026-04-20 19:52:42 -05:00
5a5184310e Add plan ladders and pool provision transitions
Introduce DB migrations for ladder and pool-attachment tables and an
audit log for provision transitions. Make product_type nullable and add
lifecycle_status plus a product_kinds view. Implement Transition and
ReapplyDefaultsForPool primitives, SQLC queries/models, webhook and
Temporal workflow integration, and accompanying unit/integration tests.
2026-04-19 20:45:56 -05:00
f1140969fb Add plan management foundation design and specs 2026-04-19 14:10:37 -05:00
c6d139d0f9 Plan concept depth design update 1. 2026-04-19 02:43:30 -05:00
732197ab03 Update design for plan management depth 2026-04-17 02:54:54 -05:00
84ba87aad6 Fix margins inconsistency between pages. 2026-04-13 02:40:15 -05:00
3e4cdab86b fix meter in products page. 2026-04-13 02:36:02 -05:00
9da9251e56 Fix operator panel tabs 2026-04-13 02:22:49 -05:00
86ae6047b8 Clarify plan concept depth in milestones 2026-04-12 17:02:40 -05:00
3e2e40103a Use Product as Org Type Default 2026-04-12 16:56:25 -05:00
cdf923a8cc Products page done. 2026-04-11 20:40:36 -05:00
64fe4cdd0b Add OpenSpec for Member Products page 2026-04-11 19:49:12 -05:00
7a2c110a56 Add deployment architecture doc and milestones 2026-04-11 04:23:42 -05:00
a5b068cbf3 Enable auto-provision of default entitlements. 2026-04-10 14:15:13 -05:00
7b5203d917 Document FedWiki service tiers and status 2026-04-09 02:06:50 -05:00
6f5a4c8752 Auto-provision default billing account 2026-04-07 08:14:35 -05:00
0015623121 Specify Stripe sync in price-management spec 2026-04-07 07:57:13 -05:00
ce32648ad9 Remove DB seed migrations for products and prices 2026-04-07 03:47:50 -05:00
e0ec53eeb7 Stripe Integration Price creation. 2026-04-07 03:24:12 -05:00
9278217a46 Stripe Operator UI 2026-04-06 03:15:20 -05:00
b901da35a8 Start Stripe workflows and handle webhooks
Expose /webhooks/stripe as a public path (signature-verified)

Verify webhook signatures with ConstructEventWithOptions and
IgnoreAPIVersionMismatch=true, and log API version mismatches.
Start two Temporal workflows: stripe-webhook-processor and
stripe-outbox-poller; workflow start failures are non-fatal.
2026-04-05 21:25:26 -05:00
cfea7d3bb5 Use plain DB connection for migrations
Add ConnectPlain to open the DB without the custom search_path and
switch migration and CLI flows to run on that plain connection.
Wrap multi-statement goose migrations with StatementBegin/End to
ensure statements are executed atomically. Move Stripe price outbox
seeding into a dedicated stripe migration.
2026-04-05 18:25:05 -05:00
32178c6e44 Stripe invoice payment projections. 2026-04-05 03:51:31 -05:00
53d8da4b7e Close subscription creation spec workflow 2026-04-05 02:45:51 -05:00
7a0557d3b2 Move comments from the copyable code blocks. 2026-04-05 02:39:22 -05:00
cc5aa88ea2 sqlc: standardize generated type names across all modules
Drop redundant schema prefixes from all sqlc-generated Go types. Since
each module generates into its own package, the package already provides
the namespace — billing.Account is unambiguous without
billing.BillingAccount.

Changes:
- Add rename: blocks to all 6 sqlc.yaml files mapping schema-prefixed
  names to clean idiomatic names (e.g. BillingBillingAccount → Account,
  IdentityPerson → Person, OrganizationOrganization → Organization)
- Rename billing.billing_accounts → billing.accounts (table name
  repeated
  the schema; the schema already provides that context)
- Rename integration.integration_outbox → integration.outbox (same
  reason)
- Regenerate all sqlc output across billing, identity, organization,
  entitlements, stripe, and fedwiki modules
- Update all calling code (server, workflows, provisioning, tests) to
  use
  the new names
- Add internal/db/sqlc_schemas.sql — sqlc-only schema declarations so
  every module can resolve schema-qualified names without including the
  full db migrations
- Update docs/database-management.md with the naming convention and
  standard sqlc.yaml template

Convention going forward: table names must not repeat the schema name;
generated types carry no schema prefix; the Go package provides the
namespace (like http.Request, not http.HttpRequest).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 02:35:36 -05:00
7ef1d32529 Stripe subcription creation 2026-04-05 02:00:07 -05:00
eaa69e525f Local secrets management. 2026-04-05 00:22:06 -05:00
e5698d5fcc Stripe product catalog sync. 2026-04-04 14:58:18 -05:00
d0a1684216 Openspec for stripe product catalog sync 2026-04-04 14:08:49 -05:00
3d602c0601 Add billing accounts and Stripe customer sync 2026-04-04 04:08:23 -05:00
2023c38339 Add Stripe customer mapping design and specs 2026-04-03 20:21:37 -05:00
3aad9268df Stripe Billing Plumbing 2026-04-03 19:25:24 -05:00
e993fccf03 Add Stripe billing plumbing open spec 2026-04-03 18:54:47 -05:00
9db333f1e0 Use testdata/ for test fixtures
gopls ignores the testdata directory
2026-04-03 18:40:43 -05:00
f78c53effc Document FedWiki sync and Keycloak seed issues
Describe that fedwiki.sites is not repopulated from existing site
directories after a DB reset, causing operator and member UIs to show
no sites. Add a note that the Keycloak seed script pins user IDs but
Keycloak may assign different UUIDs, breaking disk-to-IDP ownership
links (example: owner.json shows a different id than the pinned one).
2026-04-03 03:56:28 -05:00
cd232130f2 Introduce per-module PostgreSQL schemas 2026-04-03 03:27:48 -05:00
294a573e66 Add Milestone 4 (Stripe) to status docs
Also add an issues entry that provider_configs should be an app-level
config (discovered during Stripe planning), and update the Future table
to
reference Milestone 4
2026-04-02 02:20:54 -05:00
195cd348a9 Update design to use schemas per module and revert to using industry
aligned terminology for discounts and coupons and promo codes.
2026-04-01 03:08:35 -05:00
641c9a2aa0 Use Task Tool for OpenSpec Sync
Update prompts, skills, and .claude commands to invoke the
openspec-sync-specs skill via the Task tool. Bump skills'
generatedBy to 1.2.0 and apply minor copy edits (onboard preflight,
explore/ff wording, bulk-archive messaging)
2026-03-31 01:48:08 -05:00
fb02411f35 Introduce DB schema separation (core and fedwiki)
Add a goose migration to create core and fedwiki schemas and move
existing
domain tables using ALTER TABLE IF EXISTS. Set connection search_path to
"core, public" after successful DB ping. Update FedWiki SQL and
sqlc.yaml to
use fedwiki.sites and include db migrations for schema awareness. Add
design
docs, specs, and tasks for schema-namespacing and the migration plan.
2026-03-30 15:16:43 -05:00
b5af13ae1e Add status tracking docs and Claude hook 2026-03-30 03:18:34 -05:00
675a4d93a3 Buffer template rendering and fix FedWiki sync
Introduce SafeTemplates.Render to execute templates into a buffer and
prevent partial HTML on errors. Replace direct ExecuteTemplate calls in
partial handlers and add a make lint-templates target to catch bypasses.
Update operator sites template/view model to use OwnerOrgName. Guard the
FedWiki sync by skipping inserts when DefaultWorkspaceID is empty and
scope deletes to the configured default workspace only.
2026-03-29 04:58:02 -05:00
60c275e512 Add HTMX docs and exempt /static/ from auth 2026-03-27 16:15:55 -05:00
47a75e0873 Add products, entitlement sets, and workspace support
- Add SQL queries and generated methods for Create/List/Update products
- Add CountWorkspacesByOrgID and ListResourceKeys querier methods
- Register workspace partials and operator routes for products and sets
- Add workspace UI section and operator tabs; tweak grant/site forms
- Replace isValidDNSLabel with validateDNSLabel for site validation
2026-03-27 10:55:03 -05:00
8bf41b1090 Document UI/UX gaps and mark milestones complete
Mark Milestones 1 and 2 as complete and add Milestone 3
(UI/UX alignment) to the roadmap. Add a detailed UI/UX gap
analysis and operator/frontend action items. Note DNS label/FQDN
validation shortcomings and recommend purging the vestigial
IsMember view flag.
2026-03-26 19:01:09 -05:00
15e1a59fe7 Introduce entitlement sets and migrations
Add entitlement_sets and entitlement_set_rules with seed data and a
migration that backfills products, grants, and pool_provisions, then
removes product_entitlement_rules. Update Go models, sqlc queries,
materialization, and grant/provision flows to use entitlement_set_id.
Fix assembleMigrations to assign stable per-module numeric namespaces.
Move DB docs to docs/database-management.md and add design/specs/tests.
2026-03-26 18:19:19 -05:00
22389e6e6b Add entitlement_sets and entitlement_set_rules
Reparent product_entitlement_rules into the entitlements module as
entitlement_set_rules and introduce entitlement_sets. Update schemas and
docs: products now reference entitlement_set_id; pool_provisions carry
entitlement_set_id instead of product_id; interfaces, counts, and
companion decisions adjusted accordingly.
2026-03-26 16:48:26 -05:00
4bf69f0e7f Note FedWiki sync fails on empty workspace ID
SyncSitesToDBActivity passes an empty string to UpsertSiteByDomain,
causing an invalid UUID insertion that Postgres rejects. Either
configure
a valid DefaultWorkspaceID or make the activity skip/handle empty IDs
gracefully.
2026-03-26 03:55:02 -05:00
5a3bcf7553 Add DNS label validator for site domains
Implement isValidDNSLabel (RFC 1035/1123) in validate.go. Normalize
domain input (trim, lowercase) and enforce validation in CreateSite
handlers, returning 400 with explanatory error messages when invalid.
2026-03-26 03:52:55 -05:00