Class ParticipantsProvider
Archive list provider for the participants list of a booking (multi-person appointment)
Implements
Inherited Members
Namespace: SuperOfficeCRMArchiveLists
Assembly: SoDataBase.BusinessLogic.dll
Syntax
[ArchiveProvider("Participants", 1073741823)]
public class ParticipantsProvider : InMemoryProviderBase<ArchiveRow>, IArchiveProvider, IArchiveProviderHasRows, IArchiveProviderHasColumns, IArchiveProviderHasEntities
Remarks
This provider, like the LinksProvider, offers two alternative ways of accessing the data. For existing appointments, the appointment_id is used as search criterion. This will retrieve all participants in this appointment, regardless of whether the given appointment is the mother or one of the slaves.
For appointments under construction, where the data have not yet been saved to the database, the caller must specify all data through the use of restrictions - some of which are then used for information, and some as keys to fetch actual person or associate/resource records from the database.
| Restriction | Meaning |
|---|---|
| appointmentRestrictionId | Single appointment id, using the = operator. This restriction is used on its own for fetching information from existing appointment records. The id may be of any appointment in the booking, and all participants will be fetched (limited by entity selection). |
| associateRestrictionId | Operator: IN, Value: array of associate id's. These will be returned as participants of type associate, if the associate entity has been selected. |
| groupRestrictionId | Operator: =, Value: group id. The group will be translated into associate id's, and these will be returned as participants of type associate, if the associate entity has been selected. This is an alternative to specifying the associates one by one and cannot be used together with the associateRestrictionId. |
| externalPersonRestrictionId | Operator: IN, Value: array of of person id's. These will be returned as participants of type external person, if the externalPerson entity has been selected. Note: Persons who are actually associates will be detected as such, and be returned as associates. |
| resourceRestrictionId | Operator: IN, Value: array of of associate id's. These will be returned as participants of type resource, if the resource entity has been selected. |
| personEmailsInformation | Operator: IN, Value: array of of person id's. This restriction is optionally used together with externalPersonRestrictionId, and specifies which of the persons should have an email icon set. |
| associateEmailsInformation | Operator: IN, Value: array of of associate id's. This restriction is optionally used together with associatePersonRestrictionId, and specifies which of the associates should have an email icon set. Note that resources do not get invitation emails, so there is no corresponding resourceEmailsInformation restriction. |
| startTimeInformation | Datetime of appointment start, needed when fetching data through the explicit restrictions (not appointmentRestrictionId) and if you want collision detection. |
| endTimeInformation | Datetime of appointment end, needed when fetching data through the explicit restrictions (not appointmentRestrictionId) and if you want collision detection. |
| ownerAssociateIdInformation | Operator: =, value: associate id. This is the Id of associate who is the owner of the whole booking. If this is not given, and appointmentRestrictionId is given, the system will look up the associate of the master booking record (mother_id = appointment_id) and use that as the owner. If ownerAssociateIdInformation is given, it overrides (disables) this lookup. If neither are given, then there is no owner associate. The owner associate always comes at the top of the list, and has the 'owner' row style hint. |
| inhibitConflictsInformation | Operator: =, value: boolean. If you provide either an appointmentRestrictionId or startTime/EndTime, then conflicts will be detected. However, if the appointment is of type Free, then no conflict detetction will occur. To force 'free' behaviour on an under-construction appointment that does not have an appointment id, or on an appointment that is being changed, include this restriction with the value true. That will turn off conflict detection. |
Conflict detection is provided if the status column is requested. For non-saved data, this also requires the presence of startTimeInformation and endTimeInformation restrictions (dates in InvariantCulture format), so that the conflicts may be calculated.
Finally, the email status (should emails be sent for invitations and changes) is read from the database if the appointmentRestrictionId is used; if explicit person or associate restrictions are used, then email status information must be passed in through the associateEmailsInformation and personEmailsInformation restrictions. The value of each restriction is a list of associate resp. person id's who have the email flag set. If all this sounds complex - well, it is.
Being the tolerant sort, the provider will accept both associates and resources in each of associateRestrictionId and resourceRestrictionId, and internally sort out which is which. Similarly, if any of the person id's you happen to pass in through the externalPersonRestrictionId are actually associates, then that too will be sorted out.
Constructors
ParticipantsProvider()
Set up the instance; should only be called by factory class
Declaration
public ParticipantsProvider()
Fields
AppointmentRestrictionId
Declaration
public const string AppointmentRestrictionId = "appointmentRestrictionId"
Field Value
| Type | Description |
|---|---|
| string |
AssociateEmailsInformation
Declaration
public const string AssociateEmailsInformation = "associateEmailsInformation"
Field Value
| Type | Description |
|---|---|
| string |
AssociateEntity
Declaration
public const string AssociateEntity = "associate"
Field Value
| Type | Description |
|---|---|
| string |
AssociateRestrictionId
Declaration
public const string AssociateRestrictionId = "associateRestrictionId"
Field Value
| Type | Description |
|---|---|
| string |
DateInformation
Declaration
public const string DateInformation = "dateInformation"
Field Value
| Type | Description |
|---|---|
| string |
EmailParticipantEntity
Declaration
public const string EmailParticipantEntity = "emailParticipant"
Field Value
| Type | Description |
|---|---|
| string |
EndTimeInformation
Declaration
public const string EndTimeInformation = "endTimeInformation"
Field Value
| Type | Description |
|---|---|
| string |
EndTimeUtcInformation
Declaration
public const string EndTimeUtcInformation = "endTimeUtcInformation"
Field Value
| Type | Description |
|---|---|
| string |
ExternalPersonEntity
Declaration
public const string ExternalPersonEntity = "externalPerson"
Field Value
| Type | Description |
|---|---|
| string |
ExternalPersonRestrictionId
Declaration
public const string ExternalPersonRestrictionId = "externalPersonRestrictionId"
Field Value
| Type | Description |
|---|---|
| string |
GroupRestrictionId
Declaration
public const string GroupRestrictionId = "groupRestrictionId"
Field Value
| Type | Description |
|---|---|
| string |
InhibitConflictsInformation
Declaration
public const string InhibitConflictsInformation = "inhibitConflictsInformation"
Field Value
| Type | Description |
|---|---|
| string |
OwnerAssociateIdInformation
Declaration
public const string OwnerAssociateIdInformation = "ownerAssociateIdInformation"
Field Value
| Type | Description |
|---|---|
| string |
PersonEmailsInformation
Declaration
public const string PersonEmailsInformation = "personEmailsInformation"
Field Value
| Type | Description |
|---|---|
| string |
ProviderName
Declaration
public const string ProviderName = "Participants"
Field Value
| Type | Description |
|---|---|
| string |
ResourceEntity
Declaration
public const string ResourceEntity = "resource"
Field Value
| Type | Description |
|---|---|
| string |
ResourceRestrictionId
Declaration
public const string ResourceRestrictionId = "resourceRestrictionId"
Field Value
| Type | Description |
|---|---|
| string |
StartTimeInformation
Declaration
public const string StartTimeInformation = "startTimeInformation"
Field Value
| Type | Description |
|---|---|
| string |
StartTimeUtcInformation
Declaration
public const string StartTimeUtcInformation = "startTimeUtcInformation"
Field Value
| Type | Description |
|---|---|
| string |
_colDateInformation
Declaration
protected ArchiveColumnInfo _colDateInformation
Field Value
| Type | Description |
|---|---|
| ArchiveColumnInfo |
_colEndTimeInformation
Declaration
protected ArchiveColumnInfo _colEndTimeInformation
Field Value
| Type | Description |
|---|---|
| ArchiveColumnInfo |
_colEndTimeUtcInformation
Declaration
protected ArchiveColumnInfo _colEndTimeUtcInformation
Field Value
| Type | Description |
|---|---|
| ArchiveColumnInfo |
_colInhibitConflictsInformation
Declaration
protected ArchiveColumnInfo _colInhibitConflictsInformation
Field Value
| Type | Description |
|---|---|
| ArchiveColumnInfo |
_colOwnerAssociateIdInformation
Declaration
protected ArchiveColumnInfo _colOwnerAssociateIdInformation
Field Value
| Type | Description |
|---|---|
| ArchiveColumnInfo |
_colStartTimeInformation
Declaration
protected ArchiveColumnInfo _colStartTimeInformation
Field Value
| Type | Description |
|---|---|
| ArchiveColumnInfo |
_colStartTimeUtcInformation
Declaration
protected ArchiveColumnInfo _colStartTimeUtcInformation
Field Value
| Type | Description |
|---|---|
| ArchiveColumnInfo |
Properties
BaseClassShouldFilterColumns
Subclass contract: Return true if the base class should filter columns according to SetDesiredColumns. If this property is false, the actual ArchiveRow objects are returned; otherwise a typed copy is made and ColumnData are populated accoprding to DesiredColumns.
Declaration
protected override bool BaseClassShouldFilterColumns { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Remarks
If columns are cheap to get, the subclass can save code by leaving the filtering to this base class. Conversely, if somecolumns are expensive to calculate, the subclass should do the filtering itself to improve performance.
BaseClassShouldFilterEntities
Subclass contract: Return true if the base class should filter columns according to SetDesiredColumns. If this property is false, the actual ArchiveRow objects are returned; otherwise a typed copy is made and ColumnData are populated accoprding to DesiredColumns.
Declaration
protected override bool BaseClassShouldFilterEntities { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Remarks
If columns are cheap to get, the subclass can save code by leaving the filtering to this base class. Conversely, if somecolumns are expensive to calculate, the subclass should do the filtering itself to improve performance.
BaseClassShouldPage
Subclass contract: Return true if the base class should perform filter entities according to SetDesiredEntities. If this property is false, the result set is assumed to represent the chosen entities only.
Declaration
protected override bool BaseClassShouldPage { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Remarks
If rows are cheap to get, the subclass can save code by leaving the filtering to this base class. Conversely, if rows are expensive to calculate, the subclass should do the entity filtering itself to improve performance.
BaseClassShouldSort
Subclass contract: Return true if the base class should perform sorting according to SetOrderBy. If this property is false, the result set is assumed to be correctly ordered.
Declaration
protected override bool BaseClassShouldSort { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Methods
GetResultDataAsync(CancellationToken)
Get results for the base class, which will handle paging and other functionality
Declaration
protected override IAsyncEnumerable<ArchiveRow> GetResultDataAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerableArchiveRow | List of rows in sorted order |
Overrides
SetRestriction(params ArchiveRestrictionInfo[])
Handle restrictions; see class documentation for details. Basic consistency checks are made here, and we also determine whether we'll need booking-based data, explicit-based, or both.
Declaration
public override bool SetRestriction(params ArchiveRestrictionInfo[] rawRestrictions)
Parameters
| Type | Name | Description |
|---|---|---|
| ArchiveRestrictionInfo | rawRestrictions | Restrictions, used by the caller to dictate behaviour |
Returns
| Type | Description |
|---|---|
| bool | true if at least one valid restriction was found |