Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManageExpectedRack ¶
type ManageExpectedRack struct {
// contains filtered or unexported fields
}
ManageExpectedRack is an activity wrapper for managing ExpectedRack lifecycle that allows injecting DB access
func NewManageExpectedRack ¶
func NewManageExpectedRack(dbSession *cdb.Session, siteClientPool *sc.ClientPool) ManageExpectedRack
NewManageExpectedRack returns a new ManageExpectedRack activity
func (ManageExpectedRack) UpdateExpectedRacksInDB ¶
func (mer ManageExpectedRack) UpdateExpectedRacksInDB(ctx context.Context, siteID uuid.UUID, expectedRackInventory *cwssaws.ExpectedRackInventory) error
UpdateExpectedRacksInDB is a Temporal activity that takes a collection of ExpectedRack data pushed by Site Agent and updates the DB ExpectedRacks are uniquely identified per Site by rack_id (operator-supplied string). 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: - rack_id existing in NICo but not in DB: create record in DB - rack_id existing in both NICo and DB with differences: update record in DB - rack_id existing in DB but not in NICo: delete record in DB