Initial commit - ECommerce project

This commit is contained in:
2026-08-05 23:58:33 +03:00
commit bcebac18e7
63 changed files with 4543 additions and 0 deletions
@@ -0,0 +1,169 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Commerce.Contracts.DTOs;
using Commerce.Domain;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Commerce.Domain.Migrations
{
[DbContext(typeof(Context))]
[Migration("20260119180718_MakeTechnicalDetailsNullable")]
partial class MakeTechnicalDetailsNullable
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Commerce.Domain.Entities.Category", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Dictionary<string, string>>("Description")
.IsRequired()
.HasColumnType("jsonb");
b.Property<bool>("IsBundle")
.HasColumnType("boolean");
b.Property<Dictionary<string, string>>("Name")
.IsRequired()
.HasColumnType("jsonb");
b.Property<Guid?>("ParentCategoryId")
.HasColumnType("uuid");
b.PrimitiveCollection<string[]>("Photos")
.IsRequired()
.HasColumnType("text[]");
b.Property<Dictionary<string, List<TechnicalDetail>>>("TechnicalDetails")
.HasColumnType("jsonb");
b.HasKey("Id");
b.HasIndex("ParentCategoryId");
b.ToTable("Categories");
});
modelBuilder.Entity("Commerce.Domain.Entities.Product", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid?>("CategoryId")
.HasColumnType("uuid");
b.Property<string>("CategoryName")
.HasColumnType("text");
b.Property<string>("CodeName")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("Created")
.HasColumnType("timestamp with time zone");
b.Property<Dictionary<string, string>>("Description")
.IsRequired()
.HasColumnType("jsonb");
b.Property<double>("Discount")
.HasColumnType("double precision");
b.Property<bool>("IsBundle")
.HasColumnType("boolean");
b.Property<Dictionary<string, string>>("Name")
.IsRequired()
.HasColumnType("jsonb");
b.PrimitiveCollection<string[]>("Photos")
.IsRequired()
.HasColumnType("text[]");
b.Property<double>("Price")
.HasColumnType("double precision");
b.Property<Dictionary<string, List<TechnicalDetail>>>("TechnicalDetails")
.HasColumnType("jsonb");
b.HasKey("Id");
b.HasIndex("CategoryId");
b.ToTable("Products");
});
modelBuilder.Entity("ProductProduct", b =>
{
b.Property<Guid>("ChildProductsId")
.HasColumnType("uuid");
b.Property<Guid>("ParentBundlesId")
.HasColumnType("uuid");
b.HasKey("ChildProductsId", "ParentBundlesId");
b.HasIndex("ParentBundlesId");
b.ToTable("ProductProduct");
});
modelBuilder.Entity("Commerce.Domain.Entities.Category", b =>
{
b.HasOne("Commerce.Domain.Entities.Category", "ParentCategory")
.WithMany("ChildCategories")
.HasForeignKey("ParentCategoryId");
b.Navigation("ParentCategory");
});
modelBuilder.Entity("Commerce.Domain.Entities.Product", b =>
{
b.HasOne("Commerce.Domain.Entities.Category", "Category")
.WithMany()
.HasForeignKey("CategoryId");
b.Navigation("Category");
});
modelBuilder.Entity("ProductProduct", b =>
{
b.HasOne("Commerce.Domain.Entities.Product", null)
.WithMany()
.HasForeignKey("ChildProductsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Commerce.Domain.Entities.Product", null)
.WithMany()
.HasForeignKey("ParentBundlesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Commerce.Domain.Entities.Category", b =>
{
b.Navigation("ChildCategories");
});
#pragma warning restore 612, 618
}
}
}