Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

Validate adapter input data #154

Merged
merged 5 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung",
"retirementFundUid": "CHE-109.537.519",
"internalReferenz": "",
"oasiNumber": "756.1335.5778.23",
"oasiNumber": "756.1335.5778.25",
"internalPersonId": "",
"date": "2018-07-01"
},
Expand All @@ -21,11 +20,10 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung",
"retirementFundUid": "CHE-109.537.519",
"internalReferenz": "",
"oasiNumber": "756.9874.5778.58",
"oasiNumber": "756.9874.5778.56",
"internalPersonId": "",
"date": "2018-07-01"
},
Expand All @@ -42,11 +40,10 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung",
"retirementFundUid": "CHE-109.537.519",
"internalReferenz": "",
"oasiNumber": "756.3256.6598.23",
"oasiNumber": "756.3256.6598.26",
"internalPersonId": "",
"date": "2018-07-01"
},
Expand All @@ -63,11 +60,10 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung 2",
"retirementFundUid": "CHE-109.633.927",
"internalReferenz": "",
"oasiNumber": "756.9534.5271.94",
"oasiNumber": "756.9534.5271.91",
"internalPersonId": "",
"date": "2018-07-01"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
[
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung",
"retirementFundUid": "CHE-109.537.519",
"internalReferenz": "",
"oasiNumber": "756.1234.5678.97",
"internalPersonId": "",
"date": "2018-06-30"
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung",
"retirementFundUid": "CHE-109.537.519",
"internalReferenz": "",
"oasiNumber": "756.3421.5678.97",
"oasiNumber": "756.3421.5678.95",
"internalPersonId": "",
"date": "2018-06-30"
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung",
"retirementFundUid": "CHE-109.537.519",
"internalReferenz": "",
"oasiNumber": "756.3324.5678.58",
"oasiNumber": "756.3324.5678.55",
"internalPersonId": "",
"date": "2018-06-30"
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.537.488-Helvetia-Prisma-Sammelstiftung 2",
"retirementFundUid": "CHE-109.633.927",
"internalReferenz": "",
"oasiNumber": "756.5678.1234.17",
"oasiNumber": "756.5678.1234.11",
"internalPersonId": "",
"date": "2018-06-30"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"retirementFundUid": "CHE-109.740.084",
"internalReferenz": "",
"oasiNumber": "756.1234.5678.97",
"internalPersonId": "",
Expand All @@ -21,11 +20,10 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"retirementFundUid": "CHE-109.740.084",
"internalReferenz": "",
"oasiNumber": "756.1298.6578.97",
"oasiNumber": "756.1298.6578.93",
"internalPersonId": "",
"date": "2018-07-01"
},
Expand All @@ -42,11 +40,10 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"retirementFundUid": "CHE-109.740.084",
"internalReferenz": "",
"oasiNumber": "756.5678.1234.17",
"oasiNumber": "756.5678.1234.11",
"internalPersonId": "",
"date": "2018-07-01"
},
Expand All @@ -62,11 +59,10 @@
"referenceId": "756.5678.1234.17"
} },
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung 2",
"retirementFundUid": "CHE-223.471.073",
"internalReferenz": "",
"oasiNumber": "756.3324.5678.58",
"oasiNumber": "756.3324.5678.55",
"internalPersonId": "",
"date": "2018-07-01"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
[
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"retirementFundUid": "CHE-109.740.084",
"internalReferenz": "",
"oasiNumber": "756.1335.5778.23",
"oasiNumber": "756.1335.5778.25",
"internalPersonId": "",
"date": "2018-06-30"
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"retirementFundUid": "CHE-109.740.084",
"internalReferenz": "",
"oasiNumber": "756.3412.8844.97",
"oasiNumber": "756.3412.8844.99",
"internalPersonId": "",
"date": "2018-06-30"
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"retirementFundUid": "CHE-109.740.084",
"internalReferenz": "",
"oasiNumber": "756.9534.5271.94",
"oasiNumber": "756.9534.5271.91",
"internalPersonId": "",
"date": "2018-06-30"
} },
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung 2",
"retirementFundUid": "CHE-223.471.073",
"internalReferenz": "",
"oasiNumber": "756.9874.5778.58",
"oasiNumber": "756.9874.5778.56",
"internalPersonId": "",
"date": "2018-06-30"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"internalReferenz": "",
Expand All @@ -21,7 +20,6 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"internalReferenz": "",
Expand All @@ -42,7 +40,6 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"internalReferenz": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"internalReferenz": "",
Expand All @@ -10,7 +9,6 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"internalReferenz": "",
Expand All @@ -20,7 +18,6 @@
}
},
{
"techId": "",
"employmentInfo": {
"retirementFundUid": "CHE-109.740.084-Baloise-Sammelstiftung",
"internalReferenz": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ private Optional<EmploymentCommencement> mapEmploymentCommencement(Row row) {
capititalTransferInfo.setAdditionalName(getString(row, ADDITIONAL_NAME_COLUMN_INDEX));
capititalTransferInfo.setIban(getString(row, IBAN_COLUMN_INDEX));

return Optional.of(new EmploymentCommencement(null, employmentInfo, capititalTransferInfo));
return Optional.of(new EmploymentCommencement(employmentInfo, capititalTransferInfo));
}

private Optional<EmploymentTermination> mapEmploymentTermination(Row row) {
EmploymentInfo employmentInfo = mapEmploymentInfo(row);
if (employmentInfo == null) {
return Optional.empty();
}
return Optional.of(new EmploymentTermination(null, employmentInfo));
return Optional.of(new EmploymentTermination(employmentInfo));
}

private EmploymentInfo mapEmploymentInfo(Row row) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*******************************************************************************
* Copyright (c) 2018 - Prevo-System AG and others.
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License, v. 2.0 are satisfied: GNU General Public License, version 3
* with the GNU Classpath Exception which is
* available at https://www.gnu.org/software/classpath/license.html.
*
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-3.0 WITH Classpath-exception-2.0
*
*
* Contributors:
* Prevo-System AG - initial API and implementation
******************************************************************************/
Expand Down Expand Up @@ -63,7 +63,7 @@ public List<EmploymentTermination> getEmploymentTerminations() {
}

private EmploymentTermination buildEmploymentTermination(TozsPtverm ptVerm) {
return new EmploymentTermination(Integer.toString(ptVerm.getId().getId()), buildEmploymentInfo(ptVerm));
return new EmploymentTermination(buildEmploymentInfo(ptVerm));
}

private EmploymentInfo buildEmploymentInfo(TozsPtverm ptVerm) {
Expand All @@ -87,7 +87,7 @@ public List<EmploymentCommencement> getEmploymentCommencements() {
}

private EmploymentCommencement buildEmploymentCommencement(TozsPtverm ptVerm) {
return new EmploymentCommencement(Integer.toString(ptVerm.getId().getId()), buildEmploymentInfo(ptVerm),
return new EmploymentCommencement(buildEmploymentInfo(ptVerm),
buildCapitalTransferInformation(ptVerm));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
/*******************************************************************************
* Copyright (c) 2018 - Prevo-System AG and others.
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License, v. 2.0 are satisfied: GNU General Public License, version 3
* with the GNU Classpath Exception which is
* available at https://www.gnu.org/software/classpath/license.html.
*
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-3.0 WITH Classpath-exception-2.0
*
*
* Contributors:
* Prevo-System AG - initial API and implementation
******************************************************************************/
package ch.prevo.open.data.api;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@SuppressWarnings("unused")
abstract class AbstractEmploymentEvent {
abstract class AbstractEmployment {

private String techId;
@NotNull
@Valid
private EmploymentInfo employmentInfo;

AbstractEmploymentEvent() {
AbstractEmployment() {
}

AbstractEmploymentEvent(String techId, EmploymentInfo employmentInfo) {
this.techId = techId;
AbstractEmployment(EmploymentInfo employmentInfo) {
this.employmentInfo = employmentInfo;
}

public String getTechId() {
return techId;
}

public void setTechId(String techId) {
this.techId = techId;
}

public EmploymentInfo getEmploymentInfo() {
return employmentInfo;
}
Expand All @@ -54,7 +49,6 @@ public void setEmploymentInfo(EmploymentInfo employmentInfo) {
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
.append("techId", techId)
.append("employmentInfo", employmentInfo)
.toString();
}
Expand Down
Loading