"""Products resource — browse the HS Mail product catalogue."""
from __future__ import annotations

from .._http import HttpClient


class ProductResource:
    def __init__(self, http: HttpClient):
        self._http = http

    def list(self) -> list:
        """
        List all active product categories with their products.
        Prices are dynamically adjusted based on your account rank.

        Returns:
            list: Categories, each containing a ``products`` list.
        """
        return self._http.get("/v1/products")

    def get(self, product_id: str) -> dict:
        """
        Get a single product by its UUID.

        Args:
            product_id: Product UUID string.

        Returns:
            dict: Product details including price, stock, and category.
        """
        return self._http.get(f"/v1/products/{product_id}")
