customer/internal/models/history.go

39 lines
2.0 KiB
Go
Raw Normal View History

2023-05-23 10:52:27 +00:00
package models
import "time"
2023-06-13 22:19:42 +00:00
// TODO: обновить модель истории.
2023-06-13 22:20:40 +00:00
2023-05-23 10:52:27 +00:00
type History struct {
2023-05-23 15:24:52 +00:00
ID string `json:"id" bson:"_id,omitempty"`
UserID string `json:"userId" bson:"userId"`
Comment string `json:"comment" bson:"comment"`
Type HistoryType `json:"type" bson:"type"`
RawDetails string `json:"rawDetails" bson:"rawDetails"`
BuyCartDetails *BuyCartDetails `json:"buyCartDetails,omitempty" bson:"buyCartDetails,omitempty"`
DeclinedPaymentDetails *DeclinedPaymentDetails `json:"declinedPaymentDetails,omitempty" bson:"declinedPaymentDetails,omitempty"`
SubsriptionEndDetails *SubsriptionEndDetails `json:"subsriptionEndDetails,omitempty" bson:"subsriptionEndDetails,omitempty"`
SuccessfulPaymentDetails *SuccessfulPaymentDetails `json:"successfulPaymentDetails,omitempty" bson:"successfulPaymentDetails,omitempty"`
TimeoutPaymentDetails *TimeoutPaymentDetails `json:"timeoutPaymentDetails,omitempty" bson:"timeoutPaymentDetails,omitempty"`
Deleted bool `json:"deleted" bson:"deleted"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
2023-05-23 10:52:27 +00:00
}
2023-05-23 15:24:52 +00:00
type BuyCartDetails struct{}
type DeclinedPaymentDetails struct{}
type SubsriptionEndDetails struct{}
type SuccessfulPaymentDetails struct{}
type TimeoutPaymentDetails struct{}
2023-05-23 10:52:27 +00:00
type HistoryType string
const (
2023-06-13 19:20:11 +00:00
HistoryTypeBuyCart HistoryType = "buyCart"
HistoryTypeDeclinedPayment HistoryType = "declinedPayment"
HistoryTypeSubsriptionEnd HistoryType = "subsriptionEnd"
HistoryTypeSuccessfulPayment HistoryType = "successfulPayment"
HistoryTypeTimeoutPayment HistoryType = "timeoutPayment"
2023-05-23 10:52:27 +00:00
)