Files
ERP_Distribution/Distribution/Features/Sync/SyncController.cs
T
Kalana B. Thilakarathna 397af8fd59 item mng with sync
2026-08-19 12:49:04 +05:30

27 lines
988 B
C#

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Distribution.Features.Sync;
[ApiController]
[Route("api/sync")]
[Authorize(Policy = "items.create")]
public class SyncController(SyncService service) : ControllerBase
{
[HttpPost("uoms")]
public async Task<IActionResult> SyncUoms(SyncUomsPayload payload, CancellationToken ct) =>
Ok(await service.SyncUomsAsync(payload, ct));
[HttpPost("categories")]
public async Task<IActionResult> SyncCategories(SyncCategoriesPayload payload, CancellationToken ct) =>
Ok(await service.SyncCategoriesAsync(payload, ct));
[HttpPost("brands")]
public async Task<IActionResult> SyncBrands(SyncBrandsPayload payload, CancellationToken ct) =>
Ok(await service.SyncBrandsAsync(payload, ct));
[HttpPost("items")]
public async Task<IActionResult> SyncItems(SyncItemsPayload payload, CancellationToken ct) =>
Ok(await service.SyncItemsAsync(payload, ct));
}