<?php

use CodeIgniter\Router\RouteCollection;

/**
 * @var RouteCollection $routes
 */
$routes->get('/', 'Home::index');
$routes->group('api', ['namespace' => 'App\Controllers'], function($routes) {
    $routes->post('login', 'Auth::login');
    // Tambahkan route lain di sini nanti
    
    // Produk
    $routes->get('produk', 'Produk::index');
    $routes->get('produk/kategori', 'Produk::kategori'); 
    $routes->post('produk/tambah', 'Produk::tambah');

    // Stok & FEFO
    $routes->get('stok/monitoring', 'Stok::monitoring');
    $routes->post('stok/masuk', 'Stok::masuk');
    $routes->post('stok/keluar', 'Stok::keluar');
    $routes->get('stok/laporan', 'Stok::laporan');
});
