open-banking-pfm-sdk
Version:
The Open Banking PFM SDK uses Client classes and with **Promises** to get responses from the Open Banking PFM API in an easier way and structured as data models.
44 lines (43 loc) • 1.39 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Category_1 = __importDefault(require("./Category"));
class ParentCategory extends Category_1.default {
constructor({ id, name, color, imagePath, parentCategoryId, userId, isUserCategory, dateCreated, lastUpdated }, subcategories = []) {
super({
id,
name,
color,
imagePath,
parentCategoryId,
userId,
isUserCategory,
dateCreated,
lastUpdated
});
this._subcategories = subcategories;
}
get subcategories() {
return this._subcategories;
}
set subcategories(subcategories) {
this._subcategories = subcategories;
}
toObject() {
return {
id: this._id,
name: this._name,
color: this._color,
imagePath: this._imagePath,
parentCategoryId: this._parentCategoryId,
userId: this._userId,
isUserCategory: this._isUserCategory,
dateCreated: this._dateCreated,
lastUpdated: this._lastUpdated,
subcategories: this._subcategories
};
}
}
exports.default = ParentCategory;