composites

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AideComplet

type AideComplet struct {
	AideStructureaide
	ParticipantCamp
}

func (AideComplet) Description

func (a AideComplet) Description() string

type AideParticipant

type AideParticipant struct {
	rawdata.Aide        `json:"-"`
	rawdata.Participant `json:"-"`
}

func ScanAideParticipant

func ScanAideParticipant(row *sql.Row) (AideParticipant, error)

type AideParticipantCamp

type AideParticipantCamp struct {
	rawdata.Aide    `json:"-"`
	ParticipantCamp `json:"-"`
}

func ScanAideParticipantCamp

func ScanAideParticipantCamp(row *sql.Row) (AideParticipantCamp, error)

func (AideParticipantCamp) ValeurEffective

func (a AideParticipantCamp) ValeurEffective(withRemise bool) rd.Euros

ValeurEffective renvoie :

  • le montant dans le cas d'une aide absolue
  • le montant fois le nombre de jours (en prenant en compte une éventuelle limite) sinon

Si `withRemise` vaut true les remises (%) sont appliquées.

type AideParticipantCamps

type AideParticipantCamps []AideParticipantCamp

func ScanAideParticipantCamps

func ScanAideParticipantCamps(rs *sql.Rows) (AideParticipantCamps, error)

type AideParticipantFacture

type AideParticipantFacture struct {
	rawdata.Aide       `json:"-"`
	ParticipantFacture `json:"-"`
}

func ScanAideParticipantFacture

func ScanAideParticipantFacture(row *sql.Row) (AideParticipantFacture, error)

type AideParticipantFacturePersonne

type AideParticipantFacturePersonne struct {
	rawdata.Aide               `json:"-"`
	ParticipantFacturePersonne `json:"-"`
}

func ScanAideParticipantFacturePersonne

func ScanAideParticipantFacturePersonne(row *sql.Row) (AideParticipantFacturePersonne, error)

type AideParticipantFacturePersonnes

type AideParticipantFacturePersonnes []AideParticipantFacturePersonne

func ScanAideParticipantFacturePersonnes

func ScanAideParticipantFacturePersonnes(rs *sql.Rows) (AideParticipantFacturePersonnes, error)

type AideParticipantFactures

type AideParticipantFactures []AideParticipantFacture

func ScanAideParticipantFactures

func ScanAideParticipantFactures(rs *sql.Rows) (AideParticipantFactures, error)

type AideParticipantPersonne

type AideParticipantPersonne struct {
	rawdata.Aide        `json:"-"`
	ParticipantPersonne `json:"-"`
}

func ScanAideParticipantPersonne

func ScanAideParticipantPersonne(row *sql.Row) (AideParticipantPersonne, error)

type AideParticipantPersonnes

type AideParticipantPersonnes []AideParticipantPersonne

func ScanAideParticipantPersonnes

func ScanAideParticipantPersonnes(rs *sql.Rows) (AideParticipantPersonnes, error)

type AideParticipants

type AideParticipants []AideParticipant

func ScanAideParticipants

func ScanAideParticipants(rs *sql.Rows) (AideParticipants, error)

type AideStructureaide

type AideStructureaide struct {
	rawdata.Aide          `json:"-"`
	rawdata.Structureaide `json:"-"`
}

func ScanAideStructureaide

func ScanAideStructureaide(row *sql.Row) (AideStructureaide, error)

type AideStructureaides

type AideStructureaides []AideStructureaide

func ScanAideStructureaides

func ScanAideStructureaides(rs *sql.Rows) (AideStructureaides, error)

type BilanPrixCamp

type BilanPrixCamp struct {
	Aides   []resolvedAide
	Remises rd.Remises

	// prix du camp (option comprise)
	PrixBase        rd.Euros
	DescriptionPrix string
}

BilanPrixCamp regroupe les infos relative au coût d'un séjour pour un participant.

func (BilanPrixCamp) PrixNet

func (b BilanPrixCamp) PrixNet() rd.Euros

