Skip to content
Snippets Groups Projects
baseentity.js 1.39 KiB
Newer Older
Mathis Neumann's avatar
Mathis Neumann committed
/**
 * All models which represent data structures for API interaction.
 * Uses EmberData
 * @module models
 */
Mathis Neumann's avatar
Mathis Neumann committed
import Model from 'ember-data/model';
import attr from 'ember-data/attr';

Mathis Neumann's avatar
Mathis Neumann committed
/**
 * Model for a system which encapsulates all other models
 * @class BaseEntity
 * @extends DS.Model
 * @public
 */
Mathis Neumann's avatar
Mathis Neumann committed
export default Model.extend({
    // id: attr('string') - not allowed to be listed by ember
Mathis Neumann's avatar
Mathis Neumann committed
    /**
     * id of the system this entity is contained in
     *
     * @property systemId
     * @type {String}
     * @public
     */
    systemId: attr('string'),
Mathis Neumann's avatar
Mathis Neumann committed

    /**
     * a unique type identifier, see API documentation
     *
     * @property type
     * @type {String}
     * @public
     * @readonly
     */
    type: attr('string'),
Mathis Neumann's avatar
Mathis Neumann committed

    /**
     * the revisionNumber in which this object was created or updated from the ChangelogParser
     *
     * @property revisionNumber
     * @type {Number}
     * @public
     */
    revisionNumber: attr('number'),
Mathis Neumann's avatar
Mathis Neumann committed

    /**
     * the changelogSequence in which this object was created or updated from the ChangelogParser
     *
     * @property changelogSequence
     * @type {Number}
     * @public
     */
    changelogSequence: attr('number'),
Mathis Neumann's avatar
Mathis Neumann committed

    /**
     * the date in which this object was created or updated from the ChangelogParser
     *
     * @property lastUpdate
     * @type {Date}
     * @public
     * @readonly
     */
    lastUpdate: attr('date')
Mathis Neumann's avatar
Mathis Neumann committed
});