Recapp Code Reference
    Preparing search index...

    Actor representing the comments of a single quiz. This will be started as a child of the corresponding quiz actor

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    collectionName: string
    connector: DbClient = ...
    state: State = ...

    Methods

    • Parameters

      • from: ActorRef

      Returns Promise<
          [
              UserRole: AccessRole,
              UserID: string & BRAND<"UID">,
              IsTemporaryAccount: boolean,
          ],
      >

    • Parameters

      • uid: string & BRAND<"UID">

      Returns Promise<
          MaybeBase<
              {
                  answered: boolean;
                  archived?: Timestamp;
                  authorId: string & BRAND<"UID">;
                  authorName: string;
                  created: Timestamp;
                  relatedQuestion?: string & BRAND<"UID">;
                  relatedQuiz: string & BRAND<"UID">;
                  text: string;
                  uid: string & BRAND<"UID">;
                  updated: Timestamp;
                  upvoters: (string & BRAND<"UID">)[];
              },
          >,
      >

    • Abstract method that handles all incoming messages

      Parameters

      • from: ActorRef

        actor that has send the message

      • message:
            | { CommentActorMessage: "Create" } & {
                value: Omit<
                    {
                        answered: boolean;
                        archived?: Timestamp;
                        authorId: string & BRAND<"UID">;
                        authorName: string;
                        created: Timestamp;
                        relatedQuestion?: string & BRAND<"UID">;
                        relatedQuiz: string & BRAND<"UID">;
                        text: string;
                        uid: string & BRAND<"UID">;
                        updated: Timestamp;
                        upvoters: (string & BRAND<"UID">)[];
                    },
                    "uid",
                >;
            }
            | { CommentActorMessage: "Update" } & {
                value: Partial<
                    {
                        answered: boolean;
                        archived?: Timestamp;
                        authorId: string & BRAND<"UID">;
                        authorName: string;
                        created: Timestamp;
                        relatedQuestion?: string & BRAND<"UID">;
                        relatedQuiz: string & BRAND<"UID">;
                        text: string;
                        uid: string & BRAND<"UID">;
                        updated: Timestamp;
                        upvoters: (string & BRAND<"UID">)[];
                    },
                > & { uid: string & BRAND<"UID"> };
            }
            | { CommentActorMessage: "Upvote" } & {
                value: {
                    commentId: string & BRAND<"UID">;
                    userId: string & BRAND<"UID">;
                };
            }
            | { CommentActorMessage: "Delete" } & { value: string & BRAND<"UID"> }
            | { CommentActorMessage: "GetAll" } & { value: {} }
            | { CommentActorMessage: "SubscribeToCollection" } & { value: {} }
            | { CommentActorMessage: "UnsubscribeFromCollection" } & { value: {} }

        message type

      Returns Promise<ResultType>

      promised return value. If the caller used ask, this value will be returned to the calling actor

    • Parameters

      • entity: {
            answered: boolean;
            archived?: Timestamp;
            authorId: string & BRAND<"UID">;
            authorName: string;
            created: Timestamp;
            relatedQuestion?: string & BRAND<"UID">;
            relatedQuiz: string & BRAND<"UID">;
            text: string;
            uid: string & BRAND<"UID">;
            updated: Timestamp;
            upvoters: (string & BRAND<"UID">)[];
        }

      Returns Promise<
          {
              answered: boolean;
              archived?: Timestamp;
              authorId: string & BRAND<"UID">;
              authorName: string;
              created: Timestamp;
              relatedQuestion?: string & BRAND<"UID">;
              relatedQuiz: string & BRAND<"UID">;
              text: string;
              uid: string & BRAND<"UID">;
              updated: Timestamp;
              upvoters: (string & BRAND<"UID">)[];
          },
      >

    • Parameters

      • _draft: State
      • _quiz: {
            answered: boolean;
            archived?: Timestamp;
            authorId: string & BRAND<"UID">;
            authorName: string;
            created: Timestamp;
            relatedQuestion?: string & BRAND<"UID">;
            relatedQuiz: string & BRAND<"UID">;
            text: string;
            uid: string & BRAND<"UID">;
            updated: Timestamp;
            upvoters: (string & BRAND<"UID">)[];
        }

      Returns void