Ubiquitous Language

Ubiquitous Language#

Audience. Anyone naming a type, a method, a config key, an API field, or a test case. Use the term in the Term column everywhere — code, comments, commits, docs, and UI copy. If a concept is missing, add it here before inventing a synonym.

Ownership: the context that defines a term owns its meaning. A term used by two contexts (e.g. product) is linked to the ID that crosses the boundary, not shared as a mutable model.

Content Publishing#

TermMeaningCode name
Content itemOne authored document in one language. The aggregate root of publishing.contentdomain.Content
Post typeA content category with its own field schema (post, page, custom slugs).PostType / post_type
Custom fieldAuthor-editable data declared by a post type.customfield.FieldSchema
System fieldA field owned by a plugin or module, hidden from authors and protected from edits.FieldSchema.System
Field schemaThe declaration (type, required, bounds, options) that validates a field value.customfield.FieldSchema
Custom-field valueThe stored value, canonicalised to its declared type.Content.CustomFields
FormatThe body representation: tiptap (canonical JSON), html, or markdown at the import edge.contentdomain.Format
StatusEditorial state: draft or published.contentdomain.Status
SlugThe public URL segment, unique per language; editable while draft, immutable once published.Content.Slug
Translation groupThe identifier tying language variants of one logical item.TranslationGroupID
AliasA legacy URL that redirects to a content item.alias.Alias
TagA free-form label used for related-content reads and public filtering.Content.Tags
Featured imageThe explicitly chosen cover image (http(s) or root-relative URL); falls back to body extraction.Content.FeaturedImage
CommentA visitor response on a content item, gated by allowComments and the comment system toggle.comments.Comment
Plain textThe extracted, whitespace-collapsed body text used for SEO descriptions.seo.ExtractPlainText
SEO metadataDerived title/description/OG/canonical data produced at publish time or on demand.seo.GeneratedMetadata
Import jobAn asynchronous WordPress/Hugo migration with warnings and a terminal status.importer job store

Identity & Access#

TermMeaningCode name
PrincipalThe acting identity attached to a request: ID, username, roles.kernel.Principal
RoleA named capability set loaded from config.toml at startup (Admin, Contributor, Commentator, or custom).role.Role
CapabilityA permission string such as content.publish or catalog.manage.kernel/capability.Capability
Primary roleThe role used for coarse checks when a principal carries several.identity.PrimaryRole
API keyA machine credential (lesstruct_<keyID>_<secret>) whose secret is stored hashed.apikey.APIKey
MFA challengeA short-lived, single-use login challenge holding hashed token and code.auth.MFAChallenge
Verification tokenA hashed, expiring token for email verification or password reset.auth.VerificationToken
First loginThe seeded admin’s bootstrap state before a real password and email exist.firstLoginRequired
Login identifierThe value a user signs in with: a username, or an email address when it contains @.auth.IsEmailIdentifier
Pending approvalA registrant who verified email but awaits admin activation (admin_approval = true).users status pending

Media Library#

TermMeaningCode name
Media fileOne stored image plus metadata and its thumbnail set. The aggregate root.media.Media
Variant / thumbnailA resized render of the original under a thumbnail spec suffix.media.MediaVariant, thumbnail.Spec
Thumbnail specA configured suffix + max width pair.thumbnail.ThumbnailConfig
Content hashSHA-256 of the original bytes; drives dedup and filenames.Media.Hash
DedupReturning the existing record instead of storing a duplicate (unless forced).ErrDuplicateMedia
Perceptual hash64-bit average hash used by importers to spot visually duplicate covers.media.PerceptualHash
WebP conversionTranscoding uploads to WebP (quality 80) with metadata stripped.ConvertToWebP
Pixel budgetThe 60-megapixel cap probed before decoding, guarding decompression bombs.maxDecodedPixels
Image generationAI-produced imagery through the provider port.ImageGenerationService

Catalog#

