mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-07 18:04:59 +03:00
New orders app (ADR-HUB-0018: catalog & sale recorded in Hub, execution in product backends): - Order + OrderItem models with payment/fulfillment status; items snapshot offer + price version so the record is stable. Migration included. - Services (create_order, mark_paid, cancel_order, set_fulfillment), selectors, serializers, REST API (list/create/detail + status actions) under IsAuthenticated/IsOwner, org-scoped. Tests: 6 green. - seed_orders management command for local demo (idempotent). Wired real numbers into the spots that were "—": - Sales overview: Продажи / Выручка / Конверсия + per-product sales/revenue. - Clients list: orders count and purchases total per contact. - Client detail: Заказы tab + summary (orders, purchases). Full backend suite: 91/91. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
518 B
Python
17 lines
518 B
Python
from django.contrib import admin
|
|
|
|
from hub_platform.orders.models import Order, OrderItem
|
|
|
|
|
|
class OrderItemInline(admin.TabularInline):
|
|
model = OrderItem
|
|
extra = 0
|
|
|
|
|
|
@admin.register(Order)
|
|
class OrderAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "organization", "contact", "product", "payment_status", "fulfillment_status", "amount_minor", "created_at")
|
|
list_filter = ("payment_status", "fulfillment_status", "organization")
|
|
search_fields = ("id", "contact__name")
|
|
inlines = [OrderItemInline]
|