Dockerized again...
This commit is contained in:
25
.dockerignore
Normal file
25
.dockerignore
Normal file
@@ -0,0 +1,25 @@
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/.idea
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
43
docker-compose.yml
Normal file
43
docker-compose.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
services:
|
||||
webapi:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./src/Imprink.WebApi/Dockerfile
|
||||
expose:
|
||||
- "80"
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ConnectionStrings__DefaultConnection=Server=sqlserver;Database=Printbase;User Id=sa;Password=YourStrong(!)Password;Encrypt=false;TrustServerCertificate=true;MultipleActiveResultSets=true;
|
||||
depends_on:
|
||||
- mssql
|
||||
|
||||
webui:
|
||||
image: node:18-alpine
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./webui:/app
|
||||
expose:
|
||||
- "3000"
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
command: "sh -c 'npm install && npm run dev'"
|
||||
|
||||
mssql:
|
||||
image: mcr.microsoft.com/mssql/server:2022-latest
|
||||
container_name: sqlserver
|
||||
ports:
|
||||
- "1433:1433"
|
||||
environment:
|
||||
SA_PASSWORD: "YourStrong(!)Password"
|
||||
ACCEPT_EULA: "Y"
|
||||
restart: unless-stopped
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
depends_on:
|
||||
- webapi
|
||||
- webui
|
||||
33
nginx/nginx.conf
Normal file
33
nginx/nginx.conf
Normal file
@@ -0,0 +1,33 @@
|
||||
events {}
|
||||
|
||||
http {
|
||||
upstream webapi {
|
||||
server webapi:8080;
|
||||
}
|
||||
|
||||
upstream webui {
|
||||
server webui:3000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://webapi/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://webui/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Imprink.Domain.Entities.Users;
|
||||
|
||||
public class ApplicationRole : IdentityRole
|
||||
{
|
||||
public string Description { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public ApplicationRole()
|
||||
{}
|
||||
|
||||
public ApplicationRole(string roleName) : base(roleName)
|
||||
{}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using Imprink.Domain.Entities.Orders;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Imprink.Domain.Entities.Users;
|
||||
|
||||
public sealed class ApplicationUser : IdentityUser
|
||||
{
|
||||
public required string FirstName { get; set; }
|
||||
public required string LastName { get; set; }
|
||||
public DateTime? DateOfBirth { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime LastLoginAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string? ProfileImageUrl { get; set; }
|
||||
|
||||
public ICollection<Address> Addresses { get; set; } = new List<Address>();
|
||||
public ICollection<Order> Orders { get; set; } = new List<Order>();
|
||||
}
|
||||
@@ -35,11 +35,6 @@ public class OrderConfiguration : EntityBaseConfiguration<Order>
|
||||
builder.Property(o => o.Notes)
|
||||
.HasMaxLength(1000);
|
||||
|
||||
builder.HasOne<ApplicationUser>()
|
||||
.WithMany(u => u.Orders)
|
||||
.HasForeignKey(o => o.UserId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
builder.HasOne(o => o.OrderStatus)
|
||||
.WithMany(os => os.Orders)
|
||||
.HasForeignKey(o => o.OrderStatusId)
|
||||
|
||||
@@ -45,11 +45,6 @@ public class AddressConfiguration : EntityBaseConfiguration<Address>
|
||||
.IsRequired()
|
||||
.HasDefaultValue(true);
|
||||
|
||||
builder.HasOne<ApplicationUser>()
|
||||
.WithMany(u => u.Addresses)
|
||||
.HasForeignKey(a => a.UserId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
builder.HasIndex(a => a.UserId)
|
||||
.HasDatabaseName("IX_Address_UserId");
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
using Imprink.Domain.Entities.Users;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Imprink.Infrastructure.Configuration.Users;
|
||||
|
||||
public class ApplicationRoleConfiguration : IEntityTypeConfiguration<ApplicationRole>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ApplicationRole> builder)
|
||||
{
|
||||
builder.Property(r => r.Description)
|
||||
.HasMaxLength(500);
|
||||
|
||||
builder.Property(r => r.CreatedAt)
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
builder.Property(r => r.IsActive)
|
||||
.IsRequired()
|
||||
.HasDefaultValue(true);
|
||||
|
||||
builder.HasIndex(r => r.IsActive)
|
||||
.HasDatabaseName("IX_ApplicationRole_IsActive");
|
||||
|
||||
var seedDate = new DateTime(2025, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
builder.HasData(
|
||||
new ApplicationRole
|
||||
{
|
||||
Id = "1",
|
||||
Name = "Administrator",
|
||||
NormalizedName = "ADMINISTRATOR",
|
||||
Description = "Full system access",
|
||||
CreatedAt = seedDate,
|
||||
IsActive = true
|
||||
},
|
||||
new ApplicationRole
|
||||
{
|
||||
Id = "2",
|
||||
Name = "Customer",
|
||||
NormalizedName = "CUSTOMER",
|
||||
Description = "Standard customer access",
|
||||
CreatedAt = seedDate,
|
||||
IsActive = true
|
||||
},
|
||||
new ApplicationRole
|
||||
{
|
||||
Id = "3",
|
||||
Name = "OrderManager",
|
||||
NormalizedName = "ORDERMANAGER",
|
||||
Description = "Manage orders and fulfillment",
|
||||
CreatedAt = seedDate,
|
||||
IsActive = true
|
||||
},
|
||||
new ApplicationRole
|
||||
{
|
||||
Id = "4",
|
||||
Name = "ProductManager",
|
||||
NormalizedName = "PRODUCTMANAGER",
|
||||
Description = "Manage products and inventory",
|
||||
CreatedAt = seedDate,
|
||||
IsActive = true
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using Imprink.Domain.Entities.Users;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Imprink.Infrastructure.Configuration.Users;
|
||||
|
||||
public class ApplicationUserConfiguration : IEntityTypeConfiguration<ApplicationUser>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ApplicationUser> builder)
|
||||
{
|
||||
builder.Property(u => u.FirstName)
|
||||
.HasMaxLength(100);
|
||||
|
||||
builder.Property(u => u.LastName)
|
||||
.HasMaxLength(100);
|
||||
|
||||
builder.Property(u => u.ProfileImageUrl)
|
||||
.HasMaxLength(500);
|
||||
|
||||
builder.Property(u => u.CreatedAt)
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
builder.Property(u => u.LastLoginAt)
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
builder.Property(u => u.IsActive)
|
||||
.HasDefaultValue(true);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
namespace Imprink.Infrastructure.Database;
|
||||
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
||||
: IdentityDbContext<ApplicationUser, ApplicationRole, string>(options)
|
||||
: DbContext(options)
|
||||
{
|
||||
public DbSet<Product> Products { get; set; }
|
||||
public DbSet<ProductVariant> ProductVariants { get; set; }
|
||||
@@ -26,9 +26,6 @@ public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.ApplyConfiguration(new ApplicationUserConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new ApplicationRoleConfiguration());
|
||||
|
||||
modelBuilder.ApplyConfiguration(new ProductConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new ProductVariantConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new OrderConfiguration());
|
||||
|
||||
@@ -9,10 +9,10 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Printbase.Infrastructure.Migrations
|
||||
namespace Imprink.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20250527103204_InitialSetup")]
|
||||
[Migration("20250603173128_InitialSetup")]
|
||||
partial class InitialSetup
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -25,113 +25,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -216,7 +110,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderAddress", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderAddress", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -287,7 +181,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("OrderAddresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderItem", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderItem", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -368,7 +262,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("OrderItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderStatus", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int");
|
||||
@@ -409,7 +303,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int");
|
||||
@@ -450,7 +344,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Category", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -567,7 +461,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Product", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -651,7 +545,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("Products");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.ProductVariant", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -737,7 +631,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("ProductVariants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.Address", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Users.Address", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -830,288 +724,51 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationRole", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IsActive")
|
||||
.HasDatabaseName("IX_ApplicationRole_IsActive");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex")
|
||||
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "1",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Full system access",
|
||||
IsActive = true,
|
||||
Name = "Administrator",
|
||||
NormalizedName = "ADMINISTRATOR"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "2",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Standard customer access",
|
||||
IsActive = true,
|
||||
Name = "Customer",
|
||||
NormalizedName = "CUSTOMER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "3",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Manage orders and fulfillment",
|
||||
IsActive = true,
|
||||
Name = "OrderManager",
|
||||
NormalizedName = "ORDERMANAGER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "4",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Manage products and inventory",
|
||||
IsActive = true,
|
||||
Name = "ProductManager",
|
||||
NormalizedName = "PRODUCTMANAGER"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
b.Property<DateTime?>("DateOfBirth")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<DateTime>("LastLoginAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("ProfileImageUrl")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex")
|
||||
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.OrderStatus", "OrderStatus")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.OrderStatus", "OrderStatus")
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("OrderStatusId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.ShippingStatus", "ShippingStatus")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.ShippingStatus", "ShippingStatus")
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("ShippingStatusId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("OrderStatus");
|
||||
|
||||
b.Navigation("ShippingStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderAddress", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderAddress", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.Order", "Order")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.Order", "Order")
|
||||
.WithOne("OrderAddress")
|
||||
.HasForeignKey("Printbase.Domain.Entities.Orders.OrderAddress", "OrderId")
|
||||
.HasForeignKey("Imprink.Domain.Entities.Orders.OrderAddress", "OrderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderItem", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderItem", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.Order", "Order")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.Order", "Order")
|
||||
.WithMany("OrderItems")
|
||||
.HasForeignKey("OrderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Product", "Product")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Product", "Product")
|
||||
.WithMany("OrderItems")
|
||||
.HasForeignKey("ProductId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Product.ProductVariant", "ProductVariant")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.ProductVariant", "ProductVariant")
|
||||
.WithMany("OrderItems")
|
||||
.HasForeignKey("ProductVariantId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
@@ -1123,9 +780,9 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("ProductVariant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Category", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Category", "ParentCategory")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Category", "ParentCategory")
|
||||
.WithMany("SubCategories")
|
||||
.HasForeignKey("ParentCategoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
@@ -1133,9 +790,9 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("ParentCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Product", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Category", "Category")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Category", "Category")
|
||||
.WithMany("Products")
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
@@ -1143,9 +800,9 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("Category");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.ProductVariant", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Product", "Product")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Product", "Product")
|
||||
.WithMany("ProductVariants")
|
||||
.HasForeignKey("ProductId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -1154,16 +811,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("Product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.Address", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany("Addresses")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.Navigation("OrderAddress")
|
||||
.IsRequired();
|
||||
@@ -1171,41 +819,34 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("OrderItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderStatus", b =>
|
||||
{
|
||||
b.Navigation("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
{
|
||||
b.Navigation("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Category", b =>
|
||||
{
|
||||
b.Navigation("Products");
|
||||
|
||||
b.Navigation("SubCategories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Product", b =>
|
||||
{
|
||||
b.Navigation("OrderItems");
|
||||
|
||||
b.Navigation("ProductVariants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.ProductVariant", b =>
|
||||
{
|
||||
b.Navigation("OrderItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationUser", b =>
|
||||
{
|
||||
b.Navigation("Addresses");
|
||||
|
||||
b.Navigation("Orders");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace Printbase.Infrastructure.Migrations
|
||||
namespace Imprink.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialSetup : Migration
|
||||
@@ -14,52 +14,27 @@ namespace Printbase.Infrastructure.Migrations
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetRoles",
|
||||
name: "Addresses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
|
||||
UserId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
|
||||
AddressType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
Street = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
City = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
State = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
PostalCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
|
||||
Country = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
IsDefault = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
|
||||
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUsers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
LastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
DateOfBirth = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
|
||||
LastLoginAt = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
|
||||
ProfileImageUrl = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false),
|
||||
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false),
|
||||
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false),
|
||||
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
||||
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false),
|
||||
AccessFailedCount = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
|
||||
table.PrimaryKey("PK_Addresses", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
@@ -113,142 +88,6 @@ namespace Printbase.Infrastructure.Migrations
|
||||
table.PrimaryKey("PK_ShippingStatuses", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetRoleClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Addresses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
|
||||
UserId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
|
||||
AddressType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
Street = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
City = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
State = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
PostalCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
|
||||
Country = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
IsDefault = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Addresses", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Addresses_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserLogins",
|
||||
columns: table => new
|
||||
{
|
||||
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
ProviderKey = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserRoles",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserTokens",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Products",
|
||||
columns: table => new
|
||||
@@ -297,12 +136,6 @@ namespace Printbase.Infrastructure.Migrations
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Orders", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Orders_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Orders_OrderStatuses_OrderStatusId",
|
||||
column: x => x.OrderStatusId,
|
||||
@@ -414,17 +247,6 @@ namespace Printbase.Infrastructure.Migrations
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "CreatedAt", "Description", "IsActive", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "1", null, new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), "Full system access", true, "Administrator", "ADMINISTRATOR" },
|
||||
{ "2", null, new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), "Standard customer access", true, "Customer", "CUSTOMER" },
|
||||
{ "3", null, new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), "Manage orders and fulfillment", true, "OrderManager", "ORDERMANAGER" },
|
||||
{ "4", null, new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), "Manage products and inventory", true, "ProductManager", "PRODUCTMANAGER" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Categories",
|
||||
columns: new[] { "Id", "CreatedAt", "CreatedBy", "Description", "ImageUrl", "IsActive", "ModifiedAt", "ModifiedBy", "Name", "ParentCategoryId", "SortOrder" },
|
||||
@@ -487,50 +309,6 @@ namespace Printbase.Infrastructure.Migrations
|
||||
table: "Addresses",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetRoleClaims_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApplicationRole_IsActive",
|
||||
table: "AspNetRoles",
|
||||
column: "IsActive");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "RoleNameIndex",
|
||||
table: "AspNetRoles",
|
||||
column: "NormalizedName",
|
||||
unique: true,
|
||||
filter: "[NormalizedName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUserClaims_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUserLogins_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUserRoles_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "EmailIndex",
|
||||
table: "AspNetUsers",
|
||||
column: "NormalizedEmail");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UserNameIndex",
|
||||
table: "AspNetUsers",
|
||||
column: "NormalizedUserName",
|
||||
unique: true,
|
||||
filter: "[NormalizedUserName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Category_Active_SortOrder",
|
||||
table: "Categories",
|
||||
@@ -775,39 +553,18 @@ namespace Printbase.Infrastructure.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "Addresses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetRoleClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserLogins");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUserTokens");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderAddresses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderItems");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Orders");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ProductVariants");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUsers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderStatuses");
|
||||
|
||||
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Printbase.Infrastructure.Migrations
|
||||
namespace Imprink.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
||||
@@ -22,113 +22,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -213,7 +107,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderAddress", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderAddress", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -284,7 +178,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("OrderAddresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderItem", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderItem", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -365,7 +259,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("OrderItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderStatus", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int");
|
||||
@@ -406,7 +300,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int");
|
||||
@@ -447,7 +341,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Category", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -564,7 +458,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Product", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -648,7 +542,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("Products");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.ProductVariant", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -734,7 +628,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("ProductVariants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.Address", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Users.Address", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -827,288 +721,51 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationRole", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IsActive")
|
||||
.HasDatabaseName("IX_ApplicationRole_IsActive");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex")
|
||||
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "1",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Full system access",
|
||||
IsActive = true,
|
||||
Name = "Administrator",
|
||||
NormalizedName = "ADMINISTRATOR"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "2",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Standard customer access",
|
||||
IsActive = true,
|
||||
Name = "Customer",
|
||||
NormalizedName = "CUSTOMER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "3",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Manage orders and fulfillment",
|
||||
IsActive = true,
|
||||
Name = "OrderManager",
|
||||
NormalizedName = "ORDERMANAGER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "4",
|
||||
CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Description = "Manage products and inventory",
|
||||
IsActive = true,
|
||||
Name = "ProductManager",
|
||||
NormalizedName = "PRODUCTMANAGER"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
b.Property<DateTime?>("DateOfBirth")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<DateTime>("LastLoginAt")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("datetime2")
|
||||
.HasDefaultValueSql("GETUTCDATE()");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("ProfileImageUrl")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex")
|
||||
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.OrderStatus", "OrderStatus")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.OrderStatus", "OrderStatus")
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("OrderStatusId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.ShippingStatus", "ShippingStatus")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.ShippingStatus", "ShippingStatus")
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("ShippingStatusId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany("Orders")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("OrderStatus");
|
||||
|
||||
b.Navigation("ShippingStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderAddress", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderAddress", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.Order", "Order")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.Order", "Order")
|
||||
.WithOne("OrderAddress")
|
||||
.HasForeignKey("Printbase.Domain.Entities.Orders.OrderAddress", "OrderId")
|
||||
.HasForeignKey("Imprink.Domain.Entities.Orders.OrderAddress", "OrderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Order");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderItem", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderItem", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Orders.Order", "Order")
|
||||
b.HasOne("Imprink.Domain.Entities.Orders.Order", "Order")
|
||||
.WithMany("OrderItems")
|
||||
.HasForeignKey("OrderId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Product", "Product")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Product", "Product")
|
||||
.WithMany("OrderItems")
|
||||
.HasForeignKey("ProductId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Printbase.Domain.Entities.Product.ProductVariant", "ProductVariant")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.ProductVariant", "ProductVariant")
|
||||
.WithMany("OrderItems")
|
||||
.HasForeignKey("ProductVariantId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
@@ -1120,9 +777,9 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("ProductVariant");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Category", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Category", "ParentCategory")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Category", "ParentCategory")
|
||||
.WithMany("SubCategories")
|
||||
.HasForeignKey("ParentCategoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
@@ -1130,9 +787,9 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("ParentCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Product", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Category", "Category")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Category", "Category")
|
||||
.WithMany("Products")
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
@@ -1140,9 +797,9 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("Category");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.ProductVariant", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Product.Product", "Product")
|
||||
b.HasOne("Imprink.Domain.Entities.Product.Product", "Product")
|
||||
.WithMany("ProductVariants")
|
||||
.HasForeignKey("ProductId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -1151,16 +808,7 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("Product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.Address", b =>
|
||||
{
|
||||
b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
|
||||
.WithMany("Addresses")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.Order", b =>
|
||||
{
|
||||
b.Navigation("OrderAddress")
|
||||
.IsRequired();
|
||||
@@ -1168,41 +816,34 @@ namespace Printbase.Infrastructure.Migrations
|
||||
b.Navigation("OrderItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.OrderStatus", b =>
|
||||
{
|
||||
b.Navigation("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Orders.ShippingStatus", b =>
|
||||
{
|
||||
b.Navigation("Orders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Category", b =>
|
||||
{
|
||||
b.Navigation("Products");
|
||||
|
||||
b.Navigation("SubCategories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.Product", b =>
|
||||
{
|
||||
b.Navigation("OrderItems");
|
||||
|
||||
b.Navigation("ProductVariants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
|
||||
modelBuilder.Entity("Imprink.Domain.Entities.Product.ProductVariant", b =>
|
||||
{
|
||||
b.Navigation("OrderItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationUser", b =>
|
||||
{
|
||||
b.Navigation("Addresses");
|
||||
|
||||
b.Navigation("Orders");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
||||
25
src/Imprink.WebApi/Dockerfile
Normal file
25
src/Imprink.WebApi/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["src/Imprink.WebApi/Imprink.WebApi.csproj", "src/Imprink.WebApi/"]
|
||||
COPY ["src/Imprink.Application/Imprink.Application.csproj", "src/Imprink.Application/"]
|
||||
COPY ["src/Imprink.Domain/Imprink.Domain.csproj", "src/Imprink.Domain/"]
|
||||
COPY ["src/Imprink.Infrastructure/Imprink.Infrastructure.csproj", "src/Imprink.Infrastructure/"]
|
||||
RUN dotnet restore "src/Imprink.WebApi/Imprink.WebApi.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/src/Imprink.WebApi"
|
||||
RUN dotnet build "Imprink.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "Imprink.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Imprink.WebApi.dll"]
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -21,4 +22,10 @@
|
||||
<ProjectReference Include="..\Imprink.Infrastructure\Imprink.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\..\.dockerignore">
|
||||
<Link>.dockerignore</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using Imprink.Application;
|
||||
using Imprink.Application.Products.Handlers;
|
||||
using Imprink.Domain.Entities.Users;
|
||||
using Imprink.Domain.Repositories;
|
||||
using Imprink.Infrastructure;
|
||||
using Imprink.Infrastructure.Database;
|
||||
using Imprink.Infrastructure.Repositories;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Imprink.WebApi;
|
||||
@@ -30,52 +28,6 @@ public static class Startup
|
||||
{
|
||||
cfg.RegisterServicesFromAssembly(typeof(CreateProductHandler).Assembly);
|
||||
});
|
||||
|
||||
services.AddIdentity<ApplicationUser, ApplicationRole>(options =>
|
||||
{
|
||||
options.Password.RequireDigit = true;
|
||||
options.Password.RequireLowercase = true;
|
||||
options.Password.RequireUppercase = true;
|
||||
options.Password.RequireNonAlphanumeric = true;
|
||||
options.Password.RequiredLength = 8;
|
||||
options.Password.RequiredUniqueChars = 1;
|
||||
|
||||
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(30);
|
||||
options.Lockout.MaxFailedAccessAttempts = 5;
|
||||
options.Lockout.AllowedForNewUsers = true;
|
||||
|
||||
options.User.AllowedUserNameCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+";
|
||||
options.User.RequireUniqueEmail = true;
|
||||
|
||||
options.SignIn.RequireConfirmedEmail = true;
|
||||
options.SignIn.RequireConfirmedPhoneNumber = false;
|
||||
})
|
||||
.AddEntityFrameworkStores<ApplicationDbContext>()
|
||||
.AddDefaultTokenProviders();
|
||||
|
||||
services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
options.Cookie.HttpOnly = true;
|
||||
options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
|
||||
options.LoginPath = "/Account/Login";
|
||||
options.AccessDeniedPath = "/Account/AccessDenied";
|
||||
options.SlidingExpiration = true;
|
||||
});
|
||||
|
||||
services.Configure<DataProtectionTokenProviderOptions>(options =>
|
||||
{
|
||||
options.TokenLifespan = TimeSpan.FromHours(24);
|
||||
});
|
||||
|
||||
services.AddAuthorizationBuilder()
|
||||
.AddPolicy("AdminPolicy", policy =>
|
||||
policy.RequireRole("Administrator"))
|
||||
.AddPolicy("OrderManagementPolicy", policy =>
|
||||
policy.RequireRole("Administrator", "OrderManager"))
|
||||
.AddPolicy("ProductManagementPolicy", policy =>
|
||||
policy.RequireRole("Administrator", "ProductManager"))
|
||||
.AddPolicy("CustomerPolicy", policy =>
|
||||
policy.RequireRole("Customer", "Administrator", "OrderManager", "ProductManager"));
|
||||
|
||||
services.AddControllers();
|
||||
services.AddSwaggerGen();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=localhost;Database=Printbase;Encrypt=false;Trusted_Connection=True;TrustServerCertificate=true;MultipleActiveResultSets=true;"
|
||||
"DefaultConnection": ""
|
||||
},
|
||||
"DatabaseOptions": {
|
||||
"ApplyMigrationsAtStartup": true
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=localhost;Database=Printbase;Encrypt=false;TrustServerCertificate=true;Trusted_Connection=True;MultipleActiveResultSets=true;"
|
||||
"DefaultConnection": ""
|
||||
},
|
||||
"DatabaseOptions": {
|
||||
"ApplyMigrationsAtStartup": true
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
FROM node:18
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
||||
@@ -1,14 +0,0 @@
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
const eslintConfig = [...compat.extends("next/core-web-vitals")];
|
||||
|
||||
export default eslintConfig;
|
||||
4972
webui/package-lock.json
generated
4972
webui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"name": "webui",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -11,13 +11,10 @@
|
||||
"dependencies": {
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"next": "15.2.4"
|
||||
"next": "15.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"tailwindcss": "^4",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "15.2.4",
|
||||
"@eslint/eslintrc": "^3"
|
||||
"tailwindcss": "^4"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user