Files
member-console/internal/integration/sqlc.yaml
T
cgalo5758 23d5bad024 Add integration delivery core: provider connections, desired-state
records, outbox, lifecycle requests, relay, push, read-back, and FedWiki
lifecycle workflows

- Add core.provider_connections table and unique provider connection per
  provider
- Add core.target_mappings table linking connections to resource keys
  and targets
- Add core.desired_state_records table storing desired entitlements per
  connection and recipient with generation and content hash
- Add core.observed_projections table for application-reported state per
  connection and recipient
- Add core.lifecycle_requests table recording lifecycle requests by
  instance and generation
- Add core.person_cut_offs table and setter function to record persons
  cut off everywhere
- Add core.desired_state_outbox table with triggers on entitlement,
  membership, organization, connection, mapping, and cut-off tables to
  write change notices
- Enforce constraints on recipients, generations, and statuses across
  tables
- Implement desired_state_content SQL function computing record content
  per recipient rules
- Implement relay workflow to claim outbox rows, expand to records,
  recompute records, and dispatch pushes
- Implement push workflow to push records, handle transport answers, and
  record push results
- Implement read-back workflow to page through application state, update
  projections, and raise records as needed
- Add lifecycle request writers with idempotent recording, finishing,
  and acknowledgment
- Add FedWiki integration lifecycle workflows for create, set status,
  swap, delete, and reconcile
- Add FedWiki web handlers and forms for lifecycle requests, including
  create form with instance and generation
- Add tests for schema, triggers, relay, push, read-back, lifecycle
  requests, FedWiki workflows, and operator pages
- Add documentation updates for provider integration, entitlements,
  identity, organizations, lifecycle, and FedWiki integration
- Add benchmarks for delivery and push workflows
- Ensure schema-per-provider for in-tree integrations; connector state
  lives in generic core tables keyed by connection
- Secure functions and triggers with SECURITY DEFINER and restrict
  core_writer role privileges accordingly
- Handle Temporal client integration for workflow execution and
  scheduling
- Provide a recording transport for integration tests
- Close Issues 32 and 33 by implementing provider connections and
  desired-state records with lifecycle requests and relay mechanisms
2026-10-06 03:46:15 -05:00

120 lines
5.7 KiB
YAML

version: "2"
sql:
- engine: "postgresql"
schema:
- "../db/migrations/"
queries: "queries/"
gen:
go:
package: "integration"
out: "."
sql_package: "database/sql"
emit_json_tags: true
emit_prepared_queries: false
emit_interface: true
emit_exact_table_names: false
emit_empty_slices: true
omit_unused_structs: true
rename:
# Tables owned by this package (bare names, matching pre-consolidation).
core_provider: Provider
core_providers: Provider
core_provider_operation: ProviderOperation
core_provider_operations: ProviderOperation
core_resource_key: ResourceKey
core_resource_keys: ResourceKey
core_integration_config_override: ConfigOverride
core_integration_config_overrides: ConfigOverride
core_provider_connection: ProviderConnection
core_provider_connections: ProviderConnection
core_desired_state_record: DesiredStateRecord
core_desired_state_records: DesiredStateRecord
core_observed_projection: ObservedProjection
core_observed_projections: ObservedProjection
core_lifecycle_request: LifecycleRequest
core_lifecycle_requests: LifecycleRequest
core_desired_state_outbox: DesiredStateOutbox
core_desired_state_outboxes: DesiredStateOutbox
core_target_mapping: TargetMapping
core_target_mappings: TargetMapping
# Spillover tables pulled in because ../db/migrations/ declares the
# whole "core" schema. Renamed to match the exact pre-consolidation
# type names (from their old owning schema) so query result/model
# types are byte-for-byte identical to before -- only the schema
# string in comments/paths changed.
core_account: BillingAccount
core_accounts: BillingAccount
core_entitlement_set: EntitlementsEntitlementSet
core_entitlement_sets: EntitlementsEntitlementSet
core_entitlement_set_rule: EntitlementsEntitlementSetRule
core_entitlement_set_rules: EntitlementsEntitlementSetRule
core_grant: EntitlementsGrant
core_grants: EntitlementsGrant
core_invoice: BillingInvoice
core_invoices: BillingInvoice
core_invoice_line_item: BillingInvoiceLineItem
core_invoice_line_items: BillingInvoiceLineItem
core_numeric_entitlement: EntitlementsNumericEntitlement
core_numeric_entitlements: EntitlementsNumericEntitlement
core_numeric_entitlement_contribution: EntitlementsNumericEntitlementContribution
core_numeric_entitlement_contributions: EntitlementsNumericEntitlementContribution
core_numeric_entitlement_usage: EntitlementsNumericEntitlementUsage
core_numeric_entitlement_usages: EntitlementsNumericEntitlementUsage
core_org_member: OrganizationOrgMember
core_org_members: OrganizationOrgMember
core_org_type: OrganizationOrgType
core_org_types: OrganizationOrgType
core_organization: OrganizationOrganization
core_organizations: OrganizationOrganization
core_outbox: IntegrationOutbox
core_outboxes: IntegrationOutbox
core_payment: BillingPayment
core_payments: BillingPayment
core_payment_method: BillingPaymentMethod
core_payment_methods: BillingPaymentMethod
core_person: IdentityPerson
core_persons: IdentityPerson
core_plan_ladder: BillingPlanLadder
core_plan_ladders: BillingPlanLadder
core_plan_ladder_tier: BillingPlanLadderTier
core_plan_ladder_tiers: BillingPlanLadderTier
core_pool_assignment: EntitlementsPoolAssignment
core_pool_assignments: EntitlementsPoolAssignment
core_pool_provision: EntitlementsPoolProvision
core_pool_provisions: EntitlementsPoolProvision
core_pool_provision_ladder: EntitlementsPoolProvisionLadder
core_pool_provision_ladders: EntitlementsPoolProvisionLadder
core_pool_provision_transition: EntitlementsPoolProvisionTransition
core_pool_provision_transitions: EntitlementsPoolProvisionTransition
core_price: BillingPrice
core_prices: BillingPrice
core_product: BillingProduct
core_products: BillingProduct
core_product_kind: BillingProductKind
core_product_kinds: BillingProductKind
core_provider_state: IntegrationProviderState
core_provider_states: IntegrationProviderState
core_resource_pool: EntitlementsResourcePool
core_resource_pools: EntitlementsResourcePool
core_role: OrganizationRole
core_roles: OrganizationRole
core_role_assignment: OrganizationRoleAssignment
core_role_assignments: OrganizationRoleAssignment
core_subscription: BillingSubscription
core_subscriptions: BillingSubscription
core_subscription_change: BillingSubscriptionChange
core_subscription_changes: BillingSubscriptionChange
core_subscription_item: BillingSubscriptionItem
core_subscription_items: BillingSubscriptionItem
core_subscription_scheduled_change: BillingSubscriptionScheduledChange
core_subscription_scheduled_changes: BillingSubscriptionScheduledChange
core_user: IdentityUser
core_users: IdentityUser
core_webhook_event: IntegrationWebhookEvent
core_webhook_events: IntegrationWebhookEvent
core_workspace: OrganizationWorkspace
core_workspaces: OrganizationWorkspace
overrides:
- db_type: "uuid"
go_type: "string"