Template
Add shop, POS sync, event ticketing, and shipping catalog apps.
Clients can run in-house retail without Shopify while keeping the same Docker/Django/Postgres stack and data-ownership promise. Closes #5.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
from core.registry import (
|
||||
register_dashboard_collector,
|
||||
register_dispatcher,
|
||||
register_feature,
|
||||
register_portal_nav,
|
||||
)
|
||||
|
||||
|
||||
def register() -> None:
|
||||
register_feature("pos_sync")
|
||||
register_portal_nav(
|
||||
section="pos_sync",
|
||||
label="POS sync",
|
||||
url_name="pos_sync:event_list",
|
||||
group="Retail",
|
||||
order=40,
|
||||
)
|
||||
register_dashboard_collector(_dashboard)
|
||||
register_dispatcher(_dispatch)
|
||||
|
||||
|
||||
def _dashboard(request) -> dict:
|
||||
from pos_sync.models import SyncEvent
|
||||
|
||||
return {
|
||||
"pos_failed_syncs": SyncEvent.objects.filter(
|
||||
status=SyncEvent.Status.FAILED
|
||||
).count()
|
||||
}
|
||||
|
||||
|
||||
def _dispatch() -> int:
|
||||
from pos_sync.services import dispatch_pending_outbound
|
||||
|
||||
return dispatch_pending_outbound()
|
||||
Reference in New Issue
Block a user