using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using DomainResults.Mvc;
using WeatherForecast.Services;
namespace WeatherForecast.Controllers {
  /// 
  /// 
  /// 
  [ApiController]
  [AllowAnonymous]
  [Route("api/[controller]")]
  public class ShopCartItemsController : ControllerBase {
    private readonly IShopCartItemsService _shopCartItemsService;
    /// 
    /// 
    /// 
    /// 
    public ShopCartItemsController(
      IShopCartItemsService shopCartItemsService
    ) {
      _shopCartItemsService = shopCartItemsService;
    }
    /// 
    /// 
    /// 
    /// 
    [HttpGet("{siteId}/{userId}")]
    public IActionResult Get([FromRoute] Guid siteId, [FromRoute] Guid userId, [FromQuery] string? locale) {
      var result = _shopCartItemsService.Get(siteId, userId, locale);
      return result.ToActionResult();
    }
    /// 
    /// 
    /// 
    /// 
    /// 
    /// 
    [HttpDelete("{siteId}/{userId}")]
    public IActionResult Delete([FromRoute] Guid siteId, [FromRoute] Guid userId) {
      var result = _shopCartItemsService.Delete(siteId, userId);
      return result.ToActionResult();
    }
  
  }
}