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