Ejemplo n.º 1
0
    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));
    }
Ejemplo n.º 2
0
 private static Person MapPerson(PeopleUpdate peopleUpdate)
 {
     return(new()
     {
         PeopleId = peopleUpdate.PeopleId,
         FirstName = peopleUpdate.FirstName,
         LastName = peopleUpdate.LastName,
         UpdateDate = DateTime.UtcNow
     });
 }
Ejemplo n.º 3
0
    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;
    }