1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| package metier {
object Objets {
object Statuts extends Enumeration {
type Statut = Value
val NEW, WAITING, WAIT4DLV, SENT, ERROR, OK, SCHEDULED, DLVRD, TIMEOUT, TOOM4NUM, TOOM4USER, UNKNPFX, UNKNRCPT, UNKNOWN, BLACKLISTED = Value
}
case class Rdv(
id: Option[Int],
nom: String,
prénom: String,
sexe: Int,
telPortable: String,
telBureau: String,
telPrivé: String,
siteRDV: String,
typeRDV: String,
libelléRDV: String,
numRDV: String,
étape: String,
dateRDV: Long,
heureRDVString: String,
statut: String,
orderId: String) {
def =*=(that: Rdv): Boolean = {
this.nom == that.nom && this.prénom == that.prénom && this.dateRDV == that.dateRDV && this.heureRDVString == that.heureRDVString
}
def findGoodPhone: Option[String] = {
val privateTelOnly09 = telPrivé.replaceAll("[^0-9+]", "")
val officeTelOnly09 = telBureau.replaceAll("[^0-9+]", "")
val mobileTelOnly09 = telPortable.replaceAll("[^0-9+]", "")
def TelMatches(tel: String): Boolean = {
(tel.matches("06[0-9]{8}")
|| (tel.matches("07[0-9]{8}"))
|| (tel.matches("\\+336[0-9]{8}"))
|| (tel.matches("\\+337[0-9]{8}"))
|| (tel.matches("00336[0-9]{8}"))
|| (tel.matches("00337[0-9]{8}")))
}
if (TelMatches(mobileTelOnly09)) Some(mobileTelOnly09)
else if (TelMatches(privateTelOnly09)) Some(privateTelOnly09)
else if (TelMatches(officeTelOnly09)) Some(officeTelOnly09)
else None
}
}
case class rdv2(
nom: String,
prénom: String,
dateRDV: Long,
heureRDVString: String,
telPortable: String,
telBureau: String,
telPrivé: String,
siteRDV: String,
typeRDV: String,
libelléRDV: String,
orderId: String,
statut: String) |