Merge remote-tracking branch 'origin/tender' into staging
# Conflicts: # app/Exports/KJPPExport.php # app/Http/Controllers/KJPPController.php # app/Http/Requests/KJPPRequest.php # module.json # resources/views/kjpp/create.blade.php # resources/views/kjpp/show.blade.php # routes/web.php
This commit is contained in:
46
app/Http/Requests/JenisLaporanRequest.php
Normal file
46
app/Http/Requests/JenisLaporanRequest.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class JenisLaporanRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'code' => 'required|max:5',
|
||||
'name' => 'required|max:255',
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['code'] = 'required|max:5|unique:jenis_laporan,code,' . $this->id;
|
||||
} else {
|
||||
$rules['code'] = 'required|max:5|unique:jenis_laporan,code';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'code.required' => 'Kode Jenis Laporan Wajib diisi!',
|
||||
'code.max' => 'Kode Jenis Laporan maksimum 5 huruf!',
|
||||
'code.unique' => 'Kode Jenis Laporan tidak boleh sama!',
|
||||
'name.required' => 'Nama Jenis Laporan Wajib diisi!',
|
||||
'name.max' => 'Nama Jenis Laporan Wajib diisi!'
|
||||
];
|
||||
}
|
||||
}
|
||||
45
app/Http/Requests/JenisPenilaianKJPPRequest.php
Normal file
45
app/Http/Requests/JenisPenilaianKJPPRequest.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class JenisPenilaianKJPPRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'code' => 'required|max:5',
|
||||
'name' => 'required|max:255',
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['code'] = 'required|max:5|unique:tujuan_penilaian_kjpp,code,' . $this->id;
|
||||
} else {
|
||||
$rules['code'] = 'required|max:5|unique:tujuan_penilaian_kjpp,code';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'code.required' => 'Kode Tujuan Penilaian KJPP Wajib diisi!',
|
||||
'code.max' => 'Kode Tujuan Penilaian KJPP maksimum 5 huruf!',
|
||||
'code.unique' => 'Kode Tujuan Penilaian KJPP tidak boleh sama!',
|
||||
'name.required' => 'Nama Tujuan Penilaian KJPP Wajib diisi!',
|
||||
'name.max' => 'Nama Tujuan Penilaian KJPP Wajib diisi!'
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,10 @@ class KJPPRequest extends FormRequest
|
||||
'nomor_hp_pic_admin' => 'required|numeric|digits_between:10,15',
|
||||
'nama_pic_marketing' => 'required|string|not_regex:/^\d+$/|max:255',
|
||||
'nomor_hp_pic_marketing' => 'required|numeric|digits_between:10,15',
|
||||
'ijin_usaha_id' => 'nullable',
|
||||
'jenis_aset_id' => 'nullable',
|
||||
'ijin_usaha_id' => 'required|array',
|
||||
'ijin_usaha_id.*' => 'exists:ijin_usaha,code',
|
||||
'jenis_aset_id' => 'required|array',
|
||||
'jenis_aset_id.*' => 'exists:jenis_jaminan,code',
|
||||
'attachment' => 'nullable|mimes:pdf|max:1024'
|
||||
];
|
||||
|
||||
@@ -54,14 +56,6 @@ class KJPPRequest extends FormRequest
|
||||
return true;
|
||||
}
|
||||
|
||||
public function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'ijin_usaha_id' => json_encode($this->ijin_usaha_id),
|
||||
'jenis_aset_id' => json_encode($this->jenis_aset_id)
|
||||
]);
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
@@ -106,6 +100,10 @@ class KJPPRequest extends FormRequest
|
||||
'nomor_hp_pic_marketing.required' => 'Nomor HP PIC Marketing Wajib diisi!',
|
||||
'nomor_hp_pic_marketing.numeric' => 'Nomor HP PIC Marketing harus berupa angka!',
|
||||
'nomor_hp_pic_marketing.digits_between' => 'Nomor HP PIC Marketing minimum 10 digit dan maksimum 15 digit!',
|
||||
'ijin_usaha_id.required' => 'Ijin Usaha Wajib diisi!',
|
||||
'ijin_usaha_id.min' => 'Ijin Usaha Wajib diisi minimal satu atau lebih!',
|
||||
'jenis_aset_id.required' => 'Jenis Aset Wajib diisi!',
|
||||
'jenis_aset_id.min' => 'Jenis Aset Wajib diisi minimal satu atau lebih!',
|
||||
'attachment.mimes' => 'Attachment harus berformat pdf!',
|
||||
'attachment.max' => 'Attachment berukuran maksimum 1 MB!',
|
||||
];
|
||||
|
||||
75
app/Http/Requests/TenderPenawaranRequest.php
Normal file
75
app/Http/Requests/TenderPenawaranRequest.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TenderPenawaranRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'nama_kjpp_sebelumnya' => 'required|array',
|
||||
'nama_kjpp_sebelumnya.*' => 'exists:kjpp,name',
|
||||
'biaya_kjpp_sebelumnya' => 'required|numeric',
|
||||
'tanggal_penilaian_sebelumnya' => 'required',
|
||||
'nomor_registrasi' => 'required',
|
||||
'tujuan_penilaian_kjpp_id' => 'required',
|
||||
'jenis_laporan_id' => 'required',
|
||||
'start_date' => 'required',
|
||||
'end_date' => 'required',
|
||||
'catatan' => 'nullable',
|
||||
'status' => 'required'
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['code'] = 'required|max:50|unique:penawaran,code,' . $this->id;
|
||||
} else {
|
||||
$rules['code'] = 'required|max:50|unique:penawaran,code';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'code.required' => 'Kode Penawaran Wajib diisi!',
|
||||
'code.max' => 'Kode Penawaran maksimal 255 huruf!',
|
||||
'code.unique' => 'Kode Penawaran tidak boleh sama!',
|
||||
'nama_kjpp_sebelumnya.required' => 'Nama KJPP Sebelumnya Wajib diisi!',
|
||||
'biaya_kjpp_sebelumnya.required' => 'Biaya KJPP Sebelumnya Wajib diisi!',
|
||||
'biaya_kjpp_sebelumnya.numeric' => 'Biaya KJPP Sebelumnya harus berupa angka!',
|
||||
'tanggal_penilaian_sebelumnya.required' => 'Tanggal Penilaian Sebelumnya Wajib diisi!',
|
||||
'nomor_registrasi.required' => 'Nomor Registrasi Wajib diisi!',
|
||||
'tujuan_penilaian_kjpp_id.required' => 'Tujuan Penilaian KJPP Wajib diisi!',
|
||||
'jenis_laporan_id.required' => 'Jenis Laporan Wajib diisi!',
|
||||
'start_date.required' => 'Tanggal Awal Wajib diisi!',
|
||||
'end_date.required' => 'Tanggal Akhir Wajib diisi!',
|
||||
'status.required' => 'Status Wajib diisi!'
|
||||
];
|
||||
}
|
||||
|
||||
public function withValidator($validator)
|
||||
{
|
||||
$validator->after(function ($validator) {
|
||||
$startDate = strtotime($this->input('start_date'));
|
||||
$endDate = strtotime($this->input('end_date'));
|
||||
|
||||
if ($endDate < $startDate) {
|
||||
$validator->errors()->add('end_date', 'Tanggal Akhir tidak boleh lebih awal dari Tanggal Awal.');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user