Added models, migrations and controllers

This commit adds the logical structure for the app.
This commit is contained in:
Miguel Nogueira 2020-04-29 18:15:54 +01:00
parent 70c7429e36
commit 7c22894e94
28 changed files with 522 additions and 0 deletions

10
app/Application.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Application extends Model
{
//
}

10
app/Appointment.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Appointment extends Model
{
//
}

10
app/Form.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Form extends Model
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ApplicationController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AppointmentController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class FormController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class LogController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ProfileController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ResponseController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class StaffProfileController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class VacancyController extends Controller
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class VoteController extends Controller
{
//
}

10
app/Log.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Log extends Model
{
//
}

10
app/Profile.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Profile extends Model
{
//
}

10
app/Response.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Response extends Model
{
//
}

10
app/StaffProfile.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class StaffProfile extends Model
{
//
}

10
app/Vacancy.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Vacancy extends Model
{
//
}

10
app/Vote.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Vote extends Model
{
//
}

View File

@ -15,9 +15,13 @@ class CreateUsersTable extends Migration
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('uuid'); // Mojang UUID
$table->string('name'); $table->string('name');
$table->string('email')->unique(); $table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('username'); // Mojang Username
$table->date('dob');
$table->ipAddress('originalIP');
$table->string('password'); $table->string('password');
$table->rememberToken(); $table->rememberToken();
$table->timestamps(); $table->timestamps();

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProfilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('profiles', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateApplicationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
/*
* One user can have one application, and one application can only have one user
* One form may have multiple responses, but a response may only have one form
* One application may only have one form response, but a response can have many applications
*/
Schema::create('applications', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVotesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('votes', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('votes');
}
}

View File

@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAppointmentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('appointments', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVacanciesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vacancies', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFormsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('forms', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('logs', function (Blueprint $table) {
$table->id();
$table->bigIncrements('userID');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('logs');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStaffProfilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('staff_profiles', function (Blueprint $table) {
$table->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');
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateResponsesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('responses', function (Blueprint $table) {
$table->id();
$table->bigIncrements('responseFormID');
$table->longText('responseData');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('responses');
}
}