Skip to content

Commit

Permalink
FEAT : CDE-310 ajouter logs dans retour du ws best ppn :
Browse files Browse the repository at this point in the history
     - renommage de la classe PpnWithLogsDto.java en PpnWithErrorsDto.java
  • Loading branch information
EryneKL committed Dec 8, 2023
1 parent 2a50899 commit 45b4fe5
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 31 deletions.
11 changes: 9 additions & 2 deletions src/main/java/fr/abes/bestppn/dto/PpnDto.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
package fr.abes.bestppn.dto;

import fr.abes.bestppn.utils.TYPE_SUPPORT;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.NoArgsConstructor;

@Data
@Getter
@Setter
@NoArgsConstructor
public abstract class PpnDto {

private String ppn;

private TYPE_SUPPORT typeSupport;

public PpnDto(String ppn, TYPE_SUPPORT typeSupport) {
this.ppn = ppn;
this.typeSupport = typeSupport;
}

}
23 changes: 23 additions & 0 deletions src/main/java/fr/abes/bestppn/dto/PpnWithErrorsDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package fr.abes.bestppn.dto;

import fr.abes.bestppn.utils.TYPE_SUPPORT;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class PpnWithErrorsDto extends PpnDto {

private List<String> errors;

public PpnWithErrorsDto(String ppn, TYPE_SUPPORT typeSupport, List<String> errors){
super(ppn, typeSupport);
this.errors = errors;
}

public void addError(String error) {
this.errors.add(error);
}
}
16 changes: 0 additions & 16 deletions src/main/java/fr/abes/bestppn/dto/PpnWithLogsDto.java

This file was deleted.

16 changes: 12 additions & 4 deletions src/main/java/fr/abes/bestppn/dto/kafka/PpnWithDestinationDto.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
package fr.abes.bestppn.dto.kafka;

import fr.abes.bestppn.dto.PpnDto;
import fr.abes.bestppn.utils.DESTINATION_TOPIC;
import fr.abes.bestppn.utils.TYPE_SUPPORT;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

@Data
@Getter
@Setter
@AllArgsConstructor
public class PpnWithDestinationDto {
private String ppn;
public class PpnWithDestinationDto extends PpnDto {
private DESTINATION_TOPIC destination;

public PpnWithDestinationDto(String ppn, TYPE_SUPPORT typeSupport, DESTINATION_TOPIC destination) {
super(ppn, typeSupport);
this.destination = destination;
}
}
16 changes: 7 additions & 9 deletions src/main/java/fr/abes/bestppn/dto/wscall/PpnWithTypeDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,30 @@
import fr.abes.bestppn.dto.PpnDto;
import fr.abes.bestppn.utils.TYPE_DOCUMENT;
import fr.abes.bestppn.utils.TYPE_SUPPORT;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.NoArgsConstructor;

@Data
@Getter
@Setter
@NoArgsConstructor
public class PpnWithTypeDto extends PpnDto {
private String ppn;
private TYPE_SUPPORT typeSupport;

private TYPE_DOCUMENT typeDocument;
private Boolean providerPresent = false;


public PpnWithTypeDto(String ppn, TYPE_SUPPORT typeSupport, TYPE_DOCUMENT typeDocument) {
this.ppn = ppn;
this.typeSupport = typeSupport;
super(ppn, typeSupport);
this.typeDocument = typeDocument;
}

public PpnWithTypeDto(String ppn, TYPE_SUPPORT typeSupport) {
this.ppn = ppn;
this.typeSupport = typeSupport;
super(ppn, typeSupport);
}

public PpnWithTypeDto(String ppn) {
this.ppn = ppn;
super.setPpn(ppn);
}

public boolean isProviderPresent() {
Expand Down

0 comments on commit 45b4fe5

Please sign in to comment.