Skip to content

Commit 31fd7b0

Browse files
committed
Store timestamp for when subscription was created and updated
1 parent 91133a7 commit 31fd7b0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/international/dmc/secom_mms_gateway/services/SubscriptionService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.springframework.util.StringUtils;
1818

1919
import java.net.URI;
20+
import java.util.Date;
2021
import java.util.List;
2122
import java.util.Map;
2223
import java.util.Optional;
@@ -82,6 +83,11 @@ public Subscription addSubscription(Subscription subscription) throws Subscripti
8283
if (subscriptionResponse.isPresent() && subscriptionResponse.get().getSubscriptionIdentifier() != null) {
8384
subscription.setSubscriptionId(subscriptionResponse.get().getSubscriptionIdentifier());
8485
}
86+
87+
Date now = new Date();
88+
subscription.setCreatedAt(now);
89+
subscription.setUpdatedAt(now);
90+
8591
subscriptionRepository.save(subscription);
8692
return subscription;
8793
}

0 commit comments

Comments
 (0)