Application complète de saisie et de suivi des trajets kilométriques avec calcul de distance routière (OpenRouteService), barème kilométrique, résumés et régularisation annuelle. Backend (ASP.NET Core .NET 8, EF Core, SQLite) : - Trajets (CRUD, réordonnancement, insertion), calcul de distance ORS avec fallback Haversine, géométrie d'itinéraire stockée par trajet, recalcul en masse. - Profil, véhicules (avec dénomination), carnet d'adresses nommées, cache d'adresses. - Barème kilométrique : tranches multiples par puissance fiscale, borne max exclusive avec 'illimité' (KmMax nullable), coefficient à 3 décimales, recopie du dernier barème connu. - Résumés mensuel/annuel, montants réglés, régularisation, export PDF. Frontend (Angular 22, zoneless + signals) : - Consultation par jour, navigation temporelle synchronisée, carte Leaflet, formulaire de trajet (adresses nommées, domicile, autocomplétion BAN). - Détection de changement zoneless (indépendante de zone.js). Hébergement : Docker Compose (nginx + backend), scripts run-dev.sh / run-docker.sh.
326 lines
11 KiB
C#
326 lines
11 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using TrajetKmTracker.Api.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace TrajetKmTracker.Api.Data.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
[Migration("20260913083053_InitialCreate")]
|
|
partial class InitialCreate
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.AdresseCache", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Adresse")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("DerniereUtilisation")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("GeometrieJson")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<double>("Latitude")
|
|
.HasColumnType("REAL");
|
|
|
|
b.Property<double>("Longitude")
|
|
.HasColumnType("REAL");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Adresse")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AdresseCache", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.AdresseNommee", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Adresse")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Denomination")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("DenominationNormalisee")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("GeocodageReussi")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<double?>("Latitude")
|
|
.HasColumnType("REAL");
|
|
|
|
b.Property<double?>("Longitude")
|
|
.HasColumnType("REAL");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex(new[] { "DenominationNormalisee" }, "UX_AdresseNommee_Denomination")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AdressesNommees", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.MontantRegle", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("Annee")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("Mois")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal>("Montant")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("VehiculeId")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("VehiculeId");
|
|
|
|
b.HasIndex(new[] { "Annee", "Mois", "VehiculeId" }, "UX_MontantsRegles_Periode_Vehicule")
|
|
.IsUnique();
|
|
|
|
b.ToTable("MontantsRegles", null, t =>
|
|
{
|
|
t.HasCheckConstraint("CK_MontantsRegles_Mois", "\"Mois\" BETWEEN 1 AND 12");
|
|
|
|
t.HasCheckConstraint("CK_MontantsRegles_Montant", "\"Montant\" >= 0");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.Profil", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("AdresseDomicile")
|
|
.HasMaxLength(255)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("DomicileGeocode")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<double?>("DomicileLatitude")
|
|
.HasColumnType("REAL");
|
|
|
|
b.Property<double?>("DomicileLongitude")
|
|
.HasColumnType("REAL");
|
|
|
|
b.Property<string>("Matricule")
|
|
.HasMaxLength(8)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Nom")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Prenom")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex(new[] { "Id" }, "UX_Profil_Singleton")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Profil", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.Trajet", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("AdresseArrivee")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("AdresseDepart")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Commentaire")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateOnly>("Date")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Distance")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Position")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("PuissanceFiscale")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("VehiculeId")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex(new[] { "Date" }, "IX_Trajets_Date");
|
|
|
|
b.HasIndex(new[] { "Date", "Position" }, "IX_Trajets_Date_Position");
|
|
|
|
b.HasIndex(new[] { "VehiculeId" }, "IX_Trajets_Vehicule");
|
|
|
|
b.ToTable("Trajets", null, t =>
|
|
{
|
|
t.HasCheckConstraint("CK_Trajets_Distance", "\"Distance\" > 0");
|
|
|
|
t.HasCheckConstraint("CK_Trajets_PuissanceFiscale", "\"PuissanceFiscale\" > 0");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.TrancheBareme", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("Annee")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal>("Base")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Coefficient")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("KmMax")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("KmMin")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("PuissanceFiscale")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex(new[] { "Annee", "PuissanceFiscale" }, "IX_TranchesBareme_Annee_PF");
|
|
|
|
b.ToTable("TranchesBareme", null, t =>
|
|
{
|
|
t.HasCheckConstraint("CK_TranchesBareme_Km", "\"KmMin\" <= \"KmMax\"");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.Vehicule", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateOnly>("DateEffet")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Plaque")
|
|
.IsRequired()
|
|
.HasMaxLength(15)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("PuissanceFiscale")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex(new[] { "DateEffet" }, "IX_Vehicules_DateEffet");
|
|
|
|
b.ToTable("Vehicules", null, t =>
|
|
{
|
|
t.HasCheckConstraint("CK_Vehicules_PuissanceFiscale", "\"PuissanceFiscale\" > 0");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.MontantRegle", b =>
|
|
{
|
|
b.HasOne("TrajetKmTracker.Api.Models.Entities.Vehicule", "Vehicule")
|
|
.WithMany()
|
|
.HasForeignKey("VehiculeId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Vehicule");
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.Trajet", b =>
|
|
{
|
|
b.HasOne("TrajetKmTracker.Api.Models.Entities.Vehicule", "Vehicule")
|
|
.WithMany("Trajets")
|
|
.HasForeignKey("VehiculeId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Vehicule");
|
|
});
|
|
|
|
modelBuilder.Entity("TrajetKmTracker.Api.Models.Entities.Vehicule", b =>
|
|
{
|
|
b.Navigation("Trajets");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|