Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Event point system #430

Open
wants to merge 30 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
91c09e2
Added virtual and in person pt values to event, added virtual prop to…
Nydauron Nov 16, 2021
1d97a96
Changed PUT /event/code/ to POST, changed GET /code/{id}/ to return a…
Nydauron Nov 16, 2021
537d2ee
Added internal GET /profile/user/{id}/ route
Nydauron Dec 24, 2021
b1223ec
Fixed bug causing new rows in profileattendance not including an id v…
Nydauron Dec 24, 2021
3fafc1f
Removed unused profile info, added isVirtual bool field to Profile model
Nydauron Dec 24, 2021
ec0ed0d
Reimplemented event redemption for 3-varient point awarding
Nydauron Dec 24, 2021
f8ce10a
Modified event models in tests
Nydauron Dec 24, 2021
3980c73
Modified profile tests
Nydauron Dec 24, 2021
687dede
Fixed test error in getValidFilteredProperties
Nydauron Dec 24, 2021
977aa5b
Updated event service docs
Nydauron Dec 24, 2021
0f6898c
Updated profile service docs
Nydauron Dec 24, 2021
3d68be6
Renamed function GetEventCode to GetEventCodes
Nydauron Dec 28, 2021
66f979e
Fixed typo in function docs
Nydauron Dec 28, 2021
576811a
Added user_id to be printed on error
Nydauron Dec 28, 2021
911610a
Changed route handler to Upsert from Update
Nydauron Jan 2, 2022
af23f52
Changed GET codes route handler to plural name
Nydauron Jan 2, 2022
8fe3f1d
Added requirement property to point fields
Nydauron Jan 2, 2022
5eb48aa
Added required fields to event structs
Nydauron Jan 2, 2022
bee5d90
Revert "Added requirement property to point fields" and "Added requir…
Nydauron Jan 3, 2022
6073e88
Changed event code model to distingush code id and event id
Nydauron Jan 3, 2022
08eb9d4
Fixed event code querying
Nydauron Jan 3, 2022
34174b7
Renamed update event code service function to upsert
Nydauron Jan 3, 2022
bc616f8
Updated documentation with refactored event code model
Nydauron Jan 3, 2022
2ed5659
Added note onupdating codes for POST /event/code in event docs
Nydauron Jan 3, 2022
c1b8d5f
Added plurality to function names
Nydauron Jan 3, 2022
32b8975
Added required validators to all fields in event code
Nydauron Jan 3, 2022
c91489b
Fixed code generation on event creation
Nydauron Jan 4, 2022
43f4699
Made point values in event model unsigned
Nydauron Jan 4, 2022
a00bc90
Added tests for all event code service functions
Nydauron Jan 4, 2022
b0f053c
Removed code str argument from UpsertEventCode function
Nydauron Jan 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 70 additions & 25 deletions documentation/docs/reference/services/Event.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 10,
"inPersonVirtPoints": 5,
"virtualPoints": 3
}
```

Expand Down Expand Up @@ -51,7 +54,10 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 10,
"inPersonVirtPoints": 5,
"virtualPoints": 3
},
{
"id": "52fdfcab71282654f163f5f0f9a621d72",
Expand All @@ -68,7 +74,10 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 20,
"inPersonVirtPoints": 10,
"virtualPoints": 5
}
]
}
Expand Down Expand Up @@ -98,11 +107,14 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 10,
"inPersonVirtPoints": 5,
"virtualPoints": 3
},
{
"id": "9566c74d10037c4d7bbb0407d1e2c649",
"name": "Example Event 10",
"name": "Example Event 11",
"description": "This is a description",
"startTime": 1532202702,
"endTime": 1532212702,
Expand All @@ -115,7 +127,10 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 20,
"inPersonVirtPoints": 10,
"virtualPoints": 5
}
]
}
Expand Down Expand Up @@ -144,7 +159,10 @@ Request format:
"latitude": 40.1138,
"longitude": -88.2249
}
]
],
"inPersonPoints": 10,
"inPersonVirtPoints": 5,
"virtualPoints": 3
}
```

Expand All @@ -165,7 +183,10 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 10,
"inPersonVirtPoints": 5,
"virtualPoints": 3
}
```

Expand All @@ -191,7 +212,10 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 10,
"inPersonVirtPoints": 7,
"virtualPoints": 3
}
```

Expand All @@ -217,7 +241,10 @@ Request format:
"latitude": 40.1138,
"longitude": -88.2249
}
]
],
"inPersonPoints": 20,
"inPersonVirtPoints": 10,
"virtualPoints": 5
}
```

Expand All @@ -238,7 +265,10 @@ Response format:
}
],
"sponsor": "Example sponsor",
"eventType": "WORKSHOP"
"eventType": "WORKSHOP",
"inPersonPoints": 20,
"inPersonVirtPoints": 10,
"virtualPoints": 5
}
```

Expand Down Expand Up @@ -367,39 +397,52 @@ Response format:
GET /event/code/{id}/
----------------------------

Gets a struct that contains information about the event code (generated upon event creation) and expiration time.
Gets an array of structs that contains information about the event codes (generated upon event creation) and expiration times.
By convention, event checkin codes will be 6 bytes long.

Response format:
```
{
"id": "52fdfc072182654f163f5f0f9a621d72",
"code": "sample_code",
"expiration": 1521388800
}

[
{
"codeID": "sample_code_1",
"eventID": "52fdfc072182654f163f5f0f9a621d72",
"isVirtual": false,
"expiration": 1521388800
},
{
"codeID": "sample_code_2",
"eventID": "52fdfc072182654f163f5f0f9a621d72",
"isVirtual": true,
"expiration": 1521388800
}
]
```

PUT /event/code/{id}/
POST /event/code/
----------------------------

Updates a struct that contains information about the event code (generated upon event creation) and expiration time.
Upserts a struct that contains information about the event code (generated upon event creation) and expiration time.

NOTE: Once created, the code ID cannot be changed.

Request format:
```
{
"code": "new_code",
"expiration": 1521388800
"codeID": "code",
"eventID": "52fdfc072182654f163f5f0f9a621d72",
"isVirtual": true,
"expiration": 1521388800
}

```

Response format:
```
{
"id": "52fdfc072182654f163f5f0f9a621d72",
"code": "new_code",
"expiration": 1521388800
"codeID": "code",
"eventID": "52fdfc072182654f163f5f0f9a621d72",
"isVirtual": true,
"expiration": 1521388800
}
```

Expand All @@ -409,6 +452,8 @@ POST /event/checkin/
Retrieves a struct that contains information about the event checkin status, point increment value, and total point number.
Takes in a struct that contains an event checkin code.

The endpoint will check the use HackIllinois-Identity field to determine if the user redeeming the points registered for virtual or in-person. It will compare this to the scanned code and will award points accordingly. (e.g. If registered for virtual, give `virtualPoints`. If registered for in-person but attended virtually, give `inPersonVirtPoints`. If registered for in-person and attended in-person, give `inPersonPoints`.)

Valid values for `status` are `Success`, `InvalidCode`, `InvalidTime`, `AlreadyCheckedIn`. When `status != Success`, the `newPoints` and `totalPoints` fields will equal `-1` and should be ignored.

Request format:
Expand Down
Loading