예제 #1
0
        public async Task DeleteSupplierFromAnnouncementTemplate(DeleteSupplierFromAnnouncementModel deleteModel)
        {
            int joinRequestId = Util.Decrypt(deleteModel.JoinRequestIdString);
            AnnouncementJoinRequestSupplierTemplate joinRequest = await _joinRequestQueries.GetAnnouncementJoinRequestWithAttachmentsAndAnnouncementByRequestId(joinRequestId);

            joinRequest.DeleteSupplierJoinRequest(deleteModel.UserId, joinRequestId, deleteModel.DeleteReason);

            var announcementList = joinRequest.AnnouncementSupplierTemplate;

            await SendNotificationAfterDeleteSupplierFromAnnoincementList(deleteModel, announcementList);

            await _joinRequestCommands.UpdateAnnouncementJoinRequestAsync(joinRequest);
        }
예제 #2
0
        public void Should_Delete_SupplierFromAnnouncementTemplate()
        {
            var attachments = new List <AnnouncementTemplateJoinRequestAttachment>
            {
                new AnnouncementTemplateJoinRequestAttachment("name", "123")
            };
            var announcementId = 1;
            var cr             = "123";
            var statusId       = 4;
            var announcementJoinRequestSupplierTemplate = new AnnouncementJoinRequestSupplierTemplate(attachments, announcementId, cr, statusId);

            announcementJoinRequestSupplierTemplate.DeleteSupplierJoinRequest(1, 1, "delete Reason");

            announcementJoinRequestSupplierTemplate.ShouldNotBeNull();
            announcementJoinRequestSupplierTemplate.AnnouncementId.ShouldBe(announcementId);
            announcementJoinRequestSupplierTemplate.Cr.ShouldBe(cr);
            announcementJoinRequestSupplierTemplate.StatusId.ShouldBe((int)Enums.AnnouncementTemplateJoinRequestStatus.Deleted);
        }