2025-11-07 08:34:32 +00:00
|
|
|
// 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 FSTreatmentareaMod interface {
|
|
|
|
|
Apply(context.Context, *FSTreatmentareaTemplate)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type FSTreatmentareaModFunc func(context.Context, *FSTreatmentareaTemplate)
|
|
|
|
|
|
|
|
|
|
func (f FSTreatmentareaModFunc) Apply(ctx context.Context, n *FSTreatmentareaTemplate) {
|
|
|
|
|
f(ctx, n)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type FSTreatmentareaModSlice []FSTreatmentareaMod
|
|
|
|
|
|
|
|
|
|
func (mods FSTreatmentareaModSlice) Apply(ctx context.Context, n *FSTreatmentareaTemplate) {
|
|
|
|
|
for _, f := range mods {
|
|
|
|
|
f.Apply(ctx, n)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FSTreatmentareaTemplate is an object representing the database table.
|
|
|
|
|
// all columns are optional and should be set by mods
|
|
|
|
|
type FSTreatmentareaTemplate struct {
|
2025-11-07 09:30:31 +00:00
|
|
|
OrganizationID func() int32
|
2025-11-07 08:34:32 +00:00
|
|
|
Comments func() null.Val[string]
|
|
|
|
|
Creationdate func() null.Val[int64]
|
|
|
|
|
Creator func() null.Val[string]
|
|
|
|
|
Editdate func() null.Val[int64]
|
|
|
|
|
Editor func() null.Val[string]
|
|
|
|
|
Globalid func() null.Val[string]
|
|
|
|
|
Notified func() null.Val[int16]
|
|
|
|
|
Objectid func() int32
|
|
|
|
|
SessionID func() null.Val[string]
|
|
|
|
|
ShapeArea func() null.Val[float64]
|
|
|
|
|
ShapeLength func() null.Val[float64]
|
|
|
|
|
Treatdate func() null.Val[int64]
|
|
|
|
|
TreatID func() null.Val[string]
|
|
|
|
|
Type 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]
|
|
|
|
|
Updated func() time.Time
|
|
|
|
|
|
|
|
|
|
r fsTreatmentareaR
|
|
|
|
|
f *Factory
|
|
|
|
|
|
|
|
|
|
alreadyPersisted bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type fsTreatmentareaR struct {
|
|
|
|
|
Organization *fsTreatmentareaROrganizationR
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type fsTreatmentareaROrganizationR struct {
|
|
|
|
|
o *OrganizationTemplate
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Apply mods to the FSTreatmentareaTemplate
|
|
|
|
|
func (o *FSTreatmentareaTemplate) Apply(ctx context.Context, mods ...FSTreatmentareaMod) {
|
|
|
|
|
for _, mod := range mods {
|
|
|
|
|
mod.Apply(ctx, o)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// setModelRels creates and sets the relationships on *models.FSTreatmentarea
|
|
|
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
|
|
|
func (t FSTreatmentareaTemplate) setModelRels(o *models.FSTreatmentarea) {
|
|
|
|
|
if t.r.Organization != nil {
|
|
|
|
|
rel := t.r.Organization.o.Build()
|
|
|
|
|
rel.R.FSTreatmentareas = append(rel.R.FSTreatmentareas, o)
|
2025-11-07 09:30:31 +00:00
|
|
|
o.OrganizationID = rel.ID // h2
|
2025-11-07 08:34:32 +00:00
|
|
|
o.R.Organization = rel
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BuildSetter returns an *models.FSTreatmentareaSetter
|
|
|
|
|
// this does nothing with the relationship templates
|
|
|
|
|
func (o FSTreatmentareaTemplate) BuildSetter() *models.FSTreatmentareaSetter {
|
|
|
|
|
m := &models.FSTreatmentareaSetter{}
|
|
|
|
|
|
|
|
|
|
if o.OrganizationID != nil {
|
|
|
|
|
val := o.OrganizationID()
|
2025-11-07 09:30:31 +00:00
|
|
|
m.OrganizationID = omit.From(val)
|
2025-11-07 08:34:32 +00:00
|
|
|
}
|
|
|
|
|
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.Editdate != nil {
|
|
|
|
|
val := o.Editdate()
|
|
|
|
|
m.Editdate = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.Editor != nil {
|
|
|
|
|
val := o.Editor()
|
|
|
|
|
m.Editor = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.Globalid != nil {
|
|
|
|
|
val := o.Globalid()
|
|
|
|
|
m.Globalid = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.Notified != nil {
|
|
|
|
|
val := o.Notified()
|
|
|
|
|
m.Notified = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.Objectid != nil {
|
|
|
|
|
val := o.Objectid()
|
|
|
|
|
m.Objectid = omit.From(val)
|
|
|
|
|
}
|
|
|
|
|
if o.SessionID != nil {
|
|
|
|
|
val := o.SessionID()
|
|
|
|
|
m.SessionID = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.ShapeArea != nil {
|
|
|
|
|
val := o.ShapeArea()
|
|
|
|
|
m.ShapeArea = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.ShapeLength != nil {
|
|
|
|
|
val := o.ShapeLength()
|
|
|
|
|
m.ShapeLength = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.Treatdate != nil {
|
|
|
|
|
val := o.Treatdate()
|
|
|
|
|
m.Treatdate = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.TreatID != nil {
|
|
|
|
|
val := o.TreatID()
|
|
|
|
|
m.TreatID = omitnull.FromNull(val)
|
|
|
|
|
}
|
|
|
|
|
if o.Type != nil {
|
|
|
|
|
val := o.Type()
|
|
|
|
|
m.Type = 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.Updated != nil {
|
|
|
|
|
val := o.Updated()
|
|
|
|
|
m.Updated = omit.From(val)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BuildManySetter returns an []*models.FSTreatmentareaSetter
|
|
|
|
|
// this does nothing with the relationship templates
|
|
|
|
|
func (o FSTreatmentareaTemplate) BuildManySetter(number int) []*models.FSTreatmentareaSetter {
|
|
|
|
|
m := make([]*models.FSTreatmentareaSetter, number)
|
|
|
|
|
|
|
|
|
|
for i := range m {
|
|
|
|
|
m[i] = o.BuildSetter()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build returns an *models.FSTreatmentarea
|
|
|
|
|
// Related objects are also created and placed in the .R field
|
|
|
|
|
// NOTE: Objects are not inserted into the database. Use FSTreatmentareaTemplate.Create
|
|
|
|
|
func (o FSTreatmentareaTemplate) Build() *models.FSTreatmentarea {
|
|
|
|
|
m := &models.FSTreatmentarea{}
|
|
|
|
|
|
|
|
|
|
if o.OrganizationID != nil {
|
|
|
|
|
m.OrganizationID = o.OrganizationID()
|
|
|
|
|
}
|
|
|
|
|
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.Editdate != nil {
|
|
|
|
|
m.Editdate = o.Editdate()
|
|
|
|
|
}
|
|
|
|
|
if o.Editor != nil {
|
|
|
|
|
m.Editor = o.Editor()
|
|
|
|
|
}
|
|
|
|
|
if o.Globalid != nil {
|
|
|
|
|
m.Globalid = o.Globalid()
|
|
|
|
|
}
|
|
|
|
|
if o.Notified != nil {
|
|
|
|
|
m.Notified = o.Notified()
|
|
|
|
|
}
|
|
|
|
|
if o.Objectid != nil {
|
|
|
|
|
m.Objectid = o.Objectid()
|
|
|
|
|
}
|
|
|
|
|
if o.SessionID != nil {
|
|
|
|
|
m.SessionID = o.SessionID()
|
|
|
|
|
}
|
|
|
|
|
if o.ShapeArea != nil {
|
|
|
|
|
m.ShapeArea = o.ShapeArea()
|
|
|
|
|
}
|
|
|
|
|
if o.ShapeLength != nil {
|
|
|
|
|
m.ShapeLength = o.ShapeLength()
|
|
|
|
|
}
|
|
|
|
|
if o.Treatdate != nil {
|
|
|
|
|
m.Treatdate = o.Treatdate()
|
|
|
|
|
}
|
|
|
|
|
if o.TreatID != nil {
|
|
|
|
|
m.TreatID = o.TreatID()
|
|
|
|
|
}
|
|
|
|
|
if o.Type != nil {
|
|
|
|
|
m.Type = o.Type()
|
|
|
|
|
}
|
|
|
|
|
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.Updated != nil {
|
|
|
|
|
m.Updated = o.Updated()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o.setModelRels(m)
|
|
|
|
|
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BuildMany returns an models.FSTreatmentareaSlice
|
|
|
|
|
// Related objects are also created and placed in the .R field
|
|
|
|
|
// NOTE: Objects are not inserted into the database. Use FSTreatmentareaTemplate.CreateMany
|
|
|
|
|
func (o FSTreatmentareaTemplate) BuildMany(number int) models.FSTreatmentareaSlice {
|
|
|
|
|
m := make(models.FSTreatmentareaSlice, number)
|
|
|
|
|
|
|
|
|
|
for i := range m {
|
|
|
|
|
m[i] = o.Build()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func ensureCreatableFSTreatmentarea(m *models.FSTreatmentareaSetter) {
|
2025-11-07 09:30:31 +00:00
|
|
|
if !(m.OrganizationID.IsValue()) {
|
|
|
|
|
val := random_int32(nil)
|
|
|
|
|
m.OrganizationID = omit.From(val)
|
|
|
|
|
}
|
2025-11-07 08:34:32 +00:00
|
|
|
if !(m.Objectid.IsValue()) {
|
|
|
|
|
val := random_int32(nil)
|
|
|
|
|
m.Objectid = omit.From(val)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// insertOptRels creates and inserts any optional the relationships on *models.FSTreatmentarea
|
|
|
|
|
// according to the relationships in the template.
|
|
|
|
|
// any required relationship should have already exist on the model
|
|
|
|
|
func (o *FSTreatmentareaTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FSTreatmentarea) error {
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create builds a fsTreatmentarea and inserts it into the database
|
|
|
|
|
// Relations objects are also inserted and placed in the .R field
|
|
|
|
|
func (o *FSTreatmentareaTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FSTreatmentarea, error) {
|
|
|
|
|
var err error
|
|
|
|
|
opt := o.BuildSetter()
|
|
|
|
|
ensureCreatableFSTreatmentarea(opt)
|
|
|
|
|
|
2025-11-07 09:30:31 +00:00
|
|
|
if o.r.Organization == nil {
|
|
|
|
|
FSTreatmentareaMods.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)
|
|
|
|
|
|
2025-11-07 08:34:32 +00:00
|
|
|
m, err := models.FSTreatmentareas.Insert(opt).One(ctx, exec)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-07 09:30:31 +00:00
|
|
|
m.R.Organization = rel0
|
|
|
|
|
|
2025-11-07 08:34:32 +00:00
|
|
|
if err := o.insertOptRels(ctx, exec, m); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return m, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MustCreate builds a fsTreatmentarea and inserts it into the database
|
|
|
|
|
// Relations objects are also inserted and placed in the .R field
|
|
|
|
|
// panics if an error occurs
|
|
|
|
|
func (o *FSTreatmentareaTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FSTreatmentarea {
|
|
|
|
|
m, err := o.Create(ctx, exec)
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CreateOrFail builds a fsTreatmentarea 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 *FSTreatmentareaTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FSTreatmentarea {
|
|
|
|
|
tb.Helper()
|
|
|
|
|
m, err := o.Create(ctx, exec)
|
|
|
|
|
if err != nil {
|
|
|
|
|
tb.Fatal(err)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CreateMany builds multiple fsTreatmentareas and inserts them into the database
|
|
|
|
|
// Relations objects are also inserted and placed in the .R field
|
|
|
|
|
func (o FSTreatmentareaTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FSTreatmentareaSlice, error) {
|
|
|
|
|
var err error
|
|
|
|
|
m := make(models.FSTreatmentareaSlice, number)
|
|
|
|
|
|
|
|
|
|
for i := range m {
|
|
|
|
|
m[i], err = o.Create(ctx, exec)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return m, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MustCreateMany builds multiple fsTreatmentareas and inserts them into the database
|
|
|
|
|
// Relations objects are also inserted and placed in the .R field
|
|
|
|
|
// panics if an error occurs
|
|
|
|
|
func (o FSTreatmentareaTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FSTreatmentareaSlice {
|
|
|
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CreateManyOrFail builds multiple fsTreatmentareas 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 FSTreatmentareaTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FSTreatmentareaSlice {
|
|
|
|
|
tb.Helper()
|
|
|
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
|
|
|
if err != nil {
|
|
|
|
|
tb.Fatal(err)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return m
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FSTreatmentarea has methods that act as mods for the FSTreatmentareaTemplate
|
|
|
|
|
var FSTreatmentareaMods fsTreatmentareaMods
|
|
|
|
|
|
|
|
|
|
type fsTreatmentareaMods struct{}
|
|
|
|
|
|
|
|
|
|
func (m fsTreatmentareaMods) RandomizeAllColumns(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModSlice{
|
|
|
|
|
FSTreatmentareaMods.RandomOrganizationID(f),
|
|
|
|
|
FSTreatmentareaMods.RandomComments(f),
|
|
|
|
|
FSTreatmentareaMods.RandomCreationdate(f),
|
|
|
|
|
FSTreatmentareaMods.RandomCreator(f),
|
|
|
|
|
FSTreatmentareaMods.RandomEditdate(f),
|
|
|
|
|
FSTreatmentareaMods.RandomEditor(f),
|
|
|
|
|
FSTreatmentareaMods.RandomGlobalid(f),
|
|
|
|
|
FSTreatmentareaMods.RandomNotified(f),
|
|
|
|
|
FSTreatmentareaMods.RandomObjectid(f),
|
|
|
|
|
FSTreatmentareaMods.RandomSessionID(f),
|
|
|
|
|
FSTreatmentareaMods.RandomShapeArea(f),
|
|
|
|
|
FSTreatmentareaMods.RandomShapeLength(f),
|
|
|
|
|
FSTreatmentareaMods.RandomTreatdate(f),
|
|
|
|
|
FSTreatmentareaMods.RandomTreatID(f),
|
|
|
|
|
FSTreatmentareaMods.RandomType(f),
|
|
|
|
|
FSTreatmentareaMods.RandomCreatedDate(f),
|
|
|
|
|
FSTreatmentareaMods.RandomCreatedUser(f),
|
|
|
|
|
FSTreatmentareaMods.RandomGeometryX(f),
|
|
|
|
|
FSTreatmentareaMods.RandomGeometryY(f),
|
|
|
|
|
FSTreatmentareaMods.RandomLastEditedDate(f),
|
|
|
|
|
FSTreatmentareaMods.RandomLastEditedUser(f),
|
|
|
|
|
FSTreatmentareaMods.RandomUpdated(f),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the model columns to this value
|
2025-11-07 09:30:31 +00:00
|
|
|
func (m fsTreatmentareaMods) OrganizationID(val int32) FSTreatmentareaMod {
|
2025-11-07 08:34:32 +00:00
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
2025-11-07 09:30:31 +00:00
|
|
|
o.OrganizationID = func() int32 { return val }
|
2025-11-07 08:34:32 +00:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
2025-11-07 09:30:31 +00:00
|
|
|
func (m fsTreatmentareaMods) OrganizationIDFunc(f func() int32) FSTreatmentareaMod {
|
2025-11-07 08:34:32 +00:00
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.OrganizationID = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetOrganizationID() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomOrganizationID(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
2025-11-07 09:30:31 +00:00
|
|
|
o.OrganizationID = func() int32 {
|
|
|
|
|
return random_int32(f)
|
2025-11-07 08:34:32 +00:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the model columns to this value
|
|
|
|
|
func (m fsTreatmentareaMods) Comments(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Comments = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) CommentsFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Comments = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetComments() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomComments(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCommentsNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) Creationdate(val null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) CreationdateFunc(f func() null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Creationdate = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetCreationdate() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreationdate(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreationdateNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) Creator(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Creator = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) CreatorFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Creator = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetCreator() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreator(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreatorNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) Editdate(val null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Editdate = func() null.Val[int64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) EditdateFunc(f func() null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Editdate = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetEditdate() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomEditdate(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomEditdateNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) Editor(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Editor = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) EditorFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Editor = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetEditor() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomEditor(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomEditorNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) Globalid(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Globalid = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) GlobalidFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Globalid = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetGlobalid() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomGlobalid(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomGlobalidNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) Notified(val null.Val[int16]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Notified = func() null.Val[int16] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) NotifiedFunc(f func() null.Val[int16]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Notified = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetNotified() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Notified = 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 fsTreatmentareaMods) RandomNotified(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Notified = func() null.Val[int16] {
|
|
|
|
|
if f == nil {
|
|
|
|
|
f = &defaultFaker
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val := random_int16(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 fsTreatmentareaMods) RandomNotifiedNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Notified = func() null.Val[int16] {
|
|
|
|
|
if f == nil {
|
|
|
|
|
f = &defaultFaker
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val := random_int16(f)
|
|
|
|
|
return null.From(val)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the model columns to this value
|
|
|
|
|
func (m fsTreatmentareaMods) Objectid(val int32) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Objectid = func() int32 { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) ObjectidFunc(f func() int32) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Objectid = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetObjectid() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomObjectid(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Objectid = func() int32 {
|
|
|
|
|
return random_int32(f)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the model columns to this value
|
|
|
|
|
func (m fsTreatmentareaMods) SessionID(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.SessionID = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) SessionIDFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.SessionID = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetSessionID() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.SessionID = 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 fsTreatmentareaMods) RandomSessionID(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.SessionID = 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 fsTreatmentareaMods) RandomSessionIDNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.SessionID = 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 fsTreatmentareaMods) ShapeArea(val null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeArea = func() null.Val[float64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) ShapeAreaFunc(f func() null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeArea = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetShapeArea() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeArea = 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 fsTreatmentareaMods) RandomShapeArea(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeArea = 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 fsTreatmentareaMods) RandomShapeAreaNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeArea = 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 fsTreatmentareaMods) ShapeLength(val null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeLength = func() null.Val[float64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) ShapeLengthFunc(f func() null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeLength = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetShapeLength() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeLength = 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 fsTreatmentareaMods) RandomShapeLength(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeLength = 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 fsTreatmentareaMods) RandomShapeLengthNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.ShapeLength = 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 fsTreatmentareaMods) Treatdate(val null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Treatdate = func() null.Val[int64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) TreatdateFunc(f func() null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Treatdate = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetTreatdate() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Treatdate = 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 fsTreatmentareaMods) RandomTreatdate(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Treatdate = 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 fsTreatmentareaMods) RandomTreatdateNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Treatdate = 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 fsTreatmentareaMods) TreatID(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.TreatID = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) TreatIDFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.TreatID = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetTreatID() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.TreatID = 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 fsTreatmentareaMods) RandomTreatID(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.TreatID = 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 fsTreatmentareaMods) RandomTreatIDNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.TreatID = 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 fsTreatmentareaMods) Type(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Type = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) TypeFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Type = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetType() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Type = 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 fsTreatmentareaMods) RandomType(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Type = 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 fsTreatmentareaMods) RandomTypeNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Type = 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 fsTreatmentareaMods) CreatedDate(val null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) CreatedDateFunc(f func() null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.CreatedDate = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetCreatedDate() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreatedDate(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreatedDateNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) CreatedUser(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) CreatedUserFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.CreatedUser = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetCreatedUser() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreatedUser(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomCreatedUserNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) GeometryX(val null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) GeometryXFunc(f func() null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.GeometryX = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetGeometryX() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomGeometryX(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomGeometryXNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) GeometryY(val null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) GeometryYFunc(f func() null.Val[float64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.GeometryY = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetGeometryY() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomGeometryY(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomGeometryYNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) LastEditedDate(val null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) LastEditedDateFunc(f func() null.Val[int64]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.LastEditedDate = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetLastEditedDate() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomLastEditedDate(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomLastEditedDateNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) LastEditedUser(val null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) LastEditedUserFunc(f func() null.Val[string]) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.LastEditedUser = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetLastEditedUser() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomLastEditedUser(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomLastEditedUserNotNull(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) Updated(val time.Time) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Updated = func() time.Time { return val }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the Column from the function
|
|
|
|
|
func (m fsTreatmentareaMods) UpdatedFunc(f func() time.Time) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Updated = f
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clear any values for the column
|
|
|
|
|
func (m fsTreatmentareaMods) UnsetUpdated() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
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 fsTreatmentareaMods) RandomUpdated(f *faker.Faker) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.Updated = func() time.Time {
|
|
|
|
|
return random_time_Time(f)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m fsTreatmentareaMods) WithParentsCascading() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(ctx context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
if isDone, _ := fsTreatmentareaWithParentsCascadingCtx.Value(ctx); isDone {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ctx = fsTreatmentareaWithParentsCascadingCtx.WithValue(ctx, true)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m fsTreatmentareaMods) WithOrganization(rel *OrganizationTemplate) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(ctx context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.r.Organization = &fsTreatmentareaROrganizationR{
|
|
|
|
|
o: rel,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m fsTreatmentareaMods) WithNewOrganization(mods ...OrganizationMod) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(ctx context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
|
|
|
|
|
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m fsTreatmentareaMods) WithExistingOrganization(em *models.Organization) FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(ctx context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.r.Organization = &fsTreatmentareaROrganizationR{
|
|
|
|
|
o: o.f.FromExistingOrganization(em),
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m fsTreatmentareaMods) WithoutOrganization() FSTreatmentareaMod {
|
|
|
|
|
return FSTreatmentareaModFunc(func(ctx context.Context, o *FSTreatmentareaTemplate) {
|
|
|
|
|
o.r.Organization = nil
|
|
|
|
|
})
|
|
|
|
|
}
|