shoc-backend/Api.SeaHavenIndustries/Controllers/SyncController.cs
2026-07-24 11:30:22 -03:00

68 lines
2.3 KiB
C#

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<IActionResult> SyncWorkOrders(CancellationToken cancellationToken)
{
var result = await _syncService.SyncWorkOrdersAsync(cancellationToken);
return Ok(result);
}
[HttpPost("Comments")]
public async Task<IActionResult> SyncComments(CancellationToken cancellationToken)
{
var result = await _syncService.SyncCommentsAsync(cancellationToken);
return Ok(result);
}
[HttpPost("BackfillInternalWONumbers")]
public async Task<IActionResult> BackfillInternalWONumbers(CancellationToken cancellationToken)
{
var result = await _syncService.BackfillInternalWONumbersAsync(cancellationToken);
return Ok(result);
}
[HttpPost("BackfillDispatchNumbers")]
public async Task<IActionResult> BackfillDispatchNumbers(CancellationToken cancellationToken)
{
var result = await _syncService.BackfillDispatchNumbersAsync(cancellationToken);
return Ok(result);
}
[HttpPost("VendorReplies")]
public async Task<IActionResult> SyncVendorReplies(CancellationToken cancellationToken)
{
var result = await _syncService.SyncVendorRepliesAsync(cancellationToken);
return Ok(result);
}
[HttpPost("BackfillCommentTypes")]
public async Task<IActionResult> BackfillCommentTypes(CancellationToken cancellationToken)
{
var result = await _syncService.BackfillCommentTypesAsync(cancellationToken);
return Ok(result);
}
[HttpPost("All")]
public async Task<IActionResult> SyncAll(CancellationToken cancellationToken)
{
var result = await _syncService.SyncAllAsync(cancellationToken);
return Ok(result);
}
}
}