define(['app'], function (app) {
    'use strict';

    app.factory('$t_shirt', function ($http, $rootScope) {
        var DATA = [
            {
                info: {
                    name: 'T-Shirt 1',
                    description: '',
                    price: '',
                    gender: '',
                    image: ''
                },
                place_design: {
                    place_1 : {
                        'face'  : 'front',
                        'place' : 't_shirt_p_1'
                    },
                    place_2 : {
                        'face'  : 'front',
                        'place' : 't_shirt_p_2'
                    },
                    place_3 : {
                        'face'  : 'front',
                        'place' : 't_shirt_p_3'
                    }
                },
                color: [
                    {
                        name: 'color: 2E GRAY',
                        code: '#d0d0cd',
                        img: {
                            front: 'images/t-shirt/1/gray/front.png',
                            back: 'images/t-shirt/1/gray/back.png'
                        },
                    },
                    {
                        name: 'color: 00 BLACK',
                        code: '#23282e',
                        img: {
                            front: 'images/t-shirt/1/black/front.png',
                            back: 'images/t-shirt/1/black/back.png'
                        },
                    },
                    {
                        name: 'color: 3B ORANGE',
                        code: '#e2583b',
                        img: {
                            front: 'images/t-shirt/1/orange/front.png',
                            back: 'images/t-shirt/1/orange/back.png'
                        },
                    }
                ]
            },
            {
                info: {
                    name: 'T-Shirt 2',
                    description: '',
                    price: '',
                    gender: '',
                    image: ''
                },
                place_design: {
                    place_1 : {
                        'face'  : 'front',
                        'place' : 't_shirt_p_1'
                    },
                    place_2 : {
                        'face'  : 'front',
                        'place' : 't_shirt_p_2'
                    }
                },
                color: [
                    {
                        name: 'color:03 GRAY',
                        code: '#b2b4b2',
                        img: {
                            front: 'images/t-shirt/2/gray/front.png',
                            back: 'images/t-shirt/2/gray/back.png'
                        },
                    },
                    {
                        name: 'color:08 DARK GRAY',
                        code: '#37383d',
                        img: {
                            front: 'images/t-shirt/2/darkgray/front.png',
                            back: 'images/t-shirt/2/darkgray/back.png'
                        },
                    },
                    {
                        name: 'color:09 BLACK',
                        code: '#292929',
                        img: {
                            front: 'images/t-shirt/2/black/front.png',
                            back: 'images/t-shirt/2/black/back.png'
                        },
                    },
                    {
                        name: 'color:12 PINK',
                        code: '#ca6965',
                        img: {
                            front: 'images/t-shirt/2/pink/front.png',
                            back: 'images/t-shirt/2/pink/back.png'
                        },
                    },
                    {
                        name: 'color:18 WINE',
                        code: '#661e2e',
                        img: {
                            front: 'images/t-shirt/2/wine/front.png',
                            back: 'images/t-shirt/2/wine/back.png'
                        },
                    },
                    {
                        name: 'color:26 ORANGE',
                        code: '#bf6037',
                        img: {
                            front: 'images/t-shirt/2/orange/front.png',
                            back: 'images/t-shirt/2/orange/back.png'
                        },
                    },
                    {
                        name: 'color:57 OLIVE',
                        code: '#4c442e',
                        img: {
                            front: 'images/t-shirt/2/olive/front.png',
                            back: 'images/t-shirt/2/olive/back.png'
                        },
                    },
                    {
                        name: 'color:58 DARK GREEN',
                        code: '#204344',
                        img: {
                            front: 'images/t-shirt/2/darkgreen/front.png',
                            back: 'images/t-shirt/2/darkgreen/back.png'
                        },
                    },
                    {
                        name: 'color:69 NAVY',
                        code: '#2a2d3c',
                        img: {
                            front: 'images/t-shirt/2/navi/front.png',
                            back: 'images/t-shirt/2/navi/back.png'
                        },
                    }
                ]
            }
        ];

        return {
            getTShirtColor : function(key) {
                if (typeof DATA[key] == 'undefined'){
                    return [];
                }
                return DATA[key]['color'];
            },
            getTShirtPlace : function(key, place) {
                if(typeof DATA[key].place_design[place] == 'undefined' || typeof DATA[key].place_design[place] == 'null')
                    return [];

                return DATA[key].place_design[place];
            },

            getAll: function(){
                return DATA;
            },
            getList: function(category){
                if (typeof DATA[category] == 'undefined'){
                    return [];
                }
                return DATA[category];
            }
        };
    });
});
