Skip to content

Instantly share code, notes, and snippets.

@holmes
Created April 15, 2021 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holmes/3000dac8b0415c2e1cab349f521a4417 to your computer and use it in GitHub Desktop.
Save holmes/3000dac8b0415c2e1cab349f521a4417 to your computer and use it in GitHub Desktop.
BusinessModel Sample Interface
package com.squareup.appointments.serum.business
import android.os.Parcelable
import com.squareup.address.Address
import com.squareup.protos.common.Money
import kotlinx.parcelize.Parcelize
import org.threeten.bp.Duration
interface BusinessModel : Parcelable {
val id: String
val name: String
val phoneNumber: String
val needsMobileOnboarding: Boolean
val locationType: LocationType
val timeZone: String
val address: Address
val noShowCutoffTime: Duration
val uid: String
val isNoShowProtectionEnabled: Boolean
val buyerPrepaymentMode: BuyerPrepaymentMode
val noShowChargeType: NoShowChargeType
val isBankAccountVerified: Boolean
val minisiteStatus: MinisiteStatus
val smsReminderStatus: SmsReminderStatus
val emailReminderStatus: EmailReminderStatus
val reserveWithGoogleStatus: ReserveWithGoogleStatus
val isSoleProprietor: Boolean
val cancellationPolicy: String
val confirmationStatus: ConfirmationStatus
val conversationsEnabled: Boolean
enum class LocationType {
PREMISES,
CUSTOMER,
PHONE,
OTHER
}
enum class BuyerPrepaymentMode {
OFF,
ALL_CLIENTS_REQUIRED
}
sealed class NoShowChargeType : Parcelable {
@Parcelize
object None : NoShowChargeType()
@Parcelize
data class Percentage(val percentage: Int) : NoShowChargeType()
@Parcelize
data class FlatFee(val money: Money) : NoShowChargeType()
}
@Parcelize
data class ReserveWithGoogleStatus(
val eligible: Boolean,
val enabled: Boolean,
) : Parcelable
@Parcelize
data class MinisiteStatus(
val enabled: Boolean,
val deprecated: Boolean
) : Parcelable
sealed class SmsReminderStatus : Parcelable {
@Parcelize
object Off : SmsReminderStatus()
@Parcelize
data class Enabled(val leadTime: Duration) : SmsReminderStatus()
}
sealed class EmailReminderStatus : Parcelable {
@Parcelize
object Off : EmailReminderStatus()
@Parcelize
data class Enabled(val leadTime: Duration) : EmailReminderStatus()
}
sealed class ConfirmationStatus : Parcelable {
@Parcelize
object Disabled : ConfirmationStatus()
@Parcelize
data class Enabled(
val canSendSms: Boolean,
val canSendEmail: Boolean,
val leadTime: Duration,
) : ConfirmationStatus()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment