diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 566e51d..c8ea461 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -21,14 +21,18 @@ public function create(array $input): User { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], + 'username' => ['required', 'string', 'max:255', 'unique:users'], + 'email' => ['required', 'string', 'email', 'max:255'], + 'phone' => ['required', 'regex:/(01)[0-9]{9}/'], 'password' => $this->passwordRules(), 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', ])->validate(); return User::create([ 'name' => $input['name'], + 'username' => $input['username'], 'email' => $input['email'], + 'phone' => $input['phone'], 'password' => Hash::make($input['password']), ]); } diff --git a/app/Models/Enums/UserRole.php b/app/Models/Enums/UserRole.php new file mode 100644 index 0000000..49dd2ed --- /dev/null +++ b/app/Models/Enums/UserRole.php @@ -0,0 +1,14 @@ + 'email', + 'username' => 'username', 'email' => 'email', diff --git a/config/jetstream.php b/config/jetstream.php index 9800fbf..d5d293d 100644 --- a/config/jetstream.php +++ b/config/jetstream.php @@ -62,7 +62,7 @@ // Features::profilePhotos(), // Features::api(), // Features::teams(['invitations' => true]), - Features::accountDeletion(), + // Features::accountDeletion(), ], /* diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 2978fe3..3471d39 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -15,18 +15,21 @@ public function up(): void Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name'); - $table->string('email')->unique(); + $table->string('username')->unique(); + $table->string('email')->nullable()->index(); + $table->string('phone')->nullable()->index(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->rememberToken(); - $table->foreignId('current_team_id')->nullable(); - $table->string('profile_photo_path', 2048)->nullable(); + $table->unsignedTinyInteger('role')->default(0); + //$table->foreignId('current_team_id')->nullable(); + $table->string('profile_photo_path')->nullable(); $table->foreignIdFor(Site::class)->nullable()->index(); $table->timestamps(); }); Schema::create('password_reset_tokens', function (Blueprint $table) { - $table->string('email')->primary(); + $table->string('username')->primary(); $table->string('token'); $table->timestamp('created_at')->nullable(); }); diff --git a/database/migrations/2024_12_27_060234_create_studies_table.php b/database/migrations/2024_12_27_060234_create_studies_table.php index f34bc60..d91731b 100644 --- a/database/migrations/2024_12_27_060234_create_studies_table.php +++ b/database/migrations/2024_12_27_060234_create_studies_table.php @@ -23,20 +23,22 @@ public function up(): void $table->string('institution_name'); $table->string('accession_number')->nullable(); $table->string('study_description')->nullable(); - $table->text('history')->nullable(); $table->dateTime('study_date')->index(); - $table->dateTime('upload_date')->index(); + $table->dateTime('receive_date')->index(); $table->dateTime('report_date')->nullable(); $table->foreignIdFor(Site::class)->constrained()->onDelete('cascade'); $table->unsignedTinyInteger('report_status')->default(0); $table->string('study_modality', 4); $table->foreignIdFor(User::class, 'assigned_physician_id')->nullable()->constrained()->onDelete('set null'); $table->foreignIdFor(User::class, 'interpreting_physician_id')->nullable()->constrained()->onDelete('set null'); + $table->foreignIdFor(User::class, 'referring_physician_id')->nullable()->constrained()->onDelete('set null'); $table->timestamps(); - $table->index(['site_id', 'upload_date']); + $table->index(['referring_physician_id', 'receive_date']); + $table->index(['site_id', 'receive_date']); $table->index(['site_id', 'accession_number']); - $table->index(['site_id', 'report_status', 'priority', 'upload_date']); + $table->index(['site_id', 'report_status', 'priority', 'receive_date']); + $table->index(['assigned_physician_id', 'report_status', 'priority', 'receive_date']); }); } diff --git a/database/migrations/2024_12_28_043818_create_study_notes_table.php b/database/migrations/2024_12_28_043818_create_study_notes_table.php index 66207ce..94c9414 100644 --- a/database/migrations/2024_12_28_043818_create_study_notes_table.php +++ b/database/migrations/2024_12_28_043818_create_study_notes_table.php @@ -15,7 +15,7 @@ public function up(): void $table->foreignIdFor(Study::class)->constrained()->onDelete('cascade'); $table->foreignIdFor(User::class)->nullable()->constrained()->onDelete('cascade'); $table->string('title')->nullable(); - $table->text('note'); + $table->longText('content'); $table->timestamps(); $table->index(['study_id', 'created_at']); diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 5d71343..7cc4ba3 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -16,8 +16,8 @@ @csrf
- - + +
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 2f2585d..3ed294a 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -14,9 +14,14 @@
+
+ + +
+
- +