@@ -711,13 +711,31 @@ func (a *PatronRequestActionService) sendNotificationBorrowingRequest(ctx common
711711}
712712
713713func (a * PatronRequestActionService ) cancelLocalBorrowingRequest (ctx common.ExtendedContext , pr pr_db.PatronRequest ) actionExecutionResult {
714- // Should do the same as when supplier sends cancel
715- return a .rejectCancelLenderRequest (ctx , pr )
714+ result := events.EventResult {}
715+ status , eventResult , httpStatus := a .sendSupplyingAgencyMessage (ctx , pr , & result ,
716+ iso18626.MessageInfo {
717+ ReasonForMessage : iso18626 .TypeReasonForMessageCancelResponse ,
718+ },
719+ iso18626.StatusInfo {Status : iso18626 .TypeStatusWillSupply },
720+ nil )
721+ return a .checkSupplyingResponse (status , eventResult , & result , httpStatus , pr )
716722}
717723
718724func (a * PatronRequestActionService ) cannotSupplyLocallyBorrowingRequest (ctx common.ExtendedContext , pr pr_db.PatronRequest , params actionParams ) actionExecutionResult {
719- // Should do the same as when supplier sends cannot supply
720- return a .cannotSupplyLenderRequest (ctx , pr , params )
725+ result := events.EventResult {}
726+ var reasonUnfilled * iso18626.TypeSchemeValuePair
727+ if params .ReasonUnfilled != "" {
728+ reasonUnfilled = & iso18626.TypeSchemeValuePair {Text : params .ReasonUnfilled }
729+ }
730+ status , eventResult , httpStatus := a .sendSupplyingAgencyMessage (ctx , pr , & result ,
731+ iso18626.MessageInfo {
732+ ReasonForMessage : iso18626 .TypeReasonForMessageStatusChange ,
733+ Note : params .Note ,
734+ ReasonUnfilled : reasonUnfilled ,
735+ },
736+ iso18626.StatusInfo {Status : iso18626 .TypeStatusUnfilled },
737+ nil )
738+ return a .checkSupplyingResponse (status , eventResult , & result , httpStatus , pr )
721739}
722740
723741func (a * PatronRequestActionService ) fillLocallyBorrowingRequest (ctx common.ExtendedContext , pr pr_db.PatronRequest , lmsAdapter lms.LmsAdapter , illRequest iso18626.Request , params actionParams ) actionExecutionResult {
0 commit comments