TermMeaningCode name
Catalog productCommerce data attached to one product content item.catalog.Product
VariantOne concrete option combination with its own SKU, price override, stock, weight, image.catalog.Variant
Variant axisAn option dimension (size, color) and its allowed values.Product.Options
Variant matrixThe cross-product of axes, capped by MaxVariants.Product.Variants
PriceRegular sellable price in integer minor units.Product.Price
Sale priceOptional discounted price; must not exceed Price.Product.SalePrice
Effective priceVariant override, else sale price, else price.Product.EffectivePrice
Stock bucketThe counted unit: product stock when variantID == nil, else variant stock.Product.Stock, Variant.Stock
Track inventoryWhether stock gates sellability and moves on payment.Product.TrackInventory
Low-stock thresholdThe level at which a downward move emails the configured recipient.Product.LowStockThreshold
AdjustmentA signed stock delta applied conditionally (never below zero).Service.AdjustStock
SKUStock-keeping unit, unique per product when non-empty, ≤100 runes.Product.SKU, Variant.SKU

Cart#

TermMeaningCode name
CartA guest-owned basket identified by an opaque token. The aggregate root.cart.Cart / StoredCart
Cart tokenA 32-byte base64url secret shown once; only its SHA-256 hash is stored.TokenBytes, hashToken
Stored lineThe persisted (product, variant) → quantity row with no price.StoredLine
Cart lineThe read shape: stored quantity plus live catalog projection.CartLine
Catalog itemThe narrowed catalog projection the cart needs (price, stock, identity).CatalogItem
AvailableWhether the line’s product/variant still resolves; unavailable lines stay visible but are excluded from totals.CartLine.Available
Soft stock gateNew demand for an out-of-stock line is refused, but an existing quantity may exceed stock; checkout requires every line to still be in stock, and payment claims the exact quantities from the catalog.ErrOutOfStock
Live pricingPrices are never persisted; totals resolve from the catalog at read time.Cart.Subtotal

Orders#

TermMeaningCode name
OrderThe checkout snapshot plus lifecycle state. The aggregate root.orders.Order
Order itemAn immutable snapshot line: product ID, optional variant ID, SKU, title, unit price, quantity.OrderItem
SnapshotThe frozen copy of cart facts at checkout; later catalog edits never rewrite it.Checkout
Order numberThe derived display ID ORD-000042; never stored.Order.DisplayNumber
SubtotalSum of item line totals, frozen at checkout (minor units).Order.Subtotal
Shipping lineAdmin-entered shipping charge, pending orders only, empty by default.Order.ShippingMinor
TotalSubtotal + ShippingMinor, derived at read.Order.TotalMinor
CheckoutThe use case that validates contact/shipping, claims the cart, and stores the pending order.Service.Checkout
Claim / consumeThe atomic delete of the cart that makes one checkout win a race on a token.CartSource.Consume
TrackingGuest lookup by order number + email + the per-order tracking token, with non-enumerating failures — every mismatch reads not-found.Service.Tracking
TransitionA legal status move validated by the lifecycle map.Service.Transition
Lifecyclepending → paid → packed → shipped → delivered, with cancel/refund/expiry branches.lifecycle
Confirm paidThe only path into paid: reserve stock, then conditionally flip pending→paid.Service.ConfirmPaid
Reserve / releaseInventory claims taken on payment and returned on failed flips or fulfilment unwind.Inventory
Expire staleFlip abandoned pending orders to expired and notify (best-effort).Service.ExpireStale
InvoiceA derived, never-persisted render document (INV-000042).InvoiceDocument
PPNIndonesian VAT, a display-only invoice breakdown at the configured rate.InvoiceSettings.TaxRate
Invoice settingsThe live [invoice] block (seller identity + PPN rate): module state behind a mutex, persisted through config.SaveInvoice so an admin edit applies without a restart.Module.InvoiceSettings
Order mailerBest-effort confirmation/status email delivery.Mailer
TermMeaningCode name
Legal documentA conventional store policy page (cookie, privacy, terms, returns) published as ordinary bilingual page content.legal.Page
Conventional slugThe canonical English slug that anchors a document’s translation group (cookie-policy, privacy-policy, terms-of-service, returns-refunds).legal.PageCookiePolicy …
Legal resolutionMapping each document to the published translation-group member that best fits the visitor’s language chain; absent when the canonical slug is unpublished.legal.Resolve
OverrideAn explicit [legal] *_url value that wins over the resolved page (validated site-relative or http(s)).LegalOptions.Overrides
Consent bannerThe Accept/Decline cookie notice; links a resolved cookie (or privacy) policy and degrades to the plain notice when none resolves.LegalData.CookieNotice
Consent gateThe server-enforced requirement that checkout/registration carry an affirmative acceptance when terms and privacy resolve (or [legal] forces it).ConsentPolicy
Consent evidenceThe recorded acceptance: timestamp plus the accepted revision of each document (page ID, slug, language, last-updated).legal.Consent
Legal placementWhere conventional legal pages appear in navigation: footer (default), header, or both; the footer always lists the full site map.legal.NavPlacement

