namespace KArtSell.Modules.ModelOperations.ShadowRun.Services;

/// <summary>
/// KRX OpenAPI response DTOs for deserialization.
/// </summary>

public sealed record KrxPriceResponse(
    Response Response);

public sealed record Response(
    Header Header,
    Body Body);

public sealed record Header(
    string ResultCode,
    string ResultMsg);

public sealed record Body(
    int PageNo,
    int PageSize,
    int TotalCount,
    List<PriceItem>? Items);

public sealed record PriceItem(
    string IsuSrtCd,
    string IsuCd,
    string IsuAbbreve,
    string BasDt,
    decimal Clpr,    // 종가 (close price)
    int Vs,
    decimal FltRt,
    decimal Mkp,     // 시가 (open price)
    decimal Hipr,    // 고가 (high price)
    decimal Lopr,    // 저가 (low price)
    long Trqu,       // 거래량 (volume)
    long Tramt);     // 거래금액

public sealed record KrxMarketCalendarResponse(
    Response CalendarResponse);

public sealed record CalendarBody(
    List<HolidayItem>? Items);

public sealed record HolidayItem(
    string BasDt,
    string BzopCd,   // 01 = closed, 02 = open
    string? ClsRson); // 신정, 설날, etc.
