feat: переименование доменной области

This commit is contained in:
Artem Tsyrulnikov
2025-12-14 12:21:35 +03:00
parent 3cb3da4dbe
commit f3e09a08eb
75 changed files with 1624 additions and 1417 deletions

View File

@@ -0,0 +1,74 @@
import uuid
from typing import Annotated
from fastapi import Depends
from fastapi.routing import APIRouter
from src import deps, dto
from src.adapter.jwt import JWTPayload
purchase_plan_channels_router = APIRouter(
prefix='/workspaces/{workspace_id}/projects/{project_id}/purchase-plan/channels',
tags=['purchase plan'],
)
@purchase_plan_channels_router.get('')
async def get_purchase_plan_channels(
workspace_id: uuid.UUID,
project_id: uuid.UUID,
current_user: Annotated[JWTPayload, Depends(deps.get_current_user)],
) -> dto.GetPurchasePlanChannelsOutput:
input = dto.GetPurchasePlanChannelsInput(
user_id=current_user.user_id,
workspace_id=workspace_id,
project_id=project_id,
)
return await deps.get_usecase().get_purchase_plan_channels(input=input)
@purchase_plan_channels_router.post('')
async def attach_channel_to_purchase_plan(
request: dto.AttachChannelToPurchasePlanInput,
workspace_id: uuid.UUID,
project_id: uuid.UUID,
current_user: Annotated[JWTPayload, Depends(deps.get_current_user)],
) -> dto.PurchasePlanChannelOutput:
return await deps.get_usecase().attach_channel_to_purchase_plan(
project_id=project_id,
workspace_id=workspace_id,
user_id=current_user.user_id,
input=request,
)
@purchase_plan_channels_router.patch('/{channel_id}')
async def update_purchase_plan_channel(
channel_id: uuid.UUID,
request: dto.UpdatePurchasePlanChannelInput,
workspace_id: uuid.UUID,
project_id: uuid.UUID,
current_user: Annotated[JWTPayload, Depends(deps.get_current_user)],
) -> dto.PurchasePlanChannelOutput:
return await deps.get_usecase().update_purchase_plan_channel(
channel_id=channel_id,
project_id=project_id,
workspace_id=workspace_id,
user_id=current_user.user_id,
input=request,
)
@purchase_plan_channels_router.delete('/{channel_id}')
async def remove_purchase_plan_channel(
channel_id: uuid.UUID,
workspace_id: uuid.UUID,
project_id: uuid.UUID,
current_user: Annotated[JWTPayload, Depends(deps.get_current_user)],
) -> None:
await deps.get_usecase().remove_purchase_plan_channel(
channel_id=channel_id,
project_id=project_id,
workspace_id=workspace_id,
user_id=current_user.user_id,
)