Skip to content

Stock Validation and Reservation #30

@DakotaCondos

Description

@DakotaCondos

As the Order Service,
I want each bot to validate and reserve stock when accepting an order,
so that active and queued orders do not overcommit the bot’s inventory.

Acceptance Criteria

  • Given a bot receives an order assignment
    When it checks stock availability
    Then it validates the order against available stock, not total stock.

  • Given the bot has enough available stock
    When the order is accepted
    Then the bot immediately reserves the requested item quantities.

  • Given the bot does not have enough available stock
    When the order is validated
    Then the bot rejects the order with an insufficient-stock response.

  • Given stock is reserved for an accepted order
    When the reservation is created
    Then the bot generates a stock update event.

  • Given a queued order has reserved stock
    When earlier deliveries are completed
    Then the queued order keeps its reservation until it is delivered or cancelled.

  • Given an order is completed
    When delivery is finalized
    Then the reserved stock is converted into fulfilled stock and deducted from the bot’s onboard inventory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions