Phase 07: Product Onboarding
Duration: 3 days Goal: Implement AGM Secretary product onboarding workflow per DPR Section 3.1
Overview
Section titled “Overview”This phase implements the complete product introduction workflow from Supplier application to BoA approval, covering:
- Pre-Screening
- Screening (sample validation)
- Post-Screening
- Price Negotiation (PPN/PNC)
- BoA Approval
1. Product Application DocType
Section titled “1. Product Application DocType”class ProductApplication(BaseDocType): """New product introduction application from Supplier."""
# Applicant supplier: str # FK to Supplier application_date: date = Field(default_factory=date.today)
# Product Info product_name: str = Field(max_length=200) barcode: str = Field(max_length=50) hsn_code: str | None = None mrp: Decimal proposed_legacy_erp_price: Decimal
# Classification item_group: str # FK to ItemGroup category: str # GS, LIF, AFD-I, AFD-II
# Standards fssai_number: str | None = None bis_number: str | None = None agmark_number: str | None = None
# Documents (File links) tds_certificate: str | None = None # FK to File costing_sheet: str | None = None gst_invoice: str | None = None
# Workflow status: str = "Draft" # Draft, Pre-Screening, Screening, PNC, BoA, Approved, Rejected
class Meta: table_name = "product_application" workflow = "ProductOnboardingWorkflow"1.1 Tasks
Section titled “1.1 Tasks”- Create
ProductApplicationDocType - Implement document upload for TDS, costing sheet
- Smart Consumer App integration (barcode validation)
- GSTIN/FSSAI verification API
2. Pre-Screening Module
Section titled “2. Pre-Screening Module”class PreScreening(BaseDocType): """Pre-screening evaluation of product application."""
application: str # FK to ProductApplication screener: str # FK to User screening_date: date = Field(default_factory=date.today)
# Checklist supplier_verified: bool = False product_exists_in_market: bool = False # 3 months minimum documents_complete: bool = False standards_verified: bool = False
# Result result: str = "Pending" # Pending, Passed, Failed remarks: str | None = None
class Meta: table_name = "pre_screening"2.1 Tasks
Section titled “2.1 Tasks”- Create
PreScreeningDocType - Implement checklist validation
- Auto-notify Supplier on result
- Link to screening stage on pass
3. Screening Module (Sample Validation)
Section titled “3. Screening Module (Sample Validation)”class Screening(BaseDocType): """Physical sample screening at Legacy ERP HO."""
application: str # FK to ProductApplication
# Sample Tracking sample_requested_date: date | None = None sample_received_date: date | None = None barcode_validated: bool = False
# Screening Committee screener_1: str | None = None # FK to User screener_2: str | None = None screener_3: str | None = None
# Evaluation product_quality: str = "Pending" # Pending, Acceptable, Poor packaging_quality: str = "Pending" label_compliance: bool = False
# Lab Reports (for non-BIS/FSSAI products) nabl_report: str | None = None # FK to File
# Result result: str = "Pending" # Pending, Passed, Failed pass_date: date | None = None
class Meta: table_name = "screening"3.1 Tasks
Section titled “3.1 Tasks”- Create
ScreeningDocType - Barcode scanner integration
- Screening report generation
- Sample return notification workflow
4. Price Negotiation (PNC)
Section titled “4. Price Negotiation (PNC)”class PNCChart(BaseDocType): """Price Negotiation Committee chart for BoA review."""
application: str # FK to ProductApplication
# Pricing Analysis supplier_proposed_price: Decimal market_survey_price: Decimal competitor_1_price: Decimal | None = None competitor_2_price: Decimal | None = None
# Negotiated Terms negotiated_price: Decimal | None = None discount_percent: Decimal | None = None procurement_price: Decimal | None = None trade_price: Decimal | None = None
# PNC Meeting pnc_date: date | None = None pnc_members: list[str] = Field(default_factory=list) # User IDs mom_document: str | None = None # FK to File
# Recommendation recommendation: str = "Pending" # Pending, Recommend, Re-negotiate, Reject remarks: str | None = None
class Meta: table_name = "pnc_chart"4.1 Tasks
Section titled “4.1 Tasks”- Create
PNCChartDocType - Auto-generate chart from Market Survey data
- MoM upload functionality
- IFA access for review
5. BoA Approval
Section titled “5. BoA Approval”class BoAApproval(BaseDocType): """Board of Administration approval for new products."""
application: str # FK to ProductApplication pnc_chart: str # FK to PNCChart
# Meeting boa_date: date agenda_item_number: str | None = None
# Decision decision: str = "Pending" # Pending, Approved, Rejected, Re-PNC approved_price: Decimal | None = None
# Post-Approval ni_circular_number: str | None = None # New Introduction circular index_number: str | None = None # Item code assigned
class Meta: table_name = "boa_approval"5.1 Tasks
Section titled “5.1 Tasks”- Create
BoAApprovalDocType - Generate BoA chart from PNC data
- Auto-notify Supplier on decision
- Link to Item master on approval (create Item)
- Generate NI circular
6. Workflow Definition
Section titled “6. Workflow Definition”ProductOnboardingWorkflow = Workflow( name="ProductOnboardingWorkflow", states=[ State("Draft", is_initial=True), State("Pre-Screening"), State("Screening"), State("Post-Screening"), State("PPN"), # Pre-Price Negotiation State("PNC"), # Price Negotiation Committee State("BoA Pending"), State("Approved", is_final=True), State("Rejected", is_final=True), ], transitions=[ Transition("Submit", "Draft", "Pre-Screening"), Transition("Pass Pre-Screening", "Pre-Screening", "Screening"), Transition("Fail Pre-Screening", "Pre-Screening", "Rejected"), Transition("Pass Screening", "Screening", "Post-Screening"), Transition("Fail Screening", "Screening", "Rejected"), Transition("Complete Post-Screening", "Post-Screening", "PPN"), Transition("Submit to PNC", "PPN", "PNC"), Transition("Recommend to BoA", "PNC", "BoA Pending"), Transition("Re-negotiate", "PNC", "PPN"), Transition("Approve", "BoA Pending", "Approved"), Transition("Reject", "BoA Pending", "Rejected"), Transition("Re-PNC", "BoA Pending", "PNC"), ])7. API Endpoints
Section titled “7. API Endpoints”| Endpoint | Method | Description |
|---|---|---|
/api/v1/product-application |
POST | Submit new product application |
/api/v1/product-application/{id}/submit |
POST | Submit for pre-screening |
/api/v1/pre-screening/{id}/evaluate |
POST | Submit pre-screening result |
/api/v1/screening/{id}/validate-sample |
POST | Validate received sample |
/api/v1/pnc-chart/{id}/recommend |
POST | PNC recommendation |
/api/v1/boa-approval/{id}/decide |
POST | BoA decision |
8. Integrations
Section titled “8. Integrations”| External System | Purpose |
|---|---|
| Smart Consumer App (GS-1) | Barcode/product data validation |
| GSTIN Portal | Supplier verification |
| FSSAI Portal | Food license verification |
| MS Branch (MRU) | Market Survey data |
9. Verification Checklist
Section titled “9. Verification Checklist”- Complete workflow from Draft to Approved
- Supplier notification at each stage
- Document upload working
- PNC chart auto-generation
- Item created on approval
- Audit trail for all transitions