-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #378 from Ecwid/ECWID-135161-reviews-api
ECWID-135161 Added mass update method for product reviews
- Loading branch information
Showing
13 changed files
with
144 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/com/ecwid/apiclient/v3/dto/productreview/enums/ProductReviewSelectMode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.ecwid.apiclient.v3.dto.productreview.enums | ||
|
||
enum class ProductReviewSelectMode { | ||
SELECTED, | ||
ALL_FILTERED, | ||
ALL, | ||
} |
17 changes: 17 additions & 0 deletions
17
...otlin/com/ecwid/apiclient/v3/dto/productreview/request/ProductReviewFiltersDataRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.ecwid.apiclient.v3.dto.productreview.request | ||
|
||
import com.ecwid.apiclient.v3.dto.ApiRequest | ||
import com.ecwid.apiclient.v3.impl.RequestInfo | ||
import com.ecwid.apiclient.v3.responsefields.ResponseFields | ||
|
||
data class ProductReviewFiltersDataRequest( | ||
val responseFields: ResponseFields = ResponseFields.All, | ||
) : ApiRequest { | ||
override fun toRequestInfo() = RequestInfo.createGetRequest( | ||
pathSegments = listOf( | ||
"reviews", | ||
"filters_data", | ||
), | ||
responseFields = responseFields, | ||
) | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/kotlin/com/ecwid/apiclient/v3/dto/productreview/request/ProductReviewMassUpdate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.ecwid.apiclient.v3.dto.productreview.request | ||
|
||
import com.ecwid.apiclient.v3.dto.common.ApiRequestDTO | ||
import com.ecwid.apiclient.v3.dto.productreview.enums.ProductReviewSelectMode | ||
import com.ecwid.apiclient.v3.dto.productreview.enums.ProductReviewStatus | ||
import java.time.Instant | ||
|
||
data class ProductReviewMassUpdate( | ||
val reviewIds: List<Long>? = null, | ||
val selectMode: ProductReviewSelectMode? = null, | ||
val delete: Boolean = false, | ||
val newStatus: ProductReviewStatus? = null, | ||
val filters: Filters? = null, | ||
) : ApiRequestDTO { | ||
|
||
data class Filters( | ||
val reviewId: String? = null, | ||
val productId: String? = null, | ||
val orderId: String? = null, | ||
val status: ProductReviewStatus? = null, | ||
val rating: Int? = null, | ||
val createdFrom: Instant? = null, | ||
val createdTo: Instant? = null, | ||
val searchKeyword: String? = null, | ||
) | ||
} |
20 changes: 20 additions & 0 deletions
20
...kotlin/com/ecwid/apiclient/v3/dto/productreview/request/ProductReviewMassUpdateRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.ecwid.apiclient.v3.dto.productreview.request | ||
|
||
import com.ecwid.apiclient.v3.dto.ApiRequest | ||
import com.ecwid.apiclient.v3.httptransport.HttpBody | ||
import com.ecwid.apiclient.v3.impl.RequestInfo | ||
|
||
data class ProductReviewMassUpdateRequest( | ||
val updateInfo: ProductReviewMassUpdate = ProductReviewMassUpdate(), | ||
) : ApiRequest { | ||
override fun toRequestInfo() = RequestInfo.createPutRequest( | ||
pathSegments = listOf( | ||
"reviews", | ||
"mass_update", | ||
), | ||
params = mapOf(), | ||
httpBody = HttpBody.JsonBody( | ||
obj = updateInfo | ||
) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
.../kotlin/com/ecwid/apiclient/v3/dto/productreview/result/ProductReviewFiltersDataResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.ecwid.apiclient.v3.dto.productreview.result | ||
|
||
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO | ||
|
||
data class ProductReviewFiltersDataResult( | ||
val allCount: Int = 0, | ||
val moderatedCount: Int = 0, | ||
val publishedCount: Int = 0, | ||
) : ApiResultDTO |
7 changes: 7 additions & 0 deletions
7
...n/kotlin/com/ecwid/apiclient/v3/dto/productreview/result/ProductReviewMassUpdateResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.ecwid.apiclient.v3.dto.productreview.result | ||
|
||
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO | ||
|
||
data class ProductReviewMassUpdateResult( | ||
val updateCount: Int = 0 | ||
) : ApiResultDTO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
.../com/ecwid/apiclient/v3/rule/nullablepropertyrules/ProductReviewMassUpdateRequestRules.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.ecwid.apiclient.v3.rule.nullablepropertyrules | ||
|
||
import com.ecwid.apiclient.v3.dto.productreview.request.ProductReviewMassUpdate | ||
import com.ecwid.apiclient.v3.rule.NullablePropertyRule | ||
import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable | ||
|
||
val productReviewMassUpdateRequestNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf( | ||
AllowNullable(ProductReviewMassUpdate.Filters::createdFrom), | ||
AllowNullable(ProductReviewMassUpdate.Filters::createdTo), | ||
AllowNullable(ProductReviewMassUpdate.Filters::orderId), | ||
AllowNullable(ProductReviewMassUpdate.Filters::productId), | ||
AllowNullable(ProductReviewMassUpdate.Filters::rating), | ||
AllowNullable(ProductReviewMassUpdate.Filters::reviewId), | ||
AllowNullable(ProductReviewMassUpdate.Filters::searchKeyword), | ||
AllowNullable(ProductReviewMassUpdate.Filters::status), | ||
AllowNullable(ProductReviewMassUpdate::filters), | ||
AllowNullable(ProductReviewMassUpdate::newStatus), | ||
AllowNullable(ProductReviewMassUpdate::reviewIds), | ||
AllowNullable(ProductReviewMassUpdate::selectMode), | ||
) |
19 changes: 19 additions & 0 deletions
19
...tlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/ProductReviewSearchRequestRules.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.ecwid.apiclient.v3.rule.nullablepropertyrules | ||
|
||
import com.ecwid.apiclient.v3.dto.productreview.request.ProductReviewSearchRequest | ||
import com.ecwid.apiclient.v3.rule.NullablePropertyRule | ||
import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable | ||
|
||
val productReviewSearchRequestNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf( | ||
AllowNullable(ProductReviewSearchRequest::createdFrom), | ||
AllowNullable(ProductReviewSearchRequest::createdTo), | ||
AllowNullable(ProductReviewSearchRequest::orderId), | ||
AllowNullable(ProductReviewSearchRequest::productId), | ||
AllowNullable(ProductReviewSearchRequest::rating), | ||
AllowNullable(ProductReviewSearchRequest::reviewId), | ||
AllowNullable(ProductReviewSearchRequest::searchKeyword), | ||
AllowNullable(ProductReviewSearchRequest::sortBy), | ||
AllowNullable(ProductReviewSearchRequest::status), | ||
AllowNullable(ProductReviewSearchRequest::updatedFrom), | ||
AllowNullable(ProductReviewSearchRequest::updatedTo), | ||
) |
18 changes: 0 additions & 18 deletions
18
...lin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/ProductReviewsSearchRequestRules.kt
This file was deleted.
Oops, something went wrong.