-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sharepoint synchronization functionality #763
Sharepoint synchronization functionality #763
Conversation
...stant/Arcadia.Assistant.Calendar.Abstractions/Arcadia.Assistant.Calendar.Abstractions.csproj
Outdated
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.Calendar.Abstractions/CalendarEvent.cs
Outdated
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.Calendar.Abstractions/WorkHoursChangeStatuses.cs
Outdated
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.Sharepoint/Sharepoint.cs
Outdated
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.Sharepoint/Sharepoint.cs
Outdated
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.Employees.Contracts/EmployeeMetadata.cs
Outdated
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.SickLeaves.Contracts/ISickLeaves.cs
Outdated
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.Sharepoint/Arcadia.Assistant.Sharepoint.csproj
Show resolved
Hide resolved
server2/Arcadia.Assistant/Arcadia.Assistant.Sharepoint/ServiceEventSource.cs
Outdated
Show resolved
Hide resolved
public class SickLeaveModelConverter | ||
{ | ||
public Expression<Func<CSP.Model.SickLeave, SickLeaveDescription>> ToDescription { get; } | ||
= model => new SickLeaveDescription() | ||
{ | ||
SickLeaveId = model.Id, | ||
EmployeeId = new EmployeeId(model.EmployeeId), | ||
StartDate = model.Start, | ||
EndDate = model.End, | ||
Status = model.SickLeaveCancellations.Any() ? SickLeaveStatus.Cancelled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santee, are you sure the logic is correct? In Akka version it was a bit different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In previous version we used timestamp of each sick leave status change to determine the most actual status:
private CalendarEventWithAdditionalData CreateCalendarEventFromSickLeave(SickLeaves sickLeave)
{
var completed = sickLeave.SickLeaveCompletes
.Select(c => new CalendarEventWithAdditionalData.SickLeaveCompletion(c.ById.ToString(), c.At))
.FirstOrDefault();
var cancelled = sickLeave.SickLeaveCancellations
.Select(c => new CalendarEventWithAdditionalData.SickLeaveCancellation(c.ById.ToString(), c.At))
.FirstOrDefault();
var statuses = new[]
{
Tuple.Create(completed?.Timestamp, SickLeaveStatuses.Completed),
Tuple.Create(cancelled?.Timestamp, SickLeaveStatuses.Cancelled)
};
var status = statuses
.Where(x => x.Item1 != null)
.OrderByDescending(x => x.Item1)
.FirstOrDefault()
?.Item2;
status = status ?? SickLeaveStatuses.Requested;
var calendarEvent = new CalendarEvent(
this.calendarEventIdParser.GetCalendarEventIdFromCspId(sickLeave.Id, CalendarEventTypes.Sickleave),
CalendarEventTypes.Sickleave,
new DatesPeriod(sickLeave.Start.Date, sickLeave.End.Date),
status,
sickLeave.EmployeeId.ToString());
return new CalendarEventWithAdditionalData(calendarEvent, cancelled, completed);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santee? You haven't answered yet :)
...sistant.ExternalStorages.Abstractions/Arcadia.Assistant.ExternalStorages.Abstractions.csproj
Show resolved
Hide resolved
# Conflicts: # server2/Arcadia.Assistant/Arcadia.Assistant.SF/ApplicationPackageRoot/ApplicationManifest.xml # server2/Arcadia.Assistant/Arcadia.Assistant.SF/PublishProfiles/Azure.xml # server2/Arcadia.Assistant/Arcadia.Assistant.sln
No description provided.