@@ -7,19 +7,6 @@
// Route::any('/debugging', 'SessionController@email_testing');
Route ::any ('/debugging' , function (){
$ pedido = array (
'id' => 1 ,
'produtos' => array (
0 => array (
"nome" => "Produto 1" , "quantidade" => 5
),
1 => array (
"nome" => "Produto 2" , "quantidade" => 6
))
);
return view ('ordercreated' , ['order_id' => 1234 , 'name' => 'Yves' , 'order' => $ pedido ]);
});
// Admin
Route ::post ('/admin/usuarios/pesquisar' , 'AdminController@pesquisarUsuario' );
Route ::post ('/admin/usuarios/banir' , 'AdminController@banirUsuario' );
@@ -30,121 +17,140 @@
Route ::get ('/admin/estatisticas' , 'AdminController@estatisticas' );
// ------------------------ENDING OF TESTING SECTION-------------------------- //
// Checkout
Route ::get ('/checkout/definir_pedidos' , 'CheckoutController@criarPedidoSessao' );
Route ::get ('/checkout/pegar_pedidos' , 'CheckoutController@pegarPedidos' );
Route ::post ('/checkout/definir_entregas' , 'CheckoutController@definirEntregas' );
Route ::get ('/checkout/revisar_pedido' , 'CheckoutController@revisarPedido' );
Route ::post ('/checkout/frete' , 'CheckoutController@calcularEntrega' );
Route ::post ('/checkout/finalizar' , 'CheckoutController@finalizar' );
// Checkout - OK
Route ::get ('/checkout/definir_pedidos' , 'CheckoutController@createSessionOrder' );
Route ::get ('/checkout/pegar_pedidos' , 'CheckoutController@getOrders' );
Route ::post ('/checkout/definir_entregas' , 'CheckoutController@setDeliveries' );
Route ::get ('/checkout/revisar_pedido' , 'CheckoutController@reviewOrder' );
Route ::post ('/checkout/frete' , 'CheckoutController@calculateDelivery' );
Route ::post ('/checkout/finalizar' , 'CheckoutController@finalize' );
Route ::post ('/checkout/pagar' , 'MoipController@buy' );
Route ::post ('/checkout/cartao' , 'MoipController@pagarCartao' );
Route ::get ('/checkout/boleto' , 'MoipController@pagarBoleto' );
// Carrinho
Route ::post ('/cart/frete' , 'CartController@calcularFrete' );
Route ::post ('/cart/quantity' , 'CartController@quantidade' );
Route ::get ('/cart/products_on_cart' , 'CartController@number' );
Route ::get ('/cart/getCart' , 'CartController@get' );
Route ::post ('/cart/remove' , 'CartController@remover' );
Route ::post ('/cart/add' , 'CartController@adicionar' );
Route ::get ('/cart/clear' , 'CartController@clear' ); // -- Limpar carrinho
Route ::post ('/checkout/cartao' , 'MoipController@payWithCreditCard' );
Route ::get ('/checkout/boleto' , 'MoipController@payWithBoleto' );
// Carrinho - OK
Route ::get ('/cart/getCart' , 'CartController@get' ); // Pega o carrinho
Route ::get ('/cart/products_on_cart' , 'CartController@number' ); // Pega o número de produtos no carrinho
Route ::post ('/cart/add' , 'CartController@addProduct' ); // Adiciona o produto no carrinho
Route ::post ('/cart/remove' , 'CartController@removeProduct' ); // Remove o produto do carrinho
Route ::get ('/cart/clear' , 'CartController@clear' ); // Limpa o carrinho
Route ::post ('/cart/quantity' , 'CartController@changeQuantityOfProduct' ); // Muda a qtd de unidades de um produto no carrinho
Route ::post ('/cart/frete' , 'CartController@GetDeliveryValues' ); // Simula o frete do pedido no carrinho
// Entrega
Route ::get ('/delivery/address' , 'DeliveryController@userAddress' );
// Moip
Route ::post ('/moip/payment' , 'MoipController@buy' );
Route ::get ('/moip/balance' , 'MoipController@pegarSaldo' );
Route ::post ('/moip/withdraw' , 'MoipController@sacarDinheiro' );
// Compras
Route ::post ('/orders/myOrders' , 'ShoppingController@getAll' );
Route ::post ('/orders/compra' , 'ShoppingController@compra' );
Route ::post ('/orders/rastreio' , 'SalesController@rastreio' );
Route ::post ('/orders/venda' , 'SalesController@venda' );
Route ::any ('/orders/mySales' , 'SalesController@pegarVendas' );
Route ::post ('/orders/id' , 'OrderController@pedidoID' );
Route ::post ('/orders/loja' , 'StoreController@lojaID' );
Route ::post ('/order/getChat' , 'OrderChatController@getChat' );
Route ::post ('/order/sendMessage' , 'OrderChatController@write' );
Route ::post ('/order/avaliar_vendedor' , 'EvaluationController@avaliarVendedor' );
Route ::post ('/order/avaliar_comprador' , 'EvaluationController@avaliarComprador' );
Route ::post ('/order/checkComprador' , 'EvaluationController@compradorAvaliado' );
Route ::post ('/order/checkVendedor' , 'EvaluationController@vendedorAvaliado' );
// Usuário
Route ::get ('/delivery/address' , 'DeliveryController@userAddress' ); // Pega o endereço do usuário
// Moip - OK
Route ::get ('/moip/balance' , 'MoipController@getAccountBalance' );
Route ::post ('/moip/withdraw' , 'MoipController@withdrawMoney' );
// Pedidos - OK
Route ::post ('/orders/myOrders' , 'ShoppingController@getAll' ); // Pega compras
Route ::any ('/orders/mySales' , 'SalesController@getSales' ); // Pega vendas
Route ::post ('/orders/compra' , 'ShoppingController@getOrder' ); // Pega pedido de compra
Route ::post ('/orders/venda' , 'SalesController@getOrder' ); // Pega pedido de venda
Route ::post ('/order/getChat' , 'OrderChatController@getChat' ); // Pega o chat
Route ::post ('/order/sendMessage' , 'OrderChatController@write' ); // Escreve uma mensagem no chat
Route ::post ('/orders/rastreio' , 'SalesController@addTrackingCode' ); // Adiciona o código de rastreio ao pedido
Route ::post ('/orders/id' , 'OrderController@getOrderID' ); // Pega o id do pedido
Route ::post ('/orders/loja' , 'StoreController@getStoreID' ); // Pega o id da loja
// Avaliações - OK TODO: REWORK das funções
Route ::post ('/order/avaliar_vendedor' , 'EvaluationController@evaluateSeller' );
Route ::post ('/order/avaliar_comprador' , 'EvaluationController@evaluateBuyer' );
Route ::post ('/order/checkComprador' , 'EvaluationController@isBuyerEvaluated' );
Route ::post ('/order/checkVendedor' , 'EvaluationController@isSellerEvaluated' );
// Usuários - OK
Route ::post ('/user/signup' , 'UserController@signup' );
Route ::post ('/user/update' , 'UserController@update' );
Route ::post ('/user/login' , 'SessionController@login' );
Route ::post ('/user/activate' , 'UserController@ativarConta' );
Route ::get ('/user/logout' , 'SessionController@logout' );
Route ::get ('/user/session' , 'SessionController@checkSession' );
Route ::get ('/user/logged_user' , 'SessionController@get_infos' );
Route ::post ('/user/activate' , 'UserController@activateAccount' );
Route ::get ('/user/get_user' , 'UserController@getUser' );
Route ::get ('/user/checkStatus' , 'UserController@admin' );
Route ::get ('/user/destiny/{id}' , 'UserController@destinatario' );
// Favoritos
Route ::post ('/favorites/add' , 'FavoritesController@adicionar_favorito' );
Route ::post ('/favorites/remove' , 'FavoritesController@remover_favorito' );
Route ::post ('/favorites/get' , 'FavoritesController@pegar_favoritos' );
// Lojas
Route ::post ('/store/new_store' , 'StoreController@nova_loja' );
Route ::post ('/store/change_picture' , 'StoreController@alterarImagem' );
Route ::post ('/store/change_banner' , 'StoreController@alterarBanner' );
// Favoritos - OK
Route ::post ('/favorites/add' , 'FavoritesController@addFavorite' );
Route ::post ('/favorites/remove' , 'FavoritesController@removeFavorite' );
Route ::post ('/favorites/get' , 'FavoritesController@getFavorites' );
// Lojas - OK
Route ::post ('/store/new_store' , 'StoreController@newStore' );
Route ::post ('/store/update_store' , 'StoreController@alterar_loja' );
Route ::get ('/store/toggle_store' , 'StoreController@toggle_loja' );
Route ::get ('/store/checkStore' , 'SessionController@status_store' );
Route ::get ('/store/logged_store' , 'SessionController@logged_store' );
Route ::get ('/store/status_store' , 'SessionController@status_store' );
Route ::get ('/store/toggle_store' , 'StoreController@toggleStatusStore' );
Route ::post ('/store/store_products' , 'ProductController@getProductFromStore' );
Route ::any ('/store/produtos_vendidos' , 'StoreController@numberOfSales' );
Route ::get ('/store/featured' , 'FeaturedController@lojasDestaque' );
Route ::post ('/stores/get_store' , 'StoreController@getStore' );
Route ::get ('/stores/get_stores' , 'StoreController@getAllStores' );
// Produtos
Route ::post ('/product/add' , 'ProductController@novoProduto' );
Route ::post ('/product/update' , 'ProductController@alterar_produto' );
Route ::post ('/product/activate' , 'ProductController@ativar_produto' );
Route ::get ('/store/featured' , 'FeaturedController@featureStores' );
// Lojas - Upload de imagem
Route ::post ('/store/change_picture' , 'StoreController@uploadStoreLogo' );
Route ::post ('/store/change_banner' , 'StoreController@uploadBannerImage' );
// Pedidos - OK
Route ::get ('/order/set' , 'OrderController@setOrder' );
Route ::post ('/order/setDeliveryMethods' , 'DeliveryController@setDelivery' );
Route ::post ('/order/pegarPedido' , 'MoipController@getOrder' );
// Sessão - Produtos
Route ::post ('/user/login' , 'SessionController@login' );
Route ::get ('/user/logout' , 'SessionController@logout' );
Route ::get ('/user/session' , 'SessionController@checkSession' );
Route ::get ('/user/logged_user' , 'SessionController@get_infos' );
Route ::get ('/product/favorites' , 'FavoritesController@getFavorites' );
Route ::post ('/product/getForEdit' , 'ProductController@getProductForEdition' );
Route ::post ('/product/logged_products' , 'SessionController@logged_products' );
// Sessão - Lojas
Route ::get ('/store/checkStore' , 'SessionController@isStoreCreated' );
Route ::get ('/store/logged_store' , 'SessionController@logged_store' );
Route ::get ('/store/status_store' , 'SessionController@status_store' );
// Produtos - OK
Route ::post ('/product/add' , 'ProductController@newProduct' );
Route ::post ('/product/update' , 'ProductController@updateProduct' );
Route ::post ('/product/toggleStatus' , 'ProductController@toggleStatus' );
Route ::post ('/product/get' , 'ProductController@getProduct' );
Route ::post ('/product/getAll' , 'ProductController@getProducts' );
Route ::get ('/product/featured' , 'FeaturedController@featuredProducts' );
Route ::post ('/product/numberOfAll' , 'ProductController@getPageCount' );
//Operações com as imagens dos produtos
// Produtos - Upload de Imagens
Route ::post ('/product/profile/add' , 'UploadController@uploadProductProfile' );
Route ::post ('/product/extra/add' , 'UploadController@uploadProductExtra' );
Route ::post ('/product/remover_image' , 'UploadController@deleteProductExtra' );
Route ::post ('/product/deactivate' , 'ProductController@desativar_produto' );
Route ::post ('/product/get' , 'ProductController@getProduct' );
Route ::post ('/product/getForEdit' , 'ProductController@getProductForEdition' );
Route ::get ('/product/favorites' , 'FavoritesController@pegar_favoritos' );
Route ::post ('/product/logged_products' , 'SessionController@logged_products' );
Route ::post ('/product/getAll' , 'ProductController@listarProdutos' );
Route ::post ('/product/numberOfAll' , 'ProductController@countActive' );
Route ::get ('/product/featured' , 'FeaturedController@produtosDestaque' );
// Pedidos
Route ::get ('/order/set' , 'OrderController@definirPedido' );
Route ::post ('/order/setDeliveryMethods' , 'DeliveryController@setEntregas' );
Route ::post ('/order/pegarPedido' , 'MoipController@getOrder' );
// Perguntas
Route ::any ('/question/getActiveQuestions' , 'QuestionController@perguntasAtivas' );
Route ::post ('/question/ask' , 'QuestionController@perguntar' );
Route ::post ('/question/answer' , 'QuestionController@responder' );
Route ::post ('/question/getQuestions' , 'QuestionController@pegarPerguntas' );
Route ::post ('/question/getQuestion' , 'QuestionController@pegarPergunta' );
// Categorias
Route ::get ('/categories/getAll' , 'CategoryController@pegar_categorias' );
Route ::post ('/categories/new_category' , 'CategoryController@nova_categoria' );
Route ::post ('/categories/delete_category' , 'CategoryController@remover_categoria' );
// Marcas
Route ::post ('/brands/new_brand' , 'BrandController@nova_marca' );
Route ::post ('/brands/delete_brand' , 'BrandController@desativar_marca' );
Route ::get ('/brands/get_brands' , 'BrandController@pegar_marcas' );
// Fale Conosco
Route ::post ('/contact/contact_us' , 'ContactController@fale_conosco' );
// Endereços
Route ::post ('/address/get' , 'CorreiosController@pegarEndereco' );
Route ::post ('/address/getSignup' , 'CorreiosController@pegarEnderecoCadastro' );
// Pesquisa
Route ::post ('/search' , 'SearchController@pesquisar' );
// Perguntas - OK
Route ::post ('/question/ask' , 'QuestionController@ask' );
Route ::post ('/question/answer' , 'QuestionController@answer' );
Route ::post ('/question/getQuestions' , 'QuestionController@getQuestions' );
Route ::post ('/question/getQuestion' , 'QuestionController@getQuestion' );
Route ::any ('/question/getActiveQuestions' , 'QuestionController@getActiveQuestions' );
// Categorias - OK
Route ::post ('/categories/new_category' , 'CategoryController@newCategory' );
Route ::get ('/categories/getAll' , 'CategoryController@getCategories' );
// Marcas - OK
Route ::post ('/brands/new_brand' , 'BrandController@newBrand' );
Route ::get ('/brands/get_brands' , 'BrandController@getBrands' );
// Fale Conosco - OK
Route ::post ('/contact/contact_us' , 'ContactController@contact_us' );
// Endereços - OK
Route ::post ('/address/get' , 'CorreiosController@getAddress' );
Route ::post ('/address/getSignup' , 'CorreiosController@getAddressForSignup' );
// Pesquisa - OK
Route ::post ('/search' , 'SearchController@search' );
// Mensagens - OK
Route ::any ('/message/sent' , 'MessageController@enviadas' );
Route ::any ('/message/received' , 'MessageController@recebidas' );
Route ::post ('/message/get' , 'MessageController@pegarMensagem' );
Route ::post ('/message/send' , 'MessageController@escrever' );
Route ::post ('/message/answer' , 'MessageController@responder' );
Route ::any ('/message/sent' , 'MessageController@sent' );
Route ::any ('/message/received' , 'MessageController@received' );
Route ::post ('/message/get' , 'MessageController@getMessage' );
Route ::post ('/message/send' , 'MessageController@write' );
Route ::post ('/message/answer' , 'MessageController@answer' );
Route ::post ('/message/erase' , 'MessageController@erase' );