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.
118 lines
4.6 KiB
118 lines
4.6 KiB
<?php
|
|
|
|
namespace App\Domains\Billing\Support\Schemas\Invoice;
|
|
|
|
|
|
use App\Domains\Academic\Queries\Lookup\FacultyLookup;
|
|
use App\Domains\Academic\Queries\Lookup\StudyProgramLookup;
|
|
use App\Domains\Academic\Queries\Lookup\TermLookup;
|
|
use App\Domains\Admission\Queries\Lookup\AcademicProgramLookup;
|
|
use App\Domains\Admission\Queries\Lookup\AdmissionTrackLookup;
|
|
use App\Domains\Admission\Queries\Lookup\FeeTypeLookup;
|
|
use App\UI\Enums\InputType;
|
|
use App\UI\Support\Schemas\InputSchema;
|
|
|
|
class StudentInvoiceSchema extends CustomerInvoiceSchema
|
|
{
|
|
/**
|
|
* Build the complete fluent invoice input schema for student customer detail.
|
|
*/
|
|
public static function make(): static
|
|
{
|
|
return parent::make()
|
|
->cannotAddItems()
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('no_register')
|
|
->label(__('domains/billing/field.invoice.detail.no_register'))
|
|
->type(InputType::TEXTLINE)
|
|
->rules(['required', 'string'])
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('student_name')
|
|
->label(__('domains/billing/field.invoice.detail.student_name'))
|
|
->type(InputType::TEXTLINE)
|
|
->rules(['required', 'string'])
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('admission_track')
|
|
->label(__('domains/billing/field.invoice.detail.admission_track'))
|
|
->type(InputType::SELECT)
|
|
->rules(['required', 'string'])
|
|
->select2()
|
|
->withLabel()
|
|
->options(fn() => AdmissionTrackLookup::fetch())
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('academic_program')
|
|
->label(__('domains/billing/field.invoice.detail.academic_program'))
|
|
->type(InputType::SELECT)
|
|
->rules(['required', 'string'])
|
|
->select2()
|
|
->withLabel()
|
|
->options(fn() => AcademicProgramLookup::fetch())
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('faculty')
|
|
->label(__('domains/billing/field.invoice.detail.faculty'))
|
|
->type(InputType::SELECT)
|
|
->rules(['required', 'string'])
|
|
->select2()
|
|
->live()
|
|
->withLabel()
|
|
->options(fn () => FacultyLookup::fetch())
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('study_program')
|
|
->label(__('domains/billing/field.invoice.detail.study_program'))
|
|
->type(InputType::SELECT)
|
|
->rules(['required', 'string'])
|
|
->select2()
|
|
->live()
|
|
->dependsOn('faculty')
|
|
->setContextKeys(['faculty'])
|
|
->withLabel()
|
|
->options(fn ($context) => StudyProgramLookup::fetch($context))
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('class_year')
|
|
->label(__('domains/billing/field.invoice.detail.class_year'))
|
|
->type(InputType::TEXTLINE)
|
|
->rules(['required', 'string'])
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('term_entry')
|
|
->label(__('domains/billing/field.invoice.detail.term_entry'))
|
|
->type(InputType::SELECT)
|
|
->rules(['required'])
|
|
->select2()
|
|
->options(fn () => TermLookup::fetch())
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('semester')
|
|
->label(__('domains/billing/field.invoice.detail.semester'))
|
|
->type(InputType::SELECT)
|
|
->rules(['required'])
|
|
->select2()
|
|
->options(array_combine(range(1, 14), range(1, 14)))
|
|
)
|
|
->addInput(
|
|
InputSchema::make()
|
|
->key('fee_type')
|
|
->label(__('domains/billing/field.invoice.detail.fee_type'))
|
|
->type(InputType::SELECT)
|
|
->rules(['required'])
|
|
->select2()
|
|
->withLabel()
|
|
->options(fn() => FeeTypeLookup::fetch())
|
|
);
|
|
}
|
|
}
|
|
|