Add GenerateSku Tests
This commit is contained in:
@@ -83,7 +83,7 @@ public class CreateProductCommandHandler(
|
||||
return productDto;
|
||||
}
|
||||
|
||||
private static string GenerateSku(string productName, string? color, string? size)
|
||||
public static string GenerateSku(string productName, string? color, string? size)
|
||||
{
|
||||
var prefix = productName.Length >= 3 ? productName[..3].ToUpper() : productName.ToUpper();
|
||||
var colorPart = !string.IsNullOrEmpty(color) ? color[..Math.Min(3, color.Length)].ToUpper() : "XXX";
|
||||
|
||||
@@ -3,7 +3,7 @@ using Printbase.Infrastructure.DbEntities.Products;
|
||||
|
||||
namespace Printbase.Infrastructure.Database;
|
||||
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : DbContext(options)
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext>? options) : DbContext(options)
|
||||
{
|
||||
public DbSet<ProductDbEntity> Products { get; set; } = null!;
|
||||
public DbSet<ProductVariantDbEntity> ProductVariants { get; set; } = null!;
|
||||
|
||||
Reference in New Issue
Block a user