blocker phase 6, catalog admin
This commit is contained in:
@@ -7,7 +7,10 @@ using Baya.Application.Features.Catalog.Commands.SetServiceCategoryActive;
|
||||
using Baya.Application.Features.Catalog.Commands.UpdateServiceCategory;
|
||||
using Baya.Application.Features.Catalog.Commands.UpdateServiceOptionGroup;
|
||||
using Baya.Application.Features.Catalog.Commands.UpdateServiceOptionValue;
|
||||
using Baya.Application.Features.Catalog.Queries.GetAdminOptionGroups;
|
||||
using Baya.Application.Features.Catalog.Queries.GetAdminServiceCategories;
|
||||
using Baya.Application.Models.Catalog;
|
||||
using Baya.Application.Models.Common;
|
||||
using Baya.Infrastructure.Identity.Identity.PermissionManager;
|
||||
using Baya.WebFramework.Attributes;
|
||||
using Baya.WebFramework.BaseController;
|
||||
@@ -24,6 +27,16 @@ namespace Baya.Web.Api.Controllers.V1;
|
||||
[Display(Description = "Admin: curate the catalog skeleton (categories + option groups/values; no delete)")]
|
||||
public sealed class AdminCatalogController(ISender sender) : BaseController
|
||||
{
|
||||
[HttpGet("[action]")]
|
||||
[ProducesOkApiResponseType<PagedResult<ServiceCategoryDto>>]
|
||||
public async Task<IActionResult> ListCategories([FromQuery] GetAdminServiceCategoriesQuery query, CancellationToken cancellationToken)
|
||||
=> OperationResult(await sender.Send(query, cancellationToken));
|
||||
|
||||
[HttpGet("[action]")]
|
||||
[ProducesOkApiResponseType<IReadOnlyList<OptionGroupDto>>]
|
||||
public async Task<IActionResult> ListOptionGroups([FromQuery(Name = "category_id")] long categoryId, CancellationToken cancellationToken)
|
||||
=> OperationResult(await sender.Send(new GetAdminOptionGroupsQuery(categoryId), cancellationToken));
|
||||
|
||||
[HttpPost("[action]")]
|
||||
[ProducesOkApiResponseType<ServiceCategoryDto>]
|
||||
public async Task<IActionResult> CreateCategory(CreateServiceCategoryCommand command, CancellationToken cancellationToken)
|
||||
|
||||
Reference in New Issue
Block a user