Skip to content

Commit

Permalink
feat: current working status
Browse files Browse the repository at this point in the history
  • Loading branch information
eschrewe committed Dec 13, 2023
1 parent 726d28f commit 5a2fd2e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ private void setupCustomerRole() throws JsonProcessingException {

ItemStock.Builder builder = ItemStock.Builder.newInstance();
var itemStock = builder
.customerOrderId("123")
.supplierOrderId("234")
.customerOrderPositionId("1")
.direction(DirectionCharacteristic.INBOUND)
.material(semiconductorMaterial)
.measurementUnit(ItemUnitEnumeration.UNIT_PIECE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public class ItemStock {
private QuantityOnAllocatedStock quantityOnAllocatedStock = new QuantityOnAllocatedStock();
@Getter
@Setter
@ToString.Include
private boolean isBlocked;
private String supplierOrderId;
private String customerOrderId;
private String customerOrderPositionId;

@JsonIgnore
public Partner getPartner() {
Expand All @@ -70,15 +74,15 @@ public DirectionCharacteristic getDirection() {
}
@ToString.Include
public String getSupplierOrderId() {
return key.supplierOrderId;
return supplierOrderId;
}
@ToString.Include
public String getCustomerOrderId() {
return key.customerOrderId;
return customerOrderId;
}
@ToString.Include
public String getCustomerOrderPositionId() {
return key.customerOrderPositionId;
return customerOrderPositionId;
}
@ToString.Include
public String getLocationBpna() {
Expand Down Expand Up @@ -141,9 +145,6 @@ public static class Key implements Serializable {
@JoinColumn(name = "material_ownMaterialNumber")
private Material material;
private DirectionCharacteristic direction;
private String supplierOrderId;
private String customerOrderId;
private String customerOrderPositionId;
private String locationBpna;
private String locationBpns;

Expand All @@ -153,15 +154,14 @@ public boolean equals(Object o) {
if (!(o instanceof Key)) return false;
Key key = (Key) o;
return Objects.equals(partner, key.partner) && Objects.equals(material, key.material)
&& direction == key.direction && Objects.equals(supplierOrderId, key.supplierOrderId)
&& Objects.equals(customerOrderId, key.customerOrderId) && Objects.equals(customerOrderPositionId, key.customerOrderPositionId)
&& Objects.equals(locationBpna, key.locationBpna) && Objects.equals(locationBpns, key.locationBpns);
&& direction == key.direction && Objects.equals(locationBpna, key.locationBpna) &&
Objects.equals(locationBpns, key.locationBpns);
}

@Override
public int hashCode() {
return Objects.hash(partner, material,
direction, supplierOrderId, customerOrderId, customerOrderPositionId, locationBpna, locationBpns);
direction, locationBpna, locationBpns);
}
}

Expand Down Expand Up @@ -271,9 +271,9 @@ public ItemStock build() {
itemStock.key.partner = partner;
itemStock.key.material = material;
itemStock.key.direction = direction;
itemStock.key.supplierOrderId = supplierOrderId;
itemStock.key.customerOrderId = customerOrderId;
itemStock.key.customerOrderPositionId = customerOrderPositionId;
itemStock.supplierOrderId = supplierOrderId;
itemStock.customerOrderId = customerOrderId;
itemStock.customerOrderPositionId = customerOrderPositionId;
itemStock.key.locationBpna = locationBpna;
itemStock.key.locationBpns = locationBpns;
itemStock.quantityOnAllocatedStock = quantityOnAllocatedStock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@
public class ItemQuantityEntity {

@NotNull
private Double value;

@NotNull
private ItemUnitEnumeration unit;

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

final ItemQuantityEntity that = (ItemQuantityEntity) o;
return Objects.equals(value, that.value) && Objects.equals(unit, that.unit);
}

@Override
public int hashCode() {
return Objects.hash(value, unit);
}
private Double value;

@NotNull
private ItemUnitEnumeration unit;

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

final ItemQuantityEntity that = (ItemQuantityEntity) o;
return Objects.equals(value, that.value) && Objects.equals(unit, that.unit);
}

@Override
public int hashCode() {
return Objects.hash(value, unit);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ private boolean validate(ItemStock itemStock) {
Objects.requireNonNull(partner, "Missing Partner");
Objects.requireNonNull(key.getMaterial(), "Missing Material");
Objects.requireNonNull(key.getDirection(), "Missing direction");
Objects.requireNonNull(key.getSupplierOrderId(), "Missing supplierOrderId");
Objects.requireNonNull(key.getCustomerOrderId(), "Missing customerOrderId");
Objects.requireNonNull(key.getCustomerOrderPositionId(), "Missing customerOrderPositionId");
Objects.requireNonNull(key.getLocationBpna(), "Missing locationBpna");
Objects.requireNonNull(key.getLocationBpns(), "Missing locationBpns");
Objects.requireNonNull(itemStock.getMeasurementUnit(), "Missing measurementUnit");
Expand Down

0 comments on commit 5a2fd2e

Please sign in to comment.