class SpendProfileServiceImpl extends BaseTransactionalService implements SpendProfileService {

    @Override
    public ServiceResult<SpendProfileCSVResource> getSpendProfileCSV(ProjectOrganisationCompositeId projectOrganisationCompositeId) {
        SpendProfileTableResource spendProfileTableResource = getSpendProfileTable(projectOrganisationCompositeId).getSuccess();
        try {
            return serviceSuccess(generateSpendProfileCSVData(spendProfileTableResource, projectOrganisationCompositeId));
        } catch (IOException ioe) {
            LOG.error("exception thrown getting spend profile", ioe);
            return serviceFailure(SPEND_PROFILE_CSV_GENERATION_FAILURE);
        }
    }

}