Exemplo n.º 1
0
        public async Task <IWrappedResponse> Create(AddressesCreateRequest request)
        {
            var cmd = ServiceCommand <AddressAdministration, Rules.Address.Create.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Address.Create.MainRule(request))
                      .Then(CreateAction);

            return(await cmd.Execute());
        }
Exemplo n.º 2
0
        public async Task <IWrappedResponse> Update(int id, VouchersUpdateRequest request)
        {
            var cmd = ServiceCommand <IWrappedResponse <Contracts.Models.Voucher>, Rules.Vouchers.Update.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Vouchers.Update.MainRule((id, request)))
                      .Then(UpdateAction);

            return(await cmd.Execute());
        }
Exemplo n.º 3
0
        public async Task <IWrappedResponse> Summary(VouchersSearchRequest request)
        {
            var cmd = ServiceCommand <IWrappedResponse, Rules.Vouchers.Summary.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Vouchers.Summary.MainRule(request))
                      .Then(SummaryAction);

            return(await cmd.Execute());
        }
Exemplo n.º 4
0
        public async Task <IWrappedResponse> GetByNumber(string number)
        {
            var cmd = ServiceCommand <IWrappedResponse, Rules.Vouchers.GetByNumber.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Vouchers.GetByNumber.MainRule(number))
                      .Then(GetByNumberAction);

            return(await cmd.Execute());
        }
Exemplo n.º 5
0
        // Wird im Controller aber nicht im Client verwendet
        public async Task <IWrappedResponse> GetAll()
        {
            var cmd = ServiceCommand <IWrappedResponse <IEnumerable <PartnerDirectory> >, Rules.PartnerDirectory.GetAll.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.PartnerDirectory.GetAll.MainRule())
                      .Then(GetAllAction);

            return(await cmd.Execute());
        }
Exemplo n.º 6
0
        public async Task <IWrappedResponse> GetById(int id)
        {
            var cmd = ServiceCommand <AccountingRecord, Rules.AccountingRecords.GetById.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.AccountingRecords.GetById.MainRule(id))
                      .Then(GetByIdAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> CancelBid(int transportId, int bidId)
        {
            var cmd = ServiceCommand <TransportOfferingBid, Rules.TransportOfferings.CancelBid.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.TransportOfferings.CancelBid.MainRule((transportId, bidId)))
                      .Then(CancelBidAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> GetSortingOptionsByReceiptId(int id)
        {
            var cmd = ServiceCommand <LoadCarrierReceipt, Rules.LoadCarrierReceipts.GetSortingOptionsByReceiptId.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.LoadCarrierReceipts.GetSortingOptionsByReceiptId.MainRule(id))
                      .Then(GetSortingOptionsByReceiptIdAction);

            return(await cmd.Execute());
        }
Exemplo n.º 9
0
        public async Task <IWrappedResponse> Delete(DocumentNumberSequenceDeleteRequest request)
        {
            var cmd = ServiceCommand <DocumentNumberSequence, Rules.DocumentNumberSequence.Delete.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.DocumentNumberSequence.Delete.MainRule(request))
                      .Then(DeleteAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> GetById(int id)
        {
            var cmd = ServiceCommand <TransportOffering, Rules.TransportOfferings.GetById.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.TransportOfferings.GetById.MainRule(id))
                      .Then(GetByIdAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> GetAll()
        {
            var cmd = ServiceCommand <PostingAccount, Rules.PostingAccount.GetAll.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.PostingAccount.GetAll.MainRule(new PostingAccountsSearchRequest()))
                      .Then(GetAllAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> Delete(LoadingLocationsDeleteRequest request)
        {
            var cmd = ServiceCommand <LoadingLocationAdministration, Rules.LoadingLocation.Delete.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.LoadingLocation.Delete.MainRule(request))
                      .Then(DeleteAction);

            return(await cmd.Execute());
        }
Exemplo n.º 13
0
        public async Task <IWrappedResponse> Search(OrderSearchRequest request)
        {
            var cmd = ServiceCommand <Order, Rules.Order.Search.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Order.Search.MainRule(request))
                      .Then(SearchAction);

            return(await cmd.Execute());
        }
Exemplo n.º 14
0
        public async Task <IWrappedResponse> Create(UserCreateRequest request)
        {
            var cmd = ServiceCommand <User, Rules.User.Create.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.User.Create.MainRule(request))
                      .Then(CreateAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> Create(CustomerPartnersCreateRequest request)
        {
            var cmd = ServiceCommand <CustomerPartner, MainRule>
                      .Create(_serviceProvider)
                      .When(new MainRule(request))
                      .Then(CreateAction);

            return(await cmd.Execute());
        }
Exemplo n.º 16
0
        public async Task <IWrappedResponse> UpdateLocked(UsersLockRequest request)
        {
            var cmd = ServiceCommand <User, Rules.User.UpdateLock.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.User.UpdateLock.MainRule(request))
                      .Then(UpdateLockedAction);

            return(await cmd.Execute());
        }
Exemplo n.º 17
0
        public async Task <IWrappedResponse> ResetPassword(UserResetPasswordRequest request)
        {
            var cmd = ServiceCommand <User, Rules.User.ResetPassword.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.User.ResetPassword.MainRule(request))
                      .Then(ResetPasswordAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> Cancel(int id, LoadCarrierReceiptsCancelRequest request)
        {
            var cmd = ServiceCommand <IWrappedResponse, Rules.LoadCarrierReceipts.Cancel.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.LoadCarrierReceipts.Cancel.MainRule((id, request)))
                      .Then(CancelAction);

            return(await cmd.Execute());
        }
Exemplo n.º 19
0
        public async Task <IWrappedResponse> GetByCode(ExpressCodesSearchRequest request)
        {
            var cmd = ServiceCommand <IWrappedResponse, Rules.ExpressCode.GetByCode.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.ExpressCode.GetByCode.MainRule(request))
                      .Then(GetByCodeAction);

            return(await cmd.Execute());
        }
Exemplo n.º 20
0
        public async Task <IWrappedResponse> Create(CustomerDivisionDocumentSettingCreateRequest request)
        {
            var cmd = ServiceCommand <CustomerDivisionDocumentSetting, Rules.DivisionDocumentSetting.Create.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.DivisionDocumentSetting.Create.MainRule(request))
                      .Then(CreateAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> Update(ValuesUpdateRequest request)
        {
            var cmd = ServiceCommand <PostingAccountAdministration, Rules.PostingAccount.Update.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.PostingAccount.Update.MainRule(request))
                      .Then(UpdateAction);

            return(await cmd.Execute());
        }
Exemplo n.º 22
0
        public async Task <IWrappedResponse> Update(CustomerDivisionUpdateRequest request)
        {
            var cmd = ServiceCommand <CustomerDivision, Rules.CustomerDivision.Update.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.CustomerDivision.Update.MainRule(request))
                      .Then(UpdateAction);

            return(await cmd.Execute());
        }
