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