
- Add is_divisible_by_3 field to database model and schema - Create migration script for the new field - Update existing endpoints to check divisibility by 3 - Add dedicated endpoints for divisibility by 3 - Update README with new endpoint documentation - Fix linting issues with ruff
20 lines
377 B
Python
20 lines
377 B
Python
from pydantic import BaseModel, ConfigDict
|
|
from datetime import datetime
|
|
|
|
|
|
class NumberRequest(BaseModel):
|
|
number: int
|
|
|
|
|
|
class DivisibilityResponse(BaseModel):
|
|
number: int
|
|
is_divisible_by_2: bool
|
|
is_divisible_by_3: bool
|
|
|
|
|
|
class NumberCheckResponse(DivisibilityResponse):
|
|
id: int
|
|
created_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|