Venue Module Backend
Related documentation: Backend Modules · Venue Module Backend API · Data ownership · Access Control · Frontend Venues
Current implementation snapshot
Section titled “Current implementation snapshot”Backend-Kisum-Venuesnow exists as a real Go/Fiber service with PostgreSQL DI, JWT +x-orgaccess enforcement, internal API-key routes, repository-backed MVP handlers, and a production-intended legacy sleeping-venue importer.- The current runtime already implements venues, spaces, availability blocks, bookings, customer overlays, and internal Base-facing venue reads.
- The current runtime also exposes Admin-facing internal venue CRUD, venue-type, sleeping-inventory, takeover-approval, takeover-audit, reconciliation, and activation endpoints so Admin can use Venue as source of truth without direct DB access.
- Phase 7 (reporting) is live. Four
/api/v1/reports/*endpoints back the same query contract (fromAt,toAt,bucket,venueId,spaceId,businessUnitId,marketCompanyId,marketPersonId): utilization (pure Venue truth), revenue (Venue deposits merged with Finance-derived invoiced/paid), profitability (Finance income − Finance bills), customers (Venue bookings grouped by Artists party id, optionally enriched with Finance totals). When the Finance HTTP client is unconfigured, reports returnfinanceLinked = falsewith an explicitfinanceMessage— never silent zeros. Aggregations live ininternal/venue/repositories/reports_postgres.go(ad-hoc SQL, no materialized views). - Phase 6 (events + operations) is live on the Venue side. Events are persisted as references to the canonical Promoter-owned event (
promoterEventId) or as placeholders for off-platform promoters (isPlaceholder = true) with a reconciliation path viaPOST /api/v1/events/:id/link-promoter. Operations checklists, reusable templates, readiness state, and event/space assignment are all persisted. - Phase 4 commercial routes (deals, contracts, deposits, event finance-visibility) are repository-backed on the Venue side. Real external Adobe Sign upstream sync and the deeper Finance handoff (booking obligations, settlements, profitability source of truth) are still pending. Deposit invoice sync is live through Finance
incomemachine mode; reporting read-path is live throughGET /api/incomeandGET /api/bills. - Pending: real Adobe Sign upstream, deeper Finance handoff beyond deposit invoices + reports read-path, Venue HTTP client to call Promoters
GET /internal/events/:id(resolver live on Promoters since 2026-05-27), Finance-side aggregation endpoints so reports don’t have to pull every row. - This page documents the enforced module boundary plus the current runtime direction.
Overview
Section titled “Overview”Backend-Kisum-Venues is the domain backend for the venue module.
It exists so Kisum can manage a venue as an operating business, not only list venues or expose legacy CRUD.
Venue module responsibilities include:
- venue master records
- space records
- space-scoped availability and booking workflows
- multi-space booking support
- venue-side customer overlays on top of Market parties
- venue-rental contract lifecycle state
- Adobe signature orchestration state
- deposit workflow metadata
- venue operational readiness
- venue and per-space reporting
- imported sleeping venue inventory
Product contract
Section titled “Product contract”Current v1 product rules that the backend must support:
1 company = 1 venue1 venue = many spaces- a space behaves like a lightweight BU-style operational scope
- one booking may include one or many spaces
- whole-venue rentals are valid
- managers can edit operational details
- admin / tenant superadmin finalize approval-sensitive actions
- Finance remains the source of truth for financial persistence
Future multi-venue ownership must stay possible, but it is not the current tenant contract.
Ownership model
Section titled “Ownership model”Venue owns
Section titled “Venue owns”- venue records
- imported sleeping venue inventory before takeover
- space records
- venue type catalog imported from legacy Mongo
- availability blocks
- booking records (incl. optional
eventId/promoterEventIdlinkage carried from creation through confirmation) - venue-side event references / placeholders (NOT the canonical promoter event — see Promoter ↔ Venue event linkage below)
- venue-side deal structures
- contract workflow state
- signature orchestration state
- venue-side deposit metadata
- customer overlay data
- operational templates, checklists, tasks, and readiness state
- venue reporting views
Venue does not own
Section titled “Venue does not own”- user identity
- sessions / JWT issuance
- memberships
- company / business-unit master data
- package / entitlement truth
- canonical Artists party master data
- canonical geo master data
- invoice / settlement / ledger truth
- canonical event records — those live in the Promoter module; Venue stores only references or placeholders for off-platform promoters
Promoter ↔ Venue event linkage
Section titled “Promoter ↔ Venue event linkage”Canonical event truth lives in the Promoter module. Venue stores only a reference row in venue_events so finance-status, operations checklists, and reporting can hang off something local without forcing every event consumer to round-trip through Promoter.
Every venue_events row is exactly one of:
- Real promoter reference —
promoter_event_idis set,is_placeholder = false. The Venue row mirrors a canonical promoter event. - Placeholder for off-platform promoter —
is_placeholder = true,promoter_event_idis null, plusplaceholder_promoter_name(and optionallyplaceholder_promoter_email,placeholder_notes). The promoter has not joined Kisum yet; this row holds the venue-side operational state until reconciled.
Three creation paths populate venue_events:
- Explicit
POST /api/v1/events— strict: must carry exactly one ofpromoterEventIdorplaceholder=trueplus placeholder promoter context. - Booking confirmation sync (
SyncBookingEvent) — resolves in orderbooking.eventId(existing linked row) →booking.promoterEventId(upsert by(company_id, promoter_event_id)) → placeholder shadow keyed onbooking_id. The resolved id is back-linked onto the booking row. - Placeholder reconciliation (
POST /api/v1/events/{id}/link-promoter) — promotes a placeholder to a canonical promoter reference once the previously off-platform promoter joins Kisum, mirroring the sleeping-venue takeover pattern.
Rules:
PATCH /api/v1/events/{id}may update venue-side operational fields (title, description, status, start/end, spaceIds, placeholder context on placeholder rows) but never mutatespromoter_event_idoris_placeholder. Promotion only happens vialink-promoter.- The
(company_id, promoter_event_id)pair is unique whenpromoter_event_idis non-null — a real promoter event can be referenced by at most one Venue row per company. - Promoters exposes
GET /internal/events/:eventId(machine key) since 2026-05-27 — acceptspublicEventIdUUID or Mongo_id. Venue Phase 3 will call it before persist; until then Venue trusts caller format forpromoterEventId.
Platform dependency split
Section titled “Platform dependency split”Auth owns
Section titled “Auth owns”- identity
- sessions
- JWTs
- company memberships
- business-unit memberships
- effective module / permission resolution
Core owns
Section titled “Core owns”- companies
- business units
- commercial catalog
- subscriptions
- entitlements
Artists owns
Section titled “Artists owns”- canonical counterparties
- canonical contacts / people
- country master data
- city master data
Finance owns
Section titled “Finance owns”- obligations
- invoices
- payments
- settlements
- accounting integration truth
Practical rule:
- Venue orchestrates venue workflows
- Finance persists finance truth
Admin integration
Section titled “Admin integration”Admin venue management must flow through:
Frontend-Kisum-AdminBackend-Kisum-AdminBackend-Kisum-Venues
Rules:
Backend-Kisum-Adminstays the browser-facing BFFBackend-Kisum-Venuesstays the runtime source of truth- Admin must not read Venue Postgres directly
- numeric
venue_idis the canonical Admin-facing venue identity - sleeping venue takeover approval, audit, reconciliation, and activation are Venue-owned workflow state surfaced through Admin
Shared party model
Section titled “Shared party model”Venue must not duplicate party master data.
Recommended and current target rule:
- bookings, contracts, and overlays reference Market company/person ids when possible
- Venue stores only local overlay data such as:
- notes
- preferred terms
- risk
- relationship history
- venue-specific performance context
- local operational contacts
Finance boundary
Section titled “Finance boundary”Venue depends operationally on Finance and should be treated as finance-linked.
At the product level:
- a company using Venue Management should also have Finance enabled
- venue-management users should get the Finance visibility required for deposit and settlement workflows
At the persistence level:
- Venue may own deposit expectations and operational status
- Finance owns invoice/payment/settlement/accounting truth
- Current runtime detail: Venue deposit create/update now calls Finance
POST|PATCH /api/incomein machinesource=venue_depositmode, stores the returned Finance id locally, and should read paid-state back from Finance
Contract and signature boundary
Section titled “Contract and signature boundary”Venue owns the canonical venue-rental contract record and its operational lifecycle:
- draft creation
- template selection
- placeholder resolution
- signer assignment
- send for signature
- signature progress
- signed / declined / expired state
- attachments and addenda
Adobe Sign is backend-only.
The frontend must never hold Adobe credentials or call Adobe directly.
Access model
Section titled “Access model”Tenant-scoped requests require:
Authorization: Bearer <JWT>x-org: <company_id>
Internal service-to-service routes may use:
X-Internal-API-Key: <VENUE_INTERNAL_API_KEY>
Required fail-closed direction:
- JWT validation
- company context enforcement
venuemodule gate- granular
venue.*permission checks - scoped visibility for space-level operations
Current runtime shape
Section titled “Current runtime shape”Current stack:
- Go
- Fiber
- PostgreSQL
pgxpool- migration-driven schema
Current route namespaces:
/api/v1/*for tenant/user routes/internal/*for service-to-service reads
Current implemented route families:
- venues
- spaces
- availability blocks
- bookings (with optional
eventId/promoterEventIdlinkage) - customer overlays
- deals, contracts (with local signature adapter), deposits (with Finance income sync), event finance-status
- events (incl.
POST /api/v1/events/:id/link-promoterfor placeholder reconciliation) - operations checklists + reusable templates (incl. event/space assignment and readiness state)
- reports (utilization / revenue / profitability / customers — Venue aggregations + optional Finance HTTP enrichment via
GET /api/incomeandGET /api/bills) - internal venue list/detail/inquiry
- internal Admin venue CRUD, venue-types, sleeping-inventory, takeover-approvals/audit/reconciliation, activation
Current pending route families:
- (none for v1; pending work is upstream — real Adobe Sign, deeper Finance handoff, optional Finance-side aggregation endpoints)
Legacy sleeping venue import
Section titled “Legacy sleeping venue import”The current migration direction includes a hard import path from legacy Mongo.
Imported collections:
kisum_data.venues_typekisum_data.venues
Imported venue-type rules
Section titled “Imported venue-type rules”Legacy venue types import into the singular Postgres table:
venue_type
Key model:
venue_type.venue_type_id- numeric type id from Mongo
- primary key
Venue rows link through:
venues.venue_type_id- FK to
venue_type(venue_type_id)
- FK to
Imported venue rules
Section titled “Imported venue rules”Imported venue inventory lands under one Kisum-owned holding company, not a tenant-owned company.
Imported records are marked:
ownership_status = sleepingis_sleeping = trueis_claimable = true
Compatibility keys preserved on venues:
- Mongo
_id->source_mongo_object_id - Mongo numeric venue
id->venue_id - Mongo
unique_id->unique_idwhen present
Current DB uniqueness rules:
venue_idis enforced uniquesource_mongo_object_idis enforced uniqueunique_idis not enforced unique
Geo import rules
Section titled “Geo import rules”Imported venue rows should keep raw compatibility values:
countrycitycountry_iso2
and also resolve canonical Market references when possible:
country_idcity_id
Important rule:
cityandcity_idmay remainNULL- unresolved geo ids must remain
NULLrather than guessed
Import phase scope
Section titled “Import phase scope”This phase is import-only.
Takeover approval and activation are later workflow phases and are not part of the import command itself.
Practical engineering rules
Section titled “Practical engineering rules”When working in Backend-Kisum-Venues:
- do not duplicate canonical Artists party records
- do not redefine Finance truth in Venue
- do not weaken auth or
x-orgrules - keep
/internal/*internal-only - treat sleeping-venue import compatibility as real product behavior, not throwaway migration code
- keep docs explicit about what is live versus still target-state