Commit Graph

82 Commits

Author SHA1 Message Date
Hagernesh
c937290019 feat(eims): resolve buyer geography from the MoR location master
BuyerDetails Country/Region/City/Wereda now resolve from the Ministry's own
EIMS_COUNTRY_REGION_VW master instead of the EIMS_BUYER_*_CODES env maps and
the ethiopia-geo-codes table. Both invented their codes and looked names up
globally, so KERSA/GORO/BABILE/BURE — each present in several zones with
different LOCALITY_NOs — could be filed against the wrong jurisdiction.

Resolution is hierarchical and refuses to guess: an unknown or ambiguous
address raises a local validation error naming the level that failed, and
never selects the first matching row. Spelling differences between EDR and
MoR live in a reviewed, parent-scoped alias layer; the dataset itself stays
verbatim so it remains traceable to the Ministry sheet.

Resolution now runs before the counter reservation in both the single and
bulk paths, so a bad company address no longer burns an EIMS sequence number.

Adds eims:import-locations to regenerate the dataset from a future workbook,
reporting duplicate rows and same-hierarchy code conflicts.
2026-08-24 06:59:50 +00:00
Nathnael
b7583df426 feat(freight-api): replace canned reports with a generic report engine
Nuke the 17 hand-written raw-SQL reports (no pagination, hard LIMITs) and
the reports module built around them. Replace with a resolver contract:
a report declares columns/filters/permission and a TypeORM QueryBuilder;
ReportRunnerService applies filtering, a whitelisted sort, offset/limit
paging, and a COUNT(*) FROM (query) wrapper for the total (getCount() is
wrong for GROUP BY). ReportExportService re-runs the same resolver
unpaginated for xlsx (exceljs) and pdf (existing PdfRenderService, now
landscape-capable) exports.

