Commit Graph

25 Commits

Author SHA1 Message Date
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
79fec14c9a feat(auth): deny by default with employee/customer audience guards
FreightPermissionGuard now rejects non-employee user types before the key
check, making every BookingStaff route staff-only in one place. Adds
PortalCustomer and MixedAudience for the routes both audiences share, and
stops ServiceAuthGuard failing open when SERVICE_AUTH_TOKEN is unset.
2026-08-07 07:32:25 +00:00
Nathnael
595c165820 feat: implement audit logs 2026-08-05 14:17:00 +00:00
Nathnael
3a69b961d4 refactor(freight): move the Fayda callback to /fayda/callback
Namespaces the OAuth landing path in all three places it exists: the API's
ack controller, both web apps' routes, and the redirect_uri env values.
A bare /callback claimed a generic top-level path in every app for one
provider's redirect.

The API side needed care. The ack controller moves to @Controller
('fayda/callback'), and the global-prefix exclusion has to name that exact
path — setGlobalPrefix's exclude is an exact route match, not a subtree, so
excluding "fayda" would have left /fayda/callback served at
/api/fayda/callback and 404ing at the registered redirect_uri, while
reading as though it covered everything under /fayda. Naming the full path
also keeps /api/fayda/verification/* prefixed, which every client calls.

Also drops a stale comment on the portal's callback route describing the
popup that no longer exists, and records why the route is public: behind
RequireAuth the onboarding gate redirects to /portal before the code+state
exchange can run.

NOT verified at runtime — this changes route registration, so boot the API
and confirm GET /fayda/callback answers un-prefixed and
/api/fayda/verification/start still resolves before relying on it.

Deploying this requires registering the new redirect_uri with eSignet
first; FAYDA_WEB_REDIRECT_URI, FAYDA_PORTAL_REDIRECT_URI and any mobile
client must be updated in step or verification breaks with a redirect_uri
mismatch.
2026-08-04 12:43:25 +00:00
Nathnael
acd2cfbe8c feat: add drain tail to the payments 2026-08-04 08:59:33 +00:00
Nathnael
dcda8d7d37 feat(freight-api): drop fan claim from fayda verification
esignet userinfo carries no national id number. keep sub/name/email/
phone/address, remove fanClaims config and the hard-fail gate that
would've blocked every real verification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-29 06:57:27 +00:00
Nathnael
03b8ca0ce7 refactor: centralized the iam seeder 2026-07-27 08:42:27 +00:00
Nathnael
1fe10ee3c2 feat(seed): implement local IAM baseline seeder with configurable settings 2026-07-27 07:09:09 +00:00
Nathnael
6420c72e89 feat(auth): implement staff-triggered password-reset links 2026-07-20 11:20:50 +00:00
natib21
5a7133b599 fix 2026-07-07 08:42:01 +00:00
Marshal
1b92c57e23 refactor contract handling to support single route per contract and improve reference generation logic 2026-07-06 08:36:11 +00:00
yaschalew
47f87e8435 fix conflict 2026-07-03 17:31:29 +03:00
yaschalew
83887471a4 fix 2026-07-03 17:25:33 +03:00
Nathnael
4e6e614b48 feat: add email to notification and otp 2026-07-03 10:59:58 +00:00
natib21
e4b0c73c63 fix fayda 2026-07-03 09:10:05 +00:00
hagiye
3decc9aeea interchange document generation and acknowledgement 2026-06-27 13:39:42 +03:00
Nathnael
6fd9b6d519 chore: setup sms rabbit mq 2026-06-25 07:41:33 +00:00
Marshal
5b9fed57fe add payment success and failure pages with environment variable support 2026-06-17 17:13:19 +00:00
Eyosiyas
a1940c4901 telebirr out in the payment 2026-06-08 11:49:50 +03:00
Abubeker Yasin
1d11cbda4d feat: ( payment ) create payment microservice 2026-06-05 21:29:55 +03:00
marshal
d226d7ef22 booking flow,summtion, approval, contract, mock payemnt and integration to back office, and also add permissions 2026-06-05 10:38:31 +03:00
SennayT
342ccb63de modify pipeline to speed up deployment 2026-05-28 12:52:56 +03:00
Michael Abebe
2940d20e06 fix:(freight:auth): finished integrating the freight api with the freight portal 2026-05-18 11:07:09 +03:00
Michael Abebe
0e0d2ea450 feat(freight:api): initial backend work 2026-05-18 10:25:33 +03:00
Muluhabt
3b8b6979db Project Initialization 2026-05-12 15:17:16 +03:00