schmitty890 / homestead

Homestead
https://obscure-fortress-66993.herokuapp.com/
0 stars 1 forks source link

Model Documentation #31

Open tommyngre opened 6 years ago

tommyngre commented 6 years ago

Here is a list of the Model - files that are using that model

MODEL - FILE
Event - views/partials/upcoming_events_carousel.handlebars, public/assets/js/post-event.js, 
User - 
Classified - 

Differentiating Resources and Transactions could be tricky, and maybe arbitrary.

Optionally, instead we could have 1 Listing model with a field which indicates whether it's quid pro quo or pro bono. Because I imagine those models would otherwise be pretty similar.

In any case, those models would have foreign key UserId to associate with the owner/creator-User. We would also need another type of (many-to-one) association, in order to link Users to saved listings. I'd need to look into that. (That is, only one User should own a listing, but many Users can save a listing.)

I'll plan to mock up models tomorrow. Meanwhile, thoughts about this topic?

tommyngre commented 6 years ago

Also, I mentioned above ...

we could have 1 Listing model with a field which indicates whether it's quid pro quo or pro bono.

Similarly, I assumed listings would have a similar field which indicates whether the User was seeking or offering something (whether we go with Resource/Listing or Transaction)

schmitty890 commented 6 years ago

Listing Model if we have on listing model with a field that indicates the whether that listing is a skill/service/item/whatever else would be ideal. within that we could have the pro bonos field to key off of in the future.

we should reference the Submit Ad page as a reference to this. notice that there is client side js provided in the template, that renders new form fields in the Features section depending on which category the user selects.

we could have it where, when a user selects a category, then client side js will render the new form fields that populate in the features section depending on the category they select. then when we submit the form, we check to see which category they selected (event, item, service, etc) and then save the form data to that model. just a thought.

That would allow us to save data to different models, all within the same page.