Ships with 4 reports: bookings-list, revenue-by-customer,
aging-receivables, contract-utilization. Catalog + per-report permission
checks live in the controller; adding a report is one new definitions/
file plus a REPORT_KEYS entry, no frontend change.
2026-08-13 07:52:20 +00:00
marshalyordanos
35e5404b41 Refactor code structure for improved readability and maintainability 2026-08-11 19:36:00 +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
Nathnael
d5622ed360 chore: install auditlog pkg 2026-08-05 13:39:45 +00:00
ghost2023
aaf0aa3c92 fix(verifayda): format nested Fayda address objects into strings 2026-08-02 00:11:39 +03:00
Nathnael
784f6ac6f2 Merge branch 'dev' into update-freight-migrations 2026-08-01 10:59:41 +00:00
Nathnael
dfdb79301d chore(freight-api): upgrade api-common and iamapi-common packages 2026-08-01 10:50:40 +00:00
Hagernesh
af1d64d0bd fix 2026-08-01 08:34:59 +00:00
Nathnael
eefbc7b111 chore: update the iamapi package to 0.7.15 2026-07-30 13:22:20 +00:00
Nathnael
03b8ca0ce7 refactor: centralized the iam seeder 2026-07-27 08:42:27 +00:00
Yonas Tewabe
36f8fe2a7e Merge branch 'dev' into update-freight-migrations 2026-07-24 14:04:11 +03:00
yonastewabe
16a7aebadd update migration to before deployment in freight api 2026-07-24 14:01:21 +03:00
natib21
149e4105f4 seed vehicle 2026-07-17 11:30:25 +00:00
marshal
3c3a7595a2 Merge pull request #640 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-13 08:13:01 +03:00
Marshal
4b7f6d2548 enhance contract and booking services with server-side search and validation improvements
- Added  parameter to  and  for server-side free-text search on contract reference, company name, and booking details.
- Introduced new validation errors in  for container clashes and space issues when creating bookings.
- Implemented paginated dropdown settings retrieval in .
- Updated  to fetch active yards using a new method that handles pagination.
- Enhanced  with a  method to fetch all records by walking through pages.
- Refactored  to support filtering and pagination in schedule listings.
- Improved  to return a paginated list of facilities.
- Updated UI components in  and  to utilize debounced search inputs for better performance.
- Added alerts in  to inform users about booking constraints related to splits and capacity.
- Enhanced  to display notifications for split bookings and capacity usage.
2026-07-12 10:51:31 +00:00
yaschalew
81bdb91257 fix iam 2026-07-11 12:39:28 +03:00
yaschalew
fef7a439b4 fix package 2026-07-11 09:59:39 +03:00
Marshal
05b13e84a8 enhance booking and contract notification systems
- Added detailed logging for socket connection events in useBookingWindowSocket.
- Introduced new notification types for contract status and schedule updates.
- Updated notification visuals to include new icons for contract status.
- Enhanced notification href resolution for contract status and schedule updates.
- Implemented booking lifecycle notifier service for customer and staff notifications.
- Created contract notifier service for managing contract lifecycle notifications.
- Added end-to-end tests for booking window socket functionality.
2026-07-06 21:03:08 +00:00
Nathnael
5a10c14ceb feat: setup the notification module to the api 2026-07-06 06:51:38 +00:00
Hagernesh Tadesse
493af38ba2 Merge pull request #455 from Tria-plc/naming_convention
Handover customer sign
2026-07-04 10:04:23 +03:00
Hagernesh
18f47481d7 Handover customer sign 2026-07-04 06:31:23 +00:00
natib21
b218179d72 :wqMerge branch 'freight/feature/first_mile_invoice' of github.com:Tria-plc/edr-platform into freight/feature/first_mile_invoice 2026-07-03 09:10:31 +00:00
natib21
e4b0c73c63 fix fayda 2026-07-03 09:10:05 +00:00
hagiye
5af45c2643 Customer Truck Assignment and Portal Delivary Approval 2026-07-02 15:54:16 +03:00
hagiye
ad9f9de7a8 Truck Assign by customer plus Handover signature on portal 2026-07-02 12:32:18 +03:00
ghost2023
c88c5ee450 chore: setup script 2026-07-01 12:26:37 +03:00
Nathnael
fa3138f2ac refactor: migrate the warehouse invoice to use the central one 2026-06-30 12:54:04 +00:00
hagiye
831ac59a8e Merge branch 'dev' of github.com:Tria-plc/edr-platform into importhandover 2026-06-30 07:20:10 +03:00
hagiye
9f5c22c1ee Goods recieved notes and Booking delivery 2026-06-30 07:19:12 +03:00
Nathnael Wondisha
4cf8e89780 Merge branch 'dev' into freight/feat/invoice 2026-06-29 17:24:29 +03:00
natib21
f2826f2b9b fix 2026-06-29 13:49:01 +00:00
Nathnael
c37e8acfdc Merge branch 'dev' into freight/feat/invoice 2026-06-29 10:58:12 +00:00
hagiye
d55f9312bf Marshaling document Receive Export and import handover to customer 2026-06-29 12:24:14 +03:00
hagiye
2a038c59db Import operation gate pass 2026-06-27 21:22:18 +03:00
hagiye
fee4365b70 Import operation gate pass 2026-06-27 21:04:27 +03:00
Nathnael
98e34593c4 feat: add government support to the companies. add seeding and constrain on booking 2026-06-27 09:08:15 +00:00
yaschalew
f8aa3b3968 fix 2026-06-27 10:02:05 +03:00
yaschalew
9f85d45b17 add package 2026-06-27 09:29:48 +03:00
yaschalew
33469801b7 resolve conflict 2026-06-27 08:14:05 +03:00
yaschalew
2373e0b8a4 user module 2026-06-27 08:11:06 +03:00
hagiye
f86bdb1c36 Merge branch 'dev' of github.com:Tria-plc/edr-platform into dev 2026-06-26 13:21:18 +03:00
hagiye
4efef9bab3 inspection status column fix 2026-06-26 13:20:26 +03:00
yaschalew
ed496b72ae add iam package 2026-06-26 12:38:31 +03:00
hagiye
2b7959fc82 fix conflict 2026-06-25 11:31:50 +03:00
hagiye
f4a90755c2 api 2026-06-25 11:00:40 +03:00
Muluhabt
2e138a73ea Updating package 2026-06-24 22:56:32 +03:00
Marshal
b031ddb204 Merge branch 'freight/develop' of github.com:Tria-plc/edr-platform into freight_feature/priority 2026-06-22 11:43:38 +00:00
Muluhabt
41c51b7986 Adding local packages 2026-06-22 11:53:17 +03:00
Marshal
dc708a2473 Refactor phone input handling across onboarding and settings forms
- Replaced PhoneInput component with ControlledPhoneField for better integration with react-hook-form.
- Updated validation for phone numbers using isValidPhone function to ensure proper formatting.
- Removed country code handling from forms, simplifying phone number management.
- Introduced new phone field component with consistent styling and behavior.
- Added phone number validation on the backend using class-validator.
- Removed unused phone utility functions and cleaned up related code.
2026-06-21 10:34:40 +00:00