jmprathab / MyHome

A Java application which helps people to manage their apartment.
Apache License 2.0
93 stars 106 forks source link

Community admin should be able to schedule payments for house members #48

Closed jmprathab closed 4 years ago

jmprathab commented 4 years ago
edwardUL99 commented 4 years ago

Is this simply just adding a feature to record a payment for a user like in a Java class, e.g. a Bill and then the user can create this bill and apply it to the member?

edwardUL99 commented 4 years ago

You can assign me to it if you want and I'll figure it out. I have updated my fork and started working on it

jmprathab commented 4 years ago

@edwardUL99 You are right. This is to record payment for a user.

Example scenario:

An API endpoint should allow adding a payment for a particular house member. This payment entity should have details like - Amount

Each of these sub-tasks can be taken up in a separate issue if you feel so.

edwardUL99 commented 4 years ago

I have it set up and fixed any database errors. I have added /members/payments which schedules a new payment, /members/payments/{paymentId} which lists a payment's details, /members/{memberId}/payments which lists all the scheduled payments for a certain user and /communities/{communityId}/admins/{adminId}/payments which lists all the payments that admin scheduled. I have the 3 endpoints working but the last one gives an empty set, so I am working on getting that working. There seems to be an issue with retrieving community admin as I added a findAdminById to communit admin repository, but it throws an exception saying there is more than 1 admin per adminId.

UPDATE: I have the last endpoint working with a workaround but I am not sure how it is performance wise

jmprathab commented 4 years ago

@edwardUL99 Please skip /communities/{communityId}/admins/{adminId}/payments as of now if it seems complicated to implement now for various reasons/other bugs.

edwardUL99 commented 4 years ago

I have it implemented and it only takes 25 ms to respond but I can remove it

jmprathab commented 4 years ago

Thanks. That should be fine. Please create a tracking bug if you feel there is a better way to handle it. We will take care of performance improvement in the future.