Commit graph

155 commits

Author SHA1 Message Date
92b80dd278 feat(notifications): email notifications via Resend with React Email templates
7 event templates: po-submitted, po-approved, po-rejected, edits-requested,
vendor-id-needed, payment-processed, receipt-confirmed.
Notifier uses Resend in production and console.log in development.
2026-05-05 23:24:34 +05:30
c67afb2fff feat(state-machine): PO lifecycle state machine with role-gated transitions
10 statuses, 11 transitions. Each transition declares allowedRoles,
requiresNote flag and sideEffects (which email groups to notify).
Helpers: getTransition, canPerformAction, getAvailableActions, requiresNote.
2026-05-05 23:24:24 +05:30
043b26921a feat(auth): NextAuth v5 credentials login, database sessions and role permissions
7 roles: TECHNICAL, MANNING, ACCOUNTS, MANAGER, SUPERUSER, AUDITOR, ADMIN.
hasPermission / requirePermission helpers used across all server actions.
Login page with email + bcrypt password auth.
Middleware protects all portal routes.
2026-05-05 23:24:15 +05:30
535200aca2 feat(db): Prisma schema with all 11 models, migrations and seed data
Models: User, Vessel, Account, Vendor, Product, PurchaseOrder, POLineItem,
PODocument, POAction, Receipt, Notification.
PO fields include piQuotationNo/Date, requisitionNo/Date, placeOfDelivery,
structured T&C (tcDelivery/tcDispatch/tcInspection/tcTransitInsurance/
tcPaymentTerms/tcOthers), currency default INR.
POLineItem includes gstRate (default 0.18).
Vendor includes address, gstin, contactMobile.
Seed: 5 users across all roles, 3 vessels, 3 accounts, 3 vendors, 3 POs, 4 products.
2026-05-05 23:24:04 +05:30
36f3826684 chore: initialize Next.js 15 project with Tailwind, TypeScript and tooling config 2026-05-05 23:23:43 +05:30