feat: add CategoryId/Condition/Format/Postcode to SavedListing for draft posting

This commit is contained in:
2026-04-16 01:30:14 +01:00
parent edbce97a74
commit e3827d97e8

View File

@@ -11,6 +11,18 @@ public class SavedListing
public string ConditionNotes { get; set; } = ""; public string ConditionNotes { get; set; } = "";
public string ExportFolder { get; set; } = ""; public string ExportFolder { get; set; } = "";
/// <summary>eBay category ID — stored at save time so we can post without re-looking it up.</summary>
public string CategoryId { get; set; } = "";
/// <summary>Item condition — defaults to Used for existing records without this field.</summary>
public ItemCondition Condition { get; set; } = ItemCondition.Used;
/// <summary>Listing format — defaults to FixedPrice for existing records.</summary>
public ListingFormat Format { get; set; } = ListingFormat.FixedPrice;
/// <summary>Seller postcode — populated from appsettings default at save time.</summary>
public string Postcode { get; set; } = "";
/// <summary>Absolute paths to photos inside ExportFolder.</summary> /// <summary>Absolute paths to photos inside ExportFolder.</summary>
public List<string> PhotoPaths { get; set; } = new(); public List<string> PhotoPaths { get; set; } = new();
@@ -19,4 +31,21 @@ public class SavedListing
public string PriceDisplay => Price > 0 ? $"£{Price:F2}" : "—"; public string PriceDisplay => Price > 0 ? $"£{Price:F2}" : "—";
public string SavedAtDisplay => SavedAt.ToLocalTime().ToString("d MMM yyyy, HH:mm"); public string SavedAtDisplay => SavedAt.ToLocalTime().ToString("d MMM yyyy, HH:mm");
/// <summary>
/// Converts this saved draft back into a ListingDraft suitable for PostListingAsync.
/// </summary>
public ListingDraft ToListingDraft() => new ListingDraft
{
Title = Title,
Description = Description,
Price = Price,
CategoryId = CategoryId,
CategoryName = Category,
Condition = Condition,
Format = Format,
Postcode = Postcode,
PhotoPaths = new List<string>(PhotoPaths),
Quantity = 1
};
} }