1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

Move to libs

This commit is contained in:
Hinton
2022-06-03 16:24:40 +02:00
parent 28d15bfe2a
commit d7492e3cf3
878 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { BaseResponse } from "./baseResponse";
import { BillingInvoiceResponse, BillingTransactionResponse } from "./billingResponse";
export class BillingHistoryResponse extends BaseResponse {
invoices: BillingInvoiceResponse[] = [];
transactions: BillingTransactionResponse[] = [];
constructor(response: any) {
super(response);
const transactions = this.getResponseProperty("Transactions");
const invoices = this.getResponseProperty("Invoices");
if (transactions != null) {
this.transactions = transactions.map((t: any) => new BillingTransactionResponse(t));
}
if (invoices != null) {
this.invoices = invoices.map((i: any) => new BillingInvoiceResponse(i));
}
}
get hasNoHistory() {
return this.invoices.length == 0 && this.transactions.length == 0;
}
}