wiki:PlaceOrder

Placing an Order

Actors: Registered Shopper

1. The user selects products and proceeds to checkout.

2. The system checks if the user has a delivery address.

SELECT CASE 
         WHEN EXISTS (
             SELECT 1
             FROM delivery_address
             WHERE client_ID = '1001'
         ) THEN 'Yes'
         ELSE 'No'
       END AS has_address;

3. If not, the user will need to provide a delivery address.

INSERT INTO delivery_address(client_ID, address, city, postcode, country, is_default) VALUES
('1001', 'bul.Partizanski Odredi num.52/4' , 'Skopje', '1000', 'Macedonia', TRUE);

4. The application creates a new order in order with their chosen delivery address.

INSERT INTO "order" (order_num, client_ID, last_date_mod, payment_method, discount, delivery_address) VALUES
('00125100001', 1001, CURRENT_TIMESTAMP,'credit card, **** **** **** 6750', 0.0, 'bul.Partizanski Odredi num.52/4, Skopje 1000');

5. Products are added to the order using includes.

INSERT INTO includes (order_num, product_code)
VALUES ('00125100001', '00100001');

6. Store employees are nottifed that a new order has been placed and are given the information about the order.

Last modified 11 days ago Last modified on 01/09/26 20:27:16
Note: See TracWiki for help on using the wiki.