using CoreConnect.Commerce.Orders;
namespace CoreConnect.Erp;
New, // The order has been created but not yet processed.
Paid, // The order has been paid for.
Cancelled, // The order has been cancelled.
Returned, // The order has been returned.
public enum OrderShipmentState
Delivered, // Or returned for returns
public class OrderShipment
public required string Id { get; set; }
public OrderShipmentState State { get; set; }
public string? TNTRef { get; set; }
public string? TNTCompany { get; set; }
public string? TNTUrl { get; set; }
public List<string>? Items { get; set; }
public class OrderLineItem
public string? Id { get; set; }
public string? ArticleID { get; set; }
public string? ArticleSKU { get; set; }
public string? ArticleRef { get; set; }
public string? Image { get; set; }
public string? Title { get; set; }
public Dictionary<string, object> ExtraData { get; set; } = new();
public decimal Amount { get; set; } // 0 = Delete fo
public decimal Price { get; set; }
public record ErpOrder : Order
// An order update FROM ERP
public class ErpOrderUpdate
public string? Id { get; set; }
public string? Reference { get; set; }
public OrderState? NewState { get; set; }
public PartialState? ShipmentState { get; set; }
public PartialState? ReturnedState { get; set; }
public List<OrderShipment>? Shipment { get; set; }
public List<OrderShipment>? Returns { get; set; }
public List<OrderLineItem>? LineItemUpdates { get; set; }