|
2 | 2 |
|
3 | 3 | import java.util.Collections;
|
4 | 4 | import java.util.List;
|
5 |
| -import java.util.Map; |
6 | 5 | import java.util.Optional;
|
7 | 6 | import java.util.function.Function;
|
8 | 7 |
|
9 |
| -import org.slf4j.Logger; |
10 |
| -import org.slf4j.LoggerFactory; |
11 |
| - |
12 | 8 | import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
13 | 9 | import com.fasterxml.jackson.annotation.JsonCreator;
|
14 | 10 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
39 | 35 | import no.nav.abakus.iaygrunnlag.inntektsmelding.v1.InntektsmeldingerDto;
|
40 | 36 | import no.nav.abakus.iaygrunnlag.inntektsmelding.v1.RefusjonskravDatoerDto;
|
41 | 37 | import no.nav.abakus.iaygrunnlag.kodeverk.YtelseType;
|
42 |
| -import no.nav.abakus.iaygrunnlag.request.InntektsmeldingDiffRequest; |
43 | 38 | import no.nav.abakus.iaygrunnlag.request.InntektsmeldingerMottattRequest;
|
44 | 39 | import no.nav.abakus.iaygrunnlag.request.InntektsmeldingerRequest;
|
45 | 40 | import no.nav.foreldrepenger.abakus.domene.iay.InntektArbeidYtelseGrunnlag;
|
46 |
| -import no.nav.foreldrepenger.abakus.domene.iay.arbeidsforhold.ArbeidsforholdInformasjon; |
47 | 41 | import no.nav.foreldrepenger.abakus.domene.iay.arbeidsforhold.ArbeidsforholdInformasjonBuilder;
|
48 | 42 | import no.nav.foreldrepenger.abakus.domene.iay.inntektsmelding.Inntektsmelding;
|
49 | 43 | import no.nav.foreldrepenger.abakus.felles.LoggUtil;
|
|
67 | 61 | @ApplicationScoped
|
68 | 62 | @Transactional
|
69 | 63 | public class InntektsmeldingerRestTjeneste {
|
70 |
| - private static final Logger LOG = LoggerFactory.getLogger(InntektsmeldingerRestTjeneste.class); |
71 | 64 |
|
72 | 65 | private InntektsmeldingerTjeneste imTjeneste;
|
73 | 66 | private KoblingTjeneste koblingTjeneste;
|
@@ -181,33 +174,6 @@ private void valider(YtelseType ytelseType, List<Inntektsmelding> inntektsmeldin
|
181 | 174 | }
|
182 | 175 | }
|
183 | 176 |
|
184 |
| - @POST |
185 |
| - @Path("/hentDiff") |
186 |
| - @Consumes(MediaType.APPLICATION_JSON) |
187 |
| - @Produces(MediaType.APPLICATION_JSON) |
188 |
| - @Operation(description = "Hent inntektsmeldinger for angitt søke spesifikasjon", tags = "inntektsmelding") |
189 |
| - @BeskyttetRessurs(actionType = ActionType.READ, resourceType = ResourceType.FAGSAK) |
190 |
| - @SuppressWarnings("findsecbugs:JAXRS_ENDPOINT") |
191 |
| - public Response hentDifferanseMellomToReferanserPåSak(@NotNull @Valid InntektsmeldingDiffRequestAbacDto spesifikasjon) { |
192 |
| - LOG.info("Kall på deprekert endepunkt /hentDiff med spesifikasjon " + spesifikasjon.getSaksnummer()); |
193 |
| - LoggUtil.setupLogMdc(spesifikasjon.getYtelseType(), spesifikasjon.getSaksnummer(), |
194 |
| - spesifikasjon.getEksternRefEn() + "/" + spesifikasjon.getEksternRefTo()); |
195 |
| - |
196 |
| - var aktørId = new AktørId(spesifikasjon.getPerson().getIdent()); |
197 |
| - var saksnummer = new Saksnummer(spesifikasjon.getSaksnummer()); |
198 |
| - var ytelseType = spesifikasjon.getYtelseType(); |
199 |
| - Map<Inntektsmelding, ArbeidsforholdInformasjon> førsteMap = iayTjeneste.hentAlleInntektsmeldingerForEksternRef(aktørId, saksnummer, |
200 |
| - new KoblingReferanse(spesifikasjon.getEksternRefEn()), ytelseType); |
201 |
| - Map<Inntektsmelding, ArbeidsforholdInformasjon> andreMap = iayTjeneste.hentAlleInntektsmeldingerForEksternRef(aktørId, saksnummer, |
202 |
| - new KoblingReferanse(spesifikasjon.getEksternRefTo()), ytelseType); |
203 |
| - |
204 |
| - var diffMap = iayTjeneste.utledInntektsmeldingDiff(førsteMap, andreMap); |
205 |
| - InntektsmeldingerDto imDiffListe = MapInntektsmeldinger.mapUnikeInntektsmeldingerFraGrunnlag(diffMap); |
206 |
| - final Response response = Response.ok(imDiffListe).build(); |
207 |
| - |
208 |
| - return response; |
209 |
| - } |
210 |
| - |
211 | 177 | public static class AbacDataSupplier implements Function<Object, AbacDataAttributter> {
|
212 | 178 |
|
213 | 179 | public AbacDataSupplier() {
|
@@ -246,31 +212,4 @@ public AbacDataAttributter abacAttributter() {
|
246 | 212 | }
|
247 | 213 |
|
248 | 214 | }
|
249 |
| - |
250 |
| - /** |
251 |
| - * Json bean med Abac. |
252 |
| - */ |
253 |
| - @JsonIgnoreProperties(ignoreUnknown = true) |
254 |
| - @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE) |
255 |
| - @JsonInclude(value = JsonInclude.Include.NON_ABSENT, content = JsonInclude.Include.NON_EMPTY) |
256 |
| - public static class InntektsmeldingDiffRequestAbacDto extends InntektsmeldingDiffRequest implements AbacDto { |
257 |
| - |
258 |
| - @JsonCreator |
259 |
| - public InntektsmeldingDiffRequestAbacDto(@JsonProperty(value = "personIdent", required = true) @Valid @NotNull PersonIdent person) { |
260 |
| - super(person); |
261 |
| - } |
262 |
| - |
263 |
| - @Override |
264 |
| - public AbacDataAttributter abacAttributter() { |
265 |
| - final var abacDataAttributter = AbacDataAttributter.opprett(); |
266 |
| - if (FnrPersonident.IDENT_TYPE.equals(getPerson().getIdentType())) { |
267 |
| - return abacDataAttributter.leggTil(StandardAbacAttributtType.FNR, getPerson().getIdent()); |
268 |
| - } else if (AktørIdPersonident.IDENT_TYPE.equals(getPerson().getIdentType())) { |
269 |
| - return abacDataAttributter.leggTil(StandardAbacAttributtType.AKTØR_ID, getPerson().getIdent()); |
270 |
| - } |
271 |
| - throw new java.lang.IllegalArgumentException("Ukjent identtype: " + getPerson().getIdentType()); |
272 |
| - } |
273 |
| - |
274 |
| - } |
275 |
| - |
276 | 215 | }
|
0 commit comments