-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathFeedGeneratorHelper.cs
More file actions
56 lines (50 loc) · 2.45 KB
/
FeedGeneratorHelper.cs
File metadata and controls
56 lines (50 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using OpenActive.FakeDatabase.NET;
using OpenActive.NET;
using OpenActive.Server.NET.OpenBookingHelper;
namespace BookingSystem
{
public static class FeedGeneratorHelper
{
public static List<OpenBookingFlowRequirement> OpenBookingFlowRequirement(bool requiresApproval, bool requiresAttendeeValidation, bool requiresAdditionalDetails, bool allowsProposalAmendment)
{
List<OpenBookingFlowRequirement> openBookingFlowRequirement = null;
if (requiresApproval)
{
openBookingFlowRequirement = openBookingFlowRequirement ?? new List<OpenBookingFlowRequirement>();
openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingApproval);
}
if (requiresAttendeeValidation)
{
openBookingFlowRequirement = openBookingFlowRequirement ?? new List<OpenBookingFlowRequirement>();
openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingAttendeeDetails);
}
if (requiresAdditionalDetails)
{
openBookingFlowRequirement = openBookingFlowRequirement ?? new List<OpenBookingFlowRequirement>();
openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingIntakeForm);
}
if (allowsProposalAmendment)
{
openBookingFlowRequirement = openBookingFlowRequirement ?? new List<OpenBookingFlowRequirement>();
openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingNegotiation);
}
return openBookingFlowRequirement;
}
public static EventAttendanceModeEnumeration MapAttendanceMode(AttendanceMode attendanceMode)
{
switch (attendanceMode)
{
case AttendanceMode.Offline:
return EventAttendanceModeEnumeration.OfflineEventAttendanceMode;
case AttendanceMode.Online:
return EventAttendanceModeEnumeration.OnlineEventAttendanceMode;
case AttendanceMode.Mixed:
return EventAttendanceModeEnumeration.MixedEventAttendanceMode;
default:
throw new OpenBookingException(new OpenBookingError(), $"AttendanceMode Type {attendanceMode} not supported");
}
}
}
}