diff --git a/src/main/asciidoc/models/design/catalog.puml b/src/main/asciidoc/models/design/catalog.puml index a24affe..f45b157 100644 --- a/src/main/asciidoc/models/design/catalog.puml +++ b/src/main/asciidoc/models/design/catalog.puml @@ -49,8 +49,11 @@ package catering.catalog { interface CateringCatalog { + DEFAULT_SORT : Sort + findByCategories() - + findRentablesByCategories() - + findConsumablesByCategories() + + findByCategories(category : OrderType) + + findRentables() : Streamable + + findConsumables() : Streamable + + findRentablesByCategoriesContains(category : String) : Streamable + + findConsumablesByCategoriesContains(category : String) : Streamable } CateringCatalog --|> Catalog @@ -60,7 +63,6 @@ package catering.catalog { + Consumable(name : String, retailPrice : MonetaryAmount, wholesalePrice : MonetaryAmount, promotionPrice : Optional, Set categories, metric : Metric) : Consumable + getPrice() : MonetaryAmount + getRetailPrice() : MonetaryAmount - + setRetailPrice(price : MonetaryAmount) : void + getPromotionPrice(): Optional + setPromotionPrice(price : Optional) + getWholesalePrice() : MonetaryAmount @@ -74,17 +76,22 @@ package catering.catalog { class Rentable { - wholesalePrice : MonetaryAmount + - pricePerHour : MonetaryAmount + Rentable(name : String, pricePerHour : MonetaryAmount, wholesalePrice : MonetaryAmount, Set categories, metric : Metric) : Rentable + getWholesalePrice() : MonetaryAmount + setWholesalePrice(price : MonetaryAmount) + + getRetailPrice() : MonetaryAmount + + getPriceForTime(hours : int) : MonetaryAmount + + hashCode() : int + + equals(obj Object) : boolean } Rentable --|> Product Rentable ..> java.util.Set Rentable ..> catering.order.OrderType class CatalogDataInitializer { - - rentableCatalog : RentableCatalog - - consumableCatalog : ConsumableCatalog + - cateringCatalog : CateringCatalog + + CatalogDataInitializer(cateringCatalog : CateringCatalog) + initialize() } CatalogDataInitializer ..|> DataInitializer diff --git a/src/main/asciidoc/models/design/inventory.puml b/src/main/asciidoc/models/design/inventory.puml index 87f2ff2..3bc8c38 100644 --- a/src/main/asciidoc/models/design/inventory.puml +++ b/src/main/asciidoc/models/design/inventory.puml @@ -25,7 +25,9 @@ package catering { package inventory { class InventoryController { - + InventoryController(inventory : UniqueInventory) + - inventory : UniqueInventory + - cateringCatalog : CateringCatalog + + InventoryController(inventory : UniqueInventory, cateringCatalog : CateringCatalog) + list(model : Model) : String + edit(model : Model, pid : Product) : String + edit(model : Model, pid : Product, form : InventoryMutateForm) : String @@ -51,6 +53,8 @@ package catering { InventoryController .u.> Spring.Model class InventoryInitializer { + - inventory : UniqueInventory + - cateringCatalog : CateringCatalog + InventoryInitializer(inventory : UniqueInventory, catalog : CateringCatalog) + initialize() : void } @@ -61,9 +65,53 @@ package catering { InventoryInitializer .u.> Salespoint.UniqueInventoryItem InventoryInitializer .u.> Spring.Assert - class InventoryMutateForm - class ConsumableMutateForm - class RentableMutateForm + class InventoryMutateForm { + - name : String + - quantity : long + - retailPrice : double + - orderTypes : Set + - metric : Metric + + InventoryMutateForm() + + getName() : String + + getquantity() : long + + getRetailPrice() : double + + getMetric() : Metric + + setName(name : String) : void + + getOrderTypes() : Set + + setQuantity(quantity : long) : void + + setRetailPrice(retailPrice Double) : void + + setOrderTypes(orderTypes : Set) : void + + setMetric(metric : Metric) : void + + InventoryMutateForm forProductType(type : Class) : static + + InventoryMutateForm of(item UniqueInventoryItem ) : static + + toProduct() : Product + + modifyProduct(product : Product) : void + + modifyProductPrimitive(product : Product) : void + + orderTypesFromCategories(categories : Streamable) : Set + + supportedMetrics() : Collection + } + + class ConsumableMutateForm { + - wholesalePrice : double + - promotionPrice : double + + getWholeSalePrice() : double + + getPromotionPrice() : Optional + + setWholesalePrice(wholesalePrice : double) : void + + setPromotionPrice(promotionPrice: Optional) : void + + toProduct() : Product + + ConsumableMutateForm(item : UniqueInventoryItem) : static + + modifyProductPrimitive(product : Product) : void + } + + class RentableMutateForm{ + - wholesalePrice : double + + getWholesalePrice() : double + + setWholesalePrice(wholesalePrice : double) : void + + RentableMutateForm of(item : UniqueInventoryItem) : static + + toProduct() : Product + + modifyProductPrimitive(product : Product) : void + } + ConsumableMutateForm <|-- InventoryMutateForm RentableMutateForm <|-- InventoryMutateForm diff --git a/src/main/asciidoc/models/design/order.puml b/src/main/asciidoc/models/design/order.puml index df344f6..8a58709 100644 --- a/src/main/asciidoc/models/design/order.puml +++ b/src/main/asciidoc/models/design/order.puml @@ -30,21 +30,26 @@ package catalog { package order { class OrderController { - +OrderController(oM: OrderManagement, cOR: CustomOrderRepository, inv: UniqueInventory, cat: CateringCatalog, stM: StaffManagement) + -orderManagement : OrderManagement + -customOrderRepository : CustomOrderRepository + -inventory : UniqueInventory + -catalog : CateringCatalog + -staffManagement : StaffManagement + +OrderController(orderManagement: OrderManagement, customOrderRepository: CustomOrderRepository, inventory: UniqueInventory, catalog: CateringCatalog, staffManagement: StaffManagement) +orders(model: Model, userAccount: Optional): String - +orders(model: Model): String - +orders(model: Model, String day): String - ~initializeCart(): CustomCart + +ordersForAdmin(model: Model, form: OrderQueryForm): String + +ordersForAdmin(model: Model, String day): String + +initializeCart(): CustomCart +event(model: Model, cart: CustomCart): String - +addEmployeeToCart(empId: long, cart: CustomCart): String - +removeEmployeeFromCart(empId: long, cart: CustomCart): String + +addEmployeeToCart(employeeId: long, cart: CustomCart): String + +removeEmployeeFromCart(employeeId: long, cart: CustomCart): String +removeOrder(orderId: Order.OrderIdentifier, userAccount: Optional): String +addProduct(product: Product, number: int, cart: CustomCart): String +removeProduct(itemId: String, cart: CustomCart): String +changeDate(start: LocalDate, startHour: Optional, finish: LocalDate, finishHour: Optional, cart: CustomCart): String +checkout(cart: CustomCart, userAccount: Optional): String +changeOrderType(orderType: String, cart: CustomCart): String - +{static}findFreeAmountInInterval(product: Rentable, start: LocalDatetime, finish: LocalDatetime, inv: UniqueInventory, cOR: CustomOrderRepository): Quantity + +{static}findFreeAmountInInterval(product: Rentable, start: LocalDatetime, finish: LocalDatetime, inventory: UniqueInventory, customOrderRepository: CustomOrderRepository): Quantity +calender(model: Model): String +invoice(model: Model, userAccount: UserAccount, order: Order): String } @@ -54,31 +59,70 @@ package order { } class CustomCart { + -staff : Set + -orderType : OrderType + -start : LocalDateTime + -finish : LocalDateTime -formatterPattern: String +CustomCart(orderType: OrderType, start: LocalDateTime, finish: LocalDateTime) +addEmployee(employee: Employee): boolean + +getStaff() : Set +removeEmployee(employee: Employee): boolean +addStaffTo(order: CustomOrder): CustomOrder - +addRentablesTo(order: CustomOrder, inv: UniqueInventory): CustomOrder + +addRentablesToOrder(order: CustomOrder, inventory: UniqueInventory): CustomOrder + +getOrderType() : OrderType + +setOrderType(orderType : OrderType) : void + +getStart() : LocalDateTime + +setStart(start: LocalDateTime ) : void +getDurationInHours(): int + +getFinish() : LocalDateTime + +setFinish(finish : LocalDateTime) : void + +getFormatterPattern() : String +getPrice(): MonetaryAmount - +clear() + +clear() : void } class CustomOrder { -id: Long + -staff: Set + -orderType: OrderType + -start: LocalDateTime + -finish: LocalDateTime + -invoiceAvailable: boolean -formatterPattern: String - +CustomOrder() +CustomOrder(identifier: UserAccount.UserAccountIdentifier, cart: CustomCart) - +getDurationInSeconds(): long + +CustomOrder() + -getDurationInSeconds(start: LocalDateTime, finish: LocalDateTime): long -getDurationInHours(start: LocalDateTime, finish: LocalDateTime): long + +getDurationInHours() : long -{static}min(a: LocalDateTime, b: LocalDateTime): LocalDateTime -{static}max(a: LocalDateTime, b: LocalDateTime): LocalDateTime +getDurationInSecondsDuringMonth(month: YearMonth): long +addEmployee(employee: Employee): boolean + +getStaff() : Set + +getOrderType() : OrderType + +getStart() : LocalDateTime + +getFormattedStart() : String + +getFinish() : LocalDateTime + +getFormattedFinish() : String + +isInvoiceAvailable() : boolean + +setInvoiceAvailable() : void + +hashCode() : int + +equals(obj: Object) : boolean + } + + class OrderQueryForm{ + - orderStatus : Optional + + getOrderStatus() : Optional + + setOrderStatus(orderStatus : Optional) : void + + OrderQueryForm of(order: CustomOrder)) : static } enum OrderType { + RENT_A_COOK + EVENT_CATERING + MOBILE_BREAKFAST + PARTY_SERVICE +toHumanReadable(): String } } diff --git a/src/main/asciidoc/models/design/orderCatalog.puml b/src/main/asciidoc/models/design/orderCatalog.puml index 15d40ea..ce16612 100644 --- a/src/main/asciidoc/models/design/orderCatalog.puml +++ b/src/main/asciidoc/models/design/orderCatalog.puml @@ -20,47 +20,67 @@ package catering.order { } package catering.orderCatalog { - class OrderCatalogController { - + OrderCatalogController() + class CatalogController { + - catalogEntryRepository : CustomCatalogEntryRepository + - productMap : Map + - formCatalogEntry : CustomCatalogEntry + - inventory : UniqueInventory + + CatalogController(catalogEntryRepository : CustomCatalogEntryRepository, inventory : UniqueInventory) + catalog(model : Model) : String - + configureCatalog(model : Model) : String - + catalogAdd(eventType : OrderCatalogEntry.EventType, minimumTimePeriod : int, totalCost : int, model : Model) : String + + editCatalog(model : Model) : String + + addCatalogEntry(eventType : OrderCatalogEntry.EventType, minimumTimePeriod : int, totalCost : int, model : Model) : String + removeEntry(catalogEntryID : int) : String - + addProduct(name : String, amount : int, cost : double) : String + + addProduct(product : Product, number : int) : String + removeProduct(id : String, model : Model) : String - + addTime(minimumTimePeriod : int, eventType : OrderCatalogEntry.EventType, products : Collection, model : Model) : String + + addTime(minimumTimePeriod : int, eventType : eventType, products : Map, model : Model) : String + chooseEvent(events : String) : String } - class OrderCatalogEntry { - + OrderCatalogEntry() + class CustomCatalogEntry { + - id : long + - eventType : OrderType + - products : Map + - minimumTimePeriod : int + - totalCost : int + + CustomCatalogEntry(eventType : OrderType, products : Map, minimumTimePeriod : int, totalCost : int) + + CustomCatalogEntry() + getId() : int - + getEventType() : EventType - + getProducts() : Collection + + getEventType() : OrderType + + getProducts() : Map + getMinimumTimePeriod() : int + getTotalCost() : int - + setEventType(eventType : EventType) : void + + setEventType(eventType : OrderType) : void + + addProduct(name : String, count : Quantity) : void + + setProducts(products Map) : void + setMinimumTimePeriod(timePeriod : int) : void + setTotalCost(totalCost : int) : void - + addProduct(name : String, count : Integer) : void + + hashCode() : int + + equals(obj : Object) : boolean } - class OrderCatalogEntryRepository { - + OrderCatalogEntryRepository() - + addCatalogEntry(catalogEntry : OrderCatalogEntry) : boolean - + removeCatalogEntry(catalogEntryID : int) : boolean - + getCatalogEntries() : Set + interface CustomCatalogEntryRepository { + + findAll() : Streamable + } + + class CustomCatalogEntryDataInitializer { + - catalogEntryRepository : CustomCatalogEntryRepository + + CustomCatalogEntryDataInitializer(catalogEntryRepository : CustomCatalogEntryRepository) + + initialize() : void } } -OrderCatalogEntryRepository o---> OrderCatalogEntry -OrderCatalogController ...> OrderCatalogEntryRepository -OrderCatalogEntryRepository --|> Spring.CrudRepository -OrderCatalogController ...> Salespoint.Product -OrderCatalogController ..> Spring.Model -OrderCatalogController ...> Salespoint.Cash -OrderCatalogController ...> Salespoint.Quantity -OrderCatalogController ...> Salespoint.UserAccount -OrderCatalogEntry ...> catering.order.EventType +CustomCatalogEntryRepository --|> Spring.CrudRepository +CatalogController ...> Salespoint.Product +CatalogController ..> Spring.Model +CatalogController ...> Salespoint.Cash +CatalogController ...> Salespoint.Quantity +CatalogController ...> Salespoint.UserAccount +CustomCatalogEntry ...> catering.order.EventType +CustomCatalogEntryDataInitializer --> "1" catering.catalog.CateringCatalog : "-cateringCatalog" +CustomCatalogEntryDataInitializer .u.|> Salespoint.DataInitializer +CustomCatalogEntryDataInitializer .u.> Salespoint.Quantity +CustomCatalogEntryDataInitializer -u-> "1" Salespoint.UniqueInventory : "-inventory" +CustomCatalogEntryDataInitializer .u.> Salespoint.UniqueInventoryItem +CustomCatalogEntryDataInitializer .u.> Spring.Assert @enduml diff --git a/src/main/asciidoc/models/design/staff.puml b/src/main/asciidoc/models/design/staff.puml index a84b678..fb29240 100644 --- a/src/main/asciidoc/models/design/staff.puml +++ b/src/main/asciidoc/models/design/staff.puml @@ -27,8 +27,10 @@ package catering.staff { class Employee { - name: String + - job : JobType - id: Long - + Employee() + - wage : MonetaryAmount + # Employee() + Employee(name: String, job: JobType, wage: MonetaryAmount) + getId(): Long + getName(): String @@ -37,6 +39,8 @@ package catering.staff { + setName(name: String): void + setJob(job: JobType): void + setWage(wage: Double): void + + hashCode() : int + + equals(obj : Objects) : boolean } Employee --> JobType : -job @@ -48,11 +52,12 @@ package catering.staff { } class StaffController { - + StaffController(staffRepository: StaffRepository) + - staffManagement : StaffManagement + + StaffController(staffManagement : StaffManagement) + getStaff(model: Model, month:Optional): String + getStaff(model: Model, form: StaffForm, month:Optional): String - + removeEmployee(employee: Employee, model: Model): 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 @@ -66,7 +71,9 @@ package catering.staff { StaffController ..> EURO class StaffManagement { - + StaffManagement(staffRepository: StaffRepository, orderManagement:OrderManagement) + - staffManagement : StaffRepository + - orderManagement : OrderManagement + + StaffManagement(staffRepository: StaffRepository, orderManagement:OrderManagement) + findById(id: Long): Optional + save(employee: Employee): Employee + findAll(): Streamable @@ -87,7 +94,9 @@ package catering.staff { class StaffForm { - name: String - + StaffForm(): void + - job : JobType + - wage : double + + StaffForm() + getName(): String + getJob(): JobType + getWage(): Double diff --git a/src/main/asciidoc/models/design/user.puml b/src/main/asciidoc/models/design/user.puml index fd56e12..d634092 100644 --- a/src/main/asciidoc/models/design/user.puml +++ b/src/main/asciidoc/models/design/user.puml @@ -26,31 +26,34 @@ package catering.users { class User { - address : String - fullName : String + - userAccount : UserAccount + - User() + User(userAccount : UserAccount, address : String, fullName : String) - + User() + getAddress() : String + setAddress(address:String) : String - + getFullName() : String - + setFullName(fullName:String) : String + getUsername() : String + setUsername(username:String) : boolean + + getFullName() : String + + setFullName(fullName:String) : String + getUserAccount() : UserAccount + getId() : UserIdentifier + isEnabled() : boolean + hasRole(role:String) : boolean - + equals(obj:Object) : boolean + hashCode() : int + + equals(obj:Object) : boolean } User ..> WebDataBinder User --> UserAccount : "-userAccount" User --|> AbstractAggregateRoot : <> class UserController { + - userManagement : UserManagement + UserController(userManagement: UserManagement) - initProfileBinder(binder : WebDataBinder) : void - initRegistrationBinder(binder : WebDataBinder) : void + - initAdminBinder(binder : WebDataBinder) : void + unauthorized() : String - + register() : String + + register(model:Model)) : String + register(form:RegistrationForm,result:Errors) : String + loginPage() : String + viewProfile(model:Model,userAccount:UserAccount) : String @@ -70,41 +73,53 @@ package catering.users { UserController ..> WebDataBinder class UserManagement { + - user : UserRepository + - userAccounts : UserAccountManagement + UserManagement(users:UserRepository,userAccounts:UserAccountManagement) - + createCustomer(name:String, password:String, address:String) : User - + createAdmin(name:String, password:String, address:String,fullName:String) : User + + createCustomer(name:String, password:String, address:String, fullName : String) : User + + createAdmin(name:String, password:String, address:String) : User + save(user:User) : User + + setPassword(password : String, userAccount : UserAccount) : boolean + getUsers() : UserRepository + disableUserAccount(userAccount:UserAccount) : void + getUserByAccount(userAccount:UserAccount) : Optional + + getUserByName(username : String) : Optional } UserManagement --> UserAccountManagement : "-userAccounts" UserManagement --> UserRepository : "-users" UserManagement ..> User + class UserDataInitalizer { + - LOG : Logger - userManagement : UserManagement - + UserDataInitalizer(userManagement : UserManagement) + - userAccountManagement : UserAccountManagement + + UserDataInitalizer(userManagement : UserManagement, userAccountManagement : UserAccountManagement) + initalize() : void } UserDataInitalizer --> UserManagement : "-userManagement" UserDataInitalizer ..|> DataInitalizer + class UserRepository { + findAll() : Streamable } + UserRepository --|> CrudRepository : <> UserRepository ..|> Streamable UserRepository o-- User + class UserForm { - username: String - password: String - address: String - - password: String + UserForm(username:String,address:String,fullName:String,password:String) + getUsername() : String + getAddress() : String + getFullName() : String - + getPassword() : String + + abstract class UserFormWithPassword() + + abstract class RegistrationForm() + + abstract class ProfileForm() } + class FormValidator { supports(c:Class) : boolean validate(o:Object,e:Errors) : void