refactor: Migrate backend and frontend architecture from a module-based to an app-based structure.

This commit is contained in:
2025-12-05 22:08:52 +01:00
parent ad0ea0c7f8
commit 82d2680f5b
166 changed files with 6171 additions and 1211 deletions

View File

@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using Zentral.Domain.Entities.Purchases;
namespace Zentral.API.Apps.Purchases.Dtos;
public class PurchaseOrderDto
{
public int Id { get; set; }
public string OrderNumber { get; set; } = string.Empty;
public DateTime OrderDate { get; set; }
public DateTime? ExpectedDeliveryDate { get; set; }
public int SupplierId { get; set; }
public string SupplierName { get; set; } = string.Empty;
public PurchaseOrderStatus Status { get; set; }
public int? DestinationWarehouseId { get; set; }
public string? DestinationWarehouseName { get; set; }
public string? Notes { get; set; }
public decimal TotalNet { get; set; }
public decimal TotalTax { get; set; }
public decimal TotalGross { get; set; }
public DateTime? CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public List<PurchaseOrderLineDto> Lines { get; set; } = new();
}
public class PurchaseOrderLineDto
{
public int Id { get; set; }
public int PurchaseOrderId { get; set; }
public int WarehouseArticleId { get; set; }
public string ArticleCode { get; set; } = string.Empty;
public string ArticleDescription { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public decimal Quantity { get; set; }
public decimal ReceivedQuantity { get; set; }
public decimal UnitPrice { get; set; }
public decimal TaxRate { get; set; }
public decimal DiscountPercent { get; set; }
public decimal LineTotal { get; set; }
}
public class CreatePurchaseOrderDto
{
public DateTime OrderDate { get; set; } = DateTime.Now;
public DateTime? ExpectedDeliveryDate { get; set; }
public int SupplierId { get; set; }
public int? DestinationWarehouseId { get; set; }
public string? Notes { get; set; }
public List<CreatePurchaseOrderLineDto> Lines { get; set; } = new();
}
public class CreatePurchaseOrderLineDto
{
public int WarehouseArticleId { get; set; }
public string? Description { get; set; } // Optional override
public decimal Quantity { get; set; }
public decimal UnitPrice { get; set; }
public decimal TaxRate { get; set; }
public decimal DiscountPercent { get; set; }
}
public class UpdatePurchaseOrderDto
{
public DateTime OrderDate { get; set; }
public DateTime? ExpectedDeliveryDate { get; set; }
public int? DestinationWarehouseId { get; set; }
public string? Notes { get; set; }
public List<UpdatePurchaseOrderLineDto> Lines { get; set; } = new();
}
public class UpdatePurchaseOrderLineDto
{
public int? Id { get; set; } // Null if new line
public int WarehouseArticleId { get; set; }
public string? Description { get; set; }
public decimal Quantity { get; set; }
public decimal UnitPrice { get; set; }
public decimal TaxRate { get; set; }
public decimal DiscountPercent { get; set; }
public bool IsDeleted { get; set; } // To mark for deletion
}