<?php

namespace Fifa\ConnectId\Sdk\Util\Serialization\Configurations;

use Fifa\ConnectId\Sdk\Model\DataStandard\LocalPersonName;
use Fifa\ConnectId\Sdk\Model\DataStandard\MatchOfficialRegistration;
use Fifa\ConnectId\Sdk\Model\DataStandard\NationalIdentifier;
use Fifa\ConnectId\Sdk\Model\DataStandard\OrganisationOfficialRegistration;
use Fifa\ConnectId\Sdk\Model\DataStandard\Photo;
use Fifa\ConnectId\Sdk\Model\DataStandard\PictureEmbedded;
use Fifa\ConnectId\Sdk\Model\DataStandard\PlayerRegistration;
use Fifa\ConnectId\Sdk\Model\DataStandard\TeamOfficialRegistration;

class PersonLocalXmlSerializerConfiguration
{
    public static function getScalarAsAttributes(string $rootTag = 'PersonLocal'): array
    {
        return [
            $rootTag => [
                'LocalLastName', 'Gender', 'Nationality', 'DateOfBirth', 'CountryOfBirth', 'PlaceOfBirth', 'LocalLanguage', 'LocalCountry', 'LocalFirstName', 'LocalBirthName',
                'PersonFIFAId', 'InternationalFirstName', 'InternationalLastName', 'RegionOfBirth', 'LocalSystemMAId', 'SecondNationality', 'PopularName'
            ],
            'PlayerRegistration' => CommonXmlSerializerConfiguration::getPlayerRegistrationScalarAsAttributes(),
            'TeamOfficialRegistration' => CommonXmlSerializerConfiguration::getTeamOfficialRegistrationScalarAsAttributes(),
            'MatchOfficialRegistration' => CommonXmlSerializerConfiguration::getMatchOfficialRegistrationScalarAsAttributes(),
            'OrganisationOfficialRegistration' => CommonXmlSerializerConfiguration::getOrganisationOfficialRegistrationScalarAsAttributes(),
            'LocalPersonName' => CommonXmlSerializerConfiguration::getLocalPersonNameScalarAsAttributes(),
            'NationalIdentifier' => CommonXmlSerializerConfiguration::getNationalIdentifierScalarAsAttributes()
        ];
    }

    public static function getMappings(): array
    {
        return [
            'Photo' => Photo::class,
            'PictureEmbedded' => PictureEmbedded::class,
            'LocalPersonName' => LocalPersonName::class,
            'NationalIdentifier' => NationalIdentifier::class,
            'PlayerRegistration' => PlayerRegistration::class,
            'TeamOfficialRegistration' => TeamOfficialRegistration::class,
            'MatchOfficialRegistration' => MatchOfficialRegistration::class,
            'OrganisationOfficialRegistration' => OrganisationOfficialRegistration::class
        ];
    }

    public static function getTagmap(): array
    {
        return [
            PlayerRegistration::class => 'PlayerRegistration',
            TeamOfficialRegistration::class => 'TeamOfficialRegistration',
            MatchOfficialRegistration::class => 'MatchOfficialRegistration',
            OrganisationOfficialRegistration::class => 'OrganisationOfficialRegistration',
        ];
    }
}