Initial commit

This commit is contained in:
Kevin Harlay
2026-09-07 13:33:22 +02:00
commit ebfaf6f5ec
295 changed files with 8786 additions and 0 deletions
+302
View File
@@ -0,0 +1,302 @@
// <auto-generated />
using System;
using ExpenseTracker.Api.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace ExpenseTracker.Api.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260907100011_AddAutreCategory")]
partial class AddAutreCategory
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("ExpenseTracker.Api.Models.AppSetting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)")
.HasColumnName("key");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("text")
.HasColumnName("value");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique()
.HasDatabaseName("ix_app_settings_key_unique");
b.ToTable("app_settings", (string)null);
b.HasData(
new
{
Id = new Guid("20000000-0000-0000-0000-000000000001"),
Key = "default_salary",
Value = "0"
});
});
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(7)
.HasColumnType("character varying(7)")
.HasColumnName("color");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)")
.HasColumnName("name");
b.HasKey("Id");
b.ToTable("categories", (string)null);
b.HasData(
new
{
Id = new Guid("10000000-0000-0000-0000-000000000001"),
Color = "#f97316",
Name = "Ameublement et appareil"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000002"),
Color = "#6b7280",
Name = "Banque et assurance"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000003"),
Color = "#22c55e",
Name = "Credit"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000004"),
Color = "#eab308",
Name = "Energie"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000005"),
Color = "#ef4444",
Name = "Frais bancaires"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000006"),
Color = "#ec4899",
Name = "Hygiene"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000007"),
Color = "#dc2626",
Name = "Impots et taxes"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000008"),
Color = "#3b82f6",
Name = "Internet et telephonie"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000009"),
Color = "#8b5cf6",
Name = "Juridique et administratif"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000010"),
Color = "#64748b",
Name = "Prelevement"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000011"),
Color = "#16a34a",
Name = "Salaires"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000012"),
Color = "#a855f7",
Name = "Shopping et services"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000013"),
Color = "#0ea5e9",
Name = "Sport, Gym et Equipement"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000014"),
Color = "#94a3b8",
Name = "Transaction differee"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000015"),
Color = "#f59e0b",
Name = "Virement emis"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000016"),
Color = "#10b981",
Name = "Virement recu"
},
new
{
Id = new Guid("10000000-0000-0000-0000-000000000017"),
Color = "#6b7280",
Name = "Autre"
});
});
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<decimal>("Amount")
.HasColumnType("DECIMAL(12,2)")
.HasColumnName("amount");
b.Property<Guid?>("CategoryId")
.HasColumnType("uuid")
.HasColumnName("category_id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<DateOnly>("EntryDate")
.HasColumnType("date")
.HasColumnName("entry_date");
b.Property<string>("Label")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)")
.HasColumnName("label");
b.Property<Guid>("MonthId")
.HasColumnType("uuid")
.HasColumnName("month_id");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text")
.HasColumnName("type");
b.HasKey("Id");
b.HasIndex("CategoryId")
.HasDatabaseName("ix_entries_category_id");
b.HasIndex("MonthId")
.HasDatabaseName("ix_entries_month_id");
b.ToTable("entries", (string)null);
});
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<decimal>("DefaultSalary")
.HasColumnType("DECIMAL(12,2)")
.HasColumnName("default_salary");
b.Property<int>("MonthNumber")
.HasColumnType("integer")
.HasColumnName("month");
b.Property<int>("Year")
.HasColumnType("integer")
.HasColumnName("year");
b.HasKey("Id");
b.HasIndex("Year", "MonthNumber")
.IsUnique()
.HasDatabaseName("ix_months_year_month_unique");
b.ToTable("months", (string)null);
});
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
{
b.HasOne("ExpenseTracker.Api.Models.Category", "Category")
.WithMany("Entries")
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("ExpenseTracker.Api.Models.Month", "Month")
.WithMany("Entries")
.HasForeignKey("MonthId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Category");
b.Navigation("Month");
});
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
{
b.Navigation("Entries");
});
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
{
b.Navigation("Entries");
});
#pragma warning restore 612, 618
}
}
}