Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-29 11:43:33 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-29 13:36:55 -0400
commitcefd6e95cba8c7358ccc9eb044471dbfb40fdc43 (patch)
tree7d6b82081111a4ed200717b94332e0e13fc2528f /src
parent65e7880c81c4d3c1ce79f654b540bd2285257dda (diff)
downloadliza-cefd6e95cba8c7358ccc9eb044471dbfb40fdc43.tar.gz
liza-cefd6e95cba8c7358ccc9eb044471dbfb40fdc43.tar.bz2
liza-cefd6e95cba8c7358ccc9eb044471dbfb40fdc43.zip
RatingService: Remove unnecessary program param
It was kept for postProcessRaterData for now since that would involve modifying a subtype as well.
Diffstat (limited to 'src')
-rw-r--r--src/server/service/RatingService.ts17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/server/service/RatingService.ts b/src/server/service/RatingService.ts
index 690dcb2..df27f31 100644
--- a/src/server/service/RatingService.ts
+++ b/src/server/service/RatingService.ts
@@ -102,8 +102,6 @@ export class RatingService
cmd: string,
): Promise<RateRequestResult>
{
- const program = quote.getProgram();
-
return new Promise<RateRequestResult>( resolve =>
{
// cmd represents a request for a single rater
@@ -126,11 +124,11 @@ export class RatingService
} );
}
- resolve( this._performRating( request, program, quote, cmd ) );
+ resolve( this._performRating( request, quote, cmd ) );
} )
.catch( err =>
{
- this._sendRatingError( request, quote, program, err );
+ this._sendRatingError( request, quote, err );
throw err;
} );
}
@@ -172,7 +170,6 @@ export class RatingService
* Perform rating and process result
*
* @param request - user request to satisfy
- * @param program - quote program
* @param quote - quote to process
* @param indv - individual supplier to rate (or empty)
*
@@ -180,14 +177,13 @@ export class RatingService
*/
private _performRating(
request: UserRequest,
- program: Program,
quote: ServerSideQuote,
indv: string,
): Promise<RateRequestResult>
{
return new Promise<RateRequestResult>( ( resolve, reject ) =>
{
- var rater = this._rater_manager.byId( program.getId() );
+ const rater = this._rater_manager.byId( quote.getProgramId() );
this._logger.log( this._logger.PRIORITY_INFO,
"Performing '%s' rating for quote #%s",
@@ -201,7 +197,7 @@ export class RatingService
actions = actions || [];
this.postProcessRaterData(
- request, rate_data, actions, program, quote
+ request, rate_data, actions, quote.getProgram(), quote
);
const class_dest = {};
@@ -235,7 +231,7 @@ export class RatingService
},
( message: string ) =>
{
- this._sendRatingError( request, quote, program,
+ this._sendRatingError( request, quote,
Error( message )
);
@@ -376,7 +372,6 @@ export class RatingService
private _sendRatingError(
request: UserRequest,
quote: ServerSideQuote,
- program: Program,
err: Error,
): void
{
@@ -384,7 +379,7 @@ export class RatingService
this._logger.log( this._logger.PRIORITY_ERROR,
"Rating for quote %d (program %s) failed: %s",
quote.getId(),
- program.getId(),
+ quote.getProgramId(),
err.message + '\n-!' + ( err.stack || "" ).replace( /\n/g, '\n-!' )
);