initial commit
This commit is contained in:
12
app/models/account.js
Normal file
12
app/models/account.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Model, { attr, belongsTo } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class Account extends Model {
|
||||
@attr() voId;
|
||||
@attr() provider;
|
||||
|
||||
@belongsTo('gebruiker', {
|
||||
async: true,
|
||||
inverse: null,
|
||||
})
|
||||
gebruiker;
|
||||
}
|
||||
7
app/models/bestuurseenheid-classificatie-code.js
Normal file
7
app/models/bestuurseenheid-classificatie-code.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import Model, { attr } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class BestuurseenheidClassificatieCode extends Model {
|
||||
@attr() label;
|
||||
@attr() scopeNote;
|
||||
@attr() uri;
|
||||
}
|
||||
15
app/models/bestuurseenheid.js
Normal file
15
app/models/bestuurseenheid.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import Model, { attr, belongsTo } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class Bestuurseenheid extends Model {
|
||||
@attr() naam;
|
||||
|
||||
@belongsTo('bestuurseenheid-classificatie-code', {
|
||||
async: true,
|
||||
inverse: null,
|
||||
})
|
||||
classificatie;
|
||||
|
||||
get fullName() {
|
||||
return `${this.classificatie.get('label')} ${this.naam}`.trim();
|
||||
}
|
||||
}
|
||||
7
app/models/chat-agent.js
Normal file
7
app/models/chat-agent.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import Model, { attr } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class ChatAgent extends Model {
|
||||
@attr uri;
|
||||
@attr name;
|
||||
@attr description;
|
||||
}
|
||||
16
app/models/chat-conversation.js
Normal file
16
app/models/chat-conversation.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import Model, { attr, belongsTo, hasMany } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class ChatConversation extends Model {
|
||||
@attr uri;
|
||||
@attr title;
|
||||
@attr('date') created;
|
||||
@attr('date') lastActivity;
|
||||
|
||||
@belongsTo('gebruiker', { async: true, inverse: null }) creator;
|
||||
@hasMany('chat-message', {
|
||||
async: false,
|
||||
inverse: 'conversation',
|
||||
polymorphic: true,
|
||||
})
|
||||
messages;
|
||||
}
|
||||
8
app/models/chat-document.js
Normal file
8
app/models/chat-document.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import Model, { attr } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class ChatDocument extends Model {
|
||||
@attr uri;
|
||||
@attr name;
|
||||
@attr mediaType;
|
||||
@attr url;
|
||||
}
|
||||
3
app/models/chat-instant-message.js
Normal file
3
app/models/chat-instant-message.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import ChatMessage from './chat-message';
|
||||
|
||||
export default class ChatInstantMessage extends ChatMessage {}
|
||||
16
app/models/chat-message.js
Normal file
16
app/models/chat-message.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import Model, { attr, belongsTo, hasMany } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class ChatMessage extends Model {
|
||||
@attr uri;
|
||||
@attr content;
|
||||
@attr('date') created;
|
||||
@attr maker;
|
||||
|
||||
@belongsTo('chat-conversation', {
|
||||
async: false,
|
||||
inverse: 'messages',
|
||||
as: 'chat-message',
|
||||
})
|
||||
conversation;
|
||||
@hasMany('chat-document', { async: false, inverse: null }) attachments;
|
||||
}
|
||||
27
app/models/gebruiker.js
Normal file
27
app/models/gebruiker.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import Model, { attr, hasMany } from '@warp-drive/legacy/model';
|
||||
|
||||
export default class Gebruiker extends Model {
|
||||
@attr uri;
|
||||
|
||||
@attr() voornaam;
|
||||
@attr() achternaam;
|
||||
|
||||
@hasMany('account', {
|
||||
async: true,
|
||||
inverse: null,
|
||||
})
|
||||
account;
|
||||
@hasMany('bestuurseenheid', {
|
||||
async: true,
|
||||
inverse: null,
|
||||
})
|
||||
bestuurseenheden;
|
||||
|
||||
get group() {
|
||||
return this.hasMany('bestuurseenheden').value()[0];
|
||||
}
|
||||
|
||||
get fullName() {
|
||||
return `${this.voornaam} ${this.achternaam}`.trim();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user