Aplikasi Keuangan yang mengatur lalu lintas transaksi antara bank dan aplikasi internal Kampus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

79 lines
3.0 KiB

<?php
namespace App\Domains\Finance\Schemas\Invoice;
use App\Domains\Academic\Queries\Selection\SelectFacultyQuery;
use App\Domains\Academic\Queries\Selection\SelectStudyProgramQuery;
use App\Domains\Academic\Queries\Selection\SelectTermQuery;
use App\Domains\Finance\Support\Schemas\InvoiceSchema;
use App\UI\Enums\InputType;
use App\UI\Support\Schemas\InputSchema;
class StudentInvoiceSchema
{
public static function make(): InvoiceSchema
{
return InvoiceSchema::make()
->addInput(
InputSchema::make()
->key('student_id')
->label(__('domains/finance/field.invoice.detail.student_id'))
->type(InputType::TEXTLINE)
->rules(['required'])
)
->addInput(
InputSchema::make()
->key('student_name')
->label(__('domains/finance/field.invoice.detail.student_name'))
->type(InputType::TEXTLINE)
->rules(['required', 'string'])
)
->addInput(
InputSchema::make()
->key('faculty')
->label(__('domains/finance/field.invoice.detail.faculty'))
->type(InputType::SELECT)
->rules(['required', 'string'])
->select2()
->live()
->options(fn () => SelectFacultyQuery::fetch())
)
->addInput(
InputSchema::make()
->key('study_program')
->label(__('domains/finance/field.invoice.detail.study_program'))
->type(InputType::SELECT)
->rules(['required', 'string'])
->select2()
->dependsOn('faculty')
->setContextKeys(['faculty'])
->options(fn ($context) => SelectStudyProgramQuery::fetch($context))
)
->addInput(
InputSchema::make()
->key('term_entry')
->label(__('domains/finance/field.invoice.detail.term_entry'))
->type(InputType::SELECT)
->rules(['required'])
->options(fn () => SelectTermQuery::fetch())
->select2()
)
->addInput(
InputSchema::make()
->key('semester')
->label(__('domains/finance/field.invoice.detail.semester'))
->type(InputType::SELECT)
->rules(['required'])
->options(array_combine(range(1, 13), range(1, 13)))
->select2()
)
->addInput(
InputSchema::make()
->key('fee_type')
->label(__('domains/finance/field.invoice.detail.fee_type'))
->type(InputType::SELECT)
->rules(['required'])
->select2()
);
}
}