mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop
# Conflicts: # app/Api/V1/Controllers/Models/Bill/ShowController.php # app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php # app/Transformers/BillTransformer.php
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\JsonApi\Enrichments;
|
||||
|
||||
use Carbon\Carbon;
|
||||
@@ -96,13 +98,14 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
||||
}
|
||||
$item->amounts = $amounts;
|
||||
$item->meta = $meta;
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
return $collection;
|
||||
}
|
||||
|
||||
public function enrichSingle(Model|array $model): array|Model
|
||||
public function enrichSingle(array|Model $model): array|Model
|
||||
{
|
||||
Log::debug(__METHOD__);
|
||||
$collection = new Collection([$model]);
|
||||
@@ -160,7 +163,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
||||
->where('object_groupable_type', Bill::class)
|
||||
->get(['object_groupable_id', 'object_group_id']);
|
||||
|
||||
$ids = array_unique($set->pluck('object_group_id')->toArray());
|
||||
$ids = array_unique($set->pluck('object_group_id')->toArray());
|
||||
|
||||
foreach ($set as $entry) {
|
||||
$this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id;
|
||||
|
@@ -51,6 +51,7 @@ class BillTransformer extends AbstractTransformer
|
||||
{
|
||||
$currency = $bill->transactionCurrency;
|
||||
|
||||
|
||||
return [
|
||||
'id' => $bill->id,
|
||||
'created_at' => $bill->created_at->toAtomString(),
|
||||
@@ -81,6 +82,7 @@ class BillTransformer extends AbstractTransformer
|
||||
'object_group_order' => $bill->meta['object_group_order'],
|
||||
'object_group_title' => $bill->meta['object_group_title'],
|
||||
|
||||
|
||||
'paid_dates' => $bill->meta['paid_dates'],
|
||||
'pay_dates' => $bill->meta['pay_dates'],
|
||||
'next_expected_match' => $bill->meta['nem']?->toAtomString(),
|
||||
|
Reference in New Issue
Block a user