| 1 |
<?php |
| 2 |
|
| 3 |
namespace App\Billingo\Models\Document; |
| 4 |
|
| 5 |
use App\Billingo\Contracts\ValidableInterface; |
| 6 |
use App\Billingo\Models\BillingoModel; |
| 7 |
use App\Billingo\Models\Discount; |
| 8 |
use App\Billingo\Models\Document\DocumentPartner as DocumentPartner; |
| 9 |
use App\Billingo\Models\Partner\Partner; |
| 10 |
use App\Billingo\Traits\WithFactory; |
| 11 |
use App\Billingo\Validation\Document\DocumentValidator; |
| 12 |
|
| 13 |
/** |
| 14 |
* * @property int $id |
| 15 |
* * @property string $invoice_number |
| 16 |
* * @property string $type |
| 17 |
* * @property string $correction_type |
| 18 |
* * @property bool $cancelled |
| 19 |
* * @property int $block_id |
| 20 |
* * @property string $payment_status |
| 21 |
* * @property string $payment_method |
| 22 |
* * @property float $gross_total |
| 23 |
* * @property string $currency |
| 24 |
* * @property float $conversion_rate |
| 25 |
* * @property string $invoice_date |
| 26 |
* * @property string $fulfillment_date |
| 27 |
* * @property string $due_date |
| 28 |
* * @property string|null $paid_date |
| 29 |
* * @property Organization $organization |
| 30 |
* * @property Partner $partner |
| 31 |
* * @property DocumentPartner $document_partner |
| 32 |
* * @property bool $electronic |
| 33 |
* * @property string $comment |
| 34 |
* * @property array $tags |
| 35 |
* * @property string $notification_status |
| 36 |
* * @property string $language |
| 37 |
* * @property array $items |
| 38 |
* * @property array $settings |
| 39 |
* * @property string $online_szamla_status |
| 40 |
* * @property float|null $discount |
| 41 |
* * @property int|null $recurring_id |
| 42 |
* * @property DocumentSummary $summary |
| 43 |
* * @property array $related_documents |
| 44 |
*/ |
| 45 |
class Document extends BillingoModel |
| 46 |
{ |
| 47 |
|
| 48 |
use WithFactory; |
| 49 |
|
| 50 |
protected array $cast = [ |
| 51 |
'organization' => Organization::class, |
| 52 |
'partner' => Partner::class, |
| 53 |
'document_partner' => DocumentPartner::class, |
| 54 |
'items' => [DocumentItem::class], |
| 55 |
'summary' => DocumentSummary::class, |
| 56 |
'settings' => DocumentSettings::class, |
| 57 |
'related_documents' => [DocumentAncestor::class], |
| 58 |
'discount' => Discount::class, |
| 59 |
]; |
| 60 |
|
| 61 |
protected function getValidator(): ValidableInterface |
| 62 |
{ |
| 63 |
return new DocumentValidator(); |
| 64 |
} |
| 65 |
} |
| 66 |
|