diff --git a/backend/app/Http/Controllers/AvailabilityController.php b/backend/app/Http/Controllers/AvailabilityController.php
new file mode 100644
index 0000000..d6d12a2
--- /dev/null
+++ b/backend/app/Http/Controllers/AvailabilityController.php
@@ -0,0 +1,43 @@
+ $request->user()->available,
+ "manual_mode" => $request->user()->availability_manual_mode
+ ];
+ }
+
+ public function updateAvailability(Request $request)
+ {
+ if($request->input("id")) {
+ $user = User::find($request->input("id"));
+ } else {
+ $user = $request->user();
+ }
+
+ $user->available = $request->input("available", false);
+ $user->save();
+
+ return [
+ "updated_user_id" => $user->id,
+ "updated_user_name" => $user->name
+ ];
+ }
+
+ public function updateAvailabilityManualMode(Request $request)
+ {
+ $user = $request->user();
+ $user->availability_manual_mode = $request->input("manual_mode", false);
+ $user->save();
+
+ return;
+ }
+}
diff --git a/backend/app/Http/Controllers/UserController.php b/backend/app/Http/Controllers/UserController.php
new file mode 100644
index 0000000..6be69f8
--- /dev/null
+++ b/backend/app/Http/Controllers/UserController.php
@@ -0,0 +1,57 @@
+orderBy('available', 'desc')
+ ->orderBy('chief', 'desc')
+ ->orderBy('services', 'asc')
+ ->orderBy('trainings', 'desc')
+ ->orderBy('availability_minutes', 'asc')
+ ->orderBy('name', 'asc')
+ ->get();
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ */
+ public function store(Request $request)
+ {
+ //
+ }
+
+ /**
+ * Display the specified resource.
+ */
+ public function show(User $user)
+ {
+ //
+ }
+
+ /**
+ * Update the specified resource in storage.
+ */
+ public function update(Request $request, User $user)
+ {
+ //
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ */
+ public function destroy(User $user)
+ {
+ //
+ }
+}
diff --git a/backend/app/Models/User.php b/backend/app/Models/User.php
index 1eb1bb2..e70516b 100644
--- a/backend/app/Models/User.php
+++ b/backend/app/Models/User.php
@@ -23,6 +23,8 @@ class User extends Authenticatable
'email',
'phone_number',
'available',
+ 'availability_manual_mode',
+ 'availability_minutes',
'chief',
'driver',
'services',
diff --git a/backend/database/migrations/2023_02_20_230902_update_users_table.php b/backend/database/migrations/2023_02_20_230902_update_users_table.php
index d4dd989..879f01c 100644
--- a/backend/database/migrations/2023_02_20_230902_update_users_table.php
+++ b/backend/database/migrations/2023_02_20_230902_update_users_table.php
@@ -15,6 +15,8 @@ return new class extends Migration
$table->string('username')->unique();
$table->string('phone_number')->nullable(); //https://github.com/googlei18n/libphonenumber/blob/master/FALSEHOODS.md
$table->boolean('available')->default(false);
+ $table->boolean('availability_manual_mode')->default(false);
+ $table->int('availability_minutes')->default(0);
$table->boolean('chief')->default(false);
$table->boolean('driver')->default(false);
$table->integer('services')->default(0);
diff --git a/backend/routes/api.php b/backend/routes/api.php
index d9e0401..596913f 100644
--- a/backend/routes/api.php
+++ b/backend/routes/api.php
@@ -1,8 +1,9 @@
group( function () {
Route::get('/me', [AuthController::class, 'me']);
Route::post('/me', [AuthController::class, 'me']);
+ Route::get('/list', [UserController::class, 'index']);
+
+ Route::get('/availability', [AvailabilityController::class, 'get']);
+ Route::post('/availability', [AvailabilityController::class, 'updateAvailability']);
+ Route::post('/manual_mode', [AvailabilityController::class, 'updateAvailabilityManualMode']);
+
Route::post('/logout', [AuthController::class, 'logout']);
});
diff --git a/frontend/src/app/_components/table/table.component.html b/frontend/src/app/_components/table/table.component.html
index c54f322..706890f 100644
--- a/frontend/src/app/_components/table/table.component.html
+++ b/frontend/src/app/_components/table/table.component.html
@@ -18,8 +18,8 @@
-