mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* Adds the main Property System Architecture components This change adds the necessary migrations for the Property Groups, Fields and Values tables to be created, the store layer and a Property Service that can be used from the app layer. * Update property field type to use user instead of person * Update PropertyFields to allow for unique nondeleted fields and remove redundant indexes * Update PropertyValues to allow for unique nondeleted fields and remove redundant indexes * Use StringMap instead of the map[string]any on property fields * Add i18n strings * Revert "Use StringMap instead of the map[string]any on property fields" This reverts commit15c23544b6. * Cast JSON binary data to string and add todo note for StringMap use * Add mocks to the retrylayer tests * Cast JSON binary data to string in property value store * Check for binary parameter instead of casting to string for JSON data * Check property field type is one of the allowed ones * Avoid reusing err variable to be explicit about the returned value * Merge Property System Migrations into one file * Adds NOT NULL to timestamps at the DB level * Update stores to use tableSelectQuery instead of a slice var * Update PropertyField model translations to be more explicit and avoid repetition * Update PropertyValue model translations to be more explicit and avoid repetition * Use ExecBuilder instead of ToSql&Exec * Update property field errors to add context * Ensure PerPage is greater than zero * Update store errors to give more context * Use ExecBuilder in the property stores where possible * Add an on conflict suffix to the group register to avoid race conditions * Remove badly used translation string * Remove unused get in register group method --------- Co-authored-by: Mattermost Build <[email protected]> (cherry picked from commit25439fc8e3) Co-authored-by: Miguel de la Cruz <[email protected]>
90 lines
2.1 KiB
Go
90 lines
2.1 KiB
Go
// Code generated by mockery v2.42.2. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make store-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// PropertyGroupStore is an autogenerated mock type for the PropertyGroupStore type
|
|
type PropertyGroupStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Get provides a mock function with given fields: name
|
|
func (_m *PropertyGroupStore) Get(name string) (*model.PropertyGroup, error) {
|
|
ret := _m.Called(name)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 *model.PropertyGroup
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*model.PropertyGroup, error)); ok {
|
|
return rf(name)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *model.PropertyGroup); ok {
|
|
r0 = rf(name)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.PropertyGroup)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(name)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Register provides a mock function with given fields: name
|
|
func (_m *PropertyGroupStore) Register(name string) (*model.PropertyGroup, error) {
|
|
ret := _m.Called(name)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Register")
|
|
}
|
|
|
|
var r0 *model.PropertyGroup
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*model.PropertyGroup, error)); ok {
|
|
return rf(name)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *model.PropertyGroup); ok {
|
|
r0 = rf(name)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.PropertyGroup)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(name)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewPropertyGroupStore creates a new instance of PropertyGroupStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewPropertyGroupStore(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *PropertyGroupStore {
|
|
mock := &PropertyGroupStore{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|