type ID = string;
type UInt = number;

// each interface is a mongodb collection

type Section = { title: string, content: Content[] }
type Content = Section | string /* text */ | { reference: number } /* bib reference */ | { label: string } /* figure reference */

interface Paper {
    _id: ID,
    title: string,
    abstract: string,
    authors: [{ // attributes here reflect the data found when the paper was published
        affiliation: string, // university of blah
        email: string | null,
        name: string,
        authorId: ID
    }],
    keywords: string[],
    publicationDetails: {
        journalRef: ID,
        journal: string, // "Journal of AI"
        volume: string, // "Spring 2020 edition"
        number: string // reference for this paper in the volume
        date: Date,
        pages: { // pages in the volume where this paper is
            start: number,
            end: number
        } // [0, 1]
    },
    content: Section[],
    figures: [{
        page: number // page number where the figure is placed
        label: string,
        caption: string,
        imageURL?: string // some figures are tables, not in the scope of this assignment to model a table
    }],
    references: [{
        referenceNumber: number,
        paperId?: ID, // optional
        title: string,
        authors: [{
            name: string,
            authorId?: ID //optional
        }], // list of author names
        journal: string,
        journalId?: ID,
        volume: string,
        number: string
    }]
}

interface Author { // author data here reflects the most up to date info in the author
    _id: ID,
    name: string,
    email: string,
    affiliation: string,
    bio: string
}

interface Journal {
    _id: ID,
    name: string,
    volumes: [{
        name: string,
        papers: ID[] // references to papers in volumes
    }]
}