backbone-maintenance 0.7.21

Minimal Backbone Framework module skeleton
Documentation
# =============================================================================
# maintenance Module - Schema Index
# =============================================================================
# Version: 2.0
# Description: Module schema index. `module:` and `schema:` are stamped from the
# module name by `metaphor module create`. `schema:` gives this module its OWN
# Postgres schema (migrations emit `CREATE SCHEMA maintenance` and qualify tables
# as `maintenance.<table>`) — the convention every backbone module follows
# (see backbone-sapiens, backbone-bucket). Do not remove it.
# =============================================================================

module: maintenance
version: 2
schema: maintenance

# =============================================================================
# Tenancy: none, by design (ADR-0029)
# -----------------------------------------------------------------------------
# This module is tenant-agnostic. It declares NO company axis and NO fence:
# RLS stays ENABLE+FORCE with zero policies after the strip, and the composing
# service installs the org-unit fence (tenancy.yaml + decorator) at composition
# time. The historical postures port to the composed world as follows:
#   - maintenance_stages (was shared_blank — nullable company_id, NULL = the
#     one shared stage set): ROOT-ANCHORED rows. The decorator's allow_root
#     admits tenant-root-anchored stages, and the scope union (subtree ∪
#     tenant root) carries the visible-to-every-company semantics; a stage
#     anchored at a regular unit is that unit's private stage, the same
#     distinction the old company_id-set arm drew.
#   - schedules / visits / visit_parts / requests (were strict): plain
#     org-scoped rows — the decorator's NOT NULL org_unit_id with the
#     acting-unit fill, exactly like every strict table before them.
# -----------------------------------------------------------------------------
description: "maintenance domain module"

config:
  database: postgresql
  soft_delete: true
  audit: true
  default_timestamps: true
  generators:
    disabled:
      - graphql
      - grpc
      - proto

# Reuse sapiens for user identity (actors) — logical refs, no DB constraint.
external_imports:
  - module: sapiens
    types: [User]

# Shared value-object types available to all models in this module.
shared_types:
  Timestamps:
    created_at:
      type: datetime
      attributes: ["@default(now)"]
      description: "Record creation timestamp"
    updated_at:
      type: datetime
      attributes: ["@updated_at"]
      description: "Last update timestamp"
    deleted_at:
      type: datetime?
      description: "Soft delete timestamp"

  Actors:
    created_by:
      type: uuid?
      attributes: ["@foreign_key(sapiens.User.id)"]
      description: "User who created this record"
    updated_by:
      type: uuid?
      attributes: ["@foreign_key(sapiens.User.id)"]
      description: "User who last updated this record"
    deleted_by:
      type: uuid?
      attributes: ["@foreign_key(sapiens.User.id)"]
      description: "User who deleted this record"

  Metadata: [Timestamps, Actors]

# Import each entity model. Replace `example` with your real entities.
imports:
  - maintenance_schedule.model.yaml
  - maintenance_visit.model.yaml
  - maintenance_stage.model.yaml
  - maintenance_request.model.yaml