Commit graph

9 commits

Author SHA1 Message Date
5a1db32cee feat(po): new PO form with line items, GST rate, structured T&C and file uploads
Form sections: order info, quotation reference (PI No/Date), requisition (No/Date),
place of delivery, line items (UoM dropdown, size, GST% per item), vendor, T&C, attachments.
Line items editor: add/remove rows, GST dropdown (0/5/12/18/28%, default 18%),
live taxable/GST/grand-total breakdown.
T&C: fixed line 1, individual inputs for Delivery, Dispatch, Inspection,
Transit Insurance, Payment Terms, Others.
Save as draft or submit directly for approval (→ MGR_REVIEW).
2026-05-05 23:25:06 +05:30
94774ca96b feat(dashboard): role-specific dashboards for submitter, manager, accounts and admin
Submitter: open PO count, recent orders table, New PO CTA.
Manager: approvals count, approved PO listing, spend by vessel and month bar charts (Recharts).
Accounts: payment queue total value, ready-for-payment count.
Admin/Auditor: total PO count card.
2026-05-05 23:24:55 +05:30
77aafcce99 feat(ui): shared component library — buttons, badges, cards, inputs, header, stat cards 2026-05-05 23:24:46 +05:30
62c5a52fc0 feat(storage): file storage with local dev server and Cloudflare R2 for production
Sign API returns presigned upload URL + storage key.
Dev: files served through auth-gated /api/files/dev route with path-traversal protection.
Prod: R2 presigned URLs for upload and time-limited download.
2026-05-05 23:24:41 +05:30
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