Skip to content

Chore/project service#9

Merged
angelmp01 merged 20 commits intodevelopfrom
chore/project-service
Mar 18, 2026
Merged

Chore/project service#9
angelmp01 merged 20 commits intodevelopfrom
chore/project-service

Conversation

@angelmp01
Copy link
Contributor

No description provided.

@angelmp01 angelmp01 requested a review from jorge-romero March 12, 2026 16:47
@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@@ -1,15 +1,34 @@
package org.opendevstack.apiservice.project.mapper;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this is more close to the use of MapStuct

package org.opendevstack.apiservice.project.mapper;

import org.apache.commons.lang3.StringUtils;
import org.mapstruct.*;
import org.opendevstack.apiservice.project.model.CreateProjectRequest;
import org.opendevstack.apiservice.project.model.CreateProjectResponse;
import org.opendevstack.apiservice.serviceproject.model.ProjectRequest;
import org.opendevstack.apiservice.serviceproject.model.ProjectResponse;

@Mapper(
componentModel = "spring",
unmappedTargetPolicy = ReportingPolicy.ERROR,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS
)
public interface ProjectMapper {

// API -> Service
ProjectRequest toServiceRequest(CreateProjectRequest apiRequest);

// Service -> API (mapeo base)
@Mapping(target = "projectKey", source = "projectKey")
@Mapping(target = "status", source = "status", qualifiedByName = "emptyToNull")
// location in @AfterMapping so you have the projectkey value mappend if exists.
CreateProjectResponse toApiResponse(ProjectResponse serviceResponse);

// Helper: mapd"" -> null (not empty string )
@Named("emptyToNull")
default String emptyToNull(String value) {
    return StringUtils.isBlank(value) ? null : value.trim();
}

// Post-processing: location composed if projectkey exists
@AfterMapping
default void buildLocation(@MappingTarget CreateProjectResponse target, ProjectResponse source) {
    if (StringUtils.isNotBlank(source.getProjectKey())) {
        target.setLocation("/api/pub/v0/projects/" + source.getProjectKey().trim());
    }
}

}


@SpringBootApplication(scanBasePackages = { "org.opendevstack.apiservice" })
@EnableCaching
@EntityScan(basePackages = "org.opendevstack.apiservice.persistence.entity")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AutoConfigurationPackage(basePackages = { "org.opendevstack.apiservice" })

Check if it works with the auto without the EntityScan, maybe is not searching in the right places.

Copy link
Contributor

@jorge-romero jorge-romero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have a look at my comment

…d refactor repository methods for case-insensitive project key lookup
@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@sonarqubecloud
Copy link

@github-actions
Copy link

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@angelmp01 angelmp01 merged commit 8f7c7fa into develop Mar 18, 2026
4 checks passed
angelmp01 added a commit that referenced this pull request Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants