Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManageExpectedPowerShelf ¶
type ManageExpectedPowerShelf struct {
// contains filtered or unexported fields
}
ManageExpectedPowerShelf is an activity wrapper for managing ExpectedPowerShelf lifecycle that allows injecting DB access
func NewManageExpectedPowerShelf ¶
func NewManageExpectedPowerShelf(dbSession *cdb.Session, siteClientPool *sc.ClientPool) ManageExpectedPowerShelf
NewManageExpectedPowerShelf returns a new ManageExpectedPowerShelf activity
func (ManageExpectedPowerShelf) UpdateExpectedPowerShelvesInDB ¶
func (mei ManageExpectedPowerShelf) UpdateExpectedPowerShelvesInDB(ctx context.Context, siteID uuid.UUID, expectedPowerShelfInventory *cwssaws.ExpectedPowerShelfInventory) error
UpdateExpectedPowerShelvesInDB is a Temporal activity that takes a collection of ExpectedPowerShelf data pushed by Site Agent and updates the DB Expected Power Shelf records have two unique values (MAC and UUID). We ignore the MAC value and only rely on the UUID for uniqueness. NICo is the source of truth: out of the race-condition window we make the DB match NICo exactly. The reconciliation logic is as follows: - UUID existing in NICo but not in DB: create record in DB - UUID existing in both NICo and DB with differences: update record in DB - UUID existing in DB but not in NICo: delete record in DB