RegistrationRepository is a repository that provides SQL queries for registration.

const postgres: PostgresService

const registrationRepo = new RegistrationRepository({ postgres })

Hierarchy

  • RegistrationRepository

Constructors

Methods

  • Get all the registrations attempts for a specific email address

    const registrations = await registrationRepo.getRegistrations(
    'dalya@example.com'
    )

    Parameters

    • email: string

    Returns Promise<Registration[]>

  • Get the verified registration for an email address, or null if that email is not verified.

    const verifiedRegistration = await registrationRepo.getVerifiedRegistration(
    'dalya@example.com'
    )

    Parameters

    • id: number

    Returns Promise<null | Registration>

  • Create an unverified registration.

    await registrationRepo.register({
    name: 'Chloe Smith',
    email: 'chloe@example.com',
    language: 'EN',
    country: 'GB',
    affiliation: 'Open Lab',
    userData: { marketingConsent: false },
    })

    Parameters

    • request: RegisterRequest

    Returns Promise<void>

  • Remove all registrations, verified and unverified, for an email address.

    await registrationRepo.unregister('chloe@example.com')
    

    Parameters

    • email: string

    Returns Promise<void>

  • Mark a registration as verified, e.g. The user clicked verified in an email.

    // It takes the id of the registration record to be verified
    await registrationRepo.verifyRegistration(42)

    Parameters

    • id: number

    Returns Promise<void>

Generated using TypeDoc