Skip to main content

Order processing engine

Project description

Order Processing Engine

Python library for order processing and inventory management.

Installation

pip install order-processing-engine

Requirements

  • boto3
  • AWS credentials configured
  • DynamoDB tables set up

Environment Variables

AWS region, Orders table, Order items table, Inventory table, Low stock threshold

Quick Start

from order_processing_engine_pkg.order_processing import OrderProcessingEngine

order_engine = OrderProcessingEngine()

Usage

Lambda — Create PENDING Order from CSV

order_id, order_number = order_engine.create_order(
    order_items=[
        {'sku': 'LAP-001', 'product_name': 'Laptop', 'quantity': 2, 'price': 930.20},
        {'sku': 'MOU-001', 'product_name': 'Mouse',  'quantity': 5, 'price': 25.67}
    ],
    s3_file_path='my-bucket/orders/order.csv'
)

Staff Confirm Order

success, result = order_engine.confirm_order(order_id)

if success:
    low_stock_items = result  # list of {'sku': xxx, 'remaining': xxx}
else:
    error_message = result

Staff Modify Order Item

success, message = order_engine.modify_order(order_id, item_id, new_quantity=4)

Staff Cancel Order

success, message = order_engine.order_cancel(order_id)

Allowed Status Transitions

PENDING -> COMPLETED  (confirm order)
PENDING -> CANCELLED  (cancel order)
COMPLETED -> (cannot change after completed)
CANCELLED -> (cannot change after cancelled)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

order_processing_engine-1.0.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

order_processing_engine-1.0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file order_processing_engine-1.0.2.tar.gz.

File metadata

  • Download URL: order_processing_engine-1.0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for order_processing_engine-1.0.2.tar.gz
Algorithm Hash digest
SHA256 76f21b3390bf6e8413a043e75dd07b422405416999f91ba0a9751f1cda00b86e
MD5 405c35ded260d7f3dd1bd27504219c76
BLAKE2b-256 136e7b8901c4975b0b1c5e5698522f9b275379a31f9ad0ef302a66c1e11b1b47

See more details on using hashes here.

File details

Details for the file order_processing_engine-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for order_processing_engine-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 851ab2fc04ce4f7d450846986f70f8b0cb9a000df1d6f8fde63d15d9b7e8cb15
MD5 d91f8aeea689df50fe7466f178ee11a8
BLAKE2b-256 4d7dcbab32d10973be301e0d4d56ad01d2dc6be1f067be49c904032c2de975d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page