Use case - OOAD-Najah

749 downloads 1089 Views 1MB Size Report
Supermarket requires stock control system to void out of stock level for each ... The store manager will be able at any time to print a summary report of sales in ...
Object Oriented Systems Analysis and Design with UML

Problem Statement Supermarket requires stock control system to void out of stock level for each product. A purchasing_admin will be able to process an order by entering product numbers and required quantities into the system. The system will display a description, price and available stock. In-stock products will normally be collected immediately by the customer from the store. If stock is not available the purchasing_admin will be able to create a backorder for the product. The system will allow products to be paid by cash. Order details for in-stock products will be printed including the quantity, product number and description. The store manager will be able at any time to print a summary report of sales in the store for a given period, including assignment of sales to sales assistants in order to calculate weekly sales. The stock manager will be able to monitor stock levels and weekly run-rates in order to set minimum stock levels and requisition products which fall below the minimum stock levels or for which demand is anticipated. When the stock arrives it will be booked in by the warehouse person. Stock that has been backordered for collection from the store is held in a separate area and the store manager advised of its arrival. The catalogue of available products will be maintained remotely.

Step 1: Identify the business events and make an event table.

Number of event

1-

2-

3-

4-

5-

Event description

Purchase some goods from supplier

Receive product from supplier

System input

Actor providing system input

Request out of stock product

Purchasing admin

Product_id And quantity

Purchasing admin

Generate bill

Product_id Product_price Product _quantity

View goods in the supermarke t

Product_id Product name

Customer purchase product from supermarket

Product _id Product _unit

output

Actor receive output

Purchasing List of out admin of stock determine product which product want to buy from Supplier Update Purchasing product admin level in the stock

supplier

invoice

Purchasing Admin To pay these invoice customer

seller

Product Informati on that stored in the system

customer

Decrease the stock Seller level of that product

6-

Generate selling bill

Product _id Product-unit

employee

invoice

customer

Step2: Identify the use cases and produce a use case diagram for the system 1- Purchase goods from supplier 2-Receive product from supplier (after check the product that need) 3- Generate purchasing bill 4- View product in the supermarket 5- Purchase product from customer 6- Generate selling bill to the customer

Determine the Actor: Initiate Purchasing _admin Purchasing _admin supplier seller customer employee

Participant supplier Purchasing _ admin Purchasing _admin customer seller customer

Use case diagram Purchase good from supplier

Purchasing_admin

Generate purchasing bill

Receive product from supplier

supplier

Stock manager

View product into a supermarket

Seller Purchase product by customers

Generate selling bill

Customer

Employee

Step 3: Write a use case narrative describing the system’s response to each business event

Use case Actor

Purchase goods from supplier Purchasing_admin Supplier

purpose

Determine out of stock product then check product want to buy Purchasing admin request out of stock product and the system response a list of out of stock product then purchasing admin check the product want to buy from supplier

Description

Use case

Receive product from supplier

Actor purpose

Purchasing _ admin To check the product unit want to store in the inventory After the purchasing_admin determine the product want to Supply from specific supplier the product send to the supermarket then purchasing_admin check this product and update stock level

Description

Use case Actor

purpose

Description

Generate purchasing bill Supplier Purchasing_admin To identify and document the quantity of product that supplied from supplier and document amount of invoice Supplier determine the product id and quantity and price that checked by the purchasing_admin then prepare the invoice to the purchasing admin to prepare payment

Use case Actor

Purpose description

Use case Actor purpose Description

Use case Actor purpose description

View product in the supermarket Seller Customer To store the information in the product and then view in the supermarket The seller enter the product information in the system and then view the product in the supermarket Purchase product by the customer Customer seller Paying the product and update the level of the stock Customer purchase product and the level of stock decrease (-)

Generate bill to the customer Employee customer To produce invoice After customer purchase some goods from the supermarket the

employee enter product _id to the system and the system provide invoice that contain product _id, unit, price .

Expanded essential use case narrative for supermarket system:Use case Actor

Purchase goods from supplier Purchasing_admin Supplier

purpose

Determine out of stock product then check product want to buy Purchasing admin request out of stock product and the system response a list of out of stock product then purchasing admin check the product want to buy from supplier essential Out of stock product must exist List of out of stock product Purchasing admin must get the system response in 20 second

Description

Type precondition Post condition Special requirement

Flow of event Actor action 1- this use case begin when purchasing admin desire to supply some goods from supplier 2- the purchasing admin provide the request to determine the out of stock product 4- check the product want to purchase

system response 3- list of out of stock product 5- send the list to the supplier

Alternative flow of event When no product that out of stock so no list generate …

Use case

Receive product from supplier

Actor purpose

Purchasing _ admin To check the product unit want to store in the inventory After the purchasing_admin determine the product want to Supply from specific supplier the product send to the supermarket then purchasing_admin check this product and update stock level

Description

Type Precondition Post condition Special requirement

Essential Request of the product must exit Confirmation that the list already supply to the supermarket and received Purchasing admin must get the response and confirmation in 1 day

Flow of events Actor action 1- this use case begins when A supplier receive the list of out of stock product 3- purchasing admin receive The confirmation and the product Supplied and hold in the inventory

system response

2- send conformation to the purchasing-admin include the quantity and price of the checked product 4- update stock level

Alternative flow of events Step2:if no conformation send to the purchasing admin so no product received

Use case Actor

purpose

Description

Type Precondition Post condition

Receive purchasing bill Supplier Purchasing_admin To identify and document the quantity of product that supplied from supplier and document amount of invoice Supplier determine the product id and quantity and price that checked by the purchasing_admin then prepare the invoice to the purchasing admin to prepare payment essential Receive product from supplier and update the level of the stock Receive the invoice to prepare payment

Flow of event

Actor action 1-this use case begin when a supplier desire to provide specific detail about product that supplied to purchase-admin 2- the supplier provide invoice-no Quantity and price 3- on completion of entry the supplier indicate that the invoice is complete and send to the purchasing-admin

Use case Actor

Purpose description

Precondition

Post condition

system response 4- receive the invoice

View product in the supermarket Seller Customer To store the information in the product and then view in the supermarket The seller enter the product information in the system and then view the product in the supermarket Receive product must be exist Update level of stock must be exist Store information in the system After the completion of storing information product view in the supermarket.

Flow of event Actor action

system response

1- this use case begin when the seller store product

2- store the information about

information about the product then the product view in the supermarket

Use case Actor purpose Description

Precondition

Post condition

Purchase product by the customer Customer seller Paying the product and update the level of the stock Customer purchase product and the level of stock decrease (-) Store information about the product and view the product in the supermarket must exist Customer buying the product and update the stock level

flow of event Actor action 1-this use case begin when the customer purchase goods from

system response 3- the system store information of the product

supermarket 2- the seller enter the product id and quantity 4-on completion this process the customer Receive product (after payment)

Use case Actor purpose description

Type Precondition

Post condition

Generate bill to the customer Employee customer To produce invoice After customer purchase some goods from the supermarket the employee enter product _id to the system and the system provide invoice that contain product _id, unit, price . Essential 1- customer purchase product 2-decrease the stock level Generate bill to the customer

contain product unit, and price ,and name

Event flow Actor action

system response

1-This use case begin when employee desire

3- add detail of that product

To provide specific detail about product

4-prepare invoice.

That purchased by customer. 2- employee enter product specification as (product_id,product_name,unit,price)

Alternative step3: invalid product detail return to step 3

Use case scenario

Use case 1:

Purchase goods from supplier

Purchasing admin request the out of stock product, the system provides a list of out of stock product. After the list checked by the purchasing admin, purchasing admin choose the galaxy chocolate to purchase from a supplier.

He needs galaxy detail such as (id) the system provides detail and request from supplier.

Product name

galaxy

Product _id

1012345678

unit

200 unit

Receive product from supplier:After the request send to the supplier the purchasing admin wait the supplier conformation if the supplier can provide the product. When the conformation received the supplier can provide only 150 unit of galaxy chocolate. The purchasing admin send the request again to another supplier or reduce the quantity.

Generate purchasing bill:The supplier “kareem masri” send the conformation to the purchasing admin that he can provide the 200 unit of galaxy after One day. The purchasing admin agree with this transaction and wait the invoice.

the supplier “kareem masri” send the invoice (invoice no :10132,send to the purchasing admin in 2-2-2011 and include the quantity of sold product (galaxy:200 unit ) and price 600 shekel .

View product into the supermarket: When the seller want to view the product (galaxy) in the supermarket He enter the product detail (galaxy detail) before he can view in the supermarket He enter the galaxy_id 1031245, galaxy _description, quantity in the stock, and the supplier _id) Assume he save this information the system response: (Invalid product_ id)

Purchase product by the customer: Ahmad Jamal went to the supermarket on Jan 12,2011 and intend to by rice ( shoqha , 150 shekel , 10kg) but the product was drained from the supermarket , then the customer go back without buying it ).

Generate bill to the customer:Omar isam went to the super market on Feb 3,2011 and he intend to buy milk (Nedo, 25 shekel) the employee enter the product barcode and the system generate bill provided to the customer include product name and product quantity and the(sub total) price and total price ..

“System sequence diagram “ 1-use case 1

Purchase goods from supplier

Supermarket system Purchasing_admin Supplier

request product( ) list of out of stock product ( )

paying product (id, unit )

confirmation ( ) end request ( )

Request ( )

Bids ( )

“System sequence diagram “

Use case 2: receive product from supplier

Supermarket system

Stock manager

Purchasing_admin

jjjuhui

Enter product information (id, unit, name) Store information ( )

update stock level ( )

“System sequence diagram “ Use case 3: generate bill from supplier

Admin

Supplier

Super market system

Determine buying product (product_id, name, unit, price) Invoice information ( )

send invoice ( )

“System sequence diagram “ Use case 4: view product in the supermarket

Super market system

Seller

View product (p-id, name, des, image)

Store information ( )

“System sequence diagram “ Use case 5: purchase product by the customer

Employee

Supermarket system

Check barcode (product_id)

Decrease level of stock ( ) Payment (p-id, price, amount) Confirmation ( )

“System sequence diagram “ Generate bill to the customer :-

Employee Supermarket system

Customer

Determine purchasing product (Product id, name, price, unit) Generate bill ( )

send invoice ( )

Contract: Name

Request out of stock product

Responsibilities

Provide the product not a available in the stock

Type

System

Exception

If all product a available no out of stock generate

Precondition

Decrease the stock level

Post condition

Update list of out of the stock product

Name

Paying the product (product _id,product_unit)

Responsibilities

To identify the product id and unit want to buy

Type

System

Exception

If the product id is not valid indicate that it was an error

Precondition

Save List of out of the stock product

Post condition

Save List of product want to buy

Name

Request product (product _id, unit)

Responsibilities

To identify the supplier and send a list of product want to buy

Type

System

Exception

If no supplier none in the system indicate the error

Precondition

Add supplier to the system

Post condition

Add new order information.

Name

Choose bid

Responsibilities

Choose one of several bids

Type

System

Exception

If no bids provided indicate an error

Precondition

Store the order information

Post condition

Save selected bid

Name

Receive the product from supplier

Responsibilities

Update stock level

Type

System

Exception

If product is not available indicate error

Precondition

Save selected bid

Post condition

Update stock level.

Name

Determine buying product (p_id,name ,price,unit)

Responsibilities

Determine buying product

Type

System

Exception

Indicate error if p_id not available

Precondition

Update stock level

Post condition

Save product information .

Contracts for use case 4 contract view product(product t id ,product name, description ,image)

Name :

Responsibilities :

viewing product in the supermarket.

Type : system.

Contract Name:

store information(product id ,product name ,description ,image).

Responsibilities :

storing information about product.

Type:

system.

Output:

information stored. For use case 3 Contract

Name:

determine buying product(product id ,product name ,unit price).

Responsibilities:

to know what the product that we buying from supplier.

Type :

system.

Output:

purchasing bill.

Precondition :

send order must be exist.

Pot condition :

display invoice information.

Contract Name:

invoice information(product id, product name ,price).

Responsibilities:

storing information about invoice.

Type :

system.

Precondition:

display the product that we want to buy

Postcondition :

saving information of invoice.

Contract Name :

send invoice()

Responsibilities:

sending invoice to the admin from supplier

Type :

system.

Output:

bill for the system.