lime

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMax

func GetMax(db *gorm.DB, column string) (uint, error)

Types

type Lime

type Lime struct {
	ParamDB  *util.ConfigDB
	DB       *gorm.DB
	Limetool *limetool.Lime
}

func NewLime

func NewLime(PDB *util.ConfigDB) *Lime

func (*Lime) SaveContact

func (lime *Lime) SaveContact(row *models.Contact) error

SaveContact upserts a contact matched by (source, source_id) rather than by factum ID - same reason as SaveCustomer. NotifyMaintenance is factum-owned (the operator toggle on the contacts page, including for Lime-synced rows) so a resync must not reset it; new Lime persons default it to true to match a manually created contact.

func (*Lime) SaveCustomer

func (lime *Lime) SaveCustomer(row *models.Customer) error

SaveCustomer upserts a customer matched by (source, source_id) rather than by factum ID - the factum ID is autogenerated (see SyncCustomers) so it can't be used to find a previously-synced row.

func (*Lime) SaveDelivery

func (lime *Lime) SaveDelivery(row *models.Service) error

SaveDelivery upserts a service matched by (source, source_id) rather than by factum ID - the factum ID is autogenerated (see SyncCustomers) so it can't be used to find a previously-synced row.

Lime never feeds ServiceType/BandwidthMbps/MaxMacAddresses or the ELINE provisioning fields (Endpoint*/PseudowireID/L2VPNNetboxID) - those are only ever set from the factum side (the network GUI's service-type editor and ELINE provisioning flow, web/handler_service.go, web/handler_service_eline.go). row only carries Lime-owned fields (including AgreementStatus from agreement_status.text), so carrying the previously-stored values of these forward onto row before the wholesale Save() below keeps a resync from silently wiping out that factum-added enrichment.

func (*Lime) SyncCustomers

func (lime *Lime) SyncCustomers(companyNames []string, refresh bool, reporter jobevent.Reporter) error

Fetch data from LIME, store in factum database If refresh is true, refresh data in cache

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL