This file contains hidden or 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
| module Pricing::Pricers | |
| class BasePricer | |
| PRICE_EXPIRES_IN = 12.months | |
| attr_accessor :property, :check_in_on, :check_out_on, :reindex, :expiry, :request_live_price, :cookied | |
| alias_method :cookied?, :cookied | |
| def initialize(property, check_in_on, check_out_on, reindex: true, expiry: PRICE_EXPIRES_IN, request_live_price: false, cookied: false) | |
| @property = property |
This file contains hidden or 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
| import scala.util._ | |
| import java.security.SecureRandom | |
| import java.security.MessageDigest | |
| /* | |
| * Generates a Bearer Token with a length of | |
| * 32 characters (MD5) or 64 characters (SHA-256) according to the | |
| * specification RFC6750 (http://tools.ietf.org/html/rfc6750) | |
| * | |
| * Uniqueness obtained by hashing system time combined with a |
This file contains hidden or 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
| module Pricing::Pricers | |
| class PricerFactory | |
| def self.pricer_for(property, check_in_on, check_out_on, request_live_price: false) | |
| pricer_class = begin | |
| "Pricing::Pricers::#{property.source.gsub(/\s+/,'')}Pricer".constantize | |
| rescue NameError | |
| Pricing::Pricers::BasePricer | |
| end |
This file contains hidden or 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
| module Pricing::Pricers | |
| class WyndhamPricer < Pricing::Pricers::BasePricer | |
| WYNDHAM_DISCOUNT = 35 | |
| def do_force_live_price? | |
| (check_in_on - Date.today).to_i > 1 | |
| end | |
| def price_with_members_discount(price) |
This file contains hidden or 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
| module Pricing::Pricers | |
| class PricerFactory | |
| def self.pricer_for(property, check_in_on, check_out_on, request_live_price: request_live_price?) | |
| pricer_class = begin | |
| "Pricing::Pricers::#{property.source.gsub(/\s+/,'')}Pricer".constantize | |
| rescue NameError | |
| Pricing::Pricers::BasePricer |
This file contains hidden or 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
| class PropertyDecorator < Draper::Decorator | |
| delegate_all | |
| decorates_association :reviews | |
| def summary | |
| collection = [] #'breadcrumbs will go here? see properties/show.html.haml' | |
| ('<span>' + name + '</span>' + collection.join(', ')).html_safe | |
| end | |
| def summary_plain |
This file contains hidden or 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
| class PropertyDecorator < Draper::Decorator | |
| delegate_all | |
| decorates_association :reviews | |
| def summary | |
| collection = [] #'breadcrumbs will go here? see properties/show.html.haml' | |
| ('<span>' + name + '</span>' + collection.join(', ')).html_safe | |
| end | |
| def summary_plain |
This file contains hidden or 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
| package com.adleritech.searchplay; | |
| import com.vividsolutions.jts.geom.Coordinate; | |
| import com.vividsolutions.jts.geom.Geometry; | |
| import com.vividsolutions.jts.geom.GeometryFactory; | |
| import com.vividsolutions.jts.geom.LineSegment; | |
| import com.vividsolutions.jts.linearref.LinearLocation; | |
| import com.vividsolutions.jts.linearref.LocationIndexedLine; | |
| public class NearestLinePointFromStandalonePoint { |
This file contains hidden or 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
| package com.adleritech.aitcommons.rabbit; | |
| import com.rabbitmq.client.*; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import java.io.IOException; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.Set; |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.adleritech.billing</groupId> | |
| <artifactId>billing-platform</artifactId> | |
| <version>1.1-SNAPSHOT</version> | |
| <packaging>war</packaging> | |
| <name>Billing Platform</name> |