models/BanInfo.js

 export default class BanInfo {
    /**
     * @constructor BanInfo
     * @param {Object} banInfoMap - Ban info parameters
     * @param {number} banInfoMap.expiration - Ban expiration date
     * @param {string} [banInfoMap.reason] - Ban reason
     */
    constructor(banInfoMap) {
        try {
            this.expiration = parseInt(banInfoMap.expiration);
        } catch (e) {
            console.error(e);
            this.expiration = null;
        }

        this.reason = banInfoMap.reason || null;
        Object.freeze(this);
    }
}