Compare commits

..

No commits in common. "master" and "laravel10" have entirely different histories.

129 changed files with 4025 additions and 4712 deletions
.docker
.drone.yml.gitignoreCHANGELOG.mdEnvoy.blade.phpREADME.md
app
bin
composer.jsoncomposer.lock
config
database
docker-compose.prod.ymlpackage-lock.json
packages
phpstan.neonphpunit.xml
resources
img/svg
js

View File

@ -1,12 +1,11 @@
FROM php:8.3.11-fpm AS php
FROM php:8.3.11-fpm as php
WORKDIR /app
RUN ls /app
RUN apt-get update
RUN apt-get install -y rsync libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev unzip poppler-utils libpng-dev libjpeg-dev default-mysql-client libzip-dev imagemagick libmagickwand-dev
RUN apt-get install -y rsync libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev unzip poppler-utils libpng-dev libjpeg-dev default-mysql-client libzip-dev
RUN apt-get install -y --no-install-recommends texlive-base texlive-latex-base texlive-pictures texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils
RUN docker-php-ext-install pdo_mysql curl exif intl mbstring pcntl zip
RUN pecl install redis && docker-php-ext-enable redis
RUN pecl install imagick && docker-php-ext-enable imagick
RUN docker-php-ext-configure gd --with-jpeg
RUN docker-php-ext-install gd
RUN usermod -s /bin/bash www-data

View File

@ -1,6 +0,0 @@
#!/bin/bash
docker buildx build -f .docker/base.Dockerfile .
docker image tag sha256:... zoomyboy/adrema-base
docker push zoomyboy/adrema-base

View File

@ -1,17 +1,16 @@
FROM composer:2.7.9 AS composer
FROM composer:2.2.7 as composer
WORKDIR /app
COPY . /app
RUN composer install --ignore-platform-reqs --no-dev
RUN php artisan telescope:publish
RUN php artisan horizon:publish
FROM node:20.15.0-slim AS node
FROM node:20.15.0-slim as node
WORKDIR /app
COPY . /app
RUN cd packages/adrema-form && npm ci && npm run build && rm -R node_modules && cd ../../
RUN npm ci && npm run prod && npm run img && rm -R node_modules
RUN npm install && npm run prod && npm run img && rm -R node_modules
FROM nginx:1.21.6-alpine AS nginx
FROM nginx:1.21.6-alpine as nginx
WORKDIR /app
COPY --from=node /app /app
COPY --from=composer /app/public/vendor /app/public/vendor

View File

@ -1,15 +1,14 @@
FROM composer:2.7.9 AS composer
FROM composer:2.2.7 as composer
WORKDIR /app
COPY . /app
RUN composer install --ignore-platform-reqs --no-dev
FROM node:20.15.0-slim AS node
FROM node:20.15.0-slim as node
WORKDIR /app
COPY . /app
RUN cd packages/adrema-form && npm ci && npm run build && rm -R node_modules && cd ../../
RUN npm ci && npm run prod && npm run img && rm -R node_modules
RUN npm install && npm run prod && npm run img && rm -R node_modules
FROM zoomyboy/adrema-base:latest AS php
FROM zoomyboy/adrema-base:latest as php
COPY --chown=www-data:www-data . /app
COPY --chown=www-data:www-data --from=node /app/public /app/public
COPY --chown=www-data:www-data --from=composer /app/vendor /app/vendor

View File

@ -103,7 +103,7 @@ steps:
event: tag
- name: deploy
image: zoomyboy/adrema-base:latest
image: php:8.1.6
environment:
SSH_KEY:
from_secret: deploy_private_key

1
.gitignore vendored
View File

@ -40,4 +40,3 @@ Homestead.json
/public/sprite.svg
/.php-cs-fixer.cache
/groups.sql
/.phpunit.cache

View File

@ -1,46 +1,5 @@
# Letzte Änderungen
### 1.12.7
- Fix: Synchronisation von allen Mitgliedern bei Mail-Verteilern - nicht nur den ersten 20
### 1.12.6
- Fix: Beiträge von Familienmitgliedern splitten
### 1.12.5
- Fix: Synchronisieren von bestehenden Beiträgen aus NaMi
### 1.12.4
- Filter Mitglieder nach Verhaltenskodex
### 1.12.3
- Volltextsuche für Rechnungen
### 1.12.2
- Zuschussliste Gallier
### 1.12.1
- In Teilnehmer-Liste von Veranstaltungen kann nun sortiert und gefiltert werden.
- Formulare: Feld Registrierung von / bis
### 1.11.5
- Fix: Synchronisation von NaMi-Mitgliedern
### 1.11.4
- Fix: Nicht an Präventions-Unterlagen für vergangene Veranstaltungen erinnern
### 1.11.1
- Es kann nun auch das Feld "Datenweiterverwendung" über Adrema gepflegt werden.
### 1.10.20
- Fixed: Bei Textfeldern wird nun die Einleitung dargestellt

View File

@ -1,4 +1,4 @@
@servers(['docker' => ['stamm-silva@zoomyboy.de', 'stammgallier@stamm-gallier.de', 'dpsg-lennep@zoomyboy.de', 'dpsgbergischland@zoomyboy.de', 'dpsg-koeln@dpsg-koeln.de']])
@servers(['docker' => ['stammsilva@zoomyboy.de', 'stammgallier@stamm-gallier.de', 'dpsg-lennep@zoomyboy.de', 'dpsgbergischland@zoomyboy.de', 'dpsg-koeln@dpsg-koeln.de']])
@task('deploy', ['on' => 'docker'])
cd $ADREMA_PATH

View File

@ -32,16 +32,16 @@ Außerdem ist AdReMa auch problemlos auf Handys und Tablets bedienbar ("mobiles
## Installation des Produktivsystems
1. Verschieben der Docker-Compose
1. Herunterladen der Beispiel Docker-Compose
```cmd
mv docker-compose.prod.yml docker-compose.yml
curl https://git.zoomyboy.de/silva/adrema/raw/branch/master/docker-compose.prod.yml -o docker-compose.yml
```
2. Anwenden der Beispiel Environmentvariablen-Datei
2. Herunterladen der Beispiel Environmentvariablen-Datei
```cmd
mv .app.env.example .app.env
curl https://git.zoomyboy.de/silva/adrema/raw/branch/master/.app.env.example -o .app.env
```
3. In der `.app.env` notwendige Einstellungen vornehmen:
@ -50,8 +50,7 @@ Außerdem ist AdReMa auch problemlos auf Handys und Tablets bedienbar ("mobiles
- Mail-Server Einstellungen `MAIL_PORT`, `MAIL_HOST`, `MAIL_USERNAME`, `MAIL_PASSWORD` und `MAIL_ENCRYPTION` anpassen
- `MAIL_FROM_NAME`: Der Name, der als Absender von E-Mails gesetzt wird (z.B. `Stamm Bipi Service`)
- `MAIL_FROM_ADDRESS`: Die dazu gehörige E-Mail-Adresse, die natürlich für antworten erreichbar sein sollte (z.B. `vorstand@stamm-bipi.de`)
- `DB_PASSWORD` und `MYSQL_PASSWORD`: Mit dem selben neu erstellten, sicheren Passwort für die Datenbank versehen
- `MEILI_MASTER_KEY` Mit einem neu erstellten, sicheren Passwort versehen
- `DB_PASSWORD` und `MYSQL_PASSWORD`: Mit dem selben sicheren Passwort für die Datenbank versehen
- `USER_EMAIL` und `USER_PASSWORD`: Einstellen des standard Adrema Logins
4. Container zur Gennerierung des App-Key starten
@ -100,22 +99,28 @@ Bei dem Setup wird im Daten-Verzeichniss ein Ordner `./data/setup` angelegt. Hie
git clone https://git.zoomyboy.de/silva/adrema.git
```
2. Kopieren der Beispiel Environmentvariablen-Datei
2. Kopieren der Beispiel Docker-Compose für das Entwickeln und nach Wünschen anpassen
```cmd
cp docker-compose.dev.yml docker-compose.yml
```
3. Kopieren der Beispiel Environmentvariablen-Datei
```cmd
cp .app.env.example .app.env
```
3. Submodule aktuallisieren
4. Submodule aktuallisieren
```cmd
git submodule update --init
```
4. Container erstellen
5. Container erstellen
```cmd
docker compose build
```
5. Mit Schritt 3 und den folgenden der [Installation des Produktivsystems](#installation-des-produktivsystems) fortfahren
6. Mit Schritt 3 und den folgenden der [Installation des Produktivsystems](#installation-des-produktivsystems) fortfahren

View File

@ -22,7 +22,7 @@ class InsertMemberAction
{
$region = Region::firstWhere('nami_id', $member->regionId ?: -1);
$payload = [
return Member::updateOrCreate(['nami_id' => $member->id], [
'firstname' => $member->firstname,
'lastname' => $member->lastname,
'joined_at' => $member->joinedAt,
@ -50,27 +50,7 @@ class InsertMemberAction
'nationality_id' => Nationality::where('nami_id', $member->nationalityId)->firstOrFail()->id,
'mitgliedsnr' => $member->memberId,
'version' => $member->version,
'keepdata' => $member->keepdata,
];
// Dont update subscription if fee id of existing member's subscription is already the same
if ($existing = Member::nami($member->id)) {
if ($existing->subscription && $existing->subscription->fee->nami_id === $member->feeId) {
$payload['subscription_id'] = $existing->subscription->id;
}
}
return tap(Member::updateOrCreate(['nami_id' => $member->id], $payload), function ($insertedMember) use ($member) {
$insertedMember->bankAccount->update([
'iban' => $member->bankAccount->iban,
'bic' => $member->bankAccount->bic,
'blz' => $member->bankAccount->blz,
'account_number' => $member->bankAccount->accountNumber,
'person' => $member->bankAccount->person,
'bank_name' => $member->bankAccount->bankName,
'nami_id' => $member->bankAccount->id,
]);
});
]);
}
public function getSubscription(NamiMember $member): ?Subscription

View File

@ -34,7 +34,7 @@ class Activity extends Model
}
/**
* @return BelongsToMany<Subactivity, $this>
* @return BelongsToMany<Subactivity>
*/
public function subactivities(): BelongsToMany
{

View File

@ -8,7 +8,6 @@ use App\Contribution\Documents\RdpNrwDocument;
use App\Contribution\Documents\CityRemscheidDocument;
use App\Contribution\Documents\CitySolingenDocument;
use App\Contribution\Documents\CityFrankfurtMainDocument;
use App\Contribution\Documents\WuppertalDocument;
use Illuminate\Support\Collection;
use Illuminate\Validation\Rule;
@ -23,7 +22,6 @@ class ContributionFactory
CityRemscheidDocument::class,
CityFrankfurtMainDocument::class,
BdkjHesse::class,
WuppertalDocument::class,
];
/**
@ -32,7 +30,7 @@ class ContributionFactory
public function compilerSelect(): Collection
{
return collect($this->documents)->map(fn ($document) => [
'title' => $document::buttonName(),
'title' => $document::getName(),
'class' => $document,
]);
}

View File

@ -72,23 +72,13 @@ class MemberData extends Data
return $this->zip . ' ' . $this->location;
}
public function age(): int
public function age(): string
{
return intval($this->birthday->diffInYears(now()));
return (string) $this->birthday->diffInYears(now()) ?: '';
}
public function birthYear(): string
{
return (string) $this->birthday->year;
}
public function birthdayHuman(): string
{
return $this->birthday->format('d.m.Y');
}
public function genderLetter(): string
{
return $this->gender->short;
}
}

View File

@ -3,16 +3,15 @@
namespace App\Contribution\Documents;
use App\Contribution\Data\MemberData;
use App\Contribution\Traits\HasPdfBackground;
use App\Country;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class BdkjHesse extends ContributionDocument
{
use HasPdfBackground;
/**
* @param Collection<int, Collection<int, MemberData>> $members
*/
@ -26,7 +25,6 @@ class BdkjHesse extends ContributionDocument
public ?string $filename = '',
public string $type = 'F',
) {
$this->setEventName($eventName);
}
public function dateFrom(): string
@ -116,9 +114,36 @@ class BdkjHesse extends ContributionDocument
return $member->birthYear();
}
public function basename(): string
{
return 'zuschuesse-bdkj-hessen' . Str::slug($this->eventName);
}
public function view(): string
{
return 'tex.contribution.bdkj-hesse';
}
public function template(): Template
{
return Template::make('tex.templates.contribution');
}
public function setFilename(string $filename): static
{
$this->filename = $filename;
return $this;
}
public function getEngine(): Engine
{
return Engine::PDFLATEX;
}
public static function getName(): string
{
return 'BDKJ Hessen';
return 'Für BDKJ Hessen erstellen';
}
/**
@ -131,6 +156,7 @@ class BdkjHesse extends ContributionDocument
'dateUntil' => 'required|string|date_format:Y-m-d',
'country' => 'required|integer|exists:countries,id',
'zipLocation' => 'required|string',
'eventName' => 'required|string',
];
}
}

View File

@ -3,17 +3,16 @@
namespace App\Contribution\Documents;
use App\Contribution\Data\MemberData;
use App\Contribution\Traits\FormatsDates;
use App\Contribution\Traits\HasPdfBackground;
use App\Country;
use App\Invoice\InvoiceSettings;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class CityFrankfurtMainDocument extends ContributionDocument
{
use HasPdfBackground;
use FormatsDates;
public string $fromName;
/**
@ -29,7 +28,6 @@ class CityFrankfurtMainDocument extends ContributionDocument
public ?string $filename = '',
public string $type = 'F',
) {
$this->setEventName($eventName);
$this->fromName = app(InvoiceSettings::class)->from_long;
}
@ -63,6 +61,17 @@ class CityFrankfurtMainDocument extends ContributionDocument
);
}
public function dateFromHuman(): string
{
return Carbon::parse($this->dateFrom)->format('d.m.Y');
}
public function dateUntilHuman(): string
{
return Carbon::parse($this->dateUntil)->format('d.m.Y');
}
public function countryName(): string
{
return $this->country->name;
@ -73,9 +82,56 @@ class CityFrankfurtMainDocument extends ContributionDocument
return count($this->members);
}
public function memberShort(MemberData $member): string
{
return $member->isLeader ? 'L' : '';
}
public function memberName(MemberData $member): string
{
return $member->separatedName();
}
public function memberAddress(MemberData $member): string
{
return $member->fullAddress();
}
public function memberAge(MemberData $member): string
{
return $member->age();
}
public function basename(): string
{
return 'zuschuesse-frankfurt-' . Str::slug($this->eventName);
}
public function view(): string
{
return 'tex.contribution.city-frankfurt-main';
}
public function template(): Template
{
return Template::make('tex.templates.contribution');
}
public function setFilename(string $filename): static
{
$this->filename = $filename;
return $this;
}
public function getEngine(): Engine
{
return Engine::PDFLATEX;
}
public static function getName(): string
{
return 'Frankfurt';
return 'Für Frankfurt erstellen';
}
/**
@ -88,6 +144,7 @@ class CityFrankfurtMainDocument extends ContributionDocument
'dateUntil' => 'required|string|date_format:Y-m-d',
'country' => 'required|integer|exists:countries,id',
'zipLocation' => 'required|string',
'eventName' => 'required|string',
];
}
}

View File

@ -3,17 +3,15 @@
namespace App\Contribution\Documents;
use App\Contribution\Data\MemberData;
use App\Contribution\Traits\FormatsDates;
use App\Contribution\Traits\HasPdfBackground;
use App\Country;
use App\Member\Member;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class CityRemscheidDocument extends ContributionDocument
{
use HasPdfBackground;
use FormatsDates;
/**
* @param Collection<int, Collection<int, Member>> $leaders
* @param Collection<int, Collection<int, Member>> $children
@ -27,9 +25,17 @@ class CityRemscheidDocument extends ContributionDocument
public Collection $children,
public ?string $filename = '',
public string $type = 'F',
public string $eventName = '',
) {
$this->setEventName($eventName);
}
public function niceDateFrom(): string
{
return Carbon::parse($this->dateFrom)->format('d.m.Y');
}
public function niceDateUntil(): string
{
return Carbon::parse($this->dateUntil)->format('d.m.Y');
}
/**
@ -46,7 +52,6 @@ class CityRemscheidDocument extends ContributionDocument
country: Country::where('id', $request['country'])->firstOrFail(),
leaders: $leaders->values()->toBase()->chunk(6),
children: $children->values()->toBase()->chunk(20),
eventName: $request['eventName'],
);
}
@ -65,13 +70,39 @@ class CityRemscheidDocument extends ContributionDocument
country: Country::where('id', $request['country'])->firstOrFail(),
leaders: $leaders->values()->toBase()->chunk(6),
children: $children->values()->toBase()->chunk(20),
eventName: $request['eventName'],
);
}
public function basename(): string
{
return 'zuschuesse-remscheid';
}
public function view(): string
{
return 'tex.contribution.city-remscheid';
}
public function template(): Template
{
return Template::make('tex.templates.contribution');
}
public function setFilename(string $filename): static
{
$this->filename = $filename;
return $this;
}
public function getEngine(): Engine
{
return Engine::PDFLATEX;
}
public static function getName(): string
{
return 'Remscheid';
return 'Für Remscheid erstellen';
}
/**

View File

@ -6,7 +6,9 @@ use App\Contribution\Data\MemberData;
use App\Invoice\InvoiceSettings;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class CitySolingenDocument extends ContributionDocument
{
@ -23,7 +25,6 @@ class CitySolingenDocument extends ContributionDocument
public string $eventName,
public string $type = 'F',
) {
$this->setEventName($eventName);
$this->fromName = app(InvoiceSettings::class)->from_long;
}
@ -73,6 +74,11 @@ class CitySolingenDocument extends ContributionDocument
return Carbon::parse($this->dateUntil)->format('d.m.Y');
}
public function template(): Template
{
return Template::make('tex.templates.contribution');
}
public function checkboxes(): string
{
$output = '';
@ -88,6 +94,16 @@ class CitySolingenDocument extends ContributionDocument
return $firstRow . "\n" . $secondRow;
}
public function basename(): string
{
return 'zuschuesse-solingen-' . Str::slug($this->eventName);
}
public function view(): string
{
return 'tex.contribution.city-solingen';
}
public function getEngine(): Engine
{
return Engine::PDFLATEX;
@ -95,7 +111,7 @@ class CitySolingenDocument extends ContributionDocument
public static function getName(): string
{
return 'Stadt Solingen';
return 'Für Stadt Solingen erstellen';
}
/**
@ -107,6 +123,7 @@ class CitySolingenDocument extends ContributionDocument
'dateFrom' => 'required|string|date_format:Y-m-d',
'dateUntil' => 'required|string|date_format:Y-m-d',
'zipLocation' => 'required|string',
'eventName' => 'required|string',
];
}
}

View File

@ -3,12 +3,9 @@
namespace App\Contribution\Documents;
use Zoomyboy\Tex\Document;
use Zoomyboy\Tex\Template;
abstract class ContributionDocument extends Document
{
private string $eventName;
abstract public static function getName(): string;
/**
@ -32,34 +29,8 @@ abstract class ContributionDocument extends Document
public static function globalRules(): array
{
return [
'eventName' => 'required|string',
'members' => 'present|array|min:1',
'members.*' => 'integer|exists:members,id',
];
}
public static function buttonName(): string
{
return 'Für ' . static::getName() . ' erstellen';;
}
public function setEventName(string $eventName): void
{
$this->eventName = $eventName;
}
public function basename(): string
{
return str('Zuschüsse ')->append($this->getName())->append(' ')->append($this->eventName)->slug();
}
public function template(): Template
{
return Template::make('tex.templates.contribution');
}
public function view(): string
{
return 'tex.contribution.' . str(class_basename(static::class))->replace('Document', '')->kebab()->toString();
}
}

View File

@ -3,16 +3,14 @@
namespace App\Contribution\Documents;
use App\Contribution\Data\MemberData;
use App\Contribution\Traits\FormatsDates;
use App\Contribution\Traits\HasPdfBackground;
use App\Country;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class RdpNrwDocument extends ContributionDocument
{
use HasPdfBackground;
use FormatsDates;
/**
* @param Collection<int, Collection<int, MemberData>> $members
*/
@ -24,9 +22,14 @@ class RdpNrwDocument extends ContributionDocument
public Collection $members,
public ?string $filename = '',
public string $type = 'F',
public string $eventName = '',
) {
$this->setEventName($eventName);
}
public function dateRange(): string
{
return Carbon::parse($this->dateFrom)->format('d.m.Y')
. ' - '
. Carbon::parse($this->dateUntil)->format('d.m.Y');
}
/**
@ -40,7 +43,6 @@ class RdpNrwDocument extends ContributionDocument
zipLocation: $request['zipLocation'],
country: Country::where('id', $request['country'])->firstOrFail(),
members: MemberData::fromModels($request['members'])->chunk(17),
eventName: $request['eventName'],
);
}
@ -55,7 +57,6 @@ class RdpNrwDocument extends ContributionDocument
zipLocation: $request['zipLocation'],
country: Country::where('id', $request['country'])->firstOrFail(),
members: MemberData::fromApi($request['member_data'])->chunk(17),
eventName: $request['eventName'],
);
}
@ -64,9 +65,65 @@ class RdpNrwDocument extends ContributionDocument
return $this->country->name;
}
public function memberShort(MemberData $member): string
{
return $member->isLeader ? 'L' : '';
}
public function memberName(MemberData $member): string
{
return $member->separatedName();
}
public function memberAddress(MemberData $member): string
{
return $member->fullAddress();
}
public function memberGender(MemberData $member): string
{
if (!$member->gender) {
return '';
}
return strtolower(substr($member->gender->name, 0, 1));
}
public function memberAge(MemberData $member): string
{
return $member->age();
}
public function basename(): string
{
return 'zuschuesse-rdp-nrw';
}
public function view(): string
{
return 'tex.contribution.rdp-nrw';
}
public function template(): Template
{
return Template::make('tex.templates.contribution');
}
public function setFilename(string $filename): static
{
$this->filename = $filename;
return $this;
}
public function getEngine(): Engine
{
return Engine::PDFLATEX;
}
public static function getName(): string
{
return 'RdP NRW';
return 'Für RdP NRW erstellen';
}
/**
@ -79,6 +136,7 @@ class RdpNrwDocument extends ContributionDocument
'dateUntil' => 'required|string|date_format:Y-m-d',
'country' => 'required|integer|exists:countries,id',
'zipLocation' => 'required|string',
'eventName' => 'required|string',
];
}
}

View File

@ -1,79 +0,0 @@
<?php
namespace App\Contribution\Documents;
use App\Contribution\Data\MemberData;
use App\Contribution\Traits\FormatsDates;
use App\Contribution\Traits\HasPdfBackground;
use App\Country;
use Illuminate\Support\Collection;
class WuppertalDocument extends ContributionDocument
{
use HasPdfBackground;
use FormatsDates;
/**
* @param Collection<int, Collection<int, MemberData>> $members
*/
public function __construct(
public string $dateFrom,
public string $dateUntil,
public string $zipLocation,
public ?Country $country,
public Collection $members,
public ?string $filename = '',
public string $type = 'F',
public string $eventName = '',
) {
$this->setEventName($eventName);
}
/**
* {@inheritdoc}
*/
public static function fromRequest(array $request): self
{
return new self(
dateFrom: $request['dateFrom'],
dateUntil: $request['dateUntil'],
zipLocation: $request['zipLocation'],
country: Country::where('id', $request['country'])->firstOrFail(),
members: MemberData::fromModels($request['members'])->chunk(14),
eventName: $request['eventName'],
);
}
/**
* {@inheritdoc}
*/
public static function fromApiRequest(array $request): self
{
return new self(
dateFrom: $request['dateFrom'],
dateUntil: $request['dateUntil'],
zipLocation: $request['zipLocation'],
country: Country::where('id', $request['country'])->firstOrFail(),
members: MemberData::fromApi($request['member_data'])->chunk(14),
eventName: $request['eventName'],
);
}
public static function getName(): string
{
return 'Wuppertal';
}
/**
* @return array<string, mixed>
*/
public static function rules(): array
{
return [
'dateFrom' => 'required|string|date_format:Y-m-d',
'dateUntil' => 'required|string|date_format:Y-m-d',
'zipLocation' => 'required|string',
];
}
}

View File

@ -1,24 +0,0 @@
<?php
namespace App\Contribution\Traits;
use Carbon\Carbon;
trait FormatsDates
{
public function niceDateFrom(): string
{
return Carbon::parse($this->dateFrom)->format('d.m.Y');
}
public function niceDateUntil(): string
{
return Carbon::parse($this->dateUntil)->format('d.m.Y');
}
public function dateRange(): string
{
return implode(' - ', [$this->niceDateFrom(), $this->niceDateUntil()]);
}
}

View File

@ -1,13 +0,0 @@
<?php
namespace App\Contribution\Traits;
use Zoomyboy\Tex\Engine;
trait HasPdfBackground
{
public function getEngine(): Engine
{
return Engine::PDFLATEX;
}
}

View File

@ -17,7 +17,7 @@ class CourseMember extends Model
public $guarded = [];
/**
* @return BelongsTo<Course, $this>
* @return BelongsTo<Course, self>
*/
public function course(): BelongsTo
{
@ -25,7 +25,7 @@ class CourseMember extends Model
}
/**
* @return BelongsTo<Member, $this>
* @return BelongsTo<Member, self>
*/
public function member(): BelongsTo
{

View File

@ -129,7 +129,6 @@ class Principal implements PrincipalBackendInterface
*/
public function findByUri($uri, $principalPrefix)
{
return null;
}
/**

View File

@ -15,13 +15,14 @@ class Fee extends Model
use HasFactory;
use HasNamiField;
/** @var array<int, string> */
public $fillable = ['name', 'nami_id'];
/** @var bool */
public $timestamps = false;
/**
* @return HasMany<Subscription, $this>
* @return HasMany<Subscription>
*/
public function subscriptions(): HasMany
{

View File

@ -22,8 +22,8 @@ class FormUpdateMetaAction
return [
'sorting' => 'array',
'sorting.by' => 'required|string',
'sorting.direction' => 'required|boolean',
'sorting.0' => 'required|string',
'sorting.1' => 'required|string|in:asc,desc',
'active_columns' => 'array',
'active_columns.*' => ['string', Rule::in([...$form->getFields()->pluck('key')->toArray(), 'created_at', 'prevention'])]
];

View File

@ -6,8 +6,9 @@ use App\Form\Models\Form;
use App\Form\Models\Participant;
use App\Form\Resources\ParticipantResource;
use App\Form\Scopes\ParticipantFilterScope;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Laravel\Scout\Builder;
use Illuminate\Pagination\LengthAwarePaginator;
use Lorisleiva\Actions\Concerns\AsAction;
class ParticipantIndexAction
@ -15,22 +16,29 @@ class ParticipantIndexAction
use AsAction;
/**
* @return Builder<Participant>
* @return HasMany<Participant>
*/
protected function getQuery(Form $form, ParticipantFilterScope $filter): Builder
protected function getQuery(Form $form, ParticipantFilterScope $filter): HasMany
{
return $filter->setForm($form)->getQuery()
->query(fn ($q) => $q->withCount('children')->with('form'));
return $form->participants()->withFilter($filter)->withCount('children')->with('form');
}
/**
* @return LengthAwarePaginator<Participant>
*/
public function handle(Form $form, ParticipantFilterScope $filter): LengthAwarePaginator
{
return $this->getQuery($form, $filter)->paginate(15);
}
public function asController(Form $form, ?int $parent = null): AnonymousResourceCollection
{
$filter = ParticipantFilterScope::fromRequest(request()->input('filter', ''))->parent($parent);
$filter = ParticipantFilterScope::fromRequest(request()->input('filter'));
$data = match ($parent) {
null => $this->getQuery($form, $filter)->paginate(15), // initial all elements - paginate
-1 => $this->getQuery($form, $filter)->paginate(15), // initial root elements - parinate
default => $this->getQuery($form, $filter)->get(), // specific parent element - show all
null => $this->handle($form, $filter),
-1 => $this->getQuery($form, $filter)->where('parent_id', null)->paginate(15),
default => $this->getQuery($form, $filter)->where('parent_id', $parent)->get(),
};
return ParticipantResource::collection($data)->additional(['meta' => ParticipantResource::meta($form)]);

View File

@ -17,12 +17,7 @@ class PreventionRememberAction
public function handle(): void
{
$query = Participant::whereHas(
'form',
fn ($form) => $form
->where('needs_prevention', true)
->where('from', '>=', now())
)
$query = Participant::whereHas('form', fn ($form) => $form->where('needs_prevention', true))
->where(
fn ($q) => $q
->where('last_remembered_at', '<=', now()->subWeeks(2))

View File

@ -7,7 +7,6 @@ use App\Form\Models\Form;
use App\Form\Models\Participant;
use App\Member\Member;
use Illuminate\Http\JsonResponse;
use Illuminate\Validation\ValidationException;
use Lorisleiva\Actions\ActionRequest;
use Lorisleiva\Actions\Concerns\AsAction;
@ -20,10 +19,6 @@ class RegisterAction
*/
public function handle(Form $form, array $input): Participant
{
if (!$form->canRegister()) {
throw ValidationException::withMessages(['event' => 'Anmeldung zzt nicht möglich.']);
}
$memberQuery = FieldCollection::fromRequest($form, $input)
->withNamiType()
->reduce(fn ($query, $field) => $field->namiType->performQuery($query, $field->value), (new Member())->newQuery());

View File

@ -1,31 +0,0 @@
<?php
namespace App\Form\Actions;
use App\Form\Models\Form;
use Lorisleiva\Actions\Concerns\AsAction;
class UpdateParticipantSearchIndexAction
{
use AsAction;
public function handle(Form $form): void
{
if (config('scout.driver') !== 'meilisearch') {
return;
}
$form->searchableUsing()->updateIndexSettings(
$form->participantsSearchableAs(),
[
'filterableAttributes' => [...$form->getFields()->filterables()->getKeys(), 'parent-id'],
'searchableAttributes' => $form->getFields()->searchables()->getKeys(),
'sortableAttributes' => [...$form->getFields()->sortables()->getKeys(), 'id', 'created_at'],
'displayedAttributes' => [...$form->getFields()->filterables()->getKeys(), ...$form->getFields()->searchables()->getKeys(), 'id'],
'pagination' => [
'maxTotalHits' => 1000000,
]
]
);
}
}

View File

@ -1,9 +0,0 @@
<?php
namespace App\Form\Contracts;
interface Filterable
{
/** @param mixed $value */
public function filter($value): string;
}

View File

@ -3,11 +3,11 @@
namespace App\Form\Data;
use App\Fileshare\Data\FileshareResourceData;
use App\Form\Fields\Field;
use Spatie\LaravelData\Attributes\MapInputName;
use Spatie\LaravelData\Attributes\MapOutputName;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Mappers\SnakeCaseMapper;
use Spatie\LaravelData\Support\EloquentCasts\DataEloquentCast;
#[MapInputName(SnakeCaseMapper::class)]
#[MapOutputName(SnakeCaseMapper::class)]
@ -16,13 +16,4 @@ class ExportData extends Data
public function __construct(public ?FileshareResourceData $root = null, public ?string $groupBy = null, public ?string $toGroupField = null)
{
}
/**
* @param array<int, mixed> $arguments
* @return DataEloquentCast<self>
*/
public static function castUsing(array $arguments): DataEloquentCast
{
return new DataEloquentCast(static::class, $arguments);
}
}

View File

@ -2,7 +2,6 @@
namespace App\Form\Data;
use App\Form\Contracts\Filterable;
use App\Form\Enums\SpecialType;
use App\Form\Fields\Field;
use App\Form\Fields\NamiField;
@ -118,27 +117,4 @@ class FieldCollection extends Collection
{
return $this->first(fn ($field) => $field->specialType === $specialType);
}
public function searchables(): self
{
return $this;
}
public function sortables(): self
{
return $this;
}
public function filterables(): self
{
return $this->filter(fn ($field) => $field instanceof Filterable);
}
/**
* @return array<int, string>
*/
public function getKeys(): array
{
return $this->map(fn ($field) => $field->key)->toArray();
}
}

View File

@ -8,7 +8,6 @@ use Illuminate\Support\Collection;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Attributes\WithTransformer;
use Spatie\LaravelData\Support\EloquentCasts\DataEloquentCast;
class FormConfigData extends Data
{
@ -30,13 +29,4 @@ class FormConfigData extends Data
new FieldCollection([])
);
}
/**
* @param array<int, mixed> $arguments
* @return DataEloquentCast<self>
*/
public static function castUsing(array $arguments): DataEloquentCast
{
return new DataEloquentCast(static::class, $arguments);
}
}

View File

@ -2,7 +2,6 @@
namespace App\Form\Fields;
use App\Form\Contracts\Filterable;
use App\Form\Matchers\BooleanMatcher;
use App\Form\Matchers\Matcher;
use App\Form\Models\Form;
@ -10,8 +9,9 @@ use App\Form\Models\Participant;
use App\Form\Presenters\BooleanPresenter;
use App\Form\Presenters\Presenter;
use Faker\Generator;
use Illuminate\Validation\Rule;
class CheckboxField extends Field implements Filterable
class CheckboxField extends Field
{
public bool $required;
public string $description;
@ -86,11 +86,4 @@ class CheckboxField extends Field implements Filterable
{
return app(BooleanMatcher::class);
}
public function filter($value): string
{
$asString = $value ? 'true' : 'false';
return "{$this->key} = $asString";
}
}

View File

@ -2,7 +2,6 @@
namespace App\Form\Fields;
use App\Form\Contracts\Filterable;
use App\Form\Matchers\Matcher;
use App\Form\Matchers\SingleValueMatcher;
use App\Form\Models\Form;
@ -10,7 +9,7 @@ use App\Form\Models\Participant;
use Faker\Generator;
use Illuminate\Validation\Rule;
class DropdownField extends Field implements Filterable
class DropdownField extends Field
{
public bool $required;
/** @var array<int, string> */
@ -88,14 +87,4 @@ class DropdownField extends Field implements Filterable
{
return app(SingleValueMatcher::class);
}
/** @inheritdoc */
public function filter($value): string
{
if (is_null($value)) {
return "{$this->key} IS NULL";
}
return $this->key . ' = \'' . $value . '\'';
}
}

View File

@ -180,10 +180,4 @@ abstract class Field extends Data
{
return app(SingleValueMatcher::class);
}
/** @param mixed $value */
public function filter($value): string
{
return '';
}
}

View File

@ -2,7 +2,6 @@
namespace App\Form\Fields;
use App\Form\Contracts\Filterable;
use App\Form\Matchers\Matcher;
use App\Form\Matchers\SingleValueMatcher;
use App\Form\Models\Form;
@ -10,7 +9,7 @@ use App\Form\Models\Participant;
use Faker\Generator;
use Illuminate\Validation\Rule;
class RadioField extends Field implements Filterable
class RadioField extends Field
{
public bool $required;
/** @var array<int, string> */
@ -88,13 +87,4 @@ class RadioField extends Field implements Filterable
{
return app(SingleValueMatcher::class);
}
public function filter($value): string
{
if (is_null($value)) {
return "{$this->key} IS NULL";
}
return $this->key . ' = \'' . $value . '\'';
}
}

View File

@ -2,13 +2,11 @@
namespace App\Form\Models;
use App\Form\Actions\UpdateParticipantSearchIndexAction;
use App\Form\Data\ExportData;
use App\Form\Data\FieldCollection;
use App\Form\Data\FormConfigData;
use App\Lib\Editor\Condition;
use App\Lib\Editor\EditorData;
use App\Lib\Sorting;
use Cviebrock\EloquentSluggable\Sluggable;
use Database\Factories\Form\Models\FormFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -16,6 +14,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Laravel\Scout\Searchable;
use Spatie\Image\Enums\Fit;
use Spatie\Image\Manipulations;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
@ -62,7 +61,7 @@ class Form extends Model implements HasMedia
}
/**
* @return HasMany<Participant, $this>
* @return HasMany<Participant>
*/
public function participants(): HasMany
{
@ -160,7 +159,7 @@ class Form extends Model implements HasMedia
if (is_null(data_get($model->meta, 'active_columns'))) {
$model->setAttribute('meta', [
'active_columns' => $model->getFields()->count() ? $model->getFields()->take(4)->pluck('key')->toArray() : null,
'sorting' => Sorting::by('id'),
'sorting' => $model->getFields()->count() ? [$model->getFields()->first()->key, 'asc'] : null,
]);
return;
}
@ -173,32 +172,5 @@ class Form extends Model implements HasMedia
return;
}
});
static::saved(function ($model) {
UpdateParticipantSearchIndexAction::dispatch($model);
});
}
public function participantsSearchableAs(): string
{
return config('scout.prefix') . 'forms_' . $this->id . '_participants';
}
public function defaultSorting(): Sorting
{
return Sorting::from($this->meta['sorting']);
}
public function canRegister(): bool
{
if ($this->registration_from && $this->registration_from->gt(now())) {
return false;
}
if ($this->registration_until && $this->registration_until->lt(now())) {
return false;
}
return true;
}
}

View File

@ -15,7 +15,6 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Facades\Mail;
use Laravel\Scout\Searchable;
use stdClass;
class Participant extends Model implements Preventable
@ -23,7 +22,6 @@ class Participant extends Model implements Preventable
/** @use HasFactory<ParticipantFactory> */
use HasFactory;
use Searchable;
public $guarded = [];
@ -33,7 +31,7 @@ class Participant extends Model implements Preventable
];
/**
* @return BelongsTo<Form, $this>
* @return BelongsTo<Form, self>
*/
public function form(): BelongsTo
{
@ -41,7 +39,7 @@ class Participant extends Model implements Preventable
}
/**
* @return HasMany<Participant, $this>
* @return HasMany<self>
*/
public function children(): HasMany
{
@ -49,7 +47,16 @@ class Participant extends Model implements Preventable
}
/**
* @return BelongsTo<Member, $this>
* @param Builder<self> $query
* @return Builder<self>
*/
public function scopeWithFilter(Builder $query, ParticipantFilterScope $filter): Builder
{
return $filter->apply($query);
}
/**
* @return BelongsTo<Member, self>
*/
public function member(): BelongsTo
{
@ -103,15 +110,4 @@ class Participant extends Model implements Preventable
{
return 'Nachweise erforderlich für deine Anmeldung zu ' . $this->form->name;
}
public function searchableAs(): string
{
return $this->form->participantsSearchableAs();
}
/** @return array<string, mixed> */
public function toSearchableArray(): array
{
return [...$this->data, 'parent-id' => $this->parent_id, 'created_at' => $this->created_at->timestamp];
}
}

View File

@ -35,7 +35,6 @@ class FormApiResource extends JsonResource
'image' => $this->getMedia('headerImage')->first()->getFullUrl('square'),
'is_active' => $this->is_active,
'is_private' => $this->is_private,
'can_register' => $this->getModel()->canRegister(),
];
}

View File

@ -4,76 +4,32 @@ namespace App\Form\Scopes;
use App\Form\Models\Form;
use App\Form\Models\Participant;
use App\Lib\ScoutFilter;
use App\Lib\Sorting;
use App\Lib\Filter;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Laravel\Scout\Builder;
use Spatie\LaravelData\Attributes\MapInputName;
use Spatie\LaravelData\Attributes\MapOutputName;
use Spatie\LaravelData\Mappers\SnakeCaseMapper;
/**
* @extends ScoutFilter<Participant>
* @extends Filter<Participant>
*/
#[MapInputName(SnakeCaseMapper::class)]
#[MapOutputName(SnakeCaseMapper::class)]
class ParticipantFilterScope extends ScoutFilter
class ParticipantFilterScope extends Filter
{
public static string $nan = 'deeb3ef4-d185-44b1-a4bc-0a4e7addebc3d8900c6f-a344-4afb-b54e-065ed483a7ba';
private Form $form;
/**
* @param array<string, mixed> $data
* @param array<string, mixed> $options
*/
public function __construct(
public array $data = [],
public string $search = '',
public array $options = [],
public ?int $parent = null,
public ?Sorting $sort = null
) {
}
public function getQuery(): Builder
{
$this->search = $this->search ?: '';
return Participant::search($this->search, function ($engine, string $query, array $options) {
$filter = collect([]);
foreach ($this->form->getFields()->filterables() as $field) {
if ($this->data[$field->key] === static::$nan) {
continue;
}
$filter->push($field->filter($this->data[$field->key]));
}
if ($this->parent === -1) {
$filter->push('parent-id IS NULL');
}
if ($this->parent !== null && $this->parent !== -1) {
$filter->push('parent-id = ' . $this->parent);
}
$options['filter'] = $filter->map(fn ($expression) => "($expression)")->implode(' AND ');
$options['sort'] = $this->sort->toMeilisearch();
return $engine->search($query, [...$this->options, ...$options]);
})->within($this->form->participantsSearchableAs());
}
public static string $nan = 'deeb3ef4-d185-44b1-a4bc-0a4e7addebc3d8900c6f-a344-4afb-b54e-065ed483a7ba';
public function setForm(Form $form): self
{
$this->form = $form;
if (is_null($this->sort)) {
$this->sort = $this->form->defaultSorting();
}
foreach ($form->getFields() as $field) {
if (!Arr::has($this->data, $field->key)) {
data_set($this->data, $field->key, static::$nan);
@ -83,10 +39,18 @@ class ParticipantFilterScope extends ScoutFilter
return $this;
}
public function parent(?int $parent): self
/**
* @inheritdoc
*/
public function apply(Builder $query): Builder
{
$this->parent = $parent;
foreach ($this->data as $key => $value) {
if ($value === static::$nan) {
continue;
}
$query = $query->where('data->' . $key, $value);
}
return $this;
return $query;
}
}

View File

@ -25,15 +25,6 @@ class Gender extends Model
};
}
public function getShortAttribute(): string
{
return match ($this->name) {
'Männlich' => 'm',
'Weiblich' => 'w',
default => ''
};
}
public static function fromString(string $title): self
{
return self::firstWhere('name', $title);

View File

@ -26,7 +26,7 @@ class Group extends Model
];
/**
* @return BelongsTo<Group, $this>
* @return BelongsTo<self, self>
*/
public function parent(): BelongsTo
{
@ -34,7 +34,7 @@ class Group extends Model
}
/**
* @return HasMany<Group, $this>
* @return HasMany<self>
*/
public function children(): HasMany
{

View File

@ -18,7 +18,5 @@ class Authenticate extends Middleware
if (!$request->expectsJson()) {
return route('login');
}
return null;
}
}

View File

@ -6,9 +6,9 @@ use Lorisleiva\Actions\Concerns\AsAction;
use App\Invoice\Models\Invoice;
use App\Invoice\Resources\InvoiceResource;
use App\Invoice\Scopes\InvoiceFilterScope;
use Illuminate\Pagination\LengthAwarePaginator;
use Inertia\Inertia;
use Inertia\Response;
use Laravel\Scout\Builder;
use Lorisleiva\Actions\ActionRequest;
class InvoiceIndexAction
@ -17,11 +17,11 @@ class InvoiceIndexAction
/**
* @return Builder<Invoice>
* @return LengthAwarePaginator<Invoice>
*/
public function handle(InvoiceFilterScope $filter): Builder
public function handle(InvoiceFilterScope $filter): LengthAwarePaginator
{
return $filter->getQuery()->query(fn ($q) => $q->with('positions'));
return Invoice::withFilter($filter)->with('positions')->paginate(15);
}
public function asController(ActionRequest $request): Response
@ -32,7 +32,7 @@ class InvoiceIndexAction
$filter = InvoiceFilterScope::fromRequest($request->input('filter', ''));
return Inertia::render('invoice/Index', [
'data' => InvoiceResource::collection($this->handle($filter)->paginate(15)),
'data' => InvoiceResource::collection($this->handle($filter)),
]);
}
}

View File

@ -39,7 +39,7 @@ class MassStoreAction
foreach ($memberGroup as $members) {
$invoice = Invoice::createForMember($members->first(), $members, $year);
$invoice->save();
$invoice->positions()->createMany($invoice->positions->toArray());
$invoice->positions()->createMany($invoice->positions);
$invoices->push($invoice->fresh('positions'));
}

View File

@ -8,17 +8,27 @@ use Lorisleiva\Actions\ActionRequest;
class InvoiceSettings extends LocalSettings implements Storeable
{
public ?string $from_long;
public ?string $from;
public ?string $mobile;
public ?string $email;
public ?string $website;
public ?string $address;
public ?string $place;
public ?string $zip;
public ?string $iban;
public ?string $bic;
public ?int $rememberWeeks;
public string $from_long;
public string $from;
public string $mobile;
public string $email;
public string $website;
public string $address;
public string $place;
public string $zip;
public string $iban;
public string $bic;
public int $rememberWeeks;
public static function group(): string
{

View File

@ -17,14 +17,12 @@ use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Laravel\Scout\Searchable;
use stdClass;
class Invoice extends Model
{
/** @use HasFactory<InvoiceFactory> */
use HasFactory;
use Searchable;
public $guarded = [];
@ -37,7 +35,7 @@ class Invoice extends Model
];
/**
* @return HasMany<InvoicePosition, $this>
* @return HasMany<InvoicePosition>
*/
public function positions(): HasMany
{
@ -49,6 +47,7 @@ class Invoice extends Model
*/
public static function createForMember(Member $member, Collection $members, int $year, Subscription $subscription = null): self
{
$subscription = $subscription ?: $member->subscription;
$invoice = new self([
'to' => [
'name' => 'Familie ' . $member->lastname,
@ -65,8 +64,7 @@ class Invoice extends Model
$positions = collect([]);
foreach ($members as $member) {
$memberSubscription = $subscription ?: $member->subscription;
foreach ($memberSubscription->children as $child) {
foreach ($subscription->children as $child) {
$positions->push([
'description' => str($child->name)->replace('{name}', $member->firstname . ' ' . $member->lastname)->replace('{year}', (string) $year),
'price' => $child->amount,
@ -122,6 +120,15 @@ class Invoice extends Model
->where('last_remembered_at', '<=', now()->subWeeks($weeks));
}
/**
* @param Builder<self> $query
* @return Builder<self>
*/
public function scopeWithFilter(Builder $query, InvoiceFilterScope $filter): Builder
{
return $filter->apply($query);
}
public function getMailRecipient(): stdClass
{
return (object) [
@ -147,20 +154,4 @@ class Invoice extends Model
]);
}
}
/**
* Get the indexable data array for the model.
*
* @return array<string, mixed>
*/
public function toSearchableArray(): array
{
return [
'to' => implode(', ', $this->to),
'usage' => $this->usage,
'greeting' => $this->greeting,
'mail_email' => $this->mail_email,
'status' => $this->status->value,
];
}
}

View File

@ -16,7 +16,7 @@ class InvoicePosition extends Model
public $guarded = [];
/**
* @return BelongsTo<Member, $this>
* @return BelongsTo<Member, self>
*/
public function member(): BelongsTo
{
@ -24,7 +24,7 @@ class InvoicePosition extends Model
}
/**
* @return BelongsTo<Invoice, $this>
* @return BelongsTo<Invoice, self>
*/
public function invoice(): BelongsTo
{

View File

@ -5,43 +5,42 @@ namespace App\Invoice\Scopes;
use App\Invoice\Enums\InvoiceStatus;
use App\Invoice\Models\Invoice;
use App\Lib\Filter;
use App\Lib\ScoutFilter;
use Laravel\Scout\Builder;
use Illuminate\Database\Eloquent\Builder;
use Spatie\LaravelData\Attributes\MapInputName;
use Spatie\LaravelData\Attributes\MapOutputName;
use Spatie\LaravelData\Mappers\SnakeCaseMapper;
/**
* @extends ScoutFilter<Invoice>
* @extends Filter<Invoice>
*/
#[MapInputName(SnakeCaseMapper::class)]
#[MapOutputName(SnakeCaseMapper::class)]
class InvoiceFilterScope extends ScoutFilter
class InvoiceFilterScope extends Filter
{
/**
* @param array<int, string> $statuses
*/
public function __construct(
public ?array $statuses = null,
public ?string $search = null
) {
$this->statuses = $this->statuses === null ? InvoiceStatus::defaultVisibleValues()->toArray() : $this->statuses;
}
/**
* @inheritdoc
*/
public function getQuery(): Builder
public function apply(Builder $query): Builder
{
$this->search = $this->search ?: '';
$query = $query->whereIn('status', $this->statuses);
return Invoice::search($this->search, function ($engine, string $query, array $options) {
if (empty($this->statuses)) {
$filter = 'status = "asa6aeruuni4BahC7Wei6ahm1"';
} else {
$filter = collect($this->statuses)->map(fn (string $status) => "status = \"$status\"")->join(' OR ');
}
return $engine->search($query, [...$options, 'filter' => $filter]);
});
return $query;
}
/**
* @inheritdoc
*/
public function toDefault(): self
{
$this->statuses = $this->statuses === null ? InvoiceStatus::defaultVisibleValues()->toArray() : $this->statuses;
return $this;
}
}

View File

@ -6,7 +6,6 @@ use Spatie\LaravelData\Data;
use Spatie\LaravelData\DataCollection;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\LaravelData\Attributes\DataCollectionOf;
use Spatie\LaravelData\Support\EloquentCasts\DataEloquentCast;
class Condition extends Data
{
@ -43,13 +42,4 @@ class Condition extends Data
{
return $this->mode === ConditionMode::ALL;
}
/**
* @param array<int, mixed> $arguments
* @return DataEloquentCast<self>
*/
public static function castUsing(array $arguments): DataEloquentCast
{
return new DataEloquentCast(static::class, $arguments);
}
}

View File

@ -3,7 +3,6 @@
namespace App\Lib\Editor;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Support\EloquentCasts\DataEloquentCast;
/** @todo replace blocks with actual block data classes */
class EditorData extends Data implements Editorable
@ -84,13 +83,4 @@ class EditorData extends Data implements Editorable
{
return $this;
}
/**
* @param array<int, mixed> $arguments
* @return DataEloquentCast<self>
*/
public static function castUsing(array $arguments): DataEloquentCast
{
return new DataEloquentCast(static::class, $arguments);
}
}

View File

@ -8,7 +8,7 @@ use Spatie\LaravelData\Data;
/**
* @template T of Model
* @property Builder<T> $query
* @property Builder $query
*/
abstract class Filter extends Data
{
@ -40,7 +40,7 @@ abstract class Filter extends Data
}
/**
* @return static
* @return static(self<T>)
*/
public function toDefault(): self
{

View File

@ -8,7 +8,7 @@ use Spatie\LaravelData\Data;
/**
* @template T of Model
* @property Builder<T> $query
* @property Builder $query
*/
abstract class ScoutFilter extends Data
{

View File

@ -1,25 +0,0 @@
<?php
namespace App\Lib;
use Spatie\LaravelData\Data;
class Sorting extends Data
{
public static function by(string $by): self
{
return static::factory()->withoutMagicalCreation()->from(['by' => $by]);
}
public function __construct(public string $by, public bool $direction = false)
{
}
/**
* @return array<int, string>
*/
public function toMeilisearch(): array
{
return [$this->by . ':' . ($this->direction ? 'desc' : 'asc')];
}
}

View File

@ -25,7 +25,7 @@ class ResyncAction
*/
public function getResults(Maildispatcher $dispatcher): Collection
{
return FilterScope::fromPost($dispatcher->filter)->noPageLimit()->getQuery()->get()
return FilterScope::fromPost($dispatcher->filter)->getQuery()->get()
->filter(fn ($member) => $member->email || $member->email_parents)
->map(fn ($member) => MailEntry::from(['email' => $member->email ?: $member->email_parents]))
->unique(fn ($member) => $member->email);

View File

@ -23,7 +23,7 @@ class Maildispatcher extends Model
];
/**
* @return BelongsTo<Mailgateway, $this>
* @return BelongsTo<Mailgateway, self>
*/
public function gateway(): BelongsTo
{

View File

@ -68,9 +68,9 @@ abstract class Type
}
/**
* @return mixed
* @return array<string, array<string, mixed>>
*/
public function toResource()
public function toResource(): array
{
return [
'cls' => get_class($this),
@ -93,8 +93,8 @@ abstract class Type
}
$this->list($name, $domain)
->filter(fn ($listEntry) => $results->doesntContain(fn ($r) => $r->is($listEntry)))
->each(fn ($listEntry) => $this->remove($name, $domain, $listEntry->email));
->filter(fn ($listEntry) => $results->doesntContain(fn ($r) => $r->is($listEntry)))
->each(fn ($listEntry) => $this->remove($name, $domain, $listEntry->email));
}
/**

View File

@ -10,7 +10,6 @@ use App\Member\Member;
use App\Setting\NamiSettings;
use App\Subactivity;
use Lorisleiva\Actions\Concerns\AsAction;
use Zoomyboy\LaravelNami\Data\BankAccount;
use Zoomyboy\LaravelNami\Data\Member as NamiMember;
class NamiPutMemberAction
@ -47,17 +46,7 @@ class NamiPutMemberAction
'groupId' => $member->group->nami_id,
'id' => $member->nami_id,
'version' => $member->version,
'keepdata' => $member->keepdata,
'bankAccount' => BankAccount::from([
'bankName' => $member->bankAccount->bank_name,
'id' => $member->bankAccount->nami_id,
'memberId' => $member->mitgliedsnr,
'iban' => $member->bankAccount->iban,
'bic' => $member->bankAccount->bic,
'blz' => $member->bankAccount->blz,
'person' => $member->bankAccount->person,
'accountNumber' => $member->bankAccount->account_number,
]),
'keepdata' => false,
]);
$response = $api->putMember($namiMember, $activity ? $activity->nami_id : null, $subactivity ? $subactivity->nami_id : null);
Member::withoutEvents(function () use ($response, $member) {

View File

@ -1,17 +0,0 @@
<?php
namespace App\Member;
use Database\Factories\Member\BankAccountFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BankAccount extends Model
{
/** @use HasFactory<BankAccountFactory> */
use HasFactory;
public $guarded = [];
public $primaryKey = 'member_id';
}

View File

@ -9,8 +9,7 @@ use Zoomyboy\LaravelNami\Data\Member as NamiMember;
use Zoomyboy\LaravelNami\Data\MembershipEntry as NamiMembershipEntry;
use Spatie\LaravelData\Attributes\DataCollectionOf;
class FullMember extends Data
{
class FullMember extends Data {
/**
* @param DataCollection<int, NamiCourse> $courses
* @param DataCollection<int, NamiMembershipEntry> $memberships
@ -21,6 +20,6 @@ class FullMember extends Data
public DataCollection $courses,
#[DataCollectionOf(NamiMembershipEntry::class)]
public DataCollection $memberships,
) {
}
) {}
}

View File

@ -46,8 +46,6 @@ class FilterScope extends ScoutFilter
public array $exclude = [],
public ?bool $hasFullAddress = null,
public ?bool $hasBirthday = null,
public ?bool $hasSvk = null,
public ?bool $hasVk = null,
) {
}
@ -87,12 +85,6 @@ class FilterScope extends ScoutFilter
if ($this->hasBirthday === true) {
$filter->push('birthday IS NOT NULL');
}
if ($this->hasSvk !== null) {
$filter->push('has_svk = ' . ($this->hasSvk ? 'true' : 'false'));
}
if ($this->hasVk !== null) {
$filter->push('has_vk = ' . ($this->hasVk ? 'true' : 'false'));
}
if ($this->ausstand === true) {
$filter->push('ausstand > 0');
}

View File

@ -34,7 +34,6 @@ use Zoomyboy\Osm\HasGeolocation;
use Zoomyboy\Phone\HasPhoneNumbers;
use App\Prevention\Enums\Prevention;
use Database\Factories\Member\MemberFactory;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* @property string $subscription_name
@ -59,7 +58,7 @@ class Member extends Model implements Geolocatable
/**
* @var array<int, string>
*/
public static array $namiFields = ['firstname', 'lastname', 'joined_at', 'birthday', 'send_newspaper', 'address', 'zip', 'location', 'nickname', 'other_country', 'further_address', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'gender_id', 'confession_id', 'region_id', 'country_id', 'fee_id', 'nationality_id', 'slug', 'subscription_id', 'keepdata'];
public static array $namiFields = ['firstname', 'lastname', 'joined_at', 'birthday', 'send_newspaper', 'address', 'zip', 'location', 'nickname', 'other_country', 'further_address', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'gender_id', 'confession_id', 'region_id', 'country_id', 'fee_id', 'nationality_id', 'slug', 'subscription_id'];
/**
* @var array<string, string>
@ -78,7 +77,6 @@ class Member extends Model implements Geolocatable
'multiply_pv' => 'boolean',
'multiply_more_pv' => 'boolean',
'is_leader' => 'boolean',
'keepdata' => 'boolean',
'bill_kind' => BillKind::class,
'mitgliedsnr' => 'integer',
@ -196,7 +194,7 @@ class Member extends Model implements Geolocatable
// ---------------------------------- Relations ----------------------------------
/**
* @return BelongsTo<Country, $this>
* @return BelongsTo<Country, self>
*/
public function country(): BelongsTo
{
@ -204,7 +202,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return BelongsTo<Gender, $this>
* @return BelongsTo<Gender, self>
*/
public function gender(): BelongsTo
{
@ -212,7 +210,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return BelongsTo<Region, $this>
* @return BelongsTo<Region, self>
*/
public function region(): BelongsTo
{
@ -223,7 +221,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return HasMany<InvoicePosition, $this>
* @return HasMany<InvoicePosition>
*/
public function invoicePositions(): HasMany
{
@ -231,7 +229,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return BelongsTo<Confession, $this>
* @return BelongsTo<Confession, self>
*/
public function confession(): BelongsTo
{
@ -239,7 +237,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return BelongsTo<Nationality, $this>
* @return BelongsTo<Nationality, self>
*/
public function nationality(): BelongsTo
{
@ -247,7 +245,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return BelongsTo<Subscription, $this>
* @return BelongsTo<Subscription, self>
*/
public function subscription(): BelongsTo
{
@ -255,7 +253,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return BelongsTo<Group, $this>
* @return BelongsTo<Group, self>
*/
public function group(): BelongsTo
{
@ -263,7 +261,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return HasMany<CourseMember, $this>
* @return HasMany<CourseMember>
*/
public function courses(): HasMany
{
@ -271,7 +269,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return HasMany<Membership, $this>
* @return HasMany<Membership>
*/
public function memberships(): HasMany
{
@ -279,7 +277,7 @@ class Member extends Model implements Geolocatable
}
/**
* @return HasMany<Membership, $this>
* @return HasMany<Membership>
*/
public function leaderMemberships(): HasMany
{
@ -287,34 +285,21 @@ class Member extends Model implements Geolocatable
}
/**
* @return HasMany<Membership, $this>
* @return HasMany<Membership>
*/
public function ageGroupMemberships(): HasMany
{
return $this->memberships()->isAgeGroup()->active();
}
/**
* @return HasOne<BankAccount, $this>
*/
public function bankAccount(): HasOne
{
return $this->hasOne(BankAccount::class);
}
public static function booted()
{
static::created(function (self $model): void {
$model->bankAccount()->create([]);
});
static::deleting(function (self $model): void {
$model->memberships->each->delete();
$model->courses->each->delete();
$model->invoicePositions->each(function ($position) {
$position->delete();
});
$model->bankAccount()->delete();
});
}
@ -558,8 +543,6 @@ class Member extends Model implements Geolocatable
'bill_kind' => $this->bill_kind?->value,
'group_id' => $this->group->id,
'group_name' => $this->group->inner_name ?: $this->group->name,
'has_vk' => $this->has_vk,
'has_svk' => $this->has_svk,
'links' => [
'show' => route('member.show', ['member' => $this], false),
'edit' => route('member.edit', ['member' => $this], false),

View File

@ -83,7 +83,6 @@ class MemberRequest extends FormRequest
'other_country' => '',
'salutation' => '',
'comment' => '',
'keepdata' => 'boolean',
];
}

View File

@ -106,7 +106,6 @@ class MemberResource extends JsonResource
'lat' => $this->lat,
'lon' => $this->lon,
'group_name' => $this->group->name,
'keepdata' => $this->keepdata,
'links' => [
'membership_index' => route('member.membership.index', ['member' => $this->getModel()]),
'invoiceposition_index' => route('member.invoice-position.index', ['member' => $this->getModel()]),
@ -163,10 +162,6 @@ class MemberResource extends JsonResource
'activity_ids' => [],
'subactivity_ids' => []
],
'boolean_filter' => [
['id' => true, 'name' => 'Ja'],
['id' => false, 'name' => 'Nein'],
],
'default' => [
'gender_id' => null,
'salutation' => '',
@ -207,7 +202,6 @@ class MemberResource extends JsonResource
'has_svk' => false,
'multiply_pv' => false,
'multiply_more_pv' => false,
'keepdata' => false,
]
];
}

View File

@ -32,7 +32,7 @@ class Membership extends Model
];
/**
* @return BelongsTo<Activity, $this>
* @return BelongsTo<Activity, self>
*/
public function activity(): BelongsTo
{
@ -40,7 +40,7 @@ class Membership extends Model
}
/**
* @return BelongsTo<Group, $this>
* @return BelongsTo<Group, self>
*/
public function group(): BelongsTo
{
@ -48,7 +48,7 @@ class Membership extends Model
}
/**
* @return BelongsTo<Subactivity, $this>
* @return BelongsTo<Subactivity, self>
*/
public function subactivity(): BelongsTo
{
@ -56,7 +56,7 @@ class Membership extends Model
}
/**
* @return BelongsTo<Member, $this>
* @return BelongsTo<Member, self>
*/
public function member(): BelongsTo
{

View File

@ -14,6 +14,9 @@ class Subscription extends Model
/** @use HasFactory<SubscriptionFactory> */
use HasFactory;
/**
* @var array<int, string>
*/
public $fillable = ['name', 'fee_id'];
public function getAmount(): int
@ -22,7 +25,7 @@ class Subscription extends Model
}
/**
* @return BelongsTo<Fee, $this>
* @return BelongsTo<Fee, self>
*/
public function fee(): BelongsTo
{
@ -30,7 +33,7 @@ class Subscription extends Model
}
/**
* @return HasMany<SubscriptionChild, $this>
* @return HasMany<SubscriptionChild>
*/
public function children(): HasMany
{

View File

@ -16,6 +16,9 @@ class Subactivity extends Model
use HasNamiField;
use Sluggable;
/**
* @var array<int, string>
*/
public $fillable = ['is_age_group', 'is_filterable', 'slug', 'name', 'nami_id'];
/**
@ -23,6 +26,9 @@ class Subactivity extends Model
*/
public $timestamps = false;
/**
* @var array<string, string>
*/
public $casts = [
'is_age_group' => 'boolean',
'is_filterable' => 'boolean',
@ -41,7 +47,7 @@ class Subactivity extends Model
}
/**
* @return BelongsToMany<Activity, $this>
* @return BelongsToMany<Activity>
*/
public function activities(): BelongsToMany
{

View File

@ -3,8 +3,6 @@
echo "drop database scoutrobot;" | sudo mysql
echo "create database scoutrobot;" | sudo mysql
ssh -l stamm-silva zoomyboy.de "cd /usr/share/webapps/adrema_silva && docker compose exec db mysqldump -udb -p$SCOUTROBOT_DB_PASSWORD db" > db.tmp
sudo mysql adrema < db.tmp
ssh -l stammsilva zoomyboy.de "cd /usr/share/webapps/nami_silva && docker compose exec db mysqldump -udb -p$SCOUTROBOT_DB_PASSWORD db" > db.tmp
sudo mysql scoutrobot < db.tmp
rm db.tmp
echo 'app(\App\Form\FormSettings::class)->fill(["registerUrl" => "http://stammsilva.test/anmeldung/{slug}/register", "clearCacheUrl" => "http://stammsilva.test/adrema/clear-cache"])->save();' | php artisan tinker

20
bin/run
View File

@ -1,17 +1,5 @@
#!/bin/bash
set -e
FILESHARE=false
WEB=false
while getopts f opt; do
case $opt in
f) FILESHARE=true ;;
w) WEB=true ;;
esac
done
tmux new-session -d -s test
tmux send-keys -t test "a serve" Enter
@ -24,11 +12,11 @@ tmux send-keys -t test "SS start docker && duu socketi" Enter
tmux new-window -t test
tmux send-keys -t test "nrh" Enter
$WEB && tmux new-window -t test
$WEB && tmux send-keys -t test "ggwdk && cd plugins/silva/adrema/assets/vendor/adrema-form && nrd" Enter
tmux new-window -t test
tmux send-keys -t test "ggwdk && cd plugins/silva/adrema/assets/vendor/adrema-form && nrd" Enter
$FILESHARE && tmux new-window -t test
$FILESHARE && tmux send-keys -t test "cd tests/Fileshare && docker compose up" Enter
tmux new-window -t test
tmux send-keys -t test "cd tests/Fileshare && docker compose up" Enter
tmux attach-session -t test

View File

@ -80,12 +80,12 @@
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"larastan/larastan": "^3.0",
"larastan/larastan": "^2.0",
"laravel/envoy": "^2.8",
"mockery/mockery": "^1.4.4",
"orchestra/testbench": "^9.0",
"pestphp/pest": "^3.0",
"phpstan/phpstan-mockery": "^2.0"
"phpstan/phpstan-mockery": "^1.1"
},
"config": {
"optimize-autoloader": true,

4020
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
<?php
return [
'email' => env('USER_EMAIL', 'admin@example.com'),
'password' => env('USER_PASSWORD', 'admin'),
];

View File

@ -69,23 +69,6 @@ return [
],
/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/
'batching' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs

View File

@ -1,7 +1,6 @@
<?php
use App\Form\Models\Form;
use App\Invoice\Models\Invoice;
use App\Member\Member;
return [
@ -138,7 +137,7 @@ return [
'key' => env('MEILI_MASTER_KEY', null),
'index-settings' => [
Member::class => [
'filterableAttributes' => ['address', 'birthday', 'ausstand', 'bill_kind', 'group_id', 'memberships', 'has_vk', 'has_svk', 'id'],
'filterableAttributes' => ['address', 'birthday', 'ausstand', 'bill_kind', 'group_id', 'memberships', 'id'],
'searchableAttributes' => ['fullname', 'address'],
'sortableAttributes' => ['lastname', 'firstname'],
'displayedAttributes' => ['age_group_icon', 'group_name', 'links', 'is_leader', 'lastname', 'firstname', 'fullname', 'address', 'ausstand', 'birthday', 'id', 'memberships', 'bill_kind', 'group_id'],
@ -154,16 +153,7 @@ return [
'pagination' => [
'maxTotalHits' => 1000000,
]
],
Invoice::class => [
'filterableAttributes' => ['to', 'usage', 'greeting', 'mail_email', 'status', 'id'],
'searchableAttributes' => ['to', 'usage', 'greeting', 'mail_email', 'status', 'id'],
'sortableAttributes' => [],
'displayedAttributes' => ['to', 'usage', 'greeting', 'mail_email', 'status', 'id'],
'pagination' => [
'maxTotalHits' => 1000000,
]
],
]
],
],

View File

@ -7,7 +7,6 @@ use App\Form\Models\Form;
use App\Lib\Editor\Condition;
use Database\Factories\Traits\FakesMedia;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
use Tests\Feature\Form\FormtemplateFieldRequest;
use Tests\Feature\Form\FormtemplateSectionRequest;
use Tests\RequestFactories\EditorRequestFactory;
@ -49,8 +48,8 @@ class FormFactory extends Factory
'config' => ['sections' => []],
'from' => $this->faker->dateTimeBetween('+1 week', '+4 weeks')->format('Y-m-d H:i:s'),
'to' => $this->faker->dateTimeBetween('+1 week', '+4 weeks')->format('Y-m-d H:i:s'),
'registration_from' => $this->faker->dateTimeBetween(Carbon::parse('-2 weeks'), now())->format('Y-m-d H:i:s'),
'registration_until' => $this->faker->dateTimeBetween(now(), Carbon::parse('+2 weeks'))->format('Y-m-d H:i:s'),
'registration_from' => $this->faker->dateTimeBetween('-2 weeks', 'now')->format('Y-m-d H:i:s'),
'registration_until' => $this->faker->dateTimeBetween('now', '+2 weeks')->format('Y-m-d H:i:s'),
'mail_top' => EditorRequestFactory::new()->toData(),
'mail_bottom' => EditorRequestFactory::new()->toData(),
'is_active' => true,

View File

@ -1,36 +0,0 @@
<?php
namespace Database\Factories\Member;
use App\Member\BankAccount;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<BankAccount>
*/
class BankAccountFactory extends Factory
{
protected $model = BankAccount::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'bank_name' => $this->faker->name(),
'bic' => $this->faker->swiftBicNumber(),
'iban' => $this->faker->iban('DE'),
'blz' => $this->faker->name(),
'person' => $this->faker->name(),
'account_number' => $this->faker->name(),
];
}
public function inNami(int $namiId): self
{
return $this->state(['nami_id' => $namiId]);
}
}

View File

@ -36,9 +36,6 @@ class MemberFactory extends Factory
'location' => $this->faker->city,
'email' => $this->faker->safeEmail(),
'recertified_at' => null,
'keepdata' => false,
'has_svk' => $this->faker->boolean(),
'has_vk' => $this->faker->boolean(),
];
}
@ -93,13 +90,6 @@ class MemberFactory extends Factory
return $this->state(['nami_id' => $namiId]);
}
public function withBankAccount(BankAccountFactory $factory): self
{
return $this->afterCreating(function ($member) use ($factory) {
$member->bankAccount->update($factory->make()->toArray());
});
}
public function sameFamilyAs(Member $member): self
{
return $this->state([

View File

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('members', function (Blueprint $table) {
$table->boolean('keepdata')->after('email_parents')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('members', function (Blueprint $table) {
$table->dropColumn('keepdata');
});
}
};

View File

@ -1,31 +0,0 @@
<?php
use App\Form\Actions\UpdateParticipantSearchIndexAction;
use App\Form\Models\Form;
use App\Lib\Sorting;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
foreach (Form::get() as $form) {
UpdateParticipantSearchIndexAction::run($form);
foreach ($form->participants as $participant) {
$participant->searchable();
}
$form->updateQuietly(['meta' => [...$form->meta, 'sorting' => Sorting::by('id')]]);
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@ -1,27 +0,0 @@
<?php
use App\Invoice\Models\Invoice;
use Illuminate\Database\Migrations\Migration;
use Laravel\Scout\Console\SyncIndexSettingsCommand;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Artisan::call(SyncIndexSettingsCommand::class);
foreach (Invoice::get() as $invoice) {
$invoice->searchable();
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@ -1,30 +0,0 @@
<?php
use App\Form\Actions\UpdateParticipantSearchIndexAction;
use App\Form\Models\Form;
use App\Lib\Sorting;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
foreach (Form::get() as $form) {
UpdateParticipantSearchIndexAction::run($form);
foreach ($form->participants as $participant) {
$participant->searchable();
}
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('bank_accounts', function (Blueprint $table) {
$table->unsignedBigInteger('member_id')->primary();
$table->unsignedBigInteger('nami_id')->nullable();
$table->string('iban')->nullable();
$table->string('bic')->nullable();
$table->string('blz')->nullable();
$table->string('bank_name')->nullable();
$table->string('person')->nullable();
$table->string('account_number')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bank_accounts');
}
};

View File

@ -16,11 +16,10 @@ class UserSeeder extends Seeder
public function run()
{
User::create([
'email' => config('init.email'),
'email' => env('USER_EMAIL', 'admin@example.com'),
'email_verified_at' => now(),
'password' => Hash::make(config('init.password')),
'firstname' => 'Adrema',
'lastname' => 'Benutzer',
'password' => Hash::make(env('USER_PASSWORD', 'admin')),
'name' => 'Adrema Benutzer',
]);
}
}

View File

@ -2,6 +2,7 @@ version: '3'
services:
webservice:
image: zoomyboy/adrema-webservice:latest
restart: always
depends_on:
- php
ports:
@ -11,6 +12,7 @@ services:
php:
image: zoomyboy/adrema-app:latest
restart: always
depends_on:
- db
- redis
@ -36,6 +38,7 @@ services:
horizon:
image: zoomyboy/adrema-app:latest
restart: always
depends_on:
- php
command: /bin/entrypoint horizon
@ -59,6 +62,7 @@ services:
schedule:
image: zoomyboy/adrema-app:latest
restart: always
depends_on:
- php
command: /bin/entrypoint schedule
@ -82,6 +86,7 @@ services:
db:
image: mariadb:10.6.5
restart: always
env_file:
- .app.env
environment:
@ -93,6 +98,7 @@ services:
socketi:
image: quay.io/soketi/soketi:89604f268623cf799573178a7ba56b7491416bde-16-debian
restart: always
environment:
SOKETI_DEFAULT_APP_ID: adremaid
SOKETI_DEFAULT_APP_KEY: adremakey
@ -100,6 +106,7 @@ services:
redis:
image: redis:alpine3.18
restart: always
volumes:
- ./data/redis:/data

1396
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit f905c316ee7913cbf85c386021fbaa28b4b2a158
Subproject commit bc61530e510b3d41048984b7cf20b6d82c4f85fb

@ -1 +1 @@
Subproject commit 424ca30932610dcef496640e4097644ed404f13b
Subproject commit 77cfe9bbc7a11ee6494b205458ac5c75ff5c166d

@ -1 +1 @@
Subproject commit ed283d97ca7680b3c27b2d75da9937f4f379e321
Subproject commit 74800de149bf2ca250a17263cfaf59e48b76186f

View File

@ -7,9 +7,6 @@ parameters:
stubFiles:
- tests/stub/phpstan/TestResponse.stub
- tests/stub/phpstan/Settings.stub
- tests/stub/phpstan/DataEloquentCast.stub
- tests/stub/phpstan/File.stub
- tests/stub/phpstan/CastsAttributes.stub
paths:
- app
@ -33,6 +30,9 @@ parameters:
ignoreErrors:
-
message: "#but does not specify its types: TData#"
-
message: "#cast\\(\\) has parameter \\$properties#"
-
message: "#^Method App\\\\Activity\\:\\:sluggable\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
@ -453,6 +453,11 @@ parameters:
count: 1
path: app/Form/Fields/NamiField.php
-
message: "#^Method App\\\\Fileshare\\\\ConnectionTypes\\\\ConnectionType\\:\\:types\\(\\) should return Illuminate\\\\Support\\\\Collection\\<int, class\\-string\\<App\\\\Fileshare\\\\ConnectionTypes\\\\ConnectionType\\>\\> but returns Illuminate\\\\Support\\\\Collection\\<int, string\\>\\.$#"
count: 1
path: app/Fileshare/ConnectionTypes/ConnectionType.php
-
message: "#^Call to an undefined method Phake\\\\Proxies\\\\StubberProxy\\:\\:check\\(\\)\\.$#"
count: 1
@ -502,45 +507,3 @@ parameters:
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\Relation\\<\\*, \\*, \\*\\>\\:\\:isTrying\\(\\)\\.$#"
count: 1
path: app/Membership/TestersBlock.php
-
message: '#^Call to an undefined method Illuminate\\Database\\Eloquent\\Builder\<Illuminate\\Database\\Eloquent\\Model\>\:\:isLeader\(\)\.$#'
identifier: method.notFound
count: 1
path: app/Efz/EfzPendingBlock.php
-
message: '#^Method App\\Fileshare\\ConnectionTypes\\ConnectionType\:\:types\(\) should return Illuminate\\Support\\Collection\<int, class\-string\<App\\Fileshare\\ConnectionTypes\\ConnectionType\>\> but returns Illuminate\\Support\\Collection\<int, non\-falsy\-string\>\.$#'
identifier: return.type
count: 1
path: app/Fileshare/ConnectionTypes/ConnectionType.php
-
message: '#^Unable to resolve the template type TGroupKey in call to method Illuminate\\Support\\Collection\<int,App\\Form\\Models\\Participant\>\:\:groupBy\(\)$#'
identifier: argument.templateType
count: 1
path: app/Form/Actions/ExportSyncAction.php
-
message: '#^Parameter \#1 \$callback of method Illuminate\\Support\\Collection\<\(int\|string\),mixed\>\:\:map\(\) contains unresolvable type\.$#'
identifier: argument.unresolvableType
count: 1
path: app/Mailgateway/Resources/MailgatewayResource.php
-
message: '#^Parameter \#1 \$value of method Illuminate\\Support\\Collection\<\(int\|string\),array\<string, mixed\>\>\:\:prepend\(\) contains unresolvable type\.$#'
identifier: argument.unresolvableType
count: 1
path: app/Mailgateway/Resources/MailgatewayResource.php
-
message: '#^Call to an undefined method Illuminate\\Database\\Eloquent\\Builder\<Illuminate\\Database\\Eloquent\\Model\>\:\:isLeader\(\)\.$#'
identifier: method.notFound
count: 1
path: app/Member/PsPendingBlock.php
-
message: '#^Call to an undefined method Illuminate\\Database\\Eloquent\\Builder\<TRelatedModel of Illuminate\\Database\\Eloquent\\Model\>\:\:isTrying\(\)\.$#'
identifier: method.notFound
count: 1
path: app/Membership/TestersBlock.php

View File

@ -29,7 +29,6 @@
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
<server name="SCOUT_DRIVER" value="database"/>
</php>
<source>
<include>

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="687.866" height="704.496" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;fill-rule:evenodd;clip-rule:evenodd" viewBox="0 0 182.004 186.404"><defs></defs><g id="Ebene_x0020_1"><path d="m72.601.2-.6.2-.8.4-1 .6-1 1-.6 1-.6 1.6 1.2 18-39.4.4L10.6 43.2l61.001 4.601 2.6 28-2.4-1.6a12.425 12.425 0 0 1-2.2-1.4c-.916-.523-2.05-1.05-2.8-1.8l-1.8-1.2-1.6-1-1.6-1-2-1.2-1.4-.8-1.6-1-4.2-2.4-1.8-1-3-1.4-2.8-1.4-1.6-.8-2.2-1-2.4-1-2.8-1-3.2-1-4.4-1-2.8-.4h-5.4l-1 .2-2 .4-1.6.4-1 .4-1.401.6-.6.4-1 .6-1.4 1-2 2c-.262.524-.672.745-1 1.2l-.6.8c-.1.138-.3.662-.4.8l-1.2 2-.8 1.6-.6 1.4-.8 2.6-.6 1.6-.4 1.8-.4 1.8-.4 2-.4 2.4-.4 3.4-.2 3.4v10.401l.2 3.4.4 3.8.4 2.6.2 1.6.4 2.2.6 3 .4 1.6.6 2.4.4 1.4.4 1.4.2.6.4 1.2c.292.585.353 1.203.6 1.8l.4 1.2.4 1 .2.601.4 1 .6 1.6.4.8.6 1.4.4.8.4.8.6 1.2.4.8.6 1.2.6 1.2 1 1.8.4.6.6 1 .4.6 1 1.6.8 1.2.8 1.2 1 1.4 1 1.4.8 1 1 1.2.6.8 1 1.2 3 3 1 .8 1 .6 1.2.6.8.4 1 .4 2.8.6H38l3.2-.6 1.2-.4 3-1.4 1.4-.8 1-.6 2.001-1.2 1.6-1.2 1.4-1 1.6-1.2 2.6-2.2 1-.8 2.4-2 2-1.8 2.2-2 2.2-1.8c.704-.703 1.89-1.955 2.2-2.2.1-.053.874-.82 1.4-1.2l1.2-1 .2-.2.2-.4v-.6l-.2-.2-5.8-.2-2.2-.4-1.8-.6-1-.6-1-.8-1-1-.8-1-1.2-2.2-1.2-3.4-.8-2.6-.6-3.2-.6-3.4-.6-2.6-.6-3.4-.6-3.2-.8-4v-2l.8-.8h2.6l2 .4 2.4.6c1.357.542 2.688.943 4 1.6l2.2 1 1.4.6.8.4c.807.58 2.086.885 2.8 1.6l2 1.2 2.2 1.6 2.4 2.4.8 1.6 1.4 13.6h23.401l1-10.4.6-2.6 1.2-2.2 2.4-2.4.8-.6c.69-.346 1.377-.933 2-1.4.81-.54 1.721-1.25 2.6-1.6 1.04-.52 1.991-1.096 3-1.6l1.8-.8c.757-.33 1.629-.718 2.4-1l1.8-.6 1-.4 2.4-.6 2-.4h2.601l.8.8v2c-.015.296-1.42 6.984-1.6 8l-.4 2.6-.4 2-.6 3.4-.4 1.8-.4 2-.6 2.2-.6 2-.8 1.8-.6 1.2-.6 1-.8 1-1 1-2 1.4-1.8.6-2.2.4-5.8.2-.2.2v.6l.2.4c.16.222 1.13.954 1.4 1.2l1 1 2 1.8 1 1 1.4 1.2 2.6 2.2 1.6 1.6 4.8 4 1.6 1.2 8.4 5.6s2.962 1.606 3.6 1.8l2 .6 2.4.4h5.6l2.8-.6c.245-.074 2.257-.918 2.4-1l2.2-1.6 3.6-3.6c1.182-1.18 2.016-2.615 3.2-3.8l1.4-2.2 3.4-5 2.4-4.2 1.4-2.6 1-2 1.2-2.8 1-2.4 1.4-3.8.801-2.4 1-3.4.8-3.6 1.2-5.6.2-1.6.4-2.6.2-2.2.4-5V85.201l-.2-3.4-.4-3.4-.4-2.4-.2-1.4-.4-1.8-.4-1.6-.2-.8-.4-1.2-.4-1.4c-.165-.484-.78-1.904-1-2.4l-1-2.2-1-1.8-1.2-1.8-2.2-2.4c-.22-.2-3.7-2.745-3.8-2.8l-2-.8-2-.6-3-.6h-5.4l-2.8.4-3.4.8-3 .8-3 1-2.397.978-2.404 1.021-3 1.4-4 2-4.8 2.6-1.4.8-7 4.2-1.8 1.2-3.2 2-4 2.6-3.2 2.2 2.6-28.8 61.6-4.6-19.2-19.6-40.019-.2 1.418-17.8-.6-1.8-.8-1.2-1.2-1.2-1.4-.8-.6-.2-1.4-.2h-33.6l-1.2.2z"/><path d="m51.201 175.604-.6 1v.6l.2.4.4.4.4.2.8.4.8.4 1.6.6 1 .4 2.4.6 1.8.2h1.6l1-.2.6-.4.8-.6 1.8-1.6c3.438-3.437 7.332-6.59 11-9.8l-.8 14v2.4l.2 1 .2.4.2.2.8.2h27.201l.8-.2.2-.2.2-.4.2-1v-2.4l-.8-14 12 10.6.8.8.8.6.6.4 1 .2h1.6l1.8-.2 1.601-.4 1.8-.6 1-.4.6-.2.8-.4.8-.4.4-.2.4-.4.2-.4v-.6c0 .3-29.401-43.8-29.4-43.8H80.001l-28.8 42.8z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="687.866" height="704.496" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;fill-rule:evenodd;clip-rule:evenodd" viewBox="0 0 182.004 186.404"><defs><style>.fil0{fill:#000}</style></defs><g id="Ebene_x0020_1"><path class="fil0" d="m72.601.2-.6.2-.8.4-1 .6-1 1-.6 1-.6 1.6 1.2 18-39.4.4L10.6 43.2l61.001 4.601 2.6 28-2.4-1.6a12.425 12.425 0 0 1-2.2-1.4c-.916-.523-2.05-1.05-2.8-1.8l-1.8-1.2-1.6-1-1.6-1-2-1.2-1.4-.8-1.6-1-4.2-2.4-1.8-1-3-1.4-2.8-1.4-1.6-.8-2.2-1-2.4-1-2.8-1-3.2-1-4.4-1-2.8-.4h-5.4l-1 .2-2 .4-1.6.4-1 .4-1.401.6-.6.4-1 .6-1.4 1-2 2c-.262.524-.672.745-1 1.2l-.6.8c-.1.138-.3.662-.4.8l-1.2 2-.8 1.6-.6 1.4-.8 2.6-.6 1.6-.4 1.8-.4 1.8-.4 2-.4 2.4-.4 3.4-.2 3.4v10.401l.2 3.4.4 3.8.4 2.6.2 1.6.4 2.2.6 3 .4 1.6.6 2.4.4 1.4.4 1.4.2.6.4 1.2c.292.585.353 1.203.6 1.8l.4 1.2.4 1 .2.601.4 1 .6 1.6.4.8.6 1.4.4.8.4.8.6 1.2.4.8.6 1.2.6 1.2 1 1.8.4.6.6 1 .4.6 1 1.6.8 1.2.8 1.2 1 1.4 1 1.4.8 1 1 1.2.6.8 1 1.2 3 3 1 .8 1 .6 1.2.6.8.4 1 .4 2.8.6H38l3.2-.6 1.2-.4 3-1.4 1.4-.8 1-.6 2.001-1.2 1.6-1.2 1.4-1 1.6-1.2 2.6-2.2 1-.8 2.4-2 2-1.8 2.2-2 2.2-1.8c.704-.703 1.89-1.955 2.2-2.2.1-.053.874-.82 1.4-1.2l1.2-1 .2-.2.2-.4v-.6l-.2-.2-5.8-.2-2.2-.4-1.8-.6-1-.6-1-.8-1-1-.8-1-1.2-2.2-1.2-3.4-.8-2.6-.6-3.2-.6-3.4-.6-2.6-.6-3.4-.6-3.2-.8-4v-2l.8-.8h2.6l2 .4 2.4.6c1.357.542 2.688.943 4 1.6l2.2 1 1.4.6.8.4c.807.58 2.086.885 2.8 1.6l2 1.2 2.2 1.6 2.4 2.4.8 1.6 1.4 13.6h23.401l1-10.4.6-2.6 1.2-2.2 2.4-2.4.8-.6c.69-.346 1.377-.933 2-1.4.81-.54 1.721-1.25 2.6-1.6 1.04-.52 1.991-1.096 3-1.6l1.8-.8c.757-.33 1.629-.718 2.4-1l1.8-.6 1-.4 2.4-.6 2-.4h2.601l.8.8v2c-.015.296-1.42 6.984-1.6 8l-.4 2.6-.4 2-.6 3.4-.4 1.8-.4 2-.6 2.2-.6 2-.8 1.8-.6 1.2-.6 1-.8 1-1 1-2 1.4-1.8.6-2.2.4-5.8.2-.2.2v.6l.2.4c.16.222 1.13.954 1.4 1.2l1 1 2 1.8 1 1 1.4 1.2 2.6 2.2 1.6 1.6 4.8 4 1.6 1.2 8.4 5.6s2.962 1.606 3.6 1.8l2 .6 2.4.4h5.6l2.8-.6c.245-.074 2.257-.918 2.4-1l2.2-1.6 3.6-3.6c1.182-1.18 2.016-2.615 3.2-3.8l1.4-2.2 3.4-5 2.4-4.2 1.4-2.6 1-2 1.2-2.8 1-2.4 1.4-3.8.801-2.4 1-3.4.8-3.6 1.2-5.6.2-1.6.4-2.6.2-2.2.4-5V85.201l-.2-3.4-.4-3.4-.4-2.4-.2-1.4-.4-1.8-.4-1.6-.2-.8-.4-1.2-.4-1.4c-.165-.484-.78-1.904-1-2.4l-1-2.2-1-1.8-1.2-1.8-2.2-2.4c-.22-.2-3.7-2.745-3.8-2.8l-2-.8-2-.6-3-.6h-5.4l-2.8.4-3.4.8-3 .8-3 1-2.397.978-2.404 1.021-3 1.4-4 2-4.8 2.6-1.4.8-7 4.2-1.8 1.2-3.2 2-4 2.6-3.2 2.2 2.6-28.8 61.6-4.6-19.2-19.6-40.019-.2 1.418-17.8-.6-1.8-.8-1.2-1.2-1.2-1.4-.8-.6-.2-1.4-.2h-33.6l-1.2.2z"/><path class="fil0" d="m51.201 175.604-.6 1v.6l.2.4.4.4.4.2.8.4.8.4 1.6.6 1 .4 2.4.6 1.8.2h1.6l1-.2.6-.4.8-.6 1.8-1.6c3.438-3.437 7.332-6.59 11-9.8l-.8 14v2.4l.2 1 .2.4.2.2.8.2h27.201l.8-.2.2-.2.2-.4.2-1v-2.4l-.8-14 12 10.6.8.8.8.6.6.4 1 .2h1.6l1.8-.2 1.601-.4 1.8-.6 1-.4.6-.2.8-.4.8-.4.4-.2.4-.4.2-.4v-.6c0 .3-29.401-43.8-29.4-43.8H80.001l-28.8 42.8z"/></g></svg>

Before

(image error) Size: 2.8 KiB

After

(image error) Size: 2.8 KiB

View File

@ -1,34 +0,0 @@
<template>
<th @click="$emit('update:model-value')">
<div class="flex justify-between items-center">
<span v-text="label"></span>
<ui-sprite v-if="value.by === column && value.direction === false" src="chevron" class="w-3 h-3 text-primaryfg ml-2">ASC</ui-sprite>
<ui-sprite v-if="value.by === column && value.direction === true" src="chevron" class="rotate-180 w-3 h-3 text-primaryfg ml-2">DESC</ui-sprite>
</div>
</th>
</template>
<script setup>
defineEmits(['update:model-value']);
defineProps({
column: {
type: String,
default: () => '',
},
label: {
type: String,
default: () => '',
},
value: {
type: Object,
default: () => {
return {by: '', direction: false};
},
},
sortable: {
type: Boolean,
default: false,
},
});
</script>

View File

@ -28,9 +28,9 @@ export function useApiIndex(firstUrl, siteName = null) {
inner.meta.value = response.meta;
}
async function reloadPage(page, p = {}) {
async function reloadPage(page) {
inner.meta.value.current_page = page;
await reload(false, p);
await reload(false);
}
function create() {

View File

@ -56,8 +56,6 @@
></f-singlefile>
<f-text id="from" v-model="single.from" type="date" label="Von" required></f-text>
<f-text id="to" v-model="single.to" type="date" label="Bis" required></f-text>
<f-text id="registration_from" v-model="single.registration_from" type="datetime-local" label="Registrierung von" required></f-text>
<f-text id="registration_until" v-model="single.registration_until" type="datetime-local" label="Registrierung bis" required></f-text>
<f-textarea
id="excerpt"
v-model="single.excerpt"
@ -66,15 +64,13 @@
:rows="5"
required
></f-textarea>
</div>
<div v-if="active === 1">
<f-editor id="description" v-model="single.description" name="description" label="Beschreibung" :rows="10" required></f-editor>
</div>
<div v-if="active === 2">
<div v-if="active === 1">
<ui-note class="mt-2"> Sobald sich der erste Teilnehmer für die Veranstaltung angemeldet hat, kann dieses Formular nicht mehr geändert werden. </ui-note>
<form-builder v-model="single.config" :meta="meta"></form-builder>
</div>
<div v-show="active === 3" class="grid grid-cols-[1fr_300px] gap-3">
<div v-show="active === 2" class="grid grid-cols-[1fr_300px] gap-3">
<ui-note class="mt-2 col-span-full">
Hier kannst du die E-Mail anpassen, die nach der Anmeldung an den Teilnehmer verschickt wird.<br />
Es gibt dafür einen ersten E-Mail-Teil und einen zweiten E-Mail-Teil. Dazwischen werden die Daten des Teilnehmers aufgelistet.<br />
@ -112,14 +108,14 @@
</template>
</f-multiplefiles>
</div>
<div v-if="active === 4">
<div v-if="active === 3">
<div class="grid gap-3">
<ui-remote-resource id="export" v-model="single.export.root" label="Haupt-Ordner"></ui-remote-resource>
<f-select id="group_by" v-model="single.export.group_by" :options="allFields" label="Gruppieren nach" name="group_by"></f-select>
<f-select id="to_group_field" v-model="single.export.to_group_field" :options="allFields" label="Nach Gruppe schreiben" name="to_group_field"></f-select>
</div>
</div>
<div v-show="active === 5" class="grid grid-cols-2 gap-3">
<div v-show="active === 4" class="grid grid-cols-2 gap-3">
<f-switch id="needs_prevention" v-model="single.needs_prevention" name="needs_prevention" label="Prävention"></f-switch>
<f-editor
id="prevention_text"
@ -211,7 +207,7 @@ const fileSettingPopup = ref(null);
const active = ref(0);
const activeMailTab = ref(0);
const tabs = [{ title: 'Allgemeines' }, { title: 'Beschreibung' }, { title: 'Formular' }, { title: 'Bestätigungs-E-Mail' }, { title: 'Export' }, { title: 'Prävention' }];
const tabs = [{ title: 'Allgemeines' }, { title: 'Formular' }, { title: 'Bestätigungs-E-Mail' }, { title: 'Export' }, { title: 'Prävention' }];
const mailTabs = [{ title: 'vor Daten' }, { title: 'nach Daten' }];
const allFields = computed(() => {

View File

@ -23,7 +23,6 @@
</ui-popup>
<page-filter breakpoint="lg">
<template #buttons>
<f-text id="search" v-model="innerFilter.search" name="search" label="Suchen" size="sm"></f-text>
<ui-icon-button icon="plus" @click="editing = {participant: null, preview: JSON.stringify(meta.form_config)}">Hinzufügen</ui-icon-button>
<f-switch v-if="meta.has_nami_field" id="group_participants" v-model="groupParticipants" label="Gruppieren" size="sm" name="group_participants"></f-switch>
<f-multipleselect id="active_columns" v-model="activeColumnsConfig" :options="meta.columns" label="Aktive Spalten" size="sm"></f-multipleselect>
@ -69,15 +68,7 @@
</page-filter>
<table cellspacing="0" cellpadding="0" border="0" class="custom-table custom-table-sm">
<thead>
<ui-th
v-for="column in activeColumns"
:key="column.id"
:column="column.id"
:label="column.name"
:value="getSort"
sortable
@update:model-value="setSort(column.id, {filter: toFilterString(innerFilter)})"
></ui-th>
<th v-for="column in activeColumns" :key="column.id" v-text="column.name"></th>
<th></th>
</thead>
@ -126,7 +117,7 @@
</template>
</table>
<div class="px-6">
<ui-pagination class="mt-4" :value="meta" @reload="reloadPage($event, {filter: toFilterString(innerFilter)})"></ui-pagination>
<ui-pagination class="mt-4" :value="meta" @reload="reloadPage"></ui-pagination>
</div>
</div>
</template>
@ -182,13 +173,6 @@ var { meta, data, reload, reloadPage, axios, remove, toFilterString, url, update
const activeColumns = computed(() => meta.value.columns.filter((c) => meta.value.form_meta.active_columns.includes(c.id)));
const getSort = computed(() => innerFilter.value.sort);
async function setSort(column) {
innerFilter.value.sort = getSort.value.by === column ? {by: column, direction: !getSort.value.direction} : {by: column, direction: false};
sortingConfig.value = innerFilter.value.sort;
}
const activeColumnsConfig = computed({
get: () => meta.value.form_meta.active_columns,
set: async (v) => {
@ -201,18 +185,6 @@ const activeColumnsConfig = computed({
},
});
const sortingConfig = computed({
get: () => meta.value.form_meta.sorting,
set: async (v) => {
const response = await axios.patch(meta.value.links.update_form_meta, {
...meta.value.form_meta,
sorting: v,
});
meta.value.form_meta = response.data;
},
});
async function handleDelete() {
await remove(deleting.value);
deleting.value = null;

View File

@ -74,7 +74,6 @@
</ui-popup>
<page-filter breakpoint="xl" :filterable="false">
<template #buttons>
<f-text id="search" :model-value="getFilter('search')" label="Suchen …" size="sm" @update:model-value="setFilter('search', $event)"></f-text>
<f-multipleselect
id="statuses"
:options="meta.statuses"
@ -115,7 +114,6 @@
<div class="flex space-x-2">
<ui-action-button tooltip="Anschauen" :href="invoice.links.pdf" class="btn-info" icon="eye" blank></ui-action-button>
<ui-action-button tooltip="Erinnerung anschauen" :href="invoice.links.rememberpdf" class="btn-info" icon="document" blank></ui-action-button>
<ui-action-button tooltip="Als Bezahlt markieren" class="btn-warning" icon="money" blank @click.prevent="markAsPaid(invoice)"></ui-action-button>
<ui-action-button :data-cy="`edit-button-${invoice.id}`" tooltip="Bearbeiten" class="btn-warning" icon="pencil" @click.prevent="edit(invoice)"></ui-action-button>
<ui-action-button tooltip="Löschen" class="btn-danger" icon="trash" @click.prevent="deleting = invoice"></ui-action-button>
</div>
@ -145,9 +143,4 @@ async function sendMassstore() {
await axios.post(meta.value.links['mass-store'], massstore.value);
massstore.value = null;
}
async function markAsPaid(invoice) {
await axios.patch(invoice.links.update, {...invoice, status: 'Rechnung beglichen'});
await reloadPage();
}
</script>

View File

@ -58,8 +58,7 @@
<f-select id="subscription_id" v-model="inner.subscription_id" :options="meta.subscriptions" label="Beitrag" name="subscription_id" size="sm"></f-select>
<f-switch id="has_nami" v-model="inner.has_nami" name="has_nami" size="sm" label="In Nami eintragen"></f-switch>
<f-switch id="send_newspaper" v-model="inner.send_newspaper" name="send_newspaper" label="Mittendrin versenden" size="sm"></f-switch>
<f-switch id="keepdata" v-model="inner.keepdata" name="keepdata" label="Datenweiterverwendung" size="sm"></f-switch>
<f-text id="joined_at" v-model="inner.joined_at" type="date" label="Eintrittsdatum" size="sm" required></f-text>
<f-text id="joined_at" v-model="inner.joined_at" class="sm:col-span-2" type="date" label="Eintrittsdatum" size="sm" required></f-text>
<f-textarea id="comment" v-model="inner.comment" :rows="3" class="col-span-2" label="Kommentar" size="sm"></f-textarea>
<div v-if="mode === 'create' || (original.has_nami === false && inner.has_nami === true)" class="contents">
<f-select

View File

@ -48,24 +48,6 @@
size="sm"
@update:model-value="setFilter('ausstand', $event)"
></f-switch>
<f-select
id="has_vk"
name="has_vk"
:model-value="getFilter('has_vk')"
label="Verhaltenskodex unterschrieben"
size="sm"
:options="meta.boolean_filter"
@update:model-value="setFilter('has_vk', $event)"
></f-select>
<f-select
id="has_svk"
name="has_svk"
:model-value="getFilter('has_svk')"
label="SVK unterschrieben"
size="sm"
:options="meta.boolean_filter"
@update:model-value="setFilter('has_svk', $event)"
></f-select>
<f-multipleselect
id="group_ids"
:options="meta.groups"

Some files were not shown because too many files have changed in this diff Show More