<?xml version="1.0" encoding="UTF-8"?>
<!--
  Sitemap index for thriftjai.com.

  We split the sitemap into:
    - sitemap-static.xml     home, categories, legal pages (this file)
    - sitemap-products.xml   one entry per active product (TODO: generate
                             dynamically from the backend; see notes below)

  Until the dynamic product sitemap is wired up, this single file serves
  only the static / evergreen URLs. That's better for SEO than shipping
  hard-coded demo product URLs that 404 in production.

  WIRING THE DYNAMIC PRODUCT SITEMAP (backend TODO)
  ─────────────────────────────────────────────────
  Add a NestJS controller at GET /sitemap-products.xml that:
    1. Streams active products (status = 'available', not sold/hidden),
       paginated to ≤ 50 000 URLs per file.
    2. Emits one <url> per product with <loc>, <lastmod> (from
       updatedAt), <changefreq>weekly</changefreq>, <priority>0.8</priority>,
       and a primary <image:image> block using the first product photo.
    3. Sets Cache-Control: public, max-age=3600.
  Then convert THIS file into a <sitemapindex> referencing both
  sitemap-static.xml and sitemap-products.xml.
-->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemaps-image/0.9">

  <!-- Home / browse feed -->
  <url>
    <loc>https://thriftjai.com/</loc>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>

  <!-- Category pages — the main SEO surface for non-product queries
       (e.g. "second-hand books Bangkok"). -->
  <url>
    <loc>https://thriftjai.com/category/fashion</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://thriftjai.com/category/electronics</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://thriftjai.com/category/books</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://thriftjai.com/category/home</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://thriftjai.com/category/sports</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>

  <!-- Legal / evergreen pages. Keep these in the sitemap so they
       earn trust signals for the domain even though they're low-traffic. -->
  <url>
    <loc>https://thriftjai.com/legal/terms</loc>
    <changefreq>yearly</changefreq>
    <priority>0.3</priority>
  </url>
  <url>
    <loc>https://thriftjai.com/legal/privacy</loc>
    <changefreq>yearly</changefreq>
    <priority>0.3</priority>
  </url>

  <!--
    Product detail pages live in sitemap-products.xml (generated from
    the database). Do NOT hard-code product URLs here — they'll 404 or
    point at sold-out items and tank crawl quality.
  -->

</urlset>
