<commit_before>import { Meteor } from 'meteor/meteor';
import { Table, Tables, TableStatus, TableType } from '../imports/api/table.js';
import { Order, Orders } from '../imports/api/orders.js';

import '../imports/api/reservation.js';


// loops through all reservation tables checking if they can be made walkins 
function check_reservation_interval(){
	//console.log("Triggered check reservation");
	Table.find({$or: [{'table_type':TableType.RESERVATION},{'converted':true}]}).forEach(function(table_entry){

		//if the table is not reserved, convert it to walk for this hour
		if(table_entry.table_type == TableType.RESERVATION && table_entry.table_status != TableStatus.RESERVED){

			table_entry.table_type = TableType.WALKIN;
			table_entry.converted = true;
			table_entry.save();
		}
		//if it was converted to walk and is not taken, convert back
		else if(table_entry.converted == true && table_entry.table_status != TableStatus.TAKEN){
			table_entry.table_type = TableType.RESERVATION;
			table_entry.converted = false;
			table_entry.save();
		}


	});

	

}


Meteor.startup(() => {
	var curDate = new Date();

	
	Tables.remove({});
	Orders.remove({});

	for(i=1;i<=16;i++){
		//create astronomy table obj entry
		//L_status just for testing
		L_status = (i%4) ? TableStatus.CLEAN : TableStatus.RESERVED;
		var table_entry = new Table({
			"table_id": i,
			"size": 4,
			"occupants" : 0,
			"table_status":L_status,
			"table_type":TableType.RESERVATION,
			"reservation_intv":1,
			"converted" : false,
			"billPaid"	: false,
		});
		table_entry.save();
	}
	
	for ( i = 1; i <= 5; i++)
	{
		var order_entry = new Order({
			"orderID": i,
			"waiterID": 1,
			"menuItemID": 7,<commit_msg>Added ENUM type to order delc.<commit_after>import { Meteor } from 'meteor/meteor';
import { Table, Tables, TableStatus, TableType } from '../imports/api/table.js';
import { Order, Orders } from '../imports/api/orders.js';

import '../imports/api/reservation.js';


// loops through all reservation tables checking if they can be made walkins 
function check_reservation_interval(){
	//console.log("Triggered check reservation");
	Table.find({$or: [{'table_type':TableType.RESERVATION},{'converted':true}]}).forEach(function(table_entry){

		//if the table is not reserved, convert it to walk for this hour
		if(table_entry.table_type == TableType.RESERVATION && table_entry.table_status != TableStatus.RESERVED){

			table_entry.table_type = TableType.WALKIN;
			table_entry.converted = true;
			table_entry.save();
		}
		//if it was converted to walk and is not taken, convert back
		else if(table_entry.converted == true && table_entry.table_status != TableStatus.TAKEN){
			table_entry.table_type = TableType.RESERVATION;
			table_entry.converted = false;
			table_entry.save();
		}


	});

	

}


Meteor.startup(() => {
	var curDate = new Date();

	
	Tables.remove({});
	Orders.remove({});

	for(i=1;i<=16;i++){
		//create astronomy table obj entry
		//L_status just for testing
		L_status = (i%4) ? TableStatus.CLEAN : TableStatus.RESERVED;
		var table_entry = new Table({
			"table_id": i,
			"size": 4,
			"occupants" : 0,
			"table_status":L_status,
			"table_type":TableType.RESERVATION,
			"reservation_intv":1,
			"converted" : false,
			"billPaid"	: false,
		});
		table_entry.save();
	}
	
	for ( i = 1; i <= 5; i++)
	{
		var order_entry = new Order({
			"orderID": i,
			"orderType": 1,
			"waiterID": 1,
			"menuItemID": 7,
{'fraction_non_alphanumeric': 0.15087209302325583, 'fraction_numerical': 0.006686046511627907, 'mean_word_length': 4.01603498542274, 'pattern_counts': {'":': 17, '<': 7, '<?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': '4395291', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1179, 'n_words': 278}