Converts all timestamps to UTC

This commit is contained in:
2026-05-18 23:02:49 -05:00
parent 5e2976180c
commit 3b5046f1db
12 changed files with 38 additions and 38 deletions

View File

@@ -27,7 +27,7 @@ import org.springframework.stereotype.Service
import org.springframework.web.multipart.MultipartFile
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.time.LocalDateTime
import java.time.OffsetDateTime
private const val PHOTO_NOT_FOUND = "Photo not found"
@@ -56,7 +56,7 @@ class PhotoService(
throw BadFileException("Image type is not supported")
}
val now = LocalDateTime.now()
val now = OffsetDateTime.now()
val photo = Photo(
itemId = itemId,
huntId = huntId,
@@ -171,7 +171,7 @@ class PhotoService(
if (photoRecord.status == PhotoStatus.APPROVED) throw ConflictException("Cannot remove an approved photo")
photoRepository.save(photoRecord.copy(status = PhotoStatus.REMOVED, statusChangeDateTime = LocalDateTime.now()))
photoRepository.save(photoRecord.copy(status = PhotoStatus.REMOVED, statusChangeDateTime = OffsetDateTime.now()))
}
fun getItemPhotos(huntId: HuntId, teamId: TeamId, itemId: ItemId, email: String): List<PhotoResponse> {
@@ -197,7 +197,7 @@ class PhotoService(
fun updatePhotoStatus(photoId: PhotoId, status: PhotoStatus) {
val record = photoRepository.findByIdOrNull(photoId)
?: throw NotFoundException(PHOTO_NOT_FOUND)
photoRepository.save(record.copy(status = status, statusChangeDateTime = LocalDateTime.now()))
photoRepository.save(record.copy(status = status, statusChangeDateTime = OffsetDateTime.now()))
}
private fun toJpeg(bytes: ByteArray): ByteArray {