acupedia-api/app/bootstrap/seed_commerce/models.py

44 lines
1.2 KiB
Python

from __future__ import annotations
from dataclasses import dataclass, field
from datetime import datetime
from decimal import Decimal
from uuid import UUID
@dataclass(frozen=True, slots=True)
class AccessPlanSeed:
code: str
name: str
description: str | None
plan_type: str
billing_period: str
member_fee: Decimal = Decimal("0.00")
module_fee: Decimal = Decimal("0.00")
currency_code: str = "INR"
country: str = "India"
trial_days: int = 0
is_active: bool = True
sort_order: int = 0
metadata: dict[str, object] = field(default_factory=dict)
module_codes: tuple[str, ...] = field(default_factory=tuple)
@dataclass(frozen=True, slots=True)
class CouponSeed:
code: str
discount_type: str
value: Decimal
start_date: datetime
end_date: datetime
coupon_category: str = "general"
max_discount_limit: Decimal = Decimal("0.00")
usage_limit: int = 0
applicable_plan_ids: tuple[UUID, ...] = field(default_factory=tuple)
applicable_module_ids: tuple[UUID, ...] = field(default_factory=tuple)
min_purchase_amount: Decimal = Decimal("0.00")
is_first_purchase_only: bool = False
is_active: bool = True
description: str | None = None
created_by: UUID | None = None