Commit Graph

28 Commits

Author SHA1 Message Date
marshal
436347f7a6 Merge pull request #1500 from Tria-plc/freight_feature/usermanagement 2026-09-04 21:39:01 -08:00
ghost2023
4b3e8ad32c feat(landing): add front door routing to passenger and freight
edrsc.com had no entry point — a visitor could not tell which of the two
apps they wanted. This adds @edr/landing: one static page whose job is to
make that choice obvious, with the two doors above the fold and the rest
kept to supporting context.

Fills in apps/edr-landing/, which until now held an orphaned next-env.d.ts
from an abandoned Next 15 start and was built by nothing.

- Next.js 14 static export. Versions mirror the passenger portal exactly,
  so they resolve to what the lockfile already had and add 6 packages.
  Depends on no workspace package — @edr/ui-common's Tailwind 4 tokens do
  not fit this Tailwind 3 setup.
- Destinations come from NEXT_PUBLIC_PASSENGER_URL / NEXT_PUBLIC_FREIGHT_URL
  as origins, with the entry path appended in src/lib/apps.ts. Freight links
  to /portal rather than /, which is that app's own marketing landing.
- Design lifted from EDRFreightLandingPage so the two public surfaces read
  as one railway. Figures (752 km, ~16 h) are the ones freight already
  asserts publicly.
- Fonts load as a stylesheet, not next/font: next/font fetches from
  fonts.googleapis.com during `next build` and failed the build outright on
  a machine without network. Verified deterministic over repeated builds.
- CountUp renders its final value server-side and the reveal animation's
  hidden state is scoped behind html.js, so the page is complete with
  JavaScript off instead of blank.

turbo.json: a static export's artifact is out/, which the build task did not
list — a cache hit would have restored a build with the artifact missing.
Also gitignored.

Dockerfile.web: passes the two NEXT_PUBLIC_* build args through (a static
export inlines them at build time, so runtime env does nothing), and exempts
this app from the VITE_* required-check that guards the freight Vite apps and
would otherwise fail its build.

Claude-Session: https://claude.ai/code/session_011ZMMHwK4Ham1Dt19FVZQj3
2026-09-04 20:32:53 +03:00
Hagernesh
2644d5e52d feat(eims): add invoice mapper and signed EIMS transport
Map EDR invoices onto the MoR EIMS /v1/register document and add the
cryptographic transport needed to talk to core.mor.gov.et.

Mapper: DTOs mirror the supplied Postman collection section by section.
Tax is resolved per line via a caller-supplied resolver and throws when
unresolved -- the app models no tax at all (invoice.taxAmount is always 0,
invoice_lines and the rate catalogue carry no fiscal columns), so a
zero-rated default would assert a tax position the codebase cannot support.
Seller identity, document number, counters and previous IRN are passed in
explicitly; the mapper stays pure.

Transport: config, credential loading, RSA-SHA512 signing and /auth/login
with an in-memory token cache. Signing reproduces the process that produced
a working live token -- compact JSON of the inner request only, exact UTF-8
bytes, base64 signature, and base64 of the certificate file's exact bytes
with no parsing or re-encoding. Concurrent callers share one login via an
in-flight promise. Refresh is deliberately unimplemented: the collection
shows an unsigned refresh body but also ships unsigned examples of calls
that do require signing, so an expired token re-logs in instead.

Errors normalise to EimsApiException carrying only the gateway's own error
fields; secrets, signature, certificate and tokens never reach logs.
Key and certificate file patterns are gitignored.

Nothing calls EIMS automatically and no invoice entity, migration or UI is
touched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 15:08:40 +00:00
SennayT
5145827feb remove obfuscated code 2026-08-07 09:51:56 +03:00
Hagernesh Tadesse
b4ac92e14e Merge pull request #1140 from Tria-plc/lastmilerequest 2026-08-06 01:19:08 -07:00
Nathnael
415ae52143 test(integration): boot freight API in-process across parallel shards
The suite drove a containerized freight API, so every code change needed an
image rebuild before a test could see it, and there was no way to attach a
debugger. Files also ran strictly in sequence against one shared database,
which is the root of the warm-stack gotchas the README documents: stowaway
paid bookings climbing back aboard, a short consist on the fifth file.

The freight app now boots inside each vitest worker from dist/, and each
worker owns a whole shard of the topology - its own database, payment API,
gateway mock and broker vhost - so nothing mutable is shared and files run
in parallel. Full suite drops from roughly 20 minutes to 196s at 4 shards.

