feat: assignments with disabled formalities
addresses #869dnvm8c
This commit is contained in:
@@ -194,6 +194,61 @@ class DispositionRepositoryTest extends KernelTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A skip-formalities placement is still `confirmed` when this query runs: CronCommand sends
|
||||
* the invoice reminders before DispositionStatusService promotes it to `completed`, so the
|
||||
* status filter alone would let it through on the day after the assignment ends. The flag
|
||||
* has to be part of the DQL.
|
||||
*/
|
||||
public function testInvoiceReminderSkipsSkipFormalitiesAssignments(): void
|
||||
{
|
||||
$query = $this->invoiceQuery();
|
||||
|
||||
$this->assertStringContainsString(
|
||||
'assignment.skipFormalities = :skipFormalities',
|
||||
$query->getDQL()
|
||||
);
|
||||
$this->assertFalse($query->getParameter('skipFormalities')->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Feeds the house-manager list, both dashboards' "Überfällige Feedbacks" tiles and the
|
||||
* reminder mail, so one condition here covers every surface that chases a feedback.
|
||||
*/
|
||||
public function testPendingFeedbackSkipsSkipFormalitiesAssignments(): void
|
||||
{
|
||||
$query = $this->repository()->getDispositionsWithPendingFeedbackQuery();
|
||||
|
||||
$this->assertStringContainsString(
|
||||
'assignment.skipFormalities = :skipFormalities',
|
||||
$query->getDQL()
|
||||
);
|
||||
$this->assertFalse($query->getParameter('skipFormalities')->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Otherwise placements nobody is expected to rate would be counted as missingFeedbacks and
|
||||
* drag every hotel's percentage down.
|
||||
*/
|
||||
public function testFeedbackStatisticsDoNotCountSkipFormalitiesPlacementsAsMissing(): void
|
||||
{
|
||||
// the by-hotel and normalized-code variants back two different statistics screens and are
|
||||
// maintained as a pair, so both are pinned - dropping the condition from one only would
|
||||
// make the two disagree about the same hotel
|
||||
$queries = [
|
||||
$this->repository()->getFeedbackStatisticsByHotelQuery(),
|
||||
$this->repository()->getFeedbackStatisticsByNormalizedHotelCodeQuery(),
|
||||
];
|
||||
|
||||
foreach ($queries as $query) {
|
||||
$this->assertStringContainsString(
|
||||
'assignment.skipFormalities = :skipFormalities',
|
||||
$query->getDQL()
|
||||
);
|
||||
$this->assertFalse($query->getParameter('skipFormalities')->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
private function contractQuery(int $deadlineDays = 5): Query
|
||||
{
|
||||
return $this->repository()->getContractReminderQuery($deadlineDays);
|
||||
|
||||
Reference in New Issue
Block a user