<commit_before>'use strict';

module.exports = function(app) {

  if (app.dataSources.db.name !== 'Memory') { return; }

  console.error('Started creating inital data.');

  var User = app.models.User;
  var Role = app.models.Role;
  var RoleMapping = app.models.RoleMapping;


  User.create({
    email: '<EMAIL>',
    firstName: 'System',
    lastName: 'Admin',
    password: '<PASSWORD>'
  }, function (err, user) {

    if(err) { console.log('err', err); }

     Role.create({name: 'admin'}, function (err, role) {
       role.principals.create({principalType: RoleMapping.USER, principalId: user.id});
     });

  });

  User.create({
    email: '<EMAIL>',
    firstName: 'App',
    lastName: 'User',
    password: '<PASSWORD>'
  }, function (err, user) {

    if(err) { console.log('err', err); }

     Role.create({name: 'admin'}, function (err, role) {
       role.principals.create({principalType: RoleMapping.USER, principalId: user.id});
     });

  });



  var Category = app.models.Category;
  var Product = app.models.Product;

  Category.create({
    name: 'General Products'
  }, function (err, category) {
    if(err) { console.log('err', err); }
      Product.create({name: 'Generic product', categoryId: category.id}, function (err, data) {
        console.log(data);
      });
      Product.create({name: 'Specific product', categoryId: category.id}, function (err, data) {
        console.log(data);
      });
  });

};<commit_msg>Creates initial data<commit_after>'use strict';

module.exports = function(app) {

  if (app.dataSources.db.name !== 'Memory') { return; }

  console.error('Started creating inital data.');

  var User = app.models.User;
  var Role = app.models.Role;
  var RoleMapping = app.models.RoleMapping;


  User.create({
    email: '<EMAIL>',
    firstName: 'System',
    lastName: 'Admin',
    password: '<PASSWORD>'
  }, function (err, user) {

    if(err) { console.log('err', err); }

     Role.create({name: 'admin'}, function (err, role) {
       role.principals.create({principalType: RoleMapping.USER, principalId: user.id});
     });

  });

  User.create({
    email: '<EMAIL>',
    firstName: 'App',
    lastName: 'User',
    password: '<PASSWORD>'
  }, function (err, user) {

    if(err) { console.log('err', err); }

     Role.create({name: 'admin'}, function (err, role) {
       role.principals.create({principalType: RoleMapping.USER, principalId: user.id});
     });

  });



  var Category = app.models.Category;
  var Product = app.models.Product;

  Category.create({
    name: 'General Products'
  }, function (err, category) {
    if(err) { console.log('err', err); }
      Product.create({name: 'Generic product', categoryId: category.id}, function (err, data) {
        console.log(data);
      });
      Product.create({name: 'Specific product', categoryId: category.id}, function (err, data) {
        console.log(data);
      });
  });

  var Setting = app.models.Setting;

  Setting.create({
    key: 'appName',
    value: 'Loopback-Angular-Admin'
  }, function (err, data) {
    if(err) { console.log('err', err); }
    console.log(data);
  });

};
{'fraction_non_alphanumeric': 0.17989756722151087, 'fraction_numerical': 0.0, 'mean_word_length': 3.172229639519359, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3471116', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1004, 'n_words': 223}