---
# System prepended metadata

title: Flow revamp - Parcel

---

# Flow revamp - Parcel

## schema update

```sql=
ALTER TABLE parcels ALTER COLUMN parcel_type DROP NOT NULL;
```

## New attributes on active parcel for order details



* promo_code **(if promo applied)**
* payment_name
* breakdown->base_fare
* breakdown->distance_fare

## Sample of active parcel after these updates:
```json=
{
    "parcel": {
        "id": 12961,
        "hashed_id": "z1ci99jj426r",
        "order_id": "4LHUNQQ",
        "pickup_address_text": "Rampura Banasree Block-D , Road-6, Block F, Shhjahanpur",
        "estimated_pickup_address_latitude": "23.7595376",
        "estimated_pickup_address_longitude": "90.4391912",
        "pickup_address_latitude": "23.7598789",
        "pickup_address_longitude": "90.4391076",
        "receiver_name": "dbbr",
        "receiver_phone_number": "01521515657",
        "detailed_address": "bdb",
        "receiver_address_text": "Rampura Banashree Rd, Block E, Banashree",
        "estimated_receiver_address_latitude": "23.7629438",
        "estimated_receiver_address_longitude": "90.4329927",
        "receiver_address_latitude": null,
        "receiver_address_longitude": null,
        "rider_latitude": null,
        "rider_longitude": null,
        "parcel_status": "STARTED",
        "currency_symbol": "৳",
        "charge": 30,
        "due": -10,
        "driver_cut": 40,
        "is_review_requested": false,
        "is_review_requested_driver": false,
        "is_promo_applied": 1,
        "parcel_type": 5,
        "parcel_comment": "",
        "created_at": 1652787361,
        "server_time": 1652787507,
        "parcel_timeout": 120,
        "waiting_time": 30,
        "rating_to_user": 0,
        "rating_to_rider": 0,
        "distance": 961,
        "duration": 1140,
        "will_pay": "sender",
        "assigned_at_str": "2022-05-17 17:36:53",
        "accepted_at": "2022-05-17 17:37:04",
        "picked_at": "2022-05-17 17:37:23",
        "started_at": "2022-05-17 17:38:08",
        "completed_at": null,
        "item_name": "",
        "item_price": null,
        "is_paid": 1,
        "payment_type": 3,
        "payment_name": "Pay Later",
        "payment_processing": 0,
        "retry_count": 0,
        "ownership_type": "sender",
        "breakdown": {
            "duration": 1140,
            "distance": 961,
            "charge": 50,
            "discount": 20,
            "charge_after_discount": 24,
            "user_to_charge": 24,
            "payable_charge": 24,
            "base_fare": 10,
            "distance_fare": 40
        },
        "sender": {
            "id": 8446,
            "name": "Rafsan",
            "number": "01670892213",
            "rating": "5.00",
            "profile_picture": null
        },
        "rider": {
            "id": 8441,
            "name": "Biker Test From App",
            "number": "01670892213",
            "rating": "4.72",
            "average_rating": "4.72",
            "profile_picture": "/uploads/img/profile/driver-01670892213-2020-05-14T23:10:32Z",
            "type": "bike",
            "registration_number": "KHL METRO HA 96-6333",
            "city": {
                "id": 1,
                "name": "Dhaka"
            }
        },
        "category": {
            "id": 8,
            "name": "Other",
            "description": "No category selected",
            "icon": "/parcels/ic_document.png"
        },
        "category_v2": null,
        "promo": "Promo 20 Taka applied.",
        "promo_code": "PLTEST1",
        "current_location": {
            "lat": 23.7597874,
            "lon": 90.4391741
        },
        "is_show_estimated_charge": false,
        "is_show_request_destination": true,
        "payment_type_discount": [
            {
                "type": "PAY_LATER",
                "undiscounted_fare": 30,
                "discounted_fare": 24,
                "message": "You're  getting 20% off upto ৳60",
                "promotional_message": "additional 30% discount via pay later",
                "is_default_promotional_msg": true
            }
        ],
        "disclaimer": {
            "text": "Pathao under no circumstances will be liable for any loss, missing, defect or damage without proper packaging (No fragile product allowed).\n\nAfter proper investigation of the claim, Pathao will bear limited liability (Max 2000 BDT)  if the parcel is lost/damaged/defected during delivery time. Any parcel exceeding the above value, Pathao will not bear any liability for it.\n\nPathao parcel only delivers product. Pathao will not be liable to any extent for any cash transaction/collection through the rider.\n\nIf the receiver denies to pay delivery charge then the sender would be fully liable for the delivery fee.\nTo ensure the security of your parcel and money, You should not hand over the parcel unless the rider start his ride. First, confirm on your apps that the ride is starting the rides, then hand over the parcel to the rider to reach the specified destination."
        },
        "support_number": "09678100800"
    }
}
```

## Add other categories SQL

```sql=
ALTER TABLE categories
  ADD COLUMN "is_visible" SMALLINT NOT NULL DEFAULT 1;

INSERT INTO categories(id, name, description, deleted_at, created_at, updated_at, icon, "limit", is_visible) VALUES (8, 'Other', 'No passport or bank cheques', NULL, NOW(), NOW(), '/parcels/ic_document.png', 0, 0);
```

