private async Task InsertVehicleRegistrations()

in Amazon.QLDB.DMVSample.LedgerSetup/SampleData.cs [139:171]


        private async Task InsertVehicleRegistrations(List<string> peopleDocumentIds)
        {
            List<VehicleRegistration> registrations = new List<VehicleRegistration>
            {
                new VehicleRegistration { Vin = "1N4AL11D75C109151", LicensePlateNumber = "LEWISR261LL", 
                    State = "WA", City = "Seattle",  PendingPenaltyTicketAmount = 90.25, ValidFromDate = DateTime.Parse("2017-08-21"), 
                    ValidToDate = DateTime.Parse("2020-05-11"), Owners = new Owners {}},
                new VehicleRegistration { Vin = "KM8SRDHF6EU074761", LicensePlateNumber = "CA762X", 
                    State = "WA", City = "Kent", PendingPenaltyTicketAmount = 130.75, ValidFromDate = DateTime.Parse("2017-09-14"), 
                    ValidToDate = DateTime.Parse("2020-06-25"), Owners = new Owners {} },
                new VehicleRegistration { Vin = "3HGGK5G53FM761765", LicensePlateNumber = "CD820Z", 
                    State = "WA", City = "Everett", PendingPenaltyTicketAmount = 442.30, ValidFromDate = DateTime.Parse("2011-03-17"), 
                    ValidToDate = DateTime.Parse("2021-03-24"), Owners = new Owners {} },
                new VehicleRegistration { Vin = "1HVBBAANXWH544237", LicensePlateNumber = "LS477D", 
                    State = "WA", City = "Tacoma", PendingPenaltyTicketAmount = 42.20, ValidFromDate = DateTime.Parse("2011-10-26"), 
                    ValidToDate = DateTime.Parse("2023-09-25"), Owners = new Owners {} },
                new VehicleRegistration { Vin = "1C4RJFAG0FC625797", LicensePlateNumber = "TH393F", 
                    State = "WA", City = "Olympia", PendingPenaltyTicketAmount = 30.45, ValidFromDate = DateTime.Parse("2013-09-02"), 
                    ValidToDate = DateTime.Parse("2023-09-25"), Owners = new Owners {} }
            };

            for (int i = 0; i < peopleDocumentIds.Count; i++)
            {
                registrations[i].Owners.PrimaryOwner = new Owner { PersonId = peopleDocumentIds[i] };
            }

            Console.WriteLine("Inserting vehicle registration data");
            await qldbDriver.Execute(async transactionExecutor =>
            {
                await Insert(transactionExecutor, VehicleRegistrationTableName, registrations);
            });
            Console.WriteLine("Vehicle registration data inserted");
        }