package com.developx.szpitale.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.time.LocalDateTime;
import java.util.List;

public record CanonicalDataset(
        @JsonProperty("schemaVersion") String schemaVersion,
        @JsonProperty("voivodeship") String voivodeship,
        @JsonProperty("generatedAt") LocalDateTime generatedAt,
        @JsonProperty("hospitals") List<Hospital> hospitals,
        @JsonProperty("people") List<Person> people,
        @JsonProperty("affiliations") List<Affiliation> affiliations,
        @JsonProperty("roles") List<Role> roles,
        @JsonProperty("mandates") List<Mandate> mandates,
        @JsonProperty("organizations") List<Organization> organizations,
        @JsonProperty("companies") List<Company> companies,
        @JsonProperty("personOrganizationLinks") List<PersonOrganizationLink> personOrganizationLinks,
        @JsonProperty("organizationLinks") List<OrganizationLink> organizationLinks,
        @JsonProperty("personCompanyLinks") List<PersonCompanyLink> personCompanyLinks
) {
    public CanonicalDataset(String schemaVersion, String voivodeship, LocalDateTime generatedAt,
                            List<Hospital> hospitals, List<Person> people,
                            List<Affiliation> affiliations, List<Role> roles,
                            List<Mandate> mandates,
                            List<Organization> organizations, List<Company> companies,
                            List<PersonOrganizationLink> personOrganizationLinks,
                            List<OrganizationLink> organizationLinks,
                            List<PersonCompanyLink> personCompanyLinks) {
        this.schemaVersion = schemaVersion;
        this.voivodeship = voivodeship;
        this.generatedAt = generatedAt;
        this.hospitals = hospitals != null ? hospitals : List.of();
        this.people = people != null ? people : List.of();
        this.affiliations = affiliations != null ? affiliations : List.of();
        this.roles = roles != null ? roles : List.of();
        this.mandates = mandates != null ? mandates : List.of();
        this.organizations = organizations != null ? organizations : List.of();
        this.companies = companies != null ? companies : List.of();
        this.personOrganizationLinks = personOrganizationLinks != null ? personOrganizationLinks : List.of();
        this.organizationLinks = organizationLinks != null ? organizationLinks : List.of();
        this.personCompanyLinks = personCompanyLinks != null ? personCompanyLinks : List.of();
    }
}
