Rename contribution documents
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Philipp Lang 2023-09-07 12:04:13 +02:00
parent 38bd73cf5b
commit 639d1850c7
12 changed files with 48 additions and 48 deletions

View File

@ -3,9 +3,9 @@
namespace App\Contribution;
use App\Contribution\Documents\ContributionDocument;
use App\Contribution\Documents\DvDocument;
use App\Contribution\Documents\RemscheidDocument;
use App\Contribution\Documents\SolingenDocument;
use App\Contribution\Documents\RdpNrwDocument;
use App\Contribution\Documents\CityRemscheidDocument;
use App\Contribution\Documents\CitySolingenDocument;
use Illuminate\Support\Collection;
use Illuminate\Validation\Rule;
@ -15,9 +15,9 @@ class ContributionFactory
* @var array<int, class-string<ContributionDocument>>
*/
private array $documents = [
DvDocument::class,
SolingenDocument::class,
RemscheidDocument::class,
RdpNrwDocument::class,
CitySolingenDocument::class,
CityRemscheidDocument::class,
];
/**

View File

@ -10,7 +10,7 @@ use Illuminate\Support\Collection;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class RemscheidDocument extends ContributionDocument
class CityRemscheidDocument extends ContributionDocument
{
/**
* @param Collection<int, Collection<int, Member>> $leaders
@ -80,7 +80,7 @@ class RemscheidDocument extends ContributionDocument
public function view(): string
{
return 'tex.zuschuss-remscheid';
return 'tex.contribution.city-remscheid';
}
public function template(): Template

View File

@ -9,7 +9,7 @@ use Illuminate\Support\Str;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class SolingenDocument extends ContributionDocument
class CitySolingenDocument extends ContributionDocument
{
/**
* @param Collection<int, MemberData> $members
@ -80,24 +80,24 @@ class SolingenDocument extends ContributionDocument
$output = '';
$firstRow = collect(['B' => 'Jugendbildungsmaßnahme', 'G' => 'Gruppenleiter/innenschulung', 'FK' => 'Ferienkolonie', 'F' => 'Freizeitnaßnahme'])->map(function ($item, $key) {
return ($this->type === $key ? '\\checkedcheckbox' : '\\checkbox').'{'.$item.'}';
})->implode(' & ').' \\\\';
return ($this->type === $key ? '\\checkedcheckbox' : '\\checkbox') . '{' . $item . '}';
})->implode(' & ') . ' \\\\';
$secondRow = collect(['I' => 'Int. Jugendbegegnung', 'P' => 'politische Jugendbildung', 'PR' => 'Projekte'])->map(function ($item, $key) {
return ($this->type === $key ? '\\checkedcheckbox' : '\\checkbox').'{'.$item.'}';
})->implode(' & ').' & \\emptycheckbox \\\\';
return ($this->type === $key ? '\\checkedcheckbox' : '\\checkbox') . '{' . $item . '}';
})->implode(' & ') . ' & \\emptycheckbox \\\\';
return $firstRow."\n".$secondRow;
return $firstRow . "\n" . $secondRow;
}
public function basename(): string
{
return 'zuschuesse-solingen-'.Str::slug($this->eventName);
return 'zuschuesse-solingen-' . Str::slug($this->eventName);
}
public function view(): string
{
return 'tex.zuschuss-stadt';
return 'tex.contribution.city-solingen';
}
public function getEngine(): Engine

View File

@ -9,7 +9,7 @@ use Illuminate\Support\Collection;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class DvDocument extends ContributionDocument
class RdpNrwDocument extends ContributionDocument
{
/**
* @param Collection<int, Collection<int, MemberData>> $members
@ -28,8 +28,8 @@ class DvDocument extends ContributionDocument
public function dateRange(): string
{
return Carbon::parse($this->dateFrom)->format('d.m.Y')
.' - '
.Carbon::parse($this->dateUntil)->format('d.m.Y');
. ' - '
. Carbon::parse($this->dateUntil)->format('d.m.Y');
}
/**
@ -96,12 +96,12 @@ class DvDocument extends ContributionDocument
public function basename(): string
{
return 'zuschuesse-dv';
return 'zuschuesse-rdp-nrw';
}
public function view(): string
{
return 'tex.zuschuss-dv';
return 'tex.contribution.rdp-nrw';
}
public function template(): Template
@ -123,7 +123,7 @@ class DvDocument extends ContributionDocument
public static function getName(): string
{
return 'Für DV erstellen';
return 'Für RdP NRW erstellen';
}
/**

View File

@ -12,7 +12,7 @@
\begin{document}
@foreach($children as $chunk)
\backgroundsetup{scale = 1, angle = 0, opacity = 1, color=black, contents = {\includegraphics[width = \paperwidth, height = \paperheight] {tn.pdf}}}
\backgroundsetup{scale = 1, angle = 0, opacity = 1, color=black, contents = {\includegraphics[width = \paperwidth, height = \paperheight] {city-remscheid-children.pdf}}}
\noindent \sffamily
\begin{tikzpicture}[remember picture,overlay,yscale=-1]
\fill[white] (19mm,30mm) rectangle (80mm,36mm);
@ -31,7 +31,7 @@
@endforeach
@foreach($leaders as $chunk)
\backgroundsetup{scale = 1, angle = 0, opacity = 1, color=black, contents = {\includegraphics[width = \paperwidth, height = \paperheight] {leader.pdf}}}
\backgroundsetup{scale = 1, angle = 0, opacity = 1, color=black, contents = {\includegraphics[width = \paperwidth, height = \paperheight] {city-remscheid-leader.pdf}}}
\noindent \sffamily
\begin{tikzpicture}[remember picture,overlay,yscale=-1]
\fill[white] (17mm,27mm) rectangle (284mm,34mm);

View File

@ -8,7 +8,7 @@
\pagestyle{empty}
\setlength{\parindent}{0cm}
\backgroundsetup{scale = 1, angle = 0, opacity = 1, color=black, contents = {\includegraphics[width = \paperwidth, height = \paperheight] {teilnahmeliste.pdf}}}
\backgroundsetup{scale = 1, angle = 0, opacity = 1, color=black, contents = {\includegraphics[width = \paperwidth, height = \paperheight] {rdp-nrw.pdf}}}
\begin{document}
\noindent \sffamily

View File

@ -2,7 +2,7 @@
namespace Tests\Feature\Contribution;
use App\Contribution\Documents\DvDocument;
use App\Contribution\Documents\RdpNrwDocument;
use App\Country;
use App\Member\Member;
use Illuminate\Foundation\Testing\DatabaseTransactions;
@ -22,8 +22,8 @@ class IndexTest extends TestCase
$response = $this->get('/contribution');
$this->assertInertiaHas([
'class' => DvDocument::class,
'title' => 'Für DV erstellen',
'class' => RdpNrwDocument::class,
'title' => 'Für DV Köln erstellen',
], $response, 'compilers.0');
$this->assertInertiaHas([
'id' => $country->id,

View File

@ -3,8 +3,8 @@
namespace Tests\Feature\Contribution;
use App\Contribution\Documents\ContributionDocument;
use App\Contribution\Documents\DvDocument;
use App\Contribution\Documents\SolingenDocument;
use App\Contribution\Documents\RdpNrwDocument;
use App\Contribution\Documents\CitySolingenDocument;
use App\Country;
use App\Gender;
use App\Member\Member;
@ -22,9 +22,9 @@ class StoreTest extends TestCase
use DatabaseTransactions;
/**
* @testWith ["App\\Contribution\\Documents\\SolingenDocument", ["Super tolles Lager", "Max Muster", "Jane Muster", "15.06.1991"]]
* ["App\\Contribution\\Documents\\DvDocument", ["Muster, Max", "Muster, Jane", "15.06.1991", "42777 SG"]]
* ["App\\Contribution\\Documents\\RemscheidDocument", ["Max", "Muster", "Jane"]]
* @testWith ["App\\Contribution\\Documents\\CitySolingenDocument", ["Super tolles Lager", "Max Muster", "Jane Muster", "15.06.1991"]]
* ["App\\Contribution\\Documents\\RdpNrwDocument", ["Muster, Max", "Muster, Jane", "15.06.1991", "42777 SG"]]
* ["App\\Contribution\\Documents\\CityRemscheidDocument", ["Max", "Muster", "Jane"]]
*
* @param array<int, string> $bodyChecks
*/
@ -70,7 +70,7 @@ class StoreTest extends TestCase
'dateFrom' => '1991-06-15',
'dateUntil' => '1991-06-16',
'eventName' => 'Super tolles Lager',
'type' => SolingenDocument::class,
'type' => CitySolingenDocument::class,
'zipLocation' => '42777 SG',
'member_data' => [
ContributionMemberApiRequestFactory::new()->create(),
@ -80,7 +80,7 @@ class StoreTest extends TestCase
$response->assertSessionDoesntHaveErrors();
$response->assertOk();
Tex::assertCompiled(SolingenDocument::class, fn ($document) => $document->hasAllContent(['Super']));
Tex::assertCompiled(CitySolingenDocument::class, fn ($document) => $document->hasAllContent(['Super']));
}
/**
@ -130,67 +130,67 @@ class StoreTest extends TestCase
{
yield [
['type' => 'aaa'],
SolingenDocument::class,
CitySolingenDocument::class,
'type',
];
yield [
['type' => ''],
SolingenDocument::class,
CitySolingenDocument::class,
'type',
];
yield [
['dateFrom' => ''],
SolingenDocument::class,
CitySolingenDocument::class,
'dateFrom',
];
yield [
['dateFrom' => '2022-01'],
SolingenDocument::class,
CitySolingenDocument::class,
'dateFrom',
];
yield [
['dateUntil' => ''],
SolingenDocument::class,
CitySolingenDocument::class,
'dateUntil',
];
yield [
['dateUntil' => '2022-01'],
SolingenDocument::class,
CitySolingenDocument::class,
'dateUntil',
];
yield [
['country' => -1],
DvDocument::class,
RdpNrwDocument::class,
'country',
];
yield [
['country' => 'AAAA'],
DvDocument::class,
RdpNrwDocument::class,
'country',
];
yield [
['members' => 'A'],
DvDocument::class,
RdpNrwDocument::class,
'members',
];
yield [
['members' => [99999]],
DvDocument::class,
RdpNrwDocument::class,
'members.0',
];
yield [
['members' => ['lalala']],
DvDocument::class,
RdpNrwDocument::class,
'members.0',
];
yield [
['eventName' => ''],
SolingenDocument::class,
CitySolingenDocument::class,
'eventName',
];
yield [
['zipLocation' => ''],
SolingenDocument::class,
CitySolingenDocument::class,
'zipLocation',
];
}