Adds MotD and Message model as well as tests

This commit adds the MotD model for storing and retrieving
messages-of-the-day.

It also adds a model for messages. Messages have an author as well as a
thread they belong to, the thread can be read by a specific number of
authors. FUrthermore, the message model supports system messages.

This commit introduces a number of needed changes:
- Character is now implementing the CharacterInterface
- MissingCharacter and SystemCharacter are supporting "pseudo-characters"
- trait MockCharacter implements non-implemented methods for
  MissingCharacter and SytemCharacter
- Characters are now soft-deletable. Models wanting to load soft-deleted
  characters need to fetch them eagerly.

Closes #17
This commit is contained in:
Basilius Sauter
2016-05-03 14:56:09 +02:00
parent 53d82646bf
commit 0ff9958830
37 changed files with 1662 additions and 85 deletions
+7
View File
@@ -11,6 +11,13 @@ characters:
displayName: "Testcharacter 2"
health: 90
maxhealth: 90
-
id: 3
name: "Testcharacter 3"
displayName: "Testcharacter 3 (deleted)"
health: 90
maxhealth: 90
deletedAt: "2011-11-11 11:11:11"
character_properties:
-
owner_id: 1
+37
View File
@@ -0,0 +1,37 @@
characters:
-
id: 1
name: "Testcharacter 1"
displayName: "Testcharacter 1"
-
id: 2
name: "Testcharacter 2"
displayName: "Testcharacter 2"
-
id: 3
name: "Testcharacter 1"
displayName: "Deleted Testcharacter"
deletedAt: "2011-11-11 11:11:11"
-
id: 4
name: "Testcharacter 3"
displayName: "Testcharacter 3"
message_threads:
-
id: 1
threadKey: "messageThread://94ed406c5b7809bbdbf1e092cdbc2e4a"
messages:
-
id: 1
author_id: 1
thread_id: 1
message: "Hi!"
createdAt: "2000-01-01 00:00:01"
systemMessage: false
message_threads_x_characters:
-
messagethread_id: 1
character_id: 1
-
messagethread_id: 1
character_id: 2
+43
View File
@@ -0,0 +1,43 @@
characters:
-
id: 1
name: "Testcharacter 1"
displayName: "Testcharacter 1"
health: 0
maxhealth: 100
-
id: 2
name: "Testcharacter 2"
displayName: "Testcharacter 2"
health: 90
maxhealth: 90
-
id: 3
name: "Testcharacter 1"
displayName: "Deleted Testcharacter"
health: 200
maxhealth: 200
deletedAt: "2011-11-11 11:11:11"
motd:
-
id: 1
author_id: 1
title: "This is the title"
body: "This is the body of the message"
creationTime: "2016-05-03 14:19:12"
systemMessage: false
-
id: 2
author_id: 1
title: "This is a system message"
body: "This is the body of the system message"
creationTime: "2016-05-04 14:19:12"
systemMessage: true
-
id: 3
author_id: 3
title: "This is an old message."
body: "This is an old message."
creationTime: "2002-12-09 15:13:59"
systemMessage: false