Skip to content

Commit

Permalink
feat(src): Add process to payment home loan
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Pino committed Oct 4, 2024
1 parent eafaec1 commit cbb2b83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/modules/home-loan/home-loan.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,16 @@ export class HomeLoanService extends CrudService<HomeLoan> {
return this.homeLoanRepository.save(homeLoan);
}

async getLastCreated(customerId: string): Promise<ResponseDTO> {

async getLastCreated(customerId: string): Promise<ResponseDTO> {
const personaLoan = await this.homeLoanRepository.findOne({
where: {
customer: { id: customerId },
},
order: {
createdAt: 'DESC',
},
})
});

return { data: personaLoan }
return { data: personaLoan };
}
}
2 changes: 1 addition & 1 deletion src/modules/personal-loan/personal-loan.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class PersonalLoanController {
description: 'Return the last created PersonalLoan',
})
async getLastCreated(@Param('id') customerId: string): Promise<ResponseDTO> {
return await this.personalLoanService.getLastCreated(customerId)
return await this.personalLoanService.getLastCreated(customerId);
}

@Put(':id/accept-personal-loan')
Expand Down
7 changes: 3 additions & 4 deletions src/modules/personal-loan/personal-loan.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,16 @@ export class PersonalLoanService extends CrudService<PersonalLoan> {
return this.personalLoanRepository.save(personalLoan.data);
}

async getLastCreated(customerId: string): Promise<ResponseDTO> {

async getLastCreated(customerId: string): Promise<ResponseDTO> {
const personaLoan = await this.personalLoanRepository.findOne({
where: {
customer: { id: customerId },
},
order: {
createdAt: 'DESC',
},
})
});

return { data: personaLoan }
return { data: personaLoan };
}
}

0 comments on commit cbb2b83

Please sign in to comment.