Package com.skava.promotion.web
Class PromoWalletController
java.lang.Object
com.skava.promotion.web.PromoWalletController
This class contains the functionalities to perform CRUD operation on promotion wallet
- Since:
- 8.0
- Version:
- 8.0
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<PromoWalletResponse>
createPromoWallet
(String authToken, String versionId, long collectionId, String locale, @Valid PromoWalletRequest request) Contains functionality to create the promo code listvoid
deletePromoWallet
(String authToken, String versionId, long collectionId, String locale, String id) Functionality to delete promo code list based on the given list id.org.springframework.http.ResponseEntity<PromoWalletResponse>
findPromoWallet
(String authToken, String versionId, long collectionId, String locale, String id) org.springframework.http.ResponseEntity<PromoWalletResponseList>
loadAllPromoWallet
(String authToken, String versionId, long collectionId, String locale, EcomSorts sort, String filters, int page, int size) Contains functionality to load promowallet based on the given page requestorg.springframework.http.ResponseEntity<PromoWalletResponse>
patchUpdateWallet
(String authToken, String versionId, long collectionId, String locale, String id, PromoWalletRequest request) Contains functionality to update the promo walletorg.springframework.http.ResponseEntity<PromoWalletResponse>
updatePromoWallet
(String authToken, String versionId, long collectionId, String locale, String id, @Valid PromoWalletRequest request) Contains functionality to update the promo code list
-
Constructor Details
-
PromoWalletController
public PromoWalletController()
-
-
Method Details
-
createPromoWallet
@PreAuthorize("hasPrivilegeForServiceAndCollection(\'promotion/create/promowallet\', \'promotion\', #collectionId)") @ResponseStatus(CREATED) @PostMapping @Audit public org.springframework.http.ResponseEntity<PromoWalletResponse> createPromoWallet(@RequestHeader(value="x-auth-token",required=true) @IgnoreAudit String authToken, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="Version Id") String versionId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="Collection Id") long collectionId, @RequestHeader(value="locale",required=true,defaultValue="en_US") @IgnoreAudit String locale, @RequestBody(required=true) @AuditField(field="Promo wallet Create request") @Valid @Valid PromoWalletRequest request) Contains functionality to create the promo code list- Parameters:
authToken
- An unique token used for authorize the user.collectionId
- An unique id of the collection, where the list has to residelocale
- Response would be rendered in the mentioned localerequest
- Holds the instance ofPromoCodeList
versionId
- It refers to the version value of the API.- Returns:
- Returns the instance of @
ResponseEntity
<PromoCodeListResponse
>
-
loadAllPromoWallet
@ResponseStatus(OK) @GetMapping @PreAuthorize("hasPrivilegeForServiceAndCollection(\'promotion/viewall/promowallet\', \'promotion\', #collectionId)") @Audit public org.springframework.http.ResponseEntity<PromoWalletResponseList> loadAllPromoWallet(@RequestHeader(value="x-auth-token",required=true) @IgnoreAudit String authToken, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="Version Id") String versionId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="Collection Id") long collectionId, @RequestHeader(value="locale",required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestParam(value="sort",required=false) @AuditField(field="Sort") EcomSorts sort, @RequestParam(value="filters",required=false) @AuditField(field="Filters") String filters, @RequestParam(value="page",required=false,defaultValue="1") @AuditField(field="Page No.") int page, @RequestParam(value="size",required=false,defaultValue="10") @AuditField(field="Size") int size) Contains functionality to load promowallet based on the given page request- Parameters:
authToken
- An unique token used for authorize the user.collectionId
- An unique id of the collection, where the list resideslocale
- Response would be rendered in the mentioned localesort
- Holds the parameters for sorting.filters
- Holds the description for request parameter filter/search.page
- To mention the index for loading the promo wallet.size
- To mention the number of maximum items that can be fetched from the DB.versionId
- It refers to the version value of the API.- Returns:
- Returns the instance
of @
ResponseEntity
<PromoWalletResponse
>
-
deletePromoWallet
@ResponseStatus(NO_CONTENT) @DeleteMapping("/{id}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'promotion/delete/promowallet\', \'promotion\', #collectionId)") @Audit public void deletePromoWallet(@RequestHeader(value="x-auth-token",required=true) @IgnoreAudit String authToken, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="Version Id") String versionId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="Collection Id") long collectionId, @RequestHeader(value="locale",required=false,defaultValue="en_US") @IgnoreAudit String locale, @PathVariable(value="id",required=true) @AuditField(field="Promo code list Id") String id) Functionality to delete promo code list based on the given list id.- Parameters:
authToken
- An unique token used to authorize the user.collectionId
- An unique id of the collection, where the list resides.locale
- Response would be rendered in the mentioned locale.id
- An id of the promocode list which needs to be deleted.versionId
- It refers to the version value of the API.
-
findPromoWallet
@ResponseStatus(OK) @GetMapping("/{id}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'promotion/view/promowallet\', \'promotion\',#collectionId)") @Audit public org.springframework.http.ResponseEntity<PromoWalletResponse> findPromoWallet(@RequestHeader(value="x-auth-token",required=true) @IgnoreAudit String authToken, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="Version Id") String versionId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="Collection Id") long collectionId, @RequestHeader(value="locale",required=false,defaultValue="en_US") @IgnoreAudit String locale, @PathVariable(value="id",required=true) @AuditField(field="promo code list Id") String id) -
updatePromoWallet
@ResponseStatus(OK) @PutMapping("/{id}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'promotion/update/promowallet\', \'promotion\', #collectionId)") @Audit public org.springframework.http.ResponseEntity<PromoWalletResponse> updatePromoWallet(@RequestHeader(value="x-auth-token",required=true) @IgnoreAudit String authToken, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="Version Id") String versionId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="Collection Id") long collectionId, @RequestHeader(value="locale",required=true,defaultValue="en_US") @IgnoreAudit String locale, @PathVariable(value="id",required=true) @AuditField(field="Promo code list Id") String id, @RequestBody(required=true) @AuditField(field="Promowallet Update Request") @Valid @Valid PromoWalletRequest request) Contains functionality to update the promo code list- Parameters:
authToken
- An unique token used to authorize the user.collectionId
- An unique id of the collection, where the list resides.locale
- Response would be rendered in the mentioned locale.id
- An id of the promo code list which needs to be updated.request
- Holds the instance of com.skava.promotion.model.exchange.request.PromoCodeList.versionId
- It refers to the version value of the API.- Returns:
- Returns the instance of @
ResponseEntity
<PromoCodeListAPIResponse
>
-
patchUpdateWallet
@ResponseStatus(OK) @PatchMapping("/{id}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'promotion/update/promowallet\', \'promotion\', #collectionId)") @Audit public org.springframework.http.ResponseEntity<PromoWalletResponse> patchUpdateWallet(@RequestHeader(value="x-auth-token",required=true) @IgnoreAudit String authToken, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="Version Id") String versionId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="Collection Id") long collectionId, @RequestHeader(value="locale",required=true,defaultValue="en_US") @IgnoreAudit String locale, @PathVariable(value="id",required=true) @AuditField(field="Promo wallet Id") String id, @RequestBody(required=true) @AuditField(field="Promo walletPatch Update Request") PromoWalletRequest request) Contains functionality to update the promo wallet- Parameters:
authToken
- An unique token used to authorize the user.collectionId
- An unique id of the collection, where the list resides.locale
- Response would be rendered in the mentioned locale.id
- An id of the promo wallet which needs to be updated.request
- Holds the instance of com.skava.promotion.model.exchange.request.PromoWallet.versionId
- It refers to the version value of the API.- Returns:
- Returns the instance of @
ResponseEntity
<PromoWalletAPIResponse
>
-