Threat
Entities Definition
This file defines the threat structure within the Roll Claw domain model.
Implementation
Threat Definition
File: domain/entities/threat.pseudo
// External Threat Entity
class Threat {
// Identity
string id
// Properties
ThreatType type
string description
Date firstObserved
Date lastObserved
int frequencyPerMonth
boolean isActive
string preventiveMeasures
List<ColonyEvent> relatedIncidents
string severityLevel // "low", "medium", "high", "critical"
boolean isAddressed
List<Location> affectedAreas
Person reportedBy
List<ThreatOccurrence> occurrences
Map<string, string> mitigationStrategies // strategy -> status
Date resolvedDate
string resolutionMethod
// Methods
function recordSighting(Date date, string details, Person by)
function implementPreventiveMeasure(string measure, Date date, Person by)
function linkToIncident(ColonyEvent incident)
function assessRiskLevel()
function updateSeverity(string newLevel, Date date)
function markResolved(Date date, string method)
function isRecurring()
function getAffectedCats()
function getFrequencyTrend()
function getDaysSinceLastOccurrence(Date currentDate)
function implementMitigation(string strategy, Date date, Person by)
function updateMitigationStatus(string strategy, string status, Date date)
function recordImpact(string impact, Date date)
function getLocationPattern()
function calculatesRiskScore()
}
class ThreatOccurrence {
// Properties
Threat threat
Date date
Time time
string description
List<Location> locations
List<Cat> affectedCats
string impact
Person reportedBy
string weatherConditions
// Methods
function wasPreventable()
function getResponseTime()
function getSeverity()
function linkedToWeather()
}
class DogThreat extends Threat {
// Properties
string dogDescription
boolean isDogOwned // vs stray
Person dogOwner // if known
string entryMethod // "open gate", "under fence", etc.
boolean isRecognized // repeat offender
constructor() {
super.type = ThreatType.DOG
}
// Methods
function getEntryPoints()
function recordInteractionWithCats(Date date, List<Cat> cats, string outcome)
function notifyAuthorities(Date date, string report)
function communicateWithOwner(Date date, string communication)
}
class WeatherThreat extends Threat {
// Properties
WeatherCondition condition
Date forecastStart
Date forecastEnd
string potentialImpact
List<string> preparationSteps
constructor() {
super.type = ThreatType.WEATHER
}
// Methods
function recordPreparation(string preparation, Date date)
function assessReadiness()
function getIndoorCapacity()
function getPriorityResidents()
function recordActualImpact(Date date, string impact)
}
class ConstructionThreat extends Threat {
// Properties
string projectDescription
Date startDate
Date endDate
string constructionCompany
string contactPerson
string contactInfo
boolean hasPermits
constructor() {
super.type = ThreatType.CONSTRUCTION
}
// Methods
function recordNoiseLevel(Date date, string level)
function recordDisplacement(Date date, List<Cat> displaced)
function contactCompany(Date date, string communication)
function adjustColonyAccess(Date date, List<Location> affected)
}
class PropertyChangeThreat extends Threat {
// Properties
string changeType // "ownership", "usage", "demolition", etc.
Date announcedDate
Date effectiveDate
string previousOwner
string newOwner
string legalStatus
constructor() {
super.type = ThreatType.PROPERTY_CHANGE
}
// Methods
function assessImpactOnColony()
function developContingencyPlan()
function recordContactWithOwners(Date date, string communication)
function evaluateRelocationOptions()
}
class DiseaseThreat extends Threat {
// Properties
string diseaseName
boolean isContagious
List<Symptom> symptoms
string transmissionMethod
string recommendedQuarantine
int infectedCount
List<Cat> infectedCats
constructor() {
super.type = ThreatType.DISEASE
}
// Methods
function recordNewCase(Cat cat, Date date)
function implementQuarantineMeasures(Date date, string measures)
function trackTransmissionPattern()
function getContainmentStatus()
function recordTreatmentEffectiveness(string treatment, string effectiveness)
}
class VehicleThreat extends Threat {
// Properties
string vehicleType
string incidentPattern // "speeding", "late night", etc.
List<Location> dangerZones
string licensePlate // if known
constructor() {
super.type = ThreatType.VEHICLE
}
// Methods
function recordIncident(Date date, Time time, Location location)
function identifyHighRiskTimes()
function implementSafetyMeasures(string measure, Date implemented)
function notifyAuthorities(Date date, string report)
}
class HumanThreat extends Threat {
// Properties
string threatBehavior // "unauthorized feeding", "harassment", etc.
boolean isNeighbor
string personDescription
string motivationIfKnown
List<Time> patternOfActivity
constructor() {
super.type = ThreatType.HUMAN
}
// Methods
function recordInteraction(Date date, Time time, string details)
function attemptCommunication(Date date, string approach)
function developEducationPlan()
function assessIntentions()
function recordImpactOnColony(string impact)
}
Related Components
- See the Domain Model Overview for more information on how this component fits into the overall domain model.