Head of Product & Engineering a40a4aa626
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
feat: initial implementation of Cast GHL Provider
Complete MVP implementation of the Cast GHL Conversation Provider bridge:
- Go module setup with chi router and mongo-driver dependencies
- Config loading with env var validation and defaults
- MongoDB token store with upsert, get, update, delete operations
- Cast.ph SMS client with 429 retry logic and typed errors
- Phone number normalization (E.164 ↔ Philippine local format)
- GHL OAuth 2.0 install/callback/refresh flow
- GHL webhook handler with ECDSA signature verification (async dispatch)
- GHL API client for message status updates and inbound message stubs
- Multi-stage Dockerfile, docker-compose with MongoDB, Woodpecker CI pipeline
- Unit tests for phone normalization, Cast client, GHL webhook, and OAuth handlers

Co-Authored-By: SideKx <sidekx.ai@sds.dev>
2026-04-04 17:27:05 +02:00

26 lines
550 B
Go

package cast
import "fmt"
type SendRequest struct {
To string `json:"to"`
Message string `json:"message"`
SenderID string `json:"sender_id,omitempty"`
}
type SendResponse struct {
Success bool `json:"success"`
MessageID string `json:"message_id,omitempty"`
Parts int `json:"parts,omitempty"`
Error string `json:"error,omitempty"`
}
type CastAPIError struct {
StatusCode int
APIError string
}
func (e *CastAPIError) Error() string {
return fmt.Sprintf("cast api error (HTTP %d): %s", e.StatusCode, e.APIError)
}