'use strict';

var categoryMenu = require('../services/response/categoryMenuResponse').getInstance();
var productMenu = require('../services/response/productMenuResponse').getInstance();
var checkoutMenu = require('../services/response/checkoutResponse').getInstance();
var orderMenu = require('../services/response/orderResponse').getInstance();
var checkOutMenu = require('../services/response/checkoutResponse').getInstance();

const MENU = 'menu';
const ALL = 'all';
const CATEGORY = 'category';
const PRODUCT = 'product';
const ORDER_PRODUCT = 'order';
const CHECKOUT_PRODUCT = 'checkout';

function ResponseFactory() {
}

ResponseFactory.prototype = {
    getResponse: function (message) {
        var messages = message.split('#');

        var type = messages[0];
        var data = null;
        if (messages.length > 1) {
            data = messages[1];
        }
        console.info("Request Type : ", type);
        console.info("Request Data : ", data);

        switch (type) {
            case MENU:
                break;
            case ALL:
                return categoryMenu.getResponse();
                break;
            case CATEGORY:
                return productMenu.getResponse(data);
                break;
            case PRODUCT:
                return checkoutMenu.getResponse(data[0]);
                break;
            case ORDER_PRODUCT:
                return orderMenu.getResponse(data[0]);
                break;
        }
    }
};

/**
 * @returns {ResponseFactory}
 */
module.exports.getInstance = function () {
    return new ResponseFactory();
};

@@ -422,16 +422,104 @@
 tance();
+%0Avar dailyMenuResponse = require('../services/response/checkoutResponse').getInstance();
 %0A%0Aconst 
@@ -1097,16 +1097,76 @@
 e MENU:%0A
+                return dailyMenuResponse.getResponse(data);%0A
         
@@ -1450,35 +1450,32 @@
 getResponse(data
-%5B0%5D
 );%0A             
@@ -1565,19 +1565,16 @@
 nse(data
-%5B0%5D
 );%0A     

add notifier