func (BilanPrixCamp) PrixSansAide

func (b BilanPrixCamp) PrixSansAide() rd.Euros

PrixSansAide renvoie le prix du séjour en appliquant les remises, mais pas les aides.

func (BilanPrixCamp) PrixSansRemises

func (b BilanPrixCamp) PrixSansRemises() rd.Euros

PrixSansRemises renvoie le prix du séjour si on applique les aides (extérieures) mais pas les remises.

func (BilanPrixCamp) TotalAides

func (b BilanPrixCamp) TotalAides() rd.Euros

type CampGroupes

type CampGroupes struct {
	rd.Camp
	Groupes []rd.Groupe
}

CampParticipants ajoute les groupes à un séjour (complet)

func NewCampGroupes

func NewCampGroupes(camp rd.Camp, groupes rd.Groupes) CampGroupes

NewCampGroupes sélectionne les groupes du camp, parmi un dictionnaire possiblement plus important

func (CampGroupes) TrouveGroupe

func (c CampGroupes) TrouveGroupe(dateNaissance rd.Date) (rd.Groupe, bool)

TrouveGroupe cherche parmis les groupes possibles celui qui pourrait convenir. Normalement, les groupes respectent un invariant de continuité sur les plages, imposé par le frontend. Si plusieurs pouvait convenir, un seul est renvoyé, de façon arbitraire.

type CampParticipants

type CampParticipants struct {
	rd.Camp
	Participants []rd.Participant
}

CampParticipants ajoute les participants (inscrits et liste d'attente) à un séjour (complet)

func NewCampParticipants

func NewCampParticipants(camp rd.Camp, participants rd.Participants) CampParticipants

NewCampParticipants sélectionne les participant dans un dictionnaire possiblement plus vaste

func (CampParticipants) HintsAttente

func (c CampParticipants) HintsAttente(pers rd.BasePersonne, isCurrentInscrit bool, personnes rd.Personnes) rd.HintsAttente

HintsAttente vérifie les conditions de liste d'attente `personnes` doit contenir les personnes déjà inscrites

func (CampParticipants) IsParticipantAlreadyHere

func (c CampParticipants) IsParticipantAlreadyHere(idPersonne int64) bool

IsParticipantAlreadyHere vérifie si le potentiel participant n'est pas déjà présent dans le camp.

func (CampParticipants) KeepEquilibreGF

func (c CampParticipants) KeepEquilibreGF(s rd.Sexe, isCurrentInscrit bool, personnes rd.Personnes) rd.StatutAttente

KeepEquilibreGF renvoie `true` si l'ajout de zéro ou un participant du sexe donné ne dépasse pas le quota G/F ou si le camp ne demande pas d'équilibre.

func (CampParticipants) RestePlace

func (c CampParticipants) RestePlace(isCurrentInscrit bool) rd.StatutAttente

RestePlace renvoie `true` si l'ajout de zéro ou un inscrit ne dépasse pas le nombre de places autorisées (nombre de places - places réservées)

type ContrainteDocument

type ContrainteDocument struct {
	rawdata.Contrainte `json:"-"`
	rawdata.Document   `json:"-"`
}

func ScanContrainteDocument

func ScanContrainteDocument(row *sql.Row) (ContrainteDocument, error)

type ContrainteDocuments

type ContrainteDocuments []ContrainteDocument

func ScanContrainteDocuments

func ScanContrainteDocuments(rs *sql.Rows) (ContrainteDocuments, error)

type ContraintePersonne

type ContraintePersonne struct {
	rawdata.Contrainte `json:"-"`
	rawdata.Personne   `json:"-"`
}

func ScanContraintePersonne

func ScanContraintePersonne(row *sql.Row) (ContraintePersonne, error)

type ContraintePersonnes

type ContraintePersonnes []ContraintePersonne

func ScanContraintePersonnes

func ScanContraintePersonnes(rs *sql.Rows) (ContraintePersonnes, error)

type EquipierCamp

type EquipierCamp struct {
	rawdata.Equipier `json:"-"`
	rawdata.Camp     `json:"-"`
}

func ScanEquipierCamp

func ScanEquipierCamp(row *sql.Row) (EquipierCamp, error)

type EquipierCamps

type EquipierCamps []EquipierCamp

func ScanEquipierCamps

func ScanEquipierCamps(rs *sql.Rows) (EquipierCamps, error)

type EquipierPersonne

type EquipierPersonne struct {
	rawdata.Equipier `json:"-"`
	rawdata.Personne `json:"-"`
}

func ScanEquipierPersonne

func ScanEquipierPersonne(row *sql.Row) (EquipierPersonne, error)

type EquipierPersonnes

type EquipierPersonnes []EquipierPersonne

func ScanEquipierPersonnes

func ScanEquipierPersonnes(rs *sql.Rows) (EquipierPersonnes, error)

type FacturePersonne

type FacturePersonne struct {
	rawdata.Facture  `json:"-"`
	rawdata.Personne `json:"-"`
}

func ScanFacturePersonne

func ScanFacturePersonne(row *sql.Row) (FacturePersonne, error)

type FacturePersonnes

type FacturePersonnes []FacturePersonne

func ScanFacturePersonnes

func ScanFacturePersonnes(rs *sql.Rows) (FacturePersonnes, error)

type GroupeCamp

type GroupeCamp struct {
	rawdata.Groupe `json:"-"`
	rawdata.Camp   `json:"-"`
}

func ScanGroupeCamp

func ScanGroupeCamp(row *sql.Row) (GroupeCamp, error)

type GroupeCamps

type GroupeCamps []GroupeCamp

func ScanGroupeCamps

func ScanGroupeCamps(rs *sql.Rows) (GroupeCamps, error)

type MessageFacture

type MessageFacture struct {
	rawdata.Message `json:"-"`
	rawdata.Facture `json:"-"`
}

func ScanMessageFacture

func ScanMessageFacture(row *sql.Row) (MessageFacture, error)

type MessageFacturePersonne

type MessageFacturePersonne struct {
	rawdata.Message `json:"-"`
	FacturePersonne `json:"-"`
}

func ScanMessageFacturePersonne

func ScanMessageFacturePersonne(row *sql.Row) (MessageFacturePersonne, error)

type MessageFacturePersonnes

type MessageFacturePersonnes []MessageFacturePersonne

func ScanMessageFacturePersonnes

func ScanMessageFacturePersonnes(rs *sql.Rows) (MessageFacturePersonnes, error)

type MessageFactures

type MessageFactures []MessageFacture

func ScanMessageFactures

func ScanMessageFactures(rs *sql.Rows) (MessageFactures, error)

type OptionParticipantCamp

type OptionParticipantCamp struct {
	OptionPrix rd.OptionPrixParticipant
	Bus        rd.Bus
	Camp       rd.Camp
}

OptionParticipantCamp suffit à déterminer les dates de présence d'un participant et d'autres quantités liées

func (OptionParticipantCamp) Description

func (p OptionParticipantCamp) Description() rd.String

Description renvoie un résumé de l'option, utilisable dans un tableau

func (OptionParticipantCamp) NbJours

func (p OptionParticipantCamp) NbJours() rd.Int

NbJours renvoie le nombre de jours de présence du participant en prenant en compte une éventulle option SEMAINE ou JOUR.

func (OptionParticipantCamp) Presence

func (p OptionParticipantCamp) Presence() (rd.Plage, bool)

NbJours renvoie la de présence du participant en prenant en compte une éventulle option SEMAINE ou JOUR. et indique s'il s'agit du cas particulier JOUR. Pour un camp avec option JOUR, il peut s'agir d'une approximation.

func (OptionParticipantCamp) StatutPrix

func (p OptionParticipantCamp) StatutPrix() rd.PrixParStatut

StatutPrix renvoi la catégorie de prix du participant Une catégorie avec un Id vide équivaut à l'absence de catégorie

type OrganismePersonne

type OrganismePersonne struct {
	rawdata.Organisme `json:"-"`
	rawdata.Personne  `json:"-"`
}

func ScanOrganismePersonne

func ScanOrganismePersonne(row *sql.Row) (OrganismePersonne, error)

type OrganismePersonnes

type OrganismePersonnes []OrganismePersonne

func ScanOrganismePersonnes

func ScanOrganismePersonnes(rs *sql.Rows) (OrganismePersonnes, error)

type PaiementFacture

type PaiementFacture struct {
	rawdata.Paiement `json:"-"`
	rawdata.Facture  `json:"-"`
}

func ScanPaiementFacture

func ScanPaiementFacture(row *sql.Row) (PaiementFacture, error)

type PaiementFacturePersonne

type PaiementFacturePersonne struct {
	rawdata.Paiement `json:"-"`
	FacturePersonne  `json:"-"`
}

func ScanPaiementFacturePersonne

func ScanPaiementFacturePersonne(row *sql.Row) (PaiementFacturePersonne, error)

type PaiementFacturePersonnes

type PaiementFacturePersonnes []PaiementFacturePersonne

func ScanPaiementFacturePersonnes

func ScanPaiementFacturePersonnes(rs *sql.Rows) (PaiementFacturePersonnes, error)

type PaiementFactures

type PaiementFactures []PaiementFacture

func ScanPaiementFactures

func ScanPaiementFactures(rs *sql.Rows) (PaiementFactures, error)

func (PaiementFactures) ByFacture

func (ps PaiementFactures) ByFacture() map[int64]PaiementFactures

ByFacture associe à chaque facture ses paiements (cout linéaire)

type ParticipantCamp

type ParticipantCamp struct {
	rawdata.Participant `json:"-"`
	rawdata.Camp        `json:"-"`
}

func ScanParticipantCamp

func ScanParticipantCamp(row *sql.Row) (ParticipantCamp, error)

func (ParticipantCamp) AsOptionParticipantCamp

func (pc ParticipantCamp) AsOptionParticipantCamp() OptionParticipantCamp

func (ParticipantCamp) WithAide

func (p ParticipantCamp) WithAide(aide rd.Aide) AideParticipantCamp

type ParticipantCamps

type ParticipantCamps []ParticipantCamp

func ScanParticipantCamps

func ScanParticipantCamps(rs *sql.Rows) (ParticipantCamps, error)

type ParticipantComplet

type ParticipantComplet struct {
	ParticipantCamp
	FacturePersonne
}

func (ParticipantComplet) AsFacture

func (ParticipantComplet) EtatFinancier

func (p ParticipantComplet) EtatFinancier(aides []AideStructureaide, withAidesInvalides bool) BilanPrixCamp

EtatFinancier calcule le prix du sejour pour le participant, en prenant en compte les options, les remises et les aides. Si `withAidesInvalides` vaut `false`, les aides non validées ne sont pas renvoyées. `aides` n'est pas filtrée

type ParticipantFacture

type ParticipantFacture struct {
	rawdata.Participant `json:"-"`
	rawdata.Facture     `json:"-"`
}

func ScanParticipantFacture

func ScanParticipantFacture(row *sql.Row) (ParticipantFacture, error)

type ParticipantFacturePersonne

type ParticipantFacturePersonne struct {
	rawdata.Participant `json:"-"`
	FacturePersonne     `json:"-"`
}

func ScanParticipantFacturePersonne

func ScanParticipantFacturePersonne(row *sql.Row) (ParticipantFacturePersonne, error)

type ParticipantFacturePersonnes

type ParticipantFacturePersonnes []ParticipantFacturePersonne

func ScanParticipantFacturePersonnes

func ScanParticipantFacturePersonnes(rs *sql.Rows) (ParticipantFacturePersonnes, error)

type ParticipantFactures

type ParticipantFactures []ParticipantFacture

func ScanParticipantFactures

func ScanParticipantFactures(rs *sql.Rows) (ParticipantFactures, error)

type ParticipantPersonne

type ParticipantPersonne struct {
	rawdata.Participant `json:"-"`
	rawdata.Personne    `json:"-"`
}

func ScanParticipantPersonne

func ScanParticipantPersonne(row *sql.Row) (ParticipantPersonne, error)

func (ParticipantPersonne) IsFicheSanitaireUpToDate

func (p ParticipantPersonne) IsFicheSanitaireUpToDate() rd.OptionnalBool

IsFicheSanitaireUpToDate compare le moment d'inscription avec la dernière modification sur la fiche sanitaire Non : jamais remplie, zero : rempli mais non a jour, Oui OK

type ParticipantPersonnes

type ParticipantPersonnes []ParticipantPersonne

func ScanParticipantPersonnes

func ScanParticipantPersonnes(rs *sql.Rows) (ParticipantPersonnes, error)

func (ParticipantPersonnes) LoadCamps

func (ps ParticipantPersonnes) LoadCamps(db rd.DB) (ParticipantCamps, error)

func (ParticipantPersonnes) LookupToPersonnes

func (ps ParticipantPersonnes) LookupToPersonnes() rd.Personnes

LookupToPersonnes renvoie l'association idParticipant -> personne

type ParticipantsimpleCamp

type ParticipantsimpleCamp struct {
	rawdata.Participantsimple `json:"-"`
	rawdata.Camp              `json:"-"`
}

func ScanParticipantsimpleCamp

func ScanParticipantsimpleCamp(row *sql.Row) (ParticipantsimpleCamp, error)

type ParticipantsimpleCamps

type ParticipantsimpleCamps []ParticipantsimpleCamp

func ScanParticipantsimpleCamps

func ScanParticipantsimpleCamps(rs *sql.Rows) (ParticipantsimpleCamps, error)

type ParticipantsimplePersonne

type ParticipantsimplePersonne struct {
	rawdata.Participantsimple `json:"-"`
	rawdata.Personne          `json:"-"`
}

func ScanParticipantsimplePersonne

func ScanParticipantsimplePersonne(row *sql.Row) (ParticipantsimplePersonne, error)

type ParticipantsimplePersonnes

type ParticipantsimplePersonnes []ParticipantsimplePersonne

func ScanParticipantsimplePersonnes

func ScanParticipantsimplePersonnes(rs *sql.Rows) (ParticipantsimplePersonnes, error)

type SondageCamp

type SondageCamp struct {
	rawdata.Sondage `json:"-"`
	rawdata.Camp    `json:"-"`
}

func ScanSondageCamp

func ScanSondageCamp(row *sql.Row) (SondageCamp, error)

type SondageCamps

type SondageCamps []SondageCamp

func ScanSondageCamps

func ScanSondageCamps(rs *sql.Rows) (SondageCamps, error)

type SondageFacture

type SondageFacture struct {
	rawdata.Sondage `json:"-"`
	rawdata.Facture `json:"-"`
}

func ScanSondageFacture

func ScanSondageFacture(row *sql.Row) (SondageFacture, error)

type SondageFacturePersonne

type SondageFacturePersonne struct {
	rawdata.Sondage `json:"-"`
	FacturePersonne `json:"-"`
}

func ScanSondageFacturePersonne

func ScanSondageFacturePersonne(row *sql.Row) (SondageFacturePersonne, error)

type SondageFacturePersonnes

type SondageFacturePersonnes []SondageFacturePersonne

func ScanSondageFacturePersonnes

func ScanSondageFacturePersonnes(rs *sql.Rows) (SondageFacturePersonnes, error)

type SondageFactures

type SondageFactures []SondageFacture

func ScanSondageFactures

func ScanSondageFactures(rs *sql.Rows) (SondageFactures, error)

Jump to

Keyboard shortcuts

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