<?php

use Illuminate\Support\Facades\Route;
use Lucent\Http\Controller\Api\EdgeController;
use Lucent\Http\Controller\Api\FileController;
use Lucent\Http\Controller\Api\RecordController;
use Lucent\Http\Controller\Api\SchemaController;


Route::middleware('auth.api:editor')->group(function () {

    Route::post('/records', [RecordController::class, 'create']);
    Route::put('/records/{id}', [RecordController::class, 'update']);

    Route::post('/edges', [EdgeController::class, 'create']);
    Route::post('/files', [FileController::class, 'upload']);
});

Route::middleware('auth.api:reader')->group(function () {
    Route::get('/schemas', [SchemaController::class, 'find']);
    Route::get('/schemas/{name}', [SchemaController::class, 'findOne']);

    Route::get('/records', [RecordController::class, 'records']);
});

