const host = "api/";

const routes = {
    auth: host + "auth/",
    users: host + "users/",
    operations: host + "operations/",
    bar: host + "bar/",
    session: host + "bar/session",
    ingredient: host + "ingredient",
    order: host + "order",
    cocktails: host + "cocktail",
    visitor: host + "visitors"
}

export const requests = {
    auth: {
        login: routes.auth + "login",
        refresh: routes.auth + "refresh",
        singOut: "signOut"
    },
    cocktails: {
        menu: routes.cocktails + "/menu",
        simple: routes.cocktails + "/simple",
        cocktail: routes.cocktails + "?id=",
        modal: routes.cocktails + "/modal?id=",
        edit: routes.cocktails,
        savePhoto: routes.cocktails + "/photo",
        favourite: routes.cocktails + "/favourite?id=",
        rating: routes.cocktails + "/rating?id=",
        receipts: routes.cocktails + "/receipts?id=",
        byIngredient: routes.cocktails + "/byIngredient?id=",
        instructions: routes.cocktails + "/instructions?id="
    },
    visitors: {
        all: routes.visitor,
        invite: routes.visitor + "/invite?"
    },
    bar: {
        list: routes.bar + "list",
        addToMyList: routes.bar + "addToMyList",
        enter: routes.bar + "enter?id=",
        pay: routes.order + "?",
        order: routes.order,
        myOrders: routes.order + "/my",
        purchases: routes.bar + "purchases",
        menu: routes.bar + "menu",
        ingredients: routes.ingredient,
        ingredientSimple: routes.ingredient + "/simple",
        ingredient: routes.ingredient,
        ingredientList: routes.ingredient + "/all",
        glass: routes.bar + "glass",
        category: routes.bar + "category",
        receipts: routes.bar + "receipt?id=",
        tags: routes.bar + "tags",
        type: routes.ingredient + "/type",
        session: {
            status: routes.session + "/info",
            change: routes.session
        },
        unit: routes.bar + "units"
    },
    users: {
        getMe: routes.bar + "getMe",
    },
    operations: {
        getAll: routes.operations,
        create: routes.operations,
    }
}