<?php

defined( 'ABSPATH' ) || exit;

// Dummy sample data.

/**
 * Get course completed sample for zapier.
 *
 * @since 2.12.0
 * @return array|false
 */
function masteriyo_zapier_get_course_completed_sample() {
	$sample = array(
		'id'               => 237,
		'user_id'          => 1,
		'course_id'        => 947,
		'course_permalink' => 'http://masteriyo.me/course/erasmus-herrera/',
		'name'             => 'Erasmus Herrera Erasmus H',
		'status'           => 'completed',
		'started_at'       => '2024-03-13T04:31:50Z',
		'modified_at'      => '2024-05-02T09:14:43Z',
		'completed_at'     => null,
		'items'            => array(
			array(
				'item_id'    => 962,
				'item_title' => 'Desiree Knight',
				'item_type'  => 'section',
				'contents'   => array(
					array(
						'item_id'    => 963,
						'item_title' => 'Jakeem Pierce',
						'item_type'  => 'lesson',
						'completed'  => true,
						'video'      => true,
					),
					array(
						'item_id'    => 967,
						'item_title' => 'test quiz',
						'item_type'  => 'quiz',
						'completed'  => true,
						'video'      => false,
					),
					array(
						'item_id'    => 975,
						'item_title' => 'test quiz 1',
						'item_type'  => 'quiz',
						'completed'  => true,
						'video'      => false,
					),
					array(
						'item_id'    => 1041,
						'item_title' => 'Barclay Collier',
						'item_type'  => 'lesson',
						'completed'  => true,
						'video'      => true,
					),
				),
			),
		),
		'summary'          => array(
			'lesson'     => array(
				'pending'   => 0,
				'completed' => 2,
				'total'     => 2,
			),
			'quiz'       => array(
				'pending'   => 0,
				'completed' => 2,
				'total'     => 2,
			),
			'assignment' => array(
				'pending'   => 0,
				'completed' => 0,
				'total'     => 0,
			),
			'zoom'       => array(
				'pending'   => 0,
				'completed' => 0,
				'total'     => 0,
			),
			'total'      => array(
				'pending'   => 0,
				'completed' => 4,
				'total'     => 4,
			),
		),
		'course'           => array(
			'id'                             => 947,
			'name'                           => 'Erasmus Herrera Erasmus H',
			'slug'                           => 'erasmus-herrera',
			'permalink'                      => 'http://masteriyo.me/course/erasmus-herrera/',
			'preview_permalink'              => 'http://masteriyo.me/learn/?course_name=947&mto-preview=true#/course/947',
			'status'                         => 'publish',
			'description'                    => '',
			'short_description'              => '',
			'reviews_allowed'                => false,
			'parent_id'                      => 0,
			'menu_order'                     => 0,
			'author'                         => array(
				'id'           => 1,
				'display_name' => 'admin',
				'avatar_url'   => 'http://masteriyo.me/wp-content/uploads/2024/04/IMG_0291-150x150.jpg',
			),
			'date_created'                   => '2024-03-08T09:10:35Z',
			'date_modified'                  => '2024-04-10T11:48:30Z',
			'featured'                       => false,
			'price'                          => '5',
			'formatted_price'                => '€5.00',
			'regular_price'                  => '25',
			'sale_price'                     => '5',
			'price_type'                     => 'paid',
			'featured_image'                 => '',
			'featured_image_url'             => 'http://masteriyo.me/wp-content/uploads/masteriyo/placeholder.jpg',
			'students_count'                 => 4,
			'enrollment_limit'               => 0,
			'duration'                       => 0,
			'access_mode'                    => 'one_time',
			'billing_cycle'                  => 1,
			'show_curriculum'                => true,
			'review_after_course_completion' => false,
			'highlights'                     => '',
			'edit_post_link'                 => 'http://masteriyo.me/wp-admin/post.php?post=947&action=edit',
			'categories'                     => array(
				array(
					'id'   => 5,
					'name' => 'Accoustic',
					'slug' => 'accoustic',
				),
			),
			'tags'                           => array(),
			'difficulty'                     => null,
			'end_date'                       => '',
		),
		'user'             => array(
			'id'                   => 1,
			'username'             => 'admin',
			'nicename'             => 'admin',
			'email'                => 'dev-email@wpengine.local',
			'url'                  => 'http://masteriyo.me',
			'date_created'         => '2023-11-16T15:51:16Z',
			'status'               => 0,
			'display_name'         => 'admin',
			'nickname'             => 'admin',
			'first_name'           => 'Lihsaa',
			'last_name'            => 'Bijukshe',
			'description'          => '',
			'rich_editing'         => true,
			'syntax_highlighting'  => true,
			'comment_shortcuts'    => false,
			'use_ssl'              => false,
			'show_admin_bar_front' => true,
			'locale'               => '',
			'roles'                => array(
				'administrator',
				'tutor_instructor',
			),
			'profile_image'        => array(
				'id'  => 1198,
				'url' => 'http://masteriyo.me/wp-content/uploads/2024/04/IMG_0291-150x150.jpg',
			),
			'billing'              => array(
				'first_name'   => '',
				'last_name'    => '',
				'company_name' => '',
				'company_id'   => '',
				'address_1'    => '',
				'address_2'    => '',
				'city'         => '',
				'postcode'     => '',
				'country'      => '',
				'state'        => '',
				'country_name' => '',
				'state_name'   => null,
				'email'        => 'dev-email@wpengine.local',
				'phone'        => '',
			),
			'avatar_url'           => 'http://1.gravatar.com/avatar/729ae85bf62b9917e93538db2f2688ca?s=96&d=mm&r=g',
		),
	);

	return $sample;

}

