Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 6 additions & 12 deletions documentation/docs/reference/services/Check-In.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Response format:
```
{
"id": "github0000001",
"hasCheckedIn": true,
"hasPickedUpSwag": true
"hasCheckedIn": true
}
```

Expand All @@ -24,8 +23,7 @@ Response format:
```
{
"id": "github0000001",
"hasCheckedIn": true,
"hasPickedUpSwag": true
"hasCheckedIn": true
}
```

Expand All @@ -39,8 +37,7 @@ Request format:
{
"id": "github0000001",
"override": true,
"hasCheckedIn": true,
"hasPickedUpSwag": true
"hasCheckedIn": true
}
```

Expand All @@ -49,8 +46,7 @@ Response format:
{
"id": "github0000001",
"override": true,
"hasCheckedIn": true,
"hasPickedUpSwag": true
"hasCheckedIn": true
}
```

Expand All @@ -63,17 +59,15 @@ Request format:
```
{
"id": "github0000001",
"hasCheckedIn": true,
"hasPickedUpSwag": true
"hasCheckedIn": true
}
```

Response format:
```
{
"id": "github0000001",
"hasCheckedIn": true,
"hasPickedUpSwag": true
"hasCheckedIn": true
}
```

Expand Down
Empty file removed log/access.log
Empty file.
2 changes: 1 addition & 1 deletion services/checkin/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Checkin
=======

This is the checkin microservice supporting hackillinois. This service allows checkins to checkin and tracks if they picked up swag.
This is the checkin microservice supporting hackillinois. This service allows admitted attendees to check in to the event.
9 changes: 4 additions & 5 deletions services/checkin/models/user_checkin.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package models

type UserCheckin struct {
ID string `json:"id"`
Override bool `json:"override"`
HasCheckedIn bool `json:"hasCheckedIn"`
HasPickedUpSwag bool `json:"hasPickedUpSwag"`
RsvpData map[string]interface{} `json:"rsvpData"`
ID string `json:"id"`
Override bool `json:"override"`
HasCheckedIn bool `json:"hasCheckedIn"`
RsvpData map[string]interface{} `json:"rsvpData"`
}
2 changes: 1 addition & 1 deletion services/checkin/service/checkin_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ func GetAllCheckedInUsers() (*models.CheckinList, error) {
Returns all checkin stats
*/
func GetStats() (map[string]interface{}, error) {
return db.GetStats("checkins", []string{"override", "hascheckedin", "haspickedupswag"})
return db.GetStats("checkins", []string{"override", "hascheckedin"})
}
63 changes: 28 additions & 35 deletions services/checkin/tests/checkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package tests

import (
"fmt"
"os"
"reflect"
"testing"

"github.com/HackIllinois/api/common/database"
"github.com/HackIllinois/api/services/checkin/config"
"github.com/HackIllinois/api/services/checkin/models"
"github.com/HackIllinois/api/services/checkin/service"
"os"
"reflect"
"testing"
)

var db database.Database
Expand Down Expand Up @@ -46,10 +47,9 @@ func TestMain(m *testing.M) {
*/
func SetupTestDB(t *testing.T) {
checkin := models.UserCheckin{
ID: "testid",
HasCheckedIn: true,
HasPickedUpSwag: true,
RsvpData: map[string]interface{}{},
ID: "testid",
HasCheckedIn: true,
RsvpData: map[string]interface{}{},
}

err := db.Insert("checkins", &checkin)
Expand Down Expand Up @@ -83,10 +83,9 @@ func TestGetUserCheckinService(t *testing.T) {
}

expected_checkin := models.UserCheckin{
ID: "testid",
HasCheckedIn: true,
HasPickedUpSwag: true,
RsvpData: map[string]interface{}{},
ID: "testid",
HasCheckedIn: true,
RsvpData: map[string]interface{}{},
}

if !reflect.DeepEqual(checkin, &expected_checkin) {
Expand All @@ -103,10 +102,9 @@ func TestCreateUserCheckinService(t *testing.T) {
SetupTestDB(t)

new_checkin := models.UserCheckin{
ID: "testid2",
HasCheckedIn: true,
HasPickedUpSwag: false,
RsvpData: map[string]interface{}{},
ID: "testid2",
HasCheckedIn: true,
RsvpData: map[string]interface{}{},
}

err := service.CreateUserCheckin("testid2", new_checkin)
Expand All @@ -122,10 +120,9 @@ func TestCreateUserCheckinService(t *testing.T) {
}

expected_checkin := models.UserCheckin{
ID: "testid2",
HasCheckedIn: true,
HasPickedUpSwag: false,
RsvpData: map[string]interface{}{},
ID: "testid2",
HasCheckedIn: true,
RsvpData: map[string]interface{}{},
}

if !reflect.DeepEqual(checkin, &expected_checkin) {
Expand All @@ -142,10 +139,9 @@ func TestUpdateUserCheckinService(t *testing.T) {
SetupTestDB(t)

checkin := models.UserCheckin{
ID: "testid",
HasCheckedIn: true,
HasPickedUpSwag: false,
RsvpData: map[string]interface{}{},
ID: "testid",
HasCheckedIn: true,
RsvpData: map[string]interface{}{},
}

err := service.UpdateUserCheckin("testid", checkin)
Expand All @@ -161,10 +157,9 @@ func TestUpdateUserCheckinService(t *testing.T) {
}

expected_checkin := models.UserCheckin{
ID: "testid",
HasCheckedIn: true,
HasPickedUpSwag: false,
RsvpData: map[string]interface{}{},
ID: "testid",
HasCheckedIn: true,
RsvpData: map[string]interface{}{},
}

if !reflect.DeepEqual(updated_checkin, &expected_checkin) {
Expand All @@ -181,10 +176,9 @@ func TestGetAllCheckedInUsersService(t *testing.T) {
SetupTestDB(t)

new_checkin := models.UserCheckin{
ID: "testid2",
HasCheckedIn: false,
HasPickedUpSwag: false,
RsvpData: map[string]interface{}{},
ID: "testid2",
HasCheckedIn: false,
RsvpData: map[string]interface{}{},
}

err := service.CreateUserCheckin("testid2", new_checkin)
Expand All @@ -194,10 +188,9 @@ func TestGetAllCheckedInUsersService(t *testing.T) {
}

new_checkin = models.UserCheckin{
ID: "testid3",
HasCheckedIn: true,
HasPickedUpSwag: false,
RsvpData: map[string]interface{}{},
ID: "testid3",
HasCheckedIn: true,
RsvpData: map[string]interface{}{},
}

err = service.CreateUserCheckin("testid3", new_checkin)
Expand Down