- 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>
- 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>
- 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>
- 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>
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>