PRD v2

Detailed PRD of Flow Sense v2

Edit on GitHub

1. Overall Flow

Goal

Flow Sense helps FMCG clients deliver products within 24 hours with clear visibility over ordering, stock, dispatch, delivery, cash collection, returns, damaged goods, and distributor balance.

Core Flow

SR order → distributor stock check → packing → vehicle loading → DSR delivery → payment/credit → return/damage tracking → reconciliation → bank deposit → accounts approval → dashboard visibility.


A. Setup Flow

1. Client Setup

Each client gets their own workspace.

Client can define:

  • users
  • SRs
  • products
  • distributors
  • mapped working areas
  • routes
  • visibility rules
  • delivery rules

2. Dynamic Mapping Setup

Each client can have their own map structure.

Example:

Client A:

Division → Region → Zone → Route

Client B:

Region → Area → Route

Client C:

Territory → Route

The system should support custom hierarchy levels per client.


3. Shop Setup

One physical shop can belong to multiple clients.

But for one specific client:

one shop can have only one assigned SR.

So the system needs:

  • global shop profile
  • client-shop mapping
  • assigned SR
  • assigned route
  • assigned area
  • credit/due status
  • visit schedule

4. Product And Pricing Setup

Products, pricing, and product-related adjustments come from Chainlink API.

Flow Sense stores a local synced copy.

Each product belongs to a client.

Client can only see their own products.


B. SR Order Flow

1. SR Starts Daily Route

SR opens the mobile app for the day.

The app shows:

  • assigned route
  • assigned shops
  • previous due warning
  • product list
  • pricing
  • visit progress

2. SR Visits Shop

At each shop, SR can:

  • take product-wise order
  • upload shop/order photos
  • check previous dues
  • add visit notes
  • submit the order

3. Order Is Submitted

Once submitted, distributor can see the order.

Order status becomes:

Submitted


C. Distributor Processing Flow

1. Distributor Reviews Submitted Orders

Distributor sees orders by:

  • client
  • SR
  • route
  • shop
  • product
  • quantity
  • stock availability

2. Distributor Approves And Packs Order

Distributor confirms available stock from warehouse.

Order status moves:

Submitted → Approved → Packed


3. Vehicle And DSR Assignment

Distributor assigns packed orders to:

  • DSR
  • vehicle
  • delivery route

Order status moves:

Packed → Assigned to Vehicle


4. Vehicle Loading

Products are loaded from distributor warehouse into vehicle/DSR stock.

This creates a loaded stock record.

Warehouse stock is reduced/reserved.

DSR can only deliver from this loaded stock.


D. Delivery Flow

1. DSR Starts Delivery Route

DSR app shows:

  • assigned shops
  • assigned orders
  • loaded products
  • loaded quantity
  • route map
  • delivery progress

2. DSR Delivers To Shop

At each shop, DSR can:

  • view ordered products
  • deliver same, less, or more quantity
  • add products only if available in loaded stock
  • collect full payment
  • collect partial payment
  • mark as credit/due
  • upload delivery photos
  • capture GPS
  • report returned goods
  • report damaged goods

Important rule:

DSR can modify delivery quantity, but only within loaded vehicle stock.


3. Delivery Proof

Delivery proof includes:

  • delivered product quantity
  • delivery photo
  • GPS location
  • timestamp
  • payment/credit information

Cash submission is financial proof, not direct delivery proof.


E. End-of-Day Reconciliation Flow

At the end of delivery, the system compares:

Loaded Stock = Delivered Stock + Returned Stock + Damaged Stock + Remaining Stock

And:

Invoice Amount = Cash Collected + Partial Due / Credit

Distributor/DSR can see:

  • delivered products
  • undelivered products
  • damaged products
  • returned products
  • cash collected
  • credit amount
  • remaining vehicle stock

F. Cash Deposit And Accounts Flow

1. Distributor Deposits Money

Distributor deposits collected money to bank.

Then uploads:

  • deposit slip
  • bank details
  • amount
  • date
  • notes

2. Accounts Verifies Deposit

Accounts team reviews proof.

If approved:

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

If rejected:

  • deposit remains pending/rejected
  • reason is logged

G. Dashboard And Transparency Flow

Admin/client/distributor can monitor:

  • order status
  • route progress
  • delivery progress
  • stock movement
  • cash collection
  • dues
  • damaged goods
  • returns
  • SR performance
  • DSR performance
  • distributor balance

