You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Small shops require a simple application to support the owner or manager. A small shop (ex a food shop) occupies 50-200 square meters, sells 500-2000 different item types,
has one cash register.
EZShop is a software application to
manage sales
manage inventory
manage supply orders
manage customers
support accounting
Stakeholders
Stakeholder name
Description
Cashier
Handles sales and returns
Shop manager
Monitors inventory, does accounting, monitors profits and losses, manage supply orders
Customer
Buys items from the shop
Administrator
Installs the application, mantains it, defines users, assign privileges
Credit Card Circuit
Provides payment services
Supplier
Receives orders, provides products
Context Diagram and interfaces
Context Diagram
top to bottom directionactorAdministratorasaactorCashieraschactorCreditCardCircuitasccactorShopManagerasmngractorSupplierasspa-up-|>mngrmngr-up-|>chch-> (EZShop)
(EZShop) -->cc
(EZShop) -->sp
ShopManager creates a new product type PT populating its fields
Variants
PT exists already, ShopManager modifies its fields
PT is assigned to an occupied location, issue warning
PT is assigned to an existing barcode , issue warning
Scenario 1-1
Scenario
Create product type X
Precondition
User C exists and is logged in
Post condition
X into the system and with an assigned location
Step#
Description
1
C inserts new product description
2
C inserts new bar code
3
C inserts new price per unit
4
C inserts new product notes
5
C enters location of X
6
C confirms the entered data
Scenario 1-2
Scenario
Modify product type location
Precondition
Employee C exists and is logged in
Product type X exists
Location L is free
Post condition
X.location = L
Step#
Description
1
C searches X via bar code
2
C selects X's record
3
C selects a new product location
Scenario 1-3
Scenario
Modify product type price per unit
Precondition
Employee C exists and is logged in
Product type X exists
Post condition
X.pricePerUnit = new Price
Step#
Description
1
C searches X via bar code
2
C selects X's record
3
C inserts a new price > 0
4
C confirms the update
5
X is updated
Use case 2, UC2 - Manage users and rights
Actors Involved
Administrator
Precondition
Administrator A logged in
Post condition
Nominal Scenario
A defines a new user and its access rights
Variants
A modifies fields or access rights of an existing user
Scenario 2-1
Scenario
Create user and define rights
Precondition
Admin A exists and is logged in
Post condition
Account X is created
Step#
Description
1
A defines the credentials of the new Account X
2
A selects the access rights for the new account X
3
C confirms the inserted data
Scenario 2-2
Scenario
Delete user
Precondition
Admin A exists and is logged in
Account X exists
Post condition
Account X deleted
Step#
Description
1
A selects account X
2
X deleted from the system
Scenario 2-3
Scenario
Modify user rights
Precondition
Admin A exists and is logged in
Account X exists
Post condition
X's rights updated
Step#
Description
1
A selects account X
2
A selects the access rights for X
3
A confirms the inserted data
Use case 3, UC3 - Manage inventory and orders
Actors Involved
Administrator, Shop Manager
Precondition
Product type PT exists
Post condition
Order O for PT exists
Nominal Scenario
Manager creates new order O for product PT. Manager sends order to vendor and pays the agreed price. When order arrives to the shop, manager records order arrival.
Variants
Creation of order, PT does not exist, issue warning
Not enough money in balance to send order, issue warning
Product PT has no location assigned when registering an order arrival, issue warning
Scenario 3-1
Scenario
Order of product type X issued
Precondition
ShopManager S exists and is logged in
Product type X exists
Post condition
Order O exists and is in ISSUED state
Balance not changed
X.units not changed
Step#
Description
1
S creates order O
1
S fills quantity of product to be ordered and the price per unit
3
O is recorded in the system in ISSUED state
Scenario 3-2
Scenario
Order of product type X payed
Precondition
ShopManager S exists and is logged in
Product type X exists
Balance >= Order.units * Order.pricePerUnit
Order O exists
Post condition
Order O is in PAYED state
Balance -= Order.units * Order.pricePerUnit
X.units not changed
Step#
Description
1
S search for Order O
2
S register payment done for O
3
O's state is updated to PAYED
Scenario 3-3
Scenario
Record order of product type X arrival
Precondition
ShopManager S exists and is logged in
Product type X exists
X.location is valid
Order O exists and is in PAYED state
Post condition
O is in COMPLETED state
X.units += O.units
Step#
Description
1
O arrives to the shop
2
S records O arrival in the system
3
The system updates X available quantity
4
O is updated in the system in COMPLETED state
Use case 4, UC4 - Manage Customers and Cards
Actors Involved
Administrator, Shop Manager, Cashier
Precondition
Post condition
Account U for customer Cu exists
Nominal Scenario
User creates (if not existing) a new account for Cu, creates a new loyalty card and attaches to Cu
Variants
User modifies customer data
Variants
User deletes customer data
Scenario 4-1
Scenario
Create customer record
Precondition
Account U for Customer Cu not existing
Post condition
U is into the system
Step#
Description
1
User asks Cu personal data
2
USer fills U's fields with Cu's personal data
3
User confirms
Scenario 4-2
Scenario
Attach Loyalty card to customer record
Precondition
Account U for Customer Cu existing
Post condition
Loyalty card L attached to U
Step#
Description
1
User creates a new L with a unique serial number
2
User attaches L to U
Scenario 4-3
Scenario
Detach Loyalty card from customer record
Precondition
Account U for Customer Cu existing
Loyalty card L attached to U
Post condition
Loyalty card L detached from U
Step#
Description
1
User selects customer record U
2
User detaches L from U
3
U is updated
Scenario 4-4
Scenario
Update customer record
Precondition
Account U for Customer Cu existing
Post condition
U updated
Step#
Description
1
User selects customer record U
2
User modifies personal data of Cu
Use case 5, UC5 - Authenticate, authorize
Actors Involved
Administrator, Shop Manager, Cashier
Precondition
Post condition
Nominal Scenario
Login: user enters credentials, system checks credentials, user is authenticated
Variants
Login, credentials wrong, user not authenticated
Logout
Scenario 5-1
Scenario
Login
Precondition
Account for User U existing
Post condition
U logged in
Step#
Description
1
User inserts his username
2
User inserts his password
3
User logged in, system shows the functionalities offered by the access priviledges of U
Scenario 5-2
Scenario
Logout
Precondition
U logged-in
Post condition
U logged-out
Step#
Description
1
Employee logs out
2
The system shows the login/sign in page
Use case 6, UC6 - Manage sale transaction
Actors Involved
Administrator, Shop Manager, Cashier
Precondition
There are products available in the store
No sale transaction has already been opened with the instance of EzShop under consideration
Post condition
Sale is recorded, Ticket T is created
Nominal Scenario
Employee starts a new sale transaction and then, for each product P in the customer's cart, he records the quantity to be added to the transaction. The relative available quantity of P available in store is updated. The transaction is closed
Variants
discount rate to be applied to a product P
discount rate applied to the whole sale
Scenario 6-1
Scenario
Sale of product type X completed
Precondition
Cashier C exists and is logged in
Product type X exists and has enough units to complete the sale
Post condition
Balance += N*X.unitPrice
X.quantity -= N
Step#
Description
1
C starts a new sale transaction
2
C reads bar code of X
3
C adds N units of X to the sale
4
X available quantity is decreased by N
5
C closes the sale transaction
6
System asks payment type
7
Manage payment (see UC7)
8
Payment successful
9
C confirms the sale and prints the sale Ticket
10
Balance is updated
Scenario 6-2
Scenario
Sale of product type X with product discount
Precondition
Cashier C exists and is logged in
Product type X exists and has enough units to complete the sale
Product type X exists and has enough units to complete the sale
Customer Cu has a Loyalty Card L
Post condition
Balance += N*X.unitPrice
X.quantity -= N
L.points += (N*X.unitPrice)/10
Step#
Description
1
C starts a new sale transaction
2
C reads bar code of X
3
C adds N units of X to the sale
4
X available quantity is decreased by N
5
C closes the sale transaction
6
Sytem ask payment type
7
C reads L serial number
8
Manage credit card payment (go to scenario 3)
9
Payment successful
10
L.points updated
11
C confirms the sale and prints the sale Ticket
12
Balance is updated
Scenario 6-5
Scenario
Sale of product type X cancelled
Precondition
Cashier C exists and is logged in
Product type X exists and has enough units to complete the sale
Post condition
Balance not changed
X.quantity not changed
Step#
Description
1
C starts a new sale transaction
2
C reads bar code of X
3
C adds N units of X to the sale
4
X available quantity is decreased by N
5
C closes the sale transaction
6
System ask payment type
7
Customer cancels the payment
8
Sale transaction aborted
9
Sale ticket deleted, no change will be recorded
Scenario 6-6
Scenario
Sale of product type X completed (Cash)
Precondition
Cashier C exists and is logged in
Product type X exists and has enough units to complete the sale
Post condition
Balance += N*X.unitPrice
X.quantity -= N
Step#
Description
1
C starts a new sale transaction
2
C reads bar code of X
3
C adds N units of X to the sale
4
X available quantity is decreased by N
5
C closes the sale transaction
6
A sale review is shown to C and the Customer
7
Sytem ask payment type
8
Manage cash payment (UC7)
9
Payment successful
10
C confirms the sale and prints the sale Ticket
11
Balance is updated
Use case 7, UC7 - Manage payment
Actors Involved
Administrator, Shop Manager, Cashier
Precondition
amount to be received is defined
Post condition
Nominal Scenario
read credit card number, check card, debit card
Variants
Credit Card invalid (does not exist or stolen or expired), issue warning
Customer has not enough cash to pay the ticket, issue warning
Credit Card has not enough money, issue warning
Scenario 7-1
Scenario
Manage payment by valid credit card
Precondition
Credit card C exists
Post condition
C.Balance -= Price
Step#
Description
1
Read C.number
2
Validate C.number with Luhn algorithm
3
Ask to credit sale price
4
Price payed
5
exit with success
Scenario 7-2
Scenario
Manage payment by invalid credit card
Precondition
Credit card C does not exist
Post condition
Step#
Description
1
Read C.number
2
Validate C.number with Luhn algorithm
3
C.number invalid, issue warning
4
Exit with error
Scenario 7-3
Scenario
Manage credit card payment with not enough credit
Precondition
Credit card C exists
C.Balance < Price
Post condition
C.Balance not changed
Step#
Description
1
Read C.number
2
Validate C.number with Luhn algorithm
3
Ask to credit sale price
4
Balance not sufficient, issue warning
5
Exit with error
Scenario 7-4
Scenario
Manage cash payment
Precondition
Cash >= Price
Post condition
Step#
Description
1
Collect banknotes and coins
2
Compute cash quantity
3
Record cash payment
4
Compute change
5
Return change
Use case 8, UC8 - Manage return transaction
Actors Involved
Administrator, Shop Manager, Cashier
Precondition
Ticket T exists
No return transaction has already been opened with the instance of EzShop under consideration
Post condition
Balance updated
The available quantity of the products involved in the transaction is updated
Nominal Scenario
User starts a new return transaction inserting the T's unique number. User selects product to be returned and quantity. The customer receives a reimbursement equal to the value of the returned products, the balance is updated and the quantity of products available is updated. Reimbursement is cash if the Ticked was paid cash, by credit card if it was paid by credit card
Variants
Ticket number does not exists, issue warning
Return payment failed, transaction rolled back
Scenario 8-1
Scenario
Return transaction of product type X completed, credit card
Precondition
Cashier C exists and is logged in
Product Type X exists
Ticket T exists and has at least N units of X
Ticket T was paid with credit card
Post condition
Balance -= N*T.priceForProductX
X.quantity += N
Step#
Description
1
C inserts T.ticketNumber
2
Return transaction starts
3
C reads bar code of X
4
C adds N units of X to the return transaction
5
X available quantity is increased by N
6
Manage credit card return (go to UC 10 )
7
Return successful, C closes the return transaction
8
Balance is updated
Scenario 8-2
Scenario
Return transaction of product type X completed, cash
Precondition
Cashier C exists and is logged in
Product Type X exists
Ticket T exists and has at least N units of X
Ticket T was paid cash
Post condition
Balance -= N*T.priceForProductX
X.quantity += N
Step#
Description
1
C inserts T.ticketNumber
2
Return transaction starts
3
C reads bar code of X
4
C adds N units of X to the return transaction
5
X available quantity is increased by N
6
Manage cash return (go to UC 10)
7
Return successful
8
C confirms the return transaction and closes it
9
Sale Ticket is updated
10
Balance is updated
Use case 9, UC9 - Accounting
Actors Involved
Administrator, Shop Manager
Precondition
Post condition
List of all balance records returned
Nominal Scenario
The user enters two dates and the system returns the list of all the balance operations included between them.
Scenario 9-1
Scenario
List credits and debits
Precondition
Manager C exists and is logged in
Post condition
Transactions list displayed
Step#
Description
1
C selects a start date
2
C selects an end date
3
C sends transaction list request to the system
4
The system returns the transactions list
5
The list is displayed
Use case 10, UC10 - Manage return
Actors Involved
Administrator, Shop Manager
Precondition
Post condition
Nominal Scenario
return by credit card
Variant
return cash
Scenario 10-1
Scenario
Return payment by credit card
Precondition
Credit card C exists
Post condition
Step#
Description
1
Read C.number
2
Validate C.number with Luhn algorithm
3
Ask to return amount
4
amount returned
5
exit with success
Scenario 10-2
Scenario
return cash payment
Precondition
Post condition
Step#
Description
1
Collect banknotes and coins
2
Record cash return
Glossary
left to right directionclassShopclassAccountBookAccountBook-ShopclassFinancialTransaction {
descriptionamountdate
}
AccountBook-- "*" FinancialTransactionclassCreditclassDebitCredit--|>FinancialTransactionDebit--|>FinancialTransactionclassOrderclassSaleclassReturnOrder--|>DebitSale--|>CreditReturn--|>DebitclassProductType{
barCodedescriptionsellPricequantitydiscountRatenotes
}
Shop- "*" ProductTypeclassSaleTransaction {
IDdatetimecostpaymentTypediscount rate
}
SaleTransaction- "*" ProductTypeclassQuantity {
quantity
}
(SaleTransaction, ProductType) ..QuantityclassLoyaltyCard {
IDpoints
}
classCustomer {
namesurname
}
LoyaltyCard"0..1"-CustomerSaleTransaction"*"-- "0..1" LoyaltyCardclassProduct {
}
classPosition {
aisleIDrackIDlevelID
}
ProductType- "0..1" PositionProductType-- "*" Product : describes
classOrder {
supplierpricePerUnitquantitystatus
}
Order"*"-ProductTypeclassReturnTransaction {
quantityreturnedValue
}
ReturnTransaction"*"-SaleTransactionReturnTransaction"*"-ProductTypenote "ID is a number on 10 digits " asN1N1..LoyaltyCardnote "bar code is a number on 12 to 14 digits, compliant to GTIN specifications, see https://www.gs1.org/services/how-calculate-check-digit-manually " asN2N2..ProductTypenote "ID is a unique identifier of a transaction, printed on the receipt (ticket number) " asN3N3..SaleTransaction
EZShop is a system (including bar code reader, printer etc). However, for simplicity you are requested to
develop a software only application. Further, the system interacts with other systems (credit card systems, suppliers).
These external systems are avoided or simulated. Further documentation is available here src/main/java/it/polito/ezshop/data/EZShopInterface.java
Hardware components
Printer: not available, print function not implemented
Bar code reader: not available, bar code provided as string of digits to API functions.
Credit card reader: not available, credit card number provided as string of digits to API functions
Loyalty card reader: not available, loyalty card number provided as string of digits to API functions
Actors
Credit card circuit: interaction simulated using a file of credit cards
(src/main/java/it/polito/ezshop/utils/CreditCards.txt )
Supplier: no email with orders sent to it (orders only generated and stored internally)