예제 #1
0
        public async Task GetAfternoonOrders(CoffeeService coffee, User user, string text, SlackResponse response)
        {
            var at = DateTime.Now.Noon();

            if (DateTime.Now >= at)
            {
                throw new BadRequestException("오전에만 사용 가능한 메뉴입니다.");
            }

            var orders = await coffee.GetReservedOrdersAsync(at);

            if (orders.Count <= 0)
            {
                response.Ephemeral("오후 커피 예약자가 없습니다.");
                return;
            }

            var sb = new StringBuilder();
            await sb.AppendOrderInfo(coffee, orders);

            response.Ephemeral(sb.ToString());
        }