Skip to content

Commit

Permalink
Hasher is now functional interface. Also made working with time unifo…
Browse files Browse the repository at this point in the history
…rm using autowired clock while creating current offset time
  • Loading branch information
Filip Ballek committed Oct 3, 2023
1 parent 9213f41 commit 6d6380b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class AdvertisementServiceImpl(
responses = mutableListOf(),
location = createLocation(advertisementCreateDto.location),
status = AdvertisementStatus.CREATED,
createdAt = OffsetDateTime.now(),
createdAt = OffsetDateTime.now(clock),
createdBy = resolveAdvertisementAuthor(advertisementCreateDto.nonRegisteredUserInfo),
projects = mutableListOf(projectService.getBySlug(advertisementCreateDto.projectSlug)),
slug = slugUtility.createSlugWithOffsetDateTimePrepended(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class UserServiceImpl(
telephoneNumberChangeRequestRepository.findLatestActiveByPublicId(publicId)
?.apply {
status = ChangeRequestStatus.CANCELED
closedAt = OffsetDateTime.now()
closedAt = OffsetDateTime.now(clock)
confirmationToken = null
}
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package cz.opendatalab.egidio.backend.shared.hasher
/**
* Hash provider for the type [T]
*/
interface Hasher<T> {
fun interface Hasher<T> {
/**
* Create hash for value
*/
fun hash(value: T) : String
}

0 comments on commit 6d6380b

Please sign in to comment.