using MongoDB.Bson; namespace adas_core.Domain.Models.Responses; /// /// Represents a response payload for a beacon, encapsulating its color, point-of-contact identifier, and associated unit identifier. /// /// /// Implements to enable value-based equality comparison between instances. /// public class BeaconResponse(string color, ObjectId poc, ObjectId unitId) : IEquatable { private string Color { get; } = color; private ObjectId PointOfCareId { get; } = poc; private ObjectId UnitId { get; } = unitId; /// /// Determines whether the specified is equal to the current instance by comparing their PointOfCareId and UnitId values. /// /// The to compare with the current instance. /// if both PointOfCareId and UnitId match; otherwise, . public bool Equals(BeaconResponse? other) { return PointOfCareId == other?.PointOfCareId && UnitId == other.UnitId; } /// /// Returns a string representation of the BeaconResponse, including the point of care identifier, unit (bed) identifier, and color. /// /// A formatted string describing the beacon's point of care, unit, and color. public override string ToString() { return "BeaconResponse[pointOfCare: " + PointOfCareId + ", bed: " + UnitId + ", color: " + Color + "]"; } }