Skip to content

Question about Member Assignments Schema #3

@rjcorwin

Description

@rjcorwin

@leonardmensah I can't remember if we decided on a schema for Member assignments. Here's two options I came up with. Both work. The second one seems "more right" to me but I can't quite place my finger on why.

{
  kind: "Assignment",
  resourceId: <% Resource _id %>,
  createdBy: <% Member _id %>, 
  startDate: <% Unix timestamp %>,
  endDate: <% Unix timestamp %>,
  targetDate: <% Unix timestamp %>
  context: {
    subject: "English",
    use: "Video book", // or Stories for Week, or Lesson
    groupId: <% Group _id %>,
    memberId: <% Member _id %>,
    facilityId: <% Facility _id %>
  }
  configuration: {
    questions: [<% Question _id %>, <% Question _id %>, ...]
  }
}
{
  kind: "Assignment",
  resourceId: <% Resource _id %>,
  createdBy: <% Member _id %>, 
  startDate: <% Unix timestamp %>,
  endDate: <% Unix timestamp %>,
  targetDate: <% Unix timestamp %>
  context: {
    subject: "English",
    use: "Video book", // or Stories for Week, or Lesson
    targetId: <% Group _id || Member _id %>,
    targetKind: <% "Group" || "Member" %>,
    facilityId: <% Facility _id %>
  }
  configuration: {
    questions: [<% Question _id %>, <% Question _id %>, ...]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions