-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
6,985 additions
and
6,841 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18.x" | ||
cache: "yarn" | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build | ||
run: yarn test | ||
name: Test | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18.x" | ||
cache: "yarn" | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/bin/bash | ||
cd /home/ubuntu/rp-api | ||
yarn build | ||
#!/bin/bash | ||
cd /home/ubuntu/rp-api | ||
sudo yarn build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
#!/bin/bash | ||
cd /home/ubuntu/rp-api | ||
sudo yarn | ||
|
||
sudo pm2 describe appname 2>&1 /dev/null | ||
RUNNING=$? | ||
|
||
|
||
if [ "${RUNNING}" -eq 0 ]; then | ||
sudo pm2 start build/app.js --name RP_API -i 2 --wait-ready --listen-timeout 10000 | ||
fi; | ||
#!/bin/bash | ||
cd /home/ubuntu/rp-api | ||
sudo yarn | ||
|
||
sudo pm2 describe appname 2>&1 /dev/null | ||
RUNNING=$? | ||
|
||
|
||
if [ "${RUNNING}" -eq 0 ]; then | ||
sudo pm2 start build/app.js --name RP_API -i 2 --wait-ready --listen-timeout 10000 | ||
fi; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
cd /home/ubuntu/rp-api | ||
sudo pm2 reload RP_API | ||
#!/bin/bash | ||
cd /home/ubuntu/rp-api | ||
sudo pm2 reload RP_API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { Schema } from "mongoose"; | ||
import { z } from "zod"; | ||
|
||
// Zod schema for attendee | ||
export const AttendeeValidator = z.object({ | ||
userId: z.string(), | ||
name: z.string(), | ||
email: z.string().email(), | ||
events: z.array(z.string()).default([]), | ||
dietaryRestrictions: z.string().array(), | ||
allergies: z.string().array(), | ||
hasCheckedIn: z.boolean().default(false), | ||
points: z.number().min(0).default(0), | ||
foodWave: z.number().int().min(0).default(0), | ||
hasPriority: z | ||
.object({ | ||
Mon: z.boolean().default(false), | ||
Tue: z.boolean().default(false), | ||
Wed: z.boolean().default(false), | ||
Thu: z.boolean().default(false), | ||
Fri: z.boolean().default(false), | ||
Sat: z.boolean().default(false), | ||
Sun: z.boolean().default(false), | ||
}) | ||
.default({ | ||
Mon: false, | ||
Tue: false, | ||
Wed: false, | ||
Thu: false, | ||
Fri: false, | ||
Sat: false, | ||
Sun: false, | ||
}), | ||
}); | ||
|
||
// Mongoose schema for attendee | ||
export const AttendeeSchema = new Schema({ | ||
userId: { type: String, required: true, unique: true }, | ||
name: { type: String, required: true }, | ||
email: { type: String, required: true, unique: true }, | ||
events: [{ type: String, ref: "Event", default: [] }], | ||
dietaryRestrictions: { type: [String], required: true }, | ||
allergies: { type: [String], required: true }, | ||
hasCheckedIn: { type: Boolean, default: false }, | ||
points: { type: Number, default: 0 }, | ||
foodWave: { type: Number, default: 0 }, | ||
hasPriority: { | ||
type: new Schema( | ||
{ | ||
Mon: { type: Boolean, default: false }, | ||
Tue: { type: Boolean, default: false }, | ||
Wed: { type: Boolean, default: false }, | ||
Thu: { type: Boolean, default: false }, | ||
Fri: { type: Boolean, default: false }, | ||
Sat: { type: Boolean, default: false }, | ||
Sun: { type: Boolean, default: false }, | ||
}, | ||
{ _id: false } | ||
), | ||
default: { | ||
Mon: false, | ||
Tue: false, | ||
Wed: false, | ||
Thu: false, | ||
Fri: false, | ||
Sat: false, | ||
Sun: false, | ||
}, | ||
}, | ||
favorites: [{ type: String }], | ||
}); | ||
|
||
export const AttendeeAttendanceSchema = new Schema({ | ||
userId: { | ||
type: String, | ||
ref: "Attendee", | ||
required: true, | ||
}, | ||
eventsAttended: [{ type: String, ref: "Event", required: true }], | ||
}); | ||
|
||
export const AttendeeAttendanceValidator = z.object({ | ||
userId: z.string(), | ||
eventsAttended: z.array(z.string()), | ||
}); | ||
|
||
export const EventIdValidator = z.object({ | ||
eventId: z.string().uuid(), | ||
}); | ||
|
||
// Partial schema for attendee filter | ||
export const PartialAttendeeValidator = AttendeeValidator.partial(); |
File renamed without changes.
Oops, something went wrong.