We've moved discussions to Discord

Account - Sign up as company/organization under existing Account

Hello Jumpstart friends,

I am trying to customize my jumpstart app but have been stuck for the last 4 days working on my data model.
It's not an jumpstart issue, but I am looking for your expertise and a hint on how to utilize the existing Jumpstart Models / capabilities for my app.

About the app:

The app should be a multi-tenant app to run multiple classified ads sites.
Each site has similar UI (slightly customizable), but shows different data.

User can sign up to create a new classified ads site (= new Account) under myapp.com/registration

Models:

Account
  • Each new site is represented by an Account with its own URL path ( e.g. myapp.com/:account_id)
  • Current.account is set by account.id in URL for the start, later a custom domain should point to each Account

User - Site/Account Owner: 
  • User who is the admin / owner of the account after registration (Account belongs_to :owner, class: "User")
  • Can add other AccountUsers to administrate the site(Account)

Category - Site can have one or many Categories (scoped via: account_id)
  • id
  • account_id
  • name


-- So far so good, but I am struggling with the following requirement --

Companies / Non-Profits /Organizations should be able to create Posts on an existing site (Account).
Therefore, they need to sign up as a Company/Organization profile under an existing site.


Organization/Company
  • id
  • name
  • address
  • account_id
  • owner_id (class: User)

Organization/Company belongs to User who becomes the owner after registration. He can add / invite other team mates to join this organization.

Post
  • id
  • account_id
  • organization_id
  • category_id
  • title

Posts can be created by Organizations/Companies on a classified ads site (Account). 
 Each Site display only Posts that belong to it.

My questions are:
How would you implement the Organization/Company sign up under an existing Site(Account)?
Should a Company/Organization be scoped to an Account or be "outside" like the User model?

English is not my mother tongue, so please apologize grammar and other mistakes ;)
I hope someone of you has a minute or two and leaves his thoughts about my questions.
So basically the design question is whether a Company/Organization profile (which could be used on other sites as well) should be a resource of an Account or be a standalone model?

Another approach could be to utilize a join model as it is currently implemented with AccountUsers in Jumpstart. One company/organization profile could then be used on multiple sites(accounts).

Any thoughts about that schema?

Account
- id
- name
- domain

AccountCompanies
- id
- account_id
- company_id

Company/Organization
- id
- name
Notifications
You’re not receiving notifications from this thread.