Adding units

This commit is contained in:
hz
2026-05-18 15:30:46 -05:00
parent 6366ca46c6
commit 37a46a7b36
10 changed files with 529 additions and 3 deletions
@@ -0,0 +1,36 @@
namespace LocationsApi.Models;
public class TrainUnitRequest
{
public string UnitType { get; set; } = "Scout";
}
public class UnitTrainingResponse
{
public string Id { get; set; } = "";
public string Username { get; set; } = "";
public string UnitType { get; set; } = "";
public int GoldCost { get; set; }
public string Status { get; set; } = "";
public DateTime StartedAtUtc { get; set; }
public DateTime CompletesAtUtc { get; set; }
public DateTime? CompletedAtUtc { get; set; }
public static UnitTrainingResponse FromTraining(UnitTraining training) => new()
{
Id = training.Id,
Username = training.Username,
UnitType = training.UnitType,
GoldCost = training.GoldCost,
Status = training.Status,
StartedAtUtc = training.StartedAtUtc,
CompletesAtUtc = training.CompletesAtUtc,
CompletedAtUtc = training.CompletedAtUtc
};
}
public class PlayerUnitsResponse
{
public int CompletedScouts { get; set; }
public List<UnitTrainingResponse> Training { get; set; } = [];
}