public async Task <PlacedOrderDto> Add(PlacedOrder model)
        {
            DateTime startDateTime = DateTime.Today;                         //Today at 00:00:00
            DateTime endDateTime   = DateTime.Today.AddDays(1).AddTicks(-1); //Today at 23:59:59
            string   dateStr       = DateTime.Today.ToString("MMddyyyy");
            string   resStr        = $"{(model.RestaurantId):D4}";
            string   braStr        = $"{(model.BranchId):D4}";

            model.Code = string.Empty;

            var totalOrderToday = await _placedOrderRepository.Repo.Where(
                c => c.CreatedDate >= startDateTime && c.CreatedDate <= endDateTime).CountAsync();

            var entity = _placedOrderRepository.Add(model);
            await _unitOfWork.SaveChangesAsync();

            entity.Code = $"OD-{dateStr}{resStr}{braStr}{(totalOrderToday + 1):D5}";
            await _unitOfWork.SaveChangesAsync();

            model.Id   = entity.Id;
            model.Code = entity.Code;

            return(_mapper.Map <PlacedOrderDto>(model));
        }