<?php

namespace App\PackagesApi\Docs\v3;

class ContactApiDoc extends AbstractV3Doc
{
	/**
	 * @return array
	 */
    public static function endPoints()
    {
        return [
            'title' => 'Contacts endpoints',
            'endpoints' => [
                [
                    'title' => 'Sync Contacts on the fly',
                    'desc' => 'Send contact numbers, backend returns info about users, which are registered in the app',

                    'route' => route('contacts.list-sync'),
                    'method' => 'POST',
                    'headers' => self::middlewareHeaders(),

                    'body' => [
                        'contacts' => [
                            ['phone_full' => '+44 7328 8328 737', 'full_name' => 'Gianni Versace']
                        ],
                    ],

                    'response' => [

                        200 => [
                            'headers' => self::responseHeaders(),
                            'body' => [
                                'total' => 10,
                                'contacts' => [
                                    [
                                        "user_id" => 'e9ff99a4-3804-487a-bb3d-302ff25eeb52 - only if user exists in database',
                                        "id" => '231321 - Only if user exists in database',
                                        "phone_hash" => '39c2adf5-4b71-470f-94cd-be7a38e33fd2',
                                        "name" => 'Nickname',
                                        "is_friend" => true,
                                        "is_invited" => false,

                                        "phone_code" => '+371',
                                        "phone_number" => '20 20 20 20',
                                        "is_registered" => true,
                                    ]
                                ],
                            ],
                        ]
                    ],
                ],
            ]
        ];
    }

}
