-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1622 - added deleted_at to user_owner_mapping table and created creat…
…eUserOwnerMapping and deleteUserOwnerMapping API's (#1638) Co-authored-by: ayemets-corcentric <[email protected]>
- Loading branch information
1 parent
883b47d
commit 9c13c99
Showing
64 changed files
with
1,943 additions
and
576 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
7 changes: 7 additions & 0 deletions
7
...c/main/java/org/opendatadiscovery/oddplatform/dto/OwnerAssociationRequestActivityDto.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.opendatadiscovery.oddplatform.dto; | ||
|
||
import org.opendatadiscovery.oddplatform.model.tables.pojos.OwnerAssociationRequestActivityPojo; | ||
|
||
public record OwnerAssociationRequestActivityDto(OwnerAssociationRequestActivityPojo activityPojo, | ||
OwnerAssociationRequestDto associationRequestDto) { | ||
} |
9 changes: 9 additions & 0 deletions
9
.../main/java/org/opendatadiscovery/oddplatform/dto/OwnerAssociationRequestActivityType.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.opendatadiscovery.oddplatform.dto; | ||
|
||
public enum OwnerAssociationRequestActivityType { | ||
REQUEST_CREATED, | ||
REQUEST_DECLINED, | ||
REQUEST_APPROVED, | ||
REQUEST_MANUALLY_APPROVED, | ||
REQUEST_MANUALLY_DECLINED | ||
} |
4 changes: 4 additions & 0 deletions
4
...m-api/src/main/java/org/opendatadiscovery/oddplatform/dto/OwnerAssociationRequestDto.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,8 +1,12 @@ | ||
package org.opendatadiscovery.oddplatform.dto; | ||
|
||
import java.util.Collection; | ||
import org.opendatadiscovery.oddplatform.model.tables.pojos.OwnerAssociationRequestPojo; | ||
import org.opendatadiscovery.oddplatform.model.tables.pojos.RolePojo; | ||
|
||
public record OwnerAssociationRequestDto(OwnerAssociationRequestPojo pojo, | ||
String ownerName, | ||
Long ownerId, | ||
Collection<RolePojo> roles, | ||
AssociatedOwnerDto statusUpdatedUser) { | ||
} |
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: 44 additions & 0 deletions
44
.../java/org/opendatadiscovery/oddplatform/mapper/OwnerAssociationRequestActivityMapper.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.opendatadiscovery.oddplatform.mapper; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.opendatadiscovery.oddplatform.api.contract.model.OwnerAssociationRequestActivity; | ||
import org.opendatadiscovery.oddplatform.api.contract.model.OwnerAssociationRequestActivityList; | ||
import org.opendatadiscovery.oddplatform.api.contract.model.PageInfo; | ||
import org.opendatadiscovery.oddplatform.dto.OwnerAssociationRequestActivityDto; | ||
import org.opendatadiscovery.oddplatform.model.tables.pojos.OwnerAssociationRequestActivityPojo; | ||
import org.opendatadiscovery.oddplatform.model.tables.pojos.OwnerAssociationRequestPojo; | ||
import org.opendatadiscovery.oddplatform.utils.Page; | ||
|
||
@Mapper(config = MapperConfig.class, uses = {DateTimeMapper.class, AssociatedOwnerMapper.class}) | ||
public interface OwnerAssociationRequestActivityMapper { | ||
|
||
@Mapping(target = "activityId", source = "dto.activityPojo.id") | ||
@Mapping(target = ".", source = "dto.associationRequestDto.pojo") | ||
@Mapping(target = "statusUpdatedBy", source = "dto.associationRequestDto.statusUpdatedUser") | ||
@Mapping(target = "status", source = "dto.activityPojo.status") | ||
@Mapping(target = "roles", source = "dto.associationRequestDto.roles") | ||
@Mapping(target = "ownerName", source = "dto.associationRequestDto.ownerName") | ||
@Mapping(target = "eventType", source = "dto.activityPojo.eventType") | ||
@Mapping(target = "statusUpdatedAt", source = "dto.activityPojo.createdAt") | ||
OwnerAssociationRequestActivity mapToOwnerAssociationRequestActivity(final OwnerAssociationRequestActivityDto dto); | ||
|
||
List<OwnerAssociationRequestActivity> mapList(final Collection<OwnerAssociationRequestActivityDto> dtos); | ||
|
||
default OwnerAssociationRequestActivityList mapPage(final Page<OwnerAssociationRequestActivityDto> page) { | ||
final List<OwnerAssociationRequestActivity> items = mapList(page.getData()); | ||
final PageInfo pageInfo = new PageInfo(page.getTotal(), page.isHasNext()); | ||
return new OwnerAssociationRequestActivityList(items, pageInfo); | ||
} | ||
|
||
@Mapping(target = "ownerAssociationRequestId", source = "pojo.id") | ||
@Mapping(target = "status", source = "pojo.status") | ||
@Mapping(target = "statusUpdatedBy", source = "statusUpdatedBy") | ||
@Mapping(target = "id", ignore = true) | ||
@Mapping(target = "createdAt", ignore = true) | ||
OwnerAssociationRequestActivityPojo mapToPojo(final OwnerAssociationRequestPojo pojo, | ||
final String statusUpdatedBy, | ||
final String eventType); | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...ry/oddplatform/repository/reactive/ReactiveOwnerAssociationRequestActivityRepository.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.opendatadiscovery.oddplatform.repository.reactive; | ||
|
||
import org.opendatadiscovery.oddplatform.api.contract.model.OwnerAssociationRequestStatusParam; | ||
import org.opendatadiscovery.oddplatform.dto.OwnerAssociationRequestActivityDto; | ||
import org.opendatadiscovery.oddplatform.model.tables.pojos.OwnerAssociationRequestActivityPojo; | ||
import org.opendatadiscovery.oddplatform.utils.Page; | ||
import reactor.core.publisher.Mono; | ||
|
||
public interface ReactiveOwnerAssociationRequestActivityRepository | ||
extends ReactiveCRUDRepository<OwnerAssociationRequestActivityPojo> { | ||
Mono<Page<OwnerAssociationRequestActivityDto>> getDtoList(final Integer page, final Integer size, | ||
final String query, | ||
final OwnerAssociationRequestStatusParam status); | ||
} |
Oops, something went wrong.