-
Notifications
You must be signed in to change notification settings - Fork 9
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 #108 from FraunhoferISST/feat/itemstock
Feat/itemstock
- Loading branch information
Showing
25 changed files
with
1,523 additions
and
10 deletions.
There are no files selected for viewing
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
97 changes: 97 additions & 0 deletions
97
backend/src/main/java/org/eclipse/tractusx/puris/backend/stock/domain/model/ItemStock.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,97 @@ | ||
/* | ||
* Copyright (c) 2023 Volkswagen AG | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.eclipse.tractusx.puris.backend.stock.domain.model; | ||
|
||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
import lombok.*; | ||
import lombok.experimental.SuperBuilder; | ||
import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Address; | ||
import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Material; | ||
import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Partner; | ||
import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Site; | ||
import org.eclipse.tractusx.puris.backend.stock.logic.dto.itemstocksamm.ItemUnitEnumeration; | ||
|
||
import java.util.Date; | ||
import java.util.UUID; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Getter | ||
@Setter | ||
@SuperBuilder | ||
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) | ||
@Entity | ||
@ToString | ||
public abstract class ItemStock { | ||
|
||
static final String ORDER_ID_REGEX = "^[a-zA-Z0-9\\-\\.]{1,255}$"; | ||
|
||
@Id | ||
@GeneratedValue | ||
protected UUID uuid; | ||
|
||
@ManyToOne() | ||
@JoinColumn(name = "partner_uuid") | ||
@ToString.Exclude | ||
@NotNull | ||
protected Partner partner; | ||
@ManyToOne() | ||
@JoinColumn(name = "material_ownMaterialNumber") | ||
@ToString.Exclude | ||
@NotNull | ||
protected Material material; | ||
|
||
protected double quantity; | ||
@NotNull | ||
protected ItemUnitEnumeration measurementUnit; | ||
@NotNull | ||
@Pattern(regexp = Address.BPNA_REGEX) | ||
protected String locationBpna; | ||
@NotNull | ||
@Pattern(regexp = Site.BPNS_REGEX) | ||
protected String locationBpns; | ||
@NotNull | ||
protected Date lastUpdatedOnDateTime; | ||
|
||
protected boolean isBlocked; | ||
@Pattern(regexp = ORDER_ID_REGEX) | ||
protected String supplierOrderId; | ||
@Pattern(regexp = ORDER_ID_REGEX) | ||
protected String customerOrderId; | ||
@Pattern(regexp = ORDER_ID_REGEX) | ||
protected String customerOrderPositionId; | ||
|
||
@ToString.Include | ||
private String material_ownMaterialNumber(){ | ||
return material.getOwnMaterialNumber(); | ||
} | ||
|
||
@ToString.Include | ||
private String partner_partnerBpnl(){ | ||
return partner.getBpnl(); | ||
} | ||
|
||
} | ||
|
||
|
||
|
33 changes: 33 additions & 0 deletions
33
...rc/main/java/org/eclipse/tractusx/puris/backend/stock/domain/model/MaterialItemStock.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,33 @@ | ||
/* | ||
* Copyright (c) 2023 Volkswagen AG | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.eclipse.tractusx.puris.backend.stock.domain.model; | ||
|
||
import jakarta.persistence.Entity; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
@Entity | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@ToString(callSuper = true) | ||
public class MaterialItemStock extends ItemStock { | ||
} |
34 changes: 34 additions & 0 deletions
34
...src/main/java/org/eclipse/tractusx/puris/backend/stock/domain/model/ProductItemStock.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,34 @@ | ||
/* | ||
* Copyright (c) 2023 Volkswagen AG | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.eclipse.tractusx.puris.backend.stock.domain.model; | ||
|
||
import jakarta.persistence.Entity; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
@Entity | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@ToString(callSuper = true) | ||
public class ProductItemStock extends ItemStock { | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...java/org/eclipse/tractusx/puris/backend/stock/domain/model/ReportedMaterialItemStock.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,33 @@ | ||
/* | ||
* Copyright (c) 2023 Volkswagen AG | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.eclipse.tractusx.puris.backend.stock.domain.model; | ||
|
||
import jakarta.persistence.Entity; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
@Entity | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@ToString(callSuper = true) | ||
public class ReportedMaterialItemStock extends ItemStock { | ||
} |
33 changes: 33 additions & 0 deletions
33
.../java/org/eclipse/tractusx/puris/backend/stock/domain/model/ReportedProductItemStock.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,33 @@ | ||
/* | ||
* Copyright (c) 2023 Volkswagen AG | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.eclipse.tractusx.puris.backend.stock.domain.model; | ||
|
||
import jakarta.persistence.Entity; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
@Entity | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@ToString(callSuper = true) | ||
public class ReportedProductItemStock extends ItemStock { | ||
} |
30 changes: 30 additions & 0 deletions
30
...g/eclipse/tractusx/puris/backend/stock/domain/repository/MaterialItemStockRepository.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,30 @@ | ||
/* | ||
* Copyright (c) 2023 Volkswagen AG | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.eclipse.tractusx.puris.backend.stock.domain.repository; | ||
|
||
import org.eclipse.tractusx.puris.backend.stock.domain.model.MaterialItemStock; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.UUID; | ||
@Repository | ||
public interface MaterialItemStockRepository extends JpaRepository<MaterialItemStock, UUID> { | ||
} |
Oops, something went wrong.