Skip to content

Commit 634840f

Browse files
Merge pull request #50 from SiftScience/add_tags_field_to_booking
adding tags field to booking complex field
2 parents f381a8d + 0f4da75 commit 634840f

File tree

5 files changed

+42
-7
lines changed

5 files changed

+42
-7
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'signing'
55
apply plugin: 'java-library-distribution'
66

77
group = 'com.siftscience'
8-
version = '3.1.0'
8+
version = '3.2.0'
99

1010
repositories {
1111
mavenCentral()

src/main/java/com/siftscience/model/Booking.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class Booking {
2020
@Expose @SerializedName("$venue_id") private String venueId;
2121
@Expose @SerializedName("$location") private Address location;
2222
@Expose @SerializedName("$category") private String category;
23+
@Expose @SerializedName("$tags") private List<String> tags;
2324

2425
public String getBookingType() {
2526
return bookingType;
@@ -146,4 +147,14 @@ public Booking setCategory(String category) {
146147
this.category = category;
147148
return this;
148149
}
150+
151+
public List<String> getTags() {
152+
return tags;
153+
}
154+
155+
public Booking setTags(List<String> tags) {
156+
this.tags = tags;
157+
return this;
158+
}
159+
149160
}

src/test/java/com/siftscience/CreateOrderEventWithBookingsTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void testCreateOrderEvent() throws JSONException, IOException,
7878
" \"$loyalty_program\": \"skymiles\",\n" +
7979
" \"$loyalty_program_id\": \"PSOV34DF\",\n" +
8080
" \"$phone\": \"1-415-555-6040\",\n" +
81-
" \"$email\": \"jdeo@domain.com\"\n" +
81+
" \"$email\": \"jdoe@domain.com\"\n" +
8282
" },\n" +
8383
" {\n" +
8484
" \"$name\": \"Jane Doe\"\n" +
@@ -118,7 +118,11 @@ public void testCreateOrderEvent() throws JSONException, IOException,
118118
" ],\n" +
119119
" \"$price\": 49900000,\n" +
120120
" \"$currency_code\": \"USD\",\n" +
121-
" \"$quantity\": 1\n" +
121+
" \"$quantity\": 1,\n" +
122+
" \"$tags\": [\n" +
123+
" \"team-123\",\n" +
124+
" \"region-123\"\n" +
125+
" ]\n" +
122126
" }\n" +
123127
" ],\n" +
124128
"\n" +

src/test/java/com/siftscience/TestUtils.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
package com.siftscience;
22

3-
import com.siftscience.model.*;
3+
import com.siftscience.model.Address;
4+
import com.siftscience.model.Booking;
5+
import com.siftscience.model.CreditPoint;
6+
import com.siftscience.model.Discount;
7+
import com.siftscience.model.Guest;
8+
import com.siftscience.model.Item;
9+
import com.siftscience.model.PaymentMethod;
10+
import com.siftscience.model.Promotion;
11+
import com.siftscience.model.Segment;
412

513
import java.util.ArrayList;
614
import java.util.List;
@@ -87,6 +95,13 @@ static List<String> sampleTags2() {
8795
return tags;
8896
}
8997

98+
static List<String> sampleTags3() {
99+
List<String> tags = new ArrayList<>();
100+
tags.add("team-123");
101+
tags.add("region-123");
102+
return tags;
103+
}
104+
90105
static Item sampleItem2() {
91106
return new Item()
92107
.setItemId("B004834GQO")
@@ -119,6 +134,7 @@ static Booking sampleBooking() {
119134
.setSegments(segments)
120135
.setPrice(49900000L)
121136
.setCurrencyCode("USD")
137+
.setTags(sampleTags3())
122138
.setQuantity(1L);
123139
}
124140

@@ -129,7 +145,7 @@ static Guest sampleGuest1() {
129145
.setLoyaltyProgram("skymiles")
130146
.setLoyaltyProgramId("PSOV34DF")
131147
.setPhone("1-415-555-6040")
132-
.setEmail("jdeo@domain.com");
148+
.setEmail("jdoe@domain.com");
133149
}
134150

135151
static Guest sampleGuest2() {

src/test/java/com/siftscience/UpdateOrderEventWithBookingsTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void testUpdateOrderEvent() throws JSONException, IOException, Interrupte
7777
" \"$loyalty_program\": \"skymiles\",\n" +
7878
" \"$loyalty_program_id\": \"PSOV34DF\",\n" +
7979
" \"$phone\": \"1-415-555-6040\",\n" +
80-
" \"$email\": \"jdeo@domain.com\"\n" +
80+
" \"$email\": \"jdoe@domain.com\"\n" +
8181
" },\n" +
8282
" {\n" +
8383
" \"$name\": \"Jane Doe\"\n" +
@@ -117,7 +117,11 @@ public void testUpdateOrderEvent() throws JSONException, IOException, Interrupte
117117
" ],\n" +
118118
" \"$price\": 49900000,\n" +
119119
" \"$currency_code\": \"USD\",\n" +
120-
" \"$quantity\": 1\n" +
120+
" \"$quantity\": 1,\n" +
121+
" \"$tags\": [\n" +
122+
" \"team-123\",\n" +
123+
" \"region-123\"\n" +
124+
" ]\n" +
121125
" }\n" +
122126
" ],\n" +
123127
"\n" +

0 commit comments

Comments
 (0)