Add Tag CRUD

This commit is contained in:
Oscar Morales
2025-08-01 11:45:04 -06:00
parent 406ff07f62
commit 53a420ffd1
6 changed files with 528 additions and 1 deletions

View File

@@ -0,0 +1,75 @@
using Core.Adapters.Lib;
using Core.Blueprint.Mongo;
using Core.Inventory.Domain.Contexts.Inventory.Request;
namespace Core.Inventory.Provider.Contracts
{
public interface ITagProvider
{
/// <summary>
/// Creates a new Tag.
/// </summary>
/// <param name="entity">The Tag to be created.</param>
/// <returns>A <see cref="{Task{TagAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<TagAdapter> CreateTag(TagRequest newTag, CancellationToken cancellationToken);
/// <summary>
/// Gets an Tag by identifier.
/// </summary>
/// <param name="id">The Tag identifier.</param>
/// <returns>A <see cref="{Task{TagAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<TagAdapter> GetTagById(string _id, CancellationToken cancellationToken);
/// <summary>
/// Gets all the Tags.
/// </summary>
/// <returns>A <see cref="{Task{IEnumerbale{TagAdapter}}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<IEnumerable<TagAdapter>> GetAllTags(CancellationToken cancellationToken);
/// <summary>
/// Gets all the Tags by Tags identifier list.
/// </summary>
/// <param name="Tags">The list of Tags identifiers.</param>
/// <returns>A <see cref="Task{IEnumerable{TagAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<IEnumerable<TagAdapter>> GetAllTagsByList(string[] Tags, CancellationToken cancellationToken);
/// <summary>
/// Changes the status of the Tag.
/// </summary>
/// <param name="id">The Tag identifier.</param>
/// <param name="newStatus">The new status of the Tag.</param>
/// <returns>The <see cref="TagAdapter"/> updated entity.</returns>
/// <returns>A <see cref="{Task{TagAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<TagAdapter> ChangeTagStatus(string id, StatusEnum newStatus, CancellationToken cancellationToken);
/// <summary>
/// Updates a Tag by id.
/// </summary>
/// <param name="entity">The Tag to be updated.</param>
/// <param name="id">The Tag identifier.</param>
/// <returns>A <see cref="{Task{TagAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<TagAdapter> UpdateTag(TagAdapter entity, CancellationToken cancellationToken);
/// <summary>
/// Adds a parentTag to the tag.
/// </summary>
/// <param name="tagId">The identifier of the tag to whom the parentTag will be added.</param>
/// <param name="parentTagId">The identifier of the parentTag to add.</param>
/// <returns>A <see cref="Task{TagAdapter}"/> representing the asynchronous operation, with the updated tag object.</returns>
ValueTask<TagAdapter> AddParentTag(string tagId, string parentTagId, CancellationToken cancellationToken);
/// <summary>
/// Removes a parentTag from the tag.
/// </summary>
/// <param name="tagId">The identifier of the tag to whom the parentTag will be added.</param>
/// <param name="parentTagId">The identifier of the parentTag to add.</param>
/// <returns>A <see cref="Task{TagAdapter}"/> representing the asynchronous operation, with the updated tag object.</returns>
ValueTask<TagAdapter> RemoveParentTag(string tagId, string parentTagId, CancellationToken cancellationToken);
}
}