Run pre-commit.
All checks were successful
/ Build and Test Application Snapshot (pull_request) Successful in 1m10s

This commit is contained in:
Pat Garrity 2024-05-19 12:56:21 -05:00
parent ea3fa65e4b
commit b261d0b6df
Signed by: pfm
GPG key ID: 5CA5D21BAB7F3A76
4 changed files with 54 additions and 52 deletions

View file

@ -1,21 +1,21 @@
package gs.smolban.model package gs.smolban.model
import java.time.Instant
import cats.Show import cats.Show
import java.time.Instant
/** /** Describes an instant at which something was created. Opaque type for
* Describes an instant at which something was created. Opaque type for
* `java.time.Instant`. * `java.time.Instant`.
*/ */
opaque type CreatedAt = Instant opaque type CreatedAt = Instant
object CreatedAt: object CreatedAt:
/** /** Instantiate a new [[CreatedAt]].
* Instantiate a new [[CreatedAt]].
* *
* @param timestamp The underlying timestamp. * @param timestamp
* @return The new instance. * The underlying timestamp.
* @return
* The new instance.
*/ */
def apply(timestamp: Instant): CreatedAt = timestamp def apply(timestamp: Instant): CreatedAt = timestamp
@ -24,10 +24,10 @@ object CreatedAt:
given Show[CreatedAt] = _.toInstant().toString() given Show[CreatedAt] = _.toInstant().toString()
extension (createdAt: CreatedAt) extension (createdAt: CreatedAt)
/** /** Unwrap this value.
* Unwrap this value.
* *
* @return The underlying `Instant` value. * @return
* The underlying `Instant` value.
*/ */
def toInstant(): Instant = createdAt def toInstant(): Instant = createdAt

View file

@ -1,16 +1,18 @@
package gs.smolban.model package gs.smolban.model
import gs.uuid.v0.UUID
import gs.slug.v0.Slug
import cats.Show import cats.Show
import gs.slug.v0.Slug
import gs.uuid.v0.UUID
/** /** Groups are the basic unit of organization in Smolban. Each [[Ticket]]
* Groups are the basic unit of organization in Smolban. Each [[Ticket]]
* belongs to a single `Group`. * belongs to a single `Group`.
* *
* @param id The unique identifier for the group. * @param id
* @param slug The unique slug for the group. * The unique identifier for the group.
* @param createdAt The instant at which this group was created. * @param slug
* The unique slug for the group.
* @param createdAt
* The instant at which this group was created.
*/ */
case class Group( case class Group(
id: Group.Id, id: Group.Id,
@ -20,18 +22,18 @@ case class Group(
object Group: object Group:
/** /** Unique identifier for a [[Group]]. This is an opaque type for a UUID.
* Unique identifier for a [[Group]]. This is an opaque type for a UUID.
*/ */
opaque type Id = UUID opaque type Id = UUID
object Id: object Id:
/** /** Instantiate a new [[Group.Id]].
* Instantiate a new [[Group.Id]].
* *
* @param id The underlying UUID. * @param id
* @return The new [[Group.Id]] instance. * The underlying UUID.
* @return
* The new [[Group.Id]] instance.
*/ */
def apply(id: UUID): Id = id def apply(id: UUID): Id = id
@ -40,10 +42,10 @@ object Group:
given Show[Id] = _.toUUID().withoutDashes() given Show[Id] = _.toUUID().withoutDashes()
extension (id: Id) extension (id: Id)
/** /** Unwrap this Group ID.
* Unwrap this Group ID.
* *
* @return The underlying UUID value. * @return
* The underlying UUID value.
*/ */
def toUUID(): UUID = id def toUUID(): UUID = id

View file

@ -10,20 +10,20 @@ case class Ticket(
object Ticket: object Ticket:
/** /** Unique identifier - relative to some [[Group]] - for a [[Ticket]]. This is
* Unique identifier - relative to some [[Group]] - for a [[Ticket]]. This is * an opaque type for a Long. In general, [[Ticket]] identifiers are
* an opaque type for a Long. In general, [[Ticket]] identifiers are sequences * sequences within a group.
* within a group.
*/ */
opaque type Id = Long opaque type Id = Long
object Id: object Id:
/** /** Instantiate a new [[Ticket.Id]].
* Instantiate a new [[Ticket.Id]].
* *
* @param id The underlying Long. * @param id
* @return The new [[Ticket.Id]] instance. * The underlying Long.
* @return
* The new [[Ticket.Id]] instance.
*/ */
def apply(id: Long): Id = id def apply(id: Long): Id = id
@ -32,10 +32,10 @@ object Ticket:
given Show[Id] = _.toLong().toString() given Show[Id] = _.toLong().toString()
extension (id: Id) extension (id: Id)
/** /** Unwrap this Ticket ID.
* Unwrap this Ticket ID.
* *
* @return The underlying Long value. * @return
* The underlying Long value.
*/ */
def toLong(): Long = id def toLong(): Long = id