<?php

use App\Models\Artist;
use App\Models\ArtistImage;
use App\Models\ArtistSingsGenre;
use App\Models\ArtistType;
use App\Models\Event;
use App\Models\EventType;
use App\Models\Genre;
use App\Models\Manager;
use App\Models\ManagerInvite;
use App\Models\Offer;
use App\Models\OfferComment;
use App\Models\Organizer;
use App\Models\Review;
use App\Models\Transaction;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::get('/artists', function () {
    return Artist::with('user', 'artist_type', 'manager', 'images', 'genres')->get();
});

Route::get('/artist-images', function () {
    return ArtistImage::with('artists')->get();
});

Route::get('/artist-genres', function () {
    return ArtistSingsGenre::all();
});

Route::get('/artist-types', function () {
    return ArtistType::with('artists')->get();
});

Route::get('/events', function () {
    return Event::with('organizer', 'event_type')->get();
});

Route::get('/event-types', function () {
    return EventType::with('events')->get();
});

Route::get('/genres', function () {
    return Genre::with('artists')->get();
});

Route::get('/managers', function () {
    return Manager::with('user', 'artists')->get();
});

Route::get('/manager-invites', function () {
    return ManagerInvite::with('artist')->get();
});

Route::get('/offers', function () {
    return Offer::with('artist', 'event', 'comments')->get();
});

Route::get('/offer-comments', function () {
    return OfferComment::with('offer', 'author')->get();
});

Route::get('/organizers', function () {
    return Organizer::with('user', 'events')->get();
});

Route::get('/reviews', function () {
    return Review::with('organizer', 'artist')->get();
});

Route::get('/transactions', function () {
    return Transaction::with('offer')->get();
});

Route::get('/users', function () {
    return User::with('role', 'offer_comments')->get();
});
