-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from ermasavior/feat/docs
Feat/docs
- Loading branch information
Showing
24 changed files
with
281 additions
and
1,912 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@startuml Rides DB Schema | ||
' hide the spot | ||
' hide circle | ||
|
||
' avoid problems with angled crows feet | ||
skinparam linetype ortho | ||
|
||
entity "drivers" as e01 { | ||
*id : number <<generated>> | ||
-- | ||
*name : varchar(255) | ||
*phone_number : varchar(15) | ||
*vehicle_type : int | ||
*vehicle_plate : varchar(20) | ||
*status : int | ||
created_at : timestamp | ||
updated_at : timestamp | ||
} | ||
|
||
entity "riders" as e02 { | ||
*id : number <<generated>> | ||
-- | ||
*name : varchar(255) | ||
*phone_number : varchar(15) | ||
created_at : timestamp | ||
updated_at : timestamp | ||
} | ||
|
||
entity "rides" as e03 { | ||
*id : number <<generated>> | ||
-- | ||
*rider_id : number <<FK>> | ||
*driver_id : number <<FK>> | ||
*pickup_location : point | ||
*destination : point | ||
*status : int | ||
distance : decimal | ||
fare : decimal | ||
final_price : decimal | ||
start_time : timestamp | ||
end_time : timestamp | ||
created_at : timestamp | ||
updated_at : timestamp | ||
} | ||
|
||
entity "ride_commissions" as e04 { | ||
*id : number <<generated>> | ||
-- | ||
*ride_id : number <<FK>> | ||
platform_fee : decimal | ||
driver_commission : decimal | ||
created_at : timestamp | ||
} | ||
|
||
e01 }o..|| e03 | ||
e02 }o..|| e03 | ||
e03 |o..|| e04 | ||
|
||
@enduml |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@startuml Create New Ride Flow | ||
|
||
actor Rider | ||
actor Driver | ||
|
||
== Create New Ride == | ||
Rider->Rides: Create new ride request | ||
Rides->Location: Get nearest available drivers | ||
Location->LocationDB: Query drivers | ||
LocationDB-->Location: Return driver list | ||
Location-->Rides: Return driver list | ||
Rides->RidesDB: Store ride with status WAITING_FOR_DRIVER | ||
Rides->Drivers: Publish ride request to driver list | ||
Drivers-->Driver: Notify drivers | ||
|
||
|
||
== Set Driver Availability == | ||
Driver->Rides: Set as active | ||
Rides->RidesDB: Update as active driver | ||
Rides->Location: Update driver's current location | ||
Location->LocationDB: Store driver location | ||
|
||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml Driver-Rider Matching Flow | ||
|
||
actor Rider | ||
actor Driver | ||
|
||
alt Driver accepted the request | ||
Driver->Rides: Accept request | ||
Rides->RidesDB: Update ride to MATCHED_DRIVER | ||
Rides-->Riders: Publish update to rider | ||
Riders->Rider: Notify rider | ||
|
||
alt Rider accepted the match | ||
Rider->Rides: Accept match | ||
Rides->RidesDB: Update ride to WAITING_FOR_PICKUP | ||
Rides->RidesDB: Set driver as inactive | ||
Rides->Location: Remove driver's current location | ||
Location->LocationDB: Delete driver's location | ||
Rides->Riders: Publish update to rider | ||
Riders-->Rider: Notify rider to wait for pickup | ||
else Rider rejected the match | ||
Rider->Rides: Reject match | ||
Rides->RidesDB: Update ride to CANCELLED | ||
end | ||
end | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@startuml Start Ride Flow | ||
|
||
actor Rider | ||
actor Driver | ||
|
||
== Start Ride == | ||
Driver->Rides: Start ride request | ||
Rides->RidesDB: Update ride to RIDE_STARTED | ||
Rides->Riders: Publish ride update | ||
Riders-->Rider: Notify rider | ||
|
||
== Live Tracking Location == | ||
Driver->Drivers: Send current location | ||
Drivers->Location: Track driver location | ||
Location->LocationDB: Store driver location | ||
|
||
Rider->Riders: Send current location | ||
Riders->Location: Track rider location | ||
Location->LocationDB: Store rider location | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml Stop Ride Flow | ||
|
||
actor Rider | ||
actor Driver | ||
|
||
== End Ride == | ||
Driver->Rides: Stop ride | ||
Rides->RidesDB: Update ride to RIDE_ENDED | ||
Rides->Riders: Publish ride update | ||
Riders-->Rider: Notify rider | ||
|
||
== Confirm Ride Payment == | ||
Driver->Rides: Confirm payment | ||
note left of Rides | ||
with custom price | ||
(optional) | ||
end note | ||
Rides->Rides: Calculate commission (5%) | ||
Rides->Payment: Deduct rider's credit | ||
Rides->Payment: Add rider's credit | ||
Rides->RidesDB: Store ride commission | ||
Rides->RidesDB: Update ride to RIDE_PAID | ||
Rides->Riders: Publish ride update | ||
Riders-->Rider: Notify rider | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@startuml Ride Status Diagram | ||
hide empty description | ||
|
||
[*] --> NEW_RIDE_REQUEST : [Rider] creates ride request | ||
|
||
NEW_RIDE_REQUEST --> MATCHED_DRIVER : [Driver] accepts ride request | ||
MATCHED_DRIVER --> RIDE_CANCELLED : [Rider] rejects | ||
MATCHED_DRIVER --> READY_TO_PICKUP : [Rider] accepts | ||
READY_TO_PICKUP --> RIDE_STARTED : [Driver] starts ride in pickup location | ||
RIDE_STARTED --> RIDE_ENDED : [Driver] ends ride | ||
RIDE_ENDED --> RIDE_PAID : [Driver] confirms price | ||
|
||
RIDE_PAID --> [*] | ||
RIDE_CANCELLED --> [*] | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.