<commit_before>var domain = require("jsdm")();
var db = require("../application/db");
var query = require("../application/query");

domain.register(
        "get",function (type, id, cb) {
            db.findOne({
                "id": id
            },cb);
        },
        "AggreClass",
        require("./User"),
        "repository", require("./userRepo"),
        "service", require("./validateUserUniqueService")(query)
    ).openMethod(
        "User.changePassword",
        "User.activate",
        "User.changeUsername",
        "User.deactivate"
    ).seal();

domain.on("User.*.create",function(data){
    data._id = data.id;
    db.save(data);
})

domain.on("User.*.update",function(data){
    var id = data.id;
    delete data.id;
    db.update({id:id},{ $set:data});
})

module.exports = domain;<commit_msg>fixed<commit_after>var domain = require("jsdm")();
var db = require("../application/db");
var query = require("../application/query");

domain.register(
        "get",function (type, id, cb) {
            db.findOne({
                "id": id
            },cb);
        },
        "AggreClass",
        require("./User"),
        "repository", require("./userRepo"),
        "service", require("./validateUserUniqueService")(query)
    ).openMethod(
        "User.changePassword",
        "User.activate",
        "User.changeUsername",
        "User.deactivate"
    ).seal();

domain.on("User.*.create",function(data){
    data._id = data.id;
    db.save(data);
})

domain.on("User.*.update",function(data){
    var id = data.id;
    db.update({id:id},{ $set:data});
})

module.exports = domain;
{'fraction_non_alphanumeric': 0.19753086419753085, 'fraction_numerical': 0.0, 'mean_word_length': 2.419831223628692, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '7508278', 'n_tokens_mistral': 508, 'n_tokens_neox': 504, 'n_words': 85}