SimpleCloudNotifier/scnserver/models/delivery.go
Mike Schwörer 7ddaf5d9aa
All checks were successful
Build Docker and Deploy / Build Docker Container (push) Successful in 1m46s
Build Docker and Deploy / Deploy to Server (push) Successful in 6s
Migrate deliveries.next_delivery from type:string to type:int (SCNTime)
2024-09-16 18:26:28 +02:00

27 lines
1.1 KiB
Go

package models
type DeliveryStatus string //@enum:type
const (
DeliveryStatusRetry DeliveryStatus = "RETRY"
DeliveryStatusSuccess DeliveryStatus = "SUCCESS"
DeliveryStatusFailed DeliveryStatus = "FAILED"
)
type Delivery struct {
DeliveryID DeliveryID `db:"delivery_id" json:"delivery_id"`
MessageID MessageID `db:"message_id" json:"message_id"`
ReceiverUserID UserID `db:"receiver_user_id" json:"receiver_user_id"`
ReceiverClientID ClientID `db:"receiver_client_id" json:"receiver_client_id"`
TimestampCreated SCNTime `db:"timestamp_created" json:"timestamp_created"`
TimestampFinalized *SCNTime `db:"timestamp_finalized" json:"timestamp_finalized"`
Status DeliveryStatus `db:"status" json:"status"`
RetryCount int `db:"retry_count" json:"retry_count"`
NextDelivery *SCNTime `db:"next_delivery" json:"next_delivery"`
FCMMessageID *string `db:"fcm_message_id" json:"fcm_message_id"`
}
func (d Delivery) MaxRetryCount() int {
return 5
}