<?php

namespace App\PackagesApi\Docs\v3;

class CapsuleInfoApiDoc extends AbstractV3Doc
{

    public static function endPoints()
    {
		return [
            'title' => 'Capsule Info (info, likes, followers, comments)',
            'endpoints' => [

                // Get information
                [
                    'title' => 'Get information',
                    'desc' => 'Get capsule info',

                    'route' => route('capsule.info', ['capsule_id' => 'ff5315ea-3e09-4f1f-a5a7-e04a34ed8ecd']),
                    'method' => 'GET',
                    'headers' => self::middlewareHeaders(),
                    'body' => '',

                    'response' => [
                        200 => [
                            'headers' => self::responseHeaders(),
                            'body' => [
                                'success' => true,
                                'capsule' => [

                                    'media_url' => 'null | Video url [returns null while capsule is locked]',
                                    'media_hls_url' => 'null | Video HLS format url - optional [returns null while capsule is locked]',

                                    "cap_id" => '1 - only for test',
                                    "id" => '3ff878a3-c7c5-4f9a-ac7d-5c69714424b8',

                                    "capsule_status" => 2,

                                    "is_private" => true,
                                    "opens_at" => 'Y-m-d H:i:s',
                                    "created_at" => 'Y-m-d H:i:s',

                                    "caption" => 'This is caption',
                                    "is_complete" => true,
                                    "is_blocked" => false,

                                    "is_my_capsule" => true,

                                    "liked_by_me" => true,
                                    "subscribed_by_me" => true,

                                    "is_tagged" => true,
                                    "is_removed" =>  true,

                                    "owner" => [
                                        'id' => '3ff878a3-c7c5-4f9a-ac7d-5c69714424b2',
                                        'name' => 'Nickname',
                                        'image_url' => 'If set, avatar URL thumb'
                                    ],

                                    "preview" => [
                                        'width' => 300,
                                        'height' => 300,
                                        'url' => 'URL of capsule preview',
                                    ],

                                    "thumbnail" => [
                                        'width' => 300,
                                        'height' => 300,
                                        'url' => 'URL of capsule cropped preview if set',
                                    ],

                                    "cropped" => [
                                        'width' => 300,
                                        'height' => 300,
                                        'url' => 'URL of capsule cropped preview if set',
                                    ],

                                    'address' => [
                                        "id" => 'Google place ID',
                                        "lat" => 10,
                                        "lng" => 20,
                                        "vicinity" => 'Address title',

                                        "street_title" => 'Cesu iela',
                                        "street_number" => '20',
                                        "country_title" => 'Latvia',
                                        "full_address" => 'Cesu iela 20, Riga, Latvia, LV-1111',
                                        "city" => 'Riga',
                                    ],

                                    'last_comments' => [
                                        [
                                            'comment_id' => '321312543543543',
                                            'content' => 'Comment text',
                                            'owner' => 'User object',
                                        ]
                                    ],

                                    'tagged_users' => [
                                        [
                                            'phone_hash' => '91674332ff3a178a4f83e1d9c4d619c8',
                                            'nickname' => 'Nickname',
                                            'isAppNotificationsEnabled' => true,
                                            'isPushNotificationsEnabled' => true,
                                            'last_notification_seen' => '1552559817',
                                            'onboarding_done' => true,

                                            'image_url' => 'Avatar URL thumb, if set',
                                            'original_image_url' => 'Avatar URL original, if set',
                                        ]
                                    ],
                                ]
                            ],
                        ]
                    ],
                ],


                // Get likes
                [
                    'title' => 'Get likes',
                    'desc' => 'Get capsule likes',

                    'route' => route('capsule.likes', ['capsule_id' => 'f5d84507-0426-4e74-a6b1-78dd0fb00e43']),
                    'method' => 'GET',
                    'headers' => self::middlewareHeaders(),

                    'response' => [

                        200 => [
                            'headers' => self::responseHeaders(),
                            'body' => [
                                'success' => true,
                                'users' => []
                            ],
                        ]
                    ],
                ],

                // Get subscribers
                [
                    'title' => 'Get subscribers',
                    'desc' => 'Get capsule subscribers',

                    'route' => route('capsule.subscribers', ['capsule_id' => 'f5d84507-0426-4e74-a6b1-78dd0fb00e43']),
                    'method' => 'GET',
                    'headers' => self::middlewareHeaders(),
                    'body' => '',

                    'response' => [

                        200 => [
                            'headers' => self::responseHeaders(),
                            'body' => [
                                'success' => true,
                                'users' => []
                            ],
                        ]
                    ],
                ],

                // Get comments
                [
                    'title' => 'Get comments',
                    'desc' => 'Get capsule comments',

                    'route' => route('capsule.comments', ['capsule_id' => '8209a8ff-0c5b-4dd1-a7eb-2676c476e220']),
                    'method' => 'GET',
                    'headers' => self::middlewareHeaders(),
                    'body' => '',

                    'response' => [

                        200 => [
                            'headers' => self::responseHeaders(),
                            'body' => [
                                'success' => true,
                                'comments' => [
                                    [
                                        'id' => '8209a8ff-0c5b-4dd1-a7eb-2676c476e220',
                                        'content' => "Nobis quia nam voluptas. Incidunt cum aut et aspernatur sunt quas ipsum.",
                                        'owner' => [
                                            [
                                                'id' => "8209a8ff-0c5b-4dd1-a7eb-2676c476e220",
                                                'name' => "Виталий74",
                                                'image_url' => "https://api.timehook.local/samples/avatar/1.png"
                                            ]
                                        ]
                                    ]
                                ]
                            ],
                        ]
                    ],
                ],

            ],

        ];

    }

}
