We need the org ID so that we can avoid bleedover between different organizations.
2276 lines
68 KiB
Go
2276 lines
68 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 HistoryTimecardMod interface {
|
|
Apply(context.Context, *HistoryTimecardTemplate)
|
|
}
|
|
|
|
type HistoryTimecardModFunc func(context.Context, *HistoryTimecardTemplate)
|
|
|
|
func (f HistoryTimecardModFunc) Apply(ctx context.Context, n *HistoryTimecardTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type HistoryTimecardModSlice []HistoryTimecardMod
|
|
|
|
func (mods HistoryTimecardModSlice) Apply(ctx context.Context, n *HistoryTimecardTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// HistoryTimecardTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type HistoryTimecardTemplate struct {
|
|
OrganizationID func() 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]
|
|
Created func() null.Val[time.Time]
|
|
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]
|
|
Version func() int32
|
|
|
|
r historyTimecardR
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
type historyTimecardR struct {
|
|
Organization *historyTimecardROrganizationR
|
|
}
|
|
|
|
type historyTimecardROrganizationR struct {
|
|
o *OrganizationTemplate
|
|
}
|
|
|
|
// Apply mods to the HistoryTimecardTemplate
|
|
func (o *HistoryTimecardTemplate) Apply(ctx context.Context, mods ...HistoryTimecardMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.HistoryTimecard
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t HistoryTimecardTemplate) setModelRels(o *models.HistoryTimecard) {
|
|
if t.r.Organization != nil {
|
|
rel := t.r.Organization.o.Build()
|
|
rel.R.HistoryTimecards = append(rel.R.HistoryTimecards, o)
|
|
o.OrganizationID = rel.ID // h2
|
|
o.R.Organization = rel
|
|
}
|
|
}
|
|
|
|
// BuildSetter returns an *models.HistoryTimecardSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryTimecardTemplate) BuildSetter() *models.HistoryTimecardSetter {
|
|
m := &models.HistoryTimecardSetter{}
|
|
|
|
if o.OrganizationID != nil {
|
|
val := o.OrganizationID()
|
|
m.OrganizationID = omit.From(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.Created != nil {
|
|
val := o.Created()
|
|
m.Created = 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.Version != nil {
|
|
val := o.Version()
|
|
m.Version = omit.From(val)
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildManySetter returns an []*models.HistoryTimecardSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryTimecardTemplate) BuildManySetter(number int) []*models.HistoryTimecardSetter {
|
|
m := make([]*models.HistoryTimecardSetter, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.BuildSetter()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// Build returns an *models.HistoryTimecard
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryTimecardTemplate.Create
|
|
func (o HistoryTimecardTemplate) Build() *models.HistoryTimecard {
|
|
m := &models.HistoryTimecard{}
|
|
|
|
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.Created != nil {
|
|
m.Created = o.Created()
|
|
}
|
|
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.Version != nil {
|
|
m.Version = o.Version()
|
|
}
|
|
|
|
o.setModelRels(m)
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildMany returns an models.HistoryTimecardSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryTimecardTemplate.CreateMany
|
|
func (o HistoryTimecardTemplate) BuildMany(number int) models.HistoryTimecardSlice {
|
|
m := make(models.HistoryTimecardSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func ensureCreatableHistoryTimecard(m *models.HistoryTimecardSetter) {
|
|
if !(m.OrganizationID.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.OrganizationID = omit.From(val)
|
|
}
|
|
if !(m.Objectid.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.Objectid = omit.From(val)
|
|
}
|
|
if !(m.Version.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.Version = omit.From(val)
|
|
}
|
|
}
|
|
|
|
// insertOptRels creates and inserts any optional the relationships on *models.HistoryTimecard
|
|
// according to the relationships in the template.
|
|
// any required relationship should have already exist on the model
|
|
func (o *HistoryTimecardTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistoryTimecard) error {
|
|
var err error
|
|
|
|
return err
|
|
}
|
|
|
|
// Create builds a historyTimecard and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o *HistoryTimecardTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistoryTimecard, error) {
|
|
var err error
|
|
opt := o.BuildSetter()
|
|
ensureCreatableHistoryTimecard(opt)
|
|
|
|
if o.r.Organization == nil {
|
|
HistoryTimecardMods.WithNewOrganization().Apply(ctx, o)
|
|
}
|
|
|
|
var rel0 *models.Organization
|
|
|
|
if o.r.Organization.o.alreadyPersisted {
|
|
rel0 = o.r.Organization.o.Build()
|
|
} else {
|
|
rel0, err = o.r.Organization.o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
opt.OrganizationID = omit.From(rel0.ID)
|
|
|
|
m, err := models.HistoryTimecards.Insert(opt).One(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
m.R.Organization = rel0
|
|
|
|
if err := o.insertOptRels(ctx, exec, m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, err
|
|
}
|
|
|
|
// MustCreate builds a historyTimecard and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o *HistoryTimecardTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistoryTimecard {
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateOrFail builds a historyTimecard 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 *HistoryTimecardTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistoryTimecard {
|
|
tb.Helper()
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateMany builds multiple historyTimecards and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o HistoryTimecardTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistoryTimecardSlice, error) {
|
|
var err error
|
|
m := make(models.HistoryTimecardSlice, number)
|
|
|
|
for i := range m {
|
|
m[i], err = o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
return m, nil
|
|
}
|
|
|
|
// MustCreateMany builds multiple historyTimecards and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o HistoryTimecardTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistoryTimecardSlice {
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateManyOrFail builds multiple historyTimecards 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 HistoryTimecardTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistoryTimecardSlice {
|
|
tb.Helper()
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// HistoryTimecard has methods that act as mods for the HistoryTimecardTemplate
|
|
var HistoryTimecardMods historyTimecardMods
|
|
|
|
type historyTimecardMods struct{}
|
|
|
|
func (m historyTimecardMods) RandomizeAllColumns(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModSlice{
|
|
HistoryTimecardMods.RandomOrganizationID(f),
|
|
HistoryTimecardMods.RandomActivity(f),
|
|
HistoryTimecardMods.RandomComments(f),
|
|
HistoryTimecardMods.RandomCreationdate(f),
|
|
HistoryTimecardMods.RandomCreator(f),
|
|
HistoryTimecardMods.RandomEnddatetime(f),
|
|
HistoryTimecardMods.RandomEquiptype(f),
|
|
HistoryTimecardMods.RandomExternalid(f),
|
|
HistoryTimecardMods.RandomEditdate(f),
|
|
HistoryTimecardMods.RandomEditor(f),
|
|
HistoryTimecardMods.RandomFieldtech(f),
|
|
HistoryTimecardMods.RandomGlobalid(f),
|
|
HistoryTimecardMods.RandomLclocid(f),
|
|
HistoryTimecardMods.RandomLinelocid(f),
|
|
HistoryTimecardMods.RandomLocationname(f),
|
|
HistoryTimecardMods.RandomObjectid(f),
|
|
HistoryTimecardMods.RandomPointlocid(f),
|
|
HistoryTimecardMods.RandomPolygonlocid(f),
|
|
HistoryTimecardMods.RandomSamplelocid(f),
|
|
HistoryTimecardMods.RandomSrid(f),
|
|
HistoryTimecardMods.RandomStartdatetime(f),
|
|
HistoryTimecardMods.RandomTraplocid(f),
|
|
HistoryTimecardMods.RandomZone(f),
|
|
HistoryTimecardMods.RandomZone2(f),
|
|
HistoryTimecardMods.RandomCreated(f),
|
|
HistoryTimecardMods.RandomCreatedDate(f),
|
|
HistoryTimecardMods.RandomCreatedUser(f),
|
|
HistoryTimecardMods.RandomGeometryX(f),
|
|
HistoryTimecardMods.RandomGeometryY(f),
|
|
HistoryTimecardMods.RandomLastEditedDate(f),
|
|
HistoryTimecardMods.RandomLastEditedUser(f),
|
|
HistoryTimecardMods.RandomRodentlocid(f),
|
|
HistoryTimecardMods.RandomVersion(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTimecardMods) OrganizationID(val int32) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.OrganizationID = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) OrganizationIDFunc(f func() int32) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.OrganizationID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetOrganizationID() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.OrganizationID = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m historyTimecardMods) RandomOrganizationID(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.OrganizationID = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTimecardMods) Activity(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Activity = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) ActivityFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Activity = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetActivity() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomActivity(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomActivityNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Comments(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Comments = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) CommentsFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Comments = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetComments() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomComments(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCommentsNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Creationdate(val null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) CreationdateFunc(f func() null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Creationdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetCreationdate() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreationdate(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreationdateNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Creator(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Creator = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) CreatorFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Creator = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetCreator() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreator(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreatorNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Enddatetime(val null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Enddatetime = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) EnddatetimeFunc(f func() null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Enddatetime = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetEnddatetime() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEnddatetime(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEnddatetimeNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Equiptype(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Equiptype = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) EquiptypeFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Equiptype = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetEquiptype() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEquiptype(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEquiptypeNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Externalid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Externalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) ExternalidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Externalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetExternalid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomExternalid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomExternalidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Editdate(val null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Editdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) EditdateFunc(f func() null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Editdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetEditdate() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEditdate(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEditdateNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Editor(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Editor = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) EditorFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Editor = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetEditor() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEditor(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomEditorNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Fieldtech(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Fieldtech = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) FieldtechFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Fieldtech = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetFieldtech() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomFieldtech(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomFieldtechNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Globalid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Globalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) GlobalidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Globalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetGlobalid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomGlobalid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomGlobalidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Lclocid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Lclocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) LclocidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Lclocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetLclocid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLclocid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLclocidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Linelocid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Linelocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) LinelocidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Linelocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetLinelocid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLinelocid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLinelocidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Locationname(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Locationname = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) LocationnameFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Locationname = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetLocationname() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLocationname(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLocationnameNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Objectid(val int32) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Objectid = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) ObjectidFunc(f func() int32) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Objectid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetObjectid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomObjectid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Objectid = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTimecardMods) Pointlocid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Pointlocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) PointlocidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Pointlocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetPointlocid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomPointlocid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomPointlocidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Polygonlocid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Polygonlocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) PolygonlocidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Polygonlocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetPolygonlocid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomPolygonlocid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomPolygonlocidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Samplelocid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Samplelocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) SamplelocidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Samplelocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetSamplelocid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomSamplelocid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomSamplelocidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Srid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Srid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) SridFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Srid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetSrid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomSrid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomSridNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Startdatetime(val null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Startdatetime = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) StartdatetimeFunc(f func() null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Startdatetime = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetStartdatetime() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomStartdatetime(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomStartdatetimeNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Traplocid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Traplocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) TraplocidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Traplocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetTraplocid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomTraplocid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomTraplocidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Zone(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Zone = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) ZoneFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Zone = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetZone() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomZone(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomZoneNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Zone2(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Zone2 = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) Zone2Func(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Zone2 = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetZone2() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomZone2(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomZone2NotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Created(val null.Val[time.Time]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Created = func() null.Val[time.Time] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) CreatedFunc(f func() null.Val[time.Time]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Created = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetCreated() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Created = 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 historyTimecardMods) RandomCreated(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Created = func() null.Val[time.Time] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_time_Time(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 historyTimecardMods) RandomCreatedNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Created = func() null.Val[time.Time] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_time_Time(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyTimecardMods) CreatedDate(val null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) CreatedDateFunc(f func() null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.CreatedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetCreatedDate() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreatedDate(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreatedDateNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) CreatedUser(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) CreatedUserFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.CreatedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetCreatedUser() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreatedUser(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomCreatedUserNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) GeometryX(val null.Val[float64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) GeometryXFunc(f func() null.Val[float64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.GeometryX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetGeometryX() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomGeometryX(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomGeometryXNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) GeometryY(val null.Val[float64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) GeometryYFunc(f func() null.Val[float64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.GeometryY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetGeometryY() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomGeometryY(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomGeometryYNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) LastEditedDate(val null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) LastEditedDateFunc(f func() null.Val[int64]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.LastEditedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetLastEditedDate() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLastEditedDate(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLastEditedDateNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) LastEditedUser(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) LastEditedUserFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.LastEditedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetLastEditedUser() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLastEditedUser(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomLastEditedUserNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Rodentlocid(val null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Rodentlocid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) RodentlocidFunc(f func() null.Val[string]) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Rodentlocid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetRodentlocid() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomRodentlocid(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) RandomRodentlocidNotNull(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
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 historyTimecardMods) Version(val int32) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Version = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyTimecardMods) VersionFunc(f func() int32) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Version = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyTimecardMods) UnsetVersion() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Version = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m historyTimecardMods) RandomVersion(f *faker.Faker) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(_ context.Context, o *HistoryTimecardTemplate) {
|
|
o.Version = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTimecardMods) WithParentsCascading() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(ctx context.Context, o *HistoryTimecardTemplate) {
|
|
if isDone, _ := historyTimecardWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = historyTimecardWithParentsCascadingCtx.WithValue(ctx, true)
|
|
{
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTimecardMods) WithOrganization(rel *OrganizationTemplate) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(ctx context.Context, o *HistoryTimecardTemplate) {
|
|
o.r.Organization = &historyTimecardROrganizationR{
|
|
o: rel,
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTimecardMods) WithNewOrganization(mods ...OrganizationMod) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(ctx context.Context, o *HistoryTimecardTemplate) {
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m historyTimecardMods) WithExistingOrganization(em *models.Organization) HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(ctx context.Context, o *HistoryTimecardTemplate) {
|
|
o.r.Organization = &historyTimecardROrganizationR{
|
|
o: o.f.FromExistingOrganization(em),
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyTimecardMods) WithoutOrganization() HistoryTimecardMod {
|
|
return HistoryTimecardModFunc(func(ctx context.Context, o *HistoryTimecardTemplate) {
|
|
o.r.Organization = nil
|
|
})
|
|
}
|