package com.ikon.projectmanagement.api;

import com.ikon.projectmanagement.dto.request.RoleRequestDto;
import com.ikon.projectmanagement.dto.response.RoleResponseDto;
import java.util.List;
import java.util.UUID;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "Role APIs", description = "APIs for managing local roles")
@RequestMapping("/api/v1/roles")
public interface RoleApi {

    @Operation(summary = "Get all roles")
    @GetMapping
    ResponseEntity<List<RoleResponseDto>> getAllRoles();

    @Operation(summary = "Get role by ID")
    @GetMapping("/{id}")
    ResponseEntity<RoleResponseDto> getRoleById(@PathVariable UUID id);

    @Operation(summary = "Create a new role")
    @PostMapping
    @ResponseStatus(HttpStatus.CREATED)
    ResponseEntity<RoleResponseDto> createRole(@RequestBody RoleRequestDto dto);

    @Operation(summary = "Update an existing role")
    @PutMapping("/{id}")
    ResponseEntity<RoleResponseDto> updateRole(@PathVariable UUID id, @RequestBody RoleRequestDto dto);

    @Operation(summary = "Delete a role")
    @DeleteMapping("/{id}")
    @ResponseStatus(HttpStatus.NO_CONTENT)
    ResponseEntity<Void> deleteRole(@PathVariable UUID id);
}
