Skip to content

Commit

Permalink
fix: Add the freelancer ID to the log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
MahmoudHosamGaber committed May 16, 2024
1 parent c726435 commit 36cb855
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class AddFreelancerAchievementCommand

@Override
public AddFreelancerAchievementResponse Run(AddFreelancerAchievementRequest request) {
logger.info("Add Freelancer Achievement");
logger.info("Add Freelancer Achievement - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return AddFreelancerAchievementResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class AddFreelancerEducationCommand

@Override
public AddFreelancerEducationResponse Run(AddFreelancerEducationRequest request) {
logger.info("Add Freelancer Education");
logger.info("Add Freelancer Education - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return AddFreelancerEducationResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class AddFreelancerExperienceCommand

@Override
public AddFreelancerExperienceResponse Run(AddFreelancerExperienceRequest request) {
logger.info("Add Freelancer Experience");
logger.info("Add Freelancer Experience - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return AddFreelancerExperienceResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class AddFreelancerLanguageCommand

@Override
public AddFreelancerLanguageResponse Run(AddFreelancerLanguageRequest request) {
logger.info("Add Freelancer Language");
logger.info("Add Freelancer Language - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return AddFreelancerLanguageResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public class AddFreelancerSkillCommand

@Override
public AddFreelancerSkillResponse Run(AddFreelancerSkillRequest request) {
logger.info("Add Freelancer Skill");
logger.info("Add Freelancer Skill - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return AddFreelancerSkillResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class GetFreelancerAchievementsCommand

@Override
public GetFreelancerAchievementsResponse Run(GetFreelancerAchievementsRequest request) {
logger.info("Get Freelancer Achievements");
logger.info("Get Freelancer Achievements - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return GetFreelancerAchievementsResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class GetFreelancerEducationsCommand

@Override
public GetFreelancerEducationsResponse Run(GetFreelancerEducationsRequest request) {
logger.info("Get Freelancer Educations");
logger.info("Get Freelancer Educations - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return GetFreelancerEducationsResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class GetFreelancerExperiencesCommand

@Override
public GetFreelancerExperiencesResponse Run(GetFreelancerExperiencesRequest request) {
logger.info("Get Freelancer Experiences");
logger.info("Get Freelancer Experiences - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return GetFreelancerExperiencesResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class GetFreelancerLanguagesCommand

@Override
public GetFreelancerLanguagesResponse Run(GetFreelancerLanguagesRequest request) {
logger.info("Get Freelancer Languages");
logger.info("Get Freelancer Languages - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return GetFreelancerLanguagesResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class GetFreelancerSkillsCommand

@Override
public GetFreelancerSkillsResponse Run(GetFreelancerSkillsRequest request) {
logger.info("Get Freelancer Skills");
logger.info("Get Freelancer Skills - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return GetFreelancerSkillsResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public class RemoveFreelancerAchievementCommand

@Override
public RemoveFreelancerAchievementResponse Run(RemoveFreelancerAchievementRequest request) {
logger.info("Remove Freelancer Achievement");
logger.info("Remove Freelancer Achievement - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return RemoveFreelancerAchievementResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class RemoveFreelancerEducationCommand

@Override
public RemoveFreelancerEducationResponse Run(RemoveFreelancerEducationRequest request) {
logger.info("Remove Freelancer Education");
logger.info("Remove Freelancer Education - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return RemoveFreelancerEducationResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public class RemoveFreelancerExperienceCommand

@Override
public RemoveFreelancerExperienceResponse Run(RemoveFreelancerExperienceRequest request) {
logger.info("Remove Freelancer Experience");
logger.info("Remove Freelancer Experience - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return RemoveFreelancerExperienceResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class RemoveFreelancerLanguageCommand

@Override
public RemoveFreelancerLanguageResponse Run(RemoveFreelancerLanguageRequest request) {
logger.info("Remove Freelancer Language");
logger.info("Remove Freelancer Language - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return RemoveFreelancerLanguageResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class RemoveFreelancerSkillCommand

@Override
public RemoveFreelancerSkillResponse Run(RemoveFreelancerSkillRequest request) {
logger.info("Remove Freelancer Skill");
logger.info("Remove Freelancer Skill - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return RemoveFreelancerSkillResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public class UpdateFreelancerAchievementCommand

@Override
public UpdateFreelancerAchievementResponse Run(UpdateFreelancerAchievementRequest request) {
logger.info("Update Freelancer Achievement");
logger.info("Update Freelancer Achievement - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return UpdateFreelancerAchievementResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class UpdateFreelancerEducationCommand

@Override
public UpdateFreelancerEducationResponse Run(UpdateFreelancerEducationRequest request) {
logger.info("Update Freelancer Education");
logger.info("Update Freelancer Education - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return UpdateFreelancerEducationResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public class UpdateFreelancerExperienceCommand

@Override
public UpdateFreelancerExperienceResponse Run(UpdateFreelancerExperienceRequest request) {
logger.info("Update Freelancer Experience");
logger.info("Update Freelancer Experience - Freelancer ID: " + request.getUserId());
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.error("Freelancer Not Found");
logger.error("Freelancer Not Found - Freelancer ID: " + request.getUserId());
return UpdateFreelancerExperienceResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down

0 comments on commit 36cb855

Please sign in to comment.