Compare commits
	
		
			76 Commits
		
	
	
		
			4644f3832b
			...
			febb90e40e
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | febb90e40e | |
|  | e1271d25ea | |
|  | fe3720436f | |
|  | 099079f119 | |
|  | fea179fe7d | |
|  | 9be2a48db0 | |
|  | 2fa6d3fd42 | |
|  | 392f364e2f | |
|  | 312cd5b19e | |
|  | 2a330f911f | |
|  | da82cf6700 | |
|  | d5cee85928 | |
|  | c5518d6051 | |
|  | c7d8195e45 | |
|  | dc3c3f0b05 | |
|  | 4a865ee679 | |
|  | 69d39e8934 | |
|  | 54c25e7090 | |
|  | f651d0bf4d | |
|  | e7f2573bb4 | |
|  | 0f97f7e6bd | |
|  | d0afaba8e8 | |
|  | 9d5b44f050 | |
|  | 9367cdabf6 | |
|  | d1e65b2f6c | |
|  | f0c239055b | |
|  | d4992b2cd6 | |
|  | d282b865b5 | |
|  | c95eae60a5 | |
|  | db7c34751a | |
|  | 63120b1795 | |
|  | a98c9b7d4b | |
|  | ffed9f7ce3 | |
|  | 15b9847b72 | |
|  | 4aca886cd4 | |
|  | 2729ed40dc | |
|  | cbe53369e7 | |
|  | 1c5a9681b2 | |
|  | 74c0e7f6b7 | |
|  | d89a93ae9c | |
|  | c931b9b61b | |
|  | 4a686ff20e | |
|  | de5152ee95 | |
|  | f2a8bcd381 | |
|  | 7b40e942bd | |
|  | 5bd4eb36e7 | |
|  | 5fd5dd2da8 | |
|  | fc88910bd1 | |
|  | cf63884bdb | |
|  | 7bb09d76fa | |
|  | bfbad59df5 | |
|  | 591dc8ad55 | |
|  | 7a1d5d8769 | |
|  | 4abd16bb72 | |
|  | f7720a004d | |
|  | e7ec93e0d9 | |
|  | 143b1635de | |
|  | 90dc4fe9a9 | |
|  | 7b1e8cadb0 | |
|  | beb8e37eef | |
|  | 68aac8feef | |
|  | 48d045489b | |
|  | 9eb1a9963c | |
|  | f3318f4428 | |
|  | 063c3ad3ba | |
|  | 847aaf450a | |
|  | a4438c7b35 | |
|  | 8afdd4f124 | |
|  | ad2521ea5b | |
|  | e3cb08dbf8 | |
|  | 618fbafdcd | |
|  | 62313aa1d4 | |
|  | 8d16ba251b | |
|  | db32093621 | |
|  | da528fb09b | |
|  | e60ea9e92b | 
|  | @ -1,9 +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,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 | ||||
|  |  | |||
|  | @ -22,6 +22,7 @@ class InsertMemberAction | |||
|     { | ||||
|         $region = Region::firstWhere('nami_id', $member->regionId ?: -1); | ||||
| 
 | ||||
| 
 | ||||
|         $payload = [ | ||||
|             'firstname' => $member->firstname, | ||||
|             'lastname' => $member->lastname, | ||||
|  | @ -60,17 +61,7 @@ class InsertMemberAction | |||
|             } | ||||
|         } | ||||
| 
 | ||||
|         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, | ||||
|             ]); | ||||
|         }); | ||||
|         return Member::updateOrCreate(['nami_id' => $member->id], $payload); | ||||
|     } | ||||
| 
 | ||||