2. Phase 1 PRD

Product Requirements Document: Flow Sense Phase 1

Product Name

Flow Sense

Product Goal

Help FMCG clients deliver products within 24 hours by managing orders, fixed SR routes, distributor warehouse stock, dispatch, DSR delivery, cash collection, returns, damaged goods, and financial reconciliation in one transparent system.


1. Core Users

1. Admin

Platform-level user.

Can manage:

  • clients
  • users
  • permissions
  • system settings
  • integrations
  • reports

2. Client

FMCG company using Flow Sense.

Can view/manage:

  • own products
  • own SRs
  • own shops
  • own mappings
  • own orders
  • own inventory visibility
  • own delivery reports
  • own financial reports

Client cannot see other clients’ products, shops, orders, or inventory.


3. SR — Sales Representative

Responsible for shop visits and order collection.

Can:

  • view assigned daily route
  • visit assigned shops
  • create orders
  • upload photos
  • view previous dues
  • submit shop visit data

4. Distributor

Responsible for stock, packing, dispatch, DSR management, and cash deposit.

Can:

  • view assigned client orders
  • view warehouse inventory
  • approve orders
  • pack orders
  • assign vehicles
  • assign DSRs
  • manage delivery reconciliation
  • upload deposit slips

5. DSR — Delivery Sales Representative

Responsible for delivering products and collecting cash.

Can:

  • view assigned delivery route
  • view loaded stock
  • deliver products
  • modify delivery quantity within loaded stock
  • collect cash/partial/credit
  • upload delivery proof
  • report damaged goods
  • report returns

6. Accounts

Responsible for financial approval.

Can:

  • verify deposit slips
  • approve/reject distributor deposits
  • update distributor balance
  • view financial reports

7. Dev

Technical/internal role.

Can:

  • monitor integrations
  • view logs
  • manage technical settings
  • troubleshoot sync/API issues

2. Core Business Rules

Shop Rules

  • One physical shop can belong to multiple clients.
  • For one client, one shop can have only one assigned SR.
  • Same shop may be mapped differently for different clients.
  • Shop must have GPS/location data.
  • Duplicate shop detection should exist.

Route Rules

  • SR routes are fixed.
  • SR has predefined daily routes.
  • Each route contains multiple shops.
  • Route progress must be trackable.

Product Rules

  • Products come from Chainlink API.
  • Pricing comes from Chainlink API.
  • Product adjustments come from Chainlink API.
  • Flow Sense stores local synced copies.
  • Product belongs to a client.
  • Client can only see own products.

Inventory Rules

  • Stock exists physically in distributor warehouse.
  • Distributor warehouse can hold products from multiple clients.
  • Client can only see inventory for their own products.
  • DSR can only deliver products loaded from warehouse.
  • DSR cannot deliver products not available in loaded stock.

Delivery Rules

  • DSR can modify delivered quantity.
  • Quantity modification is allowed only within loaded stock.
  • DSR can report returned goods.
  • DSR can report damaged goods.
  • Delivery proof requires photo and GPS.
  • Payment can be full, partial, or credit.

Finance Rules

  • Cash-based delivery risk is accepted.
  • System must track cash clearly.
  • Deposit slip is required when distributor submits collected money.
  • Accounts must approve deposit before distributor balance updates.

3. Order Lifecycle

Use this lifecycle:

Draft
→ Submitted
→ Approved
→ Packed
→ Assigned to Vehicle
→ Out for Delivery
→ Delivered / Partially Delivered / Failed Delivery / Cancelled

Status Meaning

StatusMeaning
DraftSR created but not submitted
SubmittedSR submitted order
ApprovedDistributor approved order
PackedProducts packed from warehouse
Assigned to VehicleOrder assigned to DSR/vehicle
Out for DeliveryDSR started delivery
DeliveredFully delivered
Partially DeliveredSome products delivered
Failed DeliveryShop closed/refused/unavailable
CancelledOrder cancelled

4. Required Modules

Module 1: Client & User Management

Purpose

Manage clients, users, roles, and permissions.

Requirements

  • Create/manage clients
  • Create/manage users
  • Assign users to client
  • Assign roles
  • Restrict data by client
  • Support Admin, Client, SR, Distributor, DSR, Accounts, Dev
  • Enable/disable users
  • Maintain activity logs

Module 2: Dynamic Area Mapping

Purpose