- main.ts exports createFreightApp() so the harness applies the same prefix,
  pipes, filters and interceptors as production instead of replaying them by
  hand; self-start is guarded by require.main so the Dockerfile CMD still boots
- booking-window tick cadence is env-driven (BOOKING_WINDOW_TICK_CRON), */1 in
  the suite, */10 unchanged in production
- prepare-shards.mjs seeds a template database (boot seeders, then the SQL
  fixtures that depend on them) and clones it per shard; it.mjs re-clones on
  every run, so each run is hermetic
- gateway mock and payment API are generated per shard: the mock keeps modes
  and orders process-global and 20 of 25 specs reset it in beforeAll, and the
  inbound CBE bill query has to reach one specific shard's app
- poll() samples every 250ms instead of 2000ms, keeping the caller's deadline
- authz.it.ts seeds its own invoice; it previously read another spec's leftover
  and returned early, which silently passed on a pristine database

Known: an unlocked MAX(sequence_no)+1 in train-scheduling.service.ts races
under concurrent allocation and leaves a short consist, so 1-3 specs fail
intermittently. Pre-existing and reproduces at the production tick cadence.
2026-08-04 12:43:25 +00:00
Marshal
54b5882355 changes 2026-07-25 06:05:20 +00:00
Marshal
668b5e1c9d add permissions and fix issues 2026-07-23 20:24:20 +00:00
Muluhabt
64e1130f7d Commiting stop based booking 2026-07-23 20:11:11 +03:00
Muluhabt
9782dd0fe3 Fixing isssues usins AI 2026-07-22 16:42:07 +03:00
Nathnael
eb36aab05f chore: enhance the tests 2026-07-21 13:10:44 +00:00
Nathnael
b8b8c4adf7 feat(e2e): add freight e2e docker-compose stack with isolated services 2026-07-21 11:00:02 +00:00
Marshal
1abef3ce34 enhance shipment requests page with filtering and sorting options
- Added status and cargo filters to the ShipmentRequestsPage.
- Implemented date range filtering for preferred dates.
- Introduced sorting options for shipment requests based on submission date and reference.
- Enhanced the display of shipment request details, including status badges and customer information.
- Updated the UI to include a search input with clear functionality and improved layout for filters.

feat: add equipment return option in new shipment form

- Introduced a toggle for equipment return in the NewShipmentPage.
- Updated form schema to include  field for container contracts.
- Enhanced user experience with visual feedback on the equipment return selection.

fix: update booking DTO to include equipment return option

- Added  field to CreateBookingUnderContractDto for per-shipment override.
- Updated related types and schemas to accommodate the new field for better contract handling.
2026-07-10 10:32:41 +00:00
yaschalew
5897dc342d fix conflict 2026-06-24 10:08:19 +03:00
Muluhabt
f25a237dc0 Remove malware 2026-06-22 16:27:02 +03:00
Abubeker Yasin
45383a4f43 Merge pull request #226 from Tria-plc/alpha 2026-06-19 23:28:59 -07:00
Hagernesh
89d651693b automation of loading and unloading 2026-06-17 22:33:06 +00:00
Yonas Tewabe
2a9729304f Update .gitignore 2026-06-17 14:54:11 +03:00
Yonas Tewabe
999a58011c Update deploy.yml 2026-06-17 04:00:10 -07:00
Sennay
4b7a5990d7 Update .gitignore to remove malicious entries
Remove temporary files from .gitignore
2026-06-13 09:13:39 +03:00
hagiye
7facbeda22 Train scheduling API,Routes and UI 2026-06-08 16:31:28 +03:00
Eyosiyas
a1940c4901 telebirr out in the payment 2026-06-08 11:49:50 +03:00
Stephanos A
d80f77b941 Passenger portal build issues resolution 2026-06-03 08:12:40 -07:00
Michael Abebe
57776c4fef feat(freight:backoffice): role and permission seeder 2026-06-01 16:28:04 +03:00
SennayT
44072ca3c5 run migrations in pipeline 2026-05-19 09:28:54 +03:00
Michael Abebe
199a3eba11 fix: removed "test" entry for vite config 2026-05-12 17:40:03 +03:00
Michael Abebe
4540d35215 chore: added a .gitignore 2026-05-12 16:31:34 +03:00
Michael Abebe
516bbbb42b chore: fixed pnpm install issues, regarding package versions 2026-05-12 16:09:25 +03:00