Search in sources :

Example 1 with AuditLogDto

use of org.mifos.dto.domain.AuditLogDto in project head by mifos.

the class CenterServiceFacadeWebTier method retrieveChangeLogs.

@Override
public List<AuditLogDto> retrieveChangeLogs(Integer centerId) {
    try {
        List<AuditLogDto> auditLogs = new ArrayList<AuditLogDto>();
        Short entityType = EntityType.CENTER.getValue();
        AuditBusinessService auditBusinessService = new AuditBusinessService();
        List<AuditLogView> centerAuditLogs = auditBusinessService.getAuditLogRecords(entityType, centerId);
        for (AuditLogView auditLogView : centerAuditLogs) {
            auditLogs.add(auditLogView.toDto());
        }
        return auditLogs;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 2 with AuditLogDto

use of org.mifos.dto.domain.AuditLogDto in project head by mifos.

the class LoanProductChangeLogController method showAllAuditLogsForSavingsProducts.

@ModelAttribute("auditLog")
@RequestMapping(method = RequestMethod.GET)
public AuditLogScreenDto showAllAuditLogsForSavingsProducts(@RequestParam(value = "productId", required = true) Integer productId) {
    LoanProductRequest productDetails = adminServiceFacade.retrieveLoanProductDetails(productId);
    List<AuditLogDto> auditLogRecords = adminServiceFacade.retrieveLoanProductAuditLogs(productId);
    return new AuditLogScreenDto(productDetails.getProductDetails().getId(), productDetails.getProductDetails().getName(), productDetails.getProductDetails().getCreatedDateFormatted(), auditLogRecords);
}
Also used : AuditLogScreenDto(org.mifos.dto.screen.AuditLogScreenDto) AuditLogDto(org.mifos.dto.domain.AuditLogDto) LoanProductRequest(org.mifos.dto.domain.LoanProductRequest) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with AuditLogDto

use of org.mifos.dto.domain.AuditLogDto in project head by mifos.

the class AdminServiceFacadeWebTier method retrieveLoanProductAuditLogs.

@Override
public List<AuditLogDto> retrieveLoanProductAuditLogs(Integer productId) {
    List<AuditLogDto> auditLogDtos = new ArrayList<AuditLogDto>();
    AuditBusinessService auditBusinessService = new AuditBusinessService();
    try {
        List<AuditLogView> auditLogs = auditBusinessService.getAuditLogRecords(EntityType.LOANPRODUCT.getValue(), productId);
        for (AuditLogView auditLogView : auditLogs) {
            auditLogDtos.add(auditLogView.toDto());
        }
        return auditLogDtos;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 4 with AuditLogDto

use of org.mifos.dto.domain.AuditLogDto in project head by mifos.

the class AdminServiceFacadeWebTier method retrieveSavingsProductAuditLogs.

@Override
public List<AuditLogDto> retrieveSavingsProductAuditLogs(Integer productId) {
    List<AuditLogDto> auditLogDtos = new ArrayList<AuditLogDto>();
    AuditBusinessService auditBusinessService = new AuditBusinessService();
    try {
        List<AuditLogView> auditLogs = auditBusinessService.getAuditLogRecords(EntityType.SAVINGSPRODUCT.getValue(), productId);
        for (AuditLogView auditLogView : auditLogs) {
            auditLogDtos.add(auditLogView.toDto());
        }
        return auditLogDtos;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 5 with AuditLogDto

use of org.mifos.dto.domain.AuditLogDto in project head by mifos.

the class SavingsServiceFacadeWebTier method retrieveSavingsAccountAuditLogs.

@Override
public List<AuditLogDto> retrieveSavingsAccountAuditLogs(Long savingsId) {
    List<AuditLogDto> auditLogDtos = new ArrayList<AuditLogDto>();
    AuditBusinessService auditBusinessService = new AuditBusinessService();
    try {
        List<AuditLogView> auditLogs = auditBusinessService.getAuditLogRecords(EntityType.SAVINGS.getValue(), savingsId.intValue());
        for (AuditLogView auditLogView : auditLogs) {
            auditLogDtos.add(auditLogView.toDto());
        }
        return auditLogDtos;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Aggregations

AuditLogDto (org.mifos.dto.domain.AuditLogDto)6 ArrayList (java.util.ArrayList)4 MifosRuntimeException (org.mifos.core.MifosRuntimeException)4 AuditBusinessService (org.mifos.framework.components.audit.business.service.AuditBusinessService)4 AuditLogView (org.mifos.framework.components.audit.util.helpers.AuditLogView)4 ServiceException (org.mifos.framework.exceptions.ServiceException)4 AuditLogScreenDto (org.mifos.dto.screen.AuditLogScreenDto)2 ModelAttribute (org.springframework.web.bind.annotation.ModelAttribute)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 LoanProductRequest (org.mifos.dto.domain.LoanProductRequest)1 SavingsProductDto (org.mifos.dto.domain.SavingsProductDto)1