event

Object Class Demoted

An approved ObjectClass returned to draft after it lost a required classification. Covering approved Revit projections are demoted to draft for re-review.

EventStatus: Implemented in api-v1

Purpose

Records approved → draft on ObjectClass when a required classification (Uniformat, Masterformat, ObjectClass code, or Revit category) no longer resolves on the class or its ancestry. Demotion is reversible re-review, not archival.

One event is recorded per class. A subtree that loses the same kind drains several events and they are dispatched together after persist.

Payload

Envelope is { name, occurredAt, payload } (apps/api-v1/src/modules/shared/domain/events/DomainEvent.ts).

FieldTypeMeaning
objectClassIdstringClass that was demoted
reason'lost_classification'Why demotion happened
kindClassificationKind (optional)Required kind that was missing
changedAtDateSame now passed into demoteToDraft

Raised by

  • ObjectClass.demoteToDraftapps/api-v1/src/modules/bim-ontology/core/domain/object-class/ObjectClass.ts. No-op (no event) when already draft; refused when archived
  • DemoteObjectClassesThatLostClassificationUseCase.demoteWhenClassificationLost drains pullDomainEvents() after setLifecycleStatuses succeeds
  • HTTP: syncObjectClassClassificationInheritance (seeded). Graph mutations still emit ObjectClassParentGraphChanged; this event is the downstream reaction after classification refill

Consumers

DemoteRevitProjectionOnObjectClassDemotionHandler (adapters/inbound/events/), registered in bim-ontology.composition.ts on ObjectClassDemoted. Thin: payload → DemoteRevitProjectionsCoveringObjectClassUseCase, which demotes covering approved projections to draft via RevitParameterProjection.demoteToDraft (emits RevitParameterProjectionDemoted). Draft and archived projections are skipped.

The in-process dispatcher swallows handler errors, so GET missingForApproval / objectClass.approved remains the second signal if a covering projection stays approved.