Add Tag CRUD

This commit is contained in:
Oscar Morales
2025-08-01 11:45:22 -06:00
parent d922768c85
commit 6b0a681942
20 changed files with 791 additions and 1 deletions

View File

@@ -73,5 +73,33 @@ namespace Core.Inventory.External.Clients
Task<TagTypeAdapter> ChangeStatusTagTypeAsync([FromRoute] string id, [FromRoute] StatusEnum newStatus, CancellationToken cancellationToken = default);
#endregion
#region Tag
[Get("/api/v1/Tag")]
Task<IEnumerable<TagAdapter>> GetAllTagsAsync(CancellationToken cancellationToken = default);
[Post("/api/v1/Tag/GetTagList")]
Task<IEnumerable<TagAdapter>> GetAllTagsByListAsync([FromBody] string[] request, CancellationToken cancellationToken = default);
[Get("/api/v1/Tag/{id}")]
Task<TagAdapter> GetTagByIdAsync([FromRoute] string id, CancellationToken cancellationToken = default);
[Post("/api/v1/Tag")]
Task<TagAdapter> CreateTagAsync([FromBody] TagRequest newTag, CancellationToken cancellationToken = default);
[Put("/api/v1/Tag/{id}")]
Task<TagAdapter> UpdateTagAsync([FromBody] TagAdapter entity, [FromRoute] string id, CancellationToken cancellationToken = default);
[Patch("/api/v1/Tag/{id}/{newStatus}/ChangeStatus")]
Task<TagAdapter> ChangeStatusTagAsync([FromRoute] string id, [FromRoute] StatusEnum newStatus, CancellationToken cancellationToken = default);
[Post("/api/v1/Tag/{tagId}/ParentTags/{parentTagId}/Add")]
Task<TagAdapter> AddParentTagAsync([FromRoute] string tagId, [FromRoute] string parentTagId, CancellationToken cancellationToken = default);
[Delete("/api/v1/Tag/{tagId}/ParentTags/{parentTagId}/Remove")]
Task<TagAdapter> RemoveParentTagAsync([FromRoute] string tagId, [FromRoute] string parentTagId, CancellationToken cancellationToken = default);
#endregion
}
}

View File

@@ -0,0 +1,13 @@
namespace Core.Inventory.External.Clients.Requests
{
public class TagRequest
{
public string TenantId { get; set; } = null!;
public string TagName { get; set; } = null!;
public string TypeId { get; set; } = null!;
public string[] ParentTagId { get; set; } = null!;
public string Slug { get; set; } = null!;
public int DisplayOrder { get; set; }
public string Icon { get; set; } = null!;
}
}

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Adapters.Lib" Version="1.0.9" />
<PackageReference Include="Adapters.Lib" Version="1.0.10" />
<PackageReference Include="BuildingBlocks.Library" Version="1.0.0" />
<PackageReference Include="Refit" Version="8.0.0" />
</ItemGroup>