<commit_before>{Message} = require 'jraphical'

module.exports = class JReview extends Message

  {ObjectId, ObjectRef, secure, dash} = require 'bongo'
  {Relationship}  = require 'jraphical'

  {log} = console

  @trait __dirname, '../../../traits/likeable'

  @share()

  @getDefaultRole =-> 'review'

  @set
    sharedMethods  :
      instance     : ['delete', 'like', 'fetchLikedByes', 'checkIfLikedBefore']
    schema         :
      isLowQuality : Boolean
      body         :
        type       : String
        required   : yes
      originType   :
        type       : String
        required   : yes
      originId     :
        type       : ObjectId
        required   : yes
      deletedAt    : Date
      deletedBy    : ObjectRef
      meta         : require 'bongo/bundles/meta'
    relationships  :
      likedBy      :
        targetType : "JAccount"
        as         : 'like'

  delete: secure (client, callback)->
    {delegate} = client.connection
    {getDeleteHelper} = Relationship<commit_msg>Make JReview likes notifiable.<commit_after>{Reply} = require 'jraphical'

module.exports = class JReview extends Reply

  {ObjectId, ObjectRef, secure, dash} = require 'bongo'
  {Relationship}  = require 'jraphical'

  {log} = console

  @trait __dirname, '../../../traits/likeable'
  @trait __dirname, '../../../traits/notifying'

  @share()

  constructor:->
    super
    @notifyOriginWhen 'LikeIsAdded'

  @getDefaultRole =-> 'review'

  @set
    sharedMethods  :
      static       : ['fetchRelated']
      instance     : ['delete', 'like', 'fetchLikedByes', 'checkIfLikedBefore']
    schema         :
      isLowQuality : Boolean
      body         :
        type       : String
        required   : yes
      originType   :
        type       : String
        required   : yes
      originId     :
        type       : ObjectId
        required   : yes
      deletedAt    : Date
      deletedBy    : ObjectRef
      meta         : require 'bongo/bundles/meta'
    relationships  :
      likedBy      :
        targetType : "JAccount"
        as         : 'like'

  delete: secure (client, callback)->
    {delegate} = client.connection
    {getDeleteHelper} = Relationship
{'fraction_non_alphanumeric': 0.10650887573964497, 'fraction_numerical': 0.0, 'mean_word_length': 1.8807339449541285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1461731', 'n_tokens_mistral': 644, 'n_tokens_neox': 629, 'n_words': 153}