-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #312 from pagopa/PPANTT-39-add-list-maintenance-api
[PPANTT-39] feat: Add list maintenance API
- Loading branch information
Showing
12 changed files
with
13,876 additions
and
14,878 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
26 changes: 26 additions & 0 deletions
26
...v/pagopa/apiconfig/core/mapper/ConvertStationMaintenanceToStationMaintenanceResource.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,26 @@ | ||
package it.gov.pagopa.apiconfig.core.mapper; | ||
|
||
import it.gov.pagopa.apiconfig.core.model.stationmaintenance.StationMaintenanceResource; | ||
import it.gov.pagopa.apiconfig.starter.entity.StationMaintenance; | ||
import org.modelmapper.Converter; | ||
import org.modelmapper.spi.MappingContext; | ||
|
||
/** | ||
* Converter class that specify how to convert a {@link StationMaintenance} instance to a {@link StationMaintenanceResource} instance | ||
*/ | ||
public class ConvertStationMaintenanceToStationMaintenanceResource implements Converter<StationMaintenance, StationMaintenanceResource> { | ||
|
||
@Override | ||
public StationMaintenanceResource convert(MappingContext<StationMaintenance, StationMaintenanceResource> context) { | ||
StationMaintenance model = context.getSource(); | ||
|
||
return StationMaintenanceResource.builder() | ||
.maintenanceId(model.getObjId()) | ||
.brokerCode(model.getStation().getIntermediarioPa().getIdIntermediarioPa()) | ||
.stationCode(model.getStation().getIdStazione()) | ||
.startDateTime(model.getStartDateTime()) | ||
.endDateTime(model.getEndDateTime()) | ||
.standIn(model.getStandIn()) | ||
.build(); | ||
} | ||
} |
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
37 changes: 37 additions & 0 deletions
37
...it/gov/pagopa/apiconfig/core/model/stationmaintenance/StationMaintenanceListResource.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,37 @@ | ||
package it.gov.pagopa.apiconfig.core.model.stationmaintenance; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import it.gov.pagopa.apiconfig.core.model.PageInfo; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
|
||
/** | ||
* Model class the response for station's maintenance APIs | ||
*/ | ||
@Getter | ||
@Setter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class StationMaintenanceListResource { | ||
|
||
@JsonProperty("station_maintenance_list") | ||
@Schema(description = "List of station's maintenance", required = true) | ||
@NotNull | ||
@Valid | ||
private List<StationMaintenanceResource> maintenanceList; | ||
|
||
@JsonProperty("page_info") | ||
@Schema(required = true) | ||
@NotNull | ||
@Valid | ||
private PageInfo pageInfo; | ||
} |
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.