<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/tanggalnow', function () {
    return [
        'tanggal' => date('Y-m-d'),
        'jam' => date('H:i:s')
    ];
});

$router->get('/', function () {
    return view('welcome.api');
});

// ----------------- REGISTRASI ACCESS SSO MULTI APP BY SCOPE
$router->group(['namespace'  => 'ApiSSO'], function () use ($router) {
    $router->post('/access/register', 'RegistrasiPlatrofmController@Register');
    $router->post('/access/login', 'LoginPlatformController@Login');
});

// ------------------- REGISTRASI POLIKLINIK MULTI PLATFORM
$router->group(['namespace' => 'ApiSIMRS', 'middleware' => 'bpjs'], function () use ($router) {
    $router->post('/antrian/registrasi/via/bpjs', 'AntrianController@Register');
    $router->post('/antrian/getrekap', 'AntrianController@getRekapAntrian');
    $router->post('/operasi/getoperasi', 'OperationController@getOperasi');
    $router->post('/operasi/getjadwal', 'OperationController@getJadwal');
});



$router->group(['namespace' => 'AntrolBpjs'], function () use ($router) {
    $router->get('/dokter', 'AntriController@Dokter');
    $router->get('/poli', 'AntriController@Poli');
    $router->get('/jadwal/kodepoli/{kodepoli}/tgl/{tgl}', 'AntriController@Jadwal');
    $router->get('/dashboard/waktutunggu/tanggal/{tgl}/waktu/{waktu}', 'AntriController@DashboardTanggal');
    $router->get('/dashboard/waktutunggu/bulan/{bulan}/tahun/{tahun}/waktu/{waktu}', 'AntriController@DashboardBulan');
    $router->get('/decompres', 'AntriController@decompressed');


    $router->post('/tambah', 'AntriController@TambahAntrean');
    $router->post('/updatejadwal', 'AntriController@UpdateJadwal');
    $router->post('/updateantrean', 'AntriController@UpdateWaktuAntrean');
    $router->post('/batal', 'AntriController@BatalAntrean');
    $router->post('/listtask', 'AntriController@GetListTask');

    //-------------------------------- update v3---------------------------------------------------------------------//
    $router->get('/polifinger', 'AntriController@GetListFPPoli');
    $router->get('/pasien/fp/{jnsid}/{noid}', 'AntriController@RefPasienFP');
    $router->get('/antreanpertanggal/{tanggal}', 'AntriController@AntreanPerTanggal');
    $router->get('/antreanperkodebooking/{kodebooking}', 'AntriController@AntreanPerKodeBooking');
    $router->get('/antreandilayani', 'AntriController@AntreanDiLayani');
    $router->get('/antreandilayani/kp/{kodepoli}/kd/{kodedokter}/hr/{hari}/jp/{jampraktek}', 'AntriController@AntreanDiLayaniHariDokterPoli');
    $router->post('/tambahfarmasi', 'AntriController@AddAntrianFarmasi');


    // ---------APCARE------
    $router->get('/referensikamar', 'AntriController@Referensi_kamar');
    $router->get('/aplicaresws/mulai/{mulai}/limit/{limit}', 'AntriController@Ketersediaan_kamar');


});
// 





// ----------------- API BRIDGING BANK JATENG
$router->group(['namespace'  => 'ApiBankJateng', 'middleware' => 'bankjateng'], function () use ($router) {
    $router->post('/tagihan/pasien', 'TagihanController@getTagihanPasien');
    $router->post('/tagihan/bayartagihan', 'BankJatengController@bayarTagihan');
});
