fix(webstatement): perbaiki validasi password untuk stmt_sent_type

Perubahan yang dilakukan:
- Mengubah input validasi dari `request_type` menjadi `stmt_sent_type` pada `PrintStatementRequest`.
- Memperbarui pesan error sesuai dengan perubahan nama input menjadi lebih relevan dan jelas.

Tujuan perubahan:
- Memastikan validasi dan pesan error sesuai dengan nama field yang digunakan.
- Menghindari potensi kekeliruan pengguna karena perbedaan nama field yang tidak sinkron.

Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
Daeng Deni Mardaeni
2025-07-11 09:51:32 +07:00
parent 6bd8b77d87
commit c264d63fa6

View File

@@ -45,11 +45,11 @@ class PrintStatementRequest extends FormRequest
// Password wajib diisi jika request_type diisi // Password wajib diisi jika request_type diisi
'password' => [ 'password' => [
function ($attribute, $value, $fail) { function ($attribute, $value, $fail) {
$requestType = $this->input('request_type'); $requestType = $this->input('stmt_sent_type');
// Jika request_type diisi, maka password wajib diisi // Jika request_type diisi, maka password wajib diisi
if (!empty($requestType) && empty($value)) { if (!empty($requestType) && empty($value)) {
$fail('Password is required when request type is specified.'); $fail('Password is required when statement sent type is specified.');
} }
} }
], ],
@@ -120,7 +120,7 @@ class PrintStatementRequest extends FormRequest
'period_to.regex' => 'End period must be in YYYYMM format', 'period_to.regex' => 'End period must be in YYYYMM format',
'period_to.gte' => 'End period must be after or equal to start period', 'period_to.gte' => 'End period must be after or equal to start period',
'request_type.in' => 'Request type must be single_account, branch, all_branches, or multi_account', 'request_type.in' => 'Request type must be single_account, branch, all_branches, or multi_account',
'password.required' => 'Password is required when request type is specified', 'password.required' => 'Password is required when statement sent type is specified',
]; ];
} }