/**
 * Get lesson completed sample for zapier.
 *
 * @since 2.12.0
 * @return array|false
 */
function masteriyo_zapier_get_lesson_completed_sample() {
	$sample = array(
		'id'           => 276,
		'progress_id'  => 210,
		'course_id'    => 698,
		'user_id'      => 1,
		'item_id'      => 686,
		'item_type'    => 'lesson',
		'completed'    => true,
		'started_at'   => '2024-05-02T09:23:34Z',
		'modified_at'  => '2024-05-02T09:23:34Z',
		'completed_at' => '2024-05-02T09:23:34Z',
		'lesson'       => array(
			'id'                  => 686,
			'name'                => 'Introduction to power chords',
			'slug'                => 'main-power-chords-3',
			'permalink'           => 'https://masteriyo.me/lesson/main-power-chords-3/',
			'preview_link'        => 'https://masteriyo.me/learn/?course_name=698&mto-preview=true#/course/698/lesson/686',
			'status'              => 'publish',
			'description'         => '<p>A power chord is <b>a two-note chord, with no major or minor quality to it</b>. This is because power chords are just made up of the root and the fifth of the chord. The third of the chord, the part that usually gives the chord a major or minor quality, is left out of power chords.</p>',
			'short_description'   => '',
			'date_created'        => '2024-02-14T06:26:37Z',
			'date_modified'       => '2024-02-14T06:26:38Z',
			'menu_order'          => 0,
			'parent_menu_order'   => 0,
			'reviews_allowed'     => true,
			'parent_id'           => 693,
			'course_id'           => 698,
			'course_name'         => 'Rock Power Chords',
			'featured_image'      => '',
			'video_source'        => 'self-hosted',
			'video_source_url'    => '',
			'video_source_id'     => 0,
			'video_playback_time' => 0,
			'attachments'         => array(),
		),
		'course'       => array(
			'id'                             => 698,
			'name'                           => 'Rock Power Chords',
			'slug'                           => 'rock-power-chords-2-2',
			'permalink'                      => 'https://masteriyo.me/course/rock-power-chords-2-2/',
			'preview_permalink'              => 'https://masteriyo.me/learn/?course_name=698&mto-preview=true#/course/698',
			'status'                         => 'publish',
			'description'                    => '',
			'short_description'              => '',
			'reviews_allowed'                => true,
			'parent_id'                      => 0,
			'menu_order'                     => 0,
			'author'                         => array(
				'id'           => 1,
				'display_name' => 'admin',
				'avatar_url'   => 'https://masteriyo.me/wp-content/uploads/2024/04/IMG_0291-150x150.jpg',
			),
			'date_created'                   => '2024-02-14T06:26:38Z',
			'date_modified'                  => '2024-04-16T12:21:16Z',
			'featured'                       => false,
			'price'                          => '29.99',
			'formatted_price'                => '€29.99',
			'regular_price'                  => '29.99',
			'sale_price'                     => '',
			'price_type'                     => 'paid',
			'featured_image'                 => 675,
			'featured_image_url'             => 'https://masteriyo.me/wp-content/uploads/2022/07/rock-power-chords-1.png',
			'students_count'                 => 2,
			'enrollment_limit'               => 0,
			'duration'                       => 240,
			'access_mode'                    => 'one_time',
			'billing_cycle'                  => 1,
			'show_curriculum'                => true,
			'review_after_course_completion' => false,
			'highlights'                     => '<li>Suscipit tortor eget felis.</li><li>Curabitur arcu erat idimper.</li><li>Proin eget tortor risus.</li>',
			'edit_post_link'                 => 'https://masteriyo.me/wp-admin/post.php?post=698&action=edit',
			'categories'                     => array(
				array(
					'id'   => 7,
					'name' => 'Electric',
					'slug' => 'electric',
				),
			),
			'tags'                           => array(),
			'difficulty'                     => null,
			'end_date'                       => '',
		),
		'user'         => array(
			'id'                   => 1,
			'username'             => 'admin',
			'nicename'             => 'admin',
			'email'                => 'dev-email@wpengine.local',
			'url'                  => 'http://masteriyo.me',
			'date_created'         => '2023-11-16T15:51:16Z',
			'status'               => 0,
			'display_name'         => 'admin',
			'nickname'             => 'admin',
			'first_name'           => 'Lihsaa',
			'last_name'            => 'Bijukshe',
			'description'          => '',
			'rich_editing'         => true,
			'syntax_highlighting'  => true,
			'comment_shortcuts'    => false,
			'use_ssl'              => false,
			'show_admin_bar_front' => true,
			'locale'               => '',
			'roles'                => array(
				'administrator',
				'tutor_instructor',
			),
			'profile_image'        => array(
				'id'  => 1198,
				'url' => 'https://masteriyo.me/wp-content/uploads/2024/04/IMG_0291-150x150.jpg',
			),
			'billing'              => array(
				'first_name'   => '',
				'last_name'    => '',
				'company_name' => '',
				'company_id'   => '',
				'address_1'    => '',
				'address_2'    => '',
				'city'         => '',
				'postcode'     => '',
				'country'      => '',
				'state'        => '',
				'country_name' => '',
				'state_name'   => null,
				'email'        => 'dev-email@wpengine.local',
				'phone'        => '',
			),
			'avatar_url'           => 'https://secure.gravatar.com/avatar/729ae85bf62b9917e93538db2f2688ca?s=96&d=mm&r=g',
		),
	);

	return $sample;

}

