fr.paris.lutece.plugins.stock.modules.tickets.service
Class PurchaseService

java.lang.Object
  extended by fr.paris.lutece.plugins.stock.service.impl.AbstractService
      extended by fr.paris.lutece.plugins.stock.modules.tickets.service.PurchaseService
All Implemented Interfaces:
IPurchaseService

@Transactional(rollbackFor=java.lang.Exception.class)
public final class PurchaseService
extends fr.paris.lutece.plugins.stock.service.impl.AbstractService
implements IPurchaseService

PurchaseService.


Field Summary
static java.lang.String MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER
          The Constant MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER.
static java.lang.String MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER_TYPE
          The Constant MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER_TYPE.
static java.lang.String MESSAGE_ERROR_PURCHASE_SESSION_EXPIRED
          The Constant MESSAGE_ERROR_PURCHASE_SESSION_EXPIRED.
static java.lang.String MESSAGE_ERROR_PURCHASE_UNAVAILABLE
          The Constant MESSAGE_ERROR_PURCHASE_UNAVAILABLE.
static java.lang.String RESOURCE_TYPE
          The Constant RESOURCE_TYPE.
static java.lang.String RIGHT_MANAGE_OFFRES
          The Constant RIGHT_MANAGE_OFFRES.
 
Method Summary
 void doCancelPurchaseList(java.util.List<ReservationDTO> bookingList, java.lang.String sessionId)
          Release a list of reservation.
 void doDeletePurchase(int nIdPurchase)
          Delete a reservation.
 ReservationDTO doSavePurchase(ReservationDTO purchaseDTO, java.lang.String sessionId)
          Modifies a reservation.
 java.util.List<ReservationDTO> doSavePurchaseList(java.util.List<ReservationDTO> bookingList, java.lang.String sessionId)
          Save a list of reservation.
 java.util.List<ReservationDTO> findAll()
          Find all.
 fr.paris.lutece.plugins.stock.commons.ResultList<ReservationDTO> findByFilter(fr.paris.lutece.plugins.stock.business.purchase.PurchaseFilter filter, fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
          Find by filter.
 ReservationDTO findById(java.lang.Integer nIdPurchase)
          Return an purchase by his id.
 java.lang.Integer getNumberOfReservationByIdProductAndUserName(java.lang.Integer id, java.lang.Integer idOfferGenre, java.lang.String userName)
          Return the number of reservation for an offer and an agent.
 void init()
          Init this service.
 void update(ReservationDTO purchase)
          Update.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RIGHT_MANAGE_OFFRES

public static final java.lang.String RIGHT_MANAGE_OFFRES
The Constant RIGHT_MANAGE_OFFRES.

See Also:
Constant Field Values

RESOURCE_TYPE

public static final java.lang.String RESOURCE_TYPE
The Constant RESOURCE_TYPE.

See Also:
Constant Field Values

MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER

public static final java.lang.String MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER
The Constant MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER.

See Also:
Constant Field Values

MESSAGE_ERROR_PURCHASE_UNAVAILABLE

public static final java.lang.String MESSAGE_ERROR_PURCHASE_UNAVAILABLE
The Constant MESSAGE_ERROR_PURCHASE_UNAVAILABLE.

See Also:
Constant Field Values

MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER_TYPE

public static final java.lang.String MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER_TYPE
The Constant MESSAGE_ERROR_PURCHASE_QUANTITY_OFFER_TYPE.

See Also:
Constant Field Values

MESSAGE_ERROR_PURCHASE_SESSION_EXPIRED

public static final java.lang.String MESSAGE_ERROR_PURCHASE_SESSION_EXPIRED
The Constant MESSAGE_ERROR_PURCHASE_SESSION_EXPIRED.

See Also:
Constant Field Values
Method Detail

init

public void init()
Init this service.

Specified by:
init in interface IPurchaseService

doSavePurchase

public ReservationDTO doSavePurchase(ReservationDTO purchaseDTO,
                                     java.lang.String sessionId)
Modifies a reservation.

Specified by:
doSavePurchase in interface IPurchaseService
Parameters:
purchaseDTO - The reservation to modify in database
sessionId - the session id
Returns:
the reservation dto

doSavePurchaseList

public java.util.List<ReservationDTO> doSavePurchaseList(java.util.List<ReservationDTO> bookingList,
                                                         java.lang.String sessionId)
Save a list of reservation.

Specified by:
doSavePurchaseList in interface IPurchaseService
Parameters:
bookingList - list of reservation
sessionId - the session id
Returns:
the list

getNumberOfReservationByIdProductAndUserName

public java.lang.Integer getNumberOfReservationByIdProductAndUserName(java.lang.Integer id,
                                                                      java.lang.Integer idOfferGenre,
                                                                      java.lang.String userName)
Return the number of reservation for an offer and an agent.

Specified by:
getNumberOfReservationByIdProductAndUserName in interface IPurchaseService
Parameters:
id - offer id
idOfferGenre - the id offer genre
userName - agent userName
Returns:
number of reservation

doDeletePurchase

public void doDeletePurchase(int nIdPurchase)
Delete a reservation.

Specified by:
doDeletePurchase in interface IPurchaseService
Parameters:
nIdPurchase - the identifier of the reservation to delete

update

public void update(ReservationDTO purchase)
Update.

Specified by:
update in interface IPurchaseService
Parameters:
purchase - the purchase

findByFilter

public fr.paris.lutece.plugins.stock.commons.ResultList<ReservationDTO> findByFilter(fr.paris.lutece.plugins.stock.business.purchase.PurchaseFilter filter,
                                                                                     fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
Find by filter.

Specified by:
findByFilter in interface IPurchaseService
Parameters:
filter - the filter
paginationProperties - the pagination properties
Returns:
the purchase list filtered

findAll

public java.util.List<ReservationDTO> findAll()
Find all.

Specified by:
findAll in interface IPurchaseService
Returns:
the list

findById

public ReservationDTO findById(java.lang.Integer nIdPurchase)
Return an purchase by his id.

Specified by:
findById in interface IPurchaseService
Parameters:
nIdPurchase - purchase id
Returns:
the other

doCancelPurchaseList

public void doCancelPurchaseList(java.util.List<ReservationDTO> bookingList,
                                 java.lang.String sessionId)
Release a list of reservation.

Specified by:
doCancelPurchaseList in interface IPurchaseService
Parameters:
bookingList - the booking list
sessionId - the session id


Copyright © 2012 Mairie de Paris. All Rights Reserved.