Provides a common interface for all trouble containers

Allows a model to expose the troubles that are directly related to it. Also provides a standard interface to get the status of the highest priority trouble.

interface TroubleAware {
    troubles: TroubleModel<any>[];
    troubleStatus: string;
    troublesByType: Record<string, TroubleModel<any>[]>;
}

Properties

troubles: TroubleModel<any>[]

Returns the troubles that are directly related to this model.

troubleStatus: string

Returns the highest priority trouble status.

troublesByType: Record<string, TroubleModel<any>[]>

Returns the troubles that are directly related to this model, grouped by type.