Skip to content

Commit

Permalink
PI-18753: Added Serializable and Builder to SubscriptionOrder event
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulMichardAppDirect authored and naponce committed Jun 19, 2020
1 parent 82cafd1 commit 8f594ed
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

package com.appdirect.sdk.appmarket.events;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -26,7 +28,7 @@
@ToString
@AllArgsConstructor
@Builder
public class CompanyInfo {
public class CompanyInfo implements Serializable {
private String uuid;
private String name;
private String email;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static com.appdirect.sdk.appmarket.events.EventFlag.DEVELOPMENT;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -32,7 +33,7 @@
@EqualsAndHashCode
@AllArgsConstructor
@NoArgsConstructor
public abstract class EventWithContext {
public abstract class EventWithContext implements Serializable {
/**
* Returns the consumer key that was used by the appmarket to publish this event.
* You can use this to determine which product is the originator of this event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static java.util.Objects.isNull;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -12,7 +13,7 @@
@Getter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class EventWithContextWithConfiguration extends EventWithContext {
public class EventWithContextWithConfiguration extends EventWithContext implements Serializable {
private Map<String, String> configuration = new HashMap<>();

public EventWithContextWithConfiguration(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.appdirect.sdk.appmarket.events;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -9,6 +11,6 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FreeTrialInfo {
private Boolean active;
public class FreeTrialInfo implements Serializable {
private Boolean active;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package com.appdirect.sdk.appmarket.events;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -32,7 +33,7 @@
@AllArgsConstructor
@EqualsAndHashCode
@Builder
public class OrderInfo {
public class OrderInfo implements Serializable {
private String editionCode;
private String addonOfferingCode;
private PricingDuration pricingDuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@

package com.appdirect.sdk.appmarket.events;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

@Getter
@ToString
@AllArgsConstructor
public class OrderItemInfo {
public class OrderItemInfo implements Serializable {
private PricingUnit unit;
private int quantity;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@

package com.appdirect.sdk.appmarket.events;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -27,7 +29,8 @@
@Getter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class SubscriptionOrder extends EventWithContextWithConfiguration {
@Builder
public class SubscriptionOrder extends EventWithContextWithConfiguration implements Serializable {
private UserInfo purchaserInfo;
private CompanyInfo companyInfo;
private OrderInfo orderInfo;
Expand Down Expand Up @@ -71,7 +74,7 @@ public SubscriptionOrder(String consumerKeyUsedByTheRequest,
String samlIdpUrl) { // NOSONAR: constructor is too big, but it's mostly just for sdk use

this(consumerKeyUsedByTheRequest, flag, purchaserInfo, new HashMap<>(), companyInfo, orderInfo, partner,
applicationUuid, queryParameters, eventToken, marketplaceUrl, samlIdpUrl);
applicationUuid, queryParameters, eventToken, marketplaceUrl, samlIdpUrl);
}

public Optional<String> getApplicationUuid() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package com.appdirect.sdk.appmarket.events;

import java.io.Serializable;
import java.util.Map;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +27,7 @@
@AllArgsConstructor
@EqualsAndHashCode
@Builder
public class UserInfo {
public class UserInfo implements Serializable {
private String uuid;
private String openId;
private String email;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.appdirect.sdk.meteredusage.model;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -9,7 +11,7 @@
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CustomAttribute {
public class CustomAttribute implements Serializable {
private String attributeType;
private String name;
private String value;
Expand Down

0 comments on commit 8f594ed

Please sign in to comment.