Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jaxrs: remove ability to pass DateTime when LocalDate is expected
This fixes #488. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
- Loading branch information
Showing
7 changed files
with
42 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,12 +205,10 @@ public Response pauseBundle(@PathParam(ID_PARAM_NAME) final String id, | |
@HeaderParam(HDR_REASON) final String reason, | ||
@HeaderParam(HDR_COMMENT) final String comment, | ||
@javax.ws.rs.core.Context final HttpServletRequest request) throws SubscriptionApiException, EntitlementApiException, AccountApiException { | ||
|
||
final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); | ||
final CallContext callContext = context.createContext(createdBy, reason, comment, request); | ||
final UUID bundleId = UUID.fromString(id); | ||
final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, callContext); | ||
final LocalDate inputLocalDate = toLocalDate(bundle.getAccountId(), requestedDate, callContext); | ||
final LocalDate inputLocalDate = toLocalDate(requestedDate, callContext); | ||
entitlementApi.pause(bundleId, inputLocalDate, pluginProperties, callContext); | ||
return Response.status(Status.OK).build(); | ||
} | ||
|
@@ -230,12 +228,10 @@ public Response resumeBundle(@PathParam(ID_PARAM_NAME) final String id, | |
@HeaderParam(HDR_REASON) final String reason, | ||
@HeaderParam(HDR_COMMENT) final String comment, | ||
@javax.ws.rs.core.Context final HttpServletRequest request) throws SubscriptionApiException, EntitlementApiException, AccountApiException { | ||
|
||
final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); | ||
final CallContext callContext = context.createContext(createdBy, reason, comment, request); | ||
final UUID bundleId = UUID.fromString(id); | ||
final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, callContext); | ||
final LocalDate inputLocalDate = toLocalDate(bundle.getAccountId(), requestedDate, callContext); | ||
final LocalDate inputLocalDate = toLocalDate(requestedDate, callContext); | ||
entitlementApi.resume(bundleId, inputLocalDate, pluginProperties, callContext); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sbrossie
Member
|
||
return Response.status(Status.OK).build(); | ||
} | ||
|
@@ -362,7 +358,7 @@ public Response transferBundle(final BundleJson json, | |
final UUID bundleId = UUID.fromString(id); | ||
|
||
final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, callContext); | ||
final LocalDate inputLocalDate = toLocalDate(bundle.getAccountId(), requestedDate, callContext); | ||
final LocalDate inputLocalDate = toLocalDate(requestedDate, callContext); | ||
|
||
final UUID newBundleId = entitlementApi.transferEntitlementsOverrideBillingPolicy(bundle.getAccountId(), UUID.fromString(json.getAccountId()), bundle.getExternalKey(), inputLocalDate, policy, pluginProperties, callContext); | ||
return uriBuilder.buildResponse(BundleResource.class, "getBundle", newBundleId, uriInfo.getBaseUri().toString()); | ||
|
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
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
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
Oops, something went wrong.
1 comment
on commit 5effd5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Don't we want to also use the
toLocalDateDefaultToday
for all the subscription endpoints?