Commit Graph

21 Commits

Author SHA1 Message Date
Samer Salameh 4066151033 Refinery (المصفاة): port trips, wage claims, commission claims, wallets, variables and cards from AqabaTCS
New API slice under /api/v1/refinery (Dapper on the NAFITHTCS REFINERY_* tables), web screens under features/refinery,
Dinarak and Jopetrol gateways (off by default, secrets from env), remaining-balance recalculation after the ton price
correction, Excel reports (trips, operator, exchange, diesel, cards, bank). Access only through permission keys:
db/refinery-permissions.sql gives the 6 screens and all action keys to PTADM (SU always allowed).
Docs: docs/refinery-agent-brief.md, docs/refinery-db-objects.txt (legacy views and diesel functions), ENVIRONMENTS.md.
The REFINERY_OIL import job and the daily totals email job are not ported.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 16:41:19 +03:00
Samer Salameh a318d2b2f0 Grid filter panel: Arabic captions "البحث" for the title and the apply button
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 16:41:18 +03:00
Samer Salameh 514a76d7c7 Billing: raise max sent weight (الوزن المرسل) from 50000 to 60000
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 11:47:34 +03:00
Samer Salameh 91d6416198 Registry: fix trailers table alignment in truck view, add created on/by, default new driver nationality to Jordan
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 09:35:04 +03:00
Samer Salameh 3a230fd556 Orders: back button label "عودة" on the new order form, grid asks for a filter when none is set
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 17:03:02 +03:00
Samer Salameh 2a339afee3 Permits list: shortcuts to the tender order permits and distribution summary reports
Shown per report permission, same as the orders report shortcut.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 15:01:25 +03:00
Samer Salameh 0eb83d3bb5 Registry exports, ratios report as legacy Excel, RED_SEA distribution, UI fixes
- Trucks / trailers / drivers Excel export, allowed only by DB permission keys grains.registry.*.export (db/registry-export-permissions.sql)
- Bulk order ratios report: CSV removed, legacy HTML-table Excel, added to the Reports menu, cleaner layout
- Distribution: new category RED_SEA (البحر الأحمر)
- Tender order: shift optional, loading site and destination searchable
- Supply order shows company number; chassis number hidden in registry grids
- Change password: rules shown, validation messages translated and detailed
- Menu: Finance first, "الطلبيات"; toast auto-hide shortened

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 14:21:57 +03:00
Samer Salameh cc0cde3219 Login page: split layout with symbolic brand panel, white transparent logo, copyright footer
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 10:05:34 +03:00
Samer Salameh 025fbe9af8 Scheduled jobs: SU screen to start, stop and time the three legacy jobs
- Jobs: activate-company-destinations, close-old-permits (new port of GRAINS_Close_Old_Permits.cfm), fill-company-shares
- Interval (minutes/hours) or daily fixed times, run now, run history; database-row lock; tables from db/grains-jobs.sql
- Scheduler loop (off in Development), SU-only JobsController, web page /jobs
- Fix ORA-01745: no reserved words (BY, ROWS) as bind names; stale RUNNING marks heal themselves

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 17:15:24 +03:00
Samer Salameh eaf52d53d9 Match legacy: blacklist shift, dialer callback parsing, trailer edit and revoke rules; record owner decisions
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 16:34:15 +03:00
Samer Salameh bf1c04b590 Security hardening, time zone, voice call SOAP, registry fixes, CO role, remarks byte limit
- Permits: confirming a turn (accept/reject/revoke-accepted) is staff-only; submit needs REQST; company access check no longer passes null; seed/check-trucks SU-only; duplicate company-destinations endpoint removed
- Registry: attachment download scoped to the user's company; long original names and 20-char column caps; add-trailer button after revoke
- Dialer callback: constant-time key, NO_ANSWER only for REQST and legacy-style reset, postpone days capped
- Voice call: SOAP callAPI like legacy, single flight, started/busy results
- Company turn permits: truck number editable
- Blacklist remarks cut by UTF-8 bytes (500-byte column)
- Distribution: BlCategory bind, OPEN guards, process-with-destination dropdowns and server check, per-category confirmation
- Container TZ=Asia/Amman; production ownership code lists; IVR config
- Role CO (same rights as GTO), date field padding, home page grouping, grid and report fixes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 15:55:03 +03:00
Samer Salameh 83cf3c9b03 GTO reports, voice call action, SYSTEM_ERRORS logging, report fixes, collapsed menu logo
- Grant GTO the tender-order and distribution-summary reports (db/gto-reports.sql)
- Companies/owners turn: translated values, centered counters; default order date today; tender-order left-to-right, no status filter
- Voice call button on permits list (grains.permits.voiceCall), IVR config in production
- Save unexpected server errors into SYSTEM_ERRORS
- Collapsed sidebar shows the brand mark
- Production attachment paths set to /mnt/NTPFiles

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 11:28:14 +03:00
Samer Salameh cc5772092f Production attachments on /mnt/NTPFiles; center trucks/used columns in orders grid
- appsettings.Production.json: Grains:Registry UploadedFilesPath=/mnt/NTPFiles, TempUploadPath=/mnt/NTPFiles/tempuploadedfiles
- docker-compose (prod): bind-mount /mnt/NTPFiles into the container
- Orders grid: عدد السيارات / المستخدم centred

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 09:13:48 +03:00
Samer Salameh e5159c7383 Billing: port new Invoice.cfc rules; invoice/document number mapping; grid tweaks
- addBillingInfo: price = GRAINS_WAGE rate and fine price = GRAINS_FINE rate of the
  claim's cargo type on the loading date; final cost = wage - shortage fine; invoice
  cargo-family check (38 / 74 / 39+41); archived-invoice and duplicate-permit checks;
  first billing creates the INVOICE row; unclosed permit is closed with a "Billing Close."
  event; company name from NTP_TENDERS_COMPANIES; raw permit weights no longer stored.
- getBillingInfo: permits since 2020, tender company name, last invoice per user, already-billed check.
- "رقم المطالبة" is stored in INVOICENUMBER and "رقم المستند" in SERIALNO (digits only).
- Wages grid shows the wage with 4 decimals; invoices grid gets a company-number column;
  count / sent / received weight columns centred.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 16:54:31 +03:00
Samer Salameh cbdfe423c1 Date fields as dd/mm/yyyy; no spinner on number fields; empty billing fines default to 0
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 15:58:07 +03:00
Samer Salameh 174734c359 Billing entry: editable weights and fines, all destinations; searchable company lists; dark disabled text
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 15:21:24 +03:00
Samer Salameh 1b3a8500ab DISP role: view tender-order permits of own company; permit edit dialog (trailer and driver only, validate on Enter)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 12:24:04 +03:00
Samer Salameh e24ab12182 Deploy: QA and production Docker setup, serve web app from the API, report menu names
- deploy/qa and deploy/prod: Dockerfile (API + built web app), compose, .env.example, Apache vhost templates
- API serves wwwroot with an SPA fallback that leaves file requests to the static file middleware
- Docker/ENVIRONMENTS docs for QA and production
- Reports menu: drop the word تقرير from the item names

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 17:31:22 +03:00
Samer Salameh b88ced45c4 Grains finance: GNAC screens, invoice archive/activate, legacy Excel, invoice check
- New fines (الغرامات) and wages (الأجور) lists; GNAC finance screens seed script
- Invoices: archive/activate actions, legacy-format Excel export, active invoices listed
- Billing grid: truck-number label, invoice filter, invoice/by columns, reroute and delete actions
- التأكد من الفواتير page (port of FinancialRpts); hide financial and orders reports (DISABLED rows)
- Browser tab icon, remove "reconstructed columns" note, move API http port to 5181

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 16:41:53 +03:00
Samer Salameh 21328b7d1a Grains: menu reorganisation, DB-driven permissions, form/grid polish
- Create-permit and register-turn become DB authorities (grains.permits.create, grains.orders.supply)
- Reorganise menus (permits, orders, finance, flat reports) and fix sidebar expand/collapse
- Company destinations grouped by cargo type; weighbridge screen reduced to manual weighing
- Hide absence toggle; remove PDF actions from reports; loading-weights uses literal dates
- FormCard/SectionTitle components, framed DataGrid with row hover
- DB scripts: menu-reorganisation, permits-create-permission, disabled-features, events perf notes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 11:18:04 +03:00
Samer Salameh 0c0b64239c Initial commit: NTP V2 (.NET 10 API + React web) with Dev, QA and Production environments
Rebuild of the legacy ColdFusion NTP Grains module: Orders, Permits, Registry and Reports on a Dapper/Oracle API with a
metadata-driven React front end (Arabic RTL default, English LTR, light and dark).

Environments
- API: appsettings.{Development,QA,Production}.json carry only non-secret settings. Connection strings, Jwt__Key, CORS origin and
  super users come from the server environment. Production and QA CORS origins fail closed until set. launchSettings gets a QA profile.
- Web: Vite modes qa and production (web/.env.qa, web/.env.production), configurable VITE_API_BASE, scripts build:qa and build:prod.
- docs/ENVIRONMENTS.md documents the three environments, required settings and a new-environment checklist.

Security and access
- Backend-driven permissions (GET /auth/permissions, [RequirePermission]) from GRAINS_SCREEN_PERMISSIONS; SU always allowed.
  SQL in db/ (grains-screen-permissions.sql, registry-create-permissions.sql).
- OracleCredentialGuard stops retrying an account after ORA-01017 so a misconfigured copy cannot lock the database account.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 11:56:48 +03:00