magister.js
Version:
A JavaScript implementation of the Magister 6 API
79 lines (63 loc) • 1.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _magisterThing = _interopRequireDefault(require("./magisterThing"));
var _person = _interopRequireDefault(require("./person"));
var _util = require("./util");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class Class extends _magisterThing.default {
/**
* @private
* @param {Magister} magister
* @param {Object} raw
*/
constructor(magister, raw) {
super(magister);
/**
* @type {String}
* @readonly
*/
this.id = (0, _util.toString)(raw.id || raw.Id);
/**
* @type {Date}
* @readonly
*/
this.beginDate = (0, _util.parseDate)(raw.begindatum);
/**
* @type {Date}
* @readonly
*/
this.endDate = (0, _util.parseDate)(raw.einddatum);
/**
* @type {String}
* @readonly
*/
this.abbreviation = raw.afkorting || raw.Afkorting;
/**
* @type {String}
* @readonly
*/
this.description = raw.omschrijving || raw.Omschrijving;
/**
* @type {Number}
* @readonly
*/
this.number = raw.volgnr || raw.Volgnr;
/**
* @type {Person}
* @readonly
*/
this.teacher = new _person.default(magister, {
Docentcode: raw.docent
});
/**
* @type {Boolean}
* @readonly
*/
this.hasClassExemption = raw.VakDispensatie || raw.VakVrijstelling;
}
}
var _default = Class;
exports.default = _default;