Skip to content

feat(risk): implement shipment risk scoring system#327

Merged
yusuftomilola merged 2 commits intoDistinctCodes:mainfrom
Ibinola:feat/shipment-risk-scoring
Oct 2, 2025
Merged

feat(risk): implement shipment risk scoring system#327
yusuftomilola merged 2 commits intoDistinctCodes:mainfrom
Ibinola:feat/shipment-risk-scoring

Conversation

@Ibinola
Copy link
Contributor

@Ibinola Ibinola commented Oct 2, 2025

This PR introduces a new module dedicated to calculating risk scores for shipments. The system provides a quantitative measure of risk by analyzing several key factors, allowing for better decision-making in logistics.

Key Changes:

  • RiskModule: A new module that encapsulates all risk assessment logic.
  • RiskService: Contains the core scoring engine. It uses a configurable weighted model to assess risks from different factors:
  • Cargo Type: Assigns higher risk to hazardous or perishable goods.
  • Route & Geopolitical: Evaluates risk based on predefined high-risk origins or destinations.
  • Carrier Reliability: Simulates a lookup for carrier performance history.
  • RiskController: Exposes a POST /risk/score endpoint that accepts shipment details and returns a calculated score along with a breakdown of contributing factors.

CalculateRiskDto: Ensures that all incoming data for risk calculation is valid and properly structured.

Closes #321

@vercel
Copy link

vercel bot commented Oct 2, 2025

@Ibinola is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yusuftomilola yusuftomilola merged commit 5eedf64 into DistinctCodes:main Oct 2, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Risk Assessment Module

2 participants