fix(ci): fix black/ruff failures, add CoC and PR template
- Fix Python formatting (sync no longer strips blank lines from .py files) - Remove test_community_build.py (tests private sync module) - Fix ruff warnings in test files - Add CODE_OF_CONDUCT.md - Add .github/PULL_REQUEST_TEMPLATE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
||||
|
||||
|
||||
class ProductBase(BaseModel):
|
||||
"""Base product schema"""
|
||||
|
||||
@@ -71,18 +72,21 @@ class ProductBase(BaseModel):
|
||||
raise ValueError(f"Stock status must be one of: {', '.join(allowed)}")
|
||||
return v
|
||||
|
||||
|
||||
class ProductCreate(ProductBase):
|
||||
"""Schema for creating a new product"""
|
||||
|
||||
name: str = Field(..., min_length=1, description="Product name (required)")
|
||||
type: str = Field("simple", description="Product type")
|
||||
|
||||
|
||||
class ProductUpdate(ProductBase):
|
||||
"""Schema for updating an existing product"""
|
||||
|
||||
# All fields optional for updates
|
||||
pass
|
||||
|
||||
|
||||
class ProductResponse(BaseModel):
|
||||
"""Schema for product response data"""
|
||||
|
||||
@@ -100,6 +104,7 @@ class ProductResponse(BaseModel):
|
||||
stock_status: str
|
||||
permalink: str
|
||||
|
||||
|
||||
class ProductCategory(BaseModel):
|
||||
"""Schema for product category"""
|
||||
|
||||
@@ -112,6 +117,7 @@ class ProductCategory(BaseModel):
|
||||
display: str | None = Field("default", description="Display type")
|
||||
image: dict[str, Any] | None = Field(None, description="Category image")
|
||||
|
||||
|
||||
class ProductVariation(BaseModel):
|
||||
"""Schema for product variation"""
|
||||
|
||||
@@ -128,6 +134,7 @@ class ProductVariation(BaseModel):
|
||||
attributes: list[dict[str, Any]] | None = Field(None, description="Variation attributes")
|
||||
image: dict[str, Any] | None = Field(None, description="Variation image")
|
||||
|
||||
|
||||
class ProductAttribute(BaseModel):
|
||||
"""Schema for product attribute"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user