Add source to invoice criteria. Modify invoice rules to get service fees from... #1701

Merged
arcticzero merged 217 commits from 746-resq-2-0-final into master 2023-11-22 08:54:48 +00:00
Showing only changes of commit 059bda9bf6 - Show all commits

View file

@ -13,15 +13,19 @@ class MotoliteEventController extends ApiController
public function getEvents(Request $req) public function getEvents(Request $req)
{ {
// validate params // validate params
$validity = $this->validateRequest($req); $validity = $this->validateRequest($req, [
'limit',
]);
if (!$validity['is_valid']) { if (!$validity['is_valid']) {
return new ApiResponse(false, $validity['error']); return new ApiResponse(false, $validity['error']);
} }
$limit = $req->query->get('limit');
// get all events // get all events
$results = $this->em->getRepository(MotoliteEvent::class) $results = $this->em->getRepository(MotoliteEvent::class)
->findBy([], ['event_time' => 'asc']); ->findBy([], ['event_time' => 'asc'], $limit);
if (empty($results)) { if (empty($results)) {
return new ApiResponse(false, 'No events available.'); return new ApiResponse(false, 'No events available.');