|     public function getSubscription(NamiMember $member): ?Subscription | ||||
|  |  | |||
|  | @ -34,7 +34,7 @@ class Activity extends Model | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsToMany<Subactivity, $this> | ||||
|      * @return BelongsToMany<Subactivity> | ||||
|      */ | ||||
|     public function subactivities(): BelongsToMany | ||||
|     { | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -129,7 +129,6 @@ class Principal implements PrincipalBackendInterface | |||
|      */ | ||||
|     public function findByUri($uri, $principalPrefix) | ||||
|     { | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -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); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -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); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -62,7 +62,7 @@ class Form extends Model implements HasMedia | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return HasMany<Participant, $this> | ||||
|      * @return HasMany<Participant> | ||||
|      */ | ||||
|     public function participants(): HasMany | ||||
|     { | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ class Participant extends Model implements Preventable | |||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Form, $this> | ||||
|      * @return BelongsTo<Form, self> | ||||
|      */ | ||||
|     public function form(): BelongsTo | ||||
|     { | ||||
|  | @ -41,7 +41,7 @@ class Participant extends Model implements Preventable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return HasMany<Participant, $this> | ||||
|      * @return HasMany<self> | ||||
|      */ | ||||
|     public function children(): HasMany | ||||
|     { | ||||
|  | @ -49,7 +49,7 @@ class Participant extends Model implements Preventable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Member, $this> | ||||
|      * @return BelongsTo<Member, self> | ||||
|      */ | ||||
|     public function member(): BelongsTo | ||||
|     { | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -18,7 +18,5 @@ class Authenticate extends Middleware | |||
|         if (!$request->expectsJson()) { | ||||
|             return route('login'); | ||||
|         } | ||||
| 
 | ||||
|         return null; | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -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')); | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
|  | @ -37,7 +37,7 @@ class Invoice extends Model | |||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * @return HasMany<InvoicePosition, $this> | ||||
|      * @return HasMany<InvoicePosition> | ||||
|      */ | ||||
|     public function positions(): HasMany | ||||
|     { | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -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); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -5,7 +5,6 @@ namespace App\Lib\Editor; | |||
| use Livewire\Wireable; | ||||
| use Spatie\LaravelData\Concerns\WireableData; | ||||
| use Spatie\LaravelData\Data; | ||||
| use Spatie\LaravelData\Support\EloquentCasts\DataEloquentCast; | ||||
| 
 | ||||
| /** @todo replace blocks with actual block data classes */ | ||||
| class EditorData extends Data implements Editorable, Wireable | ||||
|  | @ -88,13 +87,4 @@ class EditorData extends Data implements Editorable, Wireable | |||
|     { | ||||
|         return $this; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @param array<int, mixed> $arguments | ||||
|      * @return DataEloquentCast<self> | ||||
|      */ | ||||
|     public static function castUsing(array $arguments): DataEloquentCast | ||||
|     { | ||||
|         return new DataEloquentCast(static::class, $arguments); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -8,7 +8,7 @@ use Spatie\LaravelData\Data; | |||
| 
 | ||||
| /** | ||||
|  * @template T of Model | ||||
|  * @property Builder<T> $query | ||||
|  * @property Builder $query | ||||
|  */ | ||||
| abstract class ScoutFilter extends Data | ||||
| { | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ class Maildispatcher extends Model | |||
|     ]; | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Mailgateway, $this> | ||||
|      * @return BelongsTo<Mailgateway, self> | ||||
|      */ | ||||
|     public function gateway(): BelongsTo | ||||
|     { | ||||
|  |  | |||
|  | @ -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 | ||||
|  | @ -48,16 +47,6 @@ class NamiPutMemberAction | |||
|             '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, | ||||
|             ]), | ||||
|         ]); | ||||
|         $response = $api->putMember($namiMember, $activity ? $activity->nami_id : null, $subactivity ? $subactivity->nami_id : null); | ||||
|         Member::withoutEvents(function () use ($response, $member) { | ||||
|  |  | |||
|  | @ -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'; | ||||
| } | ||||
|  | @ -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, | ||||
|     ) { | ||||
|     } | ||||
|     ) {} | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -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 | ||||
|  | @ -196,7 +195,7 @@ class Member extends Model implements Geolocatable | |||
| 
 | ||||
|     // ---------------------------------- Relations ----------------------------------
 | ||||
|     /** | ||||
|      * @return BelongsTo<Country, $this> | ||||
|      * @return BelongsTo<Country, self> | ||||
|      */ | ||||
|     public function country(): BelongsTo | ||||
|     { | ||||
|  | @ -204,7 +203,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Gender, $this> | ||||
|      * @return BelongsTo<Gender, self> | ||||
|      */ | ||||
|     public function gender(): BelongsTo | ||||
|     { | ||||
|  | @ -212,7 +211,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Region, $this> | ||||
|      * @return BelongsTo<Region, self> | ||||
|      */ | ||||
|     public function region(): BelongsTo | ||||
|     { | ||||
|  | @ -223,7 +222,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return HasMany<InvoicePosition, $this> | ||||
|      * @return HasMany<InvoicePosition> | ||||
|      */ | ||||
|     public function invoicePositions(): HasMany | ||||
|     { | ||||
|  | @ -231,7 +230,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Confession, $this> | ||||
|      * @return BelongsTo<Confession, self> | ||||
|      */ | ||||
|     public function confession(): BelongsTo | ||||
|     { | ||||
|  | @ -239,7 +238,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Nationality, $this> | ||||
|      * @return BelongsTo<Nationality, self> | ||||
|      */ | ||||
|     public function nationality(): BelongsTo | ||||
|     { | ||||
|  | @ -247,7 +246,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Subscription, $this> | ||||
|      * @return BelongsTo<Subscription, self> | ||||
|      */ | ||||
|     public function subscription(): BelongsTo | ||||
|     { | ||||
|  | @ -255,7 +254,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return BelongsTo<Group, $this> | ||||
|      * @return BelongsTo<Group, self> | ||||
|      */ | ||||
|     public function group(): BelongsTo | ||||
|     { | ||||
|  | @ -263,7 +262,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return HasMany<CourseMember, $this> | ||||
|      * @return HasMany<CourseMember> | ||||
|      */ | ||||
|     public function courses(): HasMany | ||||
|     { | ||||
|  | @ -271,7 +270,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return HasMany<Membership, $this> | ||||
|      * @return HasMany<Membership> | ||||
|      */ | ||||
|     public function memberships(): HasMany | ||||
|     { | ||||
|  | @ -279,7 +278,7 @@ class Member extends Model implements Geolocatable | |||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return HasMany<Membership, $this> | ||||
|      * @return HasMany<Membership> | ||||
|      */ | ||||
|     public function leaderMemberships(): HasMany | ||||
|     { | ||||
|  | @ -287,34 +286,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(); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -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 | ||||
|     { | ||||
|  |  | |||
|  | @ -3,8 +3,8 @@ | |||
| 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 | ||||
|  |  | |||
|  | @ -81,12 +81,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", | ||||
|         "qossmic/deptrac": "^2.0" | ||||
|     }, | ||||
|     "config": { | ||||
|  |  | |||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -1,6 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| return [ | ||||
|     'email' => env('USER_EMAIL', 'admin@example.com'), | ||||
|     'password' => env('USER_PASSWORD', 'admin'), | ||||
| ]; | ||||
|  | @ -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]); | ||||
|     } | ||||
| } | ||||
|  | @ -93,13 +93,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([ | ||||
|  |  | |||
|  | @ -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'); | ||||
|     } | ||||
| }; | ||||
|  | @ -16,9 +16,9 @@ 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')), | ||||
|             'password' => Hash::make(env('USER_PASSWORD', 'admin')), | ||||
|             'name' => 'Adrema Benutzer', | ||||
|         ]); | ||||
|     } | ||||
|  |  | |||
|  | @ -73,17 +73,6 @@ abstract class Type extends Data implements Wireable | |||
|         ])->toArray(); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @return mixed | ||||
|      */ | ||||
|     public function toResource() | ||||
|     { | ||||
|         return [ | ||||
|             'cls' => get_class($this), | ||||
|             'params' => get_object_vars($this), | ||||
|         ]; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @param Collection<int, MailEntry> $results | ||||
|      */ | ||||
|  |  | |||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -1 +1 @@ | |||
| Subproject commit f905c316ee7913cbf85c386021fbaa28b4b2a158 | ||||
| Subproject commit bc61530e510b3d41048984b7cf20b6d82c4f85fb | ||||
|  | @ -1 +1 @@ | |||
| Subproject commit ed283d97ca7680b3c27b2d75da9937f4f379e321 | ||||
| Subproject commit 74800de149bf2ca250a17263cfaf59e48b76186f | ||||
							
								
								
									
										53
									
								
								phpstan.neon
								
								
								
								
							
							
						
						
									
										53
									
								
								phpstan.neon
								
								
								
								
							|  | @ -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 | ||||
|  |  | |||
|  | @ -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> | ||||
|  |  | |||
|  | @ -7,11 +7,11 @@ use App\Actions\PullMembershipsAction; | |||
| use App\Activity; | ||||
| use App\Confession; | ||||
| use App\Country; | ||||
| use App\Gender; | ||||
| use App\Fee; | ||||
| use App\Group; | ||||
| use App\Member\Actions\NamiPutMemberAction; | ||||
| use App\Member\BankAccount; | ||||
| use App\Member\Member; | ||||
| use App\Nationality; | ||||
| use App\Payment\Subscription; | ||||
| use App\Region; | ||||
| use App\Subactivity; | ||||
|  | @ -20,130 +20,52 @@ use Phake; | |||
| use Zoomyboy\LaravelNami\Fakes\MemberFake; | ||||
| 
 | ||||
| uses(DatabaseTransactions::class); | ||||
| covers(NamiPutMemberAction::class); | ||||
| 
 | ||||
| beforeEach(function () { | ||||
| it('testItPutsAMember', function (array $memberAttributes, array $storedAttributes) { | ||||
|     Fee::factory()->create(); | ||||
|     $this->stubIo(PullMemberAction::class, fn ($mock) => $mock); | ||||
|     $this->stubIo(PullMembershipsAction::class, fn ($mock) => $mock); | ||||
|     Group::factory()->inNami(55)->create(); | ||||
|     $this->withoutExceptionHandling()->login()->loginNami(); | ||||
|     $country = Country::factory()->create(); | ||||
|     $region = Region::factory()->create(); | ||||
|     $nationality = Nationality::factory()->inNami(565)->create(); | ||||
|     $subscription = Subscription::factory()->forFee()->create(); | ||||
|     $group = Group::factory()->inNami(55)->create(); | ||||
|     $confession = Confession::factory()->inNami(567)->create(['is_null' => true]); | ||||
|     app(MemberFake::class)->stores(55, 993); | ||||
|     Confession::factory()->inNami(567)->create(['is_null' => true]); | ||||
|     $activity = Activity::factory()->inNami(6)->create(); | ||||
|     Subactivity::factory()->hasAttached($activity)->inNami(55)->create(); | ||||
| }); | ||||
|     $activity = Activity::factory()->hasAttached(Subactivity::factory()->name('Biber')->inNami(55))->name('Leiter')->inNami(6)->create(); | ||||
|     $subactivity = $activity->subactivities->first(); | ||||
| 
 | ||||
| it('pulls member and memberships befre pushing', function () { | ||||
|     $member = Member::factory()->defaults()->create(); | ||||
|     $member = Member::factory() | ||||
|         ->for($country) | ||||
|         ->for($subscription) | ||||
|         ->for($region) | ||||
|         ->for($nationality) | ||||
|         ->for($group) | ||||
|         ->emailBillKind() | ||||
|         ->create($memberAttributes); | ||||
| 
 | ||||
|     NamiPutMemberAction::run($member, Activity::first(), Subactivity::first()); | ||||
|     NamiPutMemberAction::run($member, $activity, $subactivity); | ||||
| 
 | ||||
|     app(MemberFake::class)->assertStored(55, [ | ||||
|         'ersteTaetigkeitId' => 6, | ||||
|         'ersteUntergliederungId' => 55, | ||||
|         'konfessionId' => 567, | ||||
|         ...$storedAttributes, | ||||
|     ]); | ||||
|     $this->assertDatabaseHas('members', [ | ||||
|         'nami_id' => 993, | ||||
|     ]); | ||||
|     Phake::verify(app(PullMemberAction::class))->handle(55, 993); | ||||
|     Phake::verify(app(PullMembershipsAction::class))->handle($member); | ||||
| }); | ||||
| 
 | ||||
| it('sets nami id of member', function () { | ||||
|     $member = Member::factory()->defaults()->create(); | ||||
| 
 | ||||
|     NamiPutMemberAction::run($member, Activity::first(), Subactivity::first()); | ||||
| 
 | ||||
|     $this->assertDatabaseHas('members', ['nami_id' => 993]); | ||||
| }); | ||||
| 
 | ||||
| it('stores member attributes', function (array $memberAttributes, array $storedAttributes) { | ||||
|     $member = Member::factory()->defaults()->create($memberAttributes); | ||||
| 
 | ||||
|     NamiPutMemberAction::run($member, Activity::first(), Subactivity::first()); | ||||
| 
 | ||||
|     app(MemberFake::class)->assertStored(55, $storedAttributes); | ||||
| })->with([ | ||||
|     [['firstname' => 'Phi'], ['vorname' => 'Phi']], | ||||
|     [['lastname' => 'Phi'], ['nachname' => 'Phi']], | ||||
|     [['nickname' => 'Nick'], ['spitzname' => 'Nick']], | ||||
|     [['email' => 'a@b.de'], ['email' => 'a@b.de']], | ||||
|     [['zip' => '5566'], ['plz' => '5566']], | ||||
|     [['location' => 'SG'], ['ort' => 'SG']], | ||||
|     [['further_address' => 'SG'], ['nameZusatz' => 'SG']], | ||||
|     [['other_country' => 'SG'], ['staatsangehoerigkeitText' => 'SG']], | ||||
|     [['address' => 'Add'], ['strasse' => 'Add']], | ||||
|     [['main_phone' => '+49 212 5566234'], ['telefon1' => '+49 212 5566234']], | ||||
|     [['mobile_phone' => '+49 212 5566234'], ['telefon2' => '+49 212 5566234']], | ||||
|     [['work_phone' => '+49 212 5566234'], ['telefon3' => '+49 212 5566234']], | ||||
|     [['email_parents' => 'a@b.de'], ['emailVertretungsberechtigter' => 'a@b.de']], | ||||
|     [['keepdata' => true], ['wiederverwendenFlag' => true]], | ||||
|     [['keepdata' => false], ['wiederverwendenFlag' => false]], | ||||
|     fn () => [['joined_at' => now()], ['eintrittsdatum' => now()->format('Y-m-d') . ' 00:00:00']], | ||||
|     [['fax' => '555'], ['telefax' => '555']], | ||||
|     [[], ['konfessionId' => 567]], | ||||
|     [[], ['ersteTaetigkeitId' => 6]], | ||||
|     [[], ['ersteUntergliederungId' => 55]], | ||||
|     [ | ||||
|         ['email_parents' => 'a@b.de'], ['emailVertretungsberechtigter' => 'a@b.de'], | ||||
|     ], | ||||
|     [ | ||||
|         ['keepdata' => true], ['wiederverwendenFlag' => true], | ||||
|     ], | ||||
|     [ | ||||
|         ['keepdata' => false], ['wiederverwendenFlag' => false], | ||||
|     ], | ||||
| ]); | ||||
| 
 | ||||
| it('stores related models', function () { | ||||
|     Subscription::factory()->forFee(3)->create(); | ||||
|     $member = Member::factory()->defaults() | ||||
|         ->for(Country::factory()->inNami(1)->create()) | ||||
|         ->for(Region::factory()->inNami(2)->create()) | ||||
|         ->for(Gender::factory()->inNami(4)->create()) | ||||
|         ->create(); | ||||
| 
 | ||||
|     NamiPutMemberAction::run($member, Activity::first(), Subactivity::first()); | ||||
| 
 | ||||
|     app(MemberFake::class)->assertStored(55, ['regionId' => 2, 'landId' => 1, 'beitragsartId' => 3, 'geschlechtId' => 4]); | ||||
| }); | ||||
| 
 | ||||
| it('stores bank account with empty values', function () { | ||||
|     $member = Member::factory()->defaults()->create(['mitgliedsnr' => 56]); | ||||
| 
 | ||||
|     NamiPutMemberAction::run($member, Activity::first(), Subactivity::first()); | ||||
| 
 | ||||
|     app(MemberFake::class)->assertStored(55, ['kontoverbindung' => json_encode([ | ||||
|         'id' => '', | ||||
|         'zahlungsKonditionId' => null, | ||||
|         'mitgliedsNummer' => 56, | ||||
|         'institut' => '', | ||||
|         'kontoinhaber' => '', | ||||
|         'kontonummer' => '', | ||||
|         'bankleitzahl' => '', | ||||
|         'iban' => '', | ||||
|         'bic' => '' | ||||
|     ])]); | ||||
| }); | ||||
| 
 | ||||
| it('updates existing member', function () { | ||||
|     app(MemberFake::class)->updatesSuccessfully(55, 103)->shows(55, 103); | ||||
|     $member = Member::factory()->defaults()->inNami(103)->create(['version' => 50]); | ||||
| 
 | ||||
|     NamiPutMemberAction::run($member, Activity::first(), Subactivity::first()); | ||||
| 
 | ||||
|     app(MemberFake::class)->assertUpdated(55, 103, ['id' => 103, 'version' => 50]); | ||||
| }); | ||||
| 
 | ||||
| it('updates bank account with filled values', function () { | ||||
|     app(MemberFake::class)->updatesSuccessfully(55, 103)->shows(55, 103); | ||||
|     $member = Member::factory()->defaults() | ||||
|         ->withBankAccount(BankAccount::factory()->inNami(30)->state([ | ||||
|             'bank_name' => 'Stadt', | ||||
|             'bic' => 'SOLSDE33', | ||||
|             'iban' => 'DE50', | ||||
|             'blz' => 'ssss', | ||||
|             'person' => 'Pill', | ||||
|             'account_number' => 'ddf', | ||||
|         ])) | ||||
|         ->inNami(103) | ||||
|         ->create(['mitgliedsnr' => 56]); | ||||
| 
 | ||||
|     NamiPutMemberAction::run($member, Activity::first(), Subactivity::first()); | ||||
| 
 | ||||
|     app(MemberFake::class)->assertUpdated(55, 103, ['kontoverbindung' => json_encode([ | ||||
|         'id' => 30, | ||||
|         'zahlungsKonditionId' => null, | ||||
|         'mitgliedsNummer' => 56, | ||||
|         'institut' => 'Stadt', | ||||
|         'kontoinhaber' => 'Pill', | ||||
|         'kontonummer' => 'ddf', | ||||
|         'bankleitzahl' => 'ssss', | ||||
|         'iban' => 'DE50', | ||||
|         'bic' => 'SOLSDE33' | ||||
|     ])]); | ||||
| }); | ||||
|  |  | |||
|  | @ -88,26 +88,6 @@ it('testFetchWiederverwendenFlag', function (array $memberAttributes, array $sto | |||
|     [['regionId' => 999], ['region_id' => null]] | ||||
| ]); | ||||
| 
 | ||||
| it('testFetchesKontoverbindung', function (array $memberAttributes, array $storedAttributes) { | ||||
|     $this->loginNami(); | ||||
|     Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]); | ||||
|     app(MemberFake::class)->shows(1000, 1001, $memberAttributes); | ||||
| 
 | ||||
|     app(PullMemberAction::class)->handle(1000, 1001); | ||||
| 
 | ||||
|     $this->assertDatabaseHas('bank_accounts', [ | ||||
|         'member_id' => Member::first()->id, | ||||
|         ...$storedAttributes | ||||
|     ]); | ||||
| })->with([ | ||||
|     [['kontoverbindung' => ['iban' => '3300', 'bic' => 'SOLSDE']], ['iban' => '3300', 'bic' => 'SOLSDE']], | ||||
|     [['kontoverbindung' => ['id' => 33003]], ['nami_id' => 33003]], | ||||
|     [['kontoverbindung' => ['blz' => 111]], ['blz' => 111]], | ||||
|     [['kontoverbindung' => ['institut' => 'Sparkasse']], ['bank_name' => 'Sparkasse']], | ||||
|     [['kontoverbindung' => ['kontoinhaber' => 'Max']], ['person' => 'Max']], | ||||
|     [['kontoverbindung' => ['kontonummer' => '333']], ['account_number' => '333']], | ||||
| ]); | ||||
| 
 | ||||
| it('testItSetsFirstSubscriptionFromFee', function () { | ||||
|     $this->loginNami(); | ||||
|     Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]); | ||||
|  |  | |||
|  | @ -35,10 +35,10 @@ class InitializeGroupsTest extends TestCase | |||
|     public function testItSynchsAGroupWithASingleNodeAndNoChildren(): void | ||||
|     { | ||||
|         $parentGroup = Group::from(['id' => 150, 'name' => 'lorem', 'parentId' => null]); | ||||
|         $this->api->method('groups')->willReturnMap([ | ||||
|         $this->api->method('groups')->will($this->returnValueMap([ | ||||
|             [null, collect([$parentGroup])], | ||||
|             [$parentGroup, collect([])], | ||||
|         ]); | ||||
|         ])); | ||||
|         $this->api->method('groups')->willReturn(collect([])); | ||||
| 
 | ||||
|         (new InitializeGroups($this->api))->handle(); | ||||
|  | @ -55,10 +55,10 @@ class InitializeGroupsTest extends TestCase | |||
|     { | ||||
|         $existingGroup = GroupModel::factory()->create(['nami_id' => 150, 'inner_name' => 'Def']); | ||||
|         $parentGroup = Group::from(['id' => 150, 'name' => 'lorem', 'parentId' => null]); | ||||
|         $this->api->method('groups')->willReturnMap([ | ||||
|         $this->api->method('groups')->will($this->returnValueMap([ | ||||
|             [null, collect([$parentGroup])], | ||||
|             [$parentGroup, collect([])], | ||||
|         ]); | ||||
|         ])); | ||||
| 
 | ||||
|         (new InitializeGroups($this->api))->handle(); | ||||
| 
 | ||||
|  | @ -75,11 +75,11 @@ class InitializeGroupsTest extends TestCase | |||
|     { | ||||
|         $parentGroup = Group::from(['id' => 150, 'name' => 'lorem', 'parentId' => null]); | ||||
|         $subgroup = Group::from(['id' => 200, 'name' => 'subgroup', 'parentId' => 150]); | ||||
|         $this->api->method('groups')->willReturnMap([ | ||||
|         $this->api->method('groups')->will($this->returnValueMap([ | ||||
|             [null, collect([$parentGroup])], | ||||
|             [$parentGroup, collect([$subgroup])], | ||||
|             [$subgroup, collect([])], | ||||
|         ]); | ||||
|         ])); | ||||
| 
 | ||||
|         (new InitializeGroups($this->api))->handle(); | ||||
| 
 | ||||
|  | @ -94,12 +94,12 @@ class InitializeGroupsTest extends TestCase | |||
|         $parentGroup = Group::from(['id' => 150, 'name' => 'lorem', 'parentId' => null]); | ||||
|         $subgroup = Group::from(['id' => 200, 'name' => 'subgroup', 'parentId' => 150]); | ||||
|         $subsubgroup = Group::from(['id' => 250, 'name' => 'subsubgroup', 'parentId' => 200]); | ||||
|         $this->api->method('groups')->willReturnMap([ | ||||
|         $this->api->method('groups')->will($this->returnValueMap([ | ||||
|             [null, collect([$parentGroup])], | ||||
|             [$parentGroup, collect([$subgroup])], | ||||
|             [$subgroup, collect([$subsubgroup])], | ||||
|             [$subsubgroup, collect([])], | ||||
|         ]); | ||||
|         ])); | ||||
| 
 | ||||
|         (new InitializeGroups($this->api))->handle(); | ||||
| 
 | ||||
|  | @ -111,11 +111,11 @@ class InitializeGroupsTest extends TestCase | |||
|         $existingSubgroup = GroupModel::factory()->create(['name' => 'Abc', 'inner_name' => 'Def', 'nami_id' => 200]); | ||||
|         $parentGroup = Group::from(['id' => 150, 'name' => 'root', 'parentId' => null]); | ||||
|         $subgroup = Group::from(['id' => 200, 'name' => 'child', 'parentId' => 150]); | ||||
|         $this->api->method('groups')->willReturnMap([ | ||||
|         $this->api->method('groups')->will($this->returnValueMap([ | ||||
|             [null, collect([$parentGroup])], | ||||
|             [$parentGroup, collect([$subgroup])], | ||||
|             [$subgroup, collect([])], | ||||
|         ]); | ||||
|         ])); | ||||
| 
 | ||||
|         (new InitializeGroups($this->api))->handle(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,35 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace Illuminate\Contracts\Database\Eloquent; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| /** | ||||
|  * @template TGet | ||||
|  * @template TSet | ||||
|  * @copy | ||||
|  */ | ||||
| interface CastsAttributes | ||||
| { | ||||
|     /** | ||||
|      * Transform the attribute from the underlying model values. | ||||
|      * | ||||
|      * @param  \Illuminate\Database\Eloquent\Model  $model | ||||
|      * @param  string  $key | ||||
|      * @param  mixed  $value | ||||
|      * @param  array<string, mixed>  $attributes | ||||
|      * @return TGet|null | ||||
|      */ | ||||
|     public function get(Model $model, string $key, mixed $value, array $attributes); | ||||
| 
 | ||||
|     /** | ||||
|      * Transform the attribute to its underlying model values. | ||||
|      * | ||||
|      * @param  \Illuminate\Database\Eloquent\Model  $model | ||||
|      * @param  string  $key | ||||
|      * @param  TSet|null  $value | ||||
|      * @param  array<string, mixed>  $attributes | ||||
|      * @return mixed | ||||
|      */ | ||||
|     public function set(Model $model, string $key, mixed $value, array $attributes); | ||||
| } | ||||
|  | @ -1,13 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace Spatie\LaravelData\Support\EloquentCasts; | ||||
| 
 | ||||
| use Illuminate\Contracts\Database\Eloquent\CastsAttributes; | ||||
| 
 | ||||
| /** | ||||
|  * @template TDto | ||||
|  * @implements CastsAttributes<TDto, TDto> | ||||
|  */ | ||||
| class DataEloquentCast implements CastsAttributes | ||||
| { | ||||
| } | ||||
|  | @ -1,11 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace Symfony\Component\HttpFoundation\File; | ||||
| 
 | ||||
| /** | ||||
|  * @copy | ||||
|  */ | ||||
| class File | ||||
| { | ||||
| 
 | ||||
| } | ||||
		Loading…
	
		Reference in New Issue