Skip to content

Commit

Permalink
fix config issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Valimp committed Dec 7, 2023
1 parent 349f68c commit 97b1c22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ POSTGRES_HOST=postgres
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_EXPOSE=127.0.0.1:5432
# expose postgres on localhost for dev
# POSTGRES_EXPOSE=127.0.0.1:5432
14 changes: 7 additions & 7 deletions app/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from enum import Enum
from enum import Enum, auto
from pathlib import Path

from fastapi import FastAPI, HTTPException, Request
Expand Down Expand Up @@ -58,16 +58,16 @@ async def catch_exceptions(request: Request, call_next):


class TicketStatus(str, Enum):
open = "open"
closed = "closed"
open = auto()
closed = auto()


class TicketCreate(BaseModel):
barcode: str = Field(..., description="Barcode of the product")
type: str = Field(..., description="Type of the issue")
url: str = Field(..., description="URL of the product")
url: str = Field(..., description="URL of the product, only for search issues")
status: TicketStatus = Field(..., description="Status of the ticket")
image_id: str = Field(..., description="Image ID of the product")
image_id: str = Field(..., description="ID of the flagged image")
flavour: Flavor = Field(..., description="Flavour of the product")
created_at: datetime = Field(default_factory=datetime.utcnow)

Expand All @@ -79,15 +79,15 @@ class Ticket(TicketCreate):
class FlagCreate(BaseModel):
barcode: str = Field(..., description="Barcode of the product")
type: str = Field(..., description="Type of the issue")
url: str = Field(..., description="URL of the product")
url: str = Field(..., description="URL of the product, only for search issues")
user_id: str = Field(..., description="User ID of the flagger")
device_id: str = Field(..., description="Device ID of the flagger")
source: str = Field(..., description="Source of the flag")
confidence: float = Field(
...,
description="Confidence of the flag, it's a machine learning confidence score. It's a float between 0 and 1 and it's optional.",
)
image_id: str = Field(..., description="Image ID of the product")
image_id: str = Field(..., description="Image ID of the flagged image")
flavour: Flavor = Field(..., description="Flavour of the product")
reason: str = Field(..., description="Reason of the flag")
comment: str = Field(..., description="Comment of the flag")
Expand Down
1 change: 0 additions & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)


# Définissez vos modèles de table
class TicketModel(Model):
id = IntegerField(primary_key=True)
barcode = CharField()
Expand Down

0 comments on commit 97b1c22

Please sign in to comment.