PRD v1

Detailed PRD of Flow Sense v1

Edit on GitHub

Distributor Warehouse Inventory

Physical stock belongs to:

  • distributor
  • warehouse
  • product

But product belongs to:

  • client

Therefore:

Client inventory view = distributor warehouse inventory filtered by client-owned products.

Example:

DistributorProductProduct OwnerVisible To
Distributor AMilk 500mlClient XClient X only
Distributor AJuice 250mlClient YClient Y only
Distributor ABiscuitClient XClient X only

So the distributor may hold stock for multiple clients, but each client sees only their own product inventory.

This is the correct model.


Revised Risk Analysis

Some previous “risks” are now operational assumptions, not blockers.

1. DSR quantity modification

Not a major risk if the rule is:

DSR can only deliver from products physically assigned/loaded from warehouse.

So DSR cannot invent stock.

Still, the system should track:

  • ordered quantity
  • loaded quantity
  • delivered quantity
  • returned quantity
  • damaged quantity
  • remaining quantity

Not because DSR is risky, but because reconciliation needs clean records.


For Phase 1, assume Chainlink works.

So PRD should not overcomplicate this with fallback systems.

Simple requirement:

  • sync products
  • sync prices
  • sync adjustments/product-related data
  • store local copy
  • show last synced time

No need for complex failure handling in Phase 1.


3. Cash-based delivery

Accepted business reality.

So the system should not try to eliminate the risk.

It should just make cash movement visible:

  • expected cash
  • collected cash
  • credit amount
  • partial payment
  • distributor deposit proof
  • account confirmation

The goal is transparency, not risk removal.


4. Inventory mismatch

This is less of a risk if warehouse loading is controlled.

The real control point becomes:

DSR delivery must be limited by loaded vehicle stock.

So the system needs a vehicle/DSR stock ledger.


Important Addition: DSR Loaded Stock

This is now critical.

Before delivery, the distributor loads products into a vehicle/DSR assignment.

That creates a temporary stock layer.

Stock flow

Distributor warehouse stock

→ loaded to DSR/vehicle

→ delivered to shops

→ returned/damaged/remaining reconciled

→ remaining stock returned to warehouse

So the actual model should be:

1. Warehouse Stock

Main available inventory.

2. Loaded Stock

Stock assigned to DSR/vehicle for a delivery route.

3. Delivered Stock

Stock delivered to shops.

4. Returned Stock

Stock brought back from shops or undelivered route stock.

5. Damaged Stock

Stock damaged during delivery or returned as damaged.


Corrected Delivery Logic

DSR should be able to:

  • reduce delivered quantity
  • increase delivered quantity only if loaded stock exists
  • add another product only if that product exists in loaded stock
  • mark product as damaged
  • mark product as returned
  • collect full, partial, or no payment
  • submit photo + GPS proof

So the restriction is not permission-based at first.

It is stock-based.

DSR can modify delivery freely within loaded inventory limits.

This is a strong rule.


Corrected System Flow

Step 1: SR order capture

  • SR opens fixed daily route
  • visits assigned shops
  • takes product-wise order
  • uploads shop/order photos
  • submits order

Step 2: Distributor processing

  • distributor sees all submitted orders
  • checks warehouse stock
  • approves/orders for delivery
  • packs products
  • assigns orders to DSR/vehicle
  • loads stock from warehouse to vehicle

Step 3: Vehicle/DSR stock creation

System records:

  • vehicle
  • DSR
  • assigned route
  • loaded products
  • loaded quantity
  • assigned shops/orders

Warehouse stock is reduced or reserved at this point.

Step 4: Delivery

DSR visits shops.

For each shop:

  • sees ordered products
  • delivers actual quantities
  • may adjust quantity within loaded stock
  • records damaged/returned goods
  • collects cash/partial/credit
  • uploads delivery photos
  • captures GPS

Step 5: End-of-day reconciliation

System compares:

Loaded stock = delivered stock + returned stock + damaged stock + remaining stock

Cash expected = cash collected + credit/due

Then distributor submits deposit proof.

Step 6: Accounts confirmation

Accounts verifies bank deposit.

After approval:

  • distributor balance updates
  • deposit marked confirmed
  • finance ledger updates

Key PRD Rule Updates

These should be locked before writing Phase 1 PRD:

  1. Inventory is stored at distributor warehouse level.
  2. Product ownership belongs to client.
  3. Client can only view inventory of their own products.
  4. Distributor may manage stock for multiple clients.
  5. DSR can only deliver products loaded from warehouse.
  6. DSR can modify delivery quantities only within loaded stock limits.
  7. Loaded vehicle stock must be tracked separately.
  8. End-of-day reconciliation must match loaded, delivered, returned, damaged, and remaining stock.
  9. Cash risk is accepted; system only tracks and exposes it.
  10. Chainlink failure handling is out of Phase 1 scope.
  11. Chainlink is the source for products, pricing, and product adjustments.
  12. Returns and damaged goods are captured by DSR during delivery.

Updated Phase 1 Modules

1. Client & User Management

  • clients
  • admins
  • SRs
  • DSRs
  • distributors
  • role permissions
  • client-specific visibility

2. Dynamic Mapping

  • client-specific hierarchy
  • area nodes
  • route assignment
  • SR-area mapping
  • shop-area mapping

3. Shop Management

  • global shop
  • client-shop mapping
  • one SR per shop per client
  • due warning
  • active/inactive status

4. Product & Pricing Sync

  • Chainlink product sync
  • Chainlink price sync
  • client-product ownership
  • local product copy
  • pricing snapshot in order

5. SR Order App

  • fixed daily route
  • shop visit
  • order capture
  • photo upload
  • due warning
  • order submission

6. Order Management

  • draft
  • submitted
  • approved
  • packed
  • assigned to vehicle
  • out for delivery
  • partially delivered
  • delivered
  • failed delivery
  • cancelled

7. Distributor Warehouse Inventory

  • client-product filtered stock view
  • available stock
  • reserved stock
  • loaded stock
  • damaged stock
  • returned stock

8. Dispatch & Vehicle Loading

  • assign orders to DSR/vehicle
  • load products from warehouse
  • vehicle capacity view
  • route grouping
  • manual or suggested route generation

9. DSR Delivery App

  • assigned shops
  • loaded stock visibility
  • delivery quantity update
  • cash collection
  • credit/partial payment
  • delivery photo
  • GPS capture
  • damaged/return entry

10. Reconciliation

  • loaded vs delivered
  • delivered vs collected cash
  • returned/damaged/remaining stock
  • route-wise DSR summary
  • distributor end-of-day summary

11. Finance & Deposit

  • collection summary
  • credit ledger
  • deposit slip upload
  • accounts approval
  • distributor balance update

12. Reporting Dashboard

  • order status
  • delivery progress
  • route progress
  • stock movement
  • cash collection
  • due summary
  • damaged/returned goods
  • SR/DSR performance

Final Analysis

The corrected plan is stronger.

The most important architectural concept now is:

Distributor warehouse is the physical stock source, but inventory visibility is filtered by client-owned products.

The most important operational concept is:

DSR delivery flexibility is allowed, but bounded by loaded vehicle stock.

With this, the system can support real field behavior without creating uncontrolled inventory or accounting issues. The Phase 1 PRD can now be generated module by module.

Last updated on

On this page