Skip to content

Commit bfb7a40

Browse files
committed
Fix: message format options
1 parent 890acdb commit bfb7a40

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

src/Messaging/Request/Message/MessageFormatRequest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
enum: ['html', 'text', 'invite'],
2020
example: 'html'
2121
),
22-
new OA\Property(
23-
property: 'format_options',
24-
type: 'array',
25-
items: new OA\Items(type: 'string', enum: ['text', 'html', 'pdf']),
26-
example: ['html']
27-
),
2822
],
2923
type: 'object'
3024
)]
@@ -36,18 +30,11 @@ class MessageFormatRequest implements RequestDtoInterface
3630
#[Assert\Choice(['html', 'text', 'invite'])]
3731
public string $sendFormat;
3832

39-
#[Assert\All([
40-
new Assert\Type('string'),
41-
new Assert\Choice(['text', 'html', 'pdf']),
42-
])]
43-
public array $formatOptions;
44-
4533
public function getDto(): MessageFormatDto
4634
{
4735
return new MessageFormatDto(
4836
htmlFormated: $this->htmlFormated,
4937
sendFormat: $this->sendFormat,
50-
formatOptions: $this->formatOptions,
5138
);
5239
}
5340
}

src/Messaging/Request/Message/MessageScheduleRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class MessageScheduleRequest implements RequestDtoInterface
3434
{
3535
public ?int $repeatInterval = null;
3636

37-
#[Assert\DateTime]
37+
#[Assert\DateTime(format: "Y-m-d\TH:i:s.uP")]
3838
public ?string $repeatUntil = null;
3939

4040
public ?int $requeueInterval = null;
4141

42-
#[Assert\DateTime]
42+
#[Assert\DateTime(format: "Y-m-d\TH:i:s.uP")]
4343
public ?string $requeueUntil = null;
4444

4545
#[Assert\NotBlank]

src/Messaging/Serializer/MessageNormalizer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
new OA\Property(property: 'send_format', type: 'string', example: 'text', nullable: true),
3737
new OA\Property(property: 'as_text', type: 'integer', example: 12),
3838
new OA\Property(property: 'as_html', type: 'integer', example: 12),
39+
new OA\Property(property: 'as_text_and_html', type: 'integer', example: 12),
40+
new OA\Property(property: 'as_pdf', type: 'integer', example: 12),
41+
new OA\Property(property: 'as_text_and_pdf', type: 'integer', example: 12),
3942
],
4043
type: 'object'
4144
),
@@ -112,6 +115,9 @@ public function normalize($object, string $format = null, array $context = []):
112115
'send_format' => $object->getFormat()->getSendFormat(),
113116
'as_text' => $object->getFormat()->getAsText(),
114117
'as_html' => $object->getFormat()->getAsHtml(),
118+
'as_text_and_html' => $object->getFormat()->getAsTextAndHtml(),
119+
'as_pdf' => $object->getFormat()->getAsPdf(),
120+
'as_text_and_pdf' => $object->getFormat()->getAsTextAndHtml(),
115121
],
116122
'message_metadata' => [
117123
'status' => $object->getMetadata()->getStatus()->value,

0 commit comments

Comments
 (0)