mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
Update staff docs
Co-authored-by: Denis Natusch <denis.natusch@mailbox.tu-dresden.de>
This commit is contained in:
parent
4fb63e1971
commit
c94a4d4adb
|
@ -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
|
||||
|
|
|
@ -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 javax.money {
|
||||
class MonetaryAmount
|
||||
class Money
|
||||
package salespoint {
|
||||
class EURO
|
||||
class OrderManagement
|
||||
}
|
||||
|
||||
package java.util {
|
||||
class Object
|
||||
class Set
|
||||
class function.Predicate
|
||||
class stream.Collectors
|
||||
}
|
||||
|
||||
package javax.money {
|
||||
class MonetaryAmount
|
||||
}
|
||||
|
||||
package java.time {
|
||||
class LocalDateTime
|
||||
class YearMonth
|
||||
}
|
||||
|
||||
package Spring {
|
||||
|
@ -16,20 +31,24 @@ 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
|
||||
class Employee {
|
||||
+ name: String
|
||||
- id: Long
|
||||
+ Employee()
|
||||
+ Employee(name: String, job: JobType, wage: MonetaryAmount)
|
||||
+ Employee()
|
||||
+ Employee(name: String, job: JobType, wage: MonetaryAmount)
|
||||
+ getId(): Long
|
||||
+ getName(): String
|
||||
+ getJob(): JobType
|
||||
|
@ -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 --> JobType : -job
|
||||
Employee --> MonetaryAmount : -wage
|
||||
Employee ..> Object
|
||||
Employee ..> Money
|
||||
Employee ..> Euro
|
||||
|
||||
enum JobType {
|
||||
COOK
|
||||
|
@ -48,45 +72,56 @@ package catering.staff {
|
|||
}
|
||||
|
||||
class StaffController {
|
||||
+ StaffController(staffRepository: StaffRepository)
|
||||
+ getStaff(model: Model, month:Optional<YearMonth>): String
|
||||
+ getStaff(model: Model, form: StaffForm, month:Optional<YearMonth>): String
|
||||
+ removeEmployee(employee: Employee, model: Model): String
|
||||
+ addEmployee(form:StaffForm, result:Errors, model: Model): String
|
||||
+ editEmployee(employee: Employee, model Model): String
|
||||
+ editEmployee(model Model, form:StaffForm): String
|
||||
+ updateEmployee(employee: Employee, form:StaffForm): String
|
||||
+ StaffController(staffManagement: StaffManagement)
|
||||
+ getStaff(model: Model, month:Optional<YearMonth>): 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, result: Errors, model: Model): String
|
||||
}
|
||||
StaffController --> StaffManagement : -staffManagement
|
||||
StaffController ..> Employee
|
||||
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>)
|
||||
+ findById(id: Long): Optional<Employee>
|
||||
+ save(employee: Employee): Employee
|
||||
+ findAll(): Streamable<Employee>
|
||||
+ delete(id: Long): void
|
||||
+ getAvailableStaffByJob(job: JobType, start:LocalDateTime, finish:LocalDateTime): Set<Employee>
|
||||
+ getWorkingHourseByemployee(e: Employee,month: YearMonth): double
|
||||
+ findById(id: Long): Optional<Employee>
|
||||
+ save(employee: Employee): Employee
|
||||
+ findAll(): Streamable<Employee>
|
||||
+ delete(id: Long): void
|
||||
+ getAvailableStaffByJob(job: JobType, start:LocalDateTime, finish:LocalDateTime): Set<Employee>
|
||||
+ getWorkingHourseByemployee(e: Employee,month: YearMonth): double
|
||||
}
|
||||
StaffManagement --> StaffRepository : -staffRepository
|
||||
StaffManagement --> OrderManagement : -orderManagement
|
||||
StaffManagement ..> Set
|
||||
StaffManagement --> StaffRepository : -staffRepository
|
||||
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>
|
||||
+ findAll(): Streamable<Employee>
|
||||
}
|
||||
StaffRepository --|> CrudRepository : <<extends>>
|
||||
StaffRepository ..|> Streamable
|
||||
StaffRepository o-- Employee
|
||||
StaffRepository --|> CrudRepository : <<extends>>
|
||||
StaffRepository ..|> Streamable
|
||||
StaffRepository o-- Employee
|
||||
|
||||
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)
BIN
src/main/asciidoc/models/design/staff.svg
(Stored with Git LFS)
Binary file not shown.
Loading…
Reference in a new issue