20 lines
499 B
TypeScript
20 lines
499 B
TypeScript
/**
|
|
* Application Port: DriverRatingProvider
|
|
*
|
|
* Port for looking up driver ratings.
|
|
* Implemented by infrastructure adapters that connect to rating systems.
|
|
*/
|
|
|
|
export interface DriverRatingProvider {
|
|
/**
|
|
* Get the rating for a single driver
|
|
* Returns null if driver has no rating
|
|
*/
|
|
getRating(driverId: string): number | null;
|
|
|
|
/**
|
|
* Get ratings for multiple drivers
|
|
* Returns a map of driverId -> rating
|
|
*/
|
|
getRatings(driverIds: string[]): Map<string, number>;
|
|
} |