Created At: 2026-11-19T05:56:41Z Completed At: 2026-11-19T05:56:41Z Command exited with code 0. Command output: async def update_bot_redeem_code( bot_id: UUID, code_id: UUID, req: UpdateRedeemCodeRequest, tenant_context: Annotated[tuple[Tenant, TenantMember | None], Depends(get_current_tenant)], db: Annotated[AsyncSession, Depends(get_db)], ): """Updates active state, max uses, expiry date, or title of a redeem code.""" tenant, _ = tenant_context bot_service = BotService(db) await bot_service.get_bot(bot_id, tenant_id=tenant.id) mod_service = BotModuleService(db) updated = await mod_service.update_redeem_code(bot_id, code_id, req.model_dump(exclude_unset=True)) return ApiResponse( message="Redeem code updated successfully", data=RedeemCodeResponse.model_validate(updated), ) @router.delete("/{bot_id}/redeem-codes/{code_id}", response_model=ApiResponse[None], status_code=status.HTTP_200_OK) async def delete_bot_redeem_code( bot_id: UUID, code_id: UUID, tenant_context: Annotated[tuple[Tenant, TenantMember | None], Depends(get_current_tenant)], db: Annotated[AsyncSession, Depends(get_db)], ): """Deletes a redeem code and its associated redemption logs.""" tenant, _ = tenant_context bot_service = BotService(db) await bot_service.get_bot(bot_id, tenant_id=tenant.id) mod_service = BotModuleService(db) await mod_service.delete_redeem_code(bot_id, code_id) return ApiResponse( message="Redeem code deleted successfully", data=None, ) @router.get("/{bot_id}/redeem-codes/{code_id}/logs", response_model=ApiResponse[list[RedeemLogResponse]], status_code=status.HTTP_200_OK) async def list_code_redemption_logs( bot_id: UUID, code_id: UUID, tenant_context: Annotated[tuple[Tenant, TenantMember | None], Depends(get_current_tenant)], db: Annotated[AsyncSession, Depends(get_db)], ): """Lists all subscribers who claimed this promotional code.""" tenant, _ = tenant_context bot_service = BotService(db) await bot_service.get_bot(bot_id, tenant_id=tenant.id) mod_service = BotModuleService(db) logs = await mod_service.list_redeem_logs(bot_id, code_id) return ApiResponse( message="Redemption audit logs retrieved successfully", data=[RedeemLogResponse.model_validate(l) for l in logs], )