forked from rero/rero-ils-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* The patron fees total amount in now returned by the circulation informations API. Updates code to reflect this change. * Creates services to communicate with the backend Loan API to get the preview overdue linked to a loan. * Closes rero/rero-ils#1389 Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
- Loading branch information
Showing
12 changed files
with
256 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2020 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { HttpClientTestingModule } from '@angular/common/http/testing'; | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { LoanApiService } from './loan-api.service'; | ||
|
||
describe('LoanApiService', () => { | ||
let service: LoanApiService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
HttpClientTestingModule | ||
], | ||
}); | ||
service = TestBed.inject(LoanApiService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2021 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
import { LoanOverduePreview } from '../classes/loans'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class LoanApiService { | ||
|
||
/** | ||
* Constructor | ||
* @param _http - HttpClient | ||
*/ | ||
constructor( | ||
private _http: HttpClient | ||
) {} | ||
|
||
|
||
/** | ||
* Get the preview overdue fees related to a specific loan | ||
* @param loanPid - string: the Loan pid | ||
*/ | ||
getPreviewOverdue(loanPid: string): Observable<LoanOverduePreview> { | ||
const url = `/api/loan/${loanPid}/overdue/preview`; | ||
return this._http.get<LoanOverduePreview>(url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.