38 lines
2.6 KiB
C#
38 lines
2.6 KiB
C#
using BlueLaminate.Core.CsMoney;
|
|
using BlueLaminate.Core.SkinLand;
|
|
|
|
namespace BlueLaminate.C2;
|
|
|
|
/// <summary>A unit of scrape work handed to a worker: one skin+wear, as a search.</summary>
|
|
/// <param name="JobId">Opaque id the worker echoes back when posting results.</param>
|
|
/// <param name="SkinId">Catalogue skin this job targets.</param>
|
|
/// <param name="ConditionId">Wear band (skin_conditions row), or null for a whole skin.</param>
|
|
/// <param name="Search">Free-text market search, e.g. "M4A4 Cyber Security ft".</param>
|
|
/// <param name="MaxPages">Safety cap on page fetches (60 items each). The worker
|
|
/// paginates by walking the float axis, so a skin+wear needs ceil(listings/60) pages.</param>
|
|
public sealed record ScrapeJobDto(string JobId, int SkinId, int? ConditionId, string Search, int MaxPages);
|
|
|
|
/// <summary>A worker's results for a claimed job: the listings it scraped.</summary>
|
|
/// <param name="Items">All sell-order items gathered across pages (raw cs.money shape).</param>
|
|
/// <param name="Pages">How many pages the worker fetched.</param>
|
|
/// <param name="StoppedReason">Why it stopped. "completed" = full sweep (authoritative);
|
|
/// anything else (fetch-cap / challenged / stuck-float-tie) is partial.</param>
|
|
public sealed record ScrapeResultDto(List<CsMoneyItem> Items, int Pages, string? StoppedReason);
|
|
|
|
/// <summary>A unit of skin.land scrape work: one skin+wear, as its market page URL.</summary>
|
|
/// <param name="JobId">Opaque id the worker echoes back when posting results.</param>
|
|
/// <param name="SkinId">Catalogue skin this job targets.</param>
|
|
/// <param name="ConditionId">Wear band (skin_conditions row).</param>
|
|
/// <param name="Url">The skin.land market page, e.g.
|
|
/// "https://skin.land/market/csgo/ak-47-redline-field-tested/". The worker resolves the
|
|
/// internal skin_id from this page, then pages the obtained-skins API.</param>
|
|
/// <param name="MaxPages">Safety cap on offer-page fetches (Laravel paginator, ~26/page).</param>
|
|
public sealed record SkinLandJobDto(string JobId, int SkinId, int ConditionId, string Url, int MaxPages);
|
|
|
|
/// <summary>A worker's results for a claimed skin.land job: the offers it scraped.</summary>
|
|
/// <param name="Items">All obtained-skins offers gathered across pages (raw skin.land shape).</param>
|
|
/// <param name="Pages">How many offer pages the worker fetched.</param>
|
|
/// <param name="StoppedReason">Why it stopped. "completed" = full sweep (authoritative);
|
|
/// anything else (fetch-cap / challenged / no-skin-id) is partial.</param>
|
|
public sealed record SkinLandResultDto(List<SkinLandOffer> Items, int Pages, string? StoppedReason);
|