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
- On profile page
- User can add a new address (can be created separately like a home, office, condo, etc.).
- User can set which address to be primary.
- Unwanted addresses can be removed.
- On payment page
- User can create a name for the location (home, office, etc.).
- User can enter your contact's name and phone number.
- User can set this address to be primary or not.
- 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
- If member doesn’t have primary address, the default address on payment page from location detector
- Member can input address without saving
- If member have primary address, it will show on default address on payment page
- 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
DB Schema / Database Migration
| Column Name | Data Type | Description |
|---|---|---|
| label | string | Delete this column |
| primary | boolean | Add this column,to mark the address if its primary address |
| contact_name | string | Add this column |
| contact_number | integer | change column name from phone |
New Query
API Blueprint
| Method | Path | URL | Description | Payload | Response |
|---|---|---|---|---|---|
| POST | /reservations.json | Add 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}.json | new address id response | "address": { "data": { "id": "16844", "type": "delivery-address" } } | ||
| POST | /users/{user_id}/addresses.json | Add 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}.json | Add 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
| NO | Date Time | What Changed | Description |
|---|---|---|---|
| 1 | 30 Sep 2022 13:30 | - | Initiate Document |
| 2 | 12 Oct 2022 | change flow diagram, scope, api blueprint |