mirror of
https://github.com/sortedcord/alemno-payments.git
synced 2026-07-22 04:02:49 +05:30
add test config and basic tests for csv_parser
This commit is contained in:
8
app/api/v1/jobs.py
Normal file
8
app/api/v1/jobs.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from typing import List, Optional
|
||||
from fastapi import APIRouter, Depends, File, UploadFile, Query, HTTPException, status
|
||||
from app.core.dependencies import get_job_service
|
||||
from app.core.exceptions import JobNotFoundException, InvalidCSVException
|
||||
from app.schemas.job import JobResponse, JobStatusResponse, JobResultResponse
|
||||
from app.services.job_service import JobService
|
||||
|
||||
router = APIRouter(prefix="/jobs", tags=["jobs"])
|
||||
48
app/core/config.py
Normal file
48
app/core/config.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from typing import Any
|
||||
from pydantic import Field, computed_field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env", env_file_encoding="utf-8", extra="ignore"
|
||||
)
|
||||
|
||||
# General
|
||||
PROJECT_NAME: str = "Alemno Payments API"
|
||||
API_V1_STR: str = "/api/v1"
|
||||
|
||||
# PostgreSQL
|
||||
POSTGRES_USER: str = Field(default="postgres")
|
||||
POSTGRES_PASSWORD: str = Field(default="postgres")
|
||||
POSTGRES_HOST: str = Field(default="localhost")
|
||||
POSTGRES_PORT: int = Field(default=5432)
|
||||
POSTGRES_DB: str = Field(default="alemno_payments")
|
||||
|
||||
# Redis
|
||||
REDIS_HOST: str = Field(default="localhost")
|
||||
REDIS_PORT: int = Field(default=6379)
|
||||
REDIS_DB: int = Field(default=0)
|
||||
|
||||
@computed_field
|
||||
@property
|
||||
def DATABASE_URL(self) -> str:
|
||||
return (
|
||||
f"postgresql+asyncpg://"
|
||||
f"{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}@"
|
||||
f"{self.POSTGRES_HOST}:{self.POSTGRES_PORT}/"
|
||||
f"{self.POSTGRES_DB}"
|
||||
)
|
||||
|
||||
@computed_field
|
||||
@property
|
||||
def CELERY_BROKER_URL(self) -> str:
|
||||
return f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}/{self.REDIS_DB}"
|
||||
|
||||
@computed_field
|
||||
@property
|
||||
def CELERY_RESULT_BACKEND(self) -> str:
|
||||
return f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}/{self.REDIS_DB}"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user