Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Save Address (1009)

Title

Save address feature

Description / Background

Currently on our platform, we still don’t have Save Addresses feature. Compare with other delivery platforms.

Objectives

User can save address 2 places

  1. On profile page
    1. User can add a new address (can be created separately like a home, office, condo, etc.).
    2. User can set which address to be primary.
    3. Unwanted addresses can be removed.
  2. On payment page
    1. User can create a name for the location (home, office, etc.).
    2. User can enter your contact's name and phone number.
    3. User can set this address to be primary or not.
    4. And when this user orders delivery again next time, he can set this location to be the primary. He’s not supposed to choose an address anymore because it’s already defaulted.

Scope

Available on all platforms. This feature is on the Profile page and the payment page.

Payment Flow

  1. If member doesn’t have primary address, the default address on payment page from location detector
  2. Member can input address without saving
  3. If member have primary address, it will show on default address on payment page
  4. If member have primary address they can use it, update that address, or add another address, or pick another address

Sequence Diagram / Flow

flow Diagram saved address.drawio

ERD

ERD saved address.drawio

DB Schema / Database Migration

Column NameData TypeDescription
labelstringDelete this column
primarybooleanAdd this column,to mark the address if its primary address
contact_namestringAdd this column
contact_numberintegerchange column name from phone

New Query

API Blueprint

MethodPathURLDescriptionPayloadResponse
POST/reservations.jsonAdd new address_id and primary payload{ "address_id": "16665", "access_token": "29FrkaGblCMR2TpxzMzuOa-PHOLcOsKWKYV8ZosbkN0", "minor_version": 3, "channel": "web", "source": "website", "provider": "hungryhub", "big_group": false, "omise_payment_type": "cc", "gb_primepay_card": { "hungryhub_card_id": "2605" }, "tmp_reservation_id": 552477, "use_3d_secure": true, "reservation": { "date": "2022-09-21", "adult": 1, "kids": 0, "restaurant_id": "997", "special_request": "", "start_time": "15:15", "voucher_code": [], "service_type": "delivery", "accept_we_travel_together": false, "redeemed_points": 0 }, "packages": [ { "id": "3599", "quantity": 1, "menu_sections": [] } ], "with_phone_verification": true }
GET/reservations/{reservation_id}.jsonnew address id response"address": {
"data": {
"id": "16844",
"type": "delivery-address" } }
POST/users/{user_id}/addresses.jsonAdd new primary,contact name, contact number payload{ "access_token": "kahCBp29OhWpF2qMKRv6bcE41HarEBk_0ndzbRdfT2s", "address": { "detail": "Street Bangkok holaa. detail: floor 34", "lat": 20.123, "lon": 100.123, "name": "2220m 92929929", "note_for_driver": "floor 2w4", "is_saved": true, "primary": true, "contact_name": "Patrick", "contact_number": "0123456789" } }
PUT/users/{user_id}/addresses/{address_id}.jsonAdd new primary,contact name, contact number payload{ "access_token": "kahCBp29OhWpF2qMKRv6bcE41HarEBk_0ndzbRdfT2s", "address": { "detail": "Street Bangkok holaa. detail: floor 34", "lat": 20.123, "lon": 100.123, "name": "huwuwuw", "note_for_driver": "floor 22", "primary": true, "contact_name": "Patrick", "contact_number": "0123456789" } }

Notes, Constraint & Assumptions

TODO List / Action Items

[

3.basecamp.com

https://3.basecamp.com/5190892/buckets/28384499/todosets/5111507331

](https://3.basecamp.com/5190892/buckets/28384499/todosets/5111507331)

References

Change History

NODate TimeWhat ChangedDescription
130 Sep 2022 13:30-Initiate Document
212 Oct 2022change flow diagram, scope, api blueprint