/// <summary>
        /// Allows to set the fields of the Value Object stored in the repository by Status Sell ID
        /// </summary>
        /// <param name="description"></param>
        public async Task <StatusSell> GetStatusSellByDesc(string description)
        {
            StatusSell statusSell = new StatusSell();

            statusSell = await _statusSellRepository.GetByDesc(description);

            return(statusSell);
        }
Example #2
0
        public async Task <string> CreateSellAsync(string correlationToken)
        {
            string result = String.Empty;

            try
            {
                Folio_Venta = Guid.NewGuid().ToString();
                StatusSell statusSell = new StatusSell(_statusSellRepository);
                Status = await statusSell.GetStatusSellByDesc("Activa");

                SellItems     = new Dictionary <string, SellItem>();
                Date          = DateTime.UtcNow;
                ItemsQuantity = 0;
                result        = await _sellRepository.Add(this, correlationToken);
            }
            catch (Exception e)
            {
                throw e;
            }
            return(result);
        }
Example #3
0
        public async Task <string> CheckOutSellAsync(string folio_Venta, string correlationToken)
        {
            string result = String.Empty;

            try
            {
                await GetSellbyIdAsync(folio_Venta, correlationToken);

                StatusSell statusSell = new StatusSell(_statusSellRepository);
                statusSell = await statusSell.GetStatusSellByDesc("Checkout");

                Status = statusSell;

                result = await _sellRepository.Update(this, correlationToken);
            }
            catch (Exception e)
            {
                throw e;
            }
            return(result);
        }