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

@@ -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; }
}