示例#1
0
        public async Task <IActionResult> VOP(DriverScanEvent driverScanEvent)
        {
            await this.eventStoreService.DriverScan(driverScanEvent, PackageEventType.OnVan);

            this.messengerService.DriverScan(driverScanEvent, "vop");
            return(this.Ok());
        }
示例#2
0
        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);
        }
示例#3
0
 public void DriverScan(DriverScanEvent driverScanEvent, string scan)
 {
     this.rabbitMessenger.SendMessage("package.driver-scan", driverScanEvent, scan);
 }
示例#4
0
 public async Task DriverScan(DriverScanEvent driverScanEvent, PackageEventType packageEventType)
 {
     await this.Insert(driverScanEvent.Barcode, packageEventType, driverScanEvent);
 }