<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
use Illuminate\Support\Facades\Route;
use Modules\Account\Controllers\Admin\Bill;
use Modules\Account\Controllers\Admin\Family;
use Modules\Account\Controllers\Admin\Statistics;

Route::middleware(['auth.check:admin'])->group(function () {
    // 账单管理
    Route::get('account/bill', [Bill::class, 'index'])->name('account.bill.index');
    Route::post('account/bill', [Bill::class, 'add'])->name('account.bill.add');
    Route::put('account/bill', [Bill::class, 'edit'])->name('account.bill.edit');
    Route::delete('account/bill', [Bill::class, 'delete'])->name('account.bill.delete');
    Route::get('account/bill/detail', [Bill::class, 'detail'])->name('account.bill.detail');

    // 家庭管理
    Route::get('account/family', [Family::class, 'index'])->name('account.family.index');
    Route::post('account/family', [Family::class, 'add'])->name('account.family.add');
    Route::put('account/family', [Family::class, 'edit'])->name('account.family.edit');
    Route::delete('account/family', [Family::class, 'delete'])->name('account.family.delete');
    Route::get('account/family/detail', [Family::class, 'detail'])->name('account.family.detail');
    Route::get('account/family/members', [Family::class, 'members'])->name('account.family.members');
    Route::post('account/family/member', [Family::class, 'addMember'])->name('account.family.addMember');
    Route::delete('account/family/member', [Family::class, 'removeMember'])->name('account.family.removeMember');

    // 统计报表
    Route::get('account/statistics/overview', [Statistics::class, 'overview'])->name('account.statistics.overview');
    Route::get('account/statistics/trend', [Statistics::class, 'trend'])->name('account.statistics.trend');
    Route::get('account/statistics/category', [Statistics::class, 'category'])->name('account.statistics.category');
    Route::get('account/statistics/user', [Statistics::class, 'user'])->name('account.statistics.user');
    Route::get('account/statistics/family', [Statistics::class, 'family'])->name('account.statistics.family');
});