Payments#

TermMeaningCode name
PaymentOne submitted proof or gateway settlement, append-only. The aggregate root.payments.Payment
MethodHow the payment was made: manual or midtrans.Method
Payment statusVerification state: pending, verified, or rejected.Status
ReferenceThe verbatim proof text (transfer reference or transaction ID), ≤500 runes.Payment.Reference
ProofA manual submission quoting the order number, email, tracking token, and a reference.Service.Submit
Verify / rejectPending-only admin decisions on pending orders (a gateway settlement that landed first refuses both); rejection keeps the order open for resubmission.Service.Verify, Service.Reject
Order refThe payments-side read view of an order: ID, number, status, payable total, currency.OrderRef
Gateway sessionA minted hosted-checkout token and redirect URL.GatewaySession
NotificationA verified gateway webhook event folded onto the order lifecycle.Notification
SettlementA gateway event that confirms payment and calls orders’ Confirm.settleNotification
RefundA gateway event that moves the order to refunded.refundNotification

Platform & delivery#

TermMeaningCode name
ModuleA compiled-in, first-party bounded context (modules/<name>/, own go.mod).kernel.Module
EditionA fixed module list compiled into one binary (blog, core, commerce). Internal vocabulary; product docs say “server build”.internal/editions/<name>
KernelThe frozen shared contract module (kernel/vX.Y.Z).kernel/
SeamA narrow interface a module declares for a collaborator it does not own.e.g. CartSource
AdapterAn implementation of a seam, usually in an edition or store/.e.g. internal/editions/commerce
Principal bridgeConvert a kernel.Principal into an integer acting-user ID.identity.IntID
PluginA sandboxed WASM extension; never a Go module.internal/domain/plugin
HookA plugin event (before_save, after_publish, …).plugin.HookName
Capability resolverFail-closed mapping from principal to capability set.kernel.CapabilityResolver
MigratorA module’s versioned schema migrations.kernel.Migrator
Site identityThe operator-configured name, logo, and favicon shared by every public page and passed to themes as SiteConfig.config.SiteConfig

Naming rules#

  • Prefer the domain noun over its transport spelling: order, not order record; payment proof, not payment transaction row.
  • “Minor units” always means the smallest denomination of the currency (IDR has none; USD cents). Never say cents for a non-USD amount.
  • paid is a state and ConfirmPaid is the only action that produces it. Do not name an admin endpoint pay order.
  • Consume is the cart claim; delete is a plain removal. They are not interchangeable.
  • A variant belongs to a catalog product; a media variant belongs to a media file. Keep the qualifier when the context is not obvious.
  • Use reviewer for the admin deciding a payment, customer for the payer, and buyer nowhere.