Skip to content

Commit

Permalink
uf
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamv108 committed Jan 28, 2024
1 parent d0a116c commit b922aae
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class OrderItemService {

private final OrderItemRepository repository;

private final IInventoryService inventoryService;
// private final IInventoryService inventoryService;

public List<OrderItem> save(final Long orderId, final List<OrderItemDTO> items) {
final List<OrderItem> orderItems = items.stream()
Expand All @@ -40,8 +40,10 @@ public List<OrderItem> save(final Long orderId, final List<OrderItemDTO> items)

final var persisted = this.save(orderItems, orderId);

items.forEach(item -> this.inventoryService.applyQuantityOperation(item.getInventoryId(), item.getQuantity(),
item.getClientReferenceId()));
// items.forEach(item ->
// this.inventoryService.applyQuantityOperation(item.getInventoryId(),
// item.getQuantity(),
// item.getClientReferenceId()));
persisted.forEach(item -> item.setStatus(OrderItemStatus.AWAITING_PAYMENT));
return this.save(persisted, orderId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

@Slf4j
@SuperBuilder
@Builder
@RequiredArgsConstructor
public abstract class AbstractOrderItemState {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@ public boolean cancel() {
return false;
}

@Override
public boolean initiateReturn() {
return false;
}

@Override
public boolean returnSuccess() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.Optional;

@Scope("prototype")
@Component("CreateOrderOrchestrator")
// @Component("CreateOrderOrchestrator")
@RequiredArgsConstructor
public class CreateOrderOrchestrator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

@Slf4j
@SuperBuilder
@Builder
@RequiredArgsConstructor
public abstract class AbstractOrderState {

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ springdoc:

documents:
bucket:
name: documents
name: documentssstore

order:
item:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ void getByUserId_without_existing_user() throws Exception {
.andExpect(status().is(400))
.andExpect(content().json("{\n" + " \"statusCode\": 400,\n" + " \"data\": null,\n"
+ " \"error\": [\n" + " {\n" + " \"accountId\": [\n"
+ " \"No account profile found for accountId: " + TestCommonConstants.ACCOUNT_ID + "\"\n"
+ " ]\n" + " }\n" + " ]\n" + "}"));
+ " \"No account profile found for accountId: " + TestCommonConstants.ACCOUNT_ID
+ "\"\n" + " ]\n" + " }\n" + " ]\n" + "}"));

final var profiles = this.repository.findByAccountId(TestCommonConstants.ACCOUNT_ID);

Expand Down

0 comments on commit b922aae

Please sign in to comment.