Fix member id
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
f5a57a9d16
commit
8b76f59804
|
|
@ -43,7 +43,7 @@ class MassStoreAction
|
|||
|
||||
$invoice = Invoice::createFromFactory($factory);
|
||||
$invoice->save();
|
||||
$invoice->positions()->createMany($invoice->positions->toArray());
|
||||
$invoice->positions()->createMany($invoice->positions);
|
||||
$invoices->push($invoice->fresh('positions'));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class MemberNewInvoiceAction
|
|||
return [
|
||||
...$invoice->getAttributes(),
|
||||
'to' => $invoice->to,
|
||||
'positions' => $invoice->getRelationValue('positions')->toArray(),
|
||||
'positions' => $invoice->getRelationValue('positions'),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Invoice\Data;
|
||||
|
||||
use Spatie\LaravelData\Attributes\MapOutputName;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class PositionData extends Data
|
||||
|
|
@ -9,6 +10,7 @@ class PositionData extends Data
|
|||
public function __construct(
|
||||
public string $description,
|
||||
public string $price,
|
||||
#[MapOutputName('member_id')]
|
||||
public int $memberId,
|
||||
) {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,8 +81,7 @@ class MemberInvoiceFactory implements InvoiceCreator
|
|||
$positions->push(PositionData::from([
|
||||
'description' => str($child->name)->replace('{name}', $member->firstname . ' ' . $member->lastname)->replace('{year}', (string) $this->year),
|
||||
'price' => $child->amount,
|
||||
/** @todo check if this is correct */
|
||||
'member_id' => $member->id,
|
||||
'memberId' => $member->id,
|
||||
'id' => null,
|
||||
]));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue