Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/config/packages/http_cache.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
app.httpCache.matchPath: '^/?($|index.jsonhal$|content_types|camps/[0-9a-f]*/categories)'
app.httpCache.matchPath: '^/?($|index.jsonhal$|content_types|camps/[0-9a-f]*/categories|periods/[0-9a-f]*/schedule_entries|camps/[0-9a-f]*/activities)'

fos_http_cache:
debug:
Expand Down
8 changes: 0 additions & 8 deletions api/migrations/dev-data/Version202504121559.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ public function getDescription(): string {

public function up(Schema $schema): void {
// START PHP CODE
$this->addSql(createTruncateDatabaseCommand());

$statements = getStatementsForMigrationFile();
foreach ($statements as $statement) {
if (trim($statement)) {
$this->addSql($statement);
}
}
// END PHP CODE
}

Expand Down
31 changes: 31 additions & 0 deletions api/migrations/dev-data/Version202504130046.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DataMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

require_once __DIR__.'/helpers.php';

final class Version202504130046 extends AbstractMigration {
public function getDescription(): string {
return 'Add 2nd period to Harry Potter camp';
}

public function up(Schema $schema): void {
// START PHP CODE
$this->addSql(createTruncateDatabaseCommand());

$statements = getStatementsForMigrationFile();
foreach ($statements as $statement) {
if (trim($statement)) {
$this->addSql($statement);
}
}
// END PHP CODE
}

public function down(Schema $schema): void {}
}
7 changes: 5 additions & 2 deletions api/migrations/dev-data/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,8 @@ INSERT INTO public.period (id, description, start, "end", createtime, updatetime
('c085d1d5ddfa', 'Die Jedi-Akademie', '2026-07-14', '2026-07-16', '2023-08-13 06:32:29', '2023-08-13 06:32:29', '0969e3c95dfc'),
('7fa4564a5d5d', 'Main', '2031-01-24', '2031-01-30', '2023-09-29 23:24:38', '2023-09-29 23:24:38', '70ca971c992f'),
('88f1f55a69d7', 'Hauptlager', '2025-07-13', '2025-07-20', '2023-08-08 09:22:58', '2023-08-08 09:48:01', '5d28f99890bc'),
('05938f2a5372', 'Hauptlager', '2022-01-02', '2022-01-02', '2024-09-28 21:19:13', '2024-09-28 21:22:24', '25a82475e0b7');
('05938f2a5372', 'Hauptlager', '2022-01-02', '2022-01-02', '2024-09-28 21:19:13', '2024-09-28 21:22:24', '25a82475e0b7'),
('c550b8707c26', 'Nachweekend', '2025-08-09', '2025-08-10', '2025-04-12 22:30:55', '2025-04-12 22:30:55', '6973c230d6b1');



Expand Down Expand Up @@ -2020,7 +2021,9 @@ INSERT INTO public.day (id, dayoffset, createtime, updatetime, periodid) VALUES
('273358ce9d70', 5, '2023-08-08 09:22:58', '2023-08-08 09:22:58', '88f1f55a69d7'),
('40e3a286dc08', 6, '2023-08-08 09:22:58', '2023-08-08 09:22:58', '88f1f55a69d7'),
('485e190f4852', 7, '2023-08-08 09:22:58', '2023-08-08 09:22:58', '88f1f55a69d7'),
('fb406d22f8b9', 0, '2024-09-28 21:19:13', '2024-09-28 21:19:13', '05938f2a5372');
('fb406d22f8b9', 0, '2024-09-28 21:19:13', '2024-09-28 21:19:13', '05938f2a5372'),
('be09cc00bfb5', 0, '2025-04-12 22:30:55', '2025-04-12 22:30:55', 'c550b8707c26'),
('ee1a47697fd0', 1, '2025-04-12 22:30:55', '2025-04-12 22:30:55', 'c550b8707c26');



Expand Down
7 changes: 7 additions & 0 deletions api/src/HttpCache/TagCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use ApiPlatform\Metadata\Operation;
use ApiPlatform\Serializer\TagCollectorInterface;
use App\Entity\HasId;
use App\Entity\ScheduleEntry;

/**
* Collects cache tags during normalization.
Expand Down Expand Up @@ -48,6 +49,12 @@ public function collect(array $context = []): void {
}

$this->addCacheTagForResource($iri);

// add resource specific tags
if ($object instanceof ScheduleEntry) {
// various content of ScheduleEntry such as Start, DayNumber, ScheduleNumber is calculated from period properties
$this->addCacheTagForResource($object->getPeriod()->getId());
}
}

private function addCacheTagForResource(string $iri): void {
Expand Down
8 changes: 1 addition & 7 deletions api/tests/State/PeriodPersistProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
use App\Entity\Period;
use App\Entity\ScheduleEntry;
use App\State\PeriodPersistProcessor;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -23,8 +21,6 @@ class PeriodPersistProcessorTest extends TestCase {
private ScheduleEntry $scheduleEntry;
private DayResponsible $dayResponsible;

private EntityManagerInterface|MockObject $em;

private PeriodPersistProcessor $processor;

/**
Expand Down Expand Up @@ -53,11 +49,9 @@ protected function setUp(): void {
$day2->addDayResponsible($this->dayResponsible);

$decoratedProcessor = $this->createMock(ProcessorInterface::class);
$this->em = $this->createMock(EntityManagerInterface::class);

$this->processor = new PeriodPersistProcessor(
$decoratedProcessor,
$this->em
$decoratedProcessor
);
}

Expand Down
7 changes: 7 additions & 0 deletions e2e/specs/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ export const cachedEndpoint = Cypress.env('API_ROOT_URL_CACHED')

export const grgrCampId = '3c79b99ab424'
export const loremIpsumCampId = '9c2447aefe38'
export const skilagerCampId = '70ca971c992f'

export const skilagerPeriodId = '7fa4564a5d5d'
export const grgrPeriodId = '76be24bce434'

export const harryMainPeriodId = 'fe47dfd2b541'
export const harrySecondPeriodId = 'c550b8707c26'

export const bipiUser = '[email protected]'
export const castorUser = '[email protected]'
Expand Down
Loading