-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Services): implement PrototypeApiService
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
- Loading branch information
Showing
6 changed files
with
247 additions
and
109 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
angular.module('bhima.services') | ||
.service('FiscalService', FiscalService); | ||
|
||
FiscalService.$inject = ['PrototypeApiService']; | ||
|
||
/** | ||
* Fiscal Service | ||
* | ||
* This service is responsible for loading the Fiscal Years and Periods, as well | ||
* as providing metadata like period totals, opening balances and such. | ||
*/ | ||
function FiscalService(PrototypeApiService) { | ||
var service = this; | ||
|
||
// inherit from the PrototypeApiService | ||
angular.extend(service, PrototypeApiService); | ||
|
||
// the service URL | ||
service.url = '/fiscal/'; | ||
|
||
return service; | ||
} |
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,14 @@ | ||
angular.module('bhima.services') | ||
.service('PeriodService', PeriodService); | ||
|
||
PeriodService.$inject = ['PrototypeApiService']; | ||
|
||
function PeriodService(PrototypeApiService) { | ||
var service = this; | ||
|
||
// inherit methods from the | ||
angular.extend(service, PrototypeApiService); | ||
|
||
|
||
return service; | ||
} |
Oops, something went wrong.