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

this.locationDataModel = {
	createdDate: {type: Date},
	updatedDate: {type: Date},
	name: {type: String, required:true},
	latitude: {type: Number, required:true},
	longitude:	{type: Number, required: true},
	radius:	{type: Number, "default": 0, required: true}
};

var LocationSchema = new Schema(this.locationDataModel);
this.location = mongoose.model('Location', LocationSchema);

// Describe the JSON semantic validation schema
this.locationValidation = {
		properties: {
			createdDate: {
				description: 'Date this location was created in datastore',
				type: 'date'
			},
			updatedDate: {
				description: 'Date this location was last updated in datastore',
				type: 'date'
			},
			name: {
				description: 'Name of the location',
				type: 'string',
				required: true
			},
			latitude: {
				description: 'Latitude value for the location',
				type: 'number',
				minimum: -90.0,
				maximum: 90.0,
				messages: {
					minimum: 'Expected number >= -90.0',
					maximum: 'Expected number <= 90.0'
				},
				required: true
			},
			longitude: {
				description: 'Longitude value for the location',
				type: 'number',
				minimum: -180.0,
				maximum: 180.0,
				messages: {
					minimum: 'Expected number >= -180.0',
					maximum: 'Expected number <= 180.0'
				},
				required: true
			},
			radius: {
				description: 'Radius in units of degrees',
				type: 'number',
				"default": 0,
				required: true
			}
		}	
	};

// Describe the business logic validation schema

this.businessValidation = {
	properties: {
		name: {
			operations: {
				post: {
					unique: true,
					messages: {
						unique: "Location name must be unique."
					}
				},
				get: {},
				put: {},
				del: {}
			},
		},
		record: {
			unique: true,
			messages: { unique: "Location record already exists."}
		}
	}
};<commit_msg>removed unused business validation schema<commit_after>var mongoose = require('mongoose');
var Schema = mongoose.Schema;

this.locationDataModel = {
	createdDate: {type: Date},
	updatedDate: {type: Date},
	name: {type: String, required:true},
	latitude: {type: Number, required:true},
	longitude:	{type: Number, required: true},
	radius:	{type: Number, "default": 0, required: true}
};

var LocationSchema = new Schema(this.locationDataModel);
this.location = mongoose.model('Location', LocationSchema);

// Describe the JSON semantic validation schema
this.locationValidation = {
		properties: {
			createdDate: {
				description: 'Date this location was created in datastore',
				type: 'date'
			},
			updatedDate: {
				description: 'Date this location was last updated in datastore',
				type: 'date'
			},
			name: {
				description: 'Name of the location',
				type: 'string',
				required: true
			},
			latitude: {
				description: 'Latitude value for the location',
				type: 'number',
				minimum: -90.0,
				maximum: 90.0,
				messages: {
					minimum: 'Expected number >= -90.0',
					maximum: 'Expected number <= 90.0'
				},
				required: true
			},
			longitude: {
				description: 'Longitude value for the location',
				type: 'number',
				minimum: -180.0,
				maximum: 180.0,
				messages: {
					minimum: 'Expected number >= -180.0',
					maximum: 'Expected number <= 180.0'
				},
				required: true
			},
			radius: {
				description: 'Radius in units of degrees',
				type: 'number',
				"default": 0,
				required: true
			}
		}	
	};
{'fraction_non_alphanumeric': 0.13637676971973417, 'fraction_numerical': 0.017336030049118753, 'mean_word_length': 3.039673278879813, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, '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': '5183087', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1081, 'n_words': 320}