ifixkart-backend/app/schemas/RefundSchema.py
adithiyan 10bfba7d58 feat: add warranties, refunds, notifications, CRM calendar, system config & delivery modules
- 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
2026-10-13 22:05:16 +05:30

62 lines
1.7 KiB
Python

from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
class RefundMediaBase(BaseModel):
file_url: str
file_type: str
media_filename: Optional[str] = None
class RefundMediaCreate(RefundMediaBase):
pass
class RefundMediaResponse(RefundMediaBase):
id: str
uploaded_by: str
uploaded_at: datetime
class Config:
from_attributes = True
class RefundRequestCreate(BaseModel):
entity_type: str # SALES or SERVICE
entity_id: str
location_id: str
amount: float
payment_method: str # CASH or ONLINE
reason: Optional[str] = None
part_number_verification: Optional[str] = None # Mandatory if SERVICE
media: List[RefundMediaCreate]
class RefundRequestApprove(BaseModel):
admin_notes: Optional[str] = None
class RefundRequestReject(BaseModel):
rejection_reason: str
admin_notes: Optional[str] = None
class RefundRequestResponse(BaseModel):
refund_id: str
entity_type: str
entity_id: str
location_id: str
amount: float
payment_method: str
status: str
reason: Optional[str] = None
part_number_verification: Optional[str] = None
razorpay_refund_id: Optional[str] = None
razorpay_refund_status: Optional[str] = None
requested_by: str
approved_by: Optional[str] = None
rejected_by: Optional[str] = None
requested_at: datetime
approved_at: Optional[datetime] = None
rejected_at: Optional[datetime] = None
refunded_at: Optional[datetime] = None
rejection_reason: Optional[str] = None
admin_notes: Optional[str] = None
media: List[RefundMediaResponse] = []
class Config:
from_attributes = True