Commit Graph
63 Commits
Author SHA1 Message Date
kavehhn b708a6b777 fix(healthcheck): use dynamic PORT, IPv4 127.0.0.1, and bind 0.0.0.0 2026-08-25 02:56:42 +03:30
kavehhn 38e048067b fix(docker): copy .npmrc and use npmmirror registry for fast builds 2026-08-25 02:43:34 +03:30
kavehhn 4d711fe39c build: add .npmrc with liara npm mirror registry 2026-08-25 01:58:16 +03:30
kavehhn dca7250be0 feat(users,professors): add promote student to professor and full student profile aggregation 2026-08-24 22:52:38 +03:30
kavehhn 282dd42422 feat: add employee timing system, notification templates, and professor class plan sms 2026-08-24 19:31:07 +03:30
kavehhn 53fce86ad5 feat: add waitlist module, quick payment/transaction edit, and catering fee deduction from professor share 2026-08-23 23:00:02 +03:30
kavehhn e3b51a1629 feat(financial-reports): add institute-wide analytics endpoint
Adds GET /financial-reports/admin/analytics returning daily/weekly income
trends (cash received vs. accrued session income), a multi-month
received/payout/expense/profit breakdown, a per-class income-per-session
leaderboard, payment-status distribution, and a due-date driven cash-flow
forecast (overdue + upcoming installments) to power richer charts on the
dashboard's financial reports page.
2026-08-23 18:24:32 +03:30
kavehhn 3cc813f24e fix(payments): enhance duplicate payment check query and auto-populate course 2026-08-23 16:55:48 +03:30
kavehhn dde0efc72a fix(sessions): respect database sort order in getAllSessions and getMySessions 2026-08-23 16:41:49 +03:30
kavehhn 22ce6c3fb1 fix(payments,dates): improve duplicate payment detection and Jalali date parsing 2026-08-23 14:15:06 +03:30
kavehhn 945b4e6332 fix(payments): ensure ObjectId casting for duplicate check query 2026-08-23 13:35:30 +03:30
kavehhn 28d401fd0e feat(payments): add bulk class payments creation and duplicate check 2026-08-23 13:28:06 +03:30
kavehhn 4c07ca2ae1 fix: format prices in notifications, change partial payment label, and add session holding notify API 2026-08-21 20:17:30 +03:30
kavehhn 6839685a21 fix(payments): import buildClassScheduleContext to fix sms notifications 2026-08-21 15:25:02 +03:30
kavehhn ada1b624b1 fix(payments): prevent auto transaction creation, enable sms by default, and fix transaction sms context 2026-08-21 15:17:41 +03:30
kavehhn 30db6582b7 feat: auto generate placeholder nationalId for users and professors, auto calculate class end date 2026-08-21 15:03:18 +03:30
kavehhn cbcf3f55db fix(perm): allow array of permissions in permissionMiddleware and accept classes:update or classes:delete 2026-08-21 13:35:16 +03:30
kavehhn e34fd25af7 feat: add soft delete for classes with cascade to sessions and linked records 2026-08-21 13:19:50 +03:30
kavehhn 5b56171328 fix: allow payload.professors in dataImportController and normalizeImportPayload 2026-08-21 13:05:28 +03:30
kavehhn 7c74950c95 feat: add professor import support, user account creation, and IBAN/card fields 2026-08-21 12:56:15 +03:30
kavehhn 22b57eeae2 Add professor share calculation and financial reporting feature
Introduces per-class payout configuration (percentage or hourly rate,
plus an optional per-session expense allowance), pure calculation
utilities for professor payout/net profit/receivables, and a new
financial-reports API surface with per-class, per-session, and
date-range/monthly reports. Also adds full CRUD for institutional
expenses used in the range report, and wires up the new permissions
and roles. Fixes a pre-existing ReferenceError (missing
parseImportDate import) in paymentService that blocked creating
payments with dated transactions.
2026-08-21 12:19:09 +03:30
kavehhn 3c6eb278b0 Allow enabling/disabling individual SMS template types from dashboard with sync to notification settings 2026-08-21 11:04:26 +03:30
kavehhn 091e519280 Add sessionHolding template, unique 8-digit codes, reason slot for sessionCancelled, and disable unused notifications 2026-08-21 10:44:51 +03:30
kavehhn 5328f36f06 Add admin transaction cancellation without deleting history.
Cancelled transactions are excluded from paid totals and due-date
calculations while remaining visible for audit purposes.
2026-08-16 22:38:00 +03:30
kavehhn a436cfeb47 Stop reconcile from overwriting edited transaction amounts.
When updating a transaction, skip automatic pending-amount adjustment so
admin edits to amount, due date, and other fields are preserved.
2026-08-16 22:36:12 +03:30
kavehhn 8cd355c24b Fix transaction due date parsing and preserve edited pending amounts.
Parse Jalali date strings correctly when saving transactions, and skip
reconcile amount overwrites when pending totals already match the balance.
2026-08-16 14:53:46 +03:30
kavehhn 4ad5630cb7 fix: clarify why SMS delivery is skipped when a channel gate is off
Surface env vs dashboard disable reasons in SMS logs so password reset and other sends are easier to diagnose when only one layer is enabled.
2026-08-16 13:30:51 +03:30
kavehhn 7d59448991 Improve attendance completion checks and expose recorded counts.
Only count existing enrolled students when deciding if a session is fully recorded, and return per-session attendance totals for the dashboard list.
2026-08-16 09:22:41 +03:30
kavehhn 0d57854dc3 Add class numberOfSessions and fix attendance completion detection.
Sessions with full student attendance are now excluded from the pending list reliably by loading class rosters from the database.
2026-08-16 08:55:03 +03:30
kavehhn cd98adff84 feat: add pending student registration flow and pricing APIs.
Support public class lookup, user provisioning, installment pricing, and admin approval before final enrollment.
2026-08-16 08:42:25 +03:30
kavehhn fafc362689 fix: filter attendance sessions to past-due with incomplete records
Only list sessions after their end time when at least one enrolled student lacks attendance, and expose attendanceScope on session listing.
2026-08-16 08:22:18 +03:30
kavehhn f57d8bbdfa feat: add class discounts, frontend visibility, and public listing
Add hasDiscount, freeSpots, and showOnFrontend on classes with a public get-all endpoint and richer notification user populate.
2026-08-16 08:11:42 +03:30
kavehhn 21bff0c4ba feat: add admin transaction create/update with auto payment status sync
Allow admins to edit transaction amount and status, recalculate payment totals, and mark invoices fully paid when paid transactions cover the payable amount.
2026-08-16 08:01:37 +03:30
kavehhn 06efcd5b90 feat: store payment installments in a transactions collection
Move embedded payment rows into Transaction documents with due dates so remaining tuition can be tracked separately from paid amounts.
2026-08-16 07:32:27 +03:30
kavehhn b4ca5678bf Add user preferences for theme and font size.
Persist per-account UI settings so the dashboard can restore default light/dark mode and font size on login.
2026-08-16 07:28:58 +03:30
kavehhn 3348ca5798 feat: import class sessions, attendance, and payments from JSON
Match students by name when national ID or phone is missing, parse Jalali dates, and allow sessions without a professor.
2026-08-16 07:04:16 +03:30
kavehhn 72be01fee3 feat: add messaging toggles, password reset SMS, and payment discounts
Allow SuperAdmin to disable SMS, email, and bot from dashboard settings on top of env flags. Add admin password reset with credentials SMS, plus payment discounts, notes, and payable amount handling.
2026-08-16 06:58:08 +03:30
kavehhn a6c760c3b7 fix(sms): prefix course time with ساعت
SMS courseTime now reads «از ساعت 19 تا 21» instead of «از 19 تا 21».
2026-08-16 00:16:40 +03:30
kavehhn 4d60755a95 feat(classes): store weekdays and meeting times on the class
Keep the class schedule on the class itself so SMS and listings do not have to infer days and hours from sessions.
2026-08-15 23:59:07 +03:30
kavehhn 192c595c68 feat: add password change, class unenroll, and optional notify flags
Let admins skip SMS on user, class, and invoice actions, and let users change their own password with the current one.
2026-08-15 23:48:18 +03:30
kavehhn 0cdb9cec20 feat(sms): send class start date, days, and course time
Expose schedule fields on class and invoice templates so SMS can include Jalali start date, weekdays, and hour range.
2026-08-15 23:09:04 +03:30
kavehhn 366cd41bb7 fix(settings): persist every SMS template variable on save
Mongoose Mixed updates were dropping extra invoiceCreated variables after a successful save.
2026-08-15 22:55:54 +03:30
kavehhn d3190a8729 fix(settings): support Persian and flexible SMS variable names and improve save persistence 2026-08-15 22:03:22 +03:30
kavehhn d2d4ee719b feat(settings): support dynamic number of SMS template variables 2026-08-15 21:58:10 +03:30
kavehhn 9472537536 fix(professors): handle nationalId and phone aliases with trimming; update payment sms 2026-08-15 19:07:17 +03:30
kavehhn 93f3aeb719 feat(sms): add FULLNAME, PAYMENT_PRICE, and COURSE template variables for invoice SMS 2026-08-15 18:55:17 +03:30
kavehhn 1ef54ad414 fix: stream FilePond uploads to S3 and proxy private file previews
Disk-based multer plus an authenticated content endpoint match the working Node.js uploader and avoid browser signed-URL failures on SeaweedFS.
2026-08-15 18:46:26 +03:30
kavehhn 7ebf9409f0 feat: let SuperAdmin rename SMS template variable names
Store custom sms.ir parameter names per template slot so outbound messages match the panel placeholders.
2026-08-15 18:43:24 +03:30
kavehhn 3160f07873 feat: send account and invoice SMS from stored template IDs
Move sms.ir template IDs out of env into settings so SuperAdmin can manage them, and record every outbound SMS status in notifications.
2026-08-15 18:37:44 +03:30
kavehhn 23edffba6a fix: rewrite temp files with PutObject instead of SeaweedFS CopyObject
CopyObject returns InternalError 500 across buckets, so commits now Get+Put and ensure the documents bucket exists on startup.
2026-08-15 03:33:55 +03:30
kavehhn 877dfa65d5 fix: treat SuperAdmin role name case-insensitively in permission checks
The seeded role is SuperAdmin, but the middleware only matched superAdmin, so SuperAdmin could be denied documents and other new permissions.
2026-08-15 03:27:21 +03:30
kavehhn e1772a2559 fix: force HTTPS S3 endpoint to avoid Coolify 307 on uploads
http://s3 hosts redirect to https; AWS SDK cannot follow PUT redirects, which caused XML parse errors.
2026-08-15 03:04:53 +03:30
kavehhn aa2132f02c fix: disable AWS SDK checksum defaults for SeaweedFS uploads
PutObject was failing with XML parse errors because flexible checksum headers are unsupported; match SeaweedFS recommended S3 client settings.
2026-08-15 03:00:42 +03:30
kavehhn 7394829d49 fix: honor table search q param on users and related lists
Dashboard sends q, but users/classes/payments ignored it; accept q/search and normalize Persian digits.
2026-08-15 02:57:19 +03:30
kavehhn 4603b45208 feat: private certificates/documents buckets with SeaweedFS support
Add Document CRUD, temp→bucket commit flow, SeaweedFS env aliases, and default temp bucket name to temp.
2026-08-15 02:53:59 +03:30
kavehhn 5c2fad4b44 feat: add adminNotes and registered class counts for users
Expose nationalId aliases and enrollment counts on user list responses, and store admin notes on users, classes, and sessions.
2026-08-15 02:39:10 +03:30
kavehhn bf5e66fa95 feat: add append-only course/user data import and expand user profile
Support uploading structured JSON to create courses, classes, and students without wiping existing data, and merge user name fields while adding gender and registration details from source sheets.
2026-08-15 01:31:44 +03:30
kavehhn 35704409ec feat: bootstrap SuperAdmin from env and lock one-time seeding
Production creates the SuperAdmin from env credentials, and dashboard seeding is authenticated, SuperAdmin-only, and locked after the first run.
2026-08-14 23:23:06 +03:30
kavehhn 3ca098b74d build(docker): add multi-stage production Dockerfile with health check 2026-08-12 06:46:04 +03:30
kavehhn d0cde07a1f feat: add /api/seed endpoint and refactor seed.js 2026-08-12 06:29:05 +03:30
kavehhn d28e71c3fa chore: update node version to 22 in Dockerfile 2026-08-12 05:55:55 +03:30
kavehhn 07edb98a05 feat: enhance health check endpoint with database status check 2026-08-12 05:26:00 +03:30
kavehhn f04c797be6 Initial commit: teaching institution management API.
Express/MongoDB backend with JWT auth, RBAC, S3 uploads, notifications, and scheduled jobs.
2026-08-09 04:18:08 +02:00