feat: enhance risk pool management and role validation
- Updated AGENTS.md to streamline information on risk pool operations and agent account restrictions. - Introduced filtering options in AdminRiskPoolIndexController for active risk pools. - Refactored AdminRiskPoolLockLogIndexController to support grouping by ticket or entry. - Enhanced AdminRoleStoreController and AdminRoleUpdateController to prevent the use of reserved slugs for new roles. - Improved error messaging for role creation and updates to clarify reserved role restrictions. - Added new API routes for ticket item retrieval to improve admin functionalities.
This commit is contained in:
@@ -23,6 +23,7 @@ final class AdminRiskPoolIndexController extends Controller
|
||||
$p = AdminApiList::readPaging($request);
|
||||
$soldOutOnly = $request->boolean('sold_out_only');
|
||||
$highRiskOnly = $request->boolean('high_risk_only');
|
||||
$activeOnly = $request->boolean('active_only');
|
||||
$number = trim((string) $request->query('normalized_number', ''));
|
||||
$sort = trim((string) $request->query('sort', 'usage_desc'));
|
||||
|
||||
@@ -34,6 +35,13 @@ final class AdminRiskPoolIndexController extends Controller
|
||||
if ($highRiskOnly) {
|
||||
$q->whereRaw('(locked_amount * 1.0 / NULLIF(total_cap_amount, 0)) >= 0.8');
|
||||
}
|
||||
if ($activeOnly) {
|
||||
$q->where(function ($inner): void {
|
||||
$inner->where('locked_amount', '>', 0)
|
||||
->orWhere('sold_out_status', 1)
|
||||
->orWhereRaw('(locked_amount * 1.0 / NULLIF(total_cap_amount, 0)) >= 0.8');
|
||||
});
|
||||
}
|
||||
if ($number !== '') {
|
||||
$q->where('normalized_number', 'like', '%'.$number.'%');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user