Skip to content

Commit

Permalink
Merge pull request #48 from SiftScience/travel_and_ticketing_api
Browse files Browse the repository at this point in the history
(For David) adding support for  bookings complex field in $create_order and $update_order events
  • Loading branch information
rsomavarapu-sift authored Jul 16, 2019
2 parents ad3dc88 + 4411b62 commit fafa950
Show file tree
Hide file tree
Showing 10 changed files with 794 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'signing'
apply plugin: 'java-library-distribution'

group = 'com.siftscience'
version = '3.0.0'
version = '3.1.0'

repositories {
mavenCentral()
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/BaseOrderFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public abstract class BaseOrderFieldSet<T extends BaseOrderFieldSet<T>>
@Expose @SerializedName("$seller_user_id") private String sellerUserId;
@Expose @SerializedName("$promotions") private List<Promotion> promotions;
@Expose @SerializedName("$shipping_method") private String shippingMethod;
@Expose @SerializedName("$bookings") private List<Booking> bookings;

public String getOrderId() {
return orderId;
Expand Down Expand Up @@ -105,6 +106,15 @@ public T setItems(List<Item> items) {
return (T) this;
}

public List<Booking> getBookings() {
return bookings;
}

public T setBookings(List<Booking> bookings) {
this.bookings = bookings;
return (T) this;
}

public String getSellerUserId() {
return sellerUserId;
}
Expand Down
149 changes: 149 additions & 0 deletions src/main/java/com/siftscience/model/Booking.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
package com.siftscience.model;

import java.util.List;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class Booking {
@Expose @SerializedName("$booking_type") private String bookingType;
@Expose @SerializedName("$title") private String title;
@Expose @SerializedName("$start_time") private Long startTime;
@Expose @SerializedName("$end_time") private Long endTime;
@Expose @SerializedName("$price") private Long price;
@Expose @SerializedName("$currency_code") private String currencyCode;
@Expose @SerializedName("$quantity") private Long quantity;
@Expose @SerializedName("$guests") private List<Guest> guests;
@Expose @SerializedName("$segments") private List<Segment> segments;
@Expose @SerializedName("$room_type") private String roomType;
@Expose @SerializedName("$event_id") private String eventId;
@Expose @SerializedName("$venue_id") private String venueId;
@Expose @SerializedName("$location") private Address location;
@Expose @SerializedName("$category") private String category;

public String getBookingType() {
return bookingType;
}

public Booking setBookingType(String bookingType) {
this.bookingType = bookingType;
return this;
}

public String getTitle() {
return title;
}

public Booking setTitle(String title) {
this.title = title;
return this;
}

public Long getStartTime() {
return startTime;
}

public Booking setStartTime(Long startTime) {
this.startTime = startTime;
return this;
}

public Long getEndTime() {
return endTime;
}

public Booking setEndTime(Long endTime) {
this.endTime = endTime;
return this;
}

public Long getPrice() {
return price;
}

public Booking setPrice(Long price) {
this.price = price;
return this;
}

public String getCurrencyCode() {
return currencyCode;
}

public Booking setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
return this;
}

public Long getQuantity() {
return quantity;
}

public Booking setQuantity(Long quantity) {
this.quantity = quantity;
return this;
}

public List<Guest> getGuests() {
return guests;
}

public Booking setGuests(List<Guest> guests) {
this.guests = guests;
return this;
}

public List<Segment> getSegments() {
return segments;
}

public Booking setSegments(List<Segment> segments) {
this.segments = segments;
return this;
}

public String getRoomType() {
return roomType;
}

public Booking setRoomType(String roomType) {
this.roomType = roomType;
return this;
}

public String getEventId() {
return eventId;
}

public Booking setEventId(String eventId) {
this.eventId = eventId;
return this;
}

public String getVenueId() {
return venueId;
}

public Booking setVenueId(String venueId) {
this.venueId = venueId;
return this;
}

public Address getLocation() {
return location;
}

public Booking setLocation(Address location) {
this.location = location;
return this;
}

public String getCategory() {
return category;
}

public Booking setCategory(String category) {
this.category = category;
return this;
}
}
67 changes: 67 additions & 0 deletions src/main/java/com/siftscience/model/Guest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.siftscience.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class Guest {
@Expose @SerializedName("$name") private String name;
@Expose @SerializedName("$email") private String email;
@Expose @SerializedName("$phone") private String phone;
@Expose @SerializedName("$loyalty_program") private String loyaltyProgram;
@Expose @SerializedName("$loyalty_program_id") private String loyaltyProgramId;
@Expose @SerializedName("$birth_date") private String birthDate;

public String getName() {
return name;
}

public Guest setName(String name) {
this.name = name;
return this;
}

public String getEmail() {
return email;
}

public Guest setEmail(String email) {
this.email = email;
return this;
}

public String getPhone() {
return phone;
}

public Guest setPhone(String phone) {
this.phone = phone;
return this;
}

public String getLoyaltyProgram() {
return loyaltyProgram;
}

public Guest setLoyaltyProgram(String loyaltyProgram) {
this.loyaltyProgram = loyaltyProgram;
return this;
}

public String getLoyaltyProgramId() {
return loyaltyProgramId;
}

public Guest setLoyaltyProgramId(String loyaltyProgramId) {
this.loyaltyProgramId = loyaltyProgramId;
return this;
}

public String getBirthDate() {
return birthDate;
}

public Guest setBirthDate(String birthDate) {
this.birthDate = birthDate;
return this;
}
}
88 changes: 88 additions & 0 deletions src/main/java/com/siftscience/model/Segment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package com.siftscience.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class Segment {
@Expose @SerializedName("$departure_address") private Address departureAddress;
@Expose @SerializedName("$arrival_address") private Address arrivalAddress;
@Expose @SerializedName("$start_time") private Long startTime;
@Expose @SerializedName("$end_time") private Long endTime;
@Expose @SerializedName("$vessel_number") private String vesselNumber;
@Expose @SerializedName("$arrival_airport_code") private String arrivalAirportCode;
@Expose @SerializedName("$departure_airport_code") private String departureAirportCode;
@Expose @SerializedName("$fare_class") private String fareClass;


public Address getDepartureAddress() {
return departureAddress;
}

public Segment setDepartureAddress(Address departureAddress) {
this.departureAddress = departureAddress;
return this;
}

public Address getArrivalAddress() {
return arrivalAddress;
}

public Segment setArrivalAddress(Address arrivalAddress) {
this.arrivalAddress = arrivalAddress;
return this;
}

public Long getStartTime() {
return startTime;
}

public Segment setStartTime(Long startTime) {
this.startTime = startTime;
return this;
}

public Long getEndTime() {
return endTime;
}

public Segment setEndTime(Long endTime) {
this.endTime = endTime;
return this;
}

public String getVesselNumber() {
return vesselNumber;
}

public Segment setVesselNumber(String vesselNumber) {
this.vesselNumber = vesselNumber;
return this;
}

public String getArrivalAirportCode() {
return arrivalAirportCode;
}

public Segment setArrivalAirportCode(String arrivalAirportCode) {
this.arrivalAirportCode = arrivalAirportCode;
return this;
}

public String getDepartureAirportCode() {
return departureAirportCode;
}

public Segment setDepartureAirportCode(String departureAirportCode) {
this.departureAirportCode = departureAirportCode;
return this;
}

public String getFareClass() {
return fareClass;
}

public Segment setFareClass(String fareClass) {
this.fareClass = fareClass;
return this;
}
}
Loading

0 comments on commit fafa950

Please sign in to comment.