public async Task <IActionResult> VOP(DriverScanEvent driverScanEvent) { await this.eventStoreService.DriverScan(driverScanEvent, PackageEventType.OnVan); this.messengerService.DriverScan(driverScanEvent, "vop"); return(this.Ok()); }
public async Task <bool> DriverScan(DriverScanEvent driverScanEvent) { // Notes on this are similar to NetworkScan() var update = Builders <Package> .Update .Set(t => t.State, PackageState.WithDriver) // set it to the following object: { driver: { ... } } .Set(t => t.Location, driverScanEvent.Driver.ToBsonDocument()); // Could DRY this statement, easier to read for demo var result = await this.collection.UpdateOneAsync(x => x.Barcode == driverScanEvent.Barcode, update); return(result.ModifiedCount == 1); }
public void DriverScan(DriverScanEvent driverScanEvent, string scan) { this.rabbitMessenger.SendMessage("package.driver-scan", driverScanEvent, scan); }
public async Task DriverScan(DriverScanEvent driverScanEvent, PackageEventType packageEventType) { await this.Insert(driverScanEvent.Barcode, packageEventType, driverScanEvent); }