Esempio n. 1
0
        public async Task <RejectShopCommandResponse> Handle(RejectShopCommand command)
        {
            var shop = _repository.Find(command.Id);

            if (shop == null)
            {
                throw new DomainException("شخص یافت نشد");
            }
            var shopStatusLog = new ShopStatusLog(Guid.NewGuid(), command.UserId, command.FirstName, command.LastName, ShopStatus.Reject);

            shop.ShopStatus        = ShopStatus.Reject;
            shop.DescriptionStatus = command.DescriptionStatus;
            shop.ShopStatusLogs.Add(shopStatusLog);
            await _fcmNotification.SendToIds(shop.GetPushTokens(), "رد تایید فروشگاه", "رد تایید فروشگاه با موفقیت انجام شد",
                                             NotificationType.ShopActivated, AppType.Shop, NotificationSound.Shopper);

            return(new RejectShopCommandResponse());
        }
Esempio n. 2
0
        public async Task <NeedToModifyShopCommandResponse> Handle(NeedToModifyShopCommand command)
        {
            var shop = _repository.Find(command.Id);

            if (shop == null)
            {
                throw new DomainException("فروشگاه یافت نشد");
            }
            var shopStatusLog = new ShopStatusLog(Guid.NewGuid(), command.UserId, command.FirstName, command.LastName, ShopStatus.NeedToModify);

            shop.ShopStatus        = ShopStatus.NeedToModify;
            shop.DescriptionStatus = command.DescriptionStatus;
            shop.ShopStatusLogs.Add(shopStatusLog);
            await _fcmNotification.SendToIds(shop.GetPushTokens(), "نیاز به اصلاح اطلاعات", "نیاز به اصلاح اطلاعات فروشگاه با موفقیت انجام شد",
                                             NotificationType.ShopActivated, AppType.Shop, NotificationSound.Shopper);

            return(new NeedToModifyShopCommandResponse());
        }