/// <summary> /// Method that will create a new Shift Mapping entity to store in /// Azure table storage. /// </summary> /// <param name="responseModel">The Shift object response that is received from MS Graph.</param> /// <param name="uniqueId">The Kronos Unique ID that is generated.</param> /// <param name="user">The user for which the new shift is being created.</param> /// <returns>An object of the type <see cref="TeamsShiftMappingEntity"/>.</returns> private TeamsShiftMappingEntity CreateNewShiftMappingEntity( Models.Response.Shifts.Shift responseModel, string uniqueId, UserDetailsModel user) { var createNewShiftMappingEntityProps = new Dictionary<string, string>() { { "GraphShiftId", responseModel.Id }, { "GraphShiftEtag", responseModel.ETag }, { "KronosUniqueId", uniqueId }, { "CallingAssembly", Assembly.GetCallingAssembly().GetName().Name }, }; TeamsShiftMappingEntity shiftMappingEntity = new TeamsShiftMappingEntity { ETag = responseModel.ETag, AadUserId = responseModel.UserId, KronosUniqueId = uniqueId, KronosPersonNumber = user.KronosPersonNumber, ShiftStartDate = this.utility.UTCToKronosTimeZone(responseModel.SharedShift.StartDateTime), }; this.telemetryClient.TrackTrace(MethodBase.GetCurrentMethod().Name, createNewShiftMappingEntityProps); return shiftMappingEntity; }
/// <summary> /// Method that will create a new Shift Mapping entity to store in /// Azure table storage. /// </summary> /// <param name="responseModel">The Shift object response that is received from MS Graph.</param> /// <param name="uniqueId">The Kronos Unique ID that is generated.</param> /// <param name="user">The user for which the new shift is being created.</param> /// <returns>An object of the type <see cref="TeamsShiftMappingEntity"/>.</returns> private TeamsShiftMappingEntity CreateNewShiftMappingEntity( Models.Response.Shifts.Shift responseModel, string uniqueId, UserDetailsModel user) { var createNewShiftMappingEntityProps = new Dictionary <string, string>() { { "GraphShiftId", responseModel.Id }, { "GraphShiftEtag", responseModel.ETag }, { "KronosUniqueId", uniqueId }, { "CallingAssembly", Assembly.GetCallingAssembly().GetName().Name }, }; var startDateTime = DateTime.SpecifyKind(responseModel.SharedShift.StartDateTime.DateTime, DateTimeKind.Utc); var endDateTime = DateTime.SpecifyKind(responseModel.SharedShift.EndDateTime.DateTime, DateTimeKind.Utc); TeamsShiftMappingEntity shiftMappingEntity = new TeamsShiftMappingEntity { ETag = responseModel.ETag, AadUserId = responseModel.UserId, KronosUniqueId = uniqueId, KronosPersonNumber = user.KronosPersonNumber, ShiftStartDate = startDateTime, ShiftEndDate = endDateTime, }; this.telemetryClient.TrackTrace("Creating new shift mapping entity.", createNewShiftMappingEntityProps); return(shiftMappingEntity); }