Skip to content

Commit

Permalink
Fixed action parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-bezuhlyi committed Jun 25, 2024
1 parent 2f1d2e1 commit 1f366d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Apps.XtrfCustomerPortal/Actions/InvoiceActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Apps.XtrfCustomerPortal.Models.Requests;
using Apps.XtrfCustomerPortal.Models.Responses.Invoices;
using Apps.XtrfCustomerPortal.Utilities.Extensions;
using Blackbird.Applications.Sdk.Common;
using Blackbird.Applications.Sdk.Common.Actions;
using Blackbird.Applications.Sdk.Common.Invocation;
using Blackbird.Applications.SDK.Extensions.FileManagement.Interfaces;
Expand All @@ -16,7 +17,7 @@ public class InvoiceActions(InvocationContext invocationContext, IFileManagement
: AppInvocable(invocationContext)
{
[Action("Search invoices", Description = "Search invoices")]
public async Task<GetInvoicesResponse> SearchInvoices(SearchInvoicesRequest request)
public async Task<GetInvoicesResponse> SearchInvoices([ActionParameter] SearchInvoicesRequest request)
{
var endpoint = "/invoices?limit=50";

Expand Down Expand Up @@ -47,14 +48,14 @@ public async Task<GetInvoicesResponse> SearchInvoices(SearchInvoicesRequest requ
}

[Action("Get invoice", Description = "Get a specific invoice")]
public async Task<InvoiceDto> GetInvoice(InvoiceIdentifier invoiceIdentifier)
public async Task<InvoiceDto> GetInvoice([ActionParameter] InvoiceIdentifier invoiceIdentifier)
{
var invoice = await Client.ExecuteRequestAsync<InvoiceDto>($"/invoices/{invoiceIdentifier.InvoiceId}", Method.Get, null);
return invoice;
}

[Action("Download invoice", Description = "Download a specific invoice as a PDF")]
public async Task<DownloadInvoiceResponse> DownloadInvoiceAsPdf(InvoiceIdentifier invoiceIdentifier)
public async Task<DownloadInvoiceResponse> DownloadInvoiceAsPdf([ActionParameter] InvoiceIdentifier invoiceIdentifier)
{
var invoicePdf = await Client.ExecuteRequestAsync($"/invoices/{invoiceIdentifier.InvoiceId}/document", Method.Get, null);
var rawBytes = invoicePdf.RawBytes!;
Expand Down
5 changes: 3 additions & 2 deletions Apps.XtrfCustomerPortal/Actions/QuoteActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Apps.XtrfCustomerPortal.Models.Requests;
using Apps.XtrfCustomerPortal.Models.Responses.Quotes;
using Apps.XtrfCustomerPortal.Utilities.Extensions;
using Blackbird.Applications.Sdk.Common;
using Blackbird.Applications.Sdk.Common.Actions;
using Blackbird.Applications.Sdk.Common.Files;
using Blackbird.Applications.Sdk.Common.Invocation;
Expand All @@ -19,7 +20,7 @@ public class QuoteActions(InvocationContext invocationContext, IFileManagementCl
: AppInvocable(invocationContext)
{
[Action("Search quotes", Description = "Search quotes")]
public async Task<GetQuotesResponse> SearchQuotes(SearchQuotesRequest searchQuotesRequest)
public async Task<GetQuotesResponse> SearchQuotes([ActionParameter] SearchQuotesRequest searchQuotesRequest)
{
var endpoint = "/quotes?limit=50";
if (!string.IsNullOrEmpty(searchQuotesRequest.Status))
Expand Down Expand Up @@ -61,7 +62,7 @@ public async Task<GetQuotesResponse> SearchQuotes(SearchQuotesRequest searchQuot
}

[Action("Get quote", Description = "Get a specific quote")]
public async Task<QuoteDto> GetQuote(QuoteIdentifier quoteIdentifier)
public async Task<QuoteDto> GetQuote([ActionParameter] QuoteIdentifier quoteIdentifier)
{
var quote = await Client.ExecuteRequestAsync<QuoteDto>($"/quotes/{quoteIdentifier.QuoteId}", Method.Get, null);
return quote;
Expand Down

0 comments on commit 1f366d7

Please sign in to comment.