github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/server/directeurs/types.go (about)

     1  package directeurs
     2  
     3  import (
     4  	rd "github.com/benoitkugler/goACVE/server/core/rawdata"
     5  	"github.com/benoitkugler/goACVE/server/core/rawdata/matching"
     6  	"github.com/benoitkugler/goACVE/server/core/utils/joomeo"
     7  	"github.com/benoitkugler/goACVE/server/documents"
     8  	"github.com/benoitkugler/goACVE/server/shared"
     9  )
    10  
    11  // Ce fichier regroupes les types échangés entre le client et le serveur
    12  
    13  type LogginIn struct {
    14  	IdCamp   int64  `json:"id_camp"`
    15  	Password string `json:"password"`
    16  }
    17  
    18  type LogginOut struct {
    19  	Token      string      `json:"token"`
    20  	Valide     bool        `json:"valide"`
    21  	Camp       shared.Camp `json:"camp"`
    22  	LienCompta string      `json:"lien_compta"`
    23  }
    24  
    25  type DocumentsEquipeOut struct {
    26  	Token  string `json:"token"`
    27  	Pieces Pieces `json:"pieces"`
    28  }
    29  
    30  type UpdateContrainteEquipierIn struct {
    31  	IdEquipier   int64 `json:"id_equipier"`
    32  	IdContrainte int64 `json:"id_contrainte"`
    33  	// NON pour non demandé, zero pour option, OUI pour obligatoire
    34  	Demande rd.OptionnalBool `json:"demande"`
    35  }
    36  
    37  // ajoute un document à l'equipier donné.
    38  // les metas données renvoyées permettent d'upload ensuite le contenu.
    39  type AddDocumentIn struct {
    40  	IdEquipier   int64     `json:"id_equipier"`
    41  	IdContrainte int64     `json:"id_contrainte"`
    42  	Description  rd.String `json:"description"`
    43  }
    44  
    45  type AddDocumentOut struct {
    46  	Token    string                   `json:"token"`
    47  	Document documents.PublicDocument `json:"document"`
    48  }
    49  
    50  type ChercheSimilaireOut struct {
    51  	Token        string              `json:"token"`
    52  	Propositions []ResultatRecherche `json:"propositions"`
    53  }
    54  
    55  type LoadEquipiersOut struct {
    56  	Token  string              `json:"token"`
    57  	Equipe []EquipierDirecteur `json:"equipe"`
    58  }
    59  
    60  type CreateEquipierIn struct {
    61  	// sinon, nouveau
    62  	Rattache   bool     `json:"rattache"`
    63  	Roles      rd.Roles `json:"roles"`
    64  	IdPersonne int64    `json:"id_personne"`
    65  	// le champ de recherche actuel
    66  	Personne matching.PatternsSimilarite `json:"personne"`
    67  }
    68  
    69  type InviteFormulaireIn struct {
    70  	Mode          formulaireEquipier `json:"mode"`
    71  	IdParticipant int64              `json:"id_participant"`
    72  }
    73  
    74  type LoadInscritsOut struct {
    75  	Token    string    `json:"token"`
    76  	Inscrits []Inscrit `json:"inscrits"`
    77  }
    78  
    79  type UpdateInscritIn struct {
    80  	Id            int64           `json:"id"`
    81  	Modifications InscritWritable `json:"modifications"`
    82  }
    83  
    84  type DownloadFicheSanitaireIn struct {
    85  	Mode          modeDownloadFicheSanitaire `json:"mode"`
    86  	IdParticipant int64                      `json:"id_participant"` // only for one
    87  	TriGroupe     bool                       `json:"tri_groupe"`     // only for all in one document
    88  	OnlyMineurs   bool                       `json:"only_mineurs"`   // for all and all_in_one_document
    89  }
    90  
    91  type DetailsDetailsOutput struct {
    92  	Token   string  `json:"token"`
    93  	Details Details `json:"details"`
    94  }
    95  
    96  type DetailsEnvoisOut struct {
    97  	Token         string                     `json:"token"`
    98  	Envois        rd.Envois                  `json:"envois"`
    99  	PiecesJointes []documents.PublicDocument `json:"pieces_jointes"`
   100  }
   101  
   102  type AddBonusDocOut struct {
   103  	Token    string                   `json:"token"`
   104  	Document documents.PublicDocument `json:"document"`
   105  }
   106  
   107  type ListeVetementsOut struct {
   108  	Token string            `json:"token"`
   109  	Liste rd.ListeVetements `json:"liste"`
   110  }
   111  
   112  type LettreDirecteurOut struct {
   113  	Token    string                   `json:"token"`
   114  	Lettre   rd.Lettredirecteur       `json:"lettre"`
   115  	Document documents.PublicDocument `json:"document"` // éventuellement zero
   116  }
   117  
   118  type LoadJoomeoOut struct {
   119  	JoomeoData
   120  	Token string `json:"token"`
   121  }
   122  
   123  type AddContactJoomeoIn struct {
   124  	Mails    []string `json:"mails"`
   125  	SendMail bool     `json:"send_mail"`
   126  }
   127  
   128  type AddContactJoomeoOut struct {
   129  	Token    string                     `json:"token"`
   130  	Errors   []string                   `json:"errors"`
   131  	Contacts []joomeo.ContactPermission `json:"contacts"`
   132  }
   133  
   134  type SetContactUploaderIn struct {
   135  	Contactid string `json:"contactid"`
   136  }
   137  
   138  type SetContactUploaderOut struct {
   139  	Token           string                     `json:"token"`
   140  	Contacts        []joomeo.ContactPermission `json:"contacts"`
   141  	ErrSuperContact string                     `json:"err_super_contact"`
   142  }
   143  
   144  type DeleteContactOut struct {
   145  	Token    string                     `json:"token"`
   146  	Contacts []joomeo.ContactPermission `json:"contacts"`
   147  }
   148  
   149  type LoadGroupesOut struct {
   150  	Token             string               `json:"token"`
   151  	Groupes           rd.Groupes           `json:"groupes"`
   152  	CampContraintes   rd.CampContraintes   `json:"camp_contraintes"`
   153  	GroupeContraintes rd.GroupeContraintes `json:"groupe_contraintes"`
   154  }
   155  
   156  type UpdateGroupeOut struct {
   157  	Token  string    `json:"token"`
   158  	Groupe rd.Groupe `json:"groupe"`
   159  }
   160  
   161  type UpdatePlageIn struct {
   162  	Groupes rd.Groupes `json:"groupes"`
   163  	Erase   bool       `json:"erase"`
   164  }
   165  
   166  type UpdatePlageOut struct {
   167  	Token          string `json:"token"`
   168  	NbParticipants int    `json:"nb_participants"`
   169  }
   170  
   171  type ContrainteComplete struct {
   172  	rd.Contrainte
   173  	Document documents.PublicDocument `json:"document"`
   174  }
   175  
   176  type LoadContraintesOut struct {
   177  	Token       string                       `json:"token"`
   178  	Contraintes map[int64]ContrainteComplete `json:"contraintes"`
   179  }
   180  
   181  type UpdateContrainteOut struct {
   182  	Token      string        `json:"token"`
   183  	Contrainte rd.Contrainte `json:"contrainte"`
   184  }
   185  
   186  type LieDocumentOut struct {
   187  	Token    string                   `json:"token"`
   188  	Document documents.PublicDocument `json:"document"`
   189  }
   190  
   191  type DeleteContrainteOut struct {
   192  	Token       string `json:"token"`
   193  	NbDocuments int    `json:"nb_documents"`
   194  }
   195  
   196  type DemandeContraintesIn struct {
   197  	GroupeContraintes rd.GroupeContraintes `json:"groupe_contraintes,omitempty"`
   198  	// l'attribut IdCamp est ignoré
   199  	CampContraintes rd.CampContraintes `json:"camp_contraintes,omitempty"` // appliquées à tous les participants
   200  }
   201  
   202  type PreviewDocumentsParticipantsOut struct {
   203  	NbDemandes int `json:"nb_demandes"`
   204  	NbRecus    int `json:"nb_recus"`
   205  }
   206  
   207  type SondageParts struct {
   208  	Participants []rd.String `json:"participants"`
   209  	Responsable  rd.String   `json:"responsable"`
   210  	Mail         rd.String   `json:"mail"`
   211  	rd.Sondage
   212  }
   213  
   214  type LoadSondagesOut struct {
   215  	Token    string         `json:"token"`
   216  	Sondages []SondageParts `json:"sondages"`
   217  }
   218  
   219  type UpdateInsritsAnimateurOut struct {
   220  	Token                string                  `json:"token"`
   221  	ParticipantEquipiers rd.ParticipantEquipiers `json:"participant_equipiers"`
   222  }
   223  
   224  // LoadGroupeAnimateurs renvoie les animateurs d'un groupe
   225  // et les animateurs de référence pour chaque inscrit
   226  type LoadGroupeAnimateursOut struct {
   227  	UpdateInsritsAnimateurOut
   228  	GroupeEquipiers rd.GroupeEquipiers `json:"groupe_equipiers"`
   229  }
   230  
   231  type AddGroupeAnimateursIn struct {
   232  	IdGroupe    int64  `json:"id_groupe"`
   233  	IdEquipiers rd.Ids `json:"id_equipiers"`
   234  }
   235  
   236  type DeleteGroupeAnimateurIn struct {
   237  	IdGroupe   int64 `json:"id_groupe"`
   238  	IdEquipier int64 `json:"id_equipier"`
   239  }
   240  
   241  type UpdateInscritsAnimateurIn struct {
   242  	IdGroupe int64 `json:"id_groupe"`
   243  	// si null, enlève simplement l'animateur courant
   244  	IdAnimateur rd.OptionnalId `json:"id_animateur"`
   245  	IdInscrits  rd.Ids         `json:"id_inscrits"`
   246  }