2 次代碼提交 dcb810d7b4 ... ebca17d058

作者 SHA1 備註 提交日期
  iwa23-4 ebca17d058 hopefully finished 2 年之前
  iwa23-4 4bcbc23ea6 naming fixes 2 年之前

+ 5 - 5
backend/src/main/java/pl/dmcs/backend/controller/AuthController.java

@@ -65,7 +65,7 @@ public class AuthController {
             return new ResponseEntity<>(new ResponseMessage("Fail -> Username is already taken."), HttpStatus.BAD_REQUEST);
         }
         Account user = new Account(signUpRequest.getUsername(), passwordEncoder.encode(signUpRequest.getPassword()));
-        Person person = new Person(signUpRequest.getName(), signUpRequest.getSurname());
+        Person person = new Person(signUpRequest.getFirstname(), signUpRequest.getLastname());
         Set<String> strRoles = signUpRequest.getRole();
         Set<Role> roles = new HashSet<>();
         strRoles.forEach(role -> {
@@ -94,14 +94,14 @@ public class AuthController {
         for (Role role : accountRoles) {
             if (role.getName().equals(RoleName.ROLE_STUDENT)) {
                 Student student = new Student();
-                student.setName(person.getName());
-                student.setSurname(person.getSurname());
+                student.setFirstname(person.getFirstname());
+                student.setLastname(person.getLastname());
                 student.setAccount(user);
                 studentRepository.save(student);
             } else if (role.getName().equals(RoleName.ROLE_TEACHER)) {
                 Teacher teacher = new Teacher();
-                teacher.setName(person.getName());
-                teacher.setSurname(person.getSurname());
+                teacher.setFirstname(person.getFirstname());
+                teacher.setLastname(person.getLastname());
                 teacher.setAccount(user);
                 teacherRepository.save(teacher);
             }

+ 10 - 10
backend/src/main/java/pl/dmcs/backend/message/request/SignUpForm.java

@@ -17,8 +17,8 @@ public class SignUpForm {
     @Size(min = 6, max = 40)
     private String password;
 
-    private String name;
-    private String surname;
+    private String firstname;
+    private String lastname;
 
     public String getUsername() {
         return username;
@@ -44,19 +44,19 @@ public class SignUpForm {
         this.password = password;
     }
 
-    public String getName() {
-        return name;
+    public String getFirstname() {
+        return firstname;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setFirstname(String firstname) {
+        this.firstname = firstname;
     }
 
-    public String getSurname() {
-        return surname;
+    public String getLastname() {
+        return lastname;
     }
 
-    public void setSurname(String surname) {
-        this.surname = surname;
+    public void setLastname(String lastname) {
+        this.lastname = lastname;
     }
 }

+ 13 - 13
backend/src/main/java/pl/dmcs/backend/model/Person.java

@@ -5,31 +5,31 @@ import jakarta.persistence.MappedSuperclass;
 @MappedSuperclass
 public class Person {
 
-    private String name;
-    private String surname;
+    private String firstname;
+    private String lastname;
 
     public Person() {
     }
 
-    public Person(String name, String surname) {
-        this.name = name;
-        this.surname = surname;
+    public Person(String firstname, String lastname) {
+        this.firstname = firstname;
+        this.lastname = lastname;
     }
 
-    public String getName() {
-        return name;
+    public String getFirstname() {
+        return firstname;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setFirstname(String firstname) {
+        this.firstname = firstname;
     }
 
-    public String getSurname() {
-        return surname;
+    public String getLastname() {
+        return lastname;
     }
 
-    public void setSurname(String surname) {
-        this.surname = surname;
+    public void setLastname(String lastname) {
+        this.lastname = lastname;
     }
 
 }

+ 2 - 2
backend/src/main/java/pl/dmcs/backend/security/jwt/JwtProvider.java

@@ -11,10 +11,10 @@ import java.util.Date;
 @Component
 public class JwtProvider {
 
-    @Value("${pl.dmcs.mzelazko.jwtSecret}")
+    @Value("${pl.dmcs.mtosik.jwtSecret}")
     private String jwtSecret;
 
-    @Value("${pl.dmcs.mzelazko.jwtExpiration}")
+    @Value("${pl.dmcs.mtosik.jwtExpiration}")
     private int jwtExpiration;
 
     public String generateJwtToken(Authentication authentication) {

+ 4 - 4
backend/src/main/resources/application.properties

@@ -3,7 +3,7 @@ spring.mvc.view.suffix=.jsp
 
 # DataSource settings: set here your own configurations for the database
 # connection.
-spring.datasource.url = jdbc:postgresql://localhost:5432/template1
+spring.datasource.url = jdbc:postgresql://localhost:5432/tosiczek
 spring.datasource.username = postgres
 spring.datasource.password = postgres
 
@@ -12,7 +12,7 @@ spring.datasource.testWhileIdle = true
 spring.datasource.validationQuery = SELECT 1
 
 # IMPORTANT: to use data.sql file has to be uncommented
-spring.sql.init.mode = always
+ spring.sql.init.mode = always
 
 # Show or not log for each sql query
 spring.jpa.show-sql = true
@@ -37,5 +37,5 @@ spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
 # logging.level.org.springframework.web = trace
 # logging.level.org.hibernate = trace
 
-pl.dmcs.mzelazko.jwtSecret = jwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKey
-pl.dmcs.mzelazko.jwtExpiration = 3600
+pl.dmcs.mtosik.jwtSecret = jwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKeyjwtSecretKey
+pl.dmcs.mtosik.jwtExpiration = 3600

+ 2 - 2
frontend/src/app/admin/admin.component.html

@@ -9,7 +9,7 @@
             <div class="row flex flex-row items-center justify-between my-2">
               <div class="flex flex-row items-center justify-center">
                 <span class="w-auto p-3 bg-gray-300 text-gray-900 text-3xl text-bold flex items-center justify-center mr-5 rounded-lg">ID: {{student.id}}</span>
-                <p class="text-xl font-semibold">{{student.name}} {{student.surname}}</p>
+                <p class="text-xl font-semibold">{{student.firstname}} {{student.lastname}}</p>
               </div>
               <button class="w-[200px] ml-5 text-white focus:ring-4 focus:outline-none font-medium rounded-lg text-sm px-5 py-2.5 text-center bg-gray-900 hover:bg-gray-950 focus:ring-primary-800" (click)="deleteStudent(student)">Delete</button>
             </div>
@@ -23,7 +23,7 @@
             <div class="row flex flex-row items-center justify-between my-2">
               <div class="flex flex-row items-center justify-center">
                 <span class="w-auto p-3 bg-gray-300 text-gray-900 text-3xl text-bold flex items-center justify-center mr-5 rounded-lg">ID: {{teacher.id}}</span>
-                <p class="text-xl font-semibold">{{teacher.name}} {{teacher.surname}}</p>
+                <p class="text-xl font-semibold">{{teacher.firstname}} {{teacher.lastname}}</p>
               </div>
               <button class="w-[200px] ml-5 text-white focus:ring-4 focus:outline-none font-medium rounded-lg text-sm px-5 py-2.5 text-center bg-gray-900 hover:bg-gray-950 focus:ring-primary-800" (click)="deleteTeacher(teacher)">Delete</button>
             </div>

+ 5 - 5
frontend/src/app/auth/signup-info.ts

@@ -3,14 +3,14 @@ export class SignupInfo {
   username: string;
   role: string[];
   password: string;
-  name: string;
-  surname: string;
+  firstname: string;
+  lastname: string;
 
-  constructor(username: string, password: string, role: string[], name: string, surname: string) {
+  constructor(username: string, password: string, role: string[], firstname: string, lastname: string) {
     this.username = username;
     this.role = role;
     this.password = password;
-    this.name = name;
-    this.surname = surname;
+    this.firstname = firstname
+    this.lastname = lastname;
   }
 }

+ 4 - 4
frontend/src/app/grademanager/grademanager.component.html

@@ -22,7 +22,7 @@
               <label for="student" class="block mb-2 text-2xl font-medium text-gray-900">Student</label>
               <select id="student" name="student" [(ngModel)]="form.student" #student="ngModel" required
                       class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5">
-                <option *ngFor="let student of studentList" [value]="student.id">{{ student.name }} {{ student.surname }}</option>
+                <option *ngFor="let student of studentList" [value]="student.id">{{ student.firstname }} {{ student.lastname }}</option>
               </select>
               <div *ngIf="f.submitted && student.invalid">
                 <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['student.errors?.required']">Student is required</div>
@@ -40,15 +40,15 @@
             <thead>
             <tr>
               <th class="table-header">Name</th>
-              <th class="table-header">Surname</th>
+              <th class="table-header">lastname</th>
               <th class="table-header">Grades</th>
             </tr>
             </thead>
             <tbody>
             <ng-container *ngFor="let student of studentList; index as i">
               <tr [class.even-row]="i % 2 === 1">
-                <td class="table-cell">{{ student.name }}</td>
-                <td class="table-cell">{{ student.surname }}</td>
+                <td class="table-cell">{{ student.firstname }}</td>
+                <td class="table-cell">{{ student.lastname }}</td>
                 <td class="table-cell">
                   <div class="grades-container">
                     <ng-container *ngFor="let grade of gradeList">

+ 9 - 0
frontend/src/app/home/home.component.css

@@ -10,6 +10,15 @@
   text-transform: uppercase;
 }
 
+.logout-container {
+  display: flex;
+  flex-direction: column;
+  gap: 10px;
+  text-transform: uppercase;
+  align-items: center;
+  height: 100vh;
+}
+
 .info-heading {
   font-size: 24px;
   font-weight: bold;

+ 84 - 0
frontend/src/app/login/login.component.css

@@ -0,0 +1,84 @@
+.container {
+  max-width: 24rem;
+  margin: 0 auto;
+}
+
+.message {
+  margin-bottom: 1.5rem;
+  font-size: 1.5rem;
+  font-weight: bold;
+  color: #111827;
+}
+
+.card {
+  width: 100%;
+  background-color: #F3F4F6;
+  border-radius: 0.375rem;
+  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
+}
+
+.form {
+  padding: 1.25rem;
+}
+
+.form-group {
+  margin-bottom: 1.5rem;
+}
+
+.form-group label {
+  display: block;
+  margin-bottom: 0.5rem;
+  font-size: 0.875rem;
+  font-weight: 500;
+  color: #111827;
+}
+
+.form-control {
+  width: 100%;
+  padding: 0.625rem;
+  font-size: 0.875rem;
+  border: 1px solid #D1D5DB;
+  border-radius: 0.375rem;
+  outline: none;
+  transition: border-color 0.2s ease-in-out;
+}
+
+.form-control:focus {
+  border-color: #2563EB;
+}
+
+.form-message {
+  margin-top: 0.5rem;
+  font-size: 0.75rem;
+  color: #9CA3AF;
+}
+
+.submit-button {
+  width: 100%;
+  padding: 0.625rem;
+  font-size: 0.875rem;
+  font-weight: 500;
+  color: #FFFFFF;
+  background-color: #111827;
+  border: none;
+  border-radius: 0.375rem;
+  outline: none;
+  cursor: pointer;
+  transition: background-color 0.2s ease-in-out;
+}
+
+.submit-button:hover {
+  background-color: #1F2937;
+}
+
+.error-message {
+  margin-top: 0.5rem;
+  font-size: 0.75rem;
+  color: #EF4444;
+}
+
+hr {
+  margin: 1.5rem 0;
+  border: none;
+  border-top: 1px solid #D1D5DB;
+}

+ 17 - 19
frontend/src/app/login/login.component.html

@@ -1,37 +1,35 @@
-<div class="flex flex-col items-center justify-center px-6 py-8 mx-auto lg:py-0">
-  <div class="mb-6 text-2xl font-semibold text-gray-900" *ngIf="isLoggedIn; else loggedOut">
+<div class="container">
+  <div *ngIf="isLoggedIn; else loggedOut" class="message">
     Logged in as {{roles}}.
   </div>
 
   <ng-template #loggedOut>
-    <div class="w-full bg-gray-200 rounded-lg shadow md:mt-0 sm:max-w-md xl:p-0 ">
-      <form class="space-y-4 md:space-y-6 p-5" name="form" (ngSubmit)="f.form.valid && onSubmit()" #f="ngForm" novalidate>
+    <div class="card">
+      <form class="form" name="form" (ngSubmit)="f.form.valid && onSubmit()" #f="ngForm" novalidate>
         <div class="form-group">
-          <label for="username" id="username" class="block mb-2 text-sm font-medium text-gray-900">Username</label>
-          <input type="text" class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5" name="username" [(ngModel)]="form.username" #username="ngModel"
-                 required />
-          <div *ngIf="f.submitted && username.invalid">
-            <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['username.errors?.required']">Username is required</div>
+          <label for="username" id="username">Username</label>
+          <input type="text" class="form-control" name="username" [(ngModel)]="form.username" #username="ngModel" required>
+          <div *ngIf="f.submitted && username.invalid" class="form-message">
+            <div *ngIf="username.errors?.['required']">Username is required</div>
           </div>
         </div>
         <div class="form-group">
-          <label for="password" id="password" class="block mb-2 text-sm font-medium text-gray-900">Password</label>
-          <input type="password" class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5" name="password" [(ngModel)]="form.password" #password="ngModel"
-                 required minlength="6" />
-          <div *ngIf="f.submitted && password.invalid">
-            <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['password.errors?.required']">Password is required</div>
-            <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['password.errors?.minlength']">Password must be at least 6 characters</div>
+          <label for="password" id="password">Password</label>
+          <input type="password" class="form-control" name="password" [(ngModel)]="form.password" #password="ngModel"
+                 required minlength="6">
+          <div *ngIf="f.submitted && password.invalid" class="form-message">
+            <div *ngIf="password.errors?.['required']">Password is required</div>
+            <div *ngIf="password.errors?.['minlength']">Password must be at least 6 characters</div>
           </div>
         </div>
         <div class="form-group">
-          <button class="w-full text-white focus:ring-4 focus:outline-none font-medium rounded-lg text-sm px-5 py-2.5 text-center bg-gray-900 hover:bg-gray-950 focus:ring-primary-800">Login</button>
-          <div *ngIf="f.submitted && isLoginFailed" class="mt-2 text-sm font-light text-gray-500" >
+          <button class="submit-button">Login</button>
+          <div *ngIf="f.submitted && isLoginFailed" class="error-message">
             Login failed. Please try again.
           </div>
         </div>
       </form>
-      <hr />
+      <hr>
     </div>
   </ng-template>
 </div>
-

+ 73 - 0
frontend/src/app/register/register.component.css

@@ -0,0 +1,73 @@
+.container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 6px;
+}
+
+.card {
+  width: 100%;
+  max-width: 400px; /* Added max-width */
+  background-color: #eee;
+  border-radius: 8px;
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+  padding: 0;
+}
+
+/* Rest of the CSS code remains the same */
+
+
+.form {
+  display: flex;
+  flex-direction: column;
+  gap: 16px;
+  padding: 20px;
+}
+
+.form-group {
+  display: flex;
+  flex-direction: column;
+}
+
+label {
+  margin-bottom: 8px;
+  font-size: 14px;
+  font-weight: 500;
+  color: #333;
+}
+
+.input {
+  background-color: #f8f8f8;
+  border: 1px solid #ccc;
+  color: #333;
+  font-size: 14px;
+  padding: 8px;
+  border-radius: 4px;
+  outline: none;
+}
+
+.form-message {
+  margin-top: 4px;
+  font-size: 12px;
+  font-weight: 400;
+  color: #888;
+}
+
+.submit-button {
+  background-color: #333;
+  color: #fff;
+  font-size: 14px;
+  font-weight: 500;
+  border: none;
+  border-radius: 4px;
+  padding: 10px 16px;
+  cursor: pointer;
+}
+
+.error-message {
+  margin-top: 8px;
+  font-size: 12px;
+  font-weight: 400;
+  color: #f00;
+}

+ 27 - 31
frontend/src/app/register/register.component.html

@@ -1,53 +1,49 @@
-<div class="flex flex-col items-center justify-center px-6 py-8 mx-auto lg:py-0">
-  <div class="w-full bg-gray-200 rounded-lg shadow md:mt-0 sm:max-w-md xl:p-0 ">
-    <form class="space-y-4 md:space-y-6 p-5" name="form" (ngSubmit)="f.form.valid && onSubmit()" #f="ngForm" novalidate>
+<div class="container">
+  <div class="card">
+    <form class="form" name="form" (ngSubmit)="f.form.valid && onSubmit()" #f="ngForm" novalidate>
       <div class="form-group">
-        <label for="name" id="name" class="block mb-2 text-sm font-medium text-gray-900">Name</label>
-        <input type="text" class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5" name="name" [(ngModel)]="form.name" #name="ngModel"
-               required />
-        <div *ngIf="f.submitted && name.invalid">
-          <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['name.errors?.required']">Name is required</div>
+        <label for="firstname" id="firstname">Firstname</label>
+        <input type="text" class="input" name="firstname" [(ngModel)]="form.firstname" #firstname="ngModel" required />
+        <div *ngIf="f.submitted && firstname.invalid" class="form-message">
+          <div *ngIf="firstname.errors?.['required']">Firstname is required</div>
         </div>
       </div>
       <div class="form-group">
-        <label for="surname" id="surname" class="block mb-2 text-sm font-medium text-gray-900">Surname</label>
-        <input type="email" class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5" name="surname" [(ngModel)]="form.surname" #surname="ngModel"
-               required />
-        <div *ngIf="f.submitted && surname.invalid">
-          <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['surname.errors?.required']">Surname is required</div>
+        <label for="lastname" id="lastname">Lastname</label>
+        <input type="text" class="input" name="lastname" [(ngModel)]="form.lastname" #lastname="ngModel" required />
+        <div *ngIf="f.submitted && lastname.invalid" class="form-message">
+          <div *ngIf="lastname.errors?.['required']">Lastname is required</div>
         </div>
       </div>
       <div class="form-group">
-        <label for="username" id="username" class="block mb-2 text-sm font-medium text-gray-900">Username</label>
-        <input type="text" class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5" name="username" [(ngModel)]="form.username" #username="ngModel"
-               required />
-        <div *ngIf="f.submitted && username.invalid">
-          <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['username.errors?.required']">Username is required</div>
+        <label for="username" id="username">Username</label>
+        <input type="text" class="input" name="username" [(ngModel)]="form.username" #username="ngModel" required />
+        <div *ngIf="f.submitted && username.invalid" class="form-message">
+          <div *ngIf="username.errors?.['required']">Username is required</div>
         </div>
       </div>
       <div class="form-group">
-        <label for="password" id="password" class="block mb-2 text-sm font-medium text-gray-900">Password</label>
-        <input type="password" class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5" name="password" [(ngModel)]="form.password" #password="ngModel"
-               required minlength="6" />
-        <div *ngIf="f.submitted && password.invalid">
-          <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['password.errors?.required']">Password is required</div>
-          <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['password.errors?.minlength']">Password must be at least 6 characters</div>
+        <label for="password" id="password">Password</label>
+        <input type="password" class="input" name="password" [(ngModel)]="form.password" #password="ngModel" required minlength="6" />
+        <div *ngIf="f.submitted && password.invalid" class="form-message">
+          <div *ngIf="password.errors?.['required']">Password is required</div>
+          <div *ngIf="password.errors?.['minlength']">Password must be at least 6 characters</div>
         </div>
       </div>
       <div class="form-group">
-        <label for="role" id="role" class="block mb-2 text-sm font-medium text-gray-900">Role</label>
-        <select class="form-control bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5" name="role" [(ngModel)]="form.role" #role="ngModel" required>
+        <label for="role" id="role">Role</label>
+        <select class="input" name="role" [(ngModel)]="form.role" #role="ngModel" required>
           <option value="teacher">Teacher</option>
           <option value="student">Student</option>
         </select>
-        <div *ngIf="f.submitted && role.invalid">
-          <div class="mt-2 text-sm font-light text-gray-500" *ngIf="['role.errors?.required']">Role is required</div>
+        <div *ngIf="f.submitted && role.invalid" class="form-message">
+          <div *ngIf="role.errors?.['required']">Role is required</div>
         </div>
       </div>
       <div class="form-group">
-        <button class="w-full text-white focus:ring-4 focus:outline-none font-medium rounded-lg text-sm px-5 py-2.5 text-center bg-gray-900 hover:bg-gray-950 focus:ring-primary-800">Register</button>
-        <div *ngIf="f.submitted && isSignUpFailed" class="mt-2 text-sm font-light text-gray-500" >
-          Registration failed: {{errorMessage}}
+        <button class="submit-button">Register</button>
+        <div *ngIf="f.submitted && isSignUpFailed" class="error-message">
+          Registration failed: {{ errorMessage }}
         </div>
       </div>
     </form>

+ 2 - 2
frontend/src/app/register/register.component.ts

@@ -24,8 +24,8 @@ export class RegisterComponent implements OnInit {
       this.form.username,
       this.form.password,
       [this.form.role],
-      this.form.name,
-      this.form.surname);
+      this.form.firstname,
+      this.form.lastname);
 
     this.authService.signUp(this.signupInfo).subscribe(
       data => {

+ 5 - 5
frontend/src/app/student/student.model.ts

@@ -2,13 +2,13 @@ import {Grade} from "../grade/grade.model";
 
 export class Student {
   id?: number;
-  name: string;
-  surname: string;
+  firstname: string;
+  lastname: string;
   grades: Grade[];
 
-  constructor(name: string, surname: string) {
-    this.name = name;
-    this.surname = surname;
+  constructor(firstname: string, lastname: string) {
+    this.firstname = firstname;
+    this.lastname = lastname;
     this.grades = [];
   }
 }

+ 5 - 5
frontend/src/app/teacher/teacher.model.ts

@@ -2,13 +2,13 @@ import {Subject} from "../subject/subject.model";
 
 export class Teacher {
   id?: number;
-  name: string;
-  surname: string;
+  firstname: string;
+  lastname: string;
   subjects: Subject[];
 
-  constructor(name: string, surname: string) {
-    this.name = name;
-    this.surname = surname;
+  constructor(firstname: string, lastname: string) {
+    this.firstname = firstname;
+    this.lastname = lastname;
     this.subjects = [];
   }
 }