<commit_before>'use strict';

var Branch = require('../../src/backend/models').Branch;
var Member = require('../../src/backend/models').Member;
var Group = require('../../src/backend/models').Group;

var newMember, newGroup;

Branch.create({name: 'Branch name'})
  .then(function() {
    return Member.create({firstName: 'Sherlock', lastName: 'Holmes', gender: 'horse radish', email: '<EMAIL>', dateOfBirth: '01/01/1990', primaryPhoneNumber: '0396291146', secondaryPhoneNumber: '0394291146', residentialAddress: null, postalAddress: null, membershipType: 'full', branchId: '0863a85e-e7d8-42db-8b16-80635b7ccbad', schoolType: 'Primary', contactFirstName: 'Jaime', contactLastName: 'Garzon', additionalInfo: 'Lots of information' });
  })
  .then(function(member) {
    newMember = member;
    return Group.create({ name: 'Waiting List', description: 'This is a description of the waiting list' });
  })
  .then(function(group) {
    newGroup = group;
    return newMember.addGroup(newGroup);
  })
  .then(function() {
    return newGroup.addMember(newMember);
  })
  .then(function() {
    return newGroup.getMembers();
  })
  .then(function(members) {
    console.log(members);
    return newMember.getGroups();
  })
  .then(function(groups) {
    console.log(groups)
  })
  .then(function() {<commit_msg>Slight mod to add group membership<commit_after>'use strict';

var Branch = require('../../src/backend/models').Branch;
var Member = require('../../src/backend/models').Member;
var Group = require('../../src/backend/models').Group;

var newMember, newGroup, newBranch;
Member.truncate({cascade: true})
    .then(Branch.truncate({cascade: true}))
    .then(function() {
        return Branch.truncate({cascade: true});
    })
    .then(function() {
        return Branch.create({id: 'fd4f7e67-66fe-4f7a-86a6-f031cb3af174', name: 'Branch name groups'});
    })
    .then(function(branch) {
        newBranch = branch;
        return Member.create({firstName: 'Sherlock', lastName: 'Holmes', gender: 'horse radish', memberSince: new Date(), email: '<EMAIL>', dateOfBirth: '01/01/1990', primaryPhoneNumber: '0396291146', secondaryPhoneNumber: '0394291146', residentialAddress: null, postalAddress: null, membershipType: 'full', branchId: 'fd4f7e67-66fe-4f7a-86a6-f031cb3af174', schoolType: 'Primary', contactFirstName: 'Jaime', contactLastName: 'Garzon', additionalInfo: 'Lots of information'});
    })
  .then(function(member) {
    newMember = member;
    return Group.create({ name: 'Waiting List', description: 'This is a description of the waiting list' });
  })
  .then(function(group) {
    newGroup = group;
    newBranch.addGroup(group);
    return newMember.addGroup(newGroup);
  })
  .then(function() {
    return newGroup.addMember(newMember);
  })
  .then(function() {
    return newGroup.getMembers();
  })
  .then(function(members) {
    console.log(members);
    return newMember.getGroups();
  })
  .then(function(groups) {
    console.log(groups);
  })
  .then(function() {
{'fraction_non_alphanumeric': 0.16878342245989306, 'fraction_numerical': 0.037098930481283425, 'mean_word_length': 4.363799283154122, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5095677', 'n_tokens_mistral': 1025, 'n_tokens_neox': 968, 'n_words': 199}