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-tinayekhaing

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

Built Distribution

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

File details

Details for the file order_processing_engine_tinayekhaing-1.0.0.tar.gz.

File metadata

File hashes

Hashes for order_processing_engine_tinayekhaing-1.0.0.tar.gz
Algorithm Hash digest
SHA256 299fb7c48b968273549ff81d2ba6032296489d76a38bbba56c1fb63f816cd968
MD5 3c3027270f6d7c85e491caaa98d81818
BLAKE2b-256 f1709fe3f9fa046d8f31d43bedf016ae3e6cb35d5e86010c9dbc364797fe37db

See more details on using hashes here.

File details

Details for the file order_processing_engine_tinayekhaing-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for order_processing_engine_tinayekhaing-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87aedb00c70ae6b53b5c2019ca49e01c1c8ac42fd0ceb7f8f37c9f367f74161d
MD5 2ca684686851475f2bcdcf5e0048f3fd
BLAKE2b-256 cf5b56bf1a171c10ffdd0bc65a428aeccc0ed1149d2242fa18ebaf5d0b2f14f3

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