Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Stock Adjustment API as a documented endpoint #4637

Open
4 tasks
jmiranda opened this issue May 25, 2024 · 2 comments
Open
4 tasks

Expose Stock Adjustment API as a documented endpoint #4637

jmiranda opened this issue May 25, 2024 · 2 comments
Assignees

Comments

@jmiranda
Copy link
Member

See https://community.openboxes.com/t/adjustmenttransaction/959/2

  • Test the existing endpoint in Postman to ensure it works
  • Document endpoint in our API Guide
  • Add entry to URL Mapping to expose the endpoint on our current API
  • Add document re: naming convention

Possible URLs

/openboxes/api/adjustments
/openboxes/api/stockAdjustments
/openboxes/api/inventoryItems/:id/adjustments
@jmiranda jmiranda self-assigned this May 25, 2024
@jmiranda
Copy link
Member Author

Should probably consider backporting any change to 0.8.x since 0.9.x is not officially released yet.

@jmiranda
Copy link
Member Author

So I was able to test this, but unfortunately there's a bug that's going to prevent this from working for the time being.

image

The error message

{
    "errorCode": 500,
    "cause": "groovy.lang.MissingPropertyException",
    "errorMessage": "No such property: quantity for class: org.pih.warehouse.inventory.AdjustStockCommand"
}

And the Stock Adjustment API code with the bug

  // FIXME Forgot there was already a command object for this
  stockAdjustments.each { StockAdjustment stockAdjustment ->
    AdjustStockCommand adjustStockCommand = new AdjustStockCommand()
    adjustStockCommand.inventoryItem = stockAdjustment.inventoryItem
  > adjustStockCommand.quantity = stockAdjustment.quantityAdjusted 
    adjustStockCommand.comment = stockAdjustment.comments
    adjustStockCommand.location = location
    adjustStockCommand.binLocation = stockAdjustment.binLocation
    inventoryService.adjustStock(adjustStockCommand)
  }

Thankfully this should be an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant