
    ohk                         d dl mZmZmZmZ d dlmZ d dlmZ d dl	m
Z
mZmZ d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ  e       Zej;                  ded       ee      fdedefd       Zy)    )	APIRouterDependsHTTPExceptionBody)Session)status)OptionalDictAny)ResponseModel)get_db)APIException)	constants)get_current_user)
wine_match)WineMatchPayloadSchemaz/proceedzProcess wine matching)response_modelsummarypayloaddbc                    K   t        j                  || j                                d{   }t        |t        j
                  dd      S 7 !w)a  
    Process wine matching with retailer data (direct conversion from Groovy)
    
    Args:
        payload: Object containing retailers, matchedType, and mode
        db: Database session
    
    Returns:
        ResponseModel: API response with results
    )r   paramsNTz%Wine match job triggered successfully)datastatus_codesuccessmessage)wine_match_serviceprocess_wine_match
model_dumpr   r   HTTP_200_OK)r   r   results      `/var/www/html/wine-match-dev/backend/winematch-backend/src/apps/wine_match/routers/wine_match.pyproceedr#      sM     " &88BwGYGYG[\\F &&7	  ]s   )AA"AN)fastapir   r   r   r   sqlalchemy.ormr   	starletter   typingr	   r
   r   $src.apps.base.schemas.response_modelr   src.core.dependenciesr   src.core.exceptionsr   	src.utilsr   src.utils.guardr   src.apps.wine_match.servicesr   r   &src.apps.wine_match.schemas.wine_matchr   routerpostr#        r"   <module>r3      so    ; ; "  & & > ( ,  , I I	Z?VW &/# Xr2   