-
Notifications
You must be signed in to change notification settings - Fork 0
feat(erp): Implement Pharma ERP + POS foundation (database schema and core services) #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
38
commits into
pharma-erp-pos
Choose a base branch
from
copilot/implement-pharma-erp-pos-system
base: pharma-erp-pos
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…schema - Add 31 new models for ERP and POS modules - Implement immutability triggers for inventory ledger and GL journals - Add materialized view for stock balance queries - Include comprehensive documentation - Maintain multi-tenant isolation across all tables Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
…nts-ERP.md to docs/pharma-erp/ Software-Requirements-Specification-Pharma-Inventory-and-Accounts-ERP.md
- Add ErpBaseService with transaction support - Implement InventoryLedgerService for append-only ledger operations - Implement FEFOAllocationService for First-Expire-First-Out logic - Implement PostingService for automated GL posting (GRN, Shipment, Adjustments, Returns) - Implement ApprovalService for maker-checker workflows - Implement POSService for transaction processing and shift management - Implement PrescriptionService for prescription management - Fix schema mismatches to align with service implementations - Add missing fields and enums to Prisma schema Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
- Document completion of Phases 1-2 (database schema and core services) - Outline remaining work for Phases 3-7 - Provide next steps and recommendations - Include team staffing and timeline guidance Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement Pharma ERP and POS system with all features
feat(erp): Implement Pharma ERP + POS foundation (database schema and core services)
Jan 10, 2026
Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
…evelop-backend-business-logic
…entation Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
… division by zero, remove unused variables Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
…nitions Co-authored-by: syed-reza98 <71028588+syed-reza98@users.noreply.github.com>
Refactored API route handlers to use generic type parameters for context, improved type safety, and updated service methods for better API compatibility. Added aliases like listItems, listGRNs, listPurchaseOrders, listSalesOrders, and discontinueItem to service classes. Enhanced validation schemas, improved error messages, and ensured date fields are properly converted. Updated getCurrentUser to include organizationId and isSuperAdmin. Fixed type errors and removed organizationId from service method calls where not needed. All TypeScript errors are now resolved.
Introduces a detailed implementation plan for Phase 4 of the StormCom pharma ERP system, covering UI and API development for 52 screens across 7 ERP modules and POS. The plan includes module breakdowns, reusable UI patterns, security and RBAC guidelines, week-by-week roadmap, file structure recommendations, and success metrics.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
pharma-erp
Phase 0
Priority 1
production
Changes for Production Environment and Configuration
type:story
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Implements foundation layers (Phases 1-2) for a pharmaceutical inventory and accounting ERP with integrated Point of Sale system. Adds 31 database models with regulatory compliance controls (lot tracking, FEFO allocation, immutable ledgers) and 7 service classes for inventory, procurement, sales, accounting, and POS operations.
Database Schema (Phase 1)
31 new models across 6 domains:
ErpItem(pharma attributes: dosage, strength, storage conditions, shelf-life),ErpSupplier,ErpWarehouse,ErpLocation,ErpChartOfAccountErpLot(lot/expiry tracking),ErpInventoryLedger(append-only),ErpStockBalance(materialized view)ErpPurchaseOrder,ErpGRN(goods receipt with lot capture),ErpSupplierBillErpSalesOrder,ErpAllocation(FEFO-based),ErpShipment,ErpReturn(with QA disposition)ErpGLJournal(immutable),ErpPostingRule(auto-posting),ErpARInvoice,ErpAPInvoice,ErpPaymentPosCashierShift,PosPrescription,PosTransaction,PosSyncQueue(offline support)SQL enforcement:
All tables scoped by
organizationId/storeIdfor multi-tenant isolation.Core Services (Phase 2)
7 service classes with transactional integrity:
RepeatableRead/Serializable)postGRN(): Dr Inventory / Cr GRNIpostShipment(): Dr COGS / Cr Inventory + AR invoicepostAdjustment(): With maker-checker threshold checkspostReturn(): QA disposition to GLKey Features
Remaining Work
This completes ~30% of the full implementation. Remaining phases:
See
docs/pharma-erp/IMPLEMENTATION_STATUS.mdfor complete status and next steps.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.