1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

[SM-288] Rename requests and responses to follow naming convention (#3806)

This commit is contained in:
Oscar Hinton
2022-10-18 19:01:42 +02:00
committed by GitHub
parent c2df5c608e
commit cf2d3f5382
375 changed files with 868 additions and 1054 deletions

View File

@@ -0,0 +1,23 @@
import { BaseResponse } from "./base.response";
import { BillingInvoiceResponse, BillingTransactionResponse } from "./billing.response";
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;
}
}