Types Votez
Types utilisés par le module de vote MCM Votez.
Campagnes
B2BCampagneItem
Informations d'une campagne de vote.
public class B2BCampagneItem
{
public required Guid Id { get; init; }
public required string Titre { get; init; }
public required string Slug { get; init; }
public required DateTime OuvertureDuVoteUtc { get; init; }
public required DateTime FermetureDuVoteUtc { get; init; }
public required string Etat { get; init; }
public required bool EstPublie { get; init; }
public required bool EstArchive { get; init; }
public required int NombreVotants { get; init; }
public required int NombreQuestions { get; init; }
public required DateTime DateCreationUtc { get; init; }
public required DateTime DateModificationUtc { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
Id | Guid | Identifiant unique |
Titre | string | Titre de la campagne |
Slug | string | URL-friendly identifier |
OuvertureDuVoteUtc | DateTime | Date/heure d'ouverture du vote |
FermetureDuVoteUtc | DateTime | Date/heure de fermeture du vote |
Etat | string | État actuel (voir ci-dessous) |
EstPublie | bool | Campagne publiée et accessible |
EstArchive | bool | Campagne archivée |
NombreVotants | int | Nombre total de votants inscrits |
NombreQuestions | int | Nombre de questions |
DateCreationUtc | DateTime | Date de création |
DateModificationUtc | DateTime | Dernière modification |
États de campagne
| État | Description |
|---|---|
Brouillon | En cours de préparation |
Planifie | Publiée, en attente d'ouverture |
VoteOuvert | Vote en cours |
Termine | Vote terminé |
Archive | Archivée |
B2BCreateCampagneDto
DTO pour la création d'une campagne.
public class B2BCreateCampagneDto
{
public required string Titre { get; init; }
public required DateTime OuvertureDuVoteUtc { get; init; }
public required DateTime FermetureDuVoteUtc { get; init; }
public string? TextePageAccueil { get; init; }
public string? LibelleAbstention { get; init; }
public bool OrdreReponsesAleatoire { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
Titre | string | Titre de la campagne (requis) |
OuvertureDuVoteUtc | DateTime | Date/heure d'ouverture (requis) |
FermetureDuVoteUtc | DateTime | Date/heure de fermeture (requis) |
TextePageAccueil | string? | HTML de la page d'accueil |
LibelleAbstention | string? | Texte du bouton d'abstention |
OrdreReponsesAleatoire | bool | Mélanger l'ordre des options |
B2BUpdateCampagneDto
DTO pour la modification d'une campagne.
public class B2BUpdateCampagneDto
{
public required string Titre { get; init; }
public required DateTime OuvertureDuVoteUtc { get; init; }
public required DateTime FermetureDuVoteUtc { get; init; }
public string? TextePageAccueil { get; init; }
public string? LibelleAbstention { get; init; }
public bool OrdreReponsesAleatoire { get; init; }
}
B2BCampagneSearchRequest
Paramètres de recherche pour les campagnes.
public record B2BCampagneSearchRequest
{
public string? Etat { get; init; }
public string? Titre { get; init; }
public DateTime? OuvertureApres { get; init; }
public DateTime? FermetureAvant { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
Etat | string? | Filtrer par état |
Titre | string? | Recherche par titre (contains) |
OuvertureApres | DateTime? | Campagnes ouvrant après cette date |
FermetureAvant | DateTime? | Campagnes fermant avant cette date |
B2BCampagneStatsItem
Statistiques agrégées d'une campagne.
public class B2BCampagneStatsItem
{
public required Guid CampagneId { get; init; }
public required string Titre { get; init; }
public required string Etat { get; init; }
public required int TotalVotants { get; init; }
public required int VotantsAyantVote { get; init; }
public required decimal TauxParticipation { get; init; }
public required List<B2BQuestionStatsItem> Questions { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
CampagneId | Guid | Identifiant de la campagne |
Titre | string | Titre de la campagne |
Etat | string | État actuel |
TotalVotants | int | Nombre de votants inscrits |
VotantsAyantVote | int | Nombre de votants ayant voté |
TauxParticipation | decimal | Pourcentage de participation (0-100) |
Questions | List<B2BQuestionStatsItem> | Statistiques par question |
Questions
B2BQuestionItem
Informations d'une question de vote.
public class B2BQuestionItem
{
public required int Id { get; init; }
public required string Texte { get; init; }
public required string Nom { get; init; }
public required string TypeQuestion { get; init; }
public required int MinReponses { get; init; }
public required int MaxReponses { get; init; }
public required bool AbstentionPermise { get; init; }
public required int Ordre { get; init; }
public required int NombreOptions { get; init; }
public required List<B2BOptionReponseItem> Options { get; init; }
public required DateTime DateCreationUtc { get; init; }
public required DateTime DateModificationUtc { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
Id | int | Identifiant unique |
Texte | string | Texte/description HTML de la question |
Nom | string | Nom court de la question |
TypeQuestion | string | Type (ChoixLibre, Proposition, Election) |
MinReponses | int | Nombre minimum de réponses requises |
MaxReponses | int | Nombre maximum de réponses permises |
AbstentionPermise | bool | Abstention autorisée |
Ordre | int | Position dans la campagne |
NombreOptions | int | Nombre d'options de réponse |
Options | List<B2BOptionReponseItem> | Options de réponse |
B2BCreateQuestionDto
DTO pour la création d'une question.
public class B2BCreateQuestionDto
{
public required string Texte { get; init; }
public required string Nom { get; init; }
public required string TypeQuestion { get; init; }
public required int MinReponses { get; init; }
public required int MaxReponses { get; init; }
public bool AbstentionPermise { get; init; }
public List<B2BCreateOptionReponseDto>? Options { get; init; }
}
B2BUpdateQuestionDto
DTO pour la modification d'une question.
public class B2BUpdateQuestionDto
{
public required string Texte { get; init; }
public required string Nom { get; init; }
public required int MinReponses { get; init; }
public required int MaxReponses { get; init; }
public bool AbstentionPermise { get; init; }
}
B2BQuestionStatsItem
Statistiques d'une question.
public class B2BQuestionStatsItem
{
public required int QuestionId { get; init; }
public required string Nom { get; init; }
public required string Texte { get; init; }
public required int TotalVotes { get; init; }
public required int Abstentions { get; init; }
public required List<B2BOptionStatsItem> Options { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
QuestionId | int | Identifiant de la question |
Nom | string | Nom de la question |
Texte | string | Texte de la question |
TotalVotes | int | Nombre total de votes |
Abstentions | int | Nombre d'abstentions |
Options | List<B2BOptionStatsItem> | Statistiques par option |
Options de réponse
B2BOptionReponseItem
Informations d'une option de réponse.
public class B2BOptionReponseItem
{
public required Guid Id { get; init; }
public required string Texte { get; init; }
public string? Information { get; init; }
public required int Ordre { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
Id | Guid | Identifiant unique |
Texte | string | Texte de l'option |
Information | string? | Information supplémentaire |
Ordre | int | Position dans la question |
B2BCreateOptionReponseDto
DTO pour la création d'une option.
public class B2BCreateOptionReponseDto
{
public required string Texte { get; init; }
public string? Information { get; init; }
}
B2BOptionStatsItem
Statistiques d'une option.
public class B2BOptionStatsItem
{
public required Guid OptionId { get; init; }
public required string Texte { get; init; }
public required int Votes { get; init; }
public required decimal PoidsTotal { get; init; }
public required decimal Pourcentage { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
OptionId | Guid | Identifiant de l'option |
Texte | string | Texte de l'option |
Votes | int | Nombre de votes |
PoidsTotal | decimal | Total pondéré (somme des poids des votants) |
Pourcentage | decimal | Pourcentage des votes (0-100) |
Votants
B2BVotantItem
Informations d'un votant.
public class B2BVotantItem
{
public required Guid Id { get; init; }
public required string Courriel { get; init; }
public string? CourrielAlternatif { get; init; }
public string? Identifiant { get; init; }
public required string Nom { get; init; }
public required string Prenom { get; init; }
public required bool DroitDeVote { get; init; }
public required bool EstRadie { get; init; }
public required decimal Poids { get; init; }
public required bool AVote { get; init; }
public required DateTime DateCreationUtc { get; init; }
public required DateTime DateModificationUtc { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
Id | Guid | Identifiant interne MCM |
Courriel | string | Adresse courriel principale |
CourrielAlternatif | string? | Adresse courriel secondaire |
Identifiant | string? | Identifiant externe (numéro d'employé) |
Nom | string | Nom de famille |
Prenom | string | Prénom |
DroitDeVote | bool | A le droit de voter |
EstRadie | bool | Est radié (droit retiré) |
Poids | decimal | Poids du vote (1.0 par défaut) |
AVote | bool | A déjà voté |
DateCreationUtc | DateTime | Date de création |
DateModificationUtc | DateTime | Dernière modification |
B2BUpsertVotantDto
DTO pour la création ou mise à jour d'un votant.
public class B2BUpsertVotantDto
{
public required string Identifiant { get; init; }
public required string Courriel { get; init; }
public string? CourrielAlternatif { get; init; }
public required string Nom { get; init; }
public required string Prenom { get; init; }
public bool DroitDeVote { get; init; } = true;
public decimal Poids { get; init; } = 1.0m;
}
| Propriété | Type | Défaut | Description |
|---|---|---|---|
Identifiant | string | - | Clé de correspondance (requis) |
Courriel | string | - | Adresse courriel (requis) |
CourrielAlternatif | string? | null | Adresse secondaire |
Nom | string | - | Nom de famille (requis) |
Prenom | string | - | Prénom (requis) |
DroitDeVote | bool | true | A le droit de voter |
Poids | decimal | 1.0 | Poids du vote |
B2BVotantSearchRequest
Paramètres de recherche pour les votants.
public record B2BVotantSearchRequest
{
public string? Courriel { get; init; }
public string? Identifiant { get; init; }
public string? Nom { get; init; }
public bool? DroitDeVote { get; init; }
public bool? EstRadie { get; init; }
public bool? AVote { get; init; }
}
| Propriété | Type | Description |
|---|---|---|
Courriel | string? | Recherche par courriel (contains) |
Identifiant | string? | Recherche par identifiant (exact) |
Nom | string? | Recherche par nom/prénom (contains) |
DroitDeVote | bool? | Filtrer par droit de vote |
EstRadie | bool? | Filtrer par statut radié |
AVote | bool? | Filtrer par statut de vote |