Skip to content

Repository files navigation

Vendor Onboarding

A custom Frappe Framework application for managing the vendor onboarding process through a workflow-driven approval system. The application validates vendor information, supports role-based approvals, automatically creates Suppliers upon approval, provides REST APIs, reports, dashboard charts, and workflow notifications.


Features

  • Custom Vendor Onboarding Request DocType
  • Email and GST Number validation
  • Annual Turnover validation
  • Documents Submitted checkbox validation
  • Workflow-based approval process
  • Automatic Supplier creation after approval
  • REST API for creating and retrieving requests
  • Dashboard Chart for request status
  • Script Report for vendor request statistics
  • Custom Roles using Fixtures

Installation

Clone the repository

cd ~/frappe-bench/apps

git clone https://github.com/praginapradeep/Vendor-Onboarding.git

Install the app

cd ~/frappe-bench

bench get-app apps/vendor_onboarding

bench --site <your-site-name> install-app vendor_onboarding

bench migrate

bench start

Workflow

The Vendor Onboarding Request follows the workflow below:

Draft
   │
   ▼
Submitted
   │
   ▼
Under Review
   ├──────────────► Rejected
   │
   ▼
Approved (If no duplicate exists)
   │
   ▼
Supplier Created
   │
   ▼
Cancelled (Optional)

Workflow States:

  • Draft
  • Submitted
  • Under Review
  • Approved
  • Rejected
  • Cancelled

Validations

The application performs the following validations:

  • Valid Email Address
  • Valid GST Number (if provided)
  • Annual Turnover must not be negative
  • Documents Submitted must be checked before submitting the onboarding request
  • Prevent duplicate Supplier creation using GST Number and Email

Automatic Supplier Creation

When a Vendor Onboarding Request reaches the Approved state (DocStatus = 1), a Supplier is automatically created with:

  • Supplier Name
  • GST Number
  • Email
  • Vendor Type

Duplicate suppliers are prevented using GST Number and Email ID.


REST API Documentation

Create Vendor Onboarding Request

Method

POST

Endpoint

/api/method/vendor_onboarding.api.v1.create_request

Request Body

{
    "vendor_name": "ABC Industries",
    "email": "admin@abc.com",
    "gst_number": "29ABCDE1234F1Z5",
    "vendor_type": "Material Supplier",
    "annual_turnover": 50000,
    "contact_person": "John",
    "phone": "+91-9876543210",
    "documents_submitted": 1
}

Success Response

{
    "success": true,
    "message": "Vendor Onboarding Request created successfully."
}

Get Vendor Onboarding Request

Method

GET

Endpoint

/api/method/vendor_onboarding.api.v1.get_request?name=VOR-0001

Success Response

{
    "success": true,
    "request_doc": {
        "vendor_name": "ABC Industries",
        "email": "admin@abc.com",
        "gst_number": "29ABCDE1234F1Z5",
        "vendor_type": "Material Supplier",
        "annual_turnover": 50000,
        "contact_person": "John",
        "phone": "+91-9876543210",
        "documents_submitted": 1
    }
}

Dashboard Chart

Dashboard Chart:

Vendor Onboarding Request Status

  • Type: Bar Chart
  • Group By: Workflow State
  • Displays request count by status - Approved and Rejected

Script Report

Vendor Onboarding Requests Status

The report displays:

  • Vendor Type
  • Total Requests
  • Approved Requests
  • Rejected Requests
  • Pending Requests (Under Review)

Workflow Notification

A workflow notification is configured to notify users whenever the Workflow State changes.

Notification subject:

Status Update: {{ doc.name }} has been {{ doc.workflow_state }}

Fixtures

The following custom roles are exported as fixtures:

  • Requesters
  • Reviewers

Assumptions

  • Supplier is created only after the request is approved.
  • GST Number is optional but validated when provided. Validation is based on GSTIN format only, No status check provided.
  • Email Address is mandatory.
  • Vendor Type is mandatory.
  • Annual Turnover cannot be negative.
  • Duplicate suppliers are identified using GST Number and Email ID.
  • Documents Submitted should be marked before progressing beyond the initial onboarding stages.

Design Decisions

  • Business validations are implemented in the DocType validate() method to ensure consistency across UI and API.
  • Supplier creation is implemented in on_submit() because the Approved workflow state changes the document to docstatus = 1.
  • Script Report is used to provide aggregated vendor request statistics.
  • Dashboard Chart gives a quick visual summary of request statuses.
  • REST APIs enable integration with external applications.
  • Roles are exported as fixtures for easy deployment across environments.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages