Add page for viewing the Invoice details

This commit is contained in:
nicolas.dorier
2017-10-13 00:25:45 +09:00
parent d469084596
commit 016db76306
10 changed files with 473 additions and 39 deletions

View File

@@ -65,12 +65,17 @@ namespace BTCPayServer.Servcices.Invoices
}
}
public async Task RemovePendingInvoice(string invoiceId)
public async Task<bool> RemovePendingInvoice(string invoiceId)
{
using(var ctx = _ContextFactory.CreateContext())
{
ctx.PendingInvoices.Remove(new PendingInvoiceData() { Id = invoiceId });
await ctx.SaveChangesAsync();
try
{
await ctx.SaveChangesAsync();
return true;
}
catch(DbUpdateException) { return false; }
}
}
@@ -207,12 +212,16 @@ namespace BTCPayServer.Servcices.Invoices
{
using(var context = _ContextFactory.CreateContext())
{
IQueryable<InvoiceData> query = context
.Invoices
.Include(o => o.Payments)
.Include(o => o.RefundAddresses);
if(!string.IsNullOrEmpty(queryObject.InvoiceId))
{
query = query.Where(i => i.Id == queryObject.InvoiceId);
}
if(!string.IsNullOrEmpty(queryObject.StoreId))
{
query = query.Where(i => i.StoreDataId == queryObject.StoreId);
@@ -380,5 +389,10 @@ namespace BTCPayServer.Servcices.Invoices
{
get; set;
}
public string InvoiceId
{
get;
set;
}
}
}