aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/models/Workspace.js
blob: 6c73d70953dd34665643cee141230bccfb8c33cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { observable } from 'mobx';

export default class Workspace {
  id = null;

  @observable name = null;

  @observable order = null;

  @observable services = [];

  @observable userId = null;

  constructor(data) {
    if (!data.id) {
      throw Error('Workspace requires Id');
    }

    this.id = data.id;
    this.name = data.name;
    this.order = data.order;
    this.services.replace(data.services);
    this.userId = data.userId;
  }
}