mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
WIP(assignment): change to object style
to do--let assignment API accept an array
This commit is contained in:
@@ -128,20 +128,16 @@ export const TaskSchema = new Schema({
|
||||
group: {
|
||||
id: { $type: String, ref: 'Group', validate: [v => validator.isUUID(v), 'Invalid uuid for group task.'] },
|
||||
broken: { $type: String, enum: ['GROUP_DELETED', 'TASK_DELETED', 'UNSUBSCRIBED'] },
|
||||
assignedUsers: [{ $type: String, ref: 'User', validate: [v => validator.isUUID(v), 'Invalid uuid for group assigned user.'] }],
|
||||
assignedDate: { $type: Date },
|
||||
assigningUsername: { $type: String },
|
||||
taskId: { $type: String, ref: 'Task', validate: [v => validator.isUUID(v), 'Invalid uuid for group task.'] },
|
||||
approval: {
|
||||
required: { $type: Boolean, default: false },
|
||||
approved: { $type: Boolean, default: false },
|
||||
dateApproved: { $type: Date },
|
||||
approvingUser: { $type: String, ref: 'User', validate: [v => validator.isUUID(v), 'Invalid uuid for group approving user.'] },
|
||||
requested: { $type: Boolean, default: false },
|
||||
requestedDate: { $type: Date },
|
||||
assignedUsers: {
|
||||
$type: Schema.Types.Mixed,
|
||||
// key is assigned UUID, with
|
||||
// { assignedDate: Date,
|
||||
// assigningUsername: '@username',
|
||||
// completed: Boolean }
|
||||
},
|
||||
taskId: { $type: String, ref: 'Task', validate: [v => validator.isUUID(v), 'Invalid uuid for group task.'] },
|
||||
sharedCompletion: {
|
||||
$type: String, // legacy data
|
||||
$type: String, default: 'singleCompletion', // legacy data
|
||||
},
|
||||
managerNotes: { $type: String },
|
||||
completedBy: { $type: String, ref: 'User', validate: [v => validator.isUUID(v), 'Invalid uuid for group completing user.'] },
|
||||
|
||||
Reference in New Issue
Block a user