This is an intermediate step between shifting from the old fs_* prefixed table names to an entire fieldseeker schema. At this point we have both, and we aren't doing much with the new schema but compiling.
5494 lines
182 KiB
Go
5494 lines
182 KiB
Go
// Code generated by BobGen psql v0.42.0. DO NOT EDIT.
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
package factory
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
models "github.com/Gleipnir-Technology/nidus-sync/db/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 OrganizationMod interface {
|
|
Apply(context.Context, *OrganizationTemplate)
|
|
}
|
|
|
|
type OrganizationModFunc func(context.Context, *OrganizationTemplate)
|
|
|
|
func (f OrganizationModFunc) Apply(ctx context.Context, n *OrganizationTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type OrganizationModSlice []OrganizationMod
|
|
|
|
func (mods OrganizationModSlice) Apply(ctx context.Context, n *OrganizationTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// OrganizationTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type OrganizationTemplate struct {
|
|
ID func() int32
|
|
Name func() null.Val[string]
|
|
ArcgisID func() null.Val[string]
|
|
ArcgisName func() null.Val[string]
|
|
FieldseekerURL func() null.Val[string]
|
|
|
|
r organizationR
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
type organizationR struct {
|
|
Rodentlocations []*organizationRRodentlocationsR
|
|
FieldseekerSyncs []*organizationRFieldseekerSyncsR
|
|
FSContainerrelates []*organizationRFSContainerrelatesR
|
|
FSFieldscoutinglogs []*organizationRFSFieldscoutinglogsR
|
|
FSHabitatrelates []*organizationRFSHabitatrelatesR
|
|
FSInspectionsamples []*organizationRFSInspectionsamplesR
|
|
FSInspectionsampledetails []*organizationRFSInspectionsampledetailsR
|
|
FSLinelocations []*organizationRFSLinelocationsR
|
|
FSLocationtrackings []*organizationRFSLocationtrackingsR
|
|
FSMosquitoinspections []*organizationRFSMosquitoinspectionsR
|
|
FSPointlocations []*organizationRFSPointlocationsR
|
|
FSPolygonlocations []*organizationRFSPolygonlocationsR
|
|
FSPools []*organizationRFSPoolsR
|
|
FSPooldetails []*organizationRFSPooldetailsR
|
|
FSProposedtreatmentareas []*organizationRFSProposedtreatmentareasR
|
|
FSQamosquitoinspections []*organizationRFSQamosquitoinspectionsR
|
|
FSRodentlocations []*organizationRFSRodentlocationsR
|
|
FSSamplecollections []*organizationRFSSamplecollectionsR
|
|
FSSamplelocations []*organizationRFSSamplelocationsR
|
|
FSServicerequests []*organizationRFSServicerequestsR
|
|
FSSpeciesabundances []*organizationRFSSpeciesabundancesR
|
|
FSStormdrains []*organizationRFSStormdrainsR
|
|
FSTimecards []*organizationRFSTimecardsR
|
|
FSTrapdata []*organizationRFSTrapdataR
|
|
FSTraplocations []*organizationRFSTraplocationsR
|
|
FSTreatments []*organizationRFSTreatmentsR
|
|
FSTreatmentareas []*organizationRFSTreatmentareasR
|
|
FSZones []*organizationRFSZonesR
|
|
FSZones2s []*organizationRFSZones2sR
|
|
H3Aggregations []*organizationRH3AggregationsR
|
|
HistoryContainerrelates []*organizationRHistoryContainerrelatesR
|
|
HistoryFieldscoutinglogs []*organizationRHistoryFieldscoutinglogsR
|
|
HistoryHabitatrelates []*organizationRHistoryHabitatrelatesR
|
|
HistoryInspectionsamples []*organizationRHistoryInspectionsamplesR
|
|
HistoryInspectionsampledetails []*organizationRHistoryInspectionsampledetailsR
|
|
HistoryLinelocations []*organizationRHistoryLinelocationsR
|
|
HistoryLocationtrackings []*organizationRHistoryLocationtrackingsR
|
|
HistoryMosquitoinspections []*organizationRHistoryMosquitoinspectionsR
|
|
HistoryPointlocations []*organizationRHistoryPointlocationsR
|
|
HistoryPolygonlocations []*organizationRHistoryPolygonlocationsR
|
|
HistoryPools []*organizationRHistoryPoolsR
|
|
HistoryPooldetails []*organizationRHistoryPooldetailsR
|
|
HistoryProposedtreatmentareas []*organizationRHistoryProposedtreatmentareasR
|
|
HistoryQamosquitoinspections []*organizationRHistoryQamosquitoinspectionsR
|
|
HistoryRodentlocations []*organizationRHistoryRodentlocationsR
|
|
HistorySamplecollections []*organizationRHistorySamplecollectionsR
|
|
HistorySamplelocations []*organizationRHistorySamplelocationsR
|
|
HistoryServicerequests []*organizationRHistoryServicerequestsR
|
|
HistorySpeciesabundances []*organizationRHistorySpeciesabundancesR
|
|
HistoryStormdrains []*organizationRHistoryStormdrainsR
|
|
HistoryTimecards []*organizationRHistoryTimecardsR
|
|
HistoryTrapdata []*organizationRHistoryTrapdataR
|
|
HistoryTraplocations []*organizationRHistoryTraplocationsR
|
|
HistoryTreatments []*organizationRHistoryTreatmentsR
|
|
HistoryTreatmentareas []*organizationRHistoryTreatmentareasR
|
|
HistoryZones []*organizationRHistoryZonesR
|
|
HistoryZones2s []*organizationRHistoryZones2sR
|
|
User []*organizationRUserR
|
|
}
|
|
|
|
type organizationRRodentlocationsR struct {
|
|
number int
|
|
o *FieldseekerRodentlocationTemplate
|
|
}
|
|
type organizationRFieldseekerSyncsR struct {
|
|
number int
|
|
o *FieldseekerSyncTemplate
|
|
}
|
|
type organizationRFSContainerrelatesR struct {
|
|
number int
|
|
o *FSContainerrelateTemplate
|
|
}
|
|
type organizationRFSFieldscoutinglogsR struct {
|
|
number int
|
|
o *FSFieldscoutinglogTemplate
|
|
}
|
|
type organizationRFSHabitatrelatesR struct {
|
|
number int
|
|
o *FSHabitatrelateTemplate
|
|
}
|
|
type organizationRFSInspectionsamplesR struct {
|
|
number int
|
|
o *FSInspectionsampleTemplate
|
|
}
|
|
type organizationRFSInspectionsampledetailsR struct {
|
|
number int
|
|
o *FSInspectionsampledetailTemplate
|
|
}
|
|
type organizationRFSLinelocationsR struct {
|
|
number int
|
|
o *FSLinelocationTemplate
|
|
}
|
|
type organizationRFSLocationtrackingsR struct {
|
|
number int
|
|
o *FSLocationtrackingTemplate
|
|
}
|
|
type organizationRFSMosquitoinspectionsR struct {
|
|
number int
|
|
o *FSMosquitoinspectionTemplate
|
|
}
|
|
type organizationRFSPointlocationsR struct {
|
|
number int
|
|
o *FSPointlocationTemplate
|
|
}
|
|
type organizationRFSPolygonlocationsR struct {
|
|
number int
|
|
o *FSPolygonlocationTemplate
|
|
}
|
|
type organizationRFSPoolsR struct {
|
|
number int
|
|
o *FSPoolTemplate
|
|
}
|
|
type organizationRFSPooldetailsR struct {
|
|
number int
|
|
o *FSPooldetailTemplate
|
|
}
|
|
type organizationRFSProposedtreatmentareasR struct {
|
|
number int
|
|
o *FSProposedtreatmentareaTemplate
|
|
}
|
|
type organizationRFSQamosquitoinspectionsR struct {
|
|
number int
|
|
o *FSQamosquitoinspectionTemplate
|
|
}
|
|
type organizationRFSRodentlocationsR struct {
|
|
number int
|
|
o *FSRodentlocationTemplate
|
|
}
|
|
type organizationRFSSamplecollectionsR struct {
|
|
number int
|
|
o *FSSamplecollectionTemplate
|
|
}
|
|
type organizationRFSSamplelocationsR struct {
|
|
number int
|
|
o *FSSamplelocationTemplate
|
|
}
|
|
type organizationRFSServicerequestsR struct {
|
|
number int
|
|
o *FSServicerequestTemplate
|
|
}
|
|
type organizationRFSSpeciesabundancesR struct {
|
|
number int
|
|
o *FSSpeciesabundanceTemplate
|
|
}
|
|
type organizationRFSStormdrainsR struct {
|
|
number int
|
|
o *FSStormdrainTemplate
|
|
}
|
|
type organizationRFSTimecardsR struct {
|
|
number int
|
|
o *FSTimecardTemplate
|
|
}
|
|
type organizationRFSTrapdataR struct {
|
|
number int
|
|
o *FSTrapdatumTemplate
|
|
}
|
|
type organizationRFSTraplocationsR struct {
|
|
number int
|
|
o *FSTraplocationTemplate
|
|
}
|
|
type organizationRFSTreatmentsR struct {
|
|
number int
|
|
o *FSTreatmentTemplate
|
|
}
|
|
type organizationRFSTreatmentareasR struct {
|
|
number int
|
|
o *FSTreatmentareaTemplate
|
|
}
|
|
type organizationRFSZonesR struct {
|
|
number int
|
|
o *FSZoneTemplate
|
|
}
|
|
type organizationRFSZones2sR struct {
|
|
number int
|
|
o *FSZones2Template
|
|
}
|
|
type organizationRH3AggregationsR struct {
|
|
number int
|
|
o *H3AggregationTemplate
|
|
}
|
|
type organizationRHistoryContainerrelatesR struct {
|
|
number int
|
|
o *HistoryContainerrelateTemplate
|
|
}
|
|
type organizationRHistoryFieldscoutinglogsR struct {
|
|
number int
|
|
o *HistoryFieldscoutinglogTemplate
|
|
}
|
|
type organizationRHistoryHabitatrelatesR struct {
|
|
number int
|
|
o *HistoryHabitatrelateTemplate
|
|
}
|
|
type organizationRHistoryInspectionsamplesR struct {
|
|
number int
|
|
o *HistoryInspectionsampleTemplate
|
|
}
|
|
type organizationRHistoryInspectionsampledetailsR struct {
|
|
number int
|
|
o *HistoryInspectionsampledetailTemplate
|
|
}
|
|
type organizationRHistoryLinelocationsR struct {
|
|
number int
|
|
o *HistoryLinelocationTemplate
|
|
}
|
|
type organizationRHistoryLocationtrackingsR struct {
|
|
number int
|
|
o *HistoryLocationtrackingTemplate
|
|
}
|
|
type organizationRHistoryMosquitoinspectionsR struct {
|
|
number int
|
|
o *HistoryMosquitoinspectionTemplate
|
|
}
|
|
type organizationRHistoryPointlocationsR struct {
|
|
number int
|
|
o *HistoryPointlocationTemplate
|
|
}
|
|
type organizationRHistoryPolygonlocationsR struct {
|
|
number int
|
|
o *HistoryPolygonlocationTemplate
|
|
}
|
|
type organizationRHistoryPoolsR struct {
|
|
number int
|
|
o *HistoryPoolTemplate
|
|
}
|
|
type organizationRHistoryPooldetailsR struct {
|
|
number int
|
|
o *HistoryPooldetailTemplate
|
|
}
|
|
type organizationRHistoryProposedtreatmentareasR struct {
|
|
number int
|
|
o *HistoryProposedtreatmentareaTemplate
|
|
}
|
|
type organizationRHistoryQamosquitoinspectionsR struct {
|
|
number int
|
|
o *HistoryQamosquitoinspectionTemplate
|
|
}
|
|
type organizationRHistoryRodentlocationsR struct {
|
|
number int
|
|
o *HistoryRodentlocationTemplate
|
|
}
|
|
type organizationRHistorySamplecollectionsR struct {
|
|
number int
|
|
o *HistorySamplecollectionTemplate
|
|
}
|
|
type organizationRHistorySamplelocationsR struct {
|
|
number int
|
|
o *HistorySamplelocationTemplate
|
|
}
|
|
type organizationRHistoryServicerequestsR struct {
|
|
number int
|
|
o *HistoryServicerequestTemplate
|
|
}
|
|
type organizationRHistorySpeciesabundancesR struct {
|
|
number int
|
|
o *HistorySpeciesabundanceTemplate
|
|
}
|
|
type organizationRHistoryStormdrainsR struct {
|
|
number int
|
|
o *HistoryStormdrainTemplate
|
|
}
|
|
type organizationRHistoryTimecardsR struct {
|
|
number int
|
|
o *HistoryTimecardTemplate
|
|
}
|
|
type organizationRHistoryTrapdataR struct {
|
|
number int
|
|
o *HistoryTrapdatumTemplate
|
|
}
|
|
type organizationRHistoryTraplocationsR struct {
|
|
number int
|
|
o *HistoryTraplocationTemplate
|
|
}
|
|
type organizationRHistoryTreatmentsR struct {
|
|
number int
|
|
o *HistoryTreatmentTemplate
|
|
}
|
|
type organizationRHistoryTreatmentareasR struct {
|
|
number int
|
|
o *HistoryTreatmentareaTemplate
|
|
}
|
|
type organizationRHistoryZonesR struct {
|
|
number int
|
|
o *HistoryZoneTemplate
|
|
}
|
|
type organizationRHistoryZones2sR struct {
|
|
number int
|
|
o *HistoryZones2Template
|
|
}
|
|
type organizationRUserR struct {
|
|
number int
|
|
o *UserTemplate
|
|
}
|
|
|
|
// Apply mods to the OrganizationTemplate
|
|
func (o *OrganizationTemplate) Apply(ctx context.Context, mods ...OrganizationMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.Organization
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t OrganizationTemplate) setModelRels(o *models.Organization) {
|
|
if t.r.Rodentlocations != nil {
|
|
rel := models.FieldseekerRodentlocationSlice{}
|
|
for _, r := range t.r.Rodentlocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.Rodentlocations = rel
|
|
}
|
|
|
|
if t.r.FieldseekerSyncs != nil {
|
|
rel := models.FieldseekerSyncSlice{}
|
|
for _, r := range t.r.FieldseekerSyncs {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FieldseekerSyncs = rel
|
|
}
|
|
|
|
if t.r.FSContainerrelates != nil {
|
|
rel := models.FSContainerrelateSlice{}
|
|
for _, r := range t.r.FSContainerrelates {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSContainerrelates = rel
|
|
}
|
|
|
|
if t.r.FSFieldscoutinglogs != nil {
|
|
rel := models.FSFieldscoutinglogSlice{}
|
|
for _, r := range t.r.FSFieldscoutinglogs {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSFieldscoutinglogs = rel
|
|
}
|
|
|
|
if t.r.FSHabitatrelates != nil {
|
|
rel := models.FSHabitatrelateSlice{}
|
|
for _, r := range t.r.FSHabitatrelates {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSHabitatrelates = rel
|
|
}
|
|
|
|
if t.r.FSInspectionsamples != nil {
|
|
rel := models.FSInspectionsampleSlice{}
|
|
for _, r := range t.r.FSInspectionsamples {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSInspectionsamples = rel
|
|
}
|
|
|
|
if t.r.FSInspectionsampledetails != nil {
|
|
rel := models.FSInspectionsampledetailSlice{}
|
|
for _, r := range t.r.FSInspectionsampledetails {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSInspectionsampledetails = rel
|
|
}
|
|
|
|
if t.r.FSLinelocations != nil {
|
|
rel := models.FSLinelocationSlice{}
|
|
for _, r := range t.r.FSLinelocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSLinelocations = rel
|
|
}
|
|
|
|
if t.r.FSLocationtrackings != nil {
|
|
rel := models.FSLocationtrackingSlice{}
|
|
for _, r := range t.r.FSLocationtrackings {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSLocationtrackings = rel
|
|
}
|
|
|
|
if t.r.FSMosquitoinspections != nil {
|
|
rel := models.FSMosquitoinspectionSlice{}
|
|
for _, r := range t.r.FSMosquitoinspections {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSMosquitoinspections = rel
|
|
}
|
|
|
|
if t.r.FSPointlocations != nil {
|
|
rel := models.FSPointlocationSlice{}
|
|
for _, r := range t.r.FSPointlocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSPointlocations = rel
|
|
}
|
|
|
|
if t.r.FSPolygonlocations != nil {
|
|
rel := models.FSPolygonlocationSlice{}
|
|
for _, r := range t.r.FSPolygonlocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSPolygonlocations = rel
|
|
}
|
|
|
|
if t.r.FSPools != nil {
|
|
rel := models.FSPoolSlice{}
|
|
for _, r := range t.r.FSPools {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSPools = rel
|
|
}
|
|
|
|
if t.r.FSPooldetails != nil {
|
|
rel := models.FSPooldetailSlice{}
|
|
for _, r := range t.r.FSPooldetails {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSPooldetails = rel
|
|
}
|
|
|
|
if t.r.FSProposedtreatmentareas != nil {
|
|
rel := models.FSProposedtreatmentareaSlice{}
|
|
for _, r := range t.r.FSProposedtreatmentareas {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSProposedtreatmentareas = rel
|
|
}
|
|
|
|
if t.r.FSQamosquitoinspections != nil {
|
|
rel := models.FSQamosquitoinspectionSlice{}
|
|
for _, r := range t.r.FSQamosquitoinspections {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSQamosquitoinspections = rel
|
|
}
|
|
|
|
if t.r.FSRodentlocations != nil {
|
|
rel := models.FSRodentlocationSlice{}
|
|
for _, r := range t.r.FSRodentlocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSRodentlocations = rel
|
|
}
|
|
|
|
if t.r.FSSamplecollections != nil {
|
|
rel := models.FSSamplecollectionSlice{}
|
|
for _, r := range t.r.FSSamplecollections {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSSamplecollections = rel
|
|
}
|
|
|
|
if t.r.FSSamplelocations != nil {
|
|
rel := models.FSSamplelocationSlice{}
|
|
for _, r := range t.r.FSSamplelocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSSamplelocations = rel
|
|
}
|
|
|
|
if t.r.FSServicerequests != nil {
|
|
rel := models.FSServicerequestSlice{}
|
|
for _, r := range t.r.FSServicerequests {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSServicerequests = rel
|
|
}
|
|
|
|
if t.r.FSSpeciesabundances != nil {
|
|
rel := models.FSSpeciesabundanceSlice{}
|
|
for _, r := range t.r.FSSpeciesabundances {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSSpeciesabundances = rel
|
|
}
|
|
|
|
if t.r.FSStormdrains != nil {
|
|
rel := models.FSStormdrainSlice{}
|
|
for _, r := range t.r.FSStormdrains {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSStormdrains = rel
|
|
}
|
|
|
|
if t.r.FSTimecards != nil {
|
|
rel := models.FSTimecardSlice{}
|
|
for _, r := range t.r.FSTimecards {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSTimecards = rel
|
|
}
|
|
|
|
if t.r.FSTrapdata != nil {
|
|
rel := models.FSTrapdatumSlice{}
|
|
for _, r := range t.r.FSTrapdata {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSTrapdata = rel
|
|
}
|
|
|
|
if t.r.FSTraplocations != nil {
|
|
rel := models.FSTraplocationSlice{}
|
|
for _, r := range t.r.FSTraplocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSTraplocations = rel
|
|
}
|
|
|
|
if t.r.FSTreatments != nil {
|
|
rel := models.FSTreatmentSlice{}
|
|
for _, r := range t.r.FSTreatments {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSTreatments = rel
|
|
}
|
|
|
|
if t.r.FSTreatmentareas != nil {
|
|
rel := models.FSTreatmentareaSlice{}
|
|
for _, r := range t.r.FSTreatmentareas {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSTreatmentareas = rel
|
|
}
|
|
|
|
if t.r.FSZones != nil {
|
|
rel := models.FSZoneSlice{}
|
|
for _, r := range t.r.FSZones {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSZones = rel
|
|
}
|
|
|
|
if t.r.FSZones2s != nil {
|
|
rel := models.FSZones2Slice{}
|
|
for _, r := range t.r.FSZones2s {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.FSZones2s = rel
|
|
}
|
|
|
|
if t.r.H3Aggregations != nil {
|
|
rel := models.H3AggregationSlice{}
|
|
for _, r := range t.r.H3Aggregations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.H3Aggregations = rel
|
|
}
|
|
|
|
if t.r.HistoryContainerrelates != nil {
|
|
rel := models.HistoryContainerrelateSlice{}
|
|
for _, r := range t.r.HistoryContainerrelates {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryContainerrelates = rel
|
|
}
|
|
|
|
if t.r.HistoryFieldscoutinglogs != nil {
|
|
rel := models.HistoryFieldscoutinglogSlice{}
|
|
for _, r := range t.r.HistoryFieldscoutinglogs {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryFieldscoutinglogs = rel
|
|
}
|
|
|
|
if t.r.HistoryHabitatrelates != nil {
|
|
rel := models.HistoryHabitatrelateSlice{}
|
|
for _, r := range t.r.HistoryHabitatrelates {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryHabitatrelates = rel
|
|
}
|
|
|
|
if t.r.HistoryInspectionsamples != nil {
|
|
rel := models.HistoryInspectionsampleSlice{}
|
|
for _, r := range t.r.HistoryInspectionsamples {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryInspectionsamples = rel
|
|
}
|
|
|
|
if t.r.HistoryInspectionsampledetails != nil {
|
|
rel := models.HistoryInspectionsampledetailSlice{}
|
|
for _, r := range t.r.HistoryInspectionsampledetails {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryInspectionsampledetails = rel
|
|
}
|
|
|
|
if t.r.HistoryLinelocations != nil {
|
|
rel := models.HistoryLinelocationSlice{}
|
|
for _, r := range t.r.HistoryLinelocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryLinelocations = rel
|
|
}
|
|
|
|
if t.r.HistoryLocationtrackings != nil {
|
|
rel := models.HistoryLocationtrackingSlice{}
|
|
for _, r := range t.r.HistoryLocationtrackings {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryLocationtrackings = rel
|
|
}
|
|
|
|
if t.r.HistoryMosquitoinspections != nil {
|
|
rel := models.HistoryMosquitoinspectionSlice{}
|
|
for _, r := range t.r.HistoryMosquitoinspections {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryMosquitoinspections = rel
|
|
}
|
|
|
|
if t.r.HistoryPointlocations != nil {
|
|
rel := models.HistoryPointlocationSlice{}
|
|
for _, r := range t.r.HistoryPointlocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryPointlocations = rel
|
|
}
|
|
|
|
if t.r.HistoryPolygonlocations != nil {
|
|
rel := models.HistoryPolygonlocationSlice{}
|
|
for _, r := range t.r.HistoryPolygonlocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryPolygonlocations = rel
|
|
}
|
|
|
|
if t.r.HistoryPools != nil {
|
|
rel := models.HistoryPoolSlice{}
|
|
for _, r := range t.r.HistoryPools {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryPools = rel
|
|
}
|
|
|
|
if t.r.HistoryPooldetails != nil {
|
|
rel := models.HistoryPooldetailSlice{}
|
|
for _, r := range t.r.HistoryPooldetails {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryPooldetails = rel
|
|
}
|
|
|
|
if t.r.HistoryProposedtreatmentareas != nil {
|
|
rel := models.HistoryProposedtreatmentareaSlice{}
|
|
for _, r := range t.r.HistoryProposedtreatmentareas {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryProposedtreatmentareas = rel
|
|
}
|
|
|
|
if t.r.HistoryQamosquitoinspections != nil {
|
|
rel := models.HistoryQamosquitoinspectionSlice{}
|
|
for _, r := range t.r.HistoryQamosquitoinspections {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryQamosquitoinspections = rel
|
|
}
|
|
|
|
if t.r.HistoryRodentlocations != nil {
|
|
rel := models.HistoryRodentlocationSlice{}
|
|
for _, r := range t.r.HistoryRodentlocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryRodentlocations = rel
|
|
}
|
|
|
|
if t.r.HistorySamplecollections != nil {
|
|
rel := models.HistorySamplecollectionSlice{}
|
|
for _, r := range t.r.HistorySamplecollections {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistorySamplecollections = rel
|
|
}
|
|
|
|
if t.r.HistorySamplelocations != nil {
|
|
rel := models.HistorySamplelocationSlice{}
|
|
for _, r := range t.r.HistorySamplelocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistorySamplelocations = rel
|
|
}
|
|
|
|
if t.r.HistoryServicerequests != nil {
|
|
rel := models.HistoryServicerequestSlice{}
|
|
for _, r := range t.r.HistoryServicerequests {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryServicerequests = rel
|
|
}
|
|
|
|
if t.r.HistorySpeciesabundances != nil {
|
|
rel := models.HistorySpeciesabundanceSlice{}
|
|
for _, r := range t.r.HistorySpeciesabundances {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistorySpeciesabundances = rel
|
|
}
|
|
|
|
if t.r.HistoryStormdrains != nil {
|
|
rel := models.HistoryStormdrainSlice{}
|
|
for _, r := range t.r.HistoryStormdrains {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryStormdrains = rel
|
|
}
|
|
|
|
if t.r.HistoryTimecards != nil {
|
|
rel := models.HistoryTimecardSlice{}
|
|
for _, r := range t.r.HistoryTimecards {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryTimecards = rel
|
|
}
|
|
|
|
if t.r.HistoryTrapdata != nil {
|
|
rel := models.HistoryTrapdatumSlice{}
|
|
for _, r := range t.r.HistoryTrapdata {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryTrapdata = rel
|
|
}
|
|
|
|
if t.r.HistoryTraplocations != nil {
|
|
rel := models.HistoryTraplocationSlice{}
|
|
for _, r := range t.r.HistoryTraplocations {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryTraplocations = rel
|
|
}
|
|
|
|
if t.r.HistoryTreatments != nil {
|
|
rel := models.HistoryTreatmentSlice{}
|
|
for _, r := range t.r.HistoryTreatments {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryTreatments = rel
|
|
}
|
|
|
|
if t.r.HistoryTreatmentareas != nil {
|
|
rel := models.HistoryTreatmentareaSlice{}
|
|
for _, r := range t.r.HistoryTreatmentareas {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryTreatmentareas = rel
|
|
}
|
|
|
|
if t.r.HistoryZones != nil {
|
|
rel := models.HistoryZoneSlice{}
|
|
for _, r := range t.r.HistoryZones {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryZones = rel
|
|
}
|
|
|
|
if t.r.HistoryZones2s != nil {
|
|
rel := models.HistoryZones2Slice{}
|
|
for _, r := range t.r.HistoryZones2s {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = o.ID // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.HistoryZones2s = rel
|
|
}
|
|
|
|
if t.r.User != nil {
|
|
rel := models.UserSlice{}
|
|
for _, r := range t.r.User {
|
|
related := r.o.BuildMany(r.number)
|
|
for _, rel := range related {
|
|
rel.OrganizationID = null.From(o.ID) // h2
|
|
rel.R.Organization = o
|
|
}
|
|
rel = append(rel, related...)
|
|
}
|
|
o.R.User = rel
|
|
}
|
|
}
|
|
|
|
// BuildSetter returns an *models.OrganizationSetter
|
|
// this does nothing with the relationship templates
|
|
func (o OrganizationTemplate) BuildSetter() *models.OrganizationSetter {
|
|
m := &models.OrganizationSetter{}
|
|
|
|
if o.ID != nil {
|
|
val := o.ID()
|
|
m.ID = omit.From(val)
|
|
}
|
|
if o.Name != nil {
|
|
val := o.Name()
|
|
m.Name = omitnull.FromNull(val)
|
|
}
|
|
if o.ArcgisID != nil {
|
|
val := o.ArcgisID()
|
|
m.ArcgisID = omitnull.FromNull(val)
|
|
}
|
|
if o.ArcgisName != nil {
|
|
val := o.ArcgisName()
|
|
m.ArcgisName = omitnull.FromNull(val)
|
|
}
|
|
if o.FieldseekerURL != nil {
|
|
val := o.FieldseekerURL()
|
|
m.FieldseekerURL = omitnull.FromNull(val)
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildManySetter returns an []*models.OrganizationSetter
|
|
// this does nothing with the relationship templates
|
|
func (o OrganizationTemplate) BuildManySetter(number int) []*models.OrganizationSetter {
|
|
m := make([]*models.OrganizationSetter, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.BuildSetter()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// Build returns an *models.Organization
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use OrganizationTemplate.Create
|
|
func (o OrganizationTemplate) Build() *models.Organization {
|
|
m := &models.Organization{}
|
|
|
|
if o.ID != nil {
|
|
m.ID = o.ID()
|
|
}
|
|
if o.Name != nil {
|
|
m.Name = o.Name()
|
|
}
|
|
if o.ArcgisID != nil {
|
|
m.ArcgisID = o.ArcgisID()
|
|
}
|
|
if o.ArcgisName != nil {
|
|
m.ArcgisName = o.ArcgisName()
|
|
}
|
|
if o.FieldseekerURL != nil {
|
|
m.FieldseekerURL = o.FieldseekerURL()
|
|
}
|
|
|
|
o.setModelRels(m)
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildMany returns an models.OrganizationSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use OrganizationTemplate.CreateMany
|
|
func (o OrganizationTemplate) BuildMany(number int) models.OrganizationSlice {
|
|
m := make(models.OrganizationSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func ensureCreatableOrganization(m *models.OrganizationSetter) {
|
|
}
|
|
|
|
// insertOptRels creates and inserts any optional the relationships on *models.Organization
|
|
// according to the relationships in the template.
|
|
// any required relationship should have already exist on the model
|
|
func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.Organization) error {
|
|
var err error
|
|
|
|
isRodentlocationsDone, _ := organizationRelRodentlocationsCtx.Value(ctx)
|
|
if !isRodentlocationsDone && o.r.Rodentlocations != nil {
|
|
ctx = organizationRelRodentlocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.Rodentlocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.Rodentlocations = append(m.R.Rodentlocations, r.o.Build())
|
|
} else {
|
|
rel0, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachRodentlocations(ctx, exec, rel0...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFieldseekerSyncsDone, _ := organizationRelFieldseekerSyncsCtx.Value(ctx)
|
|
if !isFieldseekerSyncsDone && o.r.FieldseekerSyncs != nil {
|
|
ctx = organizationRelFieldseekerSyncsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FieldseekerSyncs {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FieldseekerSyncs = append(m.R.FieldseekerSyncs, r.o.Build())
|
|
} else {
|
|
rel1, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFieldseekerSyncs(ctx, exec, rel1...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSContainerrelatesDone, _ := organizationRelFSContainerrelatesCtx.Value(ctx)
|
|
if !isFSContainerrelatesDone && o.r.FSContainerrelates != nil {
|
|
ctx = organizationRelFSContainerrelatesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSContainerrelates {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSContainerrelates = append(m.R.FSContainerrelates, r.o.Build())
|
|
} else {
|
|
rel2, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSContainerrelates(ctx, exec, rel2...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSFieldscoutinglogsDone, _ := organizationRelFSFieldscoutinglogsCtx.Value(ctx)
|
|
if !isFSFieldscoutinglogsDone && o.r.FSFieldscoutinglogs != nil {
|
|
ctx = organizationRelFSFieldscoutinglogsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSFieldscoutinglogs {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSFieldscoutinglogs = append(m.R.FSFieldscoutinglogs, r.o.Build())
|
|
} else {
|
|
rel3, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSFieldscoutinglogs(ctx, exec, rel3...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSHabitatrelatesDone, _ := organizationRelFSHabitatrelatesCtx.Value(ctx)
|
|
if !isFSHabitatrelatesDone && o.r.FSHabitatrelates != nil {
|
|
ctx = organizationRelFSHabitatrelatesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSHabitatrelates {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSHabitatrelates = append(m.R.FSHabitatrelates, r.o.Build())
|
|
} else {
|
|
rel4, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSHabitatrelates(ctx, exec, rel4...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSInspectionsamplesDone, _ := organizationRelFSInspectionsamplesCtx.Value(ctx)
|
|
if !isFSInspectionsamplesDone && o.r.FSInspectionsamples != nil {
|
|
ctx = organizationRelFSInspectionsamplesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSInspectionsamples {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSInspectionsamples = append(m.R.FSInspectionsamples, r.o.Build())
|
|
} else {
|
|
rel5, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSInspectionsamples(ctx, exec, rel5...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSInspectionsampledetailsDone, _ := organizationRelFSInspectionsampledetailsCtx.Value(ctx)
|
|
if !isFSInspectionsampledetailsDone && o.r.FSInspectionsampledetails != nil {
|
|
ctx = organizationRelFSInspectionsampledetailsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSInspectionsampledetails {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSInspectionsampledetails = append(m.R.FSInspectionsampledetails, r.o.Build())
|
|
} else {
|
|
rel6, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSInspectionsampledetails(ctx, exec, rel6...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSLinelocationsDone, _ := organizationRelFSLinelocationsCtx.Value(ctx)
|
|
if !isFSLinelocationsDone && o.r.FSLinelocations != nil {
|
|
ctx = organizationRelFSLinelocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSLinelocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSLinelocations = append(m.R.FSLinelocations, r.o.Build())
|
|
} else {
|
|
rel7, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSLinelocations(ctx, exec, rel7...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSLocationtrackingsDone, _ := organizationRelFSLocationtrackingsCtx.Value(ctx)
|
|
if !isFSLocationtrackingsDone && o.r.FSLocationtrackings != nil {
|
|
ctx = organizationRelFSLocationtrackingsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSLocationtrackings {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSLocationtrackings = append(m.R.FSLocationtrackings, r.o.Build())
|
|
} else {
|
|
rel8, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSLocationtrackings(ctx, exec, rel8...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSMosquitoinspectionsDone, _ := organizationRelFSMosquitoinspectionsCtx.Value(ctx)
|
|
if !isFSMosquitoinspectionsDone && o.r.FSMosquitoinspections != nil {
|
|
ctx = organizationRelFSMosquitoinspectionsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSMosquitoinspections {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSMosquitoinspections = append(m.R.FSMosquitoinspections, r.o.Build())
|
|
} else {
|
|
rel9, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSMosquitoinspections(ctx, exec, rel9...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSPointlocationsDone, _ := organizationRelFSPointlocationsCtx.Value(ctx)
|
|
if !isFSPointlocationsDone && o.r.FSPointlocations != nil {
|
|
ctx = organizationRelFSPointlocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSPointlocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSPointlocations = append(m.R.FSPointlocations, r.o.Build())
|
|
} else {
|
|
rel10, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSPointlocations(ctx, exec, rel10...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSPolygonlocationsDone, _ := organizationRelFSPolygonlocationsCtx.Value(ctx)
|
|
if !isFSPolygonlocationsDone && o.r.FSPolygonlocations != nil {
|
|
ctx = organizationRelFSPolygonlocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSPolygonlocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSPolygonlocations = append(m.R.FSPolygonlocations, r.o.Build())
|
|
} else {
|
|
rel11, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSPolygonlocations(ctx, exec, rel11...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSPoolsDone, _ := organizationRelFSPoolsCtx.Value(ctx)
|
|
if !isFSPoolsDone && o.r.FSPools != nil {
|
|
ctx = organizationRelFSPoolsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSPools {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSPools = append(m.R.FSPools, r.o.Build())
|
|
} else {
|
|
rel12, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSPools(ctx, exec, rel12...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSPooldetailsDone, _ := organizationRelFSPooldetailsCtx.Value(ctx)
|
|
if !isFSPooldetailsDone && o.r.FSPooldetails != nil {
|
|
ctx = organizationRelFSPooldetailsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSPooldetails {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSPooldetails = append(m.R.FSPooldetails, r.o.Build())
|
|
} else {
|
|
rel13, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSPooldetails(ctx, exec, rel13...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSProposedtreatmentareasDone, _ := organizationRelFSProposedtreatmentareasCtx.Value(ctx)
|
|
if !isFSProposedtreatmentareasDone && o.r.FSProposedtreatmentareas != nil {
|
|
ctx = organizationRelFSProposedtreatmentareasCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSProposedtreatmentareas {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSProposedtreatmentareas = append(m.R.FSProposedtreatmentareas, r.o.Build())
|
|
} else {
|
|
rel14, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSProposedtreatmentareas(ctx, exec, rel14...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSQamosquitoinspectionsDone, _ := organizationRelFSQamosquitoinspectionsCtx.Value(ctx)
|
|
if !isFSQamosquitoinspectionsDone && o.r.FSQamosquitoinspections != nil {
|
|
ctx = organizationRelFSQamosquitoinspectionsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSQamosquitoinspections {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSQamosquitoinspections = append(m.R.FSQamosquitoinspections, r.o.Build())
|
|
} else {
|
|
rel15, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSQamosquitoinspections(ctx, exec, rel15...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSRodentlocationsDone, _ := organizationRelFSRodentlocationsCtx.Value(ctx)
|
|
if !isFSRodentlocationsDone && o.r.FSRodentlocations != nil {
|
|
ctx = organizationRelFSRodentlocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSRodentlocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSRodentlocations = append(m.R.FSRodentlocations, r.o.Build())
|
|
} else {
|
|
rel16, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSRodentlocations(ctx, exec, rel16...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSSamplecollectionsDone, _ := organizationRelFSSamplecollectionsCtx.Value(ctx)
|
|
if !isFSSamplecollectionsDone && o.r.FSSamplecollections != nil {
|
|
ctx = organizationRelFSSamplecollectionsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSSamplecollections {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSSamplecollections = append(m.R.FSSamplecollections, r.o.Build())
|
|
} else {
|
|
rel17, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSSamplecollections(ctx, exec, rel17...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSSamplelocationsDone, _ := organizationRelFSSamplelocationsCtx.Value(ctx)
|
|
if !isFSSamplelocationsDone && o.r.FSSamplelocations != nil {
|
|
ctx = organizationRelFSSamplelocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSSamplelocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSSamplelocations = append(m.R.FSSamplelocations, r.o.Build())
|
|
} else {
|
|
rel18, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSSamplelocations(ctx, exec, rel18...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSServicerequestsDone, _ := organizationRelFSServicerequestsCtx.Value(ctx)
|
|
if !isFSServicerequestsDone && o.r.FSServicerequests != nil {
|
|
ctx = organizationRelFSServicerequestsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSServicerequests {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSServicerequests = append(m.R.FSServicerequests, r.o.Build())
|
|
} else {
|
|
rel19, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSServicerequests(ctx, exec, rel19...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSSpeciesabundancesDone, _ := organizationRelFSSpeciesabundancesCtx.Value(ctx)
|
|
if !isFSSpeciesabundancesDone && o.r.FSSpeciesabundances != nil {
|
|
ctx = organizationRelFSSpeciesabundancesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSSpeciesabundances {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSSpeciesabundances = append(m.R.FSSpeciesabundances, r.o.Build())
|
|
} else {
|
|
rel20, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSSpeciesabundances(ctx, exec, rel20...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSStormdrainsDone, _ := organizationRelFSStormdrainsCtx.Value(ctx)
|
|
if !isFSStormdrainsDone && o.r.FSStormdrains != nil {
|
|
ctx = organizationRelFSStormdrainsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSStormdrains {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSStormdrains = append(m.R.FSStormdrains, r.o.Build())
|
|
} else {
|
|
rel21, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSStormdrains(ctx, exec, rel21...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSTimecardsDone, _ := organizationRelFSTimecardsCtx.Value(ctx)
|
|
if !isFSTimecardsDone && o.r.FSTimecards != nil {
|
|
ctx = organizationRelFSTimecardsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSTimecards {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSTimecards = append(m.R.FSTimecards, r.o.Build())
|
|
} else {
|
|
rel22, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSTimecards(ctx, exec, rel22...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSTrapdataDone, _ := organizationRelFSTrapdataCtx.Value(ctx)
|
|
if !isFSTrapdataDone && o.r.FSTrapdata != nil {
|
|
ctx = organizationRelFSTrapdataCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSTrapdata {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSTrapdata = append(m.R.FSTrapdata, r.o.Build())
|
|
} else {
|
|
rel23, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSTrapdata(ctx, exec, rel23...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSTraplocationsDone, _ := organizationRelFSTraplocationsCtx.Value(ctx)
|
|
if !isFSTraplocationsDone && o.r.FSTraplocations != nil {
|
|
ctx = organizationRelFSTraplocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSTraplocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSTraplocations = append(m.R.FSTraplocations, r.o.Build())
|
|
} else {
|
|
rel24, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSTraplocations(ctx, exec, rel24...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSTreatmentsDone, _ := organizationRelFSTreatmentsCtx.Value(ctx)
|
|
if !isFSTreatmentsDone && o.r.FSTreatments != nil {
|
|
ctx = organizationRelFSTreatmentsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSTreatments {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSTreatments = append(m.R.FSTreatments, r.o.Build())
|
|
} else {
|
|
rel25, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSTreatments(ctx, exec, rel25...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSTreatmentareasDone, _ := organizationRelFSTreatmentareasCtx.Value(ctx)
|
|
if !isFSTreatmentareasDone && o.r.FSTreatmentareas != nil {
|
|
ctx = organizationRelFSTreatmentareasCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSTreatmentareas {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSTreatmentareas = append(m.R.FSTreatmentareas, r.o.Build())
|
|
} else {
|
|
rel26, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSTreatmentareas(ctx, exec, rel26...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSZonesDone, _ := organizationRelFSZonesCtx.Value(ctx)
|
|
if !isFSZonesDone && o.r.FSZones != nil {
|
|
ctx = organizationRelFSZonesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSZones {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSZones = append(m.R.FSZones, r.o.Build())
|
|
} else {
|
|
rel27, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSZones(ctx, exec, rel27...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isFSZones2sDone, _ := organizationRelFSZones2sCtx.Value(ctx)
|
|
if !isFSZones2sDone && o.r.FSZones2s != nil {
|
|
ctx = organizationRelFSZones2sCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.FSZones2s {
|
|
if r.o.alreadyPersisted {
|
|
m.R.FSZones2s = append(m.R.FSZones2s, r.o.Build())
|
|
} else {
|
|
rel28, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachFSZones2s(ctx, exec, rel28...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isH3AggregationsDone, _ := organizationRelH3AggregationsCtx.Value(ctx)
|
|
if !isH3AggregationsDone && o.r.H3Aggregations != nil {
|
|
ctx = organizationRelH3AggregationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.H3Aggregations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.H3Aggregations = append(m.R.H3Aggregations, r.o.Build())
|
|
} else {
|
|
rel29, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachH3Aggregations(ctx, exec, rel29...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryContainerrelatesDone, _ := organizationRelHistoryContainerrelatesCtx.Value(ctx)
|
|
if !isHistoryContainerrelatesDone && o.r.HistoryContainerrelates != nil {
|
|
ctx = organizationRelHistoryContainerrelatesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryContainerrelates {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryContainerrelates = append(m.R.HistoryContainerrelates, r.o.Build())
|
|
} else {
|
|
rel30, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryContainerrelates(ctx, exec, rel30...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryFieldscoutinglogsDone, _ := organizationRelHistoryFieldscoutinglogsCtx.Value(ctx)
|
|
if !isHistoryFieldscoutinglogsDone && o.r.HistoryFieldscoutinglogs != nil {
|
|
ctx = organizationRelHistoryFieldscoutinglogsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryFieldscoutinglogs {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryFieldscoutinglogs = append(m.R.HistoryFieldscoutinglogs, r.o.Build())
|
|
} else {
|
|
rel31, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryFieldscoutinglogs(ctx, exec, rel31...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryHabitatrelatesDone, _ := organizationRelHistoryHabitatrelatesCtx.Value(ctx)
|
|
if !isHistoryHabitatrelatesDone && o.r.HistoryHabitatrelates != nil {
|
|
ctx = organizationRelHistoryHabitatrelatesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryHabitatrelates {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryHabitatrelates = append(m.R.HistoryHabitatrelates, r.o.Build())
|
|
} else {
|
|
rel32, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryHabitatrelates(ctx, exec, rel32...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryInspectionsamplesDone, _ := organizationRelHistoryInspectionsamplesCtx.Value(ctx)
|
|
if !isHistoryInspectionsamplesDone && o.r.HistoryInspectionsamples != nil {
|
|
ctx = organizationRelHistoryInspectionsamplesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryInspectionsamples {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryInspectionsamples = append(m.R.HistoryInspectionsamples, r.o.Build())
|
|
} else {
|
|
rel33, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryInspectionsamples(ctx, exec, rel33...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryInspectionsampledetailsDone, _ := organizationRelHistoryInspectionsampledetailsCtx.Value(ctx)
|
|
if !isHistoryInspectionsampledetailsDone && o.r.HistoryInspectionsampledetails != nil {
|
|
ctx = organizationRelHistoryInspectionsampledetailsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryInspectionsampledetails {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryInspectionsampledetails = append(m.R.HistoryInspectionsampledetails, r.o.Build())
|
|
} else {
|
|
rel34, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryInspectionsampledetails(ctx, exec, rel34...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryLinelocationsDone, _ := organizationRelHistoryLinelocationsCtx.Value(ctx)
|
|
if !isHistoryLinelocationsDone && o.r.HistoryLinelocations != nil {
|
|
ctx = organizationRelHistoryLinelocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryLinelocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryLinelocations = append(m.R.HistoryLinelocations, r.o.Build())
|
|
} else {
|
|
rel35, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryLinelocations(ctx, exec, rel35...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryLocationtrackingsDone, _ := organizationRelHistoryLocationtrackingsCtx.Value(ctx)
|
|
if !isHistoryLocationtrackingsDone && o.r.HistoryLocationtrackings != nil {
|
|
ctx = organizationRelHistoryLocationtrackingsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryLocationtrackings {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryLocationtrackings = append(m.R.HistoryLocationtrackings, r.o.Build())
|
|
} else {
|
|
rel36, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryLocationtrackings(ctx, exec, rel36...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryMosquitoinspectionsDone, _ := organizationRelHistoryMosquitoinspectionsCtx.Value(ctx)
|
|
if !isHistoryMosquitoinspectionsDone && o.r.HistoryMosquitoinspections != nil {
|
|
ctx = organizationRelHistoryMosquitoinspectionsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryMosquitoinspections {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryMosquitoinspections = append(m.R.HistoryMosquitoinspections, r.o.Build())
|
|
} else {
|
|
rel37, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryMosquitoinspections(ctx, exec, rel37...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryPointlocationsDone, _ := organizationRelHistoryPointlocationsCtx.Value(ctx)
|
|
if !isHistoryPointlocationsDone && o.r.HistoryPointlocations != nil {
|
|
ctx = organizationRelHistoryPointlocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryPointlocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryPointlocations = append(m.R.HistoryPointlocations, r.o.Build())
|
|
} else {
|
|
rel38, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryPointlocations(ctx, exec, rel38...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryPolygonlocationsDone, _ := organizationRelHistoryPolygonlocationsCtx.Value(ctx)
|
|
if !isHistoryPolygonlocationsDone && o.r.HistoryPolygonlocations != nil {
|
|
ctx = organizationRelHistoryPolygonlocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryPolygonlocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryPolygonlocations = append(m.R.HistoryPolygonlocations, r.o.Build())
|
|
} else {
|
|
rel39, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryPolygonlocations(ctx, exec, rel39...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryPoolsDone, _ := organizationRelHistoryPoolsCtx.Value(ctx)
|
|
if !isHistoryPoolsDone && o.r.HistoryPools != nil {
|
|
ctx = organizationRelHistoryPoolsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryPools {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryPools = append(m.R.HistoryPools, r.o.Build())
|
|
} else {
|
|
rel40, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryPools(ctx, exec, rel40...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryPooldetailsDone, _ := organizationRelHistoryPooldetailsCtx.Value(ctx)
|
|
if !isHistoryPooldetailsDone && o.r.HistoryPooldetails != nil {
|
|
ctx = organizationRelHistoryPooldetailsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryPooldetails {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryPooldetails = append(m.R.HistoryPooldetails, r.o.Build())
|
|
} else {
|
|
rel41, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryPooldetails(ctx, exec, rel41...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryProposedtreatmentareasDone, _ := organizationRelHistoryProposedtreatmentareasCtx.Value(ctx)
|
|
if !isHistoryProposedtreatmentareasDone && o.r.HistoryProposedtreatmentareas != nil {
|
|
ctx = organizationRelHistoryProposedtreatmentareasCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryProposedtreatmentareas {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryProposedtreatmentareas = append(m.R.HistoryProposedtreatmentareas, r.o.Build())
|
|
} else {
|
|
rel42, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryProposedtreatmentareas(ctx, exec, rel42...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryQamosquitoinspectionsDone, _ := organizationRelHistoryQamosquitoinspectionsCtx.Value(ctx)
|
|
if !isHistoryQamosquitoinspectionsDone && o.r.HistoryQamosquitoinspections != nil {
|
|
ctx = organizationRelHistoryQamosquitoinspectionsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryQamosquitoinspections {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryQamosquitoinspections = append(m.R.HistoryQamosquitoinspections, r.o.Build())
|
|
} else {
|
|
rel43, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryQamosquitoinspections(ctx, exec, rel43...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryRodentlocationsDone, _ := organizationRelHistoryRodentlocationsCtx.Value(ctx)
|
|
if !isHistoryRodentlocationsDone && o.r.HistoryRodentlocations != nil {
|
|
ctx = organizationRelHistoryRodentlocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryRodentlocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryRodentlocations = append(m.R.HistoryRodentlocations, r.o.Build())
|
|
} else {
|
|
rel44, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryRodentlocations(ctx, exec, rel44...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistorySamplecollectionsDone, _ := organizationRelHistorySamplecollectionsCtx.Value(ctx)
|
|
if !isHistorySamplecollectionsDone && o.r.HistorySamplecollections != nil {
|
|
ctx = organizationRelHistorySamplecollectionsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistorySamplecollections {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistorySamplecollections = append(m.R.HistorySamplecollections, r.o.Build())
|
|
} else {
|
|
rel45, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistorySamplecollections(ctx, exec, rel45...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistorySamplelocationsDone, _ := organizationRelHistorySamplelocationsCtx.Value(ctx)
|
|
if !isHistorySamplelocationsDone && o.r.HistorySamplelocations != nil {
|
|
ctx = organizationRelHistorySamplelocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistorySamplelocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistorySamplelocations = append(m.R.HistorySamplelocations, r.o.Build())
|
|
} else {
|
|
rel46, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistorySamplelocations(ctx, exec, rel46...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryServicerequestsDone, _ := organizationRelHistoryServicerequestsCtx.Value(ctx)
|
|
if !isHistoryServicerequestsDone && o.r.HistoryServicerequests != nil {
|
|
ctx = organizationRelHistoryServicerequestsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryServicerequests {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryServicerequests = append(m.R.HistoryServicerequests, r.o.Build())
|
|
} else {
|
|
rel47, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryServicerequests(ctx, exec, rel47...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistorySpeciesabundancesDone, _ := organizationRelHistorySpeciesabundancesCtx.Value(ctx)
|
|
if !isHistorySpeciesabundancesDone && o.r.HistorySpeciesabundances != nil {
|
|
ctx = organizationRelHistorySpeciesabundancesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistorySpeciesabundances {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistorySpeciesabundances = append(m.R.HistorySpeciesabundances, r.o.Build())
|
|
} else {
|
|
rel48, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistorySpeciesabundances(ctx, exec, rel48...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryStormdrainsDone, _ := organizationRelHistoryStormdrainsCtx.Value(ctx)
|
|
if !isHistoryStormdrainsDone && o.r.HistoryStormdrains != nil {
|
|
ctx = organizationRelHistoryStormdrainsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryStormdrains {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryStormdrains = append(m.R.HistoryStormdrains, r.o.Build())
|
|
} else {
|
|
rel49, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryStormdrains(ctx, exec, rel49...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryTimecardsDone, _ := organizationRelHistoryTimecardsCtx.Value(ctx)
|
|
if !isHistoryTimecardsDone && o.r.HistoryTimecards != nil {
|
|
ctx = organizationRelHistoryTimecardsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryTimecards {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryTimecards = append(m.R.HistoryTimecards, r.o.Build())
|
|
} else {
|
|
rel50, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryTimecards(ctx, exec, rel50...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryTrapdataDone, _ := organizationRelHistoryTrapdataCtx.Value(ctx)
|
|
if !isHistoryTrapdataDone && o.r.HistoryTrapdata != nil {
|
|
ctx = organizationRelHistoryTrapdataCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryTrapdata {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryTrapdata = append(m.R.HistoryTrapdata, r.o.Build())
|
|
} else {
|
|
rel51, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryTrapdata(ctx, exec, rel51...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryTraplocationsDone, _ := organizationRelHistoryTraplocationsCtx.Value(ctx)
|
|
if !isHistoryTraplocationsDone && o.r.HistoryTraplocations != nil {
|
|
ctx = organizationRelHistoryTraplocationsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryTraplocations {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryTraplocations = append(m.R.HistoryTraplocations, r.o.Build())
|
|
} else {
|
|
rel52, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryTraplocations(ctx, exec, rel52...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryTreatmentsDone, _ := organizationRelHistoryTreatmentsCtx.Value(ctx)
|
|
if !isHistoryTreatmentsDone && o.r.HistoryTreatments != nil {
|
|
ctx = organizationRelHistoryTreatmentsCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryTreatments {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryTreatments = append(m.R.HistoryTreatments, r.o.Build())
|
|
} else {
|
|
rel53, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryTreatments(ctx, exec, rel53...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryTreatmentareasDone, _ := organizationRelHistoryTreatmentareasCtx.Value(ctx)
|
|
if !isHistoryTreatmentareasDone && o.r.HistoryTreatmentareas != nil {
|
|
ctx = organizationRelHistoryTreatmentareasCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryTreatmentareas {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryTreatmentareas = append(m.R.HistoryTreatmentareas, r.o.Build())
|
|
} else {
|
|
rel54, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryTreatmentareas(ctx, exec, rel54...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryZonesDone, _ := organizationRelHistoryZonesCtx.Value(ctx)
|
|
if !isHistoryZonesDone && o.r.HistoryZones != nil {
|
|
ctx = organizationRelHistoryZonesCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryZones {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryZones = append(m.R.HistoryZones, r.o.Build())
|
|
} else {
|
|
rel55, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryZones(ctx, exec, rel55...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isHistoryZones2sDone, _ := organizationRelHistoryZones2sCtx.Value(ctx)
|
|
if !isHistoryZones2sDone && o.r.HistoryZones2s != nil {
|
|
ctx = organizationRelHistoryZones2sCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.HistoryZones2s {
|
|
if r.o.alreadyPersisted {
|
|
m.R.HistoryZones2s = append(m.R.HistoryZones2s, r.o.Build())
|
|
} else {
|
|
rel56, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachHistoryZones2s(ctx, exec, rel56...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
isUserDone, _ := organizationRelUserCtx.Value(ctx)
|
|
if !isUserDone && o.r.User != nil {
|
|
ctx = organizationRelUserCtx.WithValue(ctx, true)
|
|
for _, r := range o.r.User {
|
|
if r.o.alreadyPersisted {
|
|
m.R.User = append(m.R.User, r.o.Build())
|
|
} else {
|
|
rel57, err := r.o.CreateMany(ctx, exec, r.number)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = m.AttachUser(ctx, exec, rel57...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
// Create builds a organization and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o *OrganizationTemplate) Create(ctx context.Context, exec bob.Executor) (*models.Organization, error) {
|
|
var err error
|
|
opt := o.BuildSetter()
|
|
ensureCreatableOrganization(opt)
|
|
|
|
m, err := models.Organizations.Insert(opt).One(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if err := o.insertOptRels(ctx, exec, m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, err
|
|
}
|
|
|
|
// MustCreate builds a organization and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o *OrganizationTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.Organization {
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateOrFail builds a organization 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 *OrganizationTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.Organization {
|
|
tb.Helper()
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateMany builds multiple organizations and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o OrganizationTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.OrganizationSlice, error) {
|
|
var err error
|
|
m := make(models.OrganizationSlice, number)
|
|
|
|
for i := range m {
|
|
m[i], err = o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
return m, nil
|
|
}
|
|
|
|
// MustCreateMany builds multiple organizations and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o OrganizationTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.OrganizationSlice {
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateManyOrFail builds multiple organizations 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 OrganizationTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.OrganizationSlice {
|
|
tb.Helper()
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// Organization has methods that act as mods for the OrganizationTemplate
|
|
var OrganizationMods organizationMods
|
|
|
|
type organizationMods struct{}
|
|
|
|
func (m organizationMods) RandomizeAllColumns(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModSlice{
|
|
OrganizationMods.RandomID(f),
|
|
OrganizationMods.RandomName(f),
|
|
OrganizationMods.RandomArcgisID(f),
|
|
OrganizationMods.RandomArcgisName(f),
|
|
OrganizationMods.RandomFieldseekerURL(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m organizationMods) ID(val int32) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ID = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m organizationMods) IDFunc(f func() int32) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m organizationMods) UnsetID() OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ID = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m organizationMods) RandomID(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ID = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m organizationMods) Name(val null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.Name = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m organizationMods) NameFunc(f func() null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.Name = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m organizationMods) UnsetName() OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.Name = 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 organizationMods) RandomName(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.Name = 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 organizationMods) RandomNameNotNull(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.Name = 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 organizationMods) ArcgisID(val null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisID = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m organizationMods) ArcgisIDFunc(f func() null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m organizationMods) UnsetArcgisID() OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisID = 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 organizationMods) RandomArcgisID(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisID = 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 organizationMods) RandomArcgisIDNotNull(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisID = 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 organizationMods) ArcgisName(val null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisName = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m organizationMods) ArcgisNameFunc(f func() null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisName = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m organizationMods) UnsetArcgisName() OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisName = 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 organizationMods) RandomArcgisName(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisName = 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 organizationMods) RandomArcgisNameNotNull(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.ArcgisName = 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 organizationMods) FieldseekerURL(val null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.FieldseekerURL = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m organizationMods) FieldseekerURLFunc(f func() null.Val[string]) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.FieldseekerURL = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m organizationMods) UnsetFieldseekerURL() OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.FieldseekerURL = 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 organizationMods) RandomFieldseekerURL(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.FieldseekerURL = 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 organizationMods) RandomFieldseekerURLNotNull(f *faker.Faker) OrganizationMod {
|
|
return OrganizationModFunc(func(_ context.Context, o *OrganizationTemplate) {
|
|
o.FieldseekerURL = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithParentsCascading() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
if isDone, _ := organizationWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = organizationWithParentsCascadingCtx.WithValue(ctx, true)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithRodentlocations(number int, related *FieldseekerRodentlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.Rodentlocations = []*organizationRRodentlocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewRodentlocations(number int, mods ...FieldseekerRodentlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFieldseekerRodentlocationWithContext(ctx, mods...)
|
|
m.WithRodentlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddRodentlocations(number int, related *FieldseekerRodentlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.Rodentlocations = append(o.r.Rodentlocations, &organizationRRodentlocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewRodentlocations(number int, mods ...FieldseekerRodentlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFieldseekerRodentlocationWithContext(ctx, mods...)
|
|
m.AddRodentlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingRodentlocations(existingModels ...*models.FieldseekerRodentlocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.Rodentlocations = append(o.r.Rodentlocations, &organizationRRodentlocationsR{
|
|
o: o.f.FromExistingFieldseekerRodentlocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutRodentlocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.Rodentlocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFieldseekerSyncs(number int, related *FieldseekerSyncTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FieldseekerSyncs = []*organizationRFieldseekerSyncsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFieldseekerSyncs(number int, mods ...FieldseekerSyncMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFieldseekerSyncWithContext(ctx, mods...)
|
|
m.WithFieldseekerSyncs(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFieldseekerSyncs(number int, related *FieldseekerSyncTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FieldseekerSyncs = append(o.r.FieldseekerSyncs, &organizationRFieldseekerSyncsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFieldseekerSyncs(number int, mods ...FieldseekerSyncMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFieldseekerSyncWithContext(ctx, mods...)
|
|
m.AddFieldseekerSyncs(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFieldseekerSyncs(existingModels ...*models.FieldseekerSync) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FieldseekerSyncs = append(o.r.FieldseekerSyncs, &organizationRFieldseekerSyncsR{
|
|
o: o.f.FromExistingFieldseekerSync(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFieldseekerSyncs() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FieldseekerSyncs = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSContainerrelates(number int, related *FSContainerrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSContainerrelates = []*organizationRFSContainerrelatesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSContainerrelates(number int, mods ...FSContainerrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSContainerrelateWithContext(ctx, mods...)
|
|
m.WithFSContainerrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSContainerrelates(number int, related *FSContainerrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSContainerrelates = append(o.r.FSContainerrelates, &organizationRFSContainerrelatesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSContainerrelates(number int, mods ...FSContainerrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSContainerrelateWithContext(ctx, mods...)
|
|
m.AddFSContainerrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSContainerrelates(existingModels ...*models.FSContainerrelate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSContainerrelates = append(o.r.FSContainerrelates, &organizationRFSContainerrelatesR{
|
|
o: o.f.FromExistingFSContainerrelate(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSContainerrelates() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSContainerrelates = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSFieldscoutinglogs(number int, related *FSFieldscoutinglogTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSFieldscoutinglogs = []*organizationRFSFieldscoutinglogsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSFieldscoutinglogs(number int, mods ...FSFieldscoutinglogMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSFieldscoutinglogWithContext(ctx, mods...)
|
|
m.WithFSFieldscoutinglogs(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSFieldscoutinglogs(number int, related *FSFieldscoutinglogTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSFieldscoutinglogs = append(o.r.FSFieldscoutinglogs, &organizationRFSFieldscoutinglogsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSFieldscoutinglogs(number int, mods ...FSFieldscoutinglogMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSFieldscoutinglogWithContext(ctx, mods...)
|
|
m.AddFSFieldscoutinglogs(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSFieldscoutinglogs(existingModels ...*models.FSFieldscoutinglog) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSFieldscoutinglogs = append(o.r.FSFieldscoutinglogs, &organizationRFSFieldscoutinglogsR{
|
|
o: o.f.FromExistingFSFieldscoutinglog(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSFieldscoutinglogs() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSFieldscoutinglogs = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSHabitatrelates(number int, related *FSHabitatrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSHabitatrelates = []*organizationRFSHabitatrelatesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSHabitatrelates(number int, mods ...FSHabitatrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSHabitatrelateWithContext(ctx, mods...)
|
|
m.WithFSHabitatrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSHabitatrelates(number int, related *FSHabitatrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSHabitatrelates = append(o.r.FSHabitatrelates, &organizationRFSHabitatrelatesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSHabitatrelates(number int, mods ...FSHabitatrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSHabitatrelateWithContext(ctx, mods...)
|
|
m.AddFSHabitatrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSHabitatrelates(existingModels ...*models.FSHabitatrelate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSHabitatrelates = append(o.r.FSHabitatrelates, &organizationRFSHabitatrelatesR{
|
|
o: o.f.FromExistingFSHabitatrelate(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSHabitatrelates() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSHabitatrelates = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSInspectionsamples(number int, related *FSInspectionsampleTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSInspectionsamples = []*organizationRFSInspectionsamplesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSInspectionsamples(number int, mods ...FSInspectionsampleMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSInspectionsampleWithContext(ctx, mods...)
|
|
m.WithFSInspectionsamples(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSInspectionsamples(number int, related *FSInspectionsampleTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSInspectionsamples = append(o.r.FSInspectionsamples, &organizationRFSInspectionsamplesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSInspectionsamples(number int, mods ...FSInspectionsampleMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSInspectionsampleWithContext(ctx, mods...)
|
|
m.AddFSInspectionsamples(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSInspectionsamples(existingModels ...*models.FSInspectionsample) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSInspectionsamples = append(o.r.FSInspectionsamples, &organizationRFSInspectionsamplesR{
|
|
o: o.f.FromExistingFSInspectionsample(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSInspectionsamples() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSInspectionsamples = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSInspectionsampledetails(number int, related *FSInspectionsampledetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSInspectionsampledetails = []*organizationRFSInspectionsampledetailsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSInspectionsampledetails(number int, mods ...FSInspectionsampledetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSInspectionsampledetailWithContext(ctx, mods...)
|
|
m.WithFSInspectionsampledetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSInspectionsampledetails(number int, related *FSInspectionsampledetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSInspectionsampledetails = append(o.r.FSInspectionsampledetails, &organizationRFSInspectionsampledetailsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSInspectionsampledetails(number int, mods ...FSInspectionsampledetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSInspectionsampledetailWithContext(ctx, mods...)
|
|
m.AddFSInspectionsampledetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSInspectionsampledetails(existingModels ...*models.FSInspectionsampledetail) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSInspectionsampledetails = append(o.r.FSInspectionsampledetails, &organizationRFSInspectionsampledetailsR{
|
|
o: o.f.FromExistingFSInspectionsampledetail(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSInspectionsampledetails() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSInspectionsampledetails = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSLinelocations(number int, related *FSLinelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSLinelocations = []*organizationRFSLinelocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSLinelocations(number int, mods ...FSLinelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSLinelocationWithContext(ctx, mods...)
|
|
m.WithFSLinelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSLinelocations(number int, related *FSLinelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSLinelocations = append(o.r.FSLinelocations, &organizationRFSLinelocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSLinelocations(number int, mods ...FSLinelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSLinelocationWithContext(ctx, mods...)
|
|
m.AddFSLinelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSLinelocations(existingModels ...*models.FSLinelocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSLinelocations = append(o.r.FSLinelocations, &organizationRFSLinelocationsR{
|
|
o: o.f.FromExistingFSLinelocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSLinelocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSLinelocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSLocationtrackings(number int, related *FSLocationtrackingTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSLocationtrackings = []*organizationRFSLocationtrackingsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSLocationtrackings(number int, mods ...FSLocationtrackingMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSLocationtrackingWithContext(ctx, mods...)
|
|
m.WithFSLocationtrackings(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSLocationtrackings(number int, related *FSLocationtrackingTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSLocationtrackings = append(o.r.FSLocationtrackings, &organizationRFSLocationtrackingsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSLocationtrackings(number int, mods ...FSLocationtrackingMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSLocationtrackingWithContext(ctx, mods...)
|
|
m.AddFSLocationtrackings(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSLocationtrackings(existingModels ...*models.FSLocationtracking) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSLocationtrackings = append(o.r.FSLocationtrackings, &organizationRFSLocationtrackingsR{
|
|
o: o.f.FromExistingFSLocationtracking(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSLocationtrackings() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSLocationtrackings = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSMosquitoinspections(number int, related *FSMosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSMosquitoinspections = []*organizationRFSMosquitoinspectionsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSMosquitoinspections(number int, mods ...FSMosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSMosquitoinspectionWithContext(ctx, mods...)
|
|
m.WithFSMosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSMosquitoinspections(number int, related *FSMosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSMosquitoinspections = append(o.r.FSMosquitoinspections, &organizationRFSMosquitoinspectionsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSMosquitoinspections(number int, mods ...FSMosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSMosquitoinspectionWithContext(ctx, mods...)
|
|
m.AddFSMosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSMosquitoinspections(existingModels ...*models.FSMosquitoinspection) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSMosquitoinspections = append(o.r.FSMosquitoinspections, &organizationRFSMosquitoinspectionsR{
|
|
o: o.f.FromExistingFSMosquitoinspection(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSMosquitoinspections() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSMosquitoinspections = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSPointlocations(number int, related *FSPointlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPointlocations = []*organizationRFSPointlocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSPointlocations(number int, mods ...FSPointlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPointlocationWithContext(ctx, mods...)
|
|
m.WithFSPointlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSPointlocations(number int, related *FSPointlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPointlocations = append(o.r.FSPointlocations, &organizationRFSPointlocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSPointlocations(number int, mods ...FSPointlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPointlocationWithContext(ctx, mods...)
|
|
m.AddFSPointlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSPointlocations(existingModels ...*models.FSPointlocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSPointlocations = append(o.r.FSPointlocations, &organizationRFSPointlocationsR{
|
|
o: o.f.FromExistingFSPointlocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSPointlocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPointlocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSPolygonlocations(number int, related *FSPolygonlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPolygonlocations = []*organizationRFSPolygonlocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSPolygonlocations(number int, mods ...FSPolygonlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPolygonlocationWithContext(ctx, mods...)
|
|
m.WithFSPolygonlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSPolygonlocations(number int, related *FSPolygonlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPolygonlocations = append(o.r.FSPolygonlocations, &organizationRFSPolygonlocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSPolygonlocations(number int, mods ...FSPolygonlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPolygonlocationWithContext(ctx, mods...)
|
|
m.AddFSPolygonlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSPolygonlocations(existingModels ...*models.FSPolygonlocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSPolygonlocations = append(o.r.FSPolygonlocations, &organizationRFSPolygonlocationsR{
|
|
o: o.f.FromExistingFSPolygonlocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSPolygonlocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPolygonlocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSPools(number int, related *FSPoolTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPools = []*organizationRFSPoolsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSPools(number int, mods ...FSPoolMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPoolWithContext(ctx, mods...)
|
|
m.WithFSPools(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSPools(number int, related *FSPoolTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPools = append(o.r.FSPools, &organizationRFSPoolsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSPools(number int, mods ...FSPoolMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPoolWithContext(ctx, mods...)
|
|
m.AddFSPools(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSPools(existingModels ...*models.FSPool) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSPools = append(o.r.FSPools, &organizationRFSPoolsR{
|
|
o: o.f.FromExistingFSPool(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSPools() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPools = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSPooldetails(number int, related *FSPooldetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPooldetails = []*organizationRFSPooldetailsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSPooldetails(number int, mods ...FSPooldetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPooldetailWithContext(ctx, mods...)
|
|
m.WithFSPooldetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSPooldetails(number int, related *FSPooldetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPooldetails = append(o.r.FSPooldetails, &organizationRFSPooldetailsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSPooldetails(number int, mods ...FSPooldetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSPooldetailWithContext(ctx, mods...)
|
|
m.AddFSPooldetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSPooldetails(existingModels ...*models.FSPooldetail) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSPooldetails = append(o.r.FSPooldetails, &organizationRFSPooldetailsR{
|
|
o: o.f.FromExistingFSPooldetail(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSPooldetails() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSPooldetails = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSProposedtreatmentareas(number int, related *FSProposedtreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSProposedtreatmentareas = []*organizationRFSProposedtreatmentareasR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSProposedtreatmentareas(number int, mods ...FSProposedtreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSProposedtreatmentareaWithContext(ctx, mods...)
|
|
m.WithFSProposedtreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSProposedtreatmentareas(number int, related *FSProposedtreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSProposedtreatmentareas = append(o.r.FSProposedtreatmentareas, &organizationRFSProposedtreatmentareasR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSProposedtreatmentareas(number int, mods ...FSProposedtreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSProposedtreatmentareaWithContext(ctx, mods...)
|
|
m.AddFSProposedtreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSProposedtreatmentareas(existingModels ...*models.FSProposedtreatmentarea) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSProposedtreatmentareas = append(o.r.FSProposedtreatmentareas, &organizationRFSProposedtreatmentareasR{
|
|
o: o.f.FromExistingFSProposedtreatmentarea(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSProposedtreatmentareas() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSProposedtreatmentareas = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSQamosquitoinspections(number int, related *FSQamosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSQamosquitoinspections = []*organizationRFSQamosquitoinspectionsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSQamosquitoinspections(number int, mods ...FSQamosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSQamosquitoinspectionWithContext(ctx, mods...)
|
|
m.WithFSQamosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSQamosquitoinspections(number int, related *FSQamosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSQamosquitoinspections = append(o.r.FSQamosquitoinspections, &organizationRFSQamosquitoinspectionsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSQamosquitoinspections(number int, mods ...FSQamosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSQamosquitoinspectionWithContext(ctx, mods...)
|
|
m.AddFSQamosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSQamosquitoinspections(existingModels ...*models.FSQamosquitoinspection) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSQamosquitoinspections = append(o.r.FSQamosquitoinspections, &organizationRFSQamosquitoinspectionsR{
|
|
o: o.f.FromExistingFSQamosquitoinspection(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSQamosquitoinspections() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSQamosquitoinspections = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSRodentlocations(number int, related *FSRodentlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSRodentlocations = []*organizationRFSRodentlocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSRodentlocations(number int, mods ...FSRodentlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSRodentlocationWithContext(ctx, mods...)
|
|
m.WithFSRodentlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSRodentlocations(number int, related *FSRodentlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSRodentlocations = append(o.r.FSRodentlocations, &organizationRFSRodentlocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSRodentlocations(number int, mods ...FSRodentlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSRodentlocationWithContext(ctx, mods...)
|
|
m.AddFSRodentlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSRodentlocations(existingModels ...*models.FSRodentlocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSRodentlocations = append(o.r.FSRodentlocations, &organizationRFSRodentlocationsR{
|
|
o: o.f.FromExistingFSRodentlocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSRodentlocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSRodentlocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSSamplecollections(number int, related *FSSamplecollectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSamplecollections = []*organizationRFSSamplecollectionsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSSamplecollections(number int, mods ...FSSamplecollectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSSamplecollectionWithContext(ctx, mods...)
|
|
m.WithFSSamplecollections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSSamplecollections(number int, related *FSSamplecollectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSamplecollections = append(o.r.FSSamplecollections, &organizationRFSSamplecollectionsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSSamplecollections(number int, mods ...FSSamplecollectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSSamplecollectionWithContext(ctx, mods...)
|
|
m.AddFSSamplecollections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSSamplecollections(existingModels ...*models.FSSamplecollection) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSSamplecollections = append(o.r.FSSamplecollections, &organizationRFSSamplecollectionsR{
|
|
o: o.f.FromExistingFSSamplecollection(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSSamplecollections() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSamplecollections = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSSamplelocations(number int, related *FSSamplelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSamplelocations = []*organizationRFSSamplelocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSSamplelocations(number int, mods ...FSSamplelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSSamplelocationWithContext(ctx, mods...)
|
|
m.WithFSSamplelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSSamplelocations(number int, related *FSSamplelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSamplelocations = append(o.r.FSSamplelocations, &organizationRFSSamplelocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSSamplelocations(number int, mods ...FSSamplelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSSamplelocationWithContext(ctx, mods...)
|
|
m.AddFSSamplelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSSamplelocations(existingModels ...*models.FSSamplelocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSSamplelocations = append(o.r.FSSamplelocations, &organizationRFSSamplelocationsR{
|
|
o: o.f.FromExistingFSSamplelocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSSamplelocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSamplelocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSServicerequests(number int, related *FSServicerequestTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSServicerequests = []*organizationRFSServicerequestsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSServicerequests(number int, mods ...FSServicerequestMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSServicerequestWithContext(ctx, mods...)
|
|
m.WithFSServicerequests(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSServicerequests(number int, related *FSServicerequestTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSServicerequests = append(o.r.FSServicerequests, &organizationRFSServicerequestsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSServicerequests(number int, mods ...FSServicerequestMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSServicerequestWithContext(ctx, mods...)
|
|
m.AddFSServicerequests(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSServicerequests(existingModels ...*models.FSServicerequest) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSServicerequests = append(o.r.FSServicerequests, &organizationRFSServicerequestsR{
|
|
o: o.f.FromExistingFSServicerequest(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSServicerequests() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSServicerequests = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSSpeciesabundances(number int, related *FSSpeciesabundanceTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSpeciesabundances = []*organizationRFSSpeciesabundancesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSSpeciesabundances(number int, mods ...FSSpeciesabundanceMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSSpeciesabundanceWithContext(ctx, mods...)
|
|
m.WithFSSpeciesabundances(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSSpeciesabundances(number int, related *FSSpeciesabundanceTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSpeciesabundances = append(o.r.FSSpeciesabundances, &organizationRFSSpeciesabundancesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSSpeciesabundances(number int, mods ...FSSpeciesabundanceMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSSpeciesabundanceWithContext(ctx, mods...)
|
|
m.AddFSSpeciesabundances(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSSpeciesabundances(existingModels ...*models.FSSpeciesabundance) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSSpeciesabundances = append(o.r.FSSpeciesabundances, &organizationRFSSpeciesabundancesR{
|
|
o: o.f.FromExistingFSSpeciesabundance(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSSpeciesabundances() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSSpeciesabundances = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSStormdrains(number int, related *FSStormdrainTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSStormdrains = []*organizationRFSStormdrainsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSStormdrains(number int, mods ...FSStormdrainMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSStormdrainWithContext(ctx, mods...)
|
|
m.WithFSStormdrains(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSStormdrains(number int, related *FSStormdrainTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSStormdrains = append(o.r.FSStormdrains, &organizationRFSStormdrainsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSStormdrains(number int, mods ...FSStormdrainMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSStormdrainWithContext(ctx, mods...)
|
|
m.AddFSStormdrains(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSStormdrains(existingModels ...*models.FSStormdrain) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSStormdrains = append(o.r.FSStormdrains, &organizationRFSStormdrainsR{
|
|
o: o.f.FromExistingFSStormdrain(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSStormdrains() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSStormdrains = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSTimecards(number int, related *FSTimecardTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTimecards = []*organizationRFSTimecardsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSTimecards(number int, mods ...FSTimecardMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTimecardWithContext(ctx, mods...)
|
|
m.WithFSTimecards(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSTimecards(number int, related *FSTimecardTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTimecards = append(o.r.FSTimecards, &organizationRFSTimecardsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSTimecards(number int, mods ...FSTimecardMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTimecardWithContext(ctx, mods...)
|
|
m.AddFSTimecards(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSTimecards(existingModels ...*models.FSTimecard) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSTimecards = append(o.r.FSTimecards, &organizationRFSTimecardsR{
|
|
o: o.f.FromExistingFSTimecard(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSTimecards() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTimecards = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSTrapdata(number int, related *FSTrapdatumTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTrapdata = []*organizationRFSTrapdataR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSTrapdata(number int, mods ...FSTrapdatumMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTrapdatumWithContext(ctx, mods...)
|
|
m.WithFSTrapdata(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSTrapdata(number int, related *FSTrapdatumTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTrapdata = append(o.r.FSTrapdata, &organizationRFSTrapdataR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSTrapdata(number int, mods ...FSTrapdatumMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTrapdatumWithContext(ctx, mods...)
|
|
m.AddFSTrapdata(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSTrapdata(existingModels ...*models.FSTrapdatum) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSTrapdata = append(o.r.FSTrapdata, &organizationRFSTrapdataR{
|
|
o: o.f.FromExistingFSTrapdatum(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSTrapdata() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTrapdata = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSTraplocations(number int, related *FSTraplocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTraplocations = []*organizationRFSTraplocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSTraplocations(number int, mods ...FSTraplocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTraplocationWithContext(ctx, mods...)
|
|
m.WithFSTraplocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSTraplocations(number int, related *FSTraplocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTraplocations = append(o.r.FSTraplocations, &organizationRFSTraplocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSTraplocations(number int, mods ...FSTraplocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTraplocationWithContext(ctx, mods...)
|
|
m.AddFSTraplocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSTraplocations(existingModels ...*models.FSTraplocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSTraplocations = append(o.r.FSTraplocations, &organizationRFSTraplocationsR{
|
|
o: o.f.FromExistingFSTraplocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSTraplocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTraplocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSTreatments(number int, related *FSTreatmentTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTreatments = []*organizationRFSTreatmentsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSTreatments(number int, mods ...FSTreatmentMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTreatmentWithContext(ctx, mods...)
|
|
m.WithFSTreatments(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSTreatments(number int, related *FSTreatmentTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTreatments = append(o.r.FSTreatments, &organizationRFSTreatmentsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSTreatments(number int, mods ...FSTreatmentMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTreatmentWithContext(ctx, mods...)
|
|
m.AddFSTreatments(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSTreatments(existingModels ...*models.FSTreatment) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSTreatments = append(o.r.FSTreatments, &organizationRFSTreatmentsR{
|
|
o: o.f.FromExistingFSTreatment(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSTreatments() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTreatments = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSTreatmentareas(number int, related *FSTreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTreatmentareas = []*organizationRFSTreatmentareasR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSTreatmentareas(number int, mods ...FSTreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTreatmentareaWithContext(ctx, mods...)
|
|
m.WithFSTreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSTreatmentareas(number int, related *FSTreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTreatmentareas = append(o.r.FSTreatmentareas, &organizationRFSTreatmentareasR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSTreatmentareas(number int, mods ...FSTreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSTreatmentareaWithContext(ctx, mods...)
|
|
m.AddFSTreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSTreatmentareas(existingModels ...*models.FSTreatmentarea) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSTreatmentareas = append(o.r.FSTreatmentareas, &organizationRFSTreatmentareasR{
|
|
o: o.f.FromExistingFSTreatmentarea(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSTreatmentareas() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSTreatmentareas = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSZones(number int, related *FSZoneTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSZones = []*organizationRFSZonesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSZones(number int, mods ...FSZoneMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSZoneWithContext(ctx, mods...)
|
|
m.WithFSZones(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSZones(number int, related *FSZoneTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSZones = append(o.r.FSZones, &organizationRFSZonesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSZones(number int, mods ...FSZoneMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSZoneWithContext(ctx, mods...)
|
|
m.AddFSZones(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSZones(existingModels ...*models.FSZone) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSZones = append(o.r.FSZones, &organizationRFSZonesR{
|
|
o: o.f.FromExistingFSZone(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSZones() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSZones = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithFSZones2s(number int, related *FSZones2Template) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSZones2s = []*organizationRFSZones2sR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewFSZones2s(number int, mods ...FSZones2Mod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSZones2WithContext(ctx, mods...)
|
|
m.WithFSZones2s(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddFSZones2s(number int, related *FSZones2Template) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSZones2s = append(o.r.FSZones2s, &organizationRFSZones2sR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewFSZones2s(number int, mods ...FSZones2Mod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewFSZones2WithContext(ctx, mods...)
|
|
m.AddFSZones2s(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingFSZones2s(existingModels ...*models.FSZones2) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.FSZones2s = append(o.r.FSZones2s, &organizationRFSZones2sR{
|
|
o: o.f.FromExistingFSZones2(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutFSZones2s() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.FSZones2s = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithH3Aggregations(number int, related *H3AggregationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.H3Aggregations = []*organizationRH3AggregationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewH3Aggregations(number int, mods ...H3AggregationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewH3AggregationWithContext(ctx, mods...)
|
|
m.WithH3Aggregations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddH3Aggregations(number int, related *H3AggregationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.H3Aggregations = append(o.r.H3Aggregations, &organizationRH3AggregationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewH3Aggregations(number int, mods ...H3AggregationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewH3AggregationWithContext(ctx, mods...)
|
|
m.AddH3Aggregations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingH3Aggregations(existingModels ...*models.H3Aggregation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.H3Aggregations = append(o.r.H3Aggregations, &organizationRH3AggregationsR{
|
|
o: o.f.FromExistingH3Aggregation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutH3Aggregations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.H3Aggregations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryContainerrelates(number int, related *HistoryContainerrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryContainerrelates = []*organizationRHistoryContainerrelatesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryContainerrelates(number int, mods ...HistoryContainerrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryContainerrelateWithContext(ctx, mods...)
|
|
m.WithHistoryContainerrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryContainerrelates(number int, related *HistoryContainerrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryContainerrelates = append(o.r.HistoryContainerrelates, &organizationRHistoryContainerrelatesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryContainerrelates(number int, mods ...HistoryContainerrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryContainerrelateWithContext(ctx, mods...)
|
|
m.AddHistoryContainerrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryContainerrelates(existingModels ...*models.HistoryContainerrelate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryContainerrelates = append(o.r.HistoryContainerrelates, &organizationRHistoryContainerrelatesR{
|
|
o: o.f.FromExistingHistoryContainerrelate(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryContainerrelates() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryContainerrelates = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryFieldscoutinglogs(number int, related *HistoryFieldscoutinglogTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryFieldscoutinglogs = []*organizationRHistoryFieldscoutinglogsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryFieldscoutinglogs(number int, mods ...HistoryFieldscoutinglogMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryFieldscoutinglogWithContext(ctx, mods...)
|
|
m.WithHistoryFieldscoutinglogs(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryFieldscoutinglogs(number int, related *HistoryFieldscoutinglogTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryFieldscoutinglogs = append(o.r.HistoryFieldscoutinglogs, &organizationRHistoryFieldscoutinglogsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryFieldscoutinglogs(number int, mods ...HistoryFieldscoutinglogMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryFieldscoutinglogWithContext(ctx, mods...)
|
|
m.AddHistoryFieldscoutinglogs(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryFieldscoutinglogs(existingModels ...*models.HistoryFieldscoutinglog) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryFieldscoutinglogs = append(o.r.HistoryFieldscoutinglogs, &organizationRHistoryFieldscoutinglogsR{
|
|
o: o.f.FromExistingHistoryFieldscoutinglog(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryFieldscoutinglogs() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryFieldscoutinglogs = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryHabitatrelates(number int, related *HistoryHabitatrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryHabitatrelates = []*organizationRHistoryHabitatrelatesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryHabitatrelates(number int, mods ...HistoryHabitatrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryHabitatrelateWithContext(ctx, mods...)
|
|
m.WithHistoryHabitatrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryHabitatrelates(number int, related *HistoryHabitatrelateTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryHabitatrelates = append(o.r.HistoryHabitatrelates, &organizationRHistoryHabitatrelatesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryHabitatrelates(number int, mods ...HistoryHabitatrelateMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryHabitatrelateWithContext(ctx, mods...)
|
|
m.AddHistoryHabitatrelates(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryHabitatrelates(existingModels ...*models.HistoryHabitatrelate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryHabitatrelates = append(o.r.HistoryHabitatrelates, &organizationRHistoryHabitatrelatesR{
|
|
o: o.f.FromExistingHistoryHabitatrelate(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryHabitatrelates() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryHabitatrelates = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryInspectionsamples(number int, related *HistoryInspectionsampleTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryInspectionsamples = []*organizationRHistoryInspectionsamplesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryInspectionsamples(number int, mods ...HistoryInspectionsampleMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryInspectionsampleWithContext(ctx, mods...)
|
|
m.WithHistoryInspectionsamples(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryInspectionsamples(number int, related *HistoryInspectionsampleTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryInspectionsamples = append(o.r.HistoryInspectionsamples, &organizationRHistoryInspectionsamplesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryInspectionsamples(number int, mods ...HistoryInspectionsampleMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryInspectionsampleWithContext(ctx, mods...)
|
|
m.AddHistoryInspectionsamples(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryInspectionsamples(existingModels ...*models.HistoryInspectionsample) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryInspectionsamples = append(o.r.HistoryInspectionsamples, &organizationRHistoryInspectionsamplesR{
|
|
o: o.f.FromExistingHistoryInspectionsample(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryInspectionsamples() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryInspectionsamples = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryInspectionsampledetails(number int, related *HistoryInspectionsampledetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryInspectionsampledetails = []*organizationRHistoryInspectionsampledetailsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryInspectionsampledetails(number int, mods ...HistoryInspectionsampledetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryInspectionsampledetailWithContext(ctx, mods...)
|
|
m.WithHistoryInspectionsampledetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryInspectionsampledetails(number int, related *HistoryInspectionsampledetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryInspectionsampledetails = append(o.r.HistoryInspectionsampledetails, &organizationRHistoryInspectionsampledetailsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryInspectionsampledetails(number int, mods ...HistoryInspectionsampledetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryInspectionsampledetailWithContext(ctx, mods...)
|
|
m.AddHistoryInspectionsampledetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryInspectionsampledetails(existingModels ...*models.HistoryInspectionsampledetail) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryInspectionsampledetails = append(o.r.HistoryInspectionsampledetails, &organizationRHistoryInspectionsampledetailsR{
|
|
o: o.f.FromExistingHistoryInspectionsampledetail(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryInspectionsampledetails() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryInspectionsampledetails = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryLinelocations(number int, related *HistoryLinelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryLinelocations = []*organizationRHistoryLinelocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryLinelocations(number int, mods ...HistoryLinelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryLinelocationWithContext(ctx, mods...)
|
|
m.WithHistoryLinelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryLinelocations(number int, related *HistoryLinelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryLinelocations = append(o.r.HistoryLinelocations, &organizationRHistoryLinelocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryLinelocations(number int, mods ...HistoryLinelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryLinelocationWithContext(ctx, mods...)
|
|
m.AddHistoryLinelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryLinelocations(existingModels ...*models.HistoryLinelocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryLinelocations = append(o.r.HistoryLinelocations, &organizationRHistoryLinelocationsR{
|
|
o: o.f.FromExistingHistoryLinelocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryLinelocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryLinelocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryLocationtrackings(number int, related *HistoryLocationtrackingTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryLocationtrackings = []*organizationRHistoryLocationtrackingsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryLocationtrackings(number int, mods ...HistoryLocationtrackingMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryLocationtrackingWithContext(ctx, mods...)
|
|
m.WithHistoryLocationtrackings(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryLocationtrackings(number int, related *HistoryLocationtrackingTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryLocationtrackings = append(o.r.HistoryLocationtrackings, &organizationRHistoryLocationtrackingsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryLocationtrackings(number int, mods ...HistoryLocationtrackingMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryLocationtrackingWithContext(ctx, mods...)
|
|
m.AddHistoryLocationtrackings(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryLocationtrackings(existingModels ...*models.HistoryLocationtracking) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryLocationtrackings = append(o.r.HistoryLocationtrackings, &organizationRHistoryLocationtrackingsR{
|
|
o: o.f.FromExistingHistoryLocationtracking(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryLocationtrackings() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryLocationtrackings = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryMosquitoinspections(number int, related *HistoryMosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryMosquitoinspections = []*organizationRHistoryMosquitoinspectionsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryMosquitoinspections(number int, mods ...HistoryMosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryMosquitoinspectionWithContext(ctx, mods...)
|
|
m.WithHistoryMosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryMosquitoinspections(number int, related *HistoryMosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryMosquitoinspections = append(o.r.HistoryMosquitoinspections, &organizationRHistoryMosquitoinspectionsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryMosquitoinspections(number int, mods ...HistoryMosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryMosquitoinspectionWithContext(ctx, mods...)
|
|
m.AddHistoryMosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryMosquitoinspections(existingModels ...*models.HistoryMosquitoinspection) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryMosquitoinspections = append(o.r.HistoryMosquitoinspections, &organizationRHistoryMosquitoinspectionsR{
|
|
o: o.f.FromExistingHistoryMosquitoinspection(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryMosquitoinspections() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryMosquitoinspections = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryPointlocations(number int, related *HistoryPointlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPointlocations = []*organizationRHistoryPointlocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryPointlocations(number int, mods ...HistoryPointlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPointlocationWithContext(ctx, mods...)
|
|
m.WithHistoryPointlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryPointlocations(number int, related *HistoryPointlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPointlocations = append(o.r.HistoryPointlocations, &organizationRHistoryPointlocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryPointlocations(number int, mods ...HistoryPointlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPointlocationWithContext(ctx, mods...)
|
|
m.AddHistoryPointlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryPointlocations(existingModels ...*models.HistoryPointlocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryPointlocations = append(o.r.HistoryPointlocations, &organizationRHistoryPointlocationsR{
|
|
o: o.f.FromExistingHistoryPointlocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryPointlocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPointlocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryPolygonlocations(number int, related *HistoryPolygonlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPolygonlocations = []*organizationRHistoryPolygonlocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryPolygonlocations(number int, mods ...HistoryPolygonlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPolygonlocationWithContext(ctx, mods...)
|
|
m.WithHistoryPolygonlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryPolygonlocations(number int, related *HistoryPolygonlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPolygonlocations = append(o.r.HistoryPolygonlocations, &organizationRHistoryPolygonlocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryPolygonlocations(number int, mods ...HistoryPolygonlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPolygonlocationWithContext(ctx, mods...)
|
|
m.AddHistoryPolygonlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryPolygonlocations(existingModels ...*models.HistoryPolygonlocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryPolygonlocations = append(o.r.HistoryPolygonlocations, &organizationRHistoryPolygonlocationsR{
|
|
o: o.f.FromExistingHistoryPolygonlocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryPolygonlocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPolygonlocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryPools(number int, related *HistoryPoolTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPools = []*organizationRHistoryPoolsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryPools(number int, mods ...HistoryPoolMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPoolWithContext(ctx, mods...)
|
|
m.WithHistoryPools(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryPools(number int, related *HistoryPoolTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPools = append(o.r.HistoryPools, &organizationRHistoryPoolsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryPools(number int, mods ...HistoryPoolMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPoolWithContext(ctx, mods...)
|
|
m.AddHistoryPools(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryPools(existingModels ...*models.HistoryPool) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryPools = append(o.r.HistoryPools, &organizationRHistoryPoolsR{
|
|
o: o.f.FromExistingHistoryPool(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryPools() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPools = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryPooldetails(number int, related *HistoryPooldetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPooldetails = []*organizationRHistoryPooldetailsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryPooldetails(number int, mods ...HistoryPooldetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPooldetailWithContext(ctx, mods...)
|
|
m.WithHistoryPooldetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryPooldetails(number int, related *HistoryPooldetailTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPooldetails = append(o.r.HistoryPooldetails, &organizationRHistoryPooldetailsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryPooldetails(number int, mods ...HistoryPooldetailMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryPooldetailWithContext(ctx, mods...)
|
|
m.AddHistoryPooldetails(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryPooldetails(existingModels ...*models.HistoryPooldetail) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryPooldetails = append(o.r.HistoryPooldetails, &organizationRHistoryPooldetailsR{
|
|
o: o.f.FromExistingHistoryPooldetail(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryPooldetails() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryPooldetails = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryProposedtreatmentareas(number int, related *HistoryProposedtreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryProposedtreatmentareas = []*organizationRHistoryProposedtreatmentareasR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryProposedtreatmentareas(number int, mods ...HistoryProposedtreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryProposedtreatmentareaWithContext(ctx, mods...)
|
|
m.WithHistoryProposedtreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryProposedtreatmentareas(number int, related *HistoryProposedtreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryProposedtreatmentareas = append(o.r.HistoryProposedtreatmentareas, &organizationRHistoryProposedtreatmentareasR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryProposedtreatmentareas(number int, mods ...HistoryProposedtreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryProposedtreatmentareaWithContext(ctx, mods...)
|
|
m.AddHistoryProposedtreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryProposedtreatmentareas(existingModels ...*models.HistoryProposedtreatmentarea) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryProposedtreatmentareas = append(o.r.HistoryProposedtreatmentareas, &organizationRHistoryProposedtreatmentareasR{
|
|
o: o.f.FromExistingHistoryProposedtreatmentarea(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryProposedtreatmentareas() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryProposedtreatmentareas = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryQamosquitoinspections(number int, related *HistoryQamosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryQamosquitoinspections = []*organizationRHistoryQamosquitoinspectionsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryQamosquitoinspections(number int, mods ...HistoryQamosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryQamosquitoinspectionWithContext(ctx, mods...)
|
|
m.WithHistoryQamosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryQamosquitoinspections(number int, related *HistoryQamosquitoinspectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryQamosquitoinspections = append(o.r.HistoryQamosquitoinspections, &organizationRHistoryQamosquitoinspectionsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryQamosquitoinspections(number int, mods ...HistoryQamosquitoinspectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryQamosquitoinspectionWithContext(ctx, mods...)
|
|
m.AddHistoryQamosquitoinspections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryQamosquitoinspections(existingModels ...*models.HistoryQamosquitoinspection) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryQamosquitoinspections = append(o.r.HistoryQamosquitoinspections, &organizationRHistoryQamosquitoinspectionsR{
|
|
o: o.f.FromExistingHistoryQamosquitoinspection(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryQamosquitoinspections() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryQamosquitoinspections = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryRodentlocations(number int, related *HistoryRodentlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryRodentlocations = []*organizationRHistoryRodentlocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryRodentlocations(number int, mods ...HistoryRodentlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryRodentlocationWithContext(ctx, mods...)
|
|
m.WithHistoryRodentlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryRodentlocations(number int, related *HistoryRodentlocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryRodentlocations = append(o.r.HistoryRodentlocations, &organizationRHistoryRodentlocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryRodentlocations(number int, mods ...HistoryRodentlocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryRodentlocationWithContext(ctx, mods...)
|
|
m.AddHistoryRodentlocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryRodentlocations(existingModels ...*models.HistoryRodentlocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryRodentlocations = append(o.r.HistoryRodentlocations, &organizationRHistoryRodentlocationsR{
|
|
o: o.f.FromExistingHistoryRodentlocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryRodentlocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryRodentlocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistorySamplecollections(number int, related *HistorySamplecollectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySamplecollections = []*organizationRHistorySamplecollectionsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistorySamplecollections(number int, mods ...HistorySamplecollectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistorySamplecollectionWithContext(ctx, mods...)
|
|
m.WithHistorySamplecollections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistorySamplecollections(number int, related *HistorySamplecollectionTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySamplecollections = append(o.r.HistorySamplecollections, &organizationRHistorySamplecollectionsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistorySamplecollections(number int, mods ...HistorySamplecollectionMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistorySamplecollectionWithContext(ctx, mods...)
|
|
m.AddHistorySamplecollections(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistorySamplecollections(existingModels ...*models.HistorySamplecollection) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistorySamplecollections = append(o.r.HistorySamplecollections, &organizationRHistorySamplecollectionsR{
|
|
o: o.f.FromExistingHistorySamplecollection(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistorySamplecollections() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySamplecollections = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistorySamplelocations(number int, related *HistorySamplelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySamplelocations = []*organizationRHistorySamplelocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistorySamplelocations(number int, mods ...HistorySamplelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistorySamplelocationWithContext(ctx, mods...)
|
|
m.WithHistorySamplelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistorySamplelocations(number int, related *HistorySamplelocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySamplelocations = append(o.r.HistorySamplelocations, &organizationRHistorySamplelocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistorySamplelocations(number int, mods ...HistorySamplelocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistorySamplelocationWithContext(ctx, mods...)
|
|
m.AddHistorySamplelocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistorySamplelocations(existingModels ...*models.HistorySamplelocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistorySamplelocations = append(o.r.HistorySamplelocations, &organizationRHistorySamplelocationsR{
|
|
o: o.f.FromExistingHistorySamplelocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistorySamplelocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySamplelocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryServicerequests(number int, related *HistoryServicerequestTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryServicerequests = []*organizationRHistoryServicerequestsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryServicerequests(number int, mods ...HistoryServicerequestMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryServicerequestWithContext(ctx, mods...)
|
|
m.WithHistoryServicerequests(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryServicerequests(number int, related *HistoryServicerequestTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryServicerequests = append(o.r.HistoryServicerequests, &organizationRHistoryServicerequestsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryServicerequests(number int, mods ...HistoryServicerequestMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryServicerequestWithContext(ctx, mods...)
|
|
m.AddHistoryServicerequests(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryServicerequests(existingModels ...*models.HistoryServicerequest) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryServicerequests = append(o.r.HistoryServicerequests, &organizationRHistoryServicerequestsR{
|
|
o: o.f.FromExistingHistoryServicerequest(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryServicerequests() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryServicerequests = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistorySpeciesabundances(number int, related *HistorySpeciesabundanceTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySpeciesabundances = []*organizationRHistorySpeciesabundancesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistorySpeciesabundances(number int, mods ...HistorySpeciesabundanceMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistorySpeciesabundanceWithContext(ctx, mods...)
|
|
m.WithHistorySpeciesabundances(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistorySpeciesabundances(number int, related *HistorySpeciesabundanceTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySpeciesabundances = append(o.r.HistorySpeciesabundances, &organizationRHistorySpeciesabundancesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistorySpeciesabundances(number int, mods ...HistorySpeciesabundanceMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistorySpeciesabundanceWithContext(ctx, mods...)
|
|
m.AddHistorySpeciesabundances(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistorySpeciesabundances(existingModels ...*models.HistorySpeciesabundance) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistorySpeciesabundances = append(o.r.HistorySpeciesabundances, &organizationRHistorySpeciesabundancesR{
|
|
o: o.f.FromExistingHistorySpeciesabundance(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistorySpeciesabundances() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistorySpeciesabundances = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryStormdrains(number int, related *HistoryStormdrainTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryStormdrains = []*organizationRHistoryStormdrainsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryStormdrains(number int, mods ...HistoryStormdrainMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryStormdrainWithContext(ctx, mods...)
|
|
m.WithHistoryStormdrains(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryStormdrains(number int, related *HistoryStormdrainTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryStormdrains = append(o.r.HistoryStormdrains, &organizationRHistoryStormdrainsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryStormdrains(number int, mods ...HistoryStormdrainMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryStormdrainWithContext(ctx, mods...)
|
|
m.AddHistoryStormdrains(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryStormdrains(existingModels ...*models.HistoryStormdrain) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryStormdrains = append(o.r.HistoryStormdrains, &organizationRHistoryStormdrainsR{
|
|
o: o.f.FromExistingHistoryStormdrain(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryStormdrains() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryStormdrains = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryTimecards(number int, related *HistoryTimecardTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTimecards = []*organizationRHistoryTimecardsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryTimecards(number int, mods ...HistoryTimecardMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTimecardWithContext(ctx, mods...)
|
|
m.WithHistoryTimecards(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryTimecards(number int, related *HistoryTimecardTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTimecards = append(o.r.HistoryTimecards, &organizationRHistoryTimecardsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryTimecards(number int, mods ...HistoryTimecardMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTimecardWithContext(ctx, mods...)
|
|
m.AddHistoryTimecards(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryTimecards(existingModels ...*models.HistoryTimecard) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryTimecards = append(o.r.HistoryTimecards, &organizationRHistoryTimecardsR{
|
|
o: o.f.FromExistingHistoryTimecard(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryTimecards() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTimecards = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryTrapdata(number int, related *HistoryTrapdatumTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTrapdata = []*organizationRHistoryTrapdataR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryTrapdata(number int, mods ...HistoryTrapdatumMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTrapdatumWithContext(ctx, mods...)
|
|
m.WithHistoryTrapdata(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryTrapdata(number int, related *HistoryTrapdatumTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTrapdata = append(o.r.HistoryTrapdata, &organizationRHistoryTrapdataR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryTrapdata(number int, mods ...HistoryTrapdatumMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTrapdatumWithContext(ctx, mods...)
|
|
m.AddHistoryTrapdata(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryTrapdata(existingModels ...*models.HistoryTrapdatum) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryTrapdata = append(o.r.HistoryTrapdata, &organizationRHistoryTrapdataR{
|
|
o: o.f.FromExistingHistoryTrapdatum(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryTrapdata() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTrapdata = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryTraplocations(number int, related *HistoryTraplocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTraplocations = []*organizationRHistoryTraplocationsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryTraplocations(number int, mods ...HistoryTraplocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTraplocationWithContext(ctx, mods...)
|
|
m.WithHistoryTraplocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryTraplocations(number int, related *HistoryTraplocationTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTraplocations = append(o.r.HistoryTraplocations, &organizationRHistoryTraplocationsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryTraplocations(number int, mods ...HistoryTraplocationMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTraplocationWithContext(ctx, mods...)
|
|
m.AddHistoryTraplocations(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryTraplocations(existingModels ...*models.HistoryTraplocation) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryTraplocations = append(o.r.HistoryTraplocations, &organizationRHistoryTraplocationsR{
|
|
o: o.f.FromExistingHistoryTraplocation(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryTraplocations() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTraplocations = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryTreatments(number int, related *HistoryTreatmentTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTreatments = []*organizationRHistoryTreatmentsR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryTreatments(number int, mods ...HistoryTreatmentMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTreatmentWithContext(ctx, mods...)
|
|
m.WithHistoryTreatments(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryTreatments(number int, related *HistoryTreatmentTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTreatments = append(o.r.HistoryTreatments, &organizationRHistoryTreatmentsR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryTreatments(number int, mods ...HistoryTreatmentMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTreatmentWithContext(ctx, mods...)
|
|
m.AddHistoryTreatments(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryTreatments(existingModels ...*models.HistoryTreatment) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryTreatments = append(o.r.HistoryTreatments, &organizationRHistoryTreatmentsR{
|
|
o: o.f.FromExistingHistoryTreatment(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryTreatments() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTreatments = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryTreatmentareas(number int, related *HistoryTreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTreatmentareas = []*organizationRHistoryTreatmentareasR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryTreatmentareas(number int, mods ...HistoryTreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTreatmentareaWithContext(ctx, mods...)
|
|
m.WithHistoryTreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryTreatmentareas(number int, related *HistoryTreatmentareaTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTreatmentareas = append(o.r.HistoryTreatmentareas, &organizationRHistoryTreatmentareasR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryTreatmentareas(number int, mods ...HistoryTreatmentareaMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryTreatmentareaWithContext(ctx, mods...)
|
|
m.AddHistoryTreatmentareas(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryTreatmentareas(existingModels ...*models.HistoryTreatmentarea) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryTreatmentareas = append(o.r.HistoryTreatmentareas, &organizationRHistoryTreatmentareasR{
|
|
o: o.f.FromExistingHistoryTreatmentarea(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryTreatmentareas() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryTreatmentareas = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryZones(number int, related *HistoryZoneTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryZones = []*organizationRHistoryZonesR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryZones(number int, mods ...HistoryZoneMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryZoneWithContext(ctx, mods...)
|
|
m.WithHistoryZones(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryZones(number int, related *HistoryZoneTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryZones = append(o.r.HistoryZones, &organizationRHistoryZonesR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryZones(number int, mods ...HistoryZoneMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryZoneWithContext(ctx, mods...)
|
|
m.AddHistoryZones(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryZones(existingModels ...*models.HistoryZone) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryZones = append(o.r.HistoryZones, &organizationRHistoryZonesR{
|
|
o: o.f.FromExistingHistoryZone(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryZones() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryZones = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithHistoryZones2s(number int, related *HistoryZones2Template) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryZones2s = []*organizationRHistoryZones2sR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewHistoryZones2s(number int, mods ...HistoryZones2Mod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryZones2WithContext(ctx, mods...)
|
|
m.WithHistoryZones2s(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddHistoryZones2s(number int, related *HistoryZones2Template) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryZones2s = append(o.r.HistoryZones2s, &organizationRHistoryZones2sR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewHistoryZones2s(number int, mods ...HistoryZones2Mod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewHistoryZones2WithContext(ctx, mods...)
|
|
m.AddHistoryZones2s(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingHistoryZones2s(existingModels ...*models.HistoryZones2) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.HistoryZones2s = append(o.r.HistoryZones2s, &organizationRHistoryZones2sR{
|
|
o: o.f.FromExistingHistoryZones2(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutHistoryZones2s() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.HistoryZones2s = nil
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithUser(number int, related *UserTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.User = []*organizationRUserR{{
|
|
number: number,
|
|
o: related,
|
|
}}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithNewUser(number int, mods ...UserMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewUserWithContext(ctx, mods...)
|
|
m.WithUser(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddUser(number int, related *UserTemplate) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.User = append(o.r.User, &organizationRUserR{
|
|
number: number,
|
|
o: related,
|
|
})
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddNewUser(number int, mods ...UserMod) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
related := o.f.NewUserWithContext(ctx, mods...)
|
|
m.AddUser(number, related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) AddExistingUser(existingModels ...*models.User) OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
for _, em := range existingModels {
|
|
o.r.User = append(o.r.User, &organizationRUserR{
|
|
o: o.f.FromExistingUser(em),
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m organizationMods) WithoutUser() OrganizationMod {
|
|
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
|
|
o.r.User = nil
|
|
})
|
|
}
|