Skip to content

Commit

Permalink
Merge pull request #157 from hmcts/PUB-2249
Browse files Browse the repository at this point in the history
PUB-2249 - Add models for MI reporting
  • Loading branch information
ChrisS1512 authored Dec 2, 2024
2 parents c0f27cf + e3152c1 commit fe84822
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ publishing {
}

group = 'com.github.hmcts'
version = '2.1.32'
version = '2.1.33'

java {
toolchain {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package uk.gov.hmcts.reform.pip.model.report;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import uk.gov.hmcts.reform.pip.model.account.Roles;
import uk.gov.hmcts.reform.pip.model.account.UserProvenances;

import java.time.LocalDateTime;
import java.util.UUID;

@Getter
@Setter
@NoArgsConstructor
public class AccountMiData {

/**
* The ID of the user as they exist in P&I.
*/
private UUID userId;

/**
* The user id of the user as per their provenance system.
*/
private String provenanceUserId;

/**
* The Sign in entry system the user was added with. (CFT IDAM, Crime IDAM, P&I AAD).
*/
private UserProvenances userProvenance;

/**
* Role of the user, Verified, Internal or Technical.
*/
private Roles roles;

/**
* The timestamp of when the user was created.
*/
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
private LocalDateTime createdDate;

/**
* The timestamp when the user was last signed in.
*/
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
private LocalDateTime lastSignedInDate;

@JsonCreator
public AccountMiData(
@JsonProperty("userId") UUID userId,
@JsonProperty("provenanceUserId") String provenanceUserId,
@JsonProperty("userProvenance") UserProvenances userProvenance,
@JsonProperty("roles") Roles roles,
@JsonProperty("createdDate") LocalDateTime createdDate,
@JsonProperty("lastSignedInDate") LocalDateTime lastSignedInDate
) {
this.userId = userId;
this.provenanceUserId = provenanceUserId;
this.userProvenance = userProvenance;
this.roles = roles;
this.createdDate = createdDate;
this.lastSignedInDate = lastSignedInDate;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package uk.gov.hmcts.reform.pip.model.report;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import uk.gov.hmcts.reform.pip.model.subscription.Channel;
import uk.gov.hmcts.reform.pip.model.subscription.SearchType;

import java.time.LocalDateTime;
import java.util.UUID;

@Getter
@Setter
@NoArgsConstructor
public class AllSubscriptionMiData {

private UUID id;
private Channel channel;
private SearchType searchType;
private String userId;
private String locationName;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
private LocalDateTime createdDate;

@JsonCreator
public AllSubscriptionMiData(
@JsonProperty("id") UUID id,
@JsonProperty("channel") Channel channel,
@JsonProperty("searchType") SearchType searchType,
@JsonProperty("userId") String userId,
@JsonProperty("locationName") String locationName,
@JsonProperty("createdDate") LocalDateTime createdDate
) {
this.id = id;
this.channel = channel;
this.searchType = searchType;
this.userId = userId;
this.locationName = locationName;
this.createdDate = createdDate;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package uk.gov.hmcts.reform.pip.model.report;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import uk.gov.hmcts.reform.pip.model.subscription.Channel;

import java.time.LocalDateTime;
import java.util.UUID;

@Getter
@Setter
@NoArgsConstructor
public class LocalSubscriptionMiData {

private UUID id;
private String searchValue;
private Channel channel;
private String userId;
private String locationName;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
private LocalDateTime createdDate;

@JsonCreator
public LocalSubscriptionMiData(
@JsonProperty("id") UUID id,
@JsonProperty("searchValue") String searchValue,
@JsonProperty("channel") Channel channel,
@JsonProperty("userId") String userId,
@JsonProperty("locationName") String locationName,
@JsonProperty("createdDate") LocalDateTime createdDate
) {
this.id = id;
this.searchValue = searchValue;
this.channel = channel;
this.userId = userId;
this.locationName = locationName;
this.createdDate = createdDate;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package uk.gov.hmcts.reform.pip.model.report;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import uk.gov.hmcts.reform.pip.model.publication.ArtefactType;
import uk.gov.hmcts.reform.pip.model.publication.Language;
import uk.gov.hmcts.reform.pip.model.publication.ListType;
import uk.gov.hmcts.reform.pip.model.publication.Sensitivity;

import java.time.LocalDateTime;
import java.util.UUID;

@Getter
@Setter
@SuppressWarnings("PMD.ExcessiveParameterList")
@NoArgsConstructor
public class PublicationMiData {

private UUID artefactId;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
private LocalDateTime displayFrom;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
private LocalDateTime displayTo;
private Language language;
private String provenance;
private Sensitivity sensitivity;
private String sourceArtefactId;
private Integer supersededCount;
private ArtefactType type;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
private LocalDateTime contentDate;
private String locationId;
private String locationName;
private ListType listType;

@JsonCreator
public PublicationMiData(
@JsonProperty("artefactId") UUID artefactId,
@JsonProperty("displayFrom") LocalDateTime displayFrom,
@JsonProperty("displayTo") LocalDateTime displayTo,
@JsonProperty("language") Language language,
@JsonProperty("provenance") String provenance,
@JsonProperty("sensitivity") Sensitivity sensitivity,
@JsonProperty("sourceArtefactId") String sourceArtefactId,
@JsonProperty("supersededCount") Integer supersededCount,
@JsonProperty("type") ArtefactType type,
@JsonProperty("contentDate") LocalDateTime contentDate,
@JsonProperty("locationId") String locationId,
@JsonProperty("locationName") String locationName,
@JsonProperty("listType") ListType listType
) {
this.artefactId = artefactId;
this.displayFrom = displayFrom;
this.displayTo = displayTo;
this.language = language;
this.provenance = provenance;
this.sensitivity = sensitivity;
this.sourceArtefactId = sourceArtefactId;
this.supersededCount = supersededCount;
this.type = type;
this.contentDate = contentDate;
this.locationId = locationId;
this.locationName = locationName;
this.listType = listType;
}

}

0 comments on commit fe84822

Please sign in to comment.