import { TImage, TImageUrls } from "./Image";
import { TProduct } from "./Product";

export interface TPromotion {
    slug: string;
    products: string[];
    discount: number;
    valid_until: string;
}

export interface TImageWithField extends TImage {
    field: "banner_desktop" | "banner_mobile";
}

export interface TBanners {
    banner_desktop: TImageWithField;
    banner_mobile: TImageWithField;
}

export interface TPromotionData {
    id: number;
    name: string;
    slug: string;
    content: {
        type: "content";
        data: {
            products: TProduct[];
            image: number;
            discount: string | number;
            valid_until: string;
            banner_desktop: string | number;
            banner_mobile: string | number;
            urls: TImageUrls;
            image_preview: string;
            alt_text: string | null;
            banner_desktop_urls: TImageUrls;
            banner_desktop_image_preview: string;
            banner_desktop_alt_text: string | null;
            banner_mobile_urls: TImageUrls;
            banner_mobile_image_preview: string;
            banner_mobile_alt_text: string | null;
        };
    }[];
    created_at: string;
    updated_at: string;
}
