Improve GET /health-care-sheets v2

This commit is contained in:
Djery-Tom 2022-02-10 10:10:40 +01:00
parent f6044c886a
commit 4bcc89ded4
1 changed files with 3 additions and 3 deletions

View File

@ -1080,7 +1080,7 @@ class HealthCareSheetController extends Controller
* description="Status des feuilles de soins", * description="Status des feuilles de soins",
* @OA\Schema( * @OA\Schema(
* type="string", * type="string",
* enum = {"UNTREATED","TREATED","ACCEPTED","TO_BILL","ALL"}, * enum = {"UNTREATED","TREATED","ACCEPTED","TO_BILL","ALL","UNTREATED_ALL"},
* default = "UNTREATED" * default = "UNTREATED"
* ), * ),
* in="query", * in="query",
@ -1143,7 +1143,7 @@ class HealthCareSheetController extends Controller
'beneficiary_id' => 'nullable|integer|exists:nh_having_rights,id', 'beneficiary_id' => 'nullable|integer|exists:nh_having_rights,id',
'network_agent_id' => 'required_without:user_id|integer|exists:networks_agents,id', 'network_agent_id' => 'required_without:user_id|integer|exists:networks_agents,id',
'type' => 'nullable|in:CONSULTATION,EXECUTION', 'type' => 'nullable|in:CONSULTATION,EXECUTION',
'state' => 'nullable|in:UNTREATED,TREATED,ACCEPTED,TO_BILL,ALL', 'state' => 'nullable|in:UNTREATED,TREATED,ACCEPTED,TO_BILL,ALL,UNTREATED_ALL',
'pagination' => 'nullable|boolean' 'pagination' => 'nullable|boolean'
]); ]);
@ -1159,7 +1159,7 @@ class HealthCareSheetController extends Controller
if (!empty($beneficiary_id)) { if (!empty($beneficiary_id)) {
$query = $query->where('beneficiary_id', $beneficiary_id); $query = $query->where('beneficiary_id', $beneficiary_id);
} else { } else {
if (!in_array($state, ['ALL', 'UNTREATED'])) { if (!in_array($state, ['ALL', 'UNTREATED_ALL'])) {
$query = $query->whereNull('beneficiary_id'); $query = $query->whereNull('beneficiary_id');
} }
} }