Skip to content

Commit 6068d25

Browse files
committed
ISSUE-345: add subscription date to response
1 parent a61147e commit 6068d25

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/OpenApi/SwaggerSchemasEntity.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
format: 'date-time',
1919
example: '2022-12-01T10:00:00Z'
2020
),
21+
new OA\Property(
22+
property: 'subscription_date',
23+
type: 'string',
24+
format: 'date-time',
25+
example: '2022-12-01T10:00:00Z'
26+
),
2127
new OA\Property(property: 'public', type: 'boolean', example: true),
2228
],
2329
type: 'object'

src/Serializer/SubscriberNormalizer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function normalize($object, string $format = null, array $context = []):
3636
'description' => $subscription->getSubscriberList()->getDescription(),
3737
'creation_date' => $subscription->getSubscriberList()->getCreationDate()->format('Y-m-d\TH:i:sP'),
3838
'public' => $subscription->getSubscriberList()->isPublic(),
39+
'subscription_date' => $subscription->getCreationDate()->format('Y-m-d\TH:i:sP'),
3940
];
4041
}, $object->getSubscriptions()->toArray()),
4142
];

src/Serializer/SubscriptionNormalizer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function normalize($object, string $format = null, array $context = []):
3232
return [
3333
'subscriber' => $this->subscriberNormalizer->normalize($object->getSubscriber()),
3434
'subscriber_list' => $this->subscriberListNormalizer->normalize($object->getSubscriberList()),
35+
'subscription_date' => $object->getCreationDate()->format('Y-m-d\TH:i:sP'),
3536
];
3637
}
3738

0 commit comments

Comments
 (0)