diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..a833d36d --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "printWidth": 120, + "singleQuote": true, + "tabWidth": 4, + "quoteProps": "consistent", + "bracketSpacing": false +} diff --git a/app/Member/Member.php b/app/Member/Member.php index f9f0c5f0..46b7909d 100644 --- a/app/Member/Member.php +++ b/app/Member/Member.php @@ -34,7 +34,7 @@ class Member extends Model use Notifiable; use HasFactory; - public $fillable = ['firstname', 'lastname', 'nickname', 'other_country', 'birthday', 'joined_at', 'send_newspaper', 'address', 'further_address', 'zip', 'location', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'nami_id', 'group_id', 'letter_address', 'country_id', 'way_id', 'nationality_id', 'subscription_id', 'region_id', 'gender_id', 'confession_id', 'letter_address', 'bill_kind_id', 'version', 'first_subactivity_id', 'first_activity_id', 'confirmed_at', 'children_phone', 'efz']; + public $fillable = ['firstname', 'lastname', 'nickname', 'other_country', 'birthday', 'joined_at', 'send_newspaper', 'address', 'further_address', 'zip', 'location', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'nami_id', 'group_id', 'letter_address', 'country_id', 'way_id', 'nationality_id', 'subscription_id', 'region_id', 'gender_id', 'confession_id', 'letter_address', 'bill_kind_id', 'version', 'first_subactivity_id', 'first_activity_id', 'confirmed_at', 'children_phone', 'efz', 'ps_at', 'more_ps_at', 'has_svk', 'has_vk', 'without_education_at', 'without_efz_at', 'multiply_pv', 'multiply_more_pv']; public $dates = ['try_created_at', 'joined_at', 'birthday']; @@ -48,6 +48,10 @@ class Member extends Model 'confession_id' => 'integer', 'nami_id' => 'integer', 'is_confirmed' => 'boolean', + 'has_svk' => 'boolean', + 'has_vk' => 'boolean', + 'multiply_pv' => 'boolean', + 'multiply_more_pv' => 'boolean', ]; public function scopeSearch(Builder $q, ?string $text): Builder diff --git a/app/Member/MemberRequest.php b/app/Member/MemberRequest.php index c1a4a779..3cf5ea43 100644 --- a/app/Member/MemberRequest.php +++ b/app/Member/MemberRequest.php @@ -77,7 +77,7 @@ class MemberRequest extends FormRequest CreateJob::dispatch($member, auth()->user()); } if ($this->input('has_nami') && null !== $member->nami_id) { - UpdateJob::dispatch($member, auth()->user()); + UpdateJob::dispatch($member->fresh(), auth()->user()); } if (!$this->input('has_nami') && null !== $member->nami_id) { DeleteJob::dispatch($member, auth()->user()); diff --git a/app/Member/MemberResource.php b/app/Member/MemberResource.php index 3ecedb63..5878fc34 100644 --- a/app/Member/MemberResource.php +++ b/app/Member/MemberResource.php @@ -63,6 +63,14 @@ class MemberResource extends JsonResource 'courses' => CourseResource::collection($this->whenLoaded('courses')), 'efz' => $this->efz, 'efz_link' => $this->getEfzLink(), + 'ps_at' => $this->ps_at, + 'more_ps_at' => $this->more_ps_at, + 'has_svk' => $this->has_svk, + 'has_vk' => $this->has_vk, + 'without_education_at' => $this->without_education_at, + 'without_efz_at' => $this->without_efz_at, + 'multiply_pv' => $this->multiply_pv, + 'multiply_more_pv' => $this->multiply_more_pv, ]; } } diff --git a/database/migrations/2022_04_28_203444_create_members_prevention_column.php b/database/migrations/2022_04_28_203444_create_members_prevention_column.php new file mode 100644 index 00000000..ac8599f8 --- /dev/null +++ b/database/migrations/2022_04_28_203444_create_members_prevention_column.php @@ -0,0 +1,37 @@ +date('ps_at')->nullable(); + $table->date('more_ps_at')->nullable(); + $table->date('without_education_at')->nullable(); + $table->date('without_efz_at')->nullable(); + $table->boolean('has_svk')->default(false); + $table->boolean('has_vk')->default(false); + $table->boolean('multiply_pv')->default(false); + $table->boolean('multiply_more_pv')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('members', function (Blueprint $table) { + }); + } +}; diff --git a/resources/js/views/member/VForm.vue b/resources/js/views/member/VForm.vue index 1e334c77..fb0b3a6a 100644 --- a/resources/js/views/member/VForm.vue +++ b/resources/js/views/member/VForm.vue @@ -3,10 +3,26 @@
@@ -23,14 +39,44 @@