-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added assignment exim * fix: swap assertion arguments
- Loading branch information
1 parent
1bdc9db
commit a8cc961
Showing
8 changed files
with
240 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 33 additions & 11 deletions
44
src/main/java/org/tkit/onecx/permission/bff/rs/mappers/AssignmentMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,60 @@ | ||
package org.tkit.onecx.permission.bff.rs.mappers; | ||
|
||
import jakarta.inject.Inject; | ||
|
||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.tkit.quarkus.rs.mappers.OffsetDateTimeMapper; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import gen.org.tkit.onecx.permission.bff.rs.internal.model.*; | ||
import gen.org.tkit.onecx.permission.client.model.*; | ||
import gen.org.tkit.onecx.permission.exim.client.model.AssignmentSnapshot; | ||
import gen.org.tkit.onecx.permission.exim.client.model.ExportAssignmentsRequest; | ||
|
||
@Mapper(uses = { OffsetDateTimeMapper.class }) | ||
public interface AssignmentMapper { | ||
CreateAssignmentRequest map(CreateAssignmentRequestDTO createAssignmentRequestDTO); | ||
public abstract class AssignmentMapper { | ||
|
||
@Inject | ||
ObjectMapper mapper; | ||
|
||
public abstract CreateAssignmentRequest map(CreateAssignmentRequestDTO createAssignmentRequestDTO); | ||
|
||
AssignmentDTO map(Assignment assignment); | ||
public abstract AssignmentDTO map(Assignment assignment); | ||
|
||
@Mapping(target = "appIds", source = "appIds") | ||
AssignmentSearchCriteria map(AssignmentSearchCriteriaDTO assignmentSearchCriteriaDTO); | ||
public abstract AssignmentSearchCriteria map(AssignmentSearchCriteriaDTO assignmentSearchCriteriaDTO); | ||
|
||
@Mapping(target = "removeStreamItem", ignore = true) | ||
AssignmentPageResultDTO map(AssignmentPageResult pageResult); | ||
public abstract AssignmentPageResultDTO map(AssignmentPageResult pageResult); | ||
|
||
CreateRoleProductsAssignmentRequest mapRoleProducts(CreateProductAssignmentsRequestDTO createProductAssignmentsRequestDTO); | ||
public abstract CreateRoleProductsAssignmentRequest mapRoleProducts( | ||
CreateProductAssignmentsRequestDTO createProductAssignmentsRequestDTO); | ||
|
||
default CreateRoleProductAssignmentRequest mapRoleProduct( | ||
public CreateRoleProductAssignmentRequest mapRoleProduct( | ||
CreateProductAssignmentsRequestDTO createProductAssignmentsRequestDTO, int productIndex) { | ||
return new CreateRoleProductAssignmentRequest() | ||
.productName(createProductAssignmentsRequestDTO.getProductNames().get(productIndex)) | ||
.appId(createProductAssignmentsRequestDTO.getAppId()); | ||
} | ||
|
||
CreateRoleProductAssignmentRequest map(CreateRoleApplicationAssignmentRequestDTO createRoleProductAssignmentRequestDTO); | ||
public abstract CreateRoleProductAssignmentRequest map( | ||
CreateRoleApplicationAssignmentRequestDTO createRoleProductAssignmentRequestDTO); | ||
|
||
CreateRoleProductsAssignmentRequest map(CreateRoleProductsAssignmentRequestDTO createRoleProductsAssignmentRequestDTO); | ||
public abstract CreateRoleProductsAssignmentRequest map( | ||
CreateRoleProductsAssignmentRequestDTO createRoleProductsAssignmentRequestDTO); | ||
|
||
public abstract RevokeRoleProductAssignmentRequest map( | ||
RevokeRoleApplicationAssignmentRequestDTO revokeRoleApplicationAssignmentRequestDTO); | ||
|
||
public abstract RevokeRoleProductsAssignmentRequest map( | ||
RevokeRoleProductsAssignmentRequestDTO revokeRoleProductsAssignmentRequestDTO); | ||
|
||
public AssignmentSnapshot createSnapshot(Object object) { | ||
return mapper.convertValue(object, AssignmentSnapshot.class); | ||
} | ||
|
||
RevokeRoleProductAssignmentRequest map(RevokeRoleApplicationAssignmentRequestDTO revokeRoleApplicationAssignmentRequestDTO); | ||
public abstract ExportAssignmentsRequest map(ExportAssignmentsRequestDTO exportAssignmentsRequestDTO); | ||
|
||
RevokeRoleProductsAssignmentRequest map(RevokeRoleProductsAssignmentRequestDTO revokeRoleProductsAssignmentRequestDTO); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.