rama creada apartir de master en j
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response payload for a beacon, encapsulating its color, point-of-contact identifier, and associated unit identifier.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Implements <see cref="IEquatable{T}"/> to enable value-based equality comparison between <see cref="BeaconResponse"/> instances.
|
||||
/// </remarks>
|
||||
public class BeaconResponse(string color, ObjectId poc, ObjectId unitId) : IEquatable<BeaconResponse>
|
||||
{
|
||||
private string Color { get; } = color;
|
||||
@@ -9,13 +15,22 @@ public class BeaconResponse(string color, ObjectId poc, ObjectId unitId) : IEqua
|
||||
|
||||
private ObjectId UnitId { get; } = unitId;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="BeaconResponse"/> is equal to the current instance by comparing their <c>PointOfCareId</c> and <c>UnitId</c> values.
|
||||
/// </summary>
|
||||
/// <param name="other">The <see cref="BeaconResponse"/> to compare with the current instance.</param>
|
||||
/// <returns><see langword="true"/> if both <c>PointOfCareId</c> and <c>UnitId</c> match; otherwise, <see langword="false"/>.</returns>
|
||||
public bool Equals(BeaconResponse? other)
|
||||
{
|
||||
return PointOfCareId == other?.PointOfCareId && UnitId == other.UnitId;
|
||||
}
|
||||
{
|
||||
return PointOfCareId == other?.PointOfCareId && UnitId == other.UnitId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of the BeaconResponse, including the point of care identifier, unit (bed) identifier, and color.
|
||||
/// </summary>
|
||||
/// <returns>A formatted string describing the beacon's point of care, unit, and color.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return "BeaconResponse[pointOfCare: " + PointOfCareId + ", bed: " + UnitId + ", color: " + Color + "]";
|
||||
}
|
||||
{
|
||||
return "BeaconResponse[pointOfCare: " + PointOfCareId + ", bed: " + UnitId + ", color: " + Color + "]";
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response containing a collection of observations related to a box.
|
||||
/// </summary>
|
||||
public class BoxObservationsResponse
|
||||
{
|
||||
public List<Medication> Medication = [];
|
||||
|
||||
@@ -4,6 +4,12 @@ using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a minimal response containing essential display configuration data.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class is typically used to convey a lightweight subset of display configuration information in API responses or inter-component communication.
|
||||
/// </remarks>
|
||||
public class DisplayConfigMinimalResponse
|
||||
{
|
||||
public DisplayConfigMinimalResponse()
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response data returned from a login operation.
|
||||
/// </summary>
|
||||
public class LoginResponse
|
||||
{
|
||||
public string Token { get; set; } = "";
|
||||
public string RefreshToken { get; set; } = "";
|
||||
public DateTime Expiration { get; set; } = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the item has expired by comparing its <see cref="Expiration"/> value to the current UTC time.
|
||||
/// Returns <c>true</c> when the expiration date has passed, or when no expiration date has been set (i.e., <see cref="DateTime.MinValue"/>), treating unset expirations as expired.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the item is expired or has no expiration date set; otherwise, <c>false</c>.</returns>
|
||||
public bool IsExpired()
|
||||
{
|
||||
if (Expiration != DateTime.MinValue)
|
||||
{
|
||||
if (Expiration < DateTime.UtcNow) return true;
|
||||
return false;
|
||||
if (Expiration != DateTime.MinValue)
|
||||
{
|
||||
if (Expiration < DateTime.UtcNow) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic response wrapper for paginated data, typically used to return a subset of items along with associated pagination metadata.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the items contained in the paginated response.</typeparam>
|
||||
public class PaginationResponse<T>
|
||||
{
|
||||
public PaginationResponse(List<T> data, int pageNumber, int pageSize, long totalRecords)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic response wrapper that encapsulates a payload of type <typeparamref name="T"/> along with associated response metadata.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the payload contained within the response.</typeparam>
|
||||
public class Response<T>
|
||||
{
|
||||
public Response()
|
||||
|
||||
Reference in New Issue
Block a user