UserNote

final class UserNote : Model, @unchecked Sendable

A UserNote is intended as a free-form text field that will appear on a UserProfile, in which the viewing User can make notes about the profile’s user.

It is not visible to the profile’s owner nor to any other user; it is for the viewing user’s use only. In other words, different users viewing the same profile will each see their own viewer-specific UserNote text.

Properties

  • id

    The note’s ID, provisioned automatically.

    Declaration

    Swift

    @UserNote
    .ID var id: UUID? { get set }
  • The text of the note.

    Declaration

    Swift

    @UserNote
    .Field var note: String { get set }
  • Timestamp of the model’s creation, set automatically.

    Declaration

    Swift

    @UserNote
    .Timestamp var createdAt: Date? { get set }
  • Timestamp of the model’s last update, set automatically.

    Declaration

    Swift

    @UserNote
    .Timestamp var updatedAt: Date? { get set }

Relations

  • The User owning the note.

    Declaration

    Swift

    @UserNote
    .Parent var author: User { get set }
  • The Userbeing written about. Don’t confure these two fields! Users do not get access to what others have written about them.

    Declaration

    Swift

    @UserNote
    .Parent var noteSubject: User { get set }

Initialization