using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SeaHaven.Services.Interfaces; namespace Api.SeaHavenIndustries.Controllers { [Authorize] [ApiController] [Route("api/[controller]")] public class SyncController : Controller { private readonly ISyncService _syncService; public SyncController(ISyncService syncService) { _syncService = syncService; } [HttpPost("WorkOrders")] public async Task SyncWorkOrders(CancellationToken cancellationToken) { var result = await _syncService.SyncWorkOrdersAsync(cancellationToken); return Ok(result); } [HttpPost("Comments")] public async Task SyncComments(CancellationToken cancellationToken) { var result = await _syncService.SyncCommentsAsync(cancellationToken); return Ok(result); } [HttpPost("BackfillInternalWONumbers")] public async Task BackfillInternalWONumbers(CancellationToken cancellationToken) { var result = await _syncService.BackfillInternalWONumbersAsync(cancellationToken); return Ok(result); } [HttpPost("BackfillDispatchNumbers")] public async Task BackfillDispatchNumbers(CancellationToken cancellationToken) { var result = await _syncService.BackfillDispatchNumbersAsync(cancellationToken); return Ok(result); } [HttpPost("VendorReplies")] public async Task SyncVendorReplies(CancellationToken cancellationToken) { var result = await _syncService.SyncVendorRepliesAsync(cancellationToken); return Ok(result); } [HttpPost("BackfillCommentTypes")] public async Task BackfillCommentTypes(CancellationToken cancellationToken) { var result = await _syncService.BackfillCommentTypesAsync(cancellationToken); return Ok(result); } [HttpPost("All")] public async Task SyncAll(CancellationToken cancellationToken) { var result = await _syncService.SyncAllAsync(cancellationToken); return Ok(result); } } }