Files
Poll-system/app/internal/models/structs.go

181 lines
3.4 KiB
Go
Raw Normal View History

2025-08-26 14:13:09 -06:00
package models
import (
"time"
"github.com/golang-jwt/jwt/v5"
)
2025-08-27 13:21:11 -06:00
2025-08-26 14:13:09 -06:00
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
2025-08-27 13:21:11 -06:00
RoleID int
AdminCode string
2025-08-26 14:13:09 -06:00
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
2025-08-27 13:21:11 -06:00
Assigned bool // <-- add this
2025-08-26 14:13:09 -06:00
}
// =====================
// 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
}