Update staff docs

Co-authored-by: Denis Natusch <denis.natusch@mailbox.tu-dresden.de>
This commit is contained in:
Eren Asker 2024-01-15 22:03:30 +03:00 committed by Denis Natusch
parent 4fb63e1971
commit c94a4d4adb
No known key found for this signature in database
GPG key ID: 5E57BD8EDACFA985
3 changed files with 75 additions and 38 deletions

View file

@ -3,7 +3,7 @@
// SPDX-FileCopyrightText: 2015 Oliver Drotbohm
// SPDX-FileCopyrightText: 2019 Daniel Schoenicke
// SPDX-FileCopyrightText: 2023 Markus Hamann
// SPDX-FileCopyrightText: 2023 swt23w23
// SPDX-FileCopyrightText: 2023-2024 swt23w23
[options="header"]
[cols="1, 3, 3"]
|===
@ -313,6 +313,7 @@ image:models/design/staff.svg[class design diagram - Staff]
|StaffManagement |A class that manages interactions and logic with StaffRepository. It provides methods to find, save/add, list, and delete staff members.
|StaffRepository |An extension of 'CrudRepository' that provides standard methods to perform CRUD operations on staff objects.
|StaffForm |A Form to cache a user input that was made during registration or updating an Employee.
|JobType | A list of all professions that an employee can have.
|===
=== Link between analysis and design

View file

@ -1,14 +1,29 @@
' SPDX-License-Identifier: AGPL-3.0-or-later
' SPDX-FileCopyrightText: 2023 swt23w23
' SPDX-FileCopyrightText: 2023-2024 swt23w23
@startuml
skinparam linetype ortho
skinparam groupInheritance 2
package salespoint {
class EURO
class OrderManagement
}
package java.util {
class Object
class Set
class function.Predicate
class stream.Collectors
}
package javax.money {
class MonetaryAmount
class Money
class EURO
}
package java.time {
class LocalDateTime
class YearMonth
}
package Spring {
@ -16,17 +31,21 @@ package Spring {
class Streamable
class Errors
class Model
class Pageable
}
package catering.order {
class OrderManagement
class CustomOrder
}
package org.javamonay {
class moneta.Money
}
package catering.staff {
class Employee {
- name: String
+ name: String
- id: Long
+ Employee()
+ Employee(name: String, job: JobType, wage: MonetaryAmount)
@ -37,10 +56,15 @@ package catering.staff {
+ setName(name: String): void
+ setJob(job: JobType): void
+ setWage(wage: Double): void
+ hashCode(): int
+ equals(obj: Object): boolean
}
Employee --> JobType : -job
Employee --> MonetaryAmount : -wage
Employee ..> Object
Employee ..> Money
Employee ..> Euro
enum JobType {
COOK
@ -48,22 +72,24 @@ package catering.staff {
}
class StaffController {
+ StaffController(staffRepository: StaffRepository)
+ StaffController(staffManagement: StaffManagement)
+ getStaff(model: Model, month:Optional<YearMonth>): String
+ getStaff(model: Model, form: StaffForm, month:Optional<YearMonth>): String
+ removeEmployee(employee: Employee, model: Model): String
+ getStaff(model: Model, form: StaffForm, month: YearMonth): String
+ addEmployee(form:StaffForm, result:Errors, model: Model): String
+ removeEmployee(employee: Employee, model: Model): String
+ editEmployee(employee: Employee, model Model): String
+ editEmployee(model Model, form:StaffForm): String
+ updateEmployee(employee: Employee, form:StaffForm): String
+ updateEmployee(employee: Employee, form:StaffForm, result: Errors, model: Model): String
}
StaffController --> StaffManagement : -staffManagement
StaffController ..> Employee
StaffController ..> StaffForm
StaffController ..> Model
StaffController ..> Errors
StaffController ..> Money
StaffController ..> CustomOrder
StaffController ..> EURO
StaffController ..> Money
StaffController ..> Optional
class StaffManagement {
+ StaffManagement(staffRepository: StaffRepository, orderManagement:OrderManagement<CustomOrder>)
@ -75,8 +101,16 @@ package catering.staff {
+ getWorkingHourseByemployee(e: Employee,month: YearMonth): double
}
StaffManagement --> StaffRepository : -staffRepository
StaffManagement --> OrderManagement : -orderManagement
StaffManagement --> OrderManagement : -orderManagement<CustomOrder>
StaffManagement ..> JobType
StaffManagement ..> Employee
StaffManagement ..> Set
StaffManagement ..> Streamable
StaffManagement ..> LocalDateTime
StaffManagement ..> YearMonth
StaffManagement ..> Predicate
StaffManagement ..> Collectors
StaffManagement ..> Pageable
interface StaffRepository {
+ findAll(): Streamable<Employee>
@ -87,6 +121,7 @@ package catering.staff {
class StaffForm {
- name: String
- wage: Double
+ StaffForm(): void
+ getName(): String
+ getJob(): JobType
@ -97,6 +132,7 @@ package catering.staff {
+ validate(e:Errors): void
}
StaffForm ..> JobType : -job
StaffForm ..> Errors
}
@enduml

BIN
src/main/asciidoc/models/design/staff.svg (Stored with Git LFS)

Binary file not shown.