/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.0-slava * User agent: apibuilder app.apibuilder.io/hbc/api-fraud/0.0.0-slava/http4s_0_22 */ package com.hbc.api.fraud.v0.mock { class Client[F[_]: cats.Applicative] extends com.hbc.api.fraud.v0.interfaces.Client[F] { val baseUrl: org.http4s.Uri = org.http4s.Uri.unsafeFromString("http://mock.localhost") override def decisions: com.hbc.api.fraud.v0.Decisions[F] = new MockDecisions[F] override def transactions: com.hbc.api.fraud.v0.Transactions[F] = new MockTransactions[F] } class MockDecisions[F[_]: cats.Applicative] extends com.hbc.api.fraud.v0.Decisions[F] { /** * Consumes the decision about a transaction (usually meant for manual review) and * triggers OMS to process/cancel the order */ def post( decision: com.hbc.api.fraud.v0.models.Decision, requestHeaders: Seq[(String, String)] = Nil ): F[Unit] = cats.Applicative[F].pure { // unit type } } class MockTransactions[F[_]: cats.Applicative] extends com.hbc.api.fraud.v0.Transactions[F] { /** * Provides decision about a transaction by supplying order or other information */ def post( transaction: com.hbc.api.fraud.v0.models.Transaction, requestHeaders: Seq[(String, String)] = Nil ): F[com.hbc.api.fraud.v0.models.Decision] = cats.Applicative[F].pure { com.hbc.api.fraud.v0.mock.Factories.makeDecision() } } object Factories { def randomString(length: Int = 24): String = { _root_.scala.util.Random.alphanumeric.take(length).mkString } def makeBanner(): com.hbc.api.fraud.v0.models.Banner = com.hbc.api.fraud.v0.models.Banner.Lat def makeCustomerType(): com.hbc.api.fraud.v0.models.CustomerType = com.hbc.api.fraud.v0.models.CustomerType.Guest def makeRecommendationCode(): com.hbc.api.fraud.v0.models.RecommendationCode = com.hbc.api.fraud.v0.models.RecommendationCode.Reject def makeAdditionalData(): com.hbc.api.fraud.v0.models.AdditionalData = com.hbc.api.fraud.v0.models.AdditionalData( inAuthId = _root_.java.util.UUID.randomUUID ) def makeAddress(): com.hbc.api.fraud.v0.models.Address = com.hbc.api.fraud.v0.models.Address( name = Factories.randomString(24), streetLineOne = Factories.randomString(24), streetLineTwo = None, city = Factories.randomString(24), state = Factories.randomString(24), zip = Factories.randomString(24), country = Factories.randomString(24) ) def makeCreditCard(): com.hbc.api.fraud.v0.models.CreditCard = com.hbc.api.fraud.v0.models.CreditCard( nameOnCard = Factories.randomString(24), billingAddress = com.hbc.api.fraud.v0.mock.Factories.makeAddress(), cardType = Factories.randomString(24), cardNumber = Factories.randomString(24), authorizedAmount = BigDecimal("1"), fullAmount = BigDecimal("1"), expiryDate = Factories.randomString(24), authCode = Factories.randomString(24), responseCode = 1, merchantId = None, registerNumber = None, transactionNumber = Factories.randomString(24), avsResponse = Factories.randomString(24) ) def makeCustomer(): com.hbc.api.fraud.v0.models.Customer = com.hbc.api.fraud.v0.models.Customer( customerType = com.hbc.api.fraud.v0.mock.Factories.makeCustomerType(), accountId = Factories.randomString(24), creationDate = _root_.java.time.LocalDate.now, firstName = Factories.randomString(24), lastName = Factories.randomString(24), emailAddress = Factories.randomString(24) ) def makeDBRecord(): com.hbc.api.fraud.v0.models.DBRecord = com.hbc.api.fraud.v0.models.DBRecord( transactionId = Factories.randomString(24), lastModifiedDate = None, createdDate = None, transaction = com.hbc.api.fraud.v0.mock.Factories.makeTransaction(), decision = com.hbc.api.fraud.v0.mock.Factories.makeDecision() ) def makeDecision(): com.hbc.api.fraud.v0.models.Decision = com.hbc.api.fraud.v0.models.Decision( transactionId = Factories.randomString(24), recommendationCode = com.hbc.api.fraud.v0.mock.Factories.makeRecommendationCode(), crossReference = None, rulesTripped = None, totalScore = 1, remarks = None ) def makeError(): com.hbc.api.fraud.v0.models.Error = com.hbc.api.fraud.v0.models.Error( message = Factories.randomString(24), error = Factories.randomString(24) ) def makeItem(): com.hbc.api.fraud.v0.models.Item = com.hbc.api.fraud.v0.models.Item( svsNumber = 1, skuNumber = 1, upcNumber = None, classNumber = None, color = None, size = None, currentStatus = Factories.randomString(24), department = 1, signOnDelivery = None, giftWrapped = None, costAmount = None, marginAmount = None, description = Factories.randomString(24), price = BigDecimal("1"), extendedPrice = BigDecimal("1"), quantity = 1, groupNumber = 1, shippingAddress = com.hbc.api.fraud.v0.mock.Factories.makeAddress(), shippingMethod = Factories.randomString(24), shippingCountry = Factories.randomString(24) ) def makePromo(): com.hbc.api.fraud.v0.models.Promo = com.hbc.api.fraud.v0.models.Promo( promotionCode = Factories.randomString(24), promotionAmount = BigDecimal("1") ) def makeTransaction(): com.hbc.api.fraud.v0.models.Transaction = com.hbc.api.fraud.v0.models.Transaction( orderId = Factories.randomString(24), groupId = Factories.randomString(24), orderTotal = BigDecimal("1"), shippingCost = BigDecimal("1"), currencyCode = Factories.randomString(24), storeNumber = 1, salesRep = None, lastModifiedDate = None, banner = com.hbc.api.fraud.v0.mock.Factories.makeBanner(), creditCard = com.hbc.api.fraud.v0.mock.Factories.makeCreditCard(), promos = None, items = Nil, ipAddress = None, source = Factories.randomString(24), customer = com.hbc.api.fraud.v0.mock.Factories.makeCustomer(), additionalData = None ) } }