Skip to content

Instantly share code, notes, and snippets.

@willdspd
Last active January 22, 2021 14:58

Revisions

  1. willdspd revised this gist Jan 22, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -128,6 +128,8 @@ users: {
    _modelSchema: {

    },
    // NEW - NEEDED TO CHECK THE PROPERTY TYPE IN THE CODE
    selectorType:
    }
    },
    allIds: [1],
  2. willdspd revised this gist Jan 22, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -164,6 +164,8 @@ halls: {
    credentials: {
    createRoomsPermissions: true
    }
    // NEW
    liveRoomIds: [1, 2, 3],
    }
    },
    allIds : [1],
  3. willdspd revised this gist Jan 22, 2021. 1 changed file with 13 additions and 7 deletions.
    20 changes: 13 additions & 7 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    ui: {
    screenSize: "S",
    // THIS SHOULD BE ADDED HERE, AS OPPOSED TO BEING PASSED AS PROPS
    page: "RECEPTION",
    showSidebar: ,
    showSidebar: [showSidebar],
    // THIS IS NESTED, SHOULD IT HAVE IT'S OWN STORE?
    modal: {
    editSpace: {
    // IS THIS NECESSARY?
    // IS THIS NECESSARY? IF SO THIS SHOULD BE 'space'
    space: {
    id: ,
    creatorId: ,
    @@ -21,7 +22,9 @@ ui: {
    chatId: ,
    agoraAppId: ,
    agoraChannelName: ,
    // SHOULD THIS BE canUserStream ?
    canStream: ,
    // SHOULD THIS BE isUserReceivingStream ?
    isReceivingStream: ,
    agoraScreenToken: ,
    agoraVideoToken: ,
    @@ -32,7 +35,6 @@ ui: {
    mergedSpeakers: {},
    mergedAudience: {},
    type: "ROOM"
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -145,6 +147,7 @@ halls: {
    creatorId: [hallCreatorId],
    roomIds: [1, 2, 3],
    liveRoomsCount: [hallLiveRoomsCount],
    // WHY IS THIS NEEDED HERE, BUT NOT IN ROOMS?
    slug: [hallSlug],
    accessPermissionsId: [accessPermissionsId],
    createRoomsPermissionsId: [createRoomsPermissionsId],
    @@ -156,6 +159,10 @@ halls: {
    },
    _modelSchema: {

    },
    // TO BE CHANGED
    credentials: {
    createRoomsPermissions: true
    }
    }
    },
    @@ -188,8 +195,10 @@ rooms: {
    agoraChannelName: [agoraChannelName],
    agoraScreenToken: [agoraScreenToken],
    agoraVideoToken: [agoraVideoToken],
    // SHOULD THIS BE canUserStream?
    canStream: true,
    // Fall back for accuracy to ensure the viewer count is on point
    // SHOULD THIS BE isUserReceivingStream?
    isReceivingStream: false,
    accessPermissionsId: [accessPermissionsId]
    streamPermissionsId: [createRoomPermissionsId]
    @@ -316,10 +325,7 @@ spacePermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [1, 2, 3],
    // CAN REMOVE
    createdAt: ,
    updatedAt:
    tickets: [1, 2, 3]
    }
    },
    allIds: [1]
  4. willdspd revised this gist Jan 22, 2021. 1 changed file with 63 additions and 24 deletions.
    87 changes: 63 additions & 24 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,47 @@
    // SHOULD THIS BE UI?
    ui: {
    screenSize: "S",
    page: "RECEPTION",
    modal: ,
    showSidebar: ,
    // THIS IS NESTED, SHOULD IT HAVE IT'S OWN STORE?
    modal: {
    editSpace: {
    // IS THIS NECESSARY?
    space: {
    id: ,
    creatorId: ,
    name: ,
    isStage: ,
    accessPermissionsId: ,
    streamPermissionsId: ,
    speakerCount: ,
    isLive: ,
    audienceIds: [],
    audienceCount: ,
    speakerIds: [],
    chatId: ,
    agoraAppId: ,
    agoraChannelName: ,
    canStream: ,
    isReceivingStream: ,
    agoraScreenToken: ,
    agoraVideoToken: ,
    // ARE THESE NECESSARY?
    streamPermissions: {},
    accessPermissions: {},
    mergedCreator: {},
    mergedSpeakers: {},
    mergedAudience: {},
    type: "ROOM"
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    _modelSchemaMap: {

    },
    }
    }
    }
    }

    -----
    @@ -26,13 +64,13 @@ event: {
    userCount: [eventUsersCount],
    usersInEventIds: [1, 2, 3]
    usersInEventCount: [eventUsersOnlineCount],
    // SHOULD BE IN USER?
    // SHOULD THIS BE IN THE USER STORE?
    isUserInEvent: true,
    // THIS CAN SURLY BE REMOVED
    // SHOULD THIS BE REMOVED
    selectorType: EVENT,
    // THIS WON'T BE NEEDED WHEN WE REMOVE ORGANIZATIONS
    // THIS WON'T BE NEEDED IF WE REMOVE ORGANIZATIONS
    creatorType: USER,
    // NEW
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -74,14 +112,14 @@ users: {
    isVerified: true,
    // ONLY NEEDS TO BE INCLUDED IF 'ME'
    organizationIds: [1, 2, 3],
    // THIS SHOULD BE GIVEN IT'S OWN OBJECT?
    // SHOULD BE GIVEN IT'S OWN STORE BECAUSE IT'S NESTED?
    paymentAccounts: {
    STRIPE: {
    userId: [stripeUserId],
    email: [stripeEmail]
    }
    },
    // NEW
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -110,9 +148,9 @@ halls: {
    slug: [hallSlug],
    accessPermissionsId: [accessPermissionsId],
    createRoomsPermissionsId: [createRoomsPermissionsId],
    // THIS CAN SURLY BE REMOVED
    // SHOULD THIS BE REMOVED
    selectorType: "HALL",
    // NEW
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -135,10 +173,8 @@ rooms: {
    byId: {
    1: {
    id: [roomId],
    selectorId: [roomSelectorId],
    name: [roomName],
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    // This should probably be changed from 'isStage:' to something else, because organizers may create private rooms for themsleves and speakers, which won't act as stages. I'm thinking reversing it and having something like 'isInHall:'
    isStage: true,
    @@ -157,7 +193,7 @@ rooms: {
    isReceivingStream: false,
    accessPermissionsId: [accessPermissionsId]
    streamPermissionsId: [createRoomPermissionsId]
    // NEW
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -184,6 +220,7 @@ chats: {
    hasMoreMessages: true,
    // The first 30, second 30, SHOULD BE SOMETHING DIFFERENT showMessageBatches?
    pages: [1, 2, 3]
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -203,7 +240,7 @@ messages: {
    id: [messageId],
    senderId: [senderId],
    message: "Hello",
    // NEW
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -212,12 +249,6 @@ messages: {
    },
    // WHAT IS THIS
    mergedSender: {
    _stateSchemaMap: {

    },
    _modelSchema: {

    },
    id: ,
    email: ,
    name: ,
    @@ -230,7 +261,14 @@ messages: {
    organizationIds: [],
    isVerified: ,
    mergedOrganizations: [{}],
    mergedEventUser: {}
    mergedEventUser: {},
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    _modelSchema: {

    }
    }
    }
    },
    @@ -254,8 +292,9 @@ organizations: {
    email: [stripeEmail]
    }
    },
    // CAN GET RID OF THIS?
    // SHOULD WE GET RID OF THIS?
    selectorType: [selectorType],
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -301,7 +340,7 @@ tickets: {
    remainingQuantity: [ticketsRemainingQuantity],
    // WHY IS THIS NEEDED?
    mediumId: [mediumId],
    // NEW
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
    @@ -321,7 +360,7 @@ eventUsers: {
    1: {
    id: [eventUserId],
    type: "ATTENDEE",
    // NEW
    // ARE THESE NECESSARY?
    _stateSchemaMap: {

    },
  5. willdspd revised this gist Jan 21, 2021. 1 changed file with 40 additions and 14 deletions.
    54 changes: 40 additions & 14 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    // SHOULD THIS BE UI?
    ui: {
    screenSize: "S",
    audience: ,
    showSidebar: ,
    page: "RECEPTION",
    modal: ,
    showSidebar: ,
    }

    -----
    @@ -22,14 +22,17 @@ event: {
    speakerIds: [1, 2, 3],
    roomIds: [1, 2, 3],
    hallIds: [1, 2, 3],
    ticketIds: [1, 2, 3],
    userCount: [eventUsersCount],
    usersInEventIds: [1, 2, 3]
    usersInEventCount: [eventUsersOnlineCount],
    // NEW
    // SHOULD BE IN USER?
    isUserInEvent: true,
    // THIS CAN SURLY BE REMOVED
    selectorType: EVENT,
    ticketIds: [1, 2, 3],
    // THIS WON'T BE NEEDED WHEN WE REMOVE ORGANIZATIONS
    creatorType: USER,
    // NEW
    _stateSchemaMap: {

    },
    @@ -71,13 +74,14 @@ users: {
    isVerified: true,
    // ONLY NEEDS TO BE INCLUDED IF 'ME'
    organizationIds: [1, 2, 3],
    // NEW
    // THIS SHOULD BE GIVEN IT'S OWN OBJECT?
    paymentAccounts: {
    STRIPE: {
    userId: [stripeUserId],
    email: [stripeEmail]
    }
    },
    // NEW
    _stateSchemaMap: {

    },
    @@ -106,8 +110,9 @@ halls: {
    slug: [hallSlug],
    accessPermissionsId: [accessPermissionsId],
    createRoomsPermissionsId: [createRoomsPermissionsId],
    // NEW
    // THIS CAN SURLY BE REMOVED
    selectorType: "HALL",
    // NEW
    _stateSchemaMap: {

    },
    @@ -117,7 +122,7 @@ halls: {
    }
    },
    allIds : [1],
    // NEW
    // SHOULD BE currentHallId ?
    selectedHallId: [selectedHallId],
    selectedHall: {}
    }
    @@ -162,7 +167,7 @@ rooms: {
    }
    },
    allIds : [1],
    // NEW
    // SHOULD BE currentRoom?
    selectedRoomId: [selectedRoomId]
    }

    @@ -177,8 +182,8 @@ chats: {
    messageIds: [1, 2, 3],
    // NEW
    hasMoreMessages: true,
    // The first 30, second 30
    page: [1, 2, 3]
    // The first 30, second 30, SHOULD BE SOMETHING DIFFERENT showMessageBatches?
    pages: [1, 2, 3]
    _stateSchemaMap: {

    },
    @@ -205,8 +210,27 @@ messages: {
    _modelSchema: {

    },
    mergedSender: {

    // WHAT IS THIS
    mergedSender: {
    _stateSchemaMap: {

    },
    _modelSchema: {

    },
    id: ,
    email: ,
    name: ,
    image: ,
    color: ,
    paymentAccounts: ,
    eventUserId: ,
    selectorId: ,
    slug: ,
    organizationIds: [],
    isVerified: ,
    mergedOrganizations: [{}],
    mergedEventUser: {}
    }
    }
    },
    @@ -230,6 +254,7 @@ organizations: {
    email: [stripeEmail]
    }
    },
    // CAN GET RID OF THIS?
    selectorType: [selectorType],
    _stateSchemaMap: {

    @@ -253,7 +278,7 @@ spacePermissions: {
    speakers: true,
    attendees: true,
    tickets: [1, 2, 3],
    //NEW
    // CAN REMOVE
    createdAt: ,
    updatedAt:
    }
    @@ -274,8 +299,9 @@ tickets: {
    price: [ticketPrice],
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity],
    // NEW
    // WHY IS THIS NEEDED?
    mediumId: [mediumId],
    // NEW
    _stateSchemaMap: {

    },
  6. willdspd revised this gist Jan 21, 2021. 1 changed file with 100 additions and 20 deletions.
    120 changes: 100 additions & 20 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,13 @@
    ui: {
    screenSize: "S",
    audience: ,
    showSidebar: ,
    page: "RECEPTION",
    modal: ,
    }

    -----

    event: {
    id: [eventId],
    selectorId: [eventSelectorId],
    @@ -12,8 +22,6 @@ event: {
    speakerIds: [1, 2, 3],
    roomIds: [1, 2, 3],
    hallIds: [1, 2, 3],
    // NOT NEEDED UNTIL WE NEED TO SHOW ALL EVENT USERS
    userIds: [1, 2, 3],
    userCount: [eventUsersCount],
    usersInEventIds: [1, 2, 3]
    usersInEventCount: [eventUsersOnlineCount],
    @@ -22,9 +30,29 @@ event: {
    selectorType: EVENT,
    ticketIds: [1, 2, 3],
    creatorType: USER,
    // TO BE REMOVED
    features: [features],
    test: [test],
    _stateSchemaMap: {

    },
    _modelSchemaMap: {

    },
    }

    -----

    socket: {
    socketConnected: ,
    socketReconnected: ,
    socketConnectionLost: ,
    userStartedViewingData: ,
    userStoppedViewingData: ,
    paymentAccountConfirmedData: ,
    chatMessageData: ,
    paymentProcessedData: ,
    userStartedAttendingData: ,
    userStoppedAttendingData: ,
    roomStartedStreamingData: ,
    roomStoppedStreamingData:
    }

    -----
    @@ -41,7 +69,7 @@ users: {
    slug: [userSlug],
    color: [userColor],
    isVerified: true,
    // Only needs to be included if 'me'
    // ONLY NEEDS TO BE INCLUDED IF 'ME'
    organizationIds: [1, 2, 3],
    // NEW
    paymentAccounts: {
    @@ -50,10 +78,12 @@ users: {
    email: [stripeEmail]
    }
    },
    // TO BE REMOVED
    timezone: [timezone],
    stripeAccountIds: [1, 2, 3],
    canCreateHallRooms: true,
    _stateSchemaMap: {

    },
    _modelSchema: {

    },
    }
    },
    allIds: [1],
    @@ -77,7 +107,13 @@ halls: {
    accessPermissionsId: [accessPermissionsId],
    createRoomsPermissionsId: [createRoomsPermissionsId],
    // NEW
    selectorType: "HALL"
    selectorType: "HALL",
    _stateSchemaMap: {

    },
    _modelSchema: {

    }
    }
    },
    allIds : [1],
    @@ -116,9 +152,18 @@ rooms: {
    isReceivingStream: false,
    accessPermissionsId: [accessPermissionsId]
    streamPermissionsId: [createRoomPermissionsId]
    // NEW
    _stateSchemaMap: {

    },
    _modelSchema: {

    }
    }
    },
    allIds : [1]
    allIds : [1],
    // NEW
    selectedRoomId: [selectedRoomId]
    }

    -----
    @@ -134,6 +179,12 @@ chats: {
    hasMoreMessages: true,
    // The first 30, second 30
    page: [1, 2, 3]
    _stateSchemaMap: {

    },
    _modelSchema: {

    }
    }
    },
    allIds: [1]
    @@ -146,7 +197,17 @@ messages: {
    1: {
    id: [messageId],
    senderId: [senderId],
    message: "Hello"
    message: "Hello",
    // NEW
    _stateSchemaMap: {

    },
    _modelSchema: {

    },
    mergedSender: {

    }
    }
    },
    allIds: [1]
    @@ -169,25 +230,32 @@ organizations: {
    email: [stripeEmail]
    }
    },
    color: [color],
    selectorType: [selectorType],
    // TO BE REMOVED
    stripeAccountIds: [1, 2, 3]
    _stateSchemaMap: {

    },
    _modelSchema: {

    }
    }
    },
    allIds: [1]
    }

    -----

    permissions: {
    // UPDATED
    spacePermissions: {
    byId: {
    1: {
    id: [permissionsId],
    organizers: true,
    speakers: true,
    attendees: true,
    ticketIds: [1, 2, 3]
    tickets: [1, 2, 3],
    //NEW
    createdAt: ,
    updatedAt:
    }
    },
    allIds: [1]
    @@ -208,7 +276,12 @@ tickets: {
    remainingQuantity: [ticketsRemainingQuantity],
    // NEW
    mediumId: [mediumId],
    isArchived: [archived]
    _stateSchemaMap: {

    },
    _modelSchema: {

    }

    }
    },
    @@ -222,14 +295,21 @@ eventUsers: {
    1: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [ticketId],
    // NEW
    _stateSchemaMap: {

    },
    _modelSchema: {

    }
    }
    },
    allIds: [1]
    }

    -----

    // NOT USED
    stripeAccounts: {
    byId: {
    1: {
  7. willdspd revised this gist Jan 21, 2021. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -50,7 +50,6 @@ users: {
    email: [stripeEmail]
    }
    },
    eventUserType: "CREATOR",
    // TO BE REMOVED
    timezone: [timezone],
    stripeAccountIds: [1, 2, 3],
  8. willdspd revised this gist Jan 21, 2021. 1 changed file with 108 additions and 74 deletions.
    182 changes: 108 additions & 74 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,8 @@ event: {
    chatId: [eventChatId],
    speakerIds: [1, 2, 3],
    roomIds: [1, 2, 3],
    hallIds: [1, 2, 3]
    hallIds: [1, 2, 3],
    // NOT NEEDED UNTIL WE NEED TO SHOW ALL EVENT USERS
    userIds: [1, 2, 3],
    userCount: [eventUsersCount],
    usersInEventIds: [1, 2, 3]
    @@ -20,25 +21,70 @@ event: {
    isUserInEvent: true,
    selectorType: EVENT,
    ticketIds: [1, 2, 3],
    creatorType: USER
    creatorType: USER,
    // TO BE REMOVED
    features: [features],
    test: [test],
    }

    -----

    tickets: {
    users: {
    byId: {
    1: {
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity]
    id: [userId],
    selectorId: [userSelectorId],
    eventUserId: [eventUserId],
    name: [userName],
    email: [userEmail],
    image: [userImage],
    slug: [userSlug],
    color: [userColor],
    isVerified: true,
    // Only needs to be included if 'me'
    organizationIds: [1, 2, 3],
    // NEW
    paymentAccounts: {
    STRIPE: {
    userId: [stripeUserId],
    email: [stripeEmail]
    }
    },
    eventUserType: "CREATOR",
    // TO BE REMOVED
    timezone: [timezone],
    stripeAccountIds: [1, 2, 3],
    canCreateHallRooms: true,
    }
    },
    allIds : [1]
    allIds: [1],
    meId: 1,
    me: {},
    defaultUser: {}
    }

    -----

    halls: {
    byId: {
    1: {
    id: [hallId],
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    roomIds: [1, 2, 3],
    liveRoomsCount: [hallLiveRoomsCount],
    slug: [hallSlug],
    accessPermissionsId: [accessPermissionsId],
    createRoomsPermissionsId: [createRoomsPermissionsId],
    // NEW
    selectorType: "HALL"
    }
    },
    allIds : [1],
    // NEW
    selectedHallId: [selectedHallId],
    selectedHall: {}
    }

    -----
    @@ -78,40 +124,6 @@ rooms: {

    -----

    halls: {
    byId: {
    1: {
    id: [hallId],
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    roomIds: [1, 2, 3],
    liveRoomCount: [hallLiveRoomsCount],
    slug: [hallSlug],
    accessPermissionsId: [accessPermissionsId]
    createRoomsPermissionsId: [createRoomsPermissionsId]
    }
    },
    allIds : [1]
    }

    -----

    permissions: {
    byId: {
    1: {
    id: [permissionsId],
    organizers: true,
    speakers: true,
    attendees: true,
    ticketIds: [1, 2, 3]
    }
    },
    allIds: [1]
    }

    -----

    chats: {
    byId: {
    1: {
    @@ -143,53 +155,75 @@ messages: {

    -----

    users: {
    organizations: {
    byId: {
    1: {
    id: [userId],
    selectorId: [userSelectorId],
    eventUserId: [eventUserId],
    name: [userName],
    email: [userEmail],
    image: [userImage],
    slug: [userSlug],
    color: [userColor],
    isVerified: true,
    // Only needs to be included if 'me'
    organizationIds: [1, 2, 3],
    stripeAccountIds: [1, 2, 3],
    // Needed?
    canCreateHallRooms: true
    id: [organizationId],
    selectorId: [organizationSelectorId],
    name: [organizationName],
    image: [organizationImage],
    slug: [organizationSlug],
    // NEW
    paymentAccounts: {
    STRIPE: {
    userId: [stripeUserId],
    email: [stripeEmail]
    }
    },
    color: [color],
    selectorType: [selectorType],
    // TO BE REMOVED
    stripeAccountIds: [1, 2, 3]
    }
    },
    allIds: [1],
    meId: 1
    allIds: [1]
    }

    -----

    eventUsers: {
    permissions: {
    byId: {
    1: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [ticketId],
    id: [permissionsId],
    organizers: true,
    speakers: true,
    attendees: true,
    ticketIds: [1, 2, 3]
    }
    },
    allIds: [1]
    }

    -----

    organizations: {
    tickets: {
    byId: {
    1: {
    id: [organizationId],
    selectorId: [organizationSelectorId],
    name: [organizationName],
    image: [organizationImage],
    slug: [organizationSlug],
    stripeAccountIds: [1, 2, 3]
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity],
    // NEW
    mediumId: [mediumId],
    isArchived: [archived]

    }
    },
    allIds : [1]
    }

    -----

    eventUsers: {
    byId: {
    1: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [ticketId],
    }
    },
    allIds: [1]
  9. willdspd revised this gist Jan 20, 2021. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,11 @@ event: {
    userCount: [eventUsersCount],
    usersInEventIds: [1, 2, 3]
    usersInEventCount: [eventUsersOnlineCount],
    // NEW
    isUserInEvent: true,
    selectorType: EVENT,
    ticketIds: [1, 2, 3],
    creatorType: USER
    }

    -----
    @@ -113,7 +118,11 @@ chats: {
    id: [chatId],
    // Should be type as will include 'DM' in the future
    type: "ROOM",
    messageIds: [1, 2, 3]
    messageIds: [1, 2, 3],
    // NEW
    hasMoreMessages: true,
    // The first 30, second 30
    page: [1, 2, 3]
    }
    },
    allIds: [1]
  10. willdspd revised this gist Jan 13, 2021. 1 changed file with 22 additions and 21 deletions.
    43 changes: 22 additions & 21 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -64,16 +64,8 @@ rooms: {
    canStream: true,
    // Fall back for accuracy to ensure the viewer count is on point
    isReceivingStream: false,
    // Access permissions
    organizersCanAccess: true,
    speakersCanAccess: true,
    allAttendeesCanAccess: true,
    canAccessTicketIds: [1, 2, 3]
    // Stream permissions
    organizersCanStream: true,
    speakersCanStream: true,
    allAttendeesCanStream: true,
    canStreamTicketIds: [1, 2, 3]
    accessPermissionsId: [accessPermissionsId]
    streamPermissionsId: [createRoomPermissionsId]
    }
    },
    allIds : [1]
    @@ -91,23 +83,30 @@ halls: {
    roomIds: [1, 2, 3],
    liveRoomCount: [hallLiveRoomsCount],
    slug: [hallSlug],
    // Access permissions
    organizersCanAccess: true,
    speakersCanAccess: true,
    allAttendeesCanAccess: true,
    canAccessTicketIds: [1, 2, 3]
    // Create Room Permissions
    organizersCanCreateRooms: true,
    speakersCanCreateRooms: true,
    allAttendeesCanCreateRooms: true,
    canCreateRoomsTicketIds: [1, 2, 3]
    accessPermissionsId: [accessPermissionsId]
    createRoomsPermissionsId: [createRoomsPermissionsId]
    }
    },
    allIds : [1]
    }

    -----

    permissions: {
    byId: {
    1: {
    id: [permissionsId],
    organizers: true,
    speakers: true,
    attendees: true,
    ticketIds: [1, 2, 3]
    }
    },
    allIds: [1]
    }

    -----

    chats: {
    byId: {
    1: {
    @@ -149,7 +148,9 @@ users: {
    isVerified: true,
    // Only needs to be included if 'me'
    organizationIds: [1, 2, 3],
    stripeAccountIds: [1, 2, 3]
    stripeAccountIds: [1, 2, 3],
    // Needed?
    canCreateHallRooms: true
    }
    },
    allIds: [1],
  11. willdspd revised this gist Jan 8, 2021. 1 changed file with 24 additions and 17 deletions.
    41 changes: 24 additions & 17 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -20,11 +20,10 @@ event: {

    -----

    // Do we need 'id:' in each ticket object? Yes it should be in the object

    tickets: {
    byId: {
    1: {
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    @@ -44,6 +43,7 @@ tickets: {
    rooms: {
    byId: {
    1: {
    id: [roomId],
    selectorId: [roomSelectorId],
    name: [roomName],
    creatorId: [roomCreatorId],
    @@ -61,10 +61,9 @@ rooms: {
    agoraChannelName: [agoraChannelName],
    agoraScreenToken: [agoraScreenToken],
    agoraVideoToken: [agoraVideoToken],
    // This is if the person is allowed to stream in this room? Should it be 'isStreaming:' because this could be confused with speaker eventUsers
    isSpeaker: true,
    canStream: true,
    // Fall back for accuracy to ensure the viewer count is on point
    isUserWatching: false,
    isReceivingStream: false,
    // Access permissions
    organizersCanAccess: true,
    speakersCanAccess: true,
    @@ -85,6 +84,7 @@ rooms: {
    halls: {
    byId: {
    1: {
    id: [hallId],
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    @@ -111,6 +111,7 @@ halls: {
    chats: {
    byId: {
    1: {
    id: [chatId],
    // Should be type as will include 'DM' in the future
    type: "ROOM",
    messageIds: [1, 2, 3]
    @@ -124,6 +125,7 @@ chats: {
    messages: {
    byId: {
    1: {
    id: [messageId],
    senderId: [senderId],
    message: "Hello"
    }
    @@ -133,32 +135,38 @@ messages: {

    -----

    // All users will be updated when we update 'isMe', but can be prevented using memo
    // Should eventUser have it's own object

    users: {
    byId: {
    1: {
    id: [userId],
    selectorId: [userSelectorId],
    eventUserId: [eventUserId],
    name: [userName],
    email: [userEmail],
    image: [userImage],
    slug: [userSlug],
    color: [userColor],
    isVerified: true,
    // Only needs to be included if the user is in an event
    eventUserId: [eventUserId],
    eventUserType: "ATTENDEE",
    ticketId: [ticketId],
    // Only needs to be included if the user is the current user
    // Only needs to be included if 'me'
    organizationIds: [1, 2, 3],
    stripeAccountIds: [1, 2, 3]
    }
    },
    allIds: [1],
    // Me vs my
    myId: 1
    meId: 1
    }

    -----

    eventUsers: {
    byId: {
    1: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [ticketId],
    }
    },
    allIds: [1]
    }

    -----
    @@ -179,11 +187,10 @@ organizations: {

    -----

    // Maybe should be nested if users/orgs don't have multiple stripe accounts, but if we do this soon this is ok

    stripeAccounts: {
    byId: {
    1: {
    id: [stripeAccountId],
    userId: [stripeUserId],
    email: [stripeEmail]
    }
  12. willdspd revised this gist Jan 7, 2021. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,6 @@ event: {
    hallIds: [1, 2, 3]
    userIds: [1, 2, 3],
    userCount: [eventUsersCount],
    // Is this needed if we have 'isInEvent:' in the users model? Probably will remove later
    usersInEventIds: [1, 2, 3]
    usersInEventCount: [eventUsersOnlineCount],
    }
    @@ -152,7 +151,6 @@ users: {
    eventUserId: [eventUserId],
    eventUserType: "ATTENDEE",
    ticketId: [ticketId],
    isInEvent: true
    // Only needs to be included if the user is the current user
    organizationIds: [1, 2, 3],
    stripeAccountIds: [1, 2, 3]
  13. willdspd revised this gist Jan 7, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -135,6 +135,7 @@ messages: {
    -----

    // All users will be updated when we update 'isMe', but can be prevented using memo
    // Should eventUser have it's own object

    users: {
    byId: {
  14. willdspd revised this gist Jan 7, 2021. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ event: {

    -----

    // Do we need 'id:' in each ticket object? Presumably not as the id is the object key
    // Do we need 'id:' in each ticket object? Yes it should be in the object

    tickets: {
    byId: {
    @@ -62,9 +62,9 @@ rooms: {
    agoraChannelName: [agoraChannelName],
    agoraScreenToken: [agoraScreenToken],
    agoraVideoToken: [agoraVideoToken],
    // What is the purpose of 'isSpeaker:'? Should it be 'isStreaming:' because this could be confused with speaker eventUsers
    // This is if the person is allowed to stream in this room? Should it be 'isStreaming:' because this could be confused with speaker eventUsers
    isSpeaker: true,
    // What is the purpose of 'isUserWatching:'?
    // Fall back for accuracy to ensure the viewer count is on point
    isUserWatching: false,
    // Access permissions
    organizersCanAccess: true,
    @@ -134,7 +134,7 @@ messages: {

    -----

    // All users will be updated when we update 'me', but can be prevented using memo
    // All users will be updated when we update 'isMe', but can be prevented using memo

    users: {
    byId: {
    @@ -153,12 +153,13 @@ users: {
    ticketId: [ticketId],
    isInEvent: true
    // Only needs to be included if the user is the current user
    isMe: true,
    organizationIds: [1, 2, 3],
    stripeAccountIds: [1, 2, 3]
    }
    },
    allIds: [1]
    allIds: [1],
    // Me vs my
    myId: 1
    }

    -----
    @@ -179,6 +180,8 @@ organizations: {

    -----

    // Maybe should be nested if users/orgs don't have multiple stripe accounts, but if we do this soon this is ok

    stripeAccounts: {
    byId: {
    1: {
  15. willdspd revised this gist Jan 7, 2021. 1 changed file with 152 additions and 136 deletions.
    288 changes: 152 additions & 136 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -6,169 +6,185 @@ event: {
    image: [eventImage],
    startTime: [eventStartTime],
    endTime: [eventEndTime],
    slug: [eventSlug],
    creatorId: [eventCreatorId],
    chatId: [eventChatId],
    speakerIds: [1, 2, 3],
    slug: [eventSlug],
    roomIds: [1, 3],
    hallIds: [2, 9, 10]
    roomIds: [1, 2, 3],
    hallIds: [1, 2, 3]
    userIds: [1, 2, 3],
    userCount: [eventUsersCount],
    userIds: [24, 25],
    usersInEventCount: [eventUsersOnlineCount],
    // Is this needed if we have 'isInEvent:' in the users model? Probably will remove later
    usersInEventIds: [24, 25]
    usersInEventIds: [1, 2, 3]
    usersInEventCount: [eventUsersOnlineCount],
    }

    -----

    // Should this be placed in the event model? I think the rule should be, anything that is referenced in two seperate locations, gets its own model, so in my opinion, this shouldn't be in the event model.

    tickets: [{
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity]
    }]

    // Do we need 'id:' in each ticket object? Presumably not as the id is the object key

    tickets: {
    byId: {
    1: {
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity]
    }
    },
    allIds : [1]
    }

    -----

    // I agree it isn't needed, but I think rooms in halls probably should be added to the global state for consistency. It will just be much easier to understand that everything regading event state is in easy-peasy, no need for developers to have to look into the code to see what is local and what is global, plus we can see the whole event interior state using Redux dev tools which will be easier for debugging. However, if we face any issues or obvious inconveniences we can discuss again.

    rooms: [{
    id: [roomId],
    selectorId: [roomSelectorId],
    name: [roomName],
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    // This should probably be changed from 'isStage:' to something else, because organizers may create private rooms for themsleves and speakers, which won't act as stages. I'm thinking reversing it and having something like 'isInHall:'
    isStage: true,
    chatId: [roomChatId],
    audienceCount: [roomAudienceCount],
    audienceIds: [1, 3, 5],
    speakerCount: [roomSpeakersCount],
    speakerIds: [6, 9, 10],
    streamCredentials: {
    appId: [appId],
    // Can be changed
    channel: [channelName],
    isSpeaker: true,
    isUserWatching: false,
    // Agora names
    screenToken: [screenToken],
    videoToken: [videoToken]
    },
    accessPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [
    23,
    89
    ]
    rooms: {
    byId: {
    1: {
    selectorId: [roomSelectorId],
    name: [roomName],
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    // This should probably be changed from 'isStage:' to something else, because organizers may create private rooms for themsleves and speakers, which won't act as stages. I'm thinking reversing it and having something like 'isInHall:'
    isStage: true,
    chatId: [roomChatId],
    audienceCount: [roomAudienceCount],
    audienceIds: [1, 2, 3],
    speakerIds: [1, 2, 3],
    speakerCount: [roomSpeakersCount],
    // Agora
    agoraAppId: [agoraAppId],
    agoraChannelName: [agoraChannelName],
    agoraScreenToken: [agoraScreenToken],
    agoraVideoToken: [agoraVideoToken],
    // What is the purpose of 'isSpeaker:'? Should it be 'isStreaming:' because this could be confused with speaker eventUsers
    isSpeaker: true,
    // What is the purpose of 'isUserWatching:'?
    isUserWatching: false,
    // Access permissions
    organizersCanAccess: true,
    speakersCanAccess: true,
    allAttendeesCanAccess: true,
    canAccessTicketIds: [1, 2, 3]
    // Stream permissions
    organizersCanStream: true,
    speakersCanStream: true,
    allAttendeesCanStream: true,
    canStreamTicketIds: [1, 2, 3]
    }
    },
    streamPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [
    23,
    89
    ]
    allIds : [1]
    }

    -----

    halls: {
    byId: {
    1: {
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    roomIds: [1, 2, 3],
    liveRoomCount: [hallLiveRoomsCount],
    slug: [hallSlug],
    // Access permissions
    organizersCanAccess: true,
    speakersCanAccess: true,
    allAttendeesCanAccess: true,
    canAccessTicketIds: [1, 2, 3]
    // Create Room Permissions
    organizersCanCreateRooms: true,
    speakersCanCreateRooms: true,
    allAttendeesCanCreateRooms: true,
    canCreateRoomsTicketIds: [1, 2, 3]
    }
    },
    }]
    allIds : [1]
    }

    -----

    halls: [{
    id: [hallId],
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    roomIds: [1, 3, 4],
    liveRoomCount: [hallLiveRoomsCount],
    slug: [hallSlug],
    accessPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [
    23,
    89
    ]
    chats: {
    byId: {
    1: {
    // Should be type as will include 'DM' in the future
    type: "ROOM",
    messageIds: [1, 2, 3]
    }
    },
    createRoomPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [
    23,
    89
    ]
    }
    }]
    allIds: [1]
    }

    -----

    chats: [{
    id: [chatId],
    // Should this be 'medium:' or 'location:' rather than 'type:'? What makes most intuitive sense to you? Should be type as will include 'DM' in the future
    type: "ROOM",
    messages: [{
    id: [messageId],
    senderId: [senderId],
    message: "Hello"
    }]
    }]
    messages: {
    byId: {
    1: {
    senderId: [senderId],
    message: "Hello"
    }
    },
    allIds: [1]
    }

    -----

    // Today you mentioned that if we include 'me' in the users model we'll have to "get an array from state and loop it to find our current user. Because of these reasons I believe it’s best to separate currentUser (which as I mentioned before might have special properties) from users array (a prop name for it may be “me”). And for that reason we can remove “isMe” property from other users". Is this still true after realising that we need 'me' to be included for things like audience?
    // All users will be updated when we update 'me', but can be prevented using memo

    users: [{
    id: [userId],
    selectorId: [userSelectorId],
    name: [userName],
    email: [userEmail],
    image: [userImage],
    slug: [userSlug],
    color: [userColor],
    verified: true,
    // Only needs to be included if the user is in an event
    eventUserId: [eventUserId],
    eventUserType: "ATTENDEE",
    ticketId: [eventUserTicketId],
    // Do we need this if we have inEventIds in the event object? Or maybe we don't need the inEventIds?
    isInEvent: true
    // Only needs to be included if the user is the current user
    isMe: true,
    organizationIds: [23, 65, 21],
    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
    userId: [paymentAccountUserId]
    }],
    }]
    users: {
    byId: {
    1: {
    id: [userId],
    selectorId: [userSelectorId],
    name: [userName],
    email: [userEmail],
    image: [userImage],
    slug: [userSlug],
    color: [userColor],
    isVerified: true,
    // Only needs to be included if the user is in an event
    eventUserId: [eventUserId],
    eventUserType: "ATTENDEE",
    ticketId: [ticketId],
    isInEvent: true
    // Only needs to be included if the user is the current user
    isMe: true,
    organizationIds: [1, 2, 3],
    stripeAccountIds: [1, 2, 3]
    }
    },
    allIds: [1]
    }

    -----

    organizations: {
    byId: {
    1: {
    id: [organizationId],
    selectorId: [organizationSelectorId],
    name: [organizationName],
    image: [organizationImage],
    slug: [organizationSlug],
    stripeAccountIds: [1, 2, 3]
    }
    },
    allIds: [1]
    }

    -----

    // Can be ignored for the moment as organizations won't be needed inside event
    // Maybe best to just reference in users. However, what if in the future we want to show a list of users and their organizations. If users share organizations we will want one centralised place to update organizations

    organizations: [{
    id: [organizationId],
    selectorId: [organizationSelectorId],
    name: [organizationName],
    image: [organizationImage],
    slug: [organizationSlug],
    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
    userId: [paymentAccountUserId]
    }]
    }]
    stripeAccounts: {
    byId: {
    1: {
    userId: [stripeUserId],
    email: [stripeEmail]
    }
    },
    allIds: [1]
    }
  16. willdspd revised this gist Jan 6, 2021. 1 changed file with 20 additions and 30 deletions.
    50 changes: 20 additions & 30 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -12,19 +12,16 @@ event: {
    slug: [eventSlug],
    roomIds: [1, 3],
    hallIds: [2, 9, 10]
    // Should this be nested? Or should it be 'userIds:', 'usersCount:', 'usersInEventIds:', 'usersInEventCount:'?
    users: {
    count: [eventUsersCount],
    ids: [24, 25]
    inEventCount: [eventUsersOnlineCount]
    // Is this needed if we have 'isInEvent:' in the users model?
    inEventIds: [24, 25],
    },
    userCount: [eventUsersCount],
    userIds: [24, 25],
    usersInEventCount: [eventUsersOnlineCount],
    // Is this needed if we have 'isInEvent:' in the users model? Probably will remove later
    usersInEventIds: [24, 25]
    }

    -----

    // Should this be placed in the event model? I think the rule should be, anything that is referenced in two seperate locations, gets its own model, so in my opinion, this shouldn't be in the event model. What do you think? If you disagree havily we can discuss on our call
    // Should this be placed in the event model? I think the rule should be, anything that is referenced in two seperate locations, gets its own model, so in my opinion, this shouldn't be in the event model.

    tickets: [{
    id: [ticketId],
    @@ -48,25 +45,20 @@ rooms: [{
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    // This should probably be changed from 'isStage:' to something else, because organizers may create private rooms for themsleves and speakers, which won't act as stages. Remember, we'll use the frontend as the place where we start making name changes like this, then we'll change the backend to match, so don't worry if it's not consistent for the moment. I'm thinking reversing it and having something like 'isInHall:'. What do you think?
    // This should probably be changed from 'isStage:' to something else, because organizers may create private rooms for themsleves and speakers, which won't act as stages. I'm thinking reversing it and having something like 'isInHall:'
    isStage: true,
    chatId: [roomChatId],
    // Should this be nested? Or should it be 'audienceIds:' and 'audienceCount:'
    audience: {
    count: [roomAudienceCount],
    ids: [1, 3, 5]
    }
    // Should this be nested? Or should it be 'speakerIds:' and 'speakerCount:'
    speakers: {
    count: [roomSpeakersCount],
    ids: [6, 9, 10]
    }
    // What are you basing these property names off? Are these the names that Agora uses? I ask because they seem to use channelName vs channel?
    audienceCount: [roomAudienceCount],
    audienceIds: [1, 3, 5],
    speakerCount: [roomSpeakersCount],
    speakerIds: [6, 9, 10],
    streamCredentials: {
    appId: [appId],
    // Can be changed
    channel: [channelName],
    isSpeaker: true,
    isUserWatching: false,
    // Agora names
    screenToken: [screenToken],
    videoToken: [videoToken]
    },
    @@ -124,7 +116,7 @@ halls: [{

    chats: [{
    id: [chatId],
    // Should this be 'medium:' or 'location:' rather than 'type:'? What makes most intuitive sense to you?
    // Should this be 'medium:' or 'location:' rather than 'type:'? What makes most intuitive sense to you? Should be type as will include 'DM' in the future
    type: "ROOM",
    messages: [{
    id: [messageId],
    @@ -136,6 +128,7 @@ chats: [{
    -----

    // Today you mentioned that if we include 'me' in the users model we'll have to "get an array from state and loop it to find our current user. Because of these reasons I believe it’s best to separate currentUser (which as I mentioned before might have special properties) from users array (a prop name for it may be “me”). And for that reason we can remove “isMe” property from other users". Is this still true after realising that we need 'me' to be included for things like audience?
    // All users will be updated when we update 'me', but can be prevented using memo

    users: [{
    id: [userId],
    @@ -146,15 +139,12 @@ users: [{
    slug: [userSlug],
    color: [userColor],
    verified: true,
    // Should this be in an object or just have eventUserId, eventUserType, ticketId, isInEvent
    // Only needs to be included if the user is in an event
    eventUser: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [eventUserTicketId],
    // Do we need this if we have inEventIds in the event object? Or maybe we don't need the inEventIds?
    isInEvent: true
    },
    eventUserId: [eventUserId],
    eventUserType: "ATTENDEE",
    ticketId: [eventUserTicketId],
    // Do we need this if we have inEventIds in the event object? Or maybe we don't need the inEventIds?
    isInEvent: true
    // Only needs to be included if the user is the current user
    isMe: true,
    organizationIds: [23, 65, 21],
  17. willdspd revised this gist Jan 6, 2021. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -48,7 +48,8 @@ rooms: [{
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    isStage: true, ///////// Shall we call it isStage
    // This should probably be changed from 'isStage:' to something else, because organizers may create private rooms for themsleves and speakers, which won't act as stages. Remember, we'll use the frontend as the place where we start making name changes like this, then we'll change the backend to match, so don't worry if it's not consistent for the moment. I'm thinking reversing it and having something like 'isInHall:'. What do you think?
    isStage: true,
    chatId: [roomChatId],
    // Should this be nested? Or should it be 'audienceIds:' and 'audienceCount:'
    audience: {
    @@ -60,7 +61,7 @@ rooms: [{
    count: [roomSpeakersCount],
    ids: [6, 9, 10]
    }
    ///////// Check if these properties are correct
    // What are you basing these property names off? Are these the names that Agora uses? I ask because they seem to use channelName vs channel?
    streamCredentials: {
    appId: [appId],
    channel: [channelName],
    @@ -123,7 +124,7 @@ halls: [{

    chats: [{
    id: [chatId],
    ////// Should this be 'medium:' or 'location:' rather than 'type:'
    // Should this be 'medium:' or 'location:' rather than 'type:'? What makes most intuitive sense to you?
    type: "ROOM",
    messages: [{
    id: [messageId],
  18. willdspd revised this gist Jan 6, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,7 @@ event: {
    chatId: [eventChatId],
    speakerIds: [1, 2, 3],
    slug: [eventSlug],
    // Should this be stageIds or roomIds in your opinion?
    stageIds: [1, 3],
    roomIds: [1, 3],
    hallIds: [2, 9, 10]
    // Should this be nested? Or should it be 'userIds:', 'usersCount:', 'usersInEventIds:', 'usersInEventCount:'?
    users: {
  19. willdspd revised this gist Jan 6, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ event: {
    chatId: [eventChatId],
    speakerIds: [1, 2, 3],
    slug: [eventSlug],
    //////// stageIds or roomIds?
    // Should this be stageIds or roomIds in your opinion?
    stageIds: [1, 3],
    hallIds: [2, 9, 10]
    // Should this be nested? Or should it be 'userIds:', 'usersCount:', 'usersInEventIds:', 'usersInEventCount:'?
  20. willdspd revised this gist Jan 6, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ event: {

    -----

    // Should this be placed in the event model? I think the rule should be, anything that is referenced in two seperate locations, gets its own model, so in my opinion, this shouldn't be in the event model.
    // Should this be placed in the event model? I think the rule should be, anything that is referenced in two seperate locations, gets its own model, so in my opinion, this shouldn't be in the event model. What do you think? If you disagree havily we can discuss on our call

    tickets: [{
    id: [ticketId],
  21. willdspd revised this gist Jan 6, 2021. 1 changed file with 30 additions and 26 deletions.
    56 changes: 30 additions & 26 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -10,23 +10,37 @@ event: {
    chatId: [eventChatId],
    speakerIds: [1, 2, 3],
    slug: [eventSlug],
    roomIds: [1, 3],
    //////// stageIds or roomIds?
    stageIds: [1, 3],
    hallIds: [2, 9, 10]
    // Should this be nested?
    // Should this be nested? Or should it be 'userIds:', 'usersCount:', 'usersInEventIds:', 'usersInEventCount:'?
    users: {
    count: [eventUsersCount],
    ids: [24, 25]
    inEventCount: [eventUsersOnlineCount]
    // Is this needed if we have 'isInEvent:' in the users model?
    inEventIds: [24, 25],
    },
    }

    -----

    // Should rooms in halls just be in local state or in their own state? They will only be in global state for the time we're actually on the halls page.
    // Every time a room in a hall is updated/added, rooms in sidebar will update and vice versa, but it can be prevented by using memo.
    // It will not create any inconsistency (like we had with room/event chats). Even every time we move to another page we will have to clear the data out. I believe that is not required.
    // We could have stages and rooms models?
    // Should this be placed in the event model? I think the rule should be, anything that is referenced in two seperate locations, gets its own model, so in my opinion, this shouldn't be in the event model.

    tickets: [{
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity]
    }]

    -----

    // I agree it isn't needed, but I think rooms in halls probably should be added to the global state for consistency. It will just be much easier to understand that everything regading event state is in easy-peasy, no need for developers to have to look into the code to see what is local and what is global, plus we can see the whole event interior state using Redux dev tools which will be easier for debugging. However, if we face any issues or obvious inconveniences we can discuss again.

    rooms: [{
    id: [roomId],
    @@ -35,18 +49,19 @@ rooms: [{
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    isStage: true, // Shall we call it isStage
    isStage: true, ///////// Shall we call it isStage
    chatId: [roomChatId],
    // Should this be nested?
    // Should this be nested? Or should it be 'audienceIds:' and 'audienceCount:'
    audience: {
    count: [roomAudienceCount],
    ids: [1, 3, 5]
    }
    // Should this be nested?
    // Should this be nested? Or should it be 'speakerIds:' and 'speakerCount:'
    speakers: {
    count: [roomSpeakersCount],
    ids: [6, 9, 10]
    }
    ///////// Check if these properties are correct
    streamCredentials: {
    appId: [appId],
    channel: [channelName],
    @@ -109,7 +124,7 @@ halls: [{

    chats: [{
    id: [chatId],
    // Is 'type' ok?
    ////// Should this be 'medium:' or 'location:' rather than 'type:'
    type: "ROOM",
    messages: [{
    id: [messageId],
    @@ -120,21 +135,7 @@ chats: [{

    -----

    // Maybe shouldn't be slit up because they belong to events
    tickets: [{
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity]
    }],

    -----

    // Not seperating current user. Mert: Every single time we need to get an array from state and loop it to find our current user. Because of these reasons I believe it’s best to separate currentUser (which as I mentioned before might have special properties) from users array (a prop name for it may be “me”). And for that reason we can remove “isMe” property from other users
    // Today you mentioned that if we include 'me' in the users model we'll have to "get an array from state and loop it to find our current user. Because of these reasons I believe it’s best to separate currentUser (which as I mentioned before might have special properties) from users array (a prop name for it may be “me”). And for that reason we can remove “isMe” property from other users". Is this still true after realising that we need 'me' to be included for things like audience?

    users: [{
    id: [userId],
    @@ -145,14 +146,16 @@ users: [{
    slug: [userSlug],
    color: [userColor],
    verified: true,
    // Should this be in an object or just have eventUserId, eventUserType, ticketId, isInEvent
    // Only needs to be included if the user is in an event
    eventUser: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [eventUserTicketId],
    // Do we need this if we have inEventIds in the event object? Or maybe we don't need the inEventIds?
    isInEvent: true
    },
    // Only needs to be included if the user is the current user
    // Only needs to be included if the user is the current user
    isMe: true,
    organizationIds: [23, 65, 21],
    paymentAccounts: [{
    @@ -164,6 +167,7 @@ users: [{

    -----

    // Can be ignored for the moment as organizations won't be needed inside event
    // Maybe best to just reference in users. However, what if in the future we want to show a list of users and their organizations. If users share organizations we will want one centralised place to update organizations

    organizations: [{
  22. willdspd revised this gist Jan 5, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -164,7 +164,8 @@ users: [{

    -----

    // Maybe best to just reference in users
    // Maybe best to just reference in users. However, what if in the future we want to show a list of users and their organizations. If users share organizations we will want one centralised place to update organizations

    organizations: [{
    id: [organizationId],
    selectorId: [organizationSelectorId],
  23. willdspd revised this gist Jan 5, 2021. 1 changed file with 19 additions and 22 deletions.
    41 changes: 19 additions & 22 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -23,9 +23,10 @@ event: {

    -----

    // Every time a room in a hall is updated/added, rooms in sidebar will update and vice versa
    // Should rooms in halls just be in local state, will only be in global state for the time we're actually on the halls page
    // I cannot see a reason that we need to put rooms inside hall to “rooms” prop in the state. Because if we think about the structure when we get into some hall we are going to fetch the rooms inside that hall and there is no difference between saving them into the local state and saving them into the global state since they are not going to be accessed in any other place and it will not create any inconsistency (like we had with room/event chats). Even every time we move to another page we will have to clear the data out. I believe that is not required. What do you think?. Also since we are going to be re-rendered (it can be prevented by using memo) rooms array sidebar is going to be updated because sidebar also gets its data from rooms
    // Should rooms in halls just be in local state or in their own state? They will only be in global state for the time we're actually on the halls page.
    // Every time a room in a hall is updated/added, rooms in sidebar will update and vice versa, but it can be prevented by using memo.
    // It will not create any inconsistency (like we had with room/event chats). Even every time we move to another page we will have to clear the data out. I believe that is not required.
    // We could have stages and rooms models?

    rooms: [{
    id: [roomId],
    @@ -36,10 +37,12 @@ rooms: [{
    isLive: true,
    isStage: true, // Shall we call it isStage
    chatId: [roomChatId],
    // Should this be nested?
    audience: {
    count: [roomAudienceCount],
    ids: [1, 3, 5]
    }
    // Should this be nested?
    speakers: {
    count: [roomSpeakersCount],
    ids: [6, 9, 10]
    @@ -56,7 +59,6 @@ rooms: [{
    organizers: true,
    speakers: true,
    attendees: true,
    // Should be ticketIds if it's ticketIds in backend?
    tickets: [
    23,
    89
    @@ -80,11 +82,8 @@ halls: [{
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    // Should be split up into 'roomIds:' and 'liveRoomsCount:'
    rooms: {
    ids: [1, 3, 4],
    liveCount: [hallLiveRoomsCount]
    }
    roomIds: [1, 3, 4],
    liveRoomCount: [hallLiveRoomsCount],
    slug: [hallSlug],
    accessPermissions: {
    organizers: true,
    @@ -155,8 +154,12 @@ users: [{
    },
    // Only needs to be included if the user is the current user
    isMe: true,
    paymentAccountIds: [3, 4]
    organizationIds: [23, 65, 21]
    organizationIds: [23, 65, 21],
    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
    userId: [paymentAccountUserId]
    }],
    }]

    -----
    @@ -168,15 +171,9 @@ organizations: [{
    name: [organizationName],
    image: [organizationImage],
    slug: [organizationSlug],
    paymentAccountIds: [4, 7]
    }]

    -----

    // Only for the current user, so should be in users/organizations. No updating in two places at once
    // Global state is slower than local
    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
    userId: [paymentAccountUserId]
    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
    userId: [paymentAccountUserId]
    }]
    }]
  24. willdspd revised this gist Jan 5, 2021. 1 changed file with 11 additions and 13 deletions.
    24 changes: 11 additions & 13 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -9,25 +9,24 @@ event: {
    creatorId: [eventCreatorId],
    chatId: [eventChatId],
    speakerIds: [1, 2, 3],
    // Should this be split into 'slug:' and 'previousSlugs: []'?
    slug: {
    current: [eventSlug],
    previous: []
    }
    slug: [eventSlug],
    roomIds: [1, 3],
    hallIds: [2, 9, 10]
    // Should this be nested?
    users: {
    count: [eventUsersCount],
    ids: [24, 25]
    onlineCount: [eventUsersOnlineCount]
    onlineIds: [24, 25],
    inEventCount: [eventUsersOnlineCount]
    inEventIds: [24, 25],
    },
    }

    -----

    // Every time a room in a hall is updated/added, rooms in sidebar will update and vice versa
    // Should rooms in halls just be in local state, will only be in global state for the time we're actually on the halls page
    // I cannot see a reason that we need to put rooms inside hall to “rooms” prop in the state. Because if we think about the structure when we get into some hall we are going to fetch the rooms inside that hall and there is no difference between saving them into the local state and saving them into the global state since they are not going to be accessed in any other place and it will not create any inconsistency (like we had with room/event chats). Even every time we move to another page we will have to clear the data out. I believe that is not required. What do you think?. Also since we are going to be re-rendered (it can be prevented by using memo) rooms array sidebar is going to be updated because sidebar also gets its data from rooms

    rooms: [{
    id: [roomId],
    selectorId: [roomSelectorId],
    @@ -130,15 +129,14 @@ tickets: [{
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    // Should be split into 'quantity:' and 'remainingQuantity:'
    quanitity: {
    total: [ticketQuantity]
    remaining: [ticketsRemainingQuantity]
    }
    quantity: [ticketQuantity],
    remainingQuantity: [ticketsRemainingQuantity]
    }],

    -----

    // Not seperating current user. Mert: Every single time we need to get an array from state and loop it to find our current user. Because of these reasons I believe it’s best to separate currentUser (which as I mentioned before might have special properties) from users array (a prop name for it may be “me”). And for that reason we can remove “isMe” property from other users

    users: [{
    id: [userId],
    selectorId: [userSelectorId],
    @@ -175,7 +173,7 @@ organizations: [{

    -----

    // Only for the current user, so should be in users. No updating in two places at once
    // Only for the current user, so should be in users/organizations. No updating in two places at once
    // Global state is slower than local
    paymentAccounts: [{
    id: [paymentAccountId],
  25. willdspd revised this gist Jan 5, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ event: {
    -----

    // Every time a room in a hall is updated/added, rooms in sidebar will update and vice versa
    // Should rooms in halls just be in local state
    // Should rooms in halls just be in local state, will only be in global state for the time we're actually on the halls page
    rooms: [{
    id: [roomId],
    selectorId: [roomSelectorId],
    @@ -176,6 +176,7 @@ organizations: [{
    -----

    // Only for the current user, so should be in users. No updating in two places at once
    // Global state is slower than local
    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
  26. willdspd revised this gist Jan 5, 2021. 1 changed file with 17 additions and 21 deletions.
    38 changes: 17 additions & 21 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -14,16 +14,8 @@ event: {
    current: [eventSlug],
    previous: []
    }
    // Should we just replace this with an 'isMe' boolean property in the users model?
    user: {
    id: [eventUserId],
    isOnline: true // Should this be 'isOnline:' or 'isInEvent:'?
    }
    // Should this be encapuslated in the spaces object or not?
    spaces: {
    roomIds: [1, 3],
    hallIds: [2, 9, 10]
    },
    roomIds: [1, 3],
    hallIds: [2, 9, 10]
    users: {
    count: [eventUsersCount],
    ids: [24, 25]
    @@ -34,15 +26,16 @@ event: {

    -----

    // Every time a room in a hall is updated/added, rooms in sidebar will update and vice versa
    // Should rooms in halls just be in local state
    rooms: [{
    id: [roomId],
    selectorId: [roomSelectorId],
    name: [roomName],
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    // Do we need isStage here? Because we can tell if it's a stage by checking if the id is included in event.roomIds
    isStage: true,
    isStage: true, // Shall we call it isStage
    chatId: [roomChatId],
    audience: {
    count: [roomAudienceCount],
    @@ -64,7 +57,7 @@ rooms: [{
    organizers: true,
    speakers: true,
    attendees: true,
    // Should this be ticketIds?
    // Should be ticketIds if it's ticketIds in backend?
    tickets: [
    23,
    89
    @@ -88,7 +81,7 @@ halls: [{
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    // Should this be split up into 'roomIds:' and 'liveRoomsCount:'
    // Should be split up into 'roomIds:' and 'liveRoomsCount:'
    rooms: {
    ids: [1, 3, 4],
    liveCount: [hallLiveRoomsCount]
    @@ -103,7 +96,6 @@ halls: [{
    89
    ]
    },
    // createRoomPermission vs roomCreationPermissions
    createRoomPermissions: {
    organizers: true,
    speakers: true,
    @@ -119,7 +111,7 @@ halls: [{

    chats: [{
    id: [chatId],
    // Is this needed because we can tell if it's a ROOM or EVENT chat by checking if the id is included in event.chatId or room.chatId
    // Is 'type' ok?
    type: "ROOM",
    messages: [{
    id: [messageId],
    @@ -130,14 +122,15 @@ chats: [{

    -----

    // Maybe shouldn't be slit up because they belong to events
    tickets: [{
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    // Should this be split into 'quantity:' and 'remainingQuantity:'?
    // Should be split into 'quantity:' and 'remainingQuantity:'
    quanitity: {
    total: [ticketQuantity]
    remaining: [ticketsRemainingQuantity]
    @@ -155,20 +148,22 @@ users: [{
    slug: [userSlug],
    color: [userColor],
    verified: true,
    organizationIds: [23, 65, 21],
    paymentAccountIds: [3, 4]
    // Only needs to be included if the user is in an event
    eventUser: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [eventUserTicketId]
    }
    ticketId: [eventUserTicketId],
    isInEvent: true
    },
    // Only needs to be included if the user is the current user
    isMe: true,
    paymentAccountIds: [3, 4]
    organizationIds: [23, 65, 21]
    }]

    -----

    // Maybe best to just reference in users
    organizations: [{
    id: [organizationId],
    selectorId: [organizationSelectorId],
    @@ -180,6 +175,7 @@ organizations: [{

    -----

    // Only for the current user, so should be in users. No updating in two places at once
    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
  27. willdspd created this gist Jan 5, 2021.
    187 changes: 187 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,187 @@
    event: {
    id: [eventId],
    selectorId: [eventSelectorId],
    name: [eventName],
    description: [eventDescription],
    image: [eventImage],
    startTime: [eventStartTime],
    endTime: [eventEndTime],
    creatorId: [eventCreatorId],
    chatId: [eventChatId],
    speakerIds: [1, 2, 3],
    // Should this be split into 'slug:' and 'previousSlugs: []'?
    slug: {
    current: [eventSlug],
    previous: []
    }
    // Should we just replace this with an 'isMe' boolean property in the users model?
    user: {
    id: [eventUserId],
    isOnline: true // Should this be 'isOnline:' or 'isInEvent:'?
    }
    // Should this be encapuslated in the spaces object or not?
    spaces: {
    roomIds: [1, 3],
    hallIds: [2, 9, 10]
    },
    users: {
    count: [eventUsersCount],
    ids: [24, 25]
    onlineCount: [eventUsersOnlineCount]
    onlineIds: [24, 25],
    },
    }

    -----

    rooms: [{
    id: [roomId],
    selectorId: [roomSelectorId],
    name: [roomName],
    creatorId: [roomCreatorId],
    slug: [roomSlug],
    isLive: true,
    // Do we need isStage here? Because we can tell if it's a stage by checking if the id is included in event.roomIds
    isStage: true,
    chatId: [roomChatId],
    audience: {
    count: [roomAudienceCount],
    ids: [1, 3, 5]
    }
    speakers: {
    count: [roomSpeakersCount],
    ids: [6, 9, 10]
    }
    streamCredentials: {
    appId: [appId],
    channel: [channelName],
    isSpeaker: true,
    isUserWatching: false,
    screenToken: [screenToken],
    videoToken: [videoToken]
    },
    accessPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    // Should this be ticketIds?
    tickets: [
    23,
    89
    ]
    },
    streamPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [
    23,
    89
    ]
    },
    }]

    -----

    halls: [{
    id: [hallId],
    selectorId: [hallSelectorId],
    name: [hallName],
    creatorId: [hallCreatorId],
    // Should this be split up into 'roomIds:' and 'liveRoomsCount:'
    rooms: {
    ids: [1, 3, 4],
    liveCount: [hallLiveRoomsCount]
    }
    slug: [hallSlug],
    accessPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [
    23,
    89
    ]
    },
    // createRoomPermission vs roomCreationPermissions
    createRoomPermissions: {
    organizers: true,
    speakers: true,
    attendees: true,
    tickets: [
    23,
    89
    ]
    }
    }]

    -----

    chats: [{
    id: [chatId],
    // Is this needed because we can tell if it's a ROOM or EVENT chat by checking if the id is included in event.chatId or room.chatId
    type: "ROOM",
    messages: [{
    id: [messageId],
    senderId: [senderId],
    message: "Hello"
    }]
    }]

    -----

    tickets: [{
    id: [ticketId],
    type: "DONATION",
    name: [ticketName],
    description: [ticketDescription],
    currency: [ticketCurrency],
    price: [ticketPrice],
    // Should this be split into 'quantity:' and 'remainingQuantity:'?
    quanitity: {
    total: [ticketQuantity]
    remaining: [ticketsRemainingQuantity]
    }
    }],

    -----

    users: [{
    id: [userId],
    selectorId: [userSelectorId],
    name: [userName],
    email: [userEmail],
    image: [userImage],
    slug: [userSlug],
    color: [userColor],
    verified: true,
    organizationIds: [23, 65, 21],
    paymentAccountIds: [3, 4]
    // Only needs to be included if the user is in an event
    eventUser: {
    id: [eventUserId],
    type: "ATTENDEE",
    ticketId: [eventUserTicketId]
    }
    // Only needs to be included if the user is the current user
    isMe: true,
    }]

    -----

    organizations: [{
    id: [organizationId],
    selectorId: [organizationSelectorId],
    name: [organizationName],
    image: [organizationImage],
    slug: [organizationSlug],
    paymentAccountIds: [4, 7]
    }]

    -----

    paymentAccounts: [{
    id: [paymentAccountId],
    email: [paymentAccountEmail],
    userId: [paymentAccountUserId]
    }]