/**
 * Get quiz completed sample for zapier.
 *
 * @since 2.12.0
 * @return array|false
 */
function masteriyo_zapier_get_quiz_completed_sample() {
	$sample = array(
		'id'           => 279,
		'progress_id'  => 278,
		'course_id'    => 1221,
		'user_id'      => 1,
		'item_id'      => 1223,
		'item_type'    => 'quiz',
		'completed'    => true,
		'started_at'   => '2024-05-02T09:31:18Z',
		'modified_at'  => '2024-05-02T09:31:18Z',
		'completed_at' => null,
		'quiz'         => array(
			'id'                                => 1223,
			'name'                              => 'Daquan Rowland',
			'slug'                              => 'daquan-rowland',
			'permalink'                         => 'https://masteriyo.me/quiz/daquan-rowland/',
			'preview_link'                      => 'https://masteriyo.me/learn/?course_name=1221&mto-preview=true#/course/1221/quiz/1223',
			'parent_id'                         => 1222,
			'course_id'                         => 1221,
			'course_name'                       => 'ZAp test 1',
			'menu_order'                        => 0,
			'parent_menu_order'                 => 0,
			'status'                            => 'publish',
			'description'                       => '',
			'short_description'                 => '',
			'date_created'                      => '2024-05-02T09:29:37Z',
			'date_modified'                     => '2024-05-02T09:29:44Z',
			'pass_mark'                         => 40,
			'full_mark'                         => 100,
			'duration'                          => 0,
			'attempts_allowed'                  => 0,
			'questions_display_per_page'        => 0,
			'questions_display_per_page_global' => 5,
			'questions_count'                   => 1,
		),
		'course'       => array(
			'id'                             => 1221,
			'name'                           => 'ZAp test 1',
			'slug'                           => 'zap-test-1',
			'permalink'                      => 'https://masteriyo.me/course/zap-test-1/',
			'preview_permalink'              => 'https://masteriyo.me/learn/?course_name=1221&mto-preview=true#/course/1221',
			'status'                         => 'publish',
			'description'                    => '',
			'short_description'              => '',
			'reviews_allowed'                => false,
			'parent_id'                      => 0,
			'menu_order'                     => 0,
			'author'                         => array(
				'id'           => 1,
				'display_name' => 'admin',
				'avatar_url'   => 'https://masteriyo.me/wp-content/uploads/2024/04/IMG_0291-150x150.jpg',
			),
			'date_created'                   => '2024-05-02T08:20:51Z',
			'date_modified'                  => '2024-05-02T08:38:45Z',
			'featured'                       => false,
			'price'                          => '0',
			'formatted_price'                => 'Free',
			'regular_price'                  => '0',
			'sale_price'                     => '',
			'price_type'                     => 'free',
			'featured_image'                 => '',
			'featured_image_url'             => 'https://masteriyo.me/wp-content/uploads/masteriyo/placeholder.jpg',
			'students_count'                 => 0,
			'enrollment_limit'               => 0,
			'duration'                       => 0,
			'access_mode'                    => 'open',
			'billing_cycle'                  => 1,
			'show_curriculum'                => true,
			'review_after_course_completion' => false,
			'highlights'                     => '',
			'edit_post_link'                 => 'https://masteriyo.me/wp-admin/post.php?post=1221&action=edit',
			'categories'                     => array(),
			'tags'                           => array(),
			'difficulty'                     => null,
			'end_date'                       => '2024-05-15T18:15:00.000Z',
		),
		'user'         => array(
			'id'                   => 1,
			'username'             => 'admin',
			'nicename'             => 'admin',
			'email'                => 'dev-email@wpengine.local',
			'url'                  => 'http://masteriyo.me',
			'date_created'         => '2023-11-16T15:51:16Z',
			'status'               => 0,
			'display_name'         => 'admin',
			'nickname'             => 'admin',
			'first_name'           => 'Lihsaa',
			'last_name'            => 'Bijukshe',
			'description'          => '',
			'rich_editing'         => true,
			'syntax_highlighting'  => true,
			'comment_shortcuts'    => false,
			'use_ssl'              => false,
			'show_admin_bar_front' => true,
			'locale'               => '',
			'roles'                => array(
				'administrator',
				'tutor_instructor',
			),
			'profile_image'        => array(
				'id'  => 1198,
				'url' => 'https://masteriyo.me/wp-content/uploads/2024/04/IMG_0291-150x150.jpg',
			),
			'billing'              => array(
				'first_name'   => 'Lihsaa',
				'last_name'    => 'Bijukshe',
				'company_name' => '',
				'company_id'   => '',
				'address_1'    => '',
				'address_2'    => '',
				'city'         => '',
				'postcode'     => '',
				'country'      => '',
				'state'        => '',
				'country_name' => '',
				'state_name'   => null,
				'email'        => 'dev-email@wpengine.local',
				'phone'        => '',
			),
			'avatar_url'           => 'https://secure.gravatar.com/avatar/729ae85bf62b9917e93538db2f2688ca?s=96&d=mm&r=g',
		),
	);

	return $sample;
}
