Complete rewrite of Django REST API to Go with: - Gin web framework for HTTP routing - GORM for database operations - GoAdmin for admin panel - Gorush integration for push notifications - Redis for caching and job queues Features implemented: - User authentication (login, register, logout, password reset) - Residence management (CRUD, sharing, share codes) - Task management (CRUD, kanban board, completions) - Contractor management (CRUD, specialties) - Document management (CRUD, warranties) - Notifications (preferences, push notifications) - Subscription management (tiers, limits) Infrastructure: - Docker Compose for local development - Database migrations and seed data - Admin panel for data management 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.8 KiB
Go
37 lines
1.8 KiB
Go
package requests
|
|
|
|
// CreateContractorRequest represents the request to create a contractor
|
|
type CreateContractorRequest struct {
|
|
ResidenceID uint `json:"residence_id" binding:"required"`
|
|
Name string `json:"name" binding:"required,min=1,max=200"`
|
|
Company string `json:"company" binding:"max=200"`
|
|
Phone string `json:"phone" binding:"max=20"`
|
|
Email string `json:"email" binding:"omitempty,email,max=254"`
|
|
Website string `json:"website" binding:"max=200"`
|
|
Notes string `json:"notes"`
|
|
StreetAddress string `json:"street_address" binding:"max=255"`
|
|
City string `json:"city" binding:"max=100"`
|
|
StateProvince string `json:"state_province" binding:"max=100"`
|
|
PostalCode string `json:"postal_code" binding:"max=20"`
|
|
SpecialtyIDs []uint `json:"specialty_ids"`
|
|
Rating *float64 `json:"rating"`
|
|
IsFavorite *bool `json:"is_favorite"`
|
|
}
|
|
|
|
// UpdateContractorRequest represents the request to update a contractor
|
|
type UpdateContractorRequest struct {
|
|
Name *string `json:"name" binding:"omitempty,min=1,max=200"`
|
|
Company *string `json:"company" binding:"omitempty,max=200"`
|
|
Phone *string `json:"phone" binding:"omitempty,max=20"`
|
|
Email *string `json:"email" binding:"omitempty,email,max=254"`
|
|
Website *string `json:"website" binding:"omitempty,max=200"`
|
|
Notes *string `json:"notes"`
|
|
StreetAddress *string `json:"street_address" binding:"omitempty,max=255"`
|
|
City *string `json:"city" binding:"omitempty,max=100"`
|
|
StateProvince *string `json:"state_province" binding:"omitempty,max=100"`
|
|
PostalCode *string `json:"postal_code" binding:"omitempty,max=20"`
|
|
SpecialtyIDs []uint `json:"specialty_ids"`
|
|
Rating *float64 `json:"rating"`
|
|
IsFavorite *bool `json:"is_favorite"`
|
|
}
|