...

/

Sequence Diagram for the Amazon Locker Service

Sequence Diagram for the Amazon Locker Service

Create a sequence diagram for product return in the Amazon Locker system.

We'll cover the following...

Sequence diagrams are a great way to understand the interactions between different entities and objects in the system. We can create different sequence diagrams for our Amazon Locker system. In this lesson, we will create a sequence diagram for returning a package.

Return package

The sequence diagram for the package return should have the following actors and objects that will interact with each other:

Actors / Participants

  • Customer (the person returning the package)

  • LockerService (the central system that manages lockers and OTPs)

  • Locker (an individual locker unit)

  • Notification (responsible for sending OTPs and messages to the customer)

Here are the steps in the return package interaction:

  1. The Customer asks the System to initiate a package return.

  2. System Checks Approval

    1. If the return is denied, the System immediately notifies the Customer and the process ends.

    2. If the return is approved, proceed to the next step.

  3. The System finds the first free locker and reserves it.

  4. Send and Verify OTP

    1. The System sends the Customer a one-time passcode (OTP).

    2. The Customer submits the OTP back to the System.

    3. If the code is invalid or expired, the System informs the Customer and stops.

    4. If the code is valid, move on to the next step.

  5. Assign Locker and Place Package

    1. The System assigns the reserved locker to the Customer (marks it as booked).

    2. The Customer places the package into that locker, completing the return.

  6. The process is finished. Once the package is in place, no further action is needed.

Based on the order above, the sequence diagram of package return in the Amazon Locker system is given below: