Skip to content

Commit

Permalink
Narrow down an interface to match the requirements
Browse files Browse the repository at this point in the history
Refs #2100
  • Loading branch information
thewilkybarkid committed Nov 22, 2024
1 parent fe29952 commit 6c5b4b8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Comments/Context.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { Doi } from 'doi-ts'
import { Context, Data, type Effect, type PubSub } from 'effect'
import { Context, Data, type Effect, type Option, type PubSub } from 'effect'
import type { Orcid } from 'orcid-id-ts'
import type { Uuid } from '../types/index.js'
import type { Html } from '../html.js'
import type { NonEmptyString, Uuid } from '../types/index.js'
import type { CommentCommand } from './Commands.js'
import type { CommentError } from './Errors.js'
import type { CommentEvent } from './Events.js'
import type * as Queries from './Queries.js'
import type { CommentBeingPublished, CommentState } from './State.js'
import type { CommentState } from './State.js'

export class CommentEvents extends Context.Tag('CommentEvents')<
CommentEvents,
Expand Down Expand Up @@ -45,9 +46,17 @@ export class HandleCommentCommand extends Context.Tag('HandleCommentCommand')<

export class CreateRecordOnZenodoForComment extends Context.Tag('CreateRecordOnZenodoForComment')<
CreateRecordOnZenodoForComment,
(comment: CommentBeingPublished) => Effect.Effect<[Doi, number], UnableToAssignADoi>
(comment: InputForCommentZenodoRecord) => Effect.Effect<[Doi, number], UnableToAssignADoi>
>() {}

interface InputForCommentZenodoRecord {
readonly authorId: Orcid
readonly competingInterests: Option.Option<NonEmptyString.NonEmptyString>
readonly comment: Html
readonly persona: 'public' | 'pseudonym'
readonly prereviewId: number
}

export class DoesUserHaveAVerifiedEmailAddress extends Context.Tag('DoesUserHaveAVerifiedEmailAddress')<
DoesUserHaveAVerifiedEmailAddress,
(orcid: Orcid) => Effect.Effect<boolean, UnableToQuery>
Expand Down

0 comments on commit 6c5b4b8

Please sign in to comment.