cs-24-sw-2-p2-05 / team-cohesion-tool

AAU Software 2nd semester project
MIT License
2 stars 0 forks source link

JSON db formatting? #4

Open Naitsabot opened 5 months ago

Naitsabot commented 5 months ago

Noget som dette, idk:

{
    "profiles": {
        "profile_id1": {
            "name": "Sille Smilefjæs",
            "activities": ["activity_id1", "activity_id2", "activity_id3"],
            "time_availability": ["1","2","3","4"]
        }
    },
    "teams": {
        "team_id1": {
            "name": "Bakkeskolen",
            "profile_ids": ["profile_id1", "profile_id2", "profile_id3", "profile_id4"],
            "time_frame": ["1","2","3","4","5"]
        }
    },
    "activities": {
        "activity_id1": {
            "name": "Rollespil i den mørke skov",
            "description": "Du må ik' være med før du får lov",
            "main_interest": "interest_id1",
            "interests": ["interest_id1", "interest_id5"],
            "time_interval": "1"
        }
    },
    "interests": {
        "interest_id1": {
            "name": "Roleplay"
        }
    }
}
soupglasses commented 5 months ago

Then we can fill the profiles for a team using the following pseudocode:


> Object.fromEntries(x['teams']['team_id...'].profile_ids.map((user_id) => [user_id, x['profiles'][user_id]]))
{
  'profile_id...': {
    first_name: 'Sille',
    last_name: 'Smilefjes',
    interests: [ 'skiing', 'paint-ball', 'hardcore roller-skating' ],
    time_availability: [ '2024-1-2_12:13', '2024-1-3_13:16', '2024-1-4_14:17' ]
  }
}
]```