From 8b6b5900e6b4cc4e85fb8cbb030208f9019c4d63 Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Fri, 17 Jul 2026 23:09:11 +0300 Subject: [PATCH] feat: add is_ended to eBay Item, broaden end_time to sold time (SCR-122) is_ended: boolean - listing has closed (sold / ended), any buying format. end_time_utc/end_time_at now also set for ended/sold listings of any format (the exact sold time), not just active auctions; still null for active fixed-price listings. Rides along with unreleased 0.21.0. --- CHANGELOG.md | 1 + src/ebay/types.ts | 6 ++++-- tests/ebay.test.ts | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e22679..d348245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - **eBay** — new `sold_date` / `sold_date_at` fields on `SearchResult` cards (search, seller items, category, completed). `sold_date` is the sale date text as rendered by eBay (e.g. `"2 Jul 2026"`, localized on non-English markets, always set on completed/sold cards); `sold_date_at` is a best-effort ISO date (e.g. `"2026-07-02"`, `null` when the market's format isn't English). (SCR-122) +- **eBay** — new `is_ended` field on `Item` (`true` when the listing has closed — sold or ended — any buying format). `end_time_utc` / `end_time_at` broaden from auction-only to the listing end: auction close or sold time for ended listings of any format; still `null` for active fixed-price listings. (SCR-122) ## [0.20.0] - 2026-07-13 diff --git a/src/ebay/types.ts b/src/ebay/types.ts index dc7e5a2..82c8138 100644 --- a/src/ebay/types.ts +++ b/src/ebay/types.ts @@ -195,9 +195,11 @@ export interface Item { time_left: string | null; /** Auctions: the current high bid (mirrors `price`); null for non-auctions */ current_bid: EbayPrice | null; - /** Absolute auction end time, Unix timestamp (float seconds); null for non-auctions */ + /** Listing has closed (sold / ended), any buying format */ + is_ended: boolean; + /** Listing end: auction close / sold time, Unix timestamp (float seconds); null for active fixed-price listings */ end_time_utc: number | null; - /** Absolute auction end time, ISO-8601 Z string; null for non-auctions */ + /** Listing end: auction close / sold time, ISO-8601 Z string; null for active fixed-price listings */ end_time_at: string | null; /** BIN price: fixed-price listings (== price) or auction-with-Buy-It-Now; null for pure auctions */ buy_it_now_price: EbayPrice | null; diff --git a/tests/ebay.test.ts b/tests/ebay.test.ts index 9141690..6d18e6c 100644 --- a/tests/ebay.test.ts +++ b/tests/ebay.test.ts @@ -144,6 +144,7 @@ const ITEM_FIXTURE: EbayItemDetailResponse = { bids: null, time_left: null, current_bid: null, + is_ended: false, end_time_utc: null, end_time_at: null, buy_it_now_price: PRICE, @@ -431,6 +432,7 @@ describe("EbayClient.items", () => { expect(result.item.seller?.username).toBe("musicmagpie"); expect(result.item.returns?.accepted).toBe(true); expect(result.item.current_bid).toBeNull(); + expect(result.item.is_ended).toBe(false); expect(result.item.end_time_utc).toBeNull(); expect(result.item.end_time_at).toBeNull(); expect(result.item.buy_it_now_price?.raw).toBe("$29.99");