From 7c22894e94184ef059654d63391f05cda9ec0d9b Mon Sep 17 00:00:00 2001 From: Miguel N Date: Wed, 29 Apr 2020 18:15:54 +0100 Subject: [PATCH] Added models, migrations and controllers This commit adds the logical structure for the app. --- app/Application.php | 10 ++++ app/Appointment.php | 10 ++++ app/Form.php | 10 ++++ .../Controllers/ApplicationController.php | 10 ++++ .../Controllers/AppointmentController.php | 10 ++++ app/Http/Controllers/FormController.php | 10 ++++ app/Http/Controllers/LogController.php | 10 ++++ app/Http/Controllers/ProfileController.php | 10 ++++ app/Http/Controllers/ResponseController.php | 10 ++++ .../Controllers/StaffProfileController.php | 10 ++++ app/Http/Controllers/VacancyController.php | 10 ++++ app/Http/Controllers/VoteController.php | 10 ++++ app/Log.php | 10 ++++ app/Profile.php | 10 ++++ app/Response.php | 10 ++++ app/StaffProfile.php | 10 ++++ app/Vacancy.php | 10 ++++ app/Vote.php | 10 ++++ .../2014_10_12_000000_create_users_table.php | 4 ++ ...020_04_29_022245_create_profiles_table.php | 41 +++++++++++++++++ ...04_29_022402_create_applications_table.php | 45 ++++++++++++++++++ .../2020_04_29_022421_create_votes_table.php | 31 +++++++++++++ ...04_29_022442_create_appointments_table.php | 46 +++++++++++++++++++ ...20_04_29_022642_create_vacancies_table.php | 37 +++++++++++++++ .../2020_04_29_023317_create_forms_table.php | 37 +++++++++++++++ .../2020_04_29_023554_create_logs_table.php | 32 +++++++++++++ ..._29_023647_create_staff_profiles_table.php | 36 +++++++++++++++ ...20_04_29_030107_create_responses_table.php | 33 +++++++++++++ 28 files changed, 522 insertions(+) create mode 100644 app/Application.php create mode 100644 app/Appointment.php create mode 100644 app/Form.php create mode 100644 app/Http/Controllers/ApplicationController.php create mode 100644 app/Http/Controllers/AppointmentController.php create mode 100644 app/Http/Controllers/FormController.php create mode 100644 app/Http/Controllers/LogController.php create mode 100644 app/Http/Controllers/ProfileController.php create mode 100644 app/Http/Controllers/ResponseController.php create mode 100644 app/Http/Controllers/StaffProfileController.php create mode 100644 app/Http/Controllers/VacancyController.php create mode 100644 app/Http/Controllers/VoteController.php create mode 100644 app/Log.php create mode 100644 app/Profile.php create mode 100644 app/Response.php create mode 100644 app/StaffProfile.php create mode 100644 app/Vacancy.php create mode 100644 app/Vote.php create mode 100644 database/migrations/2020_04_29_022245_create_profiles_table.php create mode 100644 database/migrations/2020_04_29_022402_create_applications_table.php create mode 100644 database/migrations/2020_04_29_022421_create_votes_table.php create mode 100644 database/migrations/2020_04_29_022442_create_appointments_table.php create mode 100644 database/migrations/2020_04_29_022642_create_vacancies_table.php create mode 100644 database/migrations/2020_04_29_023317_create_forms_table.php create mode 100644 database/migrations/2020_04_29_023554_create_logs_table.php create mode 100644 database/migrations/2020_04_29_023647_create_staff_profiles_table.php create mode 100644 database/migrations/2020_04_29_030107_create_responses_table.php diff --git a/app/Application.php b/app/Application.php new file mode 100644 index 0000000..c0b8274 --- /dev/null +++ b/app/Application.php @@ -0,0 +1,10 @@ +id(); + $table->string('uuid'); // Mojang UUID $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); + $table->string('username'); // Mojang Username + $table->date('dob'); + $table->ipAddress('originalIP'); $table->string('password'); $table->rememberToken(); $table->timestamps(); diff --git a/database/migrations/2020_04_29_022245_create_profiles_table.php b/database/migrations/2020_04_29_022245_create_profiles_table.php new file mode 100644 index 0000000..c8def1c --- /dev/null +++ b/database/migrations/2020_04_29_022245_create_profiles_table.php @@ -0,0 +1,41 @@ +id(); + $table->string('profileShortBio'); + $table->text('profileAboutMe'); + $table->enum('avatarPreference', [ + 'crafatar', // Mojang Profile + 'gravatar' // Email profile + ]); + $table->text('socialLinks'); + $table->bigIncrements('userID'); + $table->timestamps(); + + $table->foreign('userID')->references('id')->on('users')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('profiles'); + } +} diff --git a/database/migrations/2020_04_29_022402_create_applications_table.php b/database/migrations/2020_04_29_022402_create_applications_table.php new file mode 100644 index 0000000..25adbb6 --- /dev/null +++ b/database/migrations/2020_04_29_022402_create_applications_table.php @@ -0,0 +1,45 @@ +id(); + $table->bigIncrements('applicantUserID'); // 1-1 + $table->bigIncrements('applicantFormResponseID'); // 1-* + $table->enum('applicationStatus', [ + 'STAGE_SUBMITTED', + 'STAGE_PEERAPPROVAL', + 'STAGE_INTERVIEW', + 'APPROVED', + 'DENIED' + ]); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('applications'); + } +} diff --git a/database/migrations/2020_04_29_022421_create_votes_table.php b/database/migrations/2020_04_29_022421_create_votes_table.php new file mode 100644 index 0000000..ebe6980 --- /dev/null +++ b/database/migrations/2020_04_29_022421_create_votes_table.php @@ -0,0 +1,31 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('votes'); + } +} diff --git a/database/migrations/2020_04_29_022442_create_appointments_table.php b/database/migrations/2020_04_29_022442_create_appointments_table.php new file mode 100644 index 0000000..9dbeb89 --- /dev/null +++ b/database/migrations/2020_04_29_022442_create_appointments_table.php @@ -0,0 +1,46 @@ +id(); + $table->string('appointmentDescription'); + $table->dateTime('appointmentDate'); + $table->bigInteger('applicationID')->unsigned(); + $table->enum('appointmentLocation', [ + 'ZOOM', + 'DISCORD', + 'SKYPE', + 'MEET', + 'TEAMSPEAK' + ]); + $table->enum('appointmentStatus', [ + 'SCHEDULED', + 'CONCLUDED' + ])->default('SCHEDULED'); + $table->text('meetingNotes'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('appointments'); + } +} diff --git a/database/migrations/2020_04_29_022642_create_vacancies_table.php b/database/migrations/2020_04_29_022642_create_vacancies_table.php new file mode 100644 index 0000000..a2d8907 --- /dev/null +++ b/database/migrations/2020_04_29_022642_create_vacancies_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('vacancyName'); + $table->longText('vacancyDescription'); + $table->string('permissionGroupName'); + $table->string('discordRoleID'); + $table->bigIncrements('vacancyFormID'); + $table->integer('vacancyCount')->default(3); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('vacancies'); + } +} diff --git a/database/migrations/2020_04_29_023317_create_forms_table.php b/database/migrations/2020_04_29_023317_create_forms_table.php new file mode 100644 index 0000000..610a6d7 --- /dev/null +++ b/database/migrations/2020_04_29_023317_create_forms_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('formName'); + $table->string('formStructure'); + $table->enum('formStatus', [ + 'ACTIVE', + 'SUSPENDED' + ]); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('forms'); + } +} diff --git a/database/migrations/2020_04_29_023554_create_logs_table.php b/database/migrations/2020_04_29_023554_create_logs_table.php new file mode 100644 index 0000000..c797cf1 --- /dev/null +++ b/database/migrations/2020_04_29_023554_create_logs_table.php @@ -0,0 +1,32 @@ +id(); + $table->bigIncrements('userID'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('logs'); + } +} diff --git a/database/migrations/2020_04_29_023647_create_staff_profiles_table.php b/database/migrations/2020_04_29_023647_create_staff_profiles_table.php new file mode 100644 index 0000000..07f43e1 --- /dev/null +++ b/database/migrations/2020_04_29_023647_create_staff_profiles_table.php @@ -0,0 +1,36 @@ +id(); + $table->bigIncrements('userID'); + $table->dateTime('approvalDate'); + $table->dateTime('terminationDate')->nullable(); + $table->dateTime('resignationDate')->nullable(); + $table->text('memberNotes')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('staff_profiles'); + } +} diff --git a/database/migrations/2020_04_29_030107_create_responses_table.php b/database/migrations/2020_04_29_030107_create_responses_table.php new file mode 100644 index 0000000..83fe6bd --- /dev/null +++ b/database/migrations/2020_04_29_030107_create_responses_table.php @@ -0,0 +1,33 @@ +id(); + $table->bigIncrements('responseFormID'); + $table->longText('responseData'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('responses'); + } +}