Allow each client to define their own geographical hierarchy.

Requirements

  • Client can define custom map levels
  • Example: Division → Region → Zone → Route
  • Support unlimited or configurable hierarchy depth
  • Create/edit/delete area nodes
  • Assign shops to final-level areas/routes
  • Assign SRs to routes
  • Support different mappings per client
  • Same shop can belong to different areas for different clients

Module 3: Shop Management

Purpose

Maintain shop database and client-specific shop relationships.

Requirements

  • Create global shop profile
  • Store shop name, owner, phone, GPS, address
  • Detect possible duplicate shops
  • Link shop to one or more clients
  • Assign one SR per client-shop
  • Assign shop to client route
  • Track shop active/inactive status
  • Show previous due warning
  • Store shop photos/files if needed

Purpose

Sync product, pricing, and product-related data from Chainlink.

Requirements

  • Fetch client-wise product list from Chainlink
  • Store product master locally
  • Store SKU, name, category, unit, pack size, price
  • Sync product status: active/inactive
  • Sync pricing
  • Sync product adjustments
  • Store last synced timestamp
  • Maintain product ownership by client
  • Snapshot price in order line at order time

Module 5: SR Sales App

Purpose

Allow SRs to collect orders from assigned shops.

Requirements

  • SR login
  • Show today’s fixed route
  • Show assigned shops
  • Show shop location
  • Show previous dues
  • Show client-wise product list
  • Create order
  • Add product-wise quantity
  • Upload multiple photos
  • Save draft order
  • Submit order
  • Track visited/unvisited shops
  • Capture timestamp and GPS
  • Support offline-first behavior if possible

Module 6: File Management

Purpose

Handle photos, audio, and other files across different tasks.

Requirements

  • Upload files to R2 cloud storage

  • Support multiple files per task

  • Link file to entity:

    • order
    • shop
    • delivery
    • return
    • damage report
    • deposit slip
  • Store file metadata:

    • file URL
    • file type
    • uploaded by
    • uploaded time
    • entity type
    • entity ID

Module 7: Order Management

Purpose

Manage order processing from submission to delivery.

Requirements

  • View submitted orders
  • Filter by client, SR, shop, route, distributor, status
  • Approve order
  • Reject/cancel order
  • Pack order
  • Track ordered quantity
  • Track packed quantity
  • Track delivered quantity
  • Track returned quantity
  • Track damaged quantity
  • Track final invoice amount
  • Maintain full status history
  • Maintain audit log for changes

Module 8: Distributor Warehouse Inventory

Purpose

Track stock available at distributor warehouse.

Requirements

  • Maintain stock by distributor warehouse

  • Product ownership remains client-specific

  • Client can view only own product stock

  • Distributor can manage stock for assigned products

  • Track:

    • available stock
    • reserved stock
    • loaded stock
    • delivered stock
    • returned stock
    • damaged stock
  • Stock should update when products are loaded to vehicle

  • Stock should update after delivery reconciliation

  • Show low-stock warning


Module 9: Dispatch & Vehicle Loading

Purpose

Assign orders to vehicles and DSRs.

Requirements

  • Create delivery batch
  • Assign orders to DSR
  • Assign vehicle
  • Show vehicle capacity
  • Show order volume/weight if available
  • Load products from warehouse
  • Generate loaded stock record
  • Prevent loading more than warehouse stock
  • Show route map
  • Support manual route creation
  • Support suggested route grouping
  • Mark order as assigned to vehicle
  • Mark delivery batch as out for delivery

Module 10: DSR Delivery App

Purpose

Allow DSR to deliver products and collect payment.

Requirements

  • DSR login
  • Show assigned route
  • Show assigned shops
  • Show assigned orders
  • Show loaded stock
  • Start delivery
  • View ordered products
  • Enter delivered quantity
  • Allow quantity increase/decrease within loaded stock
  • Add product from loaded stock if needed
  • Collect full/partial/no payment
  • Mark due/credit
  • Upload delivery photo
  • Capture GPS
  • Add delivery note
  • Mark delivery success, partial, or failed
  • Report damaged goods
  • Report returns

Module 11: Returns & Damaged Goods

Purpose

Track product returns and damages during delivery.

Requirements

Return Capture

  • Select shop
  • Select product
  • Enter quantity
  • Select reason
  • Upload photo
  • Capture GPS
  • Link to order/delivery if applicable

Common return reasons:

  • expired
  • damaged from shop
  • wrong product
  • refused by shop
  • unsold return
  • over-delivered
  • packaging issue

Damaged Goods Capture

  • Select product
  • Enter quantity
  • Select damage reason
  • Upload photo
  • Link to DSR/vehicle/route
  • Mark whether damage happened during delivery or came from shop

Module 12: Reconciliation

Purpose

Verify stock and cash after delivery.

Requirements

For every DSR/vehicle batch, calculate:

Loaded Stock = Delivered + Returned + Damaged + Remaining

Also calculate:

Expected Cash = Cash Collected + Credit/Due

System should show:

  • loaded quantity
  • delivered quantity
  • returned quantity
  • damaged quantity
  • remaining quantity
  • cash collected
  • partial payments
  • credit/due
  • route completion
  • shop delivery status

Module 13: Finance & Distributor Balance

Purpose

Track cash deposit, accounts approval, and distributor balance.

Requirements

  • DSR submits collected cash summary
  • Distributor reviews total cash
  • Distributor deposits money to bank
  • Distributor uploads deposit slip
  • Accounts reviews deposit
  • Accounts approves/rejects deposit
  • On approval, distributor balance updates
  • Maintain ledger history
  • Track pending deposits
  • Track rejected deposits
  • Track current distributor balance

Module 14: Reports & Dashboard

Purpose

Provide visibility to all stakeholders.

Requirements

Client Dashboard

  • total orders
  • pending orders
  • delivered orders
  • partial deliveries
  • failed deliveries
  • product-wise demand
  • route-wise sales
  • SR performance
  • DSR delivery status
  • inventory view for own products
  • due/credit summary
  • return/damage summary

Distributor Dashboard

  • submitted orders
  • stock status
  • packing queue
  • delivery batches
  • vehicle loading
  • DSR progress
  • cash collection
  • deposit status
  • damaged/returned goods
  • warehouse stock

Admin Dashboard

  • all clients
  • system usage
  • order volume
  • delivery performance
  • integration status
  • user activity

Module 15: Audit Log

Purpose

Maintain traceability and transparency.

Requirements

Track all major actions:

  • order created
  • order submitted
  • order approved
  • quantity changed
  • packed quantity changed
  • vehicle assigned
  • delivery quantity changed
  • payment recorded
  • return recorded
  • damage recorded
  • deposit submitted
  • deposit approved/rejected
  • stock adjusted

Each log should store:

  • user
  • role
  • action
  • old value
  • new value
  • timestamp
  • entity type
  • entity ID

5. Core Data Entities

Minimum required entities:

  • Client
  • User
  • Role
  • Distributor
  • Warehouse
  • Vehicle
  • Shop
  • ClientShopMapping
  • AreaLevelDefinition
  • AreaNode
  • Route
  • SRRouteAssignment
  • Product
  • ProductPrice
  • InventoryStock
  • Order
  • OrderItem
  • DeliveryBatch
  • LoadedStock
  • Delivery
  • DeliveryItem
  • Payment
  • DueLedger
  • ReturnRecord
  • DamageRecord
  • Deposit
  • FileAttachment
  • AuditLog

6. Key Screens

SR App

  • Login
  • Today’s Route
  • Shop List
  • Shop Detail
  • Create Order
  • Upload Photos
  • Due Warning
  • Order Submit Success

Distributor Dashboard

  • Order Queue
  • Order Detail
  • Warehouse Inventory
  • Packing Screen
  • Dispatch Planning
  • Vehicle Loading
  • DSR Assignment
  • Reconciliation
  • Deposit Submission

DSR App

  • Today’s Delivery Route
  • Loaded Stock
  • Shop Delivery Detail
  • Quantity Adjustment
  • Payment Collection
  • Return/Damage Entry
  • Photo/GPS Proof
  • End-of-Day Summary

Client Dashboard

  • Order Overview
  • Route Progress
  • Inventory View
  • Delivery Progress
  • Sales Report
  • Due Report
  • Return/Damage Report

Accounts Panel

  • Deposit Review
  • Deposit Approval/Rejection
  • Distributor Ledger
  • Balance Summary

7. Success Metrics

Operational Metrics

  • % orders delivered within 24 hours
  • average order-to-delivery time
  • route completion rate
  • shop visit completion rate
  • failed delivery rate
  • partial delivery rate

Sales Metrics

  • total order value
  • total delivered value
  • product-wise demand
  • client-wise sales
  • route-wise sales

Inventory Metrics

  • warehouse stock availability
  • loaded vs delivered stock
  • damaged quantity
  • returned quantity
  • low-stock incidents

Finance Metrics

  • cash collected
  • credit amount
  • pending deposit amount
  • confirmed deposit amount
  • distributor balance
  • overdue shop dues

8. Phase 1 Scope

Included

  • multi-client setup
  • dynamic mapping
  • shop management
  • fixed SR routes
  • Chainlink product/pricing sync
  • SR order app
  • file uploads to R2
  • order lifecycle
  • distributor warehouse inventory
  • dispatch and vehicle loading
  • DSR delivery app
  • quantity modification within loaded stock
  • returns and damaged goods
  • cash collection
  • due tracking
  • deposit proof upload
  • accounts approval
  • basic dashboards
  • audit logs

Not Included For Now

  • advanced AI route optimization
  • demand forecasting
  • shelf image ML analysis
  • automated replenishment prediction
  • fraud detection
  • complex Chainlink failure handling
  • advanced credit scoring
  • ERP-level accounting

9. Final PRD Summary

Flow Sense Phase 1 should focus on one complete operational loop:

SR order → distributor stock check → packing → vehicle loading → DSR delivery → payment/credit → return/damage tracking → reconciliation → bank deposit → accounts approval → dashboard visibility.

The most important design decisions are:

  1. Client data must be isolated.
  2. Mapping must be dynamic per client.
  3. Shop must be global, but client-shop mapping must be separate.
  4. Products and pricing come from Chainlink.
  5. Inventory is stored at distributor warehouse level.
  6. Client only sees inventory for their own products.
  7. DSR can modify delivery quantity only within loaded stock.
  8. Delivery proof requires photo and GPS.
  9. Cash collection and deposit approval must be tracked.
  10. Returns, damaged goods, and reconciliation are part of Phase 1.

Last updated on

On this page

1. Overall FlowGoalCore FlowA. Setup Flow1. Client Setup2. Dynamic Mapping Setup3. Shop Setup4. Product And Pricing SetupB. SR Order Flow1. SR Starts Daily Route2. SR Visits Shop3. Order Is SubmittedC. Distributor Processing Flow1. Distributor Reviews Submitted Orders2. Distributor Approves And Packs Order3. Vehicle And DSR Assignment4. Vehicle LoadingD. Delivery Flow1. DSR Starts Delivery Route2. DSR Delivers To Shop3. Delivery ProofE. End-of-Day Reconciliation FlowF. Cash Deposit And Accounts Flow1. Distributor Deposits Money2. Accounts Verifies DepositG. Dashboard And Transparency Flow2. Phase 1 PRDProduct Requirements Document: Flow Sense Phase 1Product NameProduct Goal1. Core Users1. Admin2. Client3. SR — Sales Representative4. Distributor5. DSR — Delivery Sales Representative6. Accounts7. Dev2. Core Business RulesShop RulesRoute RulesProduct RulesInventory RulesDelivery RulesFinance Rules3. Order LifecycleStatus Meaning4. Required ModulesModule 1: Client & User ManagementPurposeRequirementsModule 2: Dynamic Area MappingPurposeRequirementsModule 3: Shop ManagementPurposeRequirementsModule 4: Chainlink Product & Pricing SyncPurposeRequirementsModule 5: SR Sales AppPurposeRequirementsModule 6: File ManagementPurposeRequirementsModule 7: Order ManagementPurposeRequirementsModule 8: Distributor Warehouse InventoryPurposeRequirementsModule 9: Dispatch & Vehicle LoadingPurposeRequirementsModule 10: DSR Delivery AppPurposeRequirementsModule 11: Returns & Damaged GoodsPurposeRequirementsReturn CaptureDamaged Goods CaptureModule 12: ReconciliationPurposeRequirementsModule 13: Finance & Distributor BalancePurposeRequirementsModule 14: Reports & DashboardPurposeRequirementsClient DashboardDistributor DashboardAdmin DashboardModule 15: Audit LogPurposeRequirements5. Core Data Entities6. Key ScreensSR AppDistributor DashboardDSR AppClient DashboardAccounts Panel7. Success MetricsOperational MetricsSales MetricsInventory MetricsFinance Metrics8. Phase 1 ScopeIncludedNot Included For Now9. Final PRD Summary