···11+namespace TestWeb.Core.WeatherForecasts;
22+33+public static class WeatherForecastsModule
44+{
55+ public const string Prefix = "/api/weatherforecasts";
66+77+ public static void MapEndpoints(IEndpointRouteBuilder endpoints)
88+ {
99+ var group = endpoints.MapGroup("/api/weatherforecasts")
1010+ .WithTags("WeatherForecasts")
1111+ .AllowAnonymous();
1212+ group.MapGet("/", GetWeatherForecastsEndpoint.Handle)
1313+ .WithSummary("Get weather forecast list");
1414+ }
1515+}
+4
src/Global.Usings.cs
···11+global using FluentValidation;
22+global using Microsoft.AspNetCore.Authentication.JwtBearer;
33+global using Microsoft.AspNetCore.Http.HttpResults;
44+global using Microsoft.EntityFrameworkCore;
+17
src/Infra/AppDbContext.cs
···11+namespace TestWeb.Infra;
22+33+public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
44+{
55+ public DbSet<Job> Jobs
66+ {
77+ get; set;
88+ }
99+ public DbSet<User> Users
1010+ {
1111+ get; set;
1212+ }
1313+ public DbSet<Vehicle> Vehicles
1414+ {
1515+ get; set;
1616+ }
1717+}
+33
src/Infra/Job.cs
···11+using System.ComponentModel.DataAnnotations;
22+33+namespace TestWeb.Infra;
44+55+public class Job
66+{
77+ [Key]
88+ public int Id
99+ {
1010+ get; init;
1111+ }
1212+ public required string ClientName
1313+ {
1414+ get; set;
1515+ }
1616+ public required string Pickup
1717+ {
1818+ get; set;
1919+ }
2020+ public string? Dropoff
2121+ {
2222+ get; set;
2323+ }
2424+ public int VehicleId
2525+ {
2626+ get; set;
2727+ }
2828+ public DateTime DateCreated { get; private init; } = DateTime.UtcNow;
2929+ public DateTime? LastUpdated
3030+ {
3131+ get; set;
3232+ }
3333+}
+29
src/Infra/User.cs
···11+using System.ComponentModel.DataAnnotations;
22+33+namespace TestWeb.Infra;
44+55+public class User
66+{
77+ [Key]
88+ public int Id
99+ {
1010+ get; init;
1111+ }
1212+ public required string Username
1313+ {
1414+ get; set;
1515+ }
1616+ public required string Password
1717+ {
1818+ get; set;
1919+ }
2020+ public required string DisplayName
2121+ {
2222+ get; set;
2323+ }
2424+ public DateTime DateCreated { get; private init; } = DateTime.UtcNow;
2525+ public DateTime? LastUpdated
2626+ {
2727+ get; set;
2828+ }
2929+}
+29
src/Infra/Vehicle.cs
···11+using System.ComponentModel.DataAnnotations;
22+33+namespace TestWeb.Infra;
44+55+public class Vehicle
66+{
77+ [Key]
88+ public int Id
99+ {
1010+ get; init;
1111+ }
1212+ public required string Make
1313+ {
1414+ get; set;
1515+ }
1616+ public required string Model
1717+ {
1818+ get; set;
1919+ }
2020+ public required int Year
2121+ {
2222+ get; set;
2323+ }
2424+ public DateTime DateCreated { get; private init; } = DateTime.UtcNow;
2525+ public DateTime? LastUpdated
2626+ {
2727+ get; set;
2828+ }
2929+}