<?php

use OtomaticAi\RestControllers\AmazonController;
use OtomaticAi\RestControllers\ApiKeyRestController;
use OtomaticAi\RestControllers\GlobalSystemController;
use OtomaticAi\RestControllers\NetlinkingRestController;
use OtomaticAi\RestControllers\PersonaRestController;
use OtomaticAi\RestControllers\ProjectRestController;
use OtomaticAi\RestControllers\PublicationRestController;
use OtomaticAi\RestControllers\TemplateRestController;
use OtomaticAi\RestControllers\WordpressRestController;
use OtomaticAi\Utils\Route;

// projects
Route::rest("GET", "projects", ProjectRestController::class, "index");
Route::rest("POST", "projects", ProjectRestController::class, "store");
Route::rest("GET", "projects/(?P<id>\d+)", ProjectRestController::class, "show");
Route::rest("PUT", "projects/(?P<id>\d+)", ProjectRestController::class, "update");
Route::rest("POST", "projects/(?P<id>\d+)/enable", ProjectRestController::class, "enable");
Route::rest("POST", "projects/(?P<id>\d+)/disable", ProjectRestController::class, "disable");
Route::rest("DELETE", "projects/(?P<id>\d+)", ProjectRestController::class, "destroy");

// publications
Route::rest("GET", "publications", PublicationRestController::class, "index");
Route::rest("POST", "publications/(?P<id>\d+)/publish", PublicationRestController::class, "publish");
Route::rest("POST", "publications/(?P<id>\d+)/retry", PublicationRestController::class, "retry");
Route::rest("POST", "publications/(?P<id>\d+)/regenerate", PublicationRestController::class, "regenerate");
Route::rest("DELETE", "publications/(?P<id>\d+)", PublicationRestController::class, "destroy");
Route::rest("POST", "publications/bulk-destroy", PublicationRestController::class, "bulkDestroy");
Route::rest("POST", "publications/bulk-publish", PublicationRestController::class, "bulkPublish");
Route::rest("POST", "publications/bulk-regenerate", PublicationRestController::class, "bulkRegenerate");
Route::rest("POST", "publications/bulk-regenerate-thumbnail", PublicationRestController::class, "bulkRegenerateThumbnail");
Route::rest("POST", "publications/bulk-copy-urls", PublicationRestController::class, "bulkCopyUrls");

// templates
Route::rest("GET", "templates", TemplateRestController::class, "index");
Route::rest("POST", "templates", TemplateRestController::class, "store");
Route::rest("POST", "templates/import", TemplateRestController::class, "import");
Route::rest("DELETE", "templates/(?P<id>\d+)", TemplateRestController::class, "destroy");

// personas
Route::rest("GET", "personas", PersonaRestController::class, "index");
Route::rest("POST", "personas", PersonaRestController::class, "store");
Route::rest("GET", "personas/(?P<id>\d+)", PersonaRestController::class, "show");
Route::rest("PUT", "personas/(?P<id>\d+)", PersonaRestController::class, "update");
Route::rest("POST", "personas/(?P<id>\d+)/set-avatar", PersonaRestController::class, "setAvatar");
Route::rest("POST", "personas/(?P<id>\d+)/remove-avatar", PersonaRestController::class, "removeAvatar");
Route::rest("DELETE", "personas/(?P<id>\d+)", PersonaRestController::class, "destroy");

// wordpress
Route::rest("GET", "wordpress/users", WordpressRestController::class, "users");
Route::rest("GET", "wordpress/post-types", WordpressRestController::class, "postTypes");
Route::rest("GET", "wordpress/templates", WordpressRestController::class, "templates");
Route::rest("GET", "wordpress/categories", WordpressRestController::class, "categories");
Route::rest("GET", "wordpress/statuses", WordpressRestController::class, "statuses");
Route::rest("GET", "wordpress/user-roles", WordpressRestController::class, "userRoles");
Route::rest("GET", "wordpress/related-posts", WordpressRestController::class, "relatedPosts");
Route::rest("POST", "wordpress/publish-post", WordpressRestController::class, "publishPost");

// netlinking
Route::rest("GET", "netlinking", NetlinkingRestController::class, "index");
Route::rest("GET", "netlinking/(?P<uuid>[0-9a-fA-F\-]{36})", NetlinkingRestController::class, "show");
Route::rest("POST", "netlinking/(?P<uuid>[0-9a-fA-F\-]{36})/retry", NetlinkingRestController::class, "retry");
Route::rest("POST", "netlinking", NetlinkingRestController::class, "store");

// settings api keys
Route::rest("PUT", "settings/api-keys", ApiKeyRestController::class, "update");

// settings global systems
Route::rest("GET", "settings/global-systems", GlobalSystemController::class, "show");
Route::rest("PUT", "settings/global-systems", GlobalSystemController::class, "update");

// settings amazon
Route::rest("GET", "settings/amazon", AmazonController::class, "show");
Route::rest("PUT", "settings/amazon", AmazonController::class, "update");
