customer/internal/models/history.go

39 lines
986 B
Go
Raw Normal View History

2023-05-23 10:52:27 +00:00
package models
import "time"
type History struct {
2023-06-15 12:31:34 +00:00
ID string `json:"id" bson:"_id,omitempty"`
UserID string `json:"userId" bson:"userId"`
Comment string `json:"comment" bson:"comment"`
Key string `json:"key" bson:"key"`
2023-09-10 14:54:41 +00:00
RawDetails any `json:"rawDetails" bson:"rawDetails"`
2023-06-15 12:45:38 +00:00
Deleted bool `json:"isDeleted" bson:"isDeleted"`
2023-06-15 12:31:34 +00:00
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-11-23 18:55:22 +00:00
type TariffID struct {
ID string `json:"id" bson:"_id"`
}
2023-06-15 12:45:38 +00:00
func (receiver *History) Sanitize() *History {
now := time.Now()
receiver.ID = ""
receiver.CreatedAt = now
receiver.UpdatedAt = now
receiver.DeletedAt = nil
receiver.Deleted = false
return receiver
}
2023-06-15 12:31:34 +00:00
type CustomerHistoryKey string
2023-05-23 10:52:27 +00:00
const (
2023-09-14 19:56:36 +00:00
CustomerHistoryKeyReplenish = "replenishWallet"
CustomerHistoryKeyPayCart = "payCart"
2023-05-23 10:52:27 +00:00
)