Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename collections and properties #3

Closed
nightzirch opened this issue Nov 15, 2019 · 1 comment
Closed

Rename collections and properties #3

nightzirch opened this issue Nov 15, 2019 · 1 comment

Comments

@nightzirch
Copy link
Owner

In Firestore the following UML is almost correct:

secret_toymaker_data_structure

There are a few name changes that needs to be done in the code.

  • Event.participations is currently called participants
  • Gift.event is currently not implemented

Additionally, I think we should change the name of Participant to something else. User maybe? Same goes for Timebox. I suggest Stage.

  • Participant -> User
  • Timebox -> Stage
@Silver-Golden
Copy link
Collaborator

From https://gitlab.com/snippets/1914000


Key points

  • Move to async/await for easier readability
    • currently its callback hell witn promises
  • make more functions modular to be able to easier expand to future years
    • Can pass teh year in teh request and it will go to that collection
  • see if we can persuade Daniel (dsnider) to get /v2/account/mail up and running to verify if items were sent
  • get folks api key.
    • hopefully mail (as above)
    • user access, F2P cannot send mails, only recieve, create seperate pool for them
    • get their UUID, account username can potentially change, rare but cna happen
  • Change arounf teh data formats (below) for greater future "proofing"
  • If Daniel cannot get the mail endpoint working then when reporting record it on both accounts in case the reporter is trying to game the system
  • Maybe allow previous abusers to join, but they will be put into a pool together
  • possibly move the date format to ISO.
    • Native js function
    • easy string compasision of dates

Data format

Old format

let layout = {
  timebox:[
    { SIGNUP:{start:"startTime", end:"endTime"} }
  ],
  participants:[
    {user: "user0", uid:"0123"},
    {user: "user1", uid:"1234"},
    {user: "user2", uid:"2345"}
  ],
  events:[
    {
      2019:[
        {
          participants:[
            {user: "user1", uid:"1234"},
            {user: "user2", uid:"2345"}
          ]
        }
      ]
    }
  ]
}

New ideas

let layout = {
  // stores all participents over time
  // holds all data related to that user
  participants:[
    {user: "user0", uid:"0123"},
    {user: "user1", uid:"1234"},
    {user: "user2", uid:"2345"},
    {user: "user3", uid:"3456"}
  ],
  events:[
    {
      2019:[
        {
          // store timebox in teh year collection, keeps teh data together
          timebox: { SIGNUP:{start:"startTime", end:"endTime"} },

          // store uid and who they are getting teh gift from
          // oldFromUids is an array of people who failed to get stend a gift
          participants:[
            { uid:"1234", fromUid:"2345", oldFromUids:[ "0123" ] },
            { uid:"2345", fromUid:"3456", oldFromUids:[]  },
            { uid:"3456", fromUid:"1234", oldFromUids:[]  }
          ]
        }
      ]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants