app
This commit is contained in:
parent
dc47eced14
commit
78eafc739e
@ -10,8 +10,8 @@ import os
|
||||
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
|
||||
from db.models import Base
|
||||
from db.database import DATABASE_URL
|
||||
from app.db.models import Base
|
||||
from app.db.database import DATABASE_URL
|
||||
|
||||
# this is the Alembic Config object, which provides
|
||||
# access to the values within the .ini file in use.
|
||||
|
@ -4,10 +4,10 @@ from contextlib import contextmanager
|
||||
from typing import Generator
|
||||
import os
|
||||
from sqlalchemy import inspect
|
||||
from services.tcgplayer import TCGPlayerService
|
||||
from services.pricing import PricingService
|
||||
from services.file import FileService
|
||||
from db.models import Price
|
||||
from app.services.tcgplayer import TCGPlayerService
|
||||
from app.services.pricing import PricingService
|
||||
from app.services.file import FileService
|
||||
from app.db.models import Price
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from contextlib import contextmanager
|
||||
from sqlalchemy.orm import Session
|
||||
from exceptions import FailedUploadException
|
||||
from app.exceptions import FailedUploadException
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -2,17 +2,17 @@ from typing import Annotated
|
||||
from sqlalchemy.orm import Session
|
||||
from fastapi import Depends, Form
|
||||
|
||||
from services.box import BoxService
|
||||
from services.tcgplayer import TCGPlayerService
|
||||
from services.pricing import PricingService
|
||||
from services.file import FileService
|
||||
from services.product import ProductService
|
||||
from services.inventory import InventoryService
|
||||
from services.task import TaskService
|
||||
from services.storage import StorageService
|
||||
from db.database import get_db
|
||||
from schemas.file import CreateFileRequest
|
||||
from schemas.box import CreateBoxRequest, UpdateBoxRequest, CreateOpenBoxRequest
|
||||
from app.services.box import BoxService
|
||||
from app.services.tcgplayer import TCGPlayerService
|
||||
from app.services.pricing import PricingService
|
||||
from app.services.file import FileService
|
||||
from app.services.product import ProductService
|
||||
from app.services.inventory import InventoryService
|
||||
from app.services.task import TaskService
|
||||
from app.services.storage import StorageService
|
||||
from app.db.database import get_db
|
||||
from app.schemas.file import CreateFileRequest
|
||||
from app.schemas.box import CreateBoxRequest, UpdateBoxRequest, CreateOpenBoxRequest
|
||||
|
||||
# Common type annotation for database dependency
|
||||
DB = Annotated[Session, Depends(get_db)]
|
||||
|
@ -1,8 +1,8 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
import uvicorn
|
||||
from routes.routes import router
|
||||
from db.database import init_db, check_db_connection, get_db
|
||||
from app.routes.routes import router
|
||||
from app.db.database import init_db, check_db_connection, get_db
|
||||
import logging
|
||||
import sys
|
||||
|
||||
|
@ -5,7 +5,7 @@ from io import BytesIO
|
||||
import logging
|
||||
from datetime import datetime
|
||||
|
||||
from schemas.file import (
|
||||
from app.schemas.file import (
|
||||
FileSchema,
|
||||
CreateFileRequest,
|
||||
CreateFileResponse,
|
||||
@ -13,7 +13,7 @@ from schemas.file import (
|
||||
DeleteFileResponse,
|
||||
GetFileQueryParams
|
||||
)
|
||||
from schemas.box import (
|
||||
from app.schemas.box import (
|
||||
CreateBoxResponse,
|
||||
CreateBoxRequest,
|
||||
BoxSchema,
|
||||
@ -22,11 +22,11 @@ from schemas.box import (
|
||||
CreateOpenBoxResponse,
|
||||
OpenBoxSchema
|
||||
)
|
||||
from services.file import FileService
|
||||
from services.box import BoxService
|
||||
from services.task import TaskService
|
||||
from services.pricing import PricingService
|
||||
from dependencies import (
|
||||
from app.services.file import FileService
|
||||
from app.services.box import BoxService
|
||||
from app.services.task import TaskService
|
||||
from app.services.pricing import PricingService
|
||||
from app.dependencies import (
|
||||
get_file_service,
|
||||
get_box_service,
|
||||
get_task_service,
|
||||
|
@ -1,5 +1,5 @@
|
||||
from pydantic import BaseModel, Field, ConfigDict
|
||||
from schemas.base import BaseSchema
|
||||
from app.schemas.base import BaseSchema
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
@ -5,7 +5,7 @@ from sqlalchemy import or_
|
||||
from sqlalchemy.orm import Session
|
||||
import logging
|
||||
|
||||
from db.models import (
|
||||
from app.db.models import (
|
||||
Box,
|
||||
File,
|
||||
StagedFileProduct,
|
||||
@ -15,9 +15,9 @@ from db.models import (
|
||||
TCGPlayerGroups,
|
||||
Inventory
|
||||
)
|
||||
from db.utils import db_transaction
|
||||
from schemas.box import CreateBoxRequest, UpdateBoxRequest, CreateOpenBoxRequest
|
||||
from services.inventory import InventoryService
|
||||
from app.db.utils import db_transaction
|
||||
from app.schemas.box import CreateBoxRequest, UpdateBoxRequest, CreateOpenBoxRequest
|
||||
from app.services.inventory import InventoryService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -6,9 +6,9 @@ import logging
|
||||
import os
|
||||
from io import StringIO
|
||||
|
||||
from db.utils import db_transaction
|
||||
from db.models import File, StagedFileProduct
|
||||
from schemas.file import CreateFileRequest
|
||||
from app.db.utils import db_transaction
|
||||
from app.db.models import File, StagedFileProduct
|
||||
from app.schemas.file import CreateFileRequest
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -3,9 +3,9 @@ from typing import Dict
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from db.models import Product, Inventory
|
||||
from schemas.inventory import UpdateInventoryResponse
|
||||
from db.utils import db_transaction
|
||||
from app.db.models import Product, Inventory
|
||||
from app.schemas.inventory import UpdateInventoryResponse
|
||||
from app.db.utils import db_transaction
|
||||
|
||||
|
||||
class InventoryService:
|
||||
|
@ -1,10 +1,10 @@
|
||||
from sqlalchemy.orm import Session
|
||||
from db.models import File, CardTCGPlayer, Price
|
||||
from services.util._dataframe import TCGPlayerPricingRow, DataframeUtil
|
||||
from services.file import FileService
|
||||
from services.tcgplayer import TCGPlayerService
|
||||
from app.db.models import File, CardTCGPlayer, Price
|
||||
from app.services.util._dataframe import TCGPlayerPricingRow, DataframeUtil
|
||||
from app.services.file import FileService
|
||||
from app.services.tcgplayer import TCGPlayerService
|
||||
from uuid import uuid4
|
||||
from db.utils import db_transaction
|
||||
from app.db.utils import db_transaction
|
||||
from typing import List, Dict
|
||||
import pandas as pd
|
||||
import logging
|
||||
|
@ -3,12 +3,12 @@ from uuid import uuid4
|
||||
from pandas import DataFrame
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from db.utils import db_transaction
|
||||
from db.models import CardManabox, CardTCGPlayer, StagedFileProduct, TCGPlayerGroups
|
||||
from services.util._dataframe import ManaboxRow, DataframeUtil
|
||||
from services.file import FileService
|
||||
from services.tcgplayer import TCGPlayerService
|
||||
from services.storage import StorageService
|
||||
from app.db.utils import db_transaction
|
||||
from app.db.models import CardManabox, CardTCGPlayer, StagedFileProduct, TCGPlayerGroups
|
||||
from app.services.util._dataframe import ManaboxRow, DataframeUtil
|
||||
from app.services.file import FileService
|
||||
from app.services.tcgplayer import TCGPlayerService
|
||||
from app.services.storage import StorageService
|
||||
|
||||
logger = getLogger(__name__)
|
||||
|
||||
|
@ -2,8 +2,8 @@ from uuid import uuid4
|
||||
from typing import List, TypedDict
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from db.utils import db_transaction
|
||||
from db.models import (
|
||||
from app.db.utils import db_transaction
|
||||
from app.db.models import (
|
||||
Warehouse,
|
||||
User,
|
||||
StagedFileProduct,
|
||||
|
@ -2,9 +2,9 @@ from apscheduler.schedulers.background import BackgroundScheduler
|
||||
import logging
|
||||
from typing import Dict, Callable
|
||||
from sqlalchemy.orm import Session
|
||||
from services.product import ProductService
|
||||
from db.models import File
|
||||
from services.pricing import PricingService
|
||||
from app.services.product import ProductService
|
||||
from app.db.models import File
|
||||
from app.services.pricing import PricingService
|
||||
|
||||
|
||||
class TaskService:
|
||||
|
@ -1,6 +1,6 @@
|
||||
import pandas as pd
|
||||
from io import StringIO
|
||||
from db.models import File
|
||||
from app.db.models import File
|
||||
|
||||
|
||||
class ManaboxRow:
|
||||
|
@ -2,7 +2,7 @@ from fastapi.testclient import TestClient
|
||||
from fastapi import BackgroundTasks
|
||||
import pytest
|
||||
import os
|
||||
from main import app
|
||||
from app.main import app
|
||||
|
||||
|
||||
|
||||
|
@ -4,9 +4,9 @@ import pytest
|
||||
from unittest.mock import Mock, patch
|
||||
import asyncio
|
||||
import os
|
||||
from main import app
|
||||
from services.file import FileService
|
||||
from services.task import TaskService
|
||||
from app.main import app
|
||||
from app.services.file import FileService
|
||||
from app.services.task import TaskService
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
[pytest]
|
||||
pythonpath = ./app
|
||||
pythonpath = .
|
Loading…
x
Reference in New Issue
Block a user