
    2Yh                         d dl mZmZmZmZmZ d dlmZmZ d dl	m
Z
  ed      Z G d de      Z G d de
ee         Zy	)
    )AnyGenericListOptionalTypeVar)	BaseModelField)GenericModelTc                       e Zd ZU dZ ed      Zeed<    ed      Zeed<    ed      Z	eed<    ed	d
      Z
ee   ed<    ed	d      Zee   ed<    ed      Zeed<    ed      Zeed<   y	)PaginationMetazE
    Pagination metadata schema with navigation links and counts
    zTotal number of records)descriptiontotalzCurrent page numberpagezNumber of records per pageper_pageNzURL for next pagenextzURL for previous pagepreviouszURL for first pagefirstzURL for last pagelast)__name__
__module____qualname____doc__r	   r   int__annotations__r   r   r   r   strr   r   r        ]/var/www/html/wine-match-dev/backend/winematch-backend/src/utils/helpers/pagination_schema.pyr   r   	   s     #<=E3="78D#8&BCHcC2EFD(3-F#D6MNHhsmN#78E38"56D#6r   r   c                   P    e Zd ZU dZeed<   ee   ed<   ede	e
ef   dd fd       Zy)PaginatedResponsezN
    Generic paginated response model that can be used with any data type
    metaresultpaginator_dictreturnc           
      j    t        |d   |d   |d   |d   |d   |d   |d         } | ||d	   
      S )zQ
        Create a PaginatedResponse from a paginator's dictionary output
        r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r#   )r"   r#   )r   )clsr$   r"   s      r   from_paginator_dictz%PaginatedResponse.from_paginator_dict   sZ    
  )'#J/'#J/ )'
 ^H%=>>r   N)r   r   r   r   r   r   r   r   classmethoddictr   r   r(   r   r   r   r!   r!      sA     GO?c3h ?DW ? ?r   r!   N)typingr   r   r   r   r   pydanticr   r	   pydantic.genericsr
   r   r   r!   r   r   r   <module>r.      s8    8 8 % *CL
7Y 
7?gaj ?r   