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.0.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.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: order_processing_engine-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 adfa033c971597e207d18a98335aa7109bcdfcf6ff3145a89e08a67dd4880e61
MD5 83d733dc14e667769f8c5012d7b9bd49
BLAKE2b-256 17f4ec639369449bfc49ffbd4d16a6886fd60159c3f910d2c3c00e87e5fece57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for order_processing_engine-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3b411606f6078b31c6354ae4bc07a84c89306dd5e72c060a5652a87a45d4888
MD5 9426b834ac7cc6890b9808d5900de0fd
BLAKE2b-256 6f33a9085e91c4ab7be51caa4fae02c1c279dead3166b6f282924002f6918f8d

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