sms

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnrecognized = errors.New("SMS is not a recognized bank credit message")

Functions

func ExtractReference

func ExtractReference(body string) string

func LooksLikeBankCredit

func LooksLikeBankCredit(body string) bool

func Parse

func Parse(body string) (domain.ParsedSMS, error)

Types

type Input

type Input struct {
	Source        string
	SourceEventID string
	Sender        string
	Body          string
	MessageTime   time.Time
	RawPayload    any
}

type Result

type Result struct {
	EventID      string `json:"eventId"`
	Status       string `json:"status"`
	Action       string `json:"action"`
	PaymentID    string `json:"paymentId,omitempty"`
	ReviewCaseID string `json:"reviewCaseId,omitempty"`
	Duplicate    bool   `json:"duplicate,omitempty"`
}

type ReviewInput

type ReviewInput struct {
	Kind                string
	Severity            string
	SMSEventID          string
	PaymentID           string
	CandidatePaymentIDs []string
	Reason              string
	OpenedAt            time.Time
}

type ReviewWriter

type ReviewWriter interface {
	OpenSMSReviewInApp(app core.App, input ReviewInput) (string, error)
}

type Service

type Service struct {
	App      core.App
	Payments *payments.Service
	Reviews  ReviewWriter
	Now      func() time.Time
}

func NewService

func NewService(app core.App, paymentService *payments.Service) *Service

func (*Service) Ingest

func (s *Service) Ingest(input Input) (Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL