vidakovic commented on code in PR #5562:
URL: https://github.com/apache/fineract/pull/5562#discussion_r2869645511
##########
fineract-core/src/main/java/org/apache/fineract/organisation/staff/domain/Staff.java:
##########
@@ -112,6 +113,67 @@ public static Staff fromJson(final Office staffOffice,
final JsonCommand command
return new Staff(staffOffice, firstname, lastname, externalId,
mobileNo, isLoanOfficer, isActive, joiningDate);
}
+ public static Staff fromRequest(final Office staffOffice, final
StaffRequest request) {
Review Comment:
This is more a comment to us as a community and less for you @nidhiii128 ...
we have functions like this all over the place, but I have some doubts about
the usefulness of them in general. I don't see where this is actually used
and/or where it would be useful. Do we really optimize here anything? Isn't it
just easier to return the whole updated object if we really have to (I
wouldn't... if the client needs that information really from the backend then
it should just call the "read" endpoint). The client initiates the change... if
a http 200 is received then it "knows" that the changes are ok, if 4xx or 5xx
then the updates didn't succeed... all needed information is already available
on the client side.
But let's assume this is really necessary and I'm missing something
essential here... then I would really urge to use a library that does diffing
way better than any of our handwritten (boilerplate) code: https://javers.org
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]