using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using ProposalSystem.Application.DTOs; using ProposalSystem.Application.Interfaces; namespace ProposalSystem.Api.Controllers; [ApiController] [Route("api/customers")] [Authorize] public class CustomersController : ControllerBase { private readonly ICustomerService _customerService; public CustomersController(ICustomerService customerService) { _customerService = customerService; } [HttpGet] public async Task>> Search( [FromQuery] string? query, CancellationToken ct) { var result = await _customerService.SearchAsync(query, ct); return Ok(result); } [HttpPost] public async Task> Create( [FromBody] CreateCustomerRequest request, CancellationToken ct) { var result = await _customerService.CreateAsync(request, ct); return Created($"/api/customers/{result.Id}", result); } }