Compare commits
2 Commits
290d5e6cce
...
766a1a8c2e
| Author | SHA1 | Date |
|---|---|---|
|
|
766a1a8c2e | |
|
|
552cd34b13 |
|
|
@ -15,7 +15,15 @@ class ReceiverData extends Data
|
|||
public string $greeting,
|
||||
) {}
|
||||
|
||||
public static function default(): self {
|
||||
// return new self('', '', '', '', null, '');
|
||||
public static function default(): self
|
||||
{
|
||||
return new self(
|
||||
name: '',
|
||||
address: '',
|
||||
zip: '',
|
||||
location: '',
|
||||
email: null,
|
||||
greeting: ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class Invoice extends Model
|
|||
public function toSearchableArray(): array
|
||||
{
|
||||
return [
|
||||
'to' => implode(', ', $this->to),
|
||||
'to' => implode(', ', $this->getRecipient()->toArray()),
|
||||
'usage' => $this->usage,
|
||||
'status' => $this->status->value,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ it('testItDisplaysInvoices', function () {
|
|||
$invoice = Invoice::factory()
|
||||
->has(InvoicePosition::factory()->price(1100)->for($member)->state(['description' => 'lala']), 'positions')
|
||||
->has(InvoicePosition::factory()->price(2200)->withMember(), 'positions')
|
||||
->to(ReceiverRequestFactory::new()->name('Familie Blabla'))
|
||||
->to(ReceiverRequestFactory::new()->name('Familie Blabla')->email('a@b.de')->greeting('Liebe Fam'))
|
||||
->sentAt(now()->subDay())
|
||||
->via(BillKind::POST)
|
||||
->status(InvoiceStatus::SENT)
|
||||
|
|
@ -36,9 +36,9 @@ it('testItDisplaysInvoices', function () {
|
|||
->assertInertiaPath('data.data.0.sent_at_human', now()->subDay()->format('d.m.Y'))
|
||||
->assertInertiaPath('data.data.0.status', 'Rechnung gestellt')
|
||||
->assertInertiaPath('data.data.0.via', 'Post')
|
||||
->assertInertiaPath('data.data.0.mail_email', 'a@b.de')
|
||||
->assertInertiaPath('data.data.0.to.email', 'a@b.de')
|
||||
->assertInertiaPath('data.data.0.usage', 'Usa')
|
||||
->assertInertiaPath('data.data.0.greeting', $invoice->greeting)
|
||||
->assertInertiaPath('data.data.0.to.greeting', 'Liebe Fam')
|
||||
->assertInertiaPath('data.data.0.positions.0.price', 1100)
|
||||
->assertInertiaPath('data.data.0.positions.0.member_id', $member->id)
|
||||
->assertInertiaPath('data.data.0.positions.0.description', 'lala')
|
||||
|
|
@ -62,13 +62,13 @@ it('testItDisplaysInvoices', function () {
|
|||
'address' => '',
|
||||
'zip' => '',
|
||||
'location' => '',
|
||||
'email' => null,
|
||||
'greeting' => '',
|
||||
],
|
||||
'positions' => [],
|
||||
'greeting' => '',
|
||||
'status' => InvoiceStatus::NEW->value,
|
||||
'via' => null,
|
||||
'usage' => '',
|
||||
'mail_email' => '',
|
||||
])
|
||||
->assertInertiaPath('data.meta.default_position', [
|
||||
'id' => null,
|
||||
|
|
|
|||
Loading…
Reference in New Issue