image änderungen
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
// Auto-generiert von CreateWebshopFiles.ps1
|
||||
// src/Webshop.Application/DTOs/Products/AdminProductDto.cs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace Webshop.Application.DTOs.Products
|
||||
{
|
||||
@@ -18,12 +16,13 @@ namespace Webshop.Application.DTOs.Products
|
||||
public bool IsInStock { get; set; } = true;
|
||||
public int StockQuantity { get; set; }
|
||||
public decimal? Weight { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
// << ENTFERNT: ImageUrl >>
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public DateTimeOffset CreatedDate { get; set; } = DateTimeOffset.UtcNow;
|
||||
public DateTimeOffset? LastModifiedDate { get; set; }
|
||||
public Guid? SupplierId { get; set; }
|
||||
public decimal? PurchasePrice { get; set; }
|
||||
public List<Guid> categorieIds { get; set; } = new List<Guid>();
|
||||
public List<ProductImageDto> Images { get; set; } = new List<ProductImageDto>(); // << NEU >>
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Webshop.Application/DTOs/Products/CreateAdminProductDto.cs
Normal file
36
Webshop.Application/DTOs/Products/CreateAdminProductDto.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
// src/Webshop.Application/DTOs/Products/CreateAdminProductDto.cs
|
||||
using Microsoft.AspNetCore.Http; // Für IFormFile
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Webshop.Application.DTOs.Products
|
||||
{
|
||||
public class CreateAdminProductDto
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
[Required]
|
||||
public string SKU { get; set; }
|
||||
[Required]
|
||||
public decimal Price { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public bool IsInStock { get; set; } = true;
|
||||
public int StockQuantity { get; set; }
|
||||
[Required]
|
||||
public string Slug { get; set; }
|
||||
|
||||
// << NEU: Felder für den Bildupload >>
|
||||
public IFormFile? MainImageFile { get; set; }
|
||||
public List<IFormFile>? AdditionalImageFiles { get; set; }
|
||||
|
||||
public List<Guid> CategorieIds { get; set; } = new List<Guid>();
|
||||
|
||||
// ... weitere Felder, die beim Erstellen benötigt werden (z.B. SupplierId, PurchasePrice etc.) ...
|
||||
public decimal? Weight { get; set; }
|
||||
public decimal? OldPrice { get; set; }
|
||||
public Guid? SupplierId { get; set; }
|
||||
public decimal? PurchasePrice { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
// Auto-generiert von CreateWebshopFiles.ps1
|
||||
// src/Webshop.Application/DTOs/Products/ProductDto.cs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Webshop.Application.DTOs.Categorie;
|
||||
|
||||
|
||||
namespace Webshop.Application.DTOs.Products
|
||||
{
|
||||
public class ProductDto
|
||||
@@ -17,8 +15,9 @@ namespace Webshop.Application.DTOs.Products
|
||||
public bool IsActive { get; set; }
|
||||
public bool IsInStock { get; set; }
|
||||
public int StockQuantity { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
// << ENTFERNT: ImageUrl >>
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public List<CategorieDto> categories { get; set; } = new List<CategorieDto>();
|
||||
public List<ProductImageDto> Images { get; set; } = new List<ProductImageDto>(); // << NEU >>
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Webshop.Application/DTOs/Products/ProductImageDto.cs
Normal file
13
Webshop.Application/DTOs/Products/ProductImageDto.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
// src/Webshop.Application/DTOs/Products/ProductImageDto.cs
|
||||
using System;
|
||||
|
||||
namespace Webshop.Application.DTOs.Products
|
||||
{
|
||||
public class ProductImageDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Url { get; set; } = string.Empty;
|
||||
public bool IsMainImage { get; set; }
|
||||
public int DisplayOrder { get; set; }
|
||||
}
|
||||
}
|
||||
39
Webshop.Application/DTOs/Products/UpdateAdminProductDto.cs
Normal file
39
Webshop.Application/DTOs/Products/UpdateAdminProductDto.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
// src/Webshop.Application/DTOs/Products/UpdateAdminProductDto.cs
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Webshop.Application.DTOs.Products
|
||||
{
|
||||
public class UpdateAdminProductDto
|
||||
{
|
||||
[Required]
|
||||
public Guid Id { get; set; }
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
[Required]
|
||||
public string SKU { get; set; }
|
||||
[Required]
|
||||
public decimal Price { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public bool IsInStock { get; set; }
|
||||
public int StockQuantity { get; set; }
|
||||
[Required]
|
||||
public string Slug { get; set; }
|
||||
|
||||
// << NEU: Felder für den Bildupload und -verwaltung >>
|
||||
public IFormFile? MainImageFile { get; set; } // Optional: Neues Hauptbild hochladen
|
||||
public List<IFormFile>? AdditionalImageFiles { get; set; } // Optional: Weitere Bilder hochladen
|
||||
public List<Guid>? ImagesToDelete { get; set; } // Liste der IDs von Bildern, die gelöscht werden sollen
|
||||
|
||||
public List<Guid> CategorieIds { get; set; } = new List<Guid>();
|
||||
|
||||
// ... weitere Felder, die beim Aktualisieren benötigt werden ...
|
||||
public decimal? Weight { get; set; }
|
||||
public decimal? OldPrice { get; set; }
|
||||
public Guid? SupplierId { get; set; }
|
||||
public decimal? PurchasePrice { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user