<?php
/**
 * @package   Essentials YOOtheme Pro 2.2.16 build 0813.1608
 * @author    ZOOlanders https://www.zoolanders.com
 * @copyright Copyright (C) Joolanders, SL
 * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

namespace ZOOlanders\YOOessentials\Source\Provider\GoogleCalendar\Type;

use ZOOlanders\YOOessentials\Source\GraphQL\TypeInterface;
use ZOOlanders\YOOessentials\Source\Provider\GoogleCalendar\Type\GoogleCalendarProfileType as TypeGoogleCalendarProfileType;

// https://developers.google.com/calendar/api/v3/reference/events
class GoogleCalendarAttendeeType extends TypeGoogleCalendarProfileType
{
    public const TYPE_NAME = 'GoogleCalendarAttendee';
    public const TYPE_LABEL = 'Attendee';

    public function type(): string
    {
        return TypeInterface::TYPE_OBJECT;
    }

    public function name(): string
    {
        return self::TYPE_NAME;
    }

    public function label(): string
    {
        return self::TYPE_LABEL;
    }

    public function config(): array
    {
        $parent = parent::config();

        return [
            'fields' => array_merge($parent['fields'], [
                'comment' => [
                    'type' => 'String',
                    'metadata' => [
                        'label' => 'Comment',
                        'filters' => ['limit'],
                    ],
                ],
                'responseStatus' => [
                    'type' => 'String',
                    'metadata' => [
                        'label' => 'Response Status',
                    ],
                ],
                'organizer' => [
                    'type' => 'Boolean',
                    'metadata' => [
                        'label' => 'Is Organizer',
                    ],
                ],
                'resource' => [
                    'type' => 'Boolean',
                    'metadata' => [
                        'label' => 'Is Resource',
                    ],
                ],
                'optional' => [
                    'type' => 'Boolean',
                    'metadata' => [
                        'label' => 'Is Optional',
                    ],
                ],
                'additionalGuests' => [
                    'type' => 'Int',
                    'metadata' => [
                        'label' => 'Additional Guests Count',
                    ],
                ]
            ]),

            'metadata' => [
                'type' => true,
                'label' => $this->label(),
            ],
        ];
    }
}
