generated from PenaSide/GolangTemplate
26 lines
592 B
Go
26 lines
592 B
Go
package dto
|
|
|
|
import (
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields"
|
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/bsontools"
|
|
)
|
|
|
|
type GetHistories struct {
|
|
Pagination *models.Pagination
|
|
Type *string
|
|
}
|
|
|
|
func (receiver *GetHistories) BSON() bson.M {
|
|
query := bson.M{
|
|
fields.History.IsDeleted: false,
|
|
}
|
|
|
|
if receiver.Type != nil {
|
|
query[fields.History.Type] = bsontools.BuildCaseInsensitiveRegex(*receiver.Type)
|
|
}
|
|
|
|
return query
|
|
}
|