Exemplo n.º 23
0
        public async Task <IWrappedResponse> GetDocumentDownload(int id, DocumentFileType type = DocumentFileType.Copy)
        {
            var cmd = ServiceCommand <Document, Rules.Documents.GetDocumentDownload.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Documents.GetDocumentDownload.MainRule((id, type)))
                      .Then(GetDocumentDownloadAction);

            return(await cmd.Execute());
        }
Exemplo n.º 24
0
        public async Task <IWrappedResponse> Delete(OrganizationDeleteRequest request)
        {
            var cmd = ServiceCommand <Organization, Rules.Organization.Delete.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Organization.Delete.MainRule(request))
                      .Then(DeleteAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> Search(LoadCarrierReceiptsSearchRequest request)
        {
            var cmd = ServiceCommand <LoadCarrierReceipt, Rules.LoadCarrierReceipts.Search.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.LoadCarrierReceipts.Search.MainRule(request))
                      .Then(SearchAction);

            return(await cmd.Execute());
        }
Exemplo n.º 26
0
        public async Task <IWrappedResponse> Cancel(int id, OrderCancelRequest request)
        {
            var cmd = ServiceCommand <Order, Rules.Order.Cancel.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.Order.Cancel.MainRule(id, request))
                      .Then(CancelAction);

            return(await cmd.Execute());
        }
Exemplo n.º 27
0
        public async Task <IWrappedResponse> Cancel(int id)
        {
            var cmd = ServiceCommand <IWrappedResponse, Rules.ExpressCode.Cancel.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.ExpressCode.Cancel.MainRule(id))
                      .Then(CancelAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> DeclineTransport(int transportId)
        {
            // TODO Make sure customer can only accept bids for transports he is allowed to see
            var cmd = ServiceCommand <TransportOfferingBid, Rules.TransportOfferings.DeclineTransport.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.TransportOfferings.DeclineTransport.MainRule(transportId))
                      .Then(DeclineTransportAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> AcceptBid(int transportId, TransportOfferingBidAcceptRequest request)
        {
            // TODO Make sure customer can only accept bids for transports he is allowed to see
            var cmd = ServiceCommand <TransportOfferingBid, Rules.TransportOfferings.AcceptBid.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.TransportOfferings.AcceptBid.MainRule((transportId, request)))
                      .Then(AcceptBidAction);

            return(await cmd.Execute());
        }
        public async Task <IWrappedResponse> Search(TransportOfferingsSearchRequest request)
        {
            // TODO go-live implement restrictions who can see which transport
            var cmd = ServiceCommand <TransportOffering, Rules.TransportOfferings.Search.MainRule>
                      .Create(_serviceProvider)
                      .When(new Rules.TransportOfferings.Search.MainRule(request))
                      .Then(SearchAction);

            return(await cmd.Execute());
        }