Handle thông tin record của người dùng

Model

{
  state: {
    type: Types.Select,
    options: 'draft, published, archived',
    default: 'published',
  },
  agent: {
    type: String,
  },
  unit: {
    type: Types.Relationship,
    ref: 'KUnit',
    initial: true,
  },
  unitName: {
    type: String,
  },
  author: {
    type: Types.Relationship,
    ref: 'User',
    required: true,
    initial: true,
  },
  title: {
    type: String,
    required: true,
    initial: true,
  },
  filePath: {
    type: Types.Url,
    required: true,
    initial: true,
  },
  // The original content will be here
  // if unit is absent, this value should be present
  // e.g. Khi người dùng thu âm các sentence, thì content chính là nội dung của sentence gốc
  content: {
    type: Types.Html,
    wysiwyg: true,
    height: 400,
  },
  checkingStatus: {
    type: Types.Select,
    options: 'new, assigned, done',
    default: 'new',
  },
  teacher: {
    type: Types.Relationship,
    ref: 'User',
  },
  isPrimary: {
    // this prop is used to check wherether this one get feedback or not
    type: Boolean,
    default: false,
  },
  recommended: {
    value: {
      type: Types.Boolean,
      default: false,
    },
    by: {
      type: Types.Relationship,
      ref: 'User',
    },
  },
  numberOfListen: {
    type: Number,
    default: 1,
  },
  numberOfReaction: {
    type: Number,
    default: 0,
  },
  numberOfComment: {
    type: Number,
    default: 0,
  },
  transcribeAccuracy: {
    // [0,100]
    // -1: grey
    // <50: red
    // 50 - 85: yellow
    // >85: green
    type: Number,
    default: -1,
  },
  transcribeStatus: {
    type: Types.Select,
    options: 'new, in_progress, completed, error, failed',
    default: 'new',
  },
  transcripts: {
    type: Types.Textarea,
    noedit: true,
    height: 250,
  },
  transcribeResultsJsonStr: {
    type: Types.Textarea,
    noedit: true,
  },
  mmm: {
    type: Types.TextArray
  },
  createdAt: {
    type: Types.Datetime,
    default: Date.now,
    noedit: true,
  },
}