feat: parser, refactoring
This commit is contained in:
@@ -41,7 +41,7 @@ async def create_placement(self: 'Usecase', input: dto.CreatePlacementInput, use
|
||||
requires_approval=requires_approval,
|
||||
)
|
||||
|
||||
# Создаём закуп
|
||||
# Создаём закуп со статусом PENDING (ожидаем публикацию поста)
|
||||
placement = domain.Placement(
|
||||
target_channel_id=input.target_channel_id,
|
||||
external_channel_id=input.external_channel_id,
|
||||
@@ -50,10 +50,9 @@ async def create_placement(self: 'Usecase', input: dto.CreatePlacementInput, use
|
||||
placement_date=input.placement_date,
|
||||
cost=input.cost,
|
||||
comment=input.comment,
|
||||
ad_post_url=input.ad_post_url,
|
||||
invite_link_type=input.invite_link_type,
|
||||
invite_link=invite_link,
|
||||
status=domain.PlacementStatus.ACTIVE,
|
||||
status=domain.PlacementStatus.PENDING,
|
||||
)
|
||||
|
||||
created = await self.database.create_placement(placement)
|
||||
@@ -62,7 +61,6 @@ async def create_placement(self: 'Usecase', input: dto.CreatePlacementInput, use
|
||||
creative.placements_count += 1
|
||||
await self.database.update_creative(creative)
|
||||
|
||||
# Формируем ответ внутри транзакции, пока объекты в сессии
|
||||
return dto.PlacementOutput(
|
||||
id=created.id,
|
||||
target_channel_id=created.target_channel_id,
|
||||
|
||||
Reference in New Issue
Block a user