mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
[AC-1943] Implement provider client invoice report (#4178)
* Update ProviderInvoiceItem SQL configuration * Implement provider client invoice export * Add tests * Run dotnet format * Fixed SPROC backwards compatibility issue
This commit is contained in:
@ -12,10 +12,6 @@ public class ProviderInvoiceItemEntityTypeConfiguration : IEntityTypeConfigurati
|
||||
.Property(t => t.Id)
|
||||
.ValueGeneratedNever();
|
||||
|
||||
builder
|
||||
.HasIndex(providerInvoiceItem => new { providerInvoiceItem.Id, providerInvoiceItem.InvoiceId })
|
||||
.IsUnique();
|
||||
|
||||
builder.ToTable(nameof(ProviderInvoiceItem));
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ public class ProviderInvoiceItemRepository(
|
||||
mapper,
|
||||
context => context.ProviderInvoiceItems), IProviderInvoiceItemRepository
|
||||
{
|
||||
public async Task<ProviderInvoiceItem> GetByInvoiceId(string invoiceId)
|
||||
public async Task<ICollection<ProviderInvoiceItem>> GetByInvoiceId(string invoiceId)
|
||||
{
|
||||
using var serviceScope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
@ -27,7 +27,7 @@ public class ProviderInvoiceItemRepository(
|
||||
where providerInvoiceItem.InvoiceId == invoiceId
|
||||
select providerInvoiceItem;
|
||||
|
||||
return await query.FirstOrDefaultAsync();
|
||||
return await query.ToArrayAsync();
|
||||
}
|
||||
|
||||
public async Task<ICollection<ProviderInvoiceItem>> GetByProviderId(Guid providerId)
|
||||
|
Reference in New Issue
Block a user