UNPKG

ecoledirecte.js

Version:

Good-looking client for EcoleDirecte's private API.

35 lines (34 loc) 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Transaction = exports.Wallet = void 0; class Wallet { constructor(o) { this.id = o.id; this.studentId = o.idEleve; this.type = o.typeCompte === "portemonnaie" ? "wallet" : "activity"; this.available = o.disponible; this.unitCost = o.montantVersement; this.editableAmount = o.montantModifiable; this.editableQuantity = o.quantiteModifiable; this.code = o.codeCompte; this.classServiceId = o.idServiceClasse; this.name = o.libelleCompte; this.balance = o.solde; this.future = o.avenir; this.transactions = o.ecritures && o.ecritures.map(e => new Transaction(e)); this._raw = o; } } exports.Wallet = Wallet; class Transaction { constructor(o) { this.date = new Date(o.date); this.name = o.libelle; this.lettering = o.lettrage || undefined; this.compInfo = o.infoComp || undefined; this.amount = o.montant; this.transactions = o.ecritures && o.ecritures.map(e => new Transaction(e)); this._raw = o; } } exports.Transaction = Transaction;