AgileVentures / MetPlus_tracker

Git Repository for the Waffle issue in MetPlus project
2 stars 4 forks source link

Can 2 agencies co-exist in same app instance #710

Open joaopapereira opened 6 years ago

joaopapereira commented 6 years ago

As a PETS owner I would like to have multiple agencies in PETS So that I can distribute this in Michigan


Can we have 2 agencies in a single instance? What needs to change if we can?

joaopapereira commented 6 years ago

We can create by hand a new agency. We can login with the agency admin user from the new agency. The admin looks specific for an agency.


Issues

  1. MetPlus as the page title

  2. MetPlus in the menu

  3. Landing page talks about MetPlus and should be changed per agency

    • Landing page looks good for a specific agency, start using description of the agency, and replace MetPlus with the name of the agency
    • Add some information about PETS
  4. Create a PETS landing page that eventualy can list all the agencies

    • In this page we should display some jobs
  5. About page about PETS

  6. Generic contact page that will talk to a generic email

Questions In the bottom left it says: MetPlus copyright. Should it be PETS copyright or each agency? A company can be involved with multiple agencies?

joaopapereira commented 6 years ago

How to create a new agency:

agency = Agency.find_or_create_by!(name: 'AgileVenturesAgency', website: 'agileventures.org',
                                   phone: '111 222 3333', fax: '333 444 5555',
                                   email: 'metplus@agileventures.org',
                                   description: 'Some very interesting description')

branch = Branch.create(code: '001', agency: agency)
branch.address = Address.create!(city: 'London', state: 'London',
                                  street: '123 Main Street', zipcode: 48_201)
agency_aa = AgencyPerson.new(first_name: 'Sam', last_name: 'Joseph',
                              agency_id: agency.id,
                              email: 'metplus-master@agileventures.org',
                              password: 'qwerty123', confirmed_at: Time.now,
                              branch_id: agency.branches[0].id,
                              status: 'active')
agency_aa.agency_roles << AgencyRole.find_by_role(AgencyRole::ROLE[:AA])
agency_aa.save!

agency_cm_and_jd = AgencyPerson.new(first_name: 'Joao', last_name: 'Pereira',
                                    agency_id: agency.id, email: 'joao@agileventures.org',
                                    password: 'qwerty123', confirmed_at: Time.now,
                                    branch_id: agency.branches[0].id,
                                    status: 'active')
agency_cm_and_jd.agency_roles << AgencyRole.find_by_role(AgencyRole::ROLE[:CM])
agency_cm_and_jd.agency_roles << AgencyRole.find_by_role(AgencyRole::ROLE[:JD])
agency_cm_and_jd.save!