apiserver

package
v0.0.0-...-02a8c05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Ce package définit les types communs aux échanges client/serveur, ainsi que les urls à utiliser. Les requêtes elles mêmes sont définies dans le package client/controllers

Index

Constants

View Source
const (
	DBHashHeaderJSONKey = "header"
	DBHashBinaryKey     = "bin"
)
View Source
const (
	RecusFiscauxJSONKey = "dons"
	RecusFiscauxZIPKey  = "archive"
)
View Source
const (
	UrlPersonnes                  = "/personnes"
	UrlOrganismes                 = "/organismes"
	UrlDocumentsMiniatures        = "/documents/miniatures"
	UrlDocumentsTransfert         = "/documents/transfert"
	UrlDocuments                  = "/documents"
	UrlAides                      = "/aides"
	UrlStructureaides             = "/structure_aides"
	UrlCamps                      = "/camps"
	UrlParticipants               = "/participants"
	UrlParticipantsimples         = "/participantsimples"
	UrlEquipiers                  = "/equipiers"
	UrlDB                         = "/db"
	UrlUsers                      = "/users"
	UrlDons                       = "/dons"
	UrlRecuFiscal                 = "/dons/recu"
	UrlDonsHelloasso              = "/dons/helloasso"
	UrlInscriptions               = "/inscriptions"
	UrlValideInscriptions         = "/inscriptions/valide"
	UrlPaiements                  = "/paiements"
	UrlPaiementsBordereau         = "/paiements/bordereau"
	UrlFactures                   = "/factures"
	UrlFacturesFusion             = "/factures/fusion"
	UrlIdentifieEquipier          = "/identifie/equipier"
	UrlIdentifieParticipant       = "/identifie/participant"
	UrlIdentifieResponsable       = "/identifie/responsable"
	UrlIdentifieParticipantsimple = "/identifie/participantsimple"

	UrlNotifieMessage      = "/factures/notifie"
	UrlNotifieMessagePerso = "/factures/notifie/message"

	UrlMessages = "/messages"

	UrlNotifieMessagePersos = "/factures/notifie/messages"
	UrlNotifiePlaceLiberee  = "/factures/notifie/place_liberee"
	UrlNotifieAttestation   = "/factures/notifie/attestation"
	UrlNotifieDocuments     = "/factures/notifie/documents"
	UrlNotifieSondages      = "/factures/notifie/sondages"
	UrlDeleteMessages       = "/messages/delete"

	// UrlMailsAccuseReception = "/factures/mails/accuse_reception"
	// UrlMailsFacture         = "/factures/mails/facture"
	// UrlMailsAttestations    = "/factures/mails/attestations"
	// UrlMailsRIB             = "/factures/mails/RIB"
	UrlMailsSimple = "/simple_mail"

	UrlUpdate = "/logiciel/update"

	BasicAuthUsername = "acve_gestion"
)
View Source
const DOCUMENT_MAX_SIZE = 5000000 // en bytes

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCampIn

type CreateCampIn struct {
	Camp           rd.Camp
	CopyLettreFrom rd.OptionnalId
}

type CreateDocumentIn

type CreateDocumentIn struct {
	Document rd.Document
	Target   rd.TargetDocument
}

func (CreateDocumentIn) MarshalJSON

func (cd CreateDocumentIn) MarshalJSON() ([]byte, error)

func (*CreateDocumentIn) UnmarshalJSON

func (cd *CreateDocumentIn) UnmarshalJSON(data []byte) (err error)

type CreateDonIn

type CreateDonIn struct {
	Don      rd.Don
	Donateur rd.DonDonateur
	// un don HelloAsso n'est jamais notifié par mail
	Notifie bool
}

type CreateEquipierOut

type CreateEquipierOut struct {
	Equipier    rd.Equipier
	Contraintes rd.EquipierContraintes
}

type CreateFactureIn

type CreateFactureIn struct {
	IdResponsable  int64  `json:"id_responsable"`
	IdParticipants rd.Ids `json:"id_participants"`
}

type CreateFactureOut

type CreateFactureOut struct {
	Facture      rd.Facture      `json:"facture"`
	Participants rd.Participants `json:"participants"`
	Message      rd.Message      `json:"message"`
}

type CreateMessageMessage

type CreateMessageMessage NotifieMessageOut

CreateMessageMessage ajoute un message SANS envoyer de mail

type CreateParticipantOut

type CreateParticipantOut struct {
	Participant       rd.Participant       `json:"participant"`
	FoundGroupe       bool                 `json:"found_groupe"`
	GroupeParticipant rd.GroupeParticipant `json:"groupe_participant"`
}

CreateParticipantOut renvoie aussi un éventuel groupe

type DeleteCampOut

type DeleteCampOut struct {
	IdsDocuments rd.Ids `json:"ids_documents"` // documents supprimés
	IdsGroupes   rd.Ids `json:"ids_groupes"`   // groupes supprimés
}

DeleteParticipantOut renvois les suppressions induites par la suppression d'un camp.

type DeleteEquipierOut

type DeleteEquipierOut struct {
	IdsDocuments rd.Ids `json:"ids_documents"`
	IdPersonne   int64  `json:"id_personne"` // -1 pour aucune suppression
}

DeleteEquipierOut renvois les suppressions induites par la suppression d'un équipier.

type DeleteFactureOut

type DeleteFactureOut struct {
	Participants     rd.Participants
	DeletedPaiements rd.Ids
}

type DeleteInscriptionOut

type DeleteInscriptionOut struct {
	Participants []DeleteParticipantOut

	IdsPaiements  rd.Ids // supprimés
	IdsDocuments  rd.Ids // supprimés
	IdResponsable int64  // -1 pour pas de suppression
}

type DeleteOrganismeOut

type DeleteOrganismeOut struct {
	Id   int64
	Dons rd.Ids // dons données par l'organisme
}

type DeleteParticipantOut

type DeleteParticipantOut struct {
	IdParticipant int64  `json:"id_participant"`
	IdsAides      rd.Ids `json:"ids_aides"`
	IdsDocuments  rd.Ids `json:"ids_documents"`
	IdPersonne    int64  `json:"id_personne"` // -1 pour aucune suppression
	IdsMessages   rd.Ids `json:"ids_messages"`
}

DeleteParticipantOut renvois les suppressions induites par la suppression d'un participant.

type DeleteStructureaideOut

type DeleteStructureaideOut struct {
	IdsAides     rd.Ids `json:"ids_aides"`
	IdsDocuments rd.Ids `json:"ids_documents"`
}

DeleteStructureaideOut renvois les suppressions induites par la suppression d'une stucture

type DonDonateur

type DonDonateur struct {
	Don      rd.Don          `json:"don"`
	Donateur rd.BasePersonne `json:"donateur"`
}

DonDonateur représente un don, avec des données aidant à identifier le donateur

type EditMessageIn

type EditMessageIn struct {
	IdMessages rd.Ids
	Contenu    rd.String
}

type EditMessageOut

type EditMessageOut struct {
	Messages        rd.Messages
	MessageMessages rd.MessageMessages
}

type FusionneFacturesIn

type FusionneFacturesIn struct {
	From    int64 // facture à fusionner
	To      int64 // destination
	Notifie bool  // si oui, notifie par mail du changement d'espace perso
}

type FusionneFacturesOut

type FusionneFacturesOut struct {
	Participants rd.Participants
	Paiements    rd.Paiements
	Messages     rd.Messages
	Sondages     rd.Sondages
	OldId        int64 // id du dossier désormais vide
}

type IdentifieDonIn

type IdentifieDonIn struct {
	Don              rd.Don          `json:"don"`
	Rattache         bool            `json:"rattache"`
	Modifications    rd.BasePersonne `json:"modifications"`
	IdPersonneTarget int64           `json:"id_personne_target"` // ignoré si Rattache = false
}

type IdentifieDonOut

type IdentifieDonOut struct {
	Don      rd.Don
	Donateur rd.DonDonateur
	Personne rd.Personne // nouvelle ou modifiée
}

type IdentifieEquipierIn

type IdentifieEquipierIn struct {
	IdEquipier int64

	IdentifiePersonneIn
}

Si `Rattache` vaut `true`, l'équipier est rattaché à la personne existante

type IdentifieEquipierOut

type IdentifieEquipierOut struct {
	IdentifiePersonneOut
	Equipier rd.Equipier `json:"equipier"`
}

type IdentifieParticipantIn

type IdentifieParticipantIn struct {
	IdParticipant int64

	IdentifiePersonneIn
}

Si `Rattache` vaut `true`, le partcipant est rattaché à la personne existante

type IdentifieParticipantOut

type IdentifieParticipantOut struct {
	Participant rd.Participant `json:"participant"`
	IdentifiePersonneOut
}

type IdentifieParticipantsimpleIn

type IdentifieParticipantsimpleIn struct {
	IdParticipantsimple int64

	IdentifiePersonneIn
}

Si `Rattache` vaut `true`, le participant est rattaché à la personne existante

type IdentifieParticipantsimpleOut

type IdentifieParticipantsimpleOut struct {
	Participantsimple rd.Participantsimple `json:"participantsimple"`
	IdentifiePersonneOut
}

type IdentifiePersonneIn

type IdentifiePersonneIn struct {
	IdPersonneTmp     int64           `json:"id_personne_tmp"`
	Rattache          bool            `json:"rattache"`
	IdPersonneTarget  int64           `json:"id_personne_target"`
	Modifications     rd.BasePersonne `json:"modifications"`
	SupprimeDocuments rd.Ids          `json:"supprime_documents"`
}

IdentifiePersonne indique comment identifier une personne temporaire. Si `Rattache` vaut false, la personne est marquée comme non temporaire (`IdPersonneTarget`, `Modifications` et `SupprimeDocuments` sont ignorés) Sinon, `Modifications` est appliquée à `IdPersonneTarget`. Les documents de `IdPersonneTmp` sont rattachés à la personne, en supprimant les documents existants sur `IdPersonneTarget` donnés par `SupprimeDocuments`. Finalement, `IdPersonneTmp` est supprimé (à moins qu'elle ne soit pas temporaire).

type IdentifiePersonneOut

type IdentifiePersonneOut struct {
	Personne rd.Personne `json:"personne"`

	// Modifications du propriétaire de ces documents
	Documents       rd.DocumentPersonnes `json:"documents"`
	DeletedDocs     rd.Ids               `json:"deleted_docs"`
	DeletedPersonne int64                `json:"deleted_personne"` // -1 pour aucune suppression
}

type IdentifieResponsableIn

type IdentifieResponsableIn struct {
	IdFacture int64

	IdentifiePersonneIn
}

Si `Rattache` vaut `true`, la facture est rattaché à la personne existante

type IdentifieResponsableOut

type IdentifieResponsableOut struct {
	Facture rd.Facture `json:"facture"`
	IdentifiePersonneOut
}

type NotifieAttestationIn

type NotifieAttestationIn struct {
	IdFacture int64
	Kind      rd.MessageKind
}

type NotifieAttestationOut

type NotifieAttestationOut struct {
	Message            rd.Message
	MessageAttestation rd.MessageAttestation
}

type NotifieDocumentsIn

type NotifieDocumentsIn struct {
	IdCamp      int64
	IdsFactures rd.Ids
}

NotifieDocuments envoie les documents du camp donné aux responsables des factures données. Le serveur stream une liste de factures modifiées.

type NotifieDocumentsOut

type NotifieDocumentsOut struct {
	Message     rd.Message
	MessageCamp rd.MessageDocument
}

NotifieDocumentsOut est stream par le serveur pour chaque mail

type NotifieManyIn

type NotifieManyIn struct {
	Contenu     rd.String
	IdsFactures rd.Ids
}

NotifieManyIn envoie un message à plusieurs dossiers

type NotifieManyOut

type NotifieManyOut struct {
	Message        rd.Message
	MessageMessage rd.MessageMessage
}

NotifieManyOut est stream au fur et à mesure des envois

type NotifieMessageIn

type NotifieMessageIn struct {
	IdFacture int64
	Contenu   rd.String
}

NotifieMessageIn ajoute le message et envoie un mail de notification

type NotifieMessageOut

type NotifieMessageOut struct {
	Message        rd.Message
	MessageMessage rd.MessageMessage
}

type NotifiePlaceLibereeIn

type NotifiePlaceLibereeIn struct {
	IdParticipant int64
	NewStatut     rd.StatutAttente
}

NotifiePlaceLibereeIn crée un message adapté et modifie le statut du participant

type NotifiePlaceLibereeOut

type NotifiePlaceLibereeOut struct {
	Participant rd.Participant
	Message     rd.Message
	Details     rd.MessagePlacelibere
}

type NotifieSimple

type NotifieSimple struct {
	IdFacture int64
	Kind      rd.MessageKind
}

type NotifieSondagesOut

type NotifieSondagesOut struct {
	Message        rd.Message
	MessageSondage rd.MessageSondage
}

NotifieSondagesOut est stream par le serveur pour chaque mail

type OutputLoggin

type OutputLoggin struct {
	Valid bool    `json:"valid"`
	User  rd.User `json:"user"`
}

type ParamsEnvoiAccuseReception

type ParamsEnvoiAccuseReception struct {
	Facture rd.Facture
	Html    string
	WithRIB bool
	To      string
	Ccs     []string
}

type ParamsEnvoiAttestations

type ParamsEnvoiAttestations struct {
	Facture      rd.Facture
	Html         string
	To           string
	Ccs          []string
	WithFacture  bool
	WithPresence bool
}

type ParamsEnvoiFacture

type ParamsEnvoiFacture struct {
	Facture rd.Facture
	Html    string
	To      string
	Ccs     []string
}

type ParamsEnvoiRIB

type ParamsEnvoiRIB struct {
	Html string
	To   string
	Ccs  []string
}

type ParamsLoggin

type ParamsLoggin struct {
	Id       int64  `json:"id"`
	Password string `json:"password"`
}

ParamsLoggin demande l'accès au compte donné par `Id` avec le mot de passe `password`

type ParamsSimpleMail

type ParamsSimpleMail struct {
	Html    string
	To      string
	Subject string
}

ParamsSimpleMail envoie le mail donnée à l'adresse donnée, et renvoie une string

type ParamsUploadDocument

type ParamsUploadDocument struct {
	Id       int64
	Filename string
	Content  io.ReadCloser
}

type StreamOut

type StreamOut struct {
	Error string
	Data  interface{}
}

type VersionInfos

type VersionInfos struct {
	Version string `json:"version"`
	Hash    []byte `json:"hash"`
	NbFiles int    `json:"nb_files"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL