This involves a lot of copy-pasta of code from the previous version of this logic in another code base. It'll need to be cleaned up, but for now I need something sooner rather than later.
2228 lines
63 KiB
Go
2228 lines
63 KiB
Go
// Code generated by BobGen psql v0.41.1. DO NOT EDIT.
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
package factory
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
models "github.com/Gleipnir-Technology/nidus-sync/models"
|
|
"github.com/aarondl/opt/null"
|
|
"github.com/aarondl/opt/omit"
|
|
"github.com/aarondl/opt/omitnull"
|
|
"github.com/jaswdr/faker/v2"
|
|
"github.com/stephenafamo/bob"
|
|
)
|
|
|
|
type FSTimecardMod interface {
|
|
Apply(context.Context, *FSTimecardTemplate)
|
|
}
|
|
|
|
type FSTimecardModFunc func(context.Context, *FSTimecardTemplate)
|
|
|
|
func (f FSTimecardModFunc) Apply(ctx context.Context, n *FSTimecardTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type FSTimecardModSlice []FSTimecardMod
|
|
|
|
func (mods FSTimecardModSlice) Apply(ctx context.Context, n *FSTimecardTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// FSTimecardTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type FSTimecardTemplate struct {
|
|
OrganizationID func() null.Val[int32]
|
|
Activity func() null.Val[string]
|
|
Comments func() null.Val[string]
|
|
Creationdate func() null.Val[int64]
|
|
Creator func() null.Val[string]
|
|
Enddatetime func() null.Val[int64]
|
|
Equiptype func() null.Val[string]
|
|
Externalid func() null.Val[string]
|
|
Editdate func() null.Val[int64]
|
|
Editor func() null.Val[string]
|
|
Fieldtech func() null.Val[string]
|
|
Globalid func() null.Val[string]
|
|
Lclocid func() null.Val[string]
|
|
Linelocid func() null.Val[string]
|
|
Locationname func() null.Val[string]
|
|
Objectid func() int32
|
|
Pointlocid func() null.Val[string]
|
|
Polygonlocid func() null.Val[string]
|
|
Samplelocid func() null.Val[string]
|
|
Srid func() null.Val[string]
|
|
Startdatetime func() null.Val[int64]
|
|
Traplocid func() null.Val[string]
|
|
Zone func() null.Val[string]
|
|
Zone2 func() null.Val[string]
|
|
CreatedDate func() null.Val[int64]
|
|
CreatedUser func() null.Val[string]
|
|
GeometryX func() null.Val[float64]
|
|
GeometryY func() null.Val[float64]
|
|
LastEditedDate func() null.Val[int64]
|
|
LastEditedUser func() null.Val[string]
|
|
Rodentlocid func() null.Val[string]
|
|
Updated func() time.Time
|
|
|
|
r fsTimecardR
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
type fsTimecardR struct {
|
|
Organization *fsTimecardROrganizationR
|
|
}
|
|
|
|
type fsTimecardROrganizationR struct {
|
|
o *OrganizationTemplate
|
|
}
|
|
|
|
// Apply mods to the FSTimecardTemplate
|
|
func (o *FSTimecardTemplate) Apply(ctx context.Context, mods ...FSTimecardMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.FSTimecard
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t FSTimecardTemplate) setModelRels(o *models.FSTimecard) {
|
|
if t.r.Organization != nil {
|
|
rel := t.r.Organization.o.Build()
|
|
rel.R.FSTimecards = append(rel.R.FSTimecards, o)
|
|
o.OrganizationID = null.From(rel.ID) // h2
|
|
o.R.Organization = rel
|
|
}
|
|
}
|
|
|
|
// BuildSetter returns an *models.FSTimecardSetter
|
|
// this does nothing with the relationship templates
|
|
func (o FSTimecardTemplate) BuildSetter() *models.FSTimecardSetter {
|
|
m := &models.FSTimecardSetter{}
|
|
|
|
if o.OrganizationID != nil {
|
|
val := o.OrganizationID()
|
|
m.OrganizationID = omitnull.FromNull(val)
|
|
}
|
|
if o.Activity != nil {
|
|
val := o.Activity()
|
|
m.Activity = omitnull.FromNull(val)
|
|
}
|
|
if o.Comments != nil {
|
|
val := o.Comments()
|
|
m.Comments = omitnull.FromNull(val)
|
|
}
|
|
if o.Creationdate != nil {
|
|
val := o.Creationdate()
|
|
m.Creationdate = omitnull.FromNull(val)
|
|
}
|
|
if o.Creator != nil {
|
|
val := o.Creator()
|
|
m.Creator = omitnull.FromNull(val)
|
|
}
|
|
if o.Enddatetime != nil {
|
|
val := o.Enddatetime()
|
|
m.Enddatetime = omitnull.FromNull(val)
|
|
}
|
|
if o.Equiptype != nil {
|
|
val := o.Equiptype()
|
|
m.Equiptype = omitnull.FromNull(val)
|
|
}
|
|
if o.Externalid != nil {
|
|
val := o.Externalid()
|
|
m.Externalid = omitnull.FromNull(val)
|
|
}
|
|
if o.Editdate != nil {
|
|
val := o.Editdate()
|
|
m.Editdate = omitnull.FromNull(val)
|
|
}
|
|
if o.Editor != nil {
|
|
val := o.Editor()
|
|
m.Editor = omitnull.FromNull(val)
|
|
}
|
|
if o.Fieldtech != nil {
|
|
val := o.Fieldtech()
|
|
m.Fieldtech = omitnull.FromNull(val)
|
|
}
|
|
if o.Globalid != nil {
|
|
val := o.Globalid()
|
|
m.Globalid = omitnull.FromNull(val)
|
|
}
|
|
if o.Lclocid != nil {
|
|
val := o.Lclocid()
|
|
m.Lclocid = omitnull.FromNull(val)
|
|
}
|
|
if o.Linelocid != nil {
|
|
val := o.Linelocid()
|
|
m.Linelocid = omitnull.FromNull(val)
|
|
}
|
|
if o.Locationname != nil {
|
|
val := o.Locationname()
|
|
m.Locationname = omitnull.FromNull(val)
|
|
}
|
|
if o.Objectid != nil {
|
|
val := o.Objectid()
|
|
m.Objectid = omit.From(val)
|
|
}
|
|
if o.Pointlocid != nil {
|
|
val := o.Pointlocid()
|
|
m.Pointlocid = omitnull.FromNull(val)
|
|
}
|
|
if o.Polygonlocid != nil {
|
|
val := o.Polygonlocid()
|
|
m.Polygonlocid = omitnull.FromNull(val)
|
|
}
|
|
if o.Samplelocid != nil {
|
|
val := o.Samplelocid()
|
|
m.Samplelocid = omitnull.FromNull(val)
|
|
}
|
|
if o.Srid != nil {
|
|
val := o.Srid()
|
|
m.Srid = omitnull.FromNull(val)
|
|
}
|
|
if o.Startdatetime != nil {
|
|
val := o.Startdatetime()
|
|
m.Startdatetime = omitnull.FromNull(val)
|
|
}
|
|
if o.Traplocid != nil {
|
|
val := o.Traplocid()
|
|
m.Traplocid = omitnull.FromNull(val)
|
|
}
|
|
if o.Zone != nil {
|
|
val := o.Zone()
|
|
m.Zone = omitnull.FromNull(val)
|
|
}
|
|
if o.Zone2 != nil {
|
|
val := o.Zone2()
|
|
m.Zone2 = omitnull.FromNull(val)
|
|
}
|
|
if o.CreatedDate != nil {
|
|
val := o.CreatedDate()
|
|
m.CreatedDate = omitnull.FromNull(val)
|
|
}
|
|
if o.CreatedUser != nil {
|
|
val := o.CreatedUser()
|
|
m.CreatedUser = omitnull.FromNull(val)
|
|
}
|
|
if o.GeometryX != nil {
|
|
val := o.GeometryX()
|
|
m.GeometryX = omitnull.FromNull(val)
|
|
}
|
|
if o.GeometryY != nil {
|
|
val := o.GeometryY()
|
|
m.GeometryY = omitnull.FromNull(val)
|
|
}
|
|
if o.LastEditedDate != nil {
|
|
val := o.LastEditedDate()
|
|
m.LastEditedDate = omitnull.FromNull(val)
|
|
}
|
|
if o.LastEditedUser != nil {
|
|
val := o.LastEditedUser()
|
|
m.LastEditedUser = omitnull.FromNull(val)
|
|
}
|
|
if o.Rodentlocid != nil {
|
|
val := o.Rodentlocid()
|
|
m.Rodentlocid = omitnull.FromNull(val)
|
|
}
|
|
if o.Updated != nil {
|
|
val := o.Updated()
|
|
m.Updated = omit.From(val)
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildManySetter returns an []*models.FSTimecardSetter
|
|
// this does nothing with the relationship templates
|
|
func (o FSTimecardTemplate) BuildManySetter(number int) []*models.FSTimecardSetter {
|
|
m := make([]*models.FSTimecardSetter, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.BuildSetter()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// Build returns an *models.FSTimecard
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use FSTimecardTemplate.Create
|
|
func (o FSTimecardTemplate) Build() *models.FSTimecard {
|
|
m := &models.FSTimecard{}
|
|
|
|
if o.OrganizationID != nil {
|
|
m.OrganizationID = o.OrganizationID()
|
|
}
|
|
if o.Activity != nil {
|
|
m.Activity = o.Activity()
|
|
}
|
|
if o.Comments != nil {
|
|
m.Comments = o.Comments()
|
|
}
|
|
if o.Creationdate != nil {
|
|
m.Creationdate = o.Creationdate()
|
|
}
|
|
if o.Creator != nil {
|
|
m.Creator = o.Creator()
|
|
}
|
|
if o.Enddatetime != nil {
|
|
m.Enddatetime = o.Enddatetime()
|
|
}
|
|
if o.Equiptype != nil {
|
|
m.Equiptype = o.Equiptype()
|
|
}
|
|
if o.Externalid != nil {
|
|
m.Externalid = o.Externalid()
|
|
}
|
|
if o.Editdate != nil {
|
|
m.Editdate = o.Editdate()
|
|
}
|
|
if o.Editor != nil {
|
|
m.Editor = o.Editor()
|
|
}
|
|
if o.Fieldtech != nil {
|
|
m.Fieldtech = o.Fieldtech()
|
|
}
|
|
if o.Globalid != nil {
|
|
m.Globalid = o.Globalid()
|
|
}
|
|
if o.Lclocid != nil {
|
|
m.Lclocid = o.Lclocid()
|
|
}
|
|
if o.Linelocid != nil {
|
|
m.Linelocid = o.Linelocid()
|
|
}
|
|
if o.Locationname != nil {
|
|
m.Locationname = o.Locationname()
|
|
}
|
|
if o.Objectid != nil {
|
|
m.Objectid = o.Objectid()
|
|
}
|
|
if o.Pointlocid != nil {
|
|
m.Pointlocid = o.Pointlocid()
|
|
}
|
|
if o.Polygonlocid != nil {
|
|
m.Polygonlocid = o.Polygonlocid()
|
|
}
|
|
if o.Samplelocid != nil {
|
|
m.Samplelocid = o.Samplelocid()
|
|
}
|
|
if o.Srid != nil {
|
|
m.Srid = o.Srid()
|
|
}
|
|
if o.Startdatetime != nil {
|
|
m.Startdatetime = o.Startdatetime()
|
|
}
|
|
if o.Traplocid != nil {
|
|
m.Traplocid = o.Traplocid()
|
|
}
|
|
if o.Zone != nil {
|
|
m.Zone = o.Zone()
|
|
}
|
|
if o.Zone2 != nil {
|
|
m.Zone2 = o.Zone2()
|
|
}
|
|
if o.CreatedDate != nil {
|
|
m.CreatedDate = o.CreatedDate()
|
|
}
|
|
if o.CreatedUser != nil {
|
|
m.CreatedUser = o.CreatedUser()
|
|
}
|
|
if o.GeometryX != nil {
|
|
m.GeometryX = o.GeometryX()
|
|
}
|
|
if o.GeometryY != nil {
|
|
m.GeometryY = o.GeometryY()
|
|
}
|
|
if o.LastEditedDate != nil {
|
|
m.LastEditedDate = o.LastEditedDate()
|
|
}
|
|
if o.LastEditedUser != nil {
|
|
m.LastEditedUser = o.LastEditedUser()
|
|
}
|
|
if o.Rodentlocid != nil {
|
|
m.Rodentlocid = o.Rodentlocid()
|
|
}
|
|
if o.Updated != nil {
|
|
m.Updated = o.Updated()
|
|
}
|
|
|
|
o.setModelRels(m)
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildMany returns an models.FSTimecardSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use FSTimecardTemplate.CreateMany
|
|
func (o FSTimecardTemplate) BuildMany(number int) models.FSTimecardSlice {
|
|
m := make(models.FSTimecardSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func ensureCreatableFSTimecard(m *models.FSTimecardSetter) {
|
|
if !(m.Objectid.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.Objectid = omit.From(val)
|
|
}
|
|
}
|
|
|
|
// insertOptRels creates and inserts any optional the relationships on *models.FSTimecard
|
|
// according to the relationships in the template.
|
|
// any required relationship should have already exist on the model
|
|
func (o *FSTimecardTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FSTimecard) error {
|
|
var err error
|
|
|
|
isOrganizationDone, _ := fsTimecardRelOrganizationCtx.Value(ctx)
|
|
if !isOrganizationDone && o.r.Organization != nil {
|
|
ctx = fsTimecardRelOrganizationCtx.WithValue(ctx, true)
|
|
if o.r.Organization.o.alreadyPersisted {
|
|
m.R.Organization = o.r.Organization.o.Build()
|
|
} else {
|
|
var rel0 *models.Organization
|
|
rel0, err = o.r.Organization.o.Create(ctx, exec)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = m.AttachOrganization(ctx, exec, rel0)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
// Create builds a fsTimecard and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o *FSTimecardTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FSTimecard, error) {
|
|
var err error
|
|
opt := o.BuildSetter()
|
|
ensureCreatableFSTimecard(opt)
|
|
|
|
m, err := models.FSTimecards.Insert(opt).One(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if err := o.insertOptRels(ctx, exec, m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, err
|
|
}
|
|
|
|
// MustCreate builds a fsTimecard and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o *FSTimecardTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FSTimecard {
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateOrFail builds a fsTimecard and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
|
|
func (o *FSTimecardTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FSTimecard {
|
|
tb.Helper()
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateMany builds multiple fsTimecards and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o FSTimecardTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FSTimecardSlice, error) {
|
|
var err error
|
|
m := make(models.FSTimecardSlice, number)
|
|
|
|
for i := range m {
|
|
m[i], err = o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
return m, nil
|
|
}
|
|
|
|
// MustCreateMany builds multiple fsTimecards and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o FSTimecardTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FSTimecardSlice {
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateManyOrFail builds multiple fsTimecards and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
|
|
func (o FSTimecardTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FSTimecardSlice {
|
|
tb.Helper()
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// FSTimecard has methods that act as mods for the FSTimecardTemplate
|
|
var FSTimecardMods fsTimecardMods
|
|
|
|
type fsTimecardMods struct{}
|
|
|
|
func (m fsTimecardMods) RandomizeAllColumns(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModSlice{
|
|
FSTimecardMods.RandomOrganizationID(f),
|
|
FSTimecardMods.RandomActivity(f),
|
|
FSTimecardMods.RandomComments(f),
|
|
FSTimecardMods.RandomCreationdate(f),
|
|
FSTimecardMods.RandomCreator(f),
|
|
FSTimecardMods.RandomEnddatetime(f),
|
|
FSTimecardMods.RandomEquiptype(f),
|
|
FSTimecardMods.RandomExternalid(f),
|
|
FSTimecardMods.RandomEditdate(f),
|
|
FSTimecardMods.RandomEditor(f),
|
|
FSTimecardMods.RandomFieldtech(f),
|
|
FSTimecardMods.RandomGlobalid(f),
|
|
FSTimecardMods.RandomLclocid(f),
|
|
FSTimecardMods.RandomLinelocid(f),
|
|
FSTimecardMods.RandomLocationname(f),
|
|
FSTimecardMods.RandomObjectid(f),
|
|
FSTimecardMods.RandomPointlocid(f),
|
|
FSTimecardMods.RandomPolygonlocid(f),
|
|
FSTimecardMods.RandomSamplelocid(f),
|
|
FSTimecardMods.RandomSrid(f),
|
|
FSTimecardMods.RandomStartdatetime(f),
|
|
FSTimecardMods.RandomTraplocid(f),
|
|
FSTimecardMods.RandomZone(f),
|
|
FSTimecardMods.RandomZone2(f),
|
|
FSTimecardMods.RandomCreatedDate(f),
|
|
FSTimecardMods.RandomCreatedUser(f),
|
|
FSTimecardMods.RandomGeometryX(f),
|
|
FSTimecardMods.RandomGeometryY(f),
|
|
FSTimecardMods.RandomLastEditedDate(f),
|
|
FSTimecardMods.RandomLastEditedUser(f),
|
|
FSTimecardMods.RandomRodentlocid(f),
|
|
FSTimecardMods.RandomUpdated(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) OrganizationID(val null.Val[int32]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.OrganizationID = func() null.Val[int32] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) OrganizationIDFunc(f func() null.Val[int32]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.OrganizationID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetOrganizationID() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.OrganizationID = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomOrganizationID(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.OrganizationID = func() null.Val[int32] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int32(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomOrganizationIDNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.OrganizationID = func() null.Val[int32] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int32(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Activity(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Activity = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) ActivityFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Activity = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetActivity() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Activity = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomActivity(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Activity = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomActivityNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Activity = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Comments(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Comments = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) CommentsFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Comments = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetComments() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Comments = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomComments(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Comments = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomCommentsNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Comments = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Creationdate(val null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) CreationdateFunc(f func() null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creationdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetCreationdate() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creationdate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomCreationdate(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creationdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomCreationdateNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creationdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Creator(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creator = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) CreatorFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creator = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetCreator() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creator = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomCreator(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creator = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomCreatorNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Creator = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Enddatetime(val null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Enddatetime = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) EnddatetimeFunc(f func() null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Enddatetime = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetEnddatetime() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Enddatetime = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomEnddatetime(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Enddatetime = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomEnddatetimeNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Enddatetime = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Equiptype(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Equiptype = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) EquiptypeFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Equiptype = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetEquiptype() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Equiptype = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomEquiptype(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Equiptype = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomEquiptypeNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Equiptype = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Externalid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Externalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) ExternalidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Externalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetExternalid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Externalid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomExternalid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Externalid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomExternalidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Externalid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Editdate(val null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) EditdateFunc(f func() null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetEditdate() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editdate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomEditdate(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomEditdateNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Editor(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editor = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) EditorFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editor = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetEditor() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editor = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomEditor(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editor = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomEditorNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Editor = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Fieldtech(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Fieldtech = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) FieldtechFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Fieldtech = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetFieldtech() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Fieldtech = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomFieldtech(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Fieldtech = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomFieldtechNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Fieldtech = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Globalid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Globalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) GlobalidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Globalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetGlobalid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Globalid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomGlobalid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Globalid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomGlobalidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Globalid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Lclocid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Lclocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) LclocidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Lclocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetLclocid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Lclocid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomLclocid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Lclocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomLclocidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Lclocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Linelocid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Linelocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) LinelocidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Linelocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetLinelocid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Linelocid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomLinelocid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Linelocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomLinelocidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Linelocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Locationname(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Locationname = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) LocationnameFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Locationname = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetLocationname() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Locationname = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomLocationname(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Locationname = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomLocationnameNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Locationname = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Objectid(val int32) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Objectid = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) ObjectidFunc(f func() int32) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Objectid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetObjectid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Objectid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m fsTimecardMods) RandomObjectid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Objectid = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Pointlocid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Pointlocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) PointlocidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Pointlocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetPointlocid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Pointlocid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomPointlocid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Pointlocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomPointlocidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Pointlocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Polygonlocid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Polygonlocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) PolygonlocidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Polygonlocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetPolygonlocid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Polygonlocid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomPolygonlocid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Polygonlocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomPolygonlocidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Polygonlocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Samplelocid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Samplelocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) SamplelocidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Samplelocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetSamplelocid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Samplelocid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomSamplelocid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Samplelocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomSamplelocidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Samplelocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Srid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Srid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) SridFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Srid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetSrid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Srid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomSrid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Srid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomSridNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Srid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Startdatetime(val null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Startdatetime = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) StartdatetimeFunc(f func() null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Startdatetime = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetStartdatetime() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Startdatetime = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomStartdatetime(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Startdatetime = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomStartdatetimeNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Startdatetime = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Traplocid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Traplocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) TraplocidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Traplocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetTraplocid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Traplocid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomTraplocid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Traplocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomTraplocidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Traplocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Zone(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) ZoneFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetZone() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomZone(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomZoneNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Zone2(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone2 = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) Zone2Func(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone2 = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetZone2() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone2 = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomZone2(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone2 = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomZone2NotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Zone2 = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) CreatedDate(val null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) CreatedDateFunc(f func() null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetCreatedDate() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedDate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomCreatedDate(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomCreatedDateNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) CreatedUser(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) CreatedUserFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetCreatedUser() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedUser = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomCreatedUser(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomCreatedUserNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.CreatedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) GeometryX(val null.Val[float64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) GeometryXFunc(f func() null.Val[float64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetGeometryX() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryX = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomGeometryX(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryX = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomGeometryXNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryX = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) GeometryY(val null.Val[float64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) GeometryYFunc(f func() null.Val[float64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetGeometryY() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryY = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomGeometryY(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryY = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomGeometryYNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.GeometryY = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) LastEditedDate(val null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) LastEditedDateFunc(f func() null.Val[int64]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetLastEditedDate() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedDate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomLastEditedDate(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomLastEditedDateNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) LastEditedUser(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) LastEditedUserFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetLastEditedUser() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedUser = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomLastEditedUser(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomLastEditedUserNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Rodentlocid(val null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Rodentlocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) RodentlocidFunc(f func() null.Val[string]) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Rodentlocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetRodentlocid() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Rodentlocid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m fsTimecardMods) RandomRodentlocid(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Rodentlocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m fsTimecardMods) RandomRodentlocidNotNull(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Rodentlocid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m fsTimecardMods) Updated(val time.Time) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Updated = func() time.Time { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m fsTimecardMods) UpdatedFunc(f func() time.Time) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Updated = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m fsTimecardMods) UnsetUpdated() FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Updated = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m fsTimecardMods) RandomUpdated(f *faker.Faker) FSTimecardMod {
|
|
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
|
|
o.Updated = func() time.Time {
|
|
return random_time_Time(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m fsTimecardMods) WithParentsCascading() FSTimecardMod {
|
|
return FSTimecardModFunc(func(ctx context.Context, o *FSTimecardTemplate) {
|
|
if isDone, _ := fsTimecardWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = fsTimecardWithParentsCascadingCtx.WithValue(ctx, true)
|
|
{
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m fsTimecardMods) WithOrganization(rel *OrganizationTemplate) FSTimecardMod {
|
|
return FSTimecardModFunc(func(ctx context.Context, o *FSTimecardTemplate) {
|
|
o.r.Organization = &fsTimecardROrganizationR{
|
|
o: rel,
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m fsTimecardMods) WithNewOrganization(mods ...OrganizationMod) FSTimecardMod {
|
|
return FSTimecardModFunc(func(ctx context.Context, o *FSTimecardTemplate) {
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m fsTimecardMods) WithExistingOrganization(em *models.Organization) FSTimecardMod {
|
|
return FSTimecardModFunc(func(ctx context.Context, o *FSTimecardTemplate) {
|
|
o.r.Organization = &fsTimecardROrganizationR{
|
|
o: o.f.FromExistingOrganization(em),
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m fsTimecardMods) WithoutOrganization() FSTimecardMod {
|
|
return FSTimecardModFunc(func(ctx context.Context, o *FSTimecardTemplate) {
|
|
o.r.Organization = nil
|
|
})
|
|
}
|