codeigniterlogistics

App logicstics & changes due to scope creep


I started an app that was initially a testing platform--user management, and managers that can view their employees tests.

Recently, functionality has been extended (not built yet) to allow users to complete a test in place of an employee--basically adding a record, but no user.

I have three tables in use for this: users(contains user info for login/security), profiles (all personal info: address, height, etc.), and survey (contains survey answers for user).

How do I extend my application to encompass this functionality with minimal change to the structure?

I assume that the best way to do this would be to insert records to the tables profiles and survey, and have no username/password/email? There MUST be a user_id associated b/c the tables are linked through the user_ids...


Solution

  • Seems to me you should still have a user - otherwise how will you know who completed the profile and survey?

    If it's a manager creating the profile and survey, simply have them sign in with their own user account and create a test profile. That is, a single user will be able to have more than one profile and survey - which seems trivial with your current DB setup.

    Then when a manager signs in, show them all of their own test profiles and surveys, and all of their employees' profiles and surveys.