Ajout de HelloFresh

This commit is contained in:
2025-09-03 20:17:50 +02:00
parent bcef0a472b
commit d287112b7d
429 changed files with 82881 additions and 22074 deletions

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace administration.Models;
namespace administration.Models.Finances;
public partial class AdditionalSource
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace administration.Models;
namespace administration.Models.Finances;
public partial class Expense
{

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace administration.Models;
namespace administration.Models.Finances;
public partial class FinancesContext : DbContext
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace administration.Models;
namespace administration.Models.Finances;
public partial class Logo
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace administration.Models;
namespace administration.Models.Finances;
public partial class Revenue
{

17
Models/Finances/User.cs Normal file
View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace administration.Models.Finances;
public partial class User
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<AdditionalSource> AdditionalSources { get; set; } = new List<AdditionalSource>();
public virtual ICollection<Expense> Expenses { get; set; } = new List<Expense>();
public virtual ICollection<Revenue> Revenues { get; set; } = new List<Revenue>();
}

View File

@@ -0,0 +1,9 @@
namespace administration.Models.HelloFresh.DTO;
public class IngredientItemDto
{
public string Name { get; set; } = "";
public string? Quantity { get; set; }
public string? Image { get; set; }
public bool Owned { get; set; }
}

View File

@@ -0,0 +1,16 @@
using administration.Models.HelloFresh.DTO;
namespace administration.Models.DTO
{
public class SmartSearchResponse
{
public List<IngredientItemDto> Items { get; set; } = new();
public SmartSearchDebug Debug { get; set; }
}
public class SmartSearchDebug
{
public object Sent { get; set; }
public string Llm { get; set; }
}
}

View File

@@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace administration.Models.HelloFresh;
public partial class HelloFreshContext : DbContext
{
public HelloFreshContext()
{
}
public HelloFreshContext(DbContextOptions<HelloFreshContext> options)
: base(options)
{
}
public virtual DbSet<HistoriqueRecette> HistoriqueRecettes { get; set; }
public virtual DbSet<Ingredient> Ingredients { get; set; }
public virtual DbSet<Recette> Recettes { get; set; }
public virtual DbSet<SavingRecette> SavingRecettes { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseSqlServer("Server=217.154.116.43;Database=HelloFresh;User Id=sa;Password=Mf33ksTRLrPKSqQ4cTXitgiSN6BPBt89;TrustServerCertificate=True;");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<HistoriqueRecette>(entity =>
{
entity.Property(e => e.Id).HasColumnName("id");
// Map DateOnly -> date SQL
entity.Property(e => e.DateHistorique)
.HasConversion(
v => v.ToDateTime(TimeOnly.MinValue), // vers SQL
v => DateOnly.FromDateTime(v) // depuis SQL
)
.HasColumnType("date");
entity.Property(e => e.RecetteId).HasColumnName("recetteId");
entity.Property(e => e.UserId).HasColumnName("userId");
});
modelBuilder.Entity<Ingredient>(entity =>
{
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.NameOwnedIngredients).HasColumnName("nameOwnedIngredients");
});
modelBuilder.Entity<Recette>(entity =>
{
entity.HasNoKey();
entity.Property(e => e.Description).HasColumnName("description");
entity.Property(e => e.Difficulte)
.HasMaxLength(50)
.HasColumnName("difficulte");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Image).HasColumnName("image");
entity.Property(e => e.Ingredients).HasColumnName("ingredients");
entity.Property(e => e.IngredientsToHad).HasColumnName("ingredientsToHad");
entity.Property(e => e.Kcal)
.HasMaxLength(10)
.IsFixedLength()
.HasColumnName("kcal");
entity.Property(e => e.Name).HasColumnName("name");
entity.Property(e => e.Pdf).HasColumnName("pdf");
entity.Property(e => e.Preference).HasColumnName("preference");
entity.Property(e => e.Proteines)
.HasMaxLength(10)
.IsFixedLength()
.HasColumnName("proteines");
entity.Property(e => e.Slug).HasColumnName("slug");
entity.Property(e => e.SupplementText).HasColumnName("supplementText");
entity.Property(e => e.Tags).HasColumnName("tags");
entity.Property(e => e.TempsDePreparation).HasColumnName("tempsDePreparation");
});
modelBuilder.Entity<SavingRecette>(entity =>
{
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.IdSavingRecette).HasColumnName("idSavingRecette");
entity.Property(e => e.UserId).HasColumnName("userId");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace administration.Models.HelloFresh;
public partial class HistoriqueRecette
{
public int Id { get; set; }
public string RecetteId { get; set; } = ""; // <-- string pour matcher Recette.Id
public int UserId { get; set; }
public DateOnly DateHistorique { get; set; }
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace administration.Models.HelloFresh;
public partial class Ingredient
{
public int Id { get; set; }
public string NameOwnedIngredients { get; set; } = null!;
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace administration.Models.HelloFresh;
public partial class Recette
{
public string Id { get; set; } = null!;
public string? Name { get; set; }
public string? SupplementText { get; set; }
public string? Description { get; set; }
public string? Tags { get; set; }
public string? Ingredients { get; set; }
public int? Preference { get; set; }
public string? Image { get; set; }
public string? Difficulte { get; set; }
public int? TempsDePreparation { get; set; }
public string? Kcal { get; set; }
public string? Proteines { get; set; }
public string? Slug { get; set; }
public string? Pdf { get; set; }
public string? IngredientsToHad { get; set; }
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace administration.Models.HelloFresh;
public partial class SavingRecette
{
public int Id { get; set; }
public string IdSavingRecette { get; set; } = null!;
public int UserId { get; set; }
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace administration.Models;
public partial class LayoutDataContext : DbContext
{
public LayoutDataContext()
{
}
public LayoutDataContext(DbContextOptions<LayoutDataContext> options)
: base(options)
{
}
public virtual DbSet<User> Users { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseSqlServer("Server=217.154.116.43,1433;Database=LayoutData;User Id=sa;Password=Mf33ksTRLrPKSqQ4cTXitgiSN6BPBt89;TrustServerCertificate=True;");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<User>(entity =>
{
entity.HasKey(e => e.Id).HasName("PK__Users__3214EC0774A20142");
entity.HasIndex(e => e.Username, "UX_Users_Username").IsUnique();
entity.Property(e => e.CreatedAt).HasDefaultValueSql("(sysdatetimeoffset())");
entity.Property(e => e.PasswordHash).HasMaxLength(512);
entity.Property(e => e.ResetToken).HasMaxLength(256);
entity.Property(e => e.Username).HasMaxLength(100);
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@@ -7,11 +7,13 @@ public partial class User
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public string Username { get; set; } = null!;
public virtual ICollection<AdditionalSource> AdditionalSources { get; set; } = new List<AdditionalSource>();
public string PasswordHash { get; set; } = null!;
public virtual ICollection<Expense> Expenses { get; set; } = new List<Expense>();
public string? ResetToken { get; set; }
public virtual ICollection<Revenue> Revenues { get; set; } = new List<Revenue>();
public DateTimeOffset? ResetTokenExpiresAt { get; set; }
public DateTimeOffset CreatedAt { get; set; }
}