first commit
This commit is contained in:
95
src/GreenHome.Application/Dtos.cs
Normal file
95
src/GreenHome.Application/Dtos.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using Domain = GreenHome.Domain;
|
||||
|
||||
namespace GreenHome.Application;
|
||||
|
||||
// DTOs
|
||||
public sealed class DeviceDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string DeviceName { get; set; } = string.Empty;
|
||||
public string Owner { get; set; } = string.Empty;
|
||||
public string Mobile { get; set; } = string.Empty;
|
||||
public string Location { get; set; } = string.Empty;
|
||||
public string NeshanLocation { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class TelemetryDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int DeviceId { get; set; }
|
||||
public string DeviceName { get; set; }
|
||||
public DateTime TimestampUtc { get; set; }
|
||||
public decimal TemperatureC { get; set; }
|
||||
public decimal HumidityPercent { get; set; }
|
||||
public decimal SoilPercent { get; set; }
|
||||
public int GasPPM { get; set; }
|
||||
public decimal Lux { get; set; }
|
||||
public int PersianYear { get; set; }
|
||||
public int PersianMonth { get; set; }
|
||||
public string PersianDate { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class TelemetryFilter
|
||||
{
|
||||
public int? DeviceId { get; set; }
|
||||
public DateTime? StartDateUtc { get; set; }
|
||||
public DateTime? EndDateUtc { get; set; }
|
||||
public int Page { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 20;
|
||||
}
|
||||
|
||||
public sealed class PagedResult<T>
|
||||
{
|
||||
public required IReadOnlyList<T> Items { get; init; }
|
||||
public required int TotalCount { get; init; }
|
||||
public required int Page { get; init; }
|
||||
public required int PageSize { get; init; }
|
||||
}
|
||||
|
||||
public sealed class TelemetryMinMax
|
||||
{
|
||||
public decimal MinTemperatureC { get; set; }
|
||||
public decimal MaxTemperatureC { get; set; }
|
||||
public decimal MinHumidityPercent { get; set; }
|
||||
public decimal MaxHumidityPercent { get; set; }
|
||||
public decimal MinSoilPercent { get; set; }
|
||||
public decimal MaxSoilPercent { get; set; }
|
||||
public int MinGasPPM { get; set; }
|
||||
public int MaxGasPPM { get; set; }
|
||||
public decimal MinLux { get; set; }
|
||||
public decimal MaxLux { get; set; }
|
||||
}
|
||||
|
||||
public sealed class DayCount
|
||||
{
|
||||
public string PersianDate { get; set; } = string.Empty;
|
||||
public int Count { get; set; }
|
||||
}
|
||||
|
||||
public sealed class DeviceSettingsDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int DeviceId { get; set; }
|
||||
public string DeviceName { get; set; } = string.Empty;
|
||||
|
||||
// Temperature settings
|
||||
public decimal DangerMaxTemperature { get; set; }
|
||||
public decimal DangerMinTemperature { get; set; }
|
||||
public decimal MaxTemperature { get; set; }
|
||||
public decimal MinTemperature { get; set; }
|
||||
|
||||
// Gas settings
|
||||
public int MaxGasPPM { get; set; }
|
||||
public int MinGasPPM { get; set; }
|
||||
|
||||
// Light settings
|
||||
public decimal MaxLux { get; set; }
|
||||
public decimal MinLux { get; set; }
|
||||
|
||||
// Humidity settings
|
||||
public decimal MaxHumidityPercent { get; set; }
|
||||
public decimal MinHumidityPercent { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user