Expand API to return transaction groups.

This commit is contained in:
James Cole
2023-08-08 15:03:58 +02:00
parent 7a2d4c9bd2
commit 02c906afe6
12 changed files with 412 additions and 107 deletions

View File

@@ -675,6 +675,23 @@ trait TimeCollection
return $this;
}
/**
* Set the end time of the results to return.
*
* @param Carbon $end
*
* @return GroupCollectorInterface
*/
public function setEnd(Carbon $end): GroupCollectorInterface
{
// always got to end of day / start of day for ranges.
$endStr = $end->format('Y-m-d 23:59:59');
$this->query->where('transaction_journals.date', '<=', $endStr);
return $this;
}
/**
* @param Carbon $date
* @param string $field
@@ -822,6 +839,22 @@ trait TimeCollection
return $this;
}
/**
* Set the start time of the results to return.
*
* @param Carbon $start
*
* @return GroupCollectorInterface
*/
public function setStart(Carbon $start): GroupCollectorInterface
{
$startStr = $start->format('Y-m-d 00:00:00');
$this->query->where('transaction_journals.date', '>=', $startStr);
return $this;
}
/**
* Collect transactions updated on a specific date.
*