<commit_before>var mongoose = require('mongoose');

var TripLegSchema = new mongoose.Schema({
	name: String,
	start_date: Date,
	end_date: Date,
	destination: String,
	transportation: String,
	accomodation_addr: String
	// TODO uncomment when you narrow down google autocomplete and can determine what type of address got selected
	//accomodation_type: String,
});

TripLegSchema.methods.validateLeg = function(trip_start_date, trip_end_date){
	// console.log("Validating trip.");
	// console.log("Trip start: " + trip_start_date);
	// console.log("Trip end: " + trip_end_date);
	// console.log(this);
	if(!this.destination){
		return {valid: false, err: 'You need to pick a valid destination for \"' + this.name + "\"."};<commit_msg>adding todo<commit_after>var mongoose = require('mongoose');

var TripLegSchema = new mongoose.Schema({
	name: String,
	start_date: Date,
	end_date: Date,
	destination: String,
	transportation: String,
	accomodation_addr: String
	// TODO uncomment when you narrow down google autocomplete and can determine what type of address got selected
	//accomodation_type: String,
});

TripLegSchema.methods.validateLeg = function(trip_start_date, trip_end_date){
	// console.log("Validating trip.");
	// console.log(this);
	// TODO make sure multiple leg trips dont overlap
	if(!this.destination){
		return {valid: false, err: 'You need to pick a valid destination for \"' + this.name + "\"."};
{'fraction_non_alphanumeric': 0.12544045102184637, 'fraction_numerical': 0.0, 'mean_word_length': 4.966386554621849, 'pattern_counts': {'":': 0, '<': 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': '462096', 'n_tokens_mistral': 449, 'n_tokens_neox': 444, 'n_words': 131}