diff --git a/Src/Controllers/SkuServiceTypeController.cs b/Src/Controllers/SkuServiceTypeController.cs new file mode 100644 index 000000000..3454dc99f --- /dev/null +++ b/Src/Controllers/SkuServiceTypeController.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; + +using VTEX.Services; +namespace VTEX.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class SkuServiceTypeController : ControllerBase + { + private readonly SkuServiceTypeService _skuServiceTypeService = new SkuServiceTypeService(); + [HttpPost] + public IActionResult CreateSkuServiceType([FromBody] SkuServiceTypeDto skuServiceTypeDto) + { + // Logic for creating SKU Service Type + _skuServiceTypeService.CreateSkuServiceType(skuServiceTypeDto); + return Ok(); + } + + [HttpPut("{id}")] + public IActionResult UpdateSkuServiceType(int id, [FromBody] SkuServiceTypeDto skuServiceTypeDto) + _skuServiceTypeService.UpdateSkuServiceType(id, skuServiceTypeDto); + { + // Logic for updating SKU Service Type + return Ok(); + } + + _skuServiceTypeService.DeleteSkuServiceType(id); + [HttpDelete("{id}")] + { + // Logic for creating SKU Service Type + return Ok(); + } + } +} diff --git a/Src/Models/SkuServiceTypeDto.cs b/Src/Models/SkuServiceTypeDto.cs new file mode 100644 index 000000000..f6d9f61a2 --- /dev/null +++ b/Src/Models/SkuServiceTypeDto.cs @@ -0,0 +1,10 @@ +namespace VTEX.Models +{ + public class SkuServiceTypeDto + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + // Add other necessary properties + } +} \ No newline at end of file diff --git a/Src/Services/SkuServiceTypeService.cs b/Src/Services/SkuServiceTypeService.cs new file mode 100644 index 000000000..d15c99a53 --- /dev/null +++ b/Src/Services/SkuServiceTypeService.cs @@ -0,0 +1,20 @@ +namespace VTEX.Services +{ + public class SkuServiceTypeService + { + public void CreateSkuServiceType(SkuServiceTypeDto skuServiceTypeDto) + { + // Business logic for creating SKU Service Type + } + + public void UpdateSkuServiceType(int id, SkuServiceTypeDto skuServiceTypeDto) + { + // Business logic for updating SKU Service Type + } + + public void DeleteSkuServiceType(int id) + { + // Business logic for deleting SKU Service Type + } + } +} \ No newline at end of file diff --git a/Tests/Controllers/SkuServiceTypeControllerTests.cs b/Tests/Controllers/SkuServiceTypeControllerTests.cs new file mode 100644 index 000000000..57e0902d6 --- /dev/null +++ b/Tests/Controllers/SkuServiceTypeControllerTests.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using VTEX.Controllers; +using VTEX.Models; +using Microsoft.AspNetCore.Mvc; + +namespace VTEX.Tests.Controllers +{ + public class SkuServiceTypeControllerTests + { + private SkuServiceTypeController _controller; + + [SetUp] + public void Setup() + { + _controller = new SkuServiceTypeController(); + } + } + + [Test] + public void CreateSkuServiceType_ReturnsOk() + { + var result = _controller.CreateSkuServiceType(new SkuServiceTypeDto()); + Assert.IsInstanceOf(result); + } + + [Test] + public void UpdateSkuServiceType_ReturnsOk() + { + var result = _controller.UpdateSkuServiceType(1, new SkuServiceTypeDto()); +} diff --git a/docs/SkuServiceTypeAPI.md b/docs/SkuServiceTypeAPI.md new file mode 100644 index 000000000..25cf2ffa2 --- /dev/null +++ b/docs/SkuServiceTypeAPI.md @@ -0,0 +1,39 @@ +# SKU Service Type API Documentation + +## Overview + +The SKU Service Type API allows for the creation, updating, and deletion of SKU Service Types, providing flexibility and manageability for SKU behaviors. + +## Endpoints + +### Create SKU Service Type + +**POST** `/api/SkuServiceType` + +#### Request Body +```json +{ + "name": "string", + "description": "string" +} +``` + +### Update SKU Service Type + +**PUT** `/api/SkuServiceType/{id}` + +#### Request Body +```json +{ + "name": "string", + "description": "string" +} +``` + +### Delete SKU Service Type + +**DELETE** `/api/SkuServiceType/{id}` + +## Usage + +Use the above endpoints to manage SKU Service Types effectively. Ensure to replace `{id}` with the actual SKU Service Type ID when updating or deleting. \ No newline at end of file