mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
bootstrap fake sms from cli
This commit is contained in:
@@ -52,6 +52,12 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
use TrackUpdateTrait;
|
||||
|
||||
public const SMS_CANCEL_PENDING = 'sms_cancel_pending';
|
||||
|
||||
public const SMS_PENDING = 'sms_pending';
|
||||
|
||||
public const SMS_SENT = 'sms_sent';
|
||||
|
||||
public const STATUS_CANCELED = 'canceled';
|
||||
|
||||
public const STATUS_MOVED = 'moved';
|
||||
@@ -169,7 +175,12 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
*/
|
||||
private ?bool $sendSMS;
|
||||
private ?bool $sendSMS = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": Calendar::SMS_PENDING})
|
||||
*/
|
||||
private string $smsStatus = self::SMS_PENDING;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
@@ -368,6 +379,11 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this->sendSMS;
|
||||
}
|
||||
|
||||
public function getSmsStatus(): string
|
||||
{
|
||||
return $this->smsStatus;
|
||||
}
|
||||
|
||||
public function getStartDate(): ?DateTimeImmutable
|
||||
{
|
||||
return $this->startDate;
|
||||
@@ -551,6 +567,11 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSmsStatus(string $smsStatus): void
|
||||
{
|
||||
$this->smsStatus = $smsStatus;
|
||||
}
|
||||
|
||||
public function setStartDate(DateTimeImmutable $startDate): self
|
||||
{
|
||||
$this->startDate = $startDate;
|
||||
@@ -562,6 +583,10 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
$this->status = $status;
|
||||
|
||||
if (self::STATUS_CANCELED === $status && $this->getSmsStatus() === self::SMS_SENT) {
|
||||
$this->setSmsStatus(self::SMS_CANCEL_PENDING);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user