UNPKG

@iletimerkezi/iletimerkezi-node

Version:
26 lines 800 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AccountResponse = void 0; const BaseResponse_1 = require("./BaseResponse"); class AccountResponse extends BaseResponse_1.BaseResponse { constructor(data, statusCode) { super(data, statusCode); } getAmount() { return parseFloat(this.data?.balance?.amount || '0'); } getCredits() { return parseInt(this.data?.balance?.sms || '0', 10); } toJSON() { return { success: this.ok(), statusCode: this.getStatusCode(), message: this.getMessage(), amount: this.getAmount(), credits: this.getCredits() }; } } exports.AccountResponse = AccountResponse; //# sourceMappingURL=AccountResponse.js.map