this push will conclude the majority of pulls. this repos will now, not be actively be managed or any further code pushes will not be frequent.
181 lines
3.1 KiB
Go
181 lines
3.1 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/golang-jwt/jwt/v5"
|
|
)
|
|
|
|
|
|
|
|
type Claims struct {
|
|
UserID int
|
|
Role int
|
|
jwt.RegisteredClaims
|
|
}
|
|
|
|
type TokenResponse struct {
|
|
Token string
|
|
User User
|
|
}
|
|
|
|
type ErrorResponse struct {
|
|
Error string
|
|
Details []string
|
|
}
|
|
|
|
type Role struct {
|
|
RoleID int
|
|
Name string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type User struct {
|
|
UserID int
|
|
FirstName string
|
|
LastName string
|
|
Email string
|
|
Phone string
|
|
Password string
|
|
RoleID int
|
|
AdminCode *string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type UserAddress struct {
|
|
UserID int
|
|
AddressLine1 string
|
|
AddressLine2 string
|
|
City string
|
|
Province string
|
|
Country string
|
|
PostalCode string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
// =====================
|
|
// Address Database
|
|
// =====================
|
|
|
|
type AddressDatabase struct {
|
|
AddressID int
|
|
Address string
|
|
StreetName string
|
|
StreetType string
|
|
StreetQuadrant string
|
|
HouseNumber string
|
|
HouseAlpha *string
|
|
Longitude float64
|
|
Latitude float64
|
|
VisitedValidated bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
Assigned bool // <-- add this
|
|
|
|
}
|
|
|
|
// =====================
|
|
// Teams & Assignments
|
|
// =====================
|
|
|
|
|
|
type Team struct {
|
|
TeamID int
|
|
TeamLeadID int
|
|
VolunteerID int
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type AdminVolunteer struct {
|
|
AdminID int
|
|
VolunteerID int
|
|
IsActive bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type Appointment struct {
|
|
SchedID int
|
|
UserID int
|
|
AddressID int
|
|
AppointmentDate time.Time
|
|
AppointmentTime time.Time
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
// =====================
|
|
// Polls & Responses
|
|
// =====================
|
|
|
|
type Poll struct {
|
|
PollID int
|
|
AddressID int
|
|
UserID int
|
|
ResponseURL string
|
|
AmountDonated float64
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type PollResponse struct {
|
|
ResponseID int
|
|
PollID int
|
|
Signage bool
|
|
VotingChoice string
|
|
DonationAmount float64
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
// =====================
|
|
// Updates & Reactions
|
|
// =====================
|
|
|
|
type Post struct {
|
|
PostID int
|
|
AuthorID int
|
|
AuthorName string // for display
|
|
Content string
|
|
ImageURL string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
|
|
type Reaction struct {
|
|
ReactionID int
|
|
PostID int
|
|
UserID int
|
|
ReactionType string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
// =====================
|
|
// Volunteer Availability
|
|
// =====================
|
|
|
|
type Availability struct {
|
|
AvailabilityID int
|
|
UserID int
|
|
DayOfWeek string
|
|
StartTime time.Time
|
|
EndTime time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
// =====================
|
|
// Chat Links
|
|
// =====================
|
|
|
|
type ChatLink struct {
|
|
ChatID int
|
|
Platform string
|
|
URL string
|
|
UserID *int
|
|
TeamID *int
|
|
CreatedAt time.Time
|
|
}
|