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

Uploaded Python 3

File details

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

File metadata

  • Download URL: order_processing_engine-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 663d2fb590a92dab5fd5ac4d4f248f5486dafb8f91f6b69b93a518297882a018
MD5 b430e4462f6a2ef24852162b685357f9
BLAKE2b-256 b9aa73590b22a9366deb51314b28b865b351d41f01ec460044a1c34b274174ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for order_processing_engine-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45e2ff8c21446e0bec3981be5cf12398016fe2ace57c8d47f0543d9b8ef897b6
MD5 f7993371f84d0716fe85a79dd9549a00
BLAKE2b-256 b05931863f18d6e1089153b12ce0646785829defc4ff66e583d2110e678fea7b

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