Mango.Nop.Plugins/Nop.Plugin.Misc.AIPlugin/Areas/Admin/Models/EditShippingModel.cs

58 lines
1.9 KiB
C#

using FruitBank.Common.Entities;
using Microsoft.AspNetCore.Http;
using Nop.Web.Framework.Models;
using System.ComponentModel.DataAnnotations;
namespace Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Models
{
public record EditShippingModel : BaseNopModel
{
public int Id { get; set; }
public string LicencePlate { get; set; }
[Required]
public DateTime ShippingDate { get; set; }
public bool IsAllMeasured { get; set; }
// List of existing documents associated with this Shipping
public List<ShippingDocumentModel> ExistingDocuments { get; set; } = new();
// For tracking newly uploaded files during the session
public List<string> NewlyUploadedFiles { get; set; } = new();
}
public class ShippingDocumentModel
{
public int Id { get; set; }
public ShippingDocument ShippingDocument { get; set; }
public string FileName { get; set; }
public string FilePath { get; set; }
public int FileSize { get; set; } // in KB
public DateTime UploadDate { get; set; }
public string ContentType { get; set; }
public bool IsActive { get; set; } = true;
// Computed properties for display
public string FormattedFileSize => $"{FileSize:N0} KB";
public string FormattedUploadDate => UploadDate.ToString("yyyy-MM-dd HH:mm");
}
// Result model for AJAX operations
public class DocumentOperationResult
{
public bool Success { get; set; }
public string Message { get; set; }
public ShippingDocumentModel Document { get; set; }
public int DocumentId { get; set; }
}
// Model for bulk operations
public class BulkDocumentOperation
{
public List<int> DocumentIds { get; set; } = new();
public string Operation { get; set; } // "delete", "activate", "deactivate"
}
}