private static CheckInsUpdate MapCheckInsUpdate( Attendee attendee, ImmutableDictionary <long, int> locationIdsByCheckInsLocationId ) { var attributes = attendee.Attributes; var checkInsLocationId = attendee.Relationships?.Locations?.Data?.FirstOrDefault()?.Id; var peopleId = attendee.Relationships?.Person?.Data?.Id; var peopleUpdate = new PeopleUpdate( peopleId: peopleId, firstName: attributes?.FirstName ?? string.Empty, lastName: attributes?.LastName ?? string.Empty); var locationId = checkInsLocationId.HasValue && locationIdsByCheckInsLocationId.ContainsKey(key: checkInsLocationId.Value) ? locationIdsByCheckInsLocationId[key : checkInsLocationId.Value] : 30; return(new( checkInsId : attendee.Id, peopleId : peopleId, attendeeType : attributes?.Kind ?? AttendeeType.Regular, securityCode : attributes?.SecurityCode ?? string.Empty, locationId : locationId, creationDate : attributes?.CreatedAt ?? DateTime.UtcNow, kid : peopleUpdate, emergencyContactName : attributes?.EmergencyContactName, emergencyContactNumber : attributes?.EmergencyContactPhoneNumber)); }
private static Person MapPerson(PeopleUpdate peopleUpdate) { return(new() { PeopleId = peopleUpdate.PeopleId, FirstName = peopleUpdate.FirstName, LastName = peopleUpdate.LastName, UpdateDate = DateTime.UtcNow }); }
public CheckInsUpdate( long checkInsId, long?peopleId, AttendeeType attendeeType, string securityCode, int locationId, DateTime creationDate, PeopleUpdate kid, string?emergencyContactName, string?emergencyContactNumber) { CheckInsId = checkInsId; PeopleId = peopleId; SecurityCode = securityCode; LocationId = locationId; CreationDate = creationDate; Kid = kid; EmergencyContactName = emergencyContactName; EmergencyContactNumber = emergencyContactNumber; AttendeeType = attendeeType; }