Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
engremran07 avatar

Fin Order Fulfillment

  • 1 installs
  • Updated May 22, 2026
  • engremran07/gsmvault

Process confirmed Django ecommerce orders - inventory check, atomic stock reservation, status notifications, and shipping/tracking updates.

About

Order fulfillment service patterns in Django covering inventory checks, atomic stock reservation, notifications, and tracking. A developer uses it when processing confirmed orders, verifying stock, or updating order status and shipping info.

  • Atomic fulfill_order with select_for_update inventory reservation
  • Notifications on each status change and auto-complete after delivery

Fin Order Fulfillment by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #3,836 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Jul 8, 2026 (Skillselion catalog sync)
npx skills add https://github.com/engremran07/gsmvault --skill fin-order-fulfillment

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
Last updatedMay 22, 2026
Repositoryengremran07/gsmvault

What it does

Process confirmed Django ecommerce orders - inventory check, atomic stock reservation, status notifications, and shipping/tracking updates.

Files

SKILL.mdMarkdownGitHub ↗

Order Fulfillment

When to Use

  • Processing confirmed orders for delivery
  • Checking inventory/stock before fulfillment
  • Sending order status notifications to buyer
  • Adding shipping/tracking information

Rules

1. Check inventory before transitioning to "processing" 2. Reserve stock atomically with order confirmation 3. Send notifications on each status change (email + in-app) 4. Tracking info added when order moves to "shipped" 5. Auto-complete after delivery confirmation timeout

Pattern: Fulfillment Service

from django.db import transaction
from apps.shop.models import Order, Product

@transaction.atomic
def fulfill_order(order_id: int) -> None:
    """Move order to processing after inventory check."""
    order = Order.objects.select_for_update().get(pk=order_id)
    if order.status != "confirmed":
        raise ValueError("Only confirmed orders can be fulfilled")

    for item in order.items.select_for_update().select_related("product"):
        product = item.product
        if product.stock < item.quantity:
            raise ValueError(f"Insufficient stock for {product.name}")
        product.stock -= item.quantity
        product.save(update_fields=["stock", "updated_at"])

    order.status = "processing"
    order.save(update_fields=["status", "updated_at"])
    # Trigger notification via EventBus
    from apps.core.events.bus import event_bus, EventTypes
    event_bus.emit(EventTypes.ORDER_STATUS_CHANGED, {
        "order_id": order.pk, "status": "processing",
        "user_id": order.user_id,
    })


@transaction.atomic
def add_tracking(order_id: int, carrier: str, tracking_number: str) -> None:
    """Add tracking info and transition to shipped."""
    order = Order.objects.select_for_update().get(pk=order_id)
    if order.status != "processing":
        raise ValueError("Only processing orders can be shipped")
    order.carrier = carrier
    order.tracking_number = tracking_number
    order.status = "shipped"
    order.save(update_fields=["carrier", "tracking_number",
                               "status", "updated_at"])

Anti-Patterns

BadWhyFix
Fulfilling without stock checkOversellingCheck stock with select_for_update()
Stock decrement outside atomic blockRace condition on concurrent ordersSame transaction
No notification on status changeUser left in darkEventBus emission

Red Flags

  • product.stock -= quantity without select_for_update()
  • Fulfillment without inventory validation
  • Missing tracking info when order ships

Quality Gate

& .\.venv\Scripts\python.exe -m ruff check . --fix
& .\.venv\Scripts\python.exe -m ruff format .
& .\.venv\Scripts\python.exe manage.py check --settings=app.settings_dev

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.