Skip to content

Commit

Permalink
DON-998 - rename limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorota Hawro committed Jan 3, 2025
1 parent 06be75c commit f8f1ad7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Domain/DoctrineDonationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public function findAllCompleteForCustomer(StripeCustomerId $stripeCustomerId):
/**
* We only set Payment Intent on the day of the payment due to stripe limitations, see
*/
public function findDonationsToSetPaymentIntent(\DateTimeImmutable $atDateTime, int $limit): array
public function findDonationsToSetPaymentIntent(\DateTimeImmutable $atDateTime, int $maxBatchSize): array
{
$preAuthorized = DonationStatus::PreAuthorized->value;
$active = MandateStatus::Active->value;
Expand All @@ -753,12 +753,14 @@ public function findDonationsToSetPaymentIntent(\DateTimeImmutable $atDateTime,
$query = $this->getEntityManager()->createQuery(<<<DQL
SELECT donation from Matchbot\Domain\Donation donation JOIN donation.mandate mandate
WHERE donation.donationStatus = '$preAuthorized'
AND donation.transactionId = null
AND donation.preAuthorizationDate <= $atDateTime
AND mandate.status = '$active'
AND mandate.dayOfMonth.value = '$dayOfMonthToday'
DQL
);

$query->setMaxResults($limit);
$query->setMaxResults($maxBatchSize);

/** @var list<Donation> $result */
$result = $query->getResult();
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/DonationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function findAllCompleteForCustomer(StripeCustomerId $stripeCustomerId):
/**
* @return list<Donation>
*/
public function findDonationsToSetPaymentIntent(\DateTimeImmutable $atDateTime, int $limit): array;
public function findDonationsToSetPaymentIntent(\DateTimeImmutable $atDateTime, int $maxBatchSize): array;

/**
* @return list<Donation>
Expand Down
2 changes: 1 addition & 1 deletion tests/Domain/InMemoryDonationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function totalMatchFundsReleased(): string
throw new \Exception("Method not implemented in test double");
}

#[\Override] public function findDonationsToSetPaymentIntent(\DateTimeImmutable $atDateTime, int $limit): array
#[\Override] public function findDonationsToSetPaymentIntent(\DateTimeImmutable $atDateTime, int $maxBatchSize): array
{
throw new \Exception("Method not implemented in test double");
}
Expand Down

0 comments on commit f8f1ad7

Please sign in to comment.