import { TBusinessType } from "./Business";
import { TCompany } from "./Company";
import { TImage, TImageUrls } from "./Image";
import { TSEO } from "./Seo";

export interface TPage {
    id: number;
    name: string;
    slug: string;
    seo: TSEO;
    content: TContentItem[];
    companies: TCompany[];
    locations: TLocation[];
    departments: TDept[];
    business_types: TBusinessType[];
    jobs: TJob[];
    base_url: string;
}

type TContentItem = TMainBannerSection | TJobListSection | TModalSection;

export interface TMainBannerSection {
    type: "section_main_banner";
    data: TBannerData;
}

export interface TJobListSection {
    type: "section_job_list";
    data: TJobListData;
}

export interface TModalSection {
    type: "section_modal";
    data: TModalData;
}

export interface TBannerData {
    title: string;
    subtitle: string;
    content_title: string;
    image: number;
    alt_text: string | null;
    urls: TImageUrls;
    image_preview: string;
}

export interface TJobListData {}

export interface TModalData {}

export interface TJob {
    id: number;
    name: string;
    slug: string;
    qualifications: string;
    created_at: string;
    updated_at: string;
    company_id: number;
    location_id: number;
    company: TCompany;
    location: TLocation;
    deadline: string;
    department_id: number;
    department: TDept;
}

export interface TDept {
    id: number;
    name: string;
    slug: string;
    created_at: string;
    updated_at: string;
}

export interface TLocation {
    id: number;
    name: string;
    slug: string;
    created_at: string;
    updated_at: string;
}

export interface TJobOption {
    locations: TLocation[];
    departments: any;
    business_types: TBusinessType[];
    companies: TCompany[];
}
