
    W8i                     2    d dl mZ d dlmZ  G d de      Zy)    )Response)OurLimitOffsetPaginationc                       e Zd Zd Zy) AppointmentLimitOffsetPaginationc                    | j                   j                  d   }|j                  |j                               }|j	                  d      j                         }|j	                  d      j                         }||z   }|rt        ||z  dz  d      nd}|rt        ||z  dz  d      nd}t        || j                         | j                         |||||d      S )Nview   )offtimer   d      )countnextprevioustotal_offtimetotal_ontimeofftime_percentageontime_percentageresults)
requestparser_contextfilter_querysetget_querysetfilterr   roundr   get_next_linkget_previous_link)	selfdatar   querysettotal_offtime_bookingstotal_ontime_bookings	total_allr   r   s	            E/var/www/html/dp2/backend_v2.1/server/apps/appointments/pagination.pyget_paginated_responsez7AppointmentLimitOffsetPagination.get_paginated_response   s    ||**62''(9(9(;<!)!;!A!A!C ( : @ @ B*-BB	  ##i/36
 	
  ""Y.#5q
 	 &&(..031"4!2	
 	 		    N)__name__
__module____qualname__r$    r%   r#   r   r      s    r%   r   N)rest_framework.responser   utils.paginationsr   r   r)   r%   r#   <module>r,      s    , 6'? r%   