127 lines
3.7 KiB
C#
127 lines
3.7 KiB
C#
namespace HuntingAppApi.Models;
|
|
|
|
public sealed record PointDto(double Latitude, double Longitude);
|
|
public sealed record ApiId(Guid Id);
|
|
|
|
public sealed class HuntAreaDto
|
|
{
|
|
public Guid Id { get; set; }
|
|
public string Name { get; set; } = "";
|
|
public string? Description { get; set; }
|
|
public string? GeoJson { get; set; }
|
|
}
|
|
|
|
public sealed class CreateHuntAreaRequest
|
|
{
|
|
public string Name { get; set; } = "";
|
|
public string? Description { get; set; }
|
|
public string? GeoJson { get; set; }
|
|
}
|
|
|
|
public sealed class CreateMapPointRequest
|
|
{
|
|
public Guid HuntAreaId { get; set; }
|
|
public string Type { get; set; } = "HuntingTower";
|
|
public string Name { get; set; } = "";
|
|
public string? Description { get; set; }
|
|
public double Latitude { get; set; }
|
|
public double Longitude { get; set; }
|
|
public string? ImageUrl { get; set; }
|
|
}
|
|
|
|
public sealed class MapPointDto
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid HuntAreaId { get; set; }
|
|
public string Type { get; set; } = "";
|
|
public string? Icon { get; set; }
|
|
public string? Color { get; set; }
|
|
public string Name { get; set; } = "";
|
|
public string? Description { get; set; }
|
|
public double Latitude { get; set; }
|
|
public double Longitude { get; set; }
|
|
public string? ImageUrl { get; set; }
|
|
}
|
|
|
|
public sealed class CreateHuntRequest
|
|
{
|
|
public Guid HuntAreaId { get; set; }
|
|
public string Title { get; set; } = "";
|
|
public string? Description { get; set; }
|
|
public DateTimeOffset? StartsAt { get; set; }
|
|
public DateTimeOffset? EndsAt { get; set; }
|
|
}
|
|
|
|
public sealed class HuntDto
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid HuntAreaId { get; set; }
|
|
public string Title { get; set; } = "";
|
|
public string? Description { get; set; }
|
|
public DateTimeOffset? StartsAt { get; set; }
|
|
public DateTimeOffset? EndsAt { get; set; }
|
|
public string Status { get; set; } = "";
|
|
}
|
|
|
|
public sealed class JoinHuntRequest
|
|
{
|
|
public Guid UserId { get; set; }
|
|
public string Role { get; set; } = "hunter";
|
|
}
|
|
|
|
public sealed class AssignParticipantRequest
|
|
{
|
|
public Guid ParticipantId { get; set; }
|
|
public Guid MapPointId { get; set; }
|
|
public string? Note { get; set; }
|
|
}
|
|
|
|
public sealed class ParticipantLocationDto
|
|
{
|
|
public Guid ParticipantId { get; set; }
|
|
public Guid UserId { get; set; }
|
|
public string DisplayName { get; set; } = "";
|
|
public string? Color { get; set; }
|
|
public double? Latitude { get; set; }
|
|
public double? Longitude { get; set; }
|
|
public decimal? AccuracyM { get; set; }
|
|
public int? BatteryPercent { get; set; }
|
|
public DateTimeOffset? RecordedAt { get; set; }
|
|
}
|
|
|
|
public sealed class UpsertLocationRequest
|
|
{
|
|
public Guid ParticipantId { get; set; }
|
|
public double Latitude { get; set; }
|
|
public double Longitude { get; set; }
|
|
public decimal? AccuracyM { get; set; }
|
|
public decimal? SpeedMps { get; set; }
|
|
public decimal? HeadingDegrees { get; set; }
|
|
public int? BatteryPercent { get; set; }
|
|
public DateTimeOffset RecordedAt { get; set; }
|
|
}
|
|
|
|
public sealed class ExternalLoginRequest
|
|
{
|
|
public string Provider { get; set; } = ""; // google or microsoft
|
|
public string IdToken { get; set; } = "";
|
|
}
|
|
|
|
public sealed class LoginResponse
|
|
{
|
|
public Guid UserId { get; set; }
|
|
public string DisplayName { get; set; } = "";
|
|
public string? Email { get; set; }
|
|
public string Token { get; set; } = "";
|
|
}
|
|
|
|
public sealed class ExternalUserInfo
|
|
{
|
|
public string Provider { get; set; } = "";
|
|
public string Subject { get; set; } = "";
|
|
public string? Email { get; set; }
|
|
public bool EmailVerified { get; set; }
|
|
public string DisplayName { get; set; } = "";
|
|
public string? AvatarUrl { get; set; }
|
|
}
|