mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 19:23:52 +00:00
[AC-1944] Add provider billing history component (#9520)
* Add provider-billing-history.component * Implement provider client invoice export
This commit is contained in:
34
libs/common/src/billing/models/response/invoices.response.ts
Normal file
34
libs/common/src/billing/models/response/invoices.response.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { BaseResponse } from "@bitwarden/common/models/response/base.response";
|
||||
|
||||
export class InvoicesResponse extends BaseResponse {
|
||||
invoices: InvoiceResponse[] = [];
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
const invoices = this.getResponseProperty("Invoices");
|
||||
if (invoices && invoices.length) {
|
||||
this.invoices = invoices.map((t: any) => new InvoiceResponse(t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class InvoiceResponse extends BaseResponse {
|
||||
id: string;
|
||||
date: string;
|
||||
number: string;
|
||||
total: number;
|
||||
status: string;
|
||||
url: string;
|
||||
pdfUrl: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.id = this.getResponseProperty("Id");
|
||||
this.date = this.getResponseProperty("Date");
|
||||
this.number = this.getResponseProperty("Number");
|
||||
this.total = this.getResponseProperty("Total");
|
||||
this.status = this.getResponseProperty("Status");
|
||||
this.url = this.getResponseProperty("Url");
|
||||
this.pdfUrl = this.getResponseProperty("PdfUrl");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user