- New models: WarrantyModel, WalletModel, SystemConfigModel - New schemas: WarrantySchema, RefundSchema, SystemConfig, CrmTaskCalendar, NotificationTemplate, NotificationGateway, RepairErp, ReviewModeration, InventoryPos, MultiDashboard, BillingFinance - New services: WarrantyService, RefundService, CrmService, CrmTaskCalendarService, DeliveryService, EmailTemplateService, InventoryPosService, MultiDashboardService, NotificationGatewayService, RepairErpService, ReviewModerationService, SystemConfigService, TemplateService, CreditService - Updated routers: AdminOrder, BillingFinance, Cart, Catalog, Checkout, Crm, InventoryPos, NotificationGateway, RolePermission, ServiceJob, Settings, Storefront, UserCreation - Updated models: Inventory, Notification, Order, Product, Service, Setting, SystemConfig, User - Updated core: database init, invoice generator, main app - Added WarrantyRouter with full CRUD and claim flow
25 lines
742 B
Python
25 lines
742 B
Python
from fastapi import Depends
|
|
from app.core.database.db_session import SessionLocal
|
|
from app.api.v1.routers.PosSyncRouter import sync_pos_transactions, POSSyncPayload
|
|
|
|
db = SessionLocal()
|
|
payload = POSSyncPayload.model_validate({
|
|
"device_id": "DEV",
|
|
"terminal_id": "TERM-MAIN-01",
|
|
"store_id": "STORE",
|
|
"transactions": [{
|
|
"pos_transaction_id": "TX-123",
|
|
"local_sequence": 1,
|
|
"invoice_no": "INV-1",
|
|
"total_amount": 100.0,
|
|
"created_at": "2023-10-10T00:00:00Z",
|
|
"items": [{"variant_id": "V-1", "qty": 1, "unit_price": 100.0}]
|
|
}]
|
|
})
|
|
|
|
try:
|
|
res = sync_pos_transactions(payload, db)
|
|
print("Success:", res)
|
|
except Exception as e:
|
|
import traceback
|
|
traceback.print_exc()
|