Sales posting (UC04)
Receive the books and quantities of a completed sale from the payment service and deduct them from stock.
| Item |
Content |
| Actors |
Payment service |
| Business processes |
2.2 Record sales |
| Precondition |
The books sold are registered. |
| Postcondition |
The sale is recorded and the sold quantity has been deducted from the stock quantity of each book. |
Main scenario
| # |
Payment service |
System |
| 1 |
Notifies the books (ISBNs) and quantities of a completed sale. |
Records the sale, deducts each quantity from the stock quantity of its book and returns an acknowledgement. |
Exceptions
| Step |
Condition |
System |
| 1 |
A notified ISBN is not registered. |
Records the sale as pending and asks a clerk to review the books. |
| 1 |
The stock quantity is less than the quantity sold. |
Deducts the quantity anyway and flags the book to the clerk as needing attention. |
Requirements
| ID |
Requirement |
Rationale |
Priority |
| R06 |
Stock deduction on sales notification The system shall deduct the sold quantity from the stock quantity of each notified book when it receives a sales notification from the payment service. |
Spares the clerk from reducing stock after every sale, and keeps stock in step with actual sales. |
Mandatory |
| R07 |
Pending sales for unregistered books The system shall record a sale as pending and ask a clerk to review the books when the sales notification includes an unregistered ISBN. |
Discarding the notification leaves the sale out of stock; rejecting it stalls processing on the payment service's side. |
Mandatory |
| R08 |
Alert on sales exceeding stock The system shall, when a sale exceeds the stock quantity of a book, deduct the quantity anyway and flag the book to the clerk as needing attention. |
It is a sign that the stock quantity disagrees with the actual quantity, and left alone it would go unnoticed until the next stocktake. |
Important |