Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My templates #43

Closed
haydenrou opened this issue Mar 13, 2024 · 2 comments
Closed

My templates #43

haydenrou opened this issue Mar 13, 2024 · 2 comments
Milestone

Comments

@haydenrou
Copy link
Contributor

haydenrou commented Mar 13, 2024

  • Associate templates to a user on "use" and show their templates on a "my templates" page
  • See router/routes.go TODO
  • For this we'll need to add an id to users.

Note from a previous PR:

I'm undecided on the data-structure we want to go with yet. We obviously don't want a template to belong to one person via their username. At the least, it would be an ID.

Saying that, I don't know if we want to do some sort of joins-table-esque type deal between users and templates, or if we just straight up want to duplicate the template per use.

Considerations:

  • A user may partially fill out a template and won't want it to completely change if the author made amends to it half way through completing it
  • A user may want to use the updated version of the template next time they fill it out. Should they perhaps have an option to be able to use the same as last time, too? Maybe take this even a step further and you cannot update templates after creating them, but you can duplicate them? This could solve some problems.
  • A user may want to amend the template themselves (is this functionality we even want to offer?)
@haydenrou
Copy link
Contributor Author

haydenrou commented Mar 18, 2024

In progress...

classDiagram
    class users {
        _id: ObjectId
        password: string
        email: string
    }
    
    class Question {
        _id: ObjectId
        title: string
        description?: string
        type: QuestionType
        options?: string[]
        min?: int
        max?: int
        order: int
    }

    class Template {
        _id: ObjectId
        title: string
        description: string
        created_at: DateTime
        default?: boolean
        questions?: Question[]
        user_id?: ObjectId
    }

    class Answer {
        _id: ObjectId
        question_id: ObjectId
        answer: string
    }

    users "1" -- "N" Template : "owns"
    Template "1" -- "N" Question : "contains"
    Question "1" -- "N" Answer : "has"
Loading

@haydenrou
Copy link
Contributor Author

I'm of the thought that with the new structure / features we'll be building out for the MVP, this will come for free. We will decide on the data-structure as we go, and potentially use this as a base, but in general, I don't think this story will be needed after we have a dashboard. Or if it is, it'll be a single page to show history or something.

@haydenrou haydenrou added this to the MVP milestone May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant