|
| 1 | +/* ************************************************************************ |
| 2 | +
|
| 3 | + osparc - the simcore frontend |
| 4 | +
|
| 5 | + https://osparc.io |
| 6 | +
|
| 7 | + Copyright: |
| 8 | + 2025 IT'IS Foundation, https://itis.swiss |
| 9 | +
|
| 10 | + License: |
| 11 | + MIT: https://opensource.org/licenses/MIT |
| 12 | +
|
| 13 | + Authors: |
| 14 | + * Odei Maiz (odeimaiz) |
| 15 | +
|
| 16 | +************************************************************************ */ |
| 17 | + |
| 18 | +/** |
| 19 | + * Class that stores Conversation data. |
| 20 | + */ |
| 21 | + |
| 22 | +qx.Class.define("osparc.data.model.Conversation", { |
| 23 | + extend: qx.core.Object, |
| 24 | + |
| 25 | + /** |
| 26 | + * @param conversationData {Object} Object containing the serialized Conversation Data |
| 27 | + * */ |
| 28 | + construct: function(conversationData) { |
| 29 | + this.base(arguments); |
| 30 | + |
| 31 | + this.set({ |
| 32 | + conversationId: conversationData.conversationId, |
| 33 | + name: conversationData.name, |
| 34 | + userGroupId: conversationData.userGroupId, |
| 35 | + type: conversationData.type, |
| 36 | + created: new Date(conversationData.created), |
| 37 | + modified: new Date(conversationData.modified), |
| 38 | + projectId: conversationData.projectUuid || null, |
| 39 | + extraContent: conversationData.extraContent || null, |
| 40 | + }); |
| 41 | + }, |
| 42 | + |
| 43 | + properties: { |
| 44 | + conversationId: { |
| 45 | + check: "String", |
| 46 | + nullable: false, |
| 47 | + init: null, |
| 48 | + event: "changeConversationId", |
| 49 | + }, |
| 50 | + |
| 51 | + name: { |
| 52 | + check: "String", |
| 53 | + nullable: false, |
| 54 | + init: null, |
| 55 | + event: "changeName", |
| 56 | + }, |
| 57 | + |
| 58 | + userGroupId: { |
| 59 | + check: "Number", |
| 60 | + nullable: false, |
| 61 | + init: null, |
| 62 | + event: "changeUserGroupId", |
| 63 | + }, |
| 64 | + |
| 65 | + type: { |
| 66 | + check: [ |
| 67 | + "PROJECT_STATIC", |
| 68 | + "PROJECT_ANNOTATION", |
| 69 | + "SUPPORT", |
| 70 | + ], |
| 71 | + nullable: false, |
| 72 | + init: null, |
| 73 | + event: "changeType", |
| 74 | + }, |
| 75 | + |
| 76 | + created: { |
| 77 | + check: "Date", |
| 78 | + nullable: false, |
| 79 | + init: null, |
| 80 | + event: "changeCreated", |
| 81 | + }, |
| 82 | + |
| 83 | + modified: { |
| 84 | + check: "Date", |
| 85 | + nullable: false, |
| 86 | + init: null, |
| 87 | + event: "changeModified", |
| 88 | + }, |
| 89 | + |
| 90 | + projectId: { |
| 91 | + check: "String", |
| 92 | + nullable: true, |
| 93 | + init: null, |
| 94 | + event: "changeProjectId", |
| 95 | + }, |
| 96 | + |
| 97 | + extraContent: { |
| 98 | + check: "Object", |
| 99 | + nullable: true, |
| 100 | + init: null, |
| 101 | + event: "changeExtraContent", |
| 102 | + }, |
| 103 | + }, |
| 104 | + |
| 105 | + statics: { |
| 106 | + }, |
| 107 | +}); |
0 commit comments