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.
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).
| Field | Type | Meaning |
|---|---|---|
objectClassId | string | Class that was demoted |
reason | 'lost_classification' | Why demotion happened |
kind | ClassificationKind (optional) | Required kind that was missing |
changedAt | Date | Same now passed into demoteToDraft |
Raised by
ObjectClass.demoteToDraft—apps/api-v1/src/modules/bim-ontology/core/domain/object-class/ObjectClass.ts. No-op (no event) when alreadydraft; refused whenarchivedDemoteObjectClassesThatLostClassificationUseCase.demoteWhenClassificationLostdrainspullDomainEvents()aftersetLifecycleStatusessucceeds- 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.