Documentation ¶
Index ¶
- Variables
- type Config
- type Database
- func (d *Database) Close() error
- func (d *Database) Exec(query interface{}, params ...interface{}) (pg.Result, error)
- func (d *Database) Insert(model ...interface{}) error
- func (d *Database) Model(model ...interface{}) *orm.Query
- func (d *Database) Query(model interface{}, query interface{}, params ...interface{}) (pg.Result, error)
- type InspectionWithNombrePointsDeControle
- type Repository
- func (repo *Repository) AddFavoriToInspection(ctx *domain.UserContext, idInspection int64) error
- func (repo *Repository) CanCloreInspection(ctx *domain.UserContext, idInspection int64) error
- func (repo *Repository) CanCreateConstat(ctx *domain.UserContext, idPointDeControle int64) error
- func (repo *Repository) CanCreatePointDeControle(ctx *domain.UserContext, idInspection int64) error
- func (repo *Repository) CanDeleteOrUpdateConstat(ctx *domain.UserContext, idPointDeControle int64) error
- func (repo *Repository) CanUpdatePointDeControle(ctx *domain.UserContext, idPointDeControle int64) error
- func (repo *Repository) CheckCanCreateSuite(ctx *domain.UserContext, idInspection int64) error
- func (repo *Repository) CheckCanDeleteSuite(ctx *domain.UserContext, idInspection int64) (bool, error)
- func (repo *Repository) CheckEtatInspection(id int64, etats []models.EtatInspection) (bool, error)
- func (repo *Repository) CheckInspecteurAllowedInspection(ctx *domain.UserContext, id int64) error
- func (repo *Repository) CheckInspectionHasNonConformites(id int64) (bool, error)
- func (repo *Repository) CheckUserAllowedMessage(ctx *domain.UserContext, id int64) (bool, error)
- func (repo *Repository) CheckUserAllowedPointDeControle(ctx *domain.UserContext, id int64) (bool, error)
- func (repo *Repository) CheckUserIsRecipient(ctx *domain.UserContext, id int64) (bool, error)
- func (repo *Repository) CheckUsersInspecteurs(ids []int64) (bool, error)
- func (repo *Repository) CreateCanevas(ctx *domain.UserContext, idInspection int64, canevas models.Canevas) (int64, error)
- func (repo *Repository) CreateCommentaire(ctx *domain.UserContext, idInspection int64, commentaire models.Commentaire) (int64, error)
- func (repo *Repository) CreateConstat(ctx *domain.UserContext, idPointDeControle int64, constat models.Constat) (int64, error)
- func (repo *Repository) CreateEvenement(ctx *domain.UserContext, typeEvenement models.TypeEvenement, ...) error
- func (repo *Repository) CreateEvenementTx(tx *pg.Tx, ctx *domain.UserContext, typeEvenement models.TypeEvenement, ...) error
- func (repo *Repository) CreateInspection(ctx *domain.UserContext, inspection models.Inspection) (int64, error)
- func (repo *Repository) CreateMessage(ctx *domain.UserContext, idPointDeControle int64, message models.Message) (int64, error)
- func (repo *Repository) CreatePieceJointe(pieceJointe models.PieceJointe) (int64, error)
- func (repo *Repository) CreatePointDeControle(ctx *domain.UserContext, idInspection int64, ...) (int64, error)
- func (repo *Repository) CreateRapport(idInspection int64, rapport models.Rapport) error
- func (repo *Repository) CreateSuite(ctx *domain.UserContext, idInspection int64, suite models.Suite) (int64, error)
- func (repo *Repository) CreateTheme(ctx *domain.UserContext, theme models.Theme) (int64, error)
- func (repo *Repository) DeleteCanevas(ctx *domain.UserContext, id int64) error
- func (repo *Repository) DeleteConstat(ctx *domain.UserContext, idPointDeControle int64) error
- func (repo *Repository) DeletePointDeControle(ctx *domain.UserContext, idPointDeControle int64) error
- func (repo *Repository) DeleteSuite(ctx *domain.UserContext, idInspection int64) error
- func (repo *Repository) DeleteTheme(ctx *domain.UserContext, idTheme int64) error
- func (repo *Repository) FindEtablissements(ctx *domain.UserContext, filter domain.ListEtablissementsFilter) (*models.FindEtablissementResults, error)
- func (repo *Repository) FindUsers(filters domain.ListUsersFilters) ([]models.User, error)
- func (repo *Repository) GetCanevasByID(id int64) (*models.Canevas, error)
- func (repo *Repository) GetEtablissementByID(ctx *domain.UserContext, id int64) (*models.Etablissement, error)
- func (repo *Repository) GetEtatInspectionByPointDeControleID(idPointDeControle int64) (models.EtatInspection, error)
- func (repo *Repository) GetInspectionByID(ctx *domain.UserContext, id int64, filter domain.InspectionFilter) (*models.Inspection, error)
- func (repo *Repository) GetInspectionTypesConstatsSuiteByID(id int64) (*models.Inspection, error)
- func (repo *Repository) GetPieceJointe(ctx *domain.UserContext, idPieceJointe int64) (*models.PieceJointe, error)
- func (repo *Repository) GetRapport(ctx *domain.UserContext, idInspection int64) (*models.Rapport, error)
- func (repo *Repository) GetRecapsValidation(idInspection int64) ([]domain.RecapValidationInspection, error)
- func (repo *Repository) GetTypeConstatByPointDeControleID(idPointDeControle int64) (models.TypeConstat, error)
- func (repo *Repository) GetUserByEmail(email string) (*models.User, error)
- func (repo *Repository) GetUserByID(id int64) (*models.User, error)
- func (repo *Repository) ImportCanevas(ctx *domain.UserContext, inspectionId int64, canevas models.Canevas) error
- func (repo *Repository) ImportPointsDeControlesNonConformes(ctx *domain.UserContext, inspectionId int64, previousInspectionId int64) error
- func (repo *Repository) LireMessage(ctx *domain.UserContext, idMessage int64) error
- func (repo *Repository) LireNotifications(ctx *domain.UserContext, ids []int64) error
- func (repo *Repository) ListCanevas() ([]models.Canevas, error)
- func (repo *Repository) ListEtablissements() ([]models.Etablissement, error)
- func (repo *Repository) ListInspections(ctx *domain.UserContext, filter domain.ListInspectionsFilter) ([]models.Inspection, error)
- func (repo *Repository) ListInspectionsEcheancesProches(seuilRappelEcheances float32) ([]domain.InspectionEcheancesProches, error)
- func (repo *Repository) ListInspectionsExpirationDelais() ([]domain.InspectionExpirationDelais, error)
- func (repo *Repository) ListInspectionsFavorites(ctx *domain.UserContext) ([]models.Inspection, error)
- func (repo *Repository) ListNotifications(ctx *domain.UserContext, filter *domain.ListNotificationsFilter) ([]models.Notification, error)
- func (repo *Repository) ListNouveauxMessages() ([]domain.NouveauxMessagesUser, error)
- func (repo *Repository) ListThemes() ([]models.Theme, error)
- func (repo *Repository) ListUsersAssignedToInspection(idInspection int64) ([]int64, error)
- func (repo *Repository) OrderPointsDeControle(ctx *domain.UserContext, idInspection int64, pointsDeControleIds []int64) error
- func (repo *Repository) PublishPointDeControle(ctx *domain.UserContext, idPointDeControle int64) error
- func (repo *Repository) RejectInspection(id int64, motifRejet string) error
- func (repo *Repository) RemoveFavoriToInspection(ctx *domain.UserContext, idInspection int64) error
- func (repo *Repository) ResolveConstat(ctx *domain.UserContext, idPointDeControle int64) error
- func (repo *Repository) UpdateConstat(ctx *domain.UserContext, idPointDeControle int64, constat models.Constat) error
- func (repo *Repository) UpdateEtatInspection(ctx *domain.UserContext, id int64, etat models.EtatInspection) error
- func (repo *Repository) UpdateInspection(ctx *domain.UserContext, inspection models.Inspection) error
- func (repo *Repository) UpdateNotificationEcheanceExpireeEnvoyee(constatIds []int64) error
- func (repo *Repository) UpdateNotificationRappelEcheanceEnvoyee(constatIds []int64) error
- func (repo *Repository) UpdatePointDeControle(ctx *domain.UserContext, idPointDeControle int64, ...) error
- func (repo *Repository) UpdateSuite(ctx *domain.UserContext, idInspection int64, suite models.Suite) error
- func (repo *Repository) ValidateInspection(id int64, etatCible models.EtatInspection) error
- type RepositoryConfig
- type RowNouveauMessageUser
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBesoinInspecteurAffecte = errors.NewErrForbidden("Il faut être affecté à l'inspection")
)
View Source
var (
ErrEtablissementNotFound = errors.NewErrForbidden("Établissement non trouvé")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string `default:"localhost"` Port int `default:"5432"` User string `default:"filharmonic"` Password string `default:"filharmonic"` Name string `default:"filharmonic"` ApplyMigrations bool `default:"true"` InitSchema bool `default:"false"` Seeds bool `default:"false"` LogSQL bool `default:"false"` PaginationSize int `default:"50"` }
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(config RepositoryConfig, db *Database, eventsManager events.EventsManager) *Repository
func (*Repository) AddFavoriToInspection ¶
func (repo *Repository) AddFavoriToInspection(ctx *domain.UserContext, idInspection int64) error
func (*Repository) CanCloreInspection ¶
func (repo *Repository) CanCloreInspection(ctx *domain.UserContext, idInspection int64) error
func (*Repository) CanCreateConstat ¶
func (repo *Repository) CanCreateConstat(ctx *domain.UserContext, idPointDeControle int64) error
func (*Repository) CanCreatePointDeControle ¶
func (repo *Repository) CanCreatePointDeControle(ctx *domain.UserContext, idInspection int64) error
func (*Repository) CanDeleteOrUpdateConstat ¶
func (repo *Repository) CanDeleteOrUpdateConstat(ctx *domain.UserContext, idPointDeControle int64) error
func (*Repository) CanUpdatePointDeControle ¶
func (repo *Repository) CanUpdatePointDeControle(ctx *domain.UserContext, idPointDeControle int64) error
func (*Repository) CheckCanCreateSuite ¶
func (repo *Repository) CheckCanCreateSuite(ctx *domain.UserContext, idInspection int64) error
func (*Repository) CheckCanDeleteSuite ¶
func (repo *Repository) CheckCanDeleteSuite(ctx *domain.UserContext, idInspection int64) (bool, error)
func (*Repository) CheckEtatInspection ¶
func (repo *Repository) CheckEtatInspection(id int64, etats []models.EtatInspection) (bool, error)
func (*Repository) CheckInspecteurAllowedInspection ¶
func (repo *Repository) CheckInspecteurAllowedInspection(ctx *domain.UserContext, id int64) error
func (*Repository) CheckInspectionHasNonConformites ¶
func (repo *Repository) CheckInspectionHasNonConformites(id int64) (bool, error)
func (*Repository) CheckUserAllowedMessage ¶
func (repo *Repository) CheckUserAllowedMessage(ctx *domain.UserContext, id int64) (bool, error)
func (*Repository) CheckUserAllowedPointDeControle ¶
func (repo *Repository) CheckUserAllowedPointDeControle(ctx *domain.UserContext, id int64) (bool, error)
func (*Repository) CheckUserIsRecipient ¶
func (repo *Repository) CheckUserIsRecipient(ctx *domain.UserContext, id int64) (bool, error)
func (*Repository) CheckUsersInspecteurs ¶
func (repo *Repository) CheckUsersInspecteurs(ids []int64) (bool, error)
func (*Repository) CreateCanevas ¶
func (repo *Repository) CreateCanevas(ctx *domain.UserContext, idInspection int64, canevas models.Canevas) (int64, error)
func (*Repository) CreateCommentaire ¶
func (repo *Repository) CreateCommentaire(ctx *domain.UserContext, idInspection int64, commentaire models.Commentaire) (int64, error)
func (*Repository) CreateConstat ¶
func (repo *Repository) CreateConstat(ctx *domain.UserContext, idPointDeControle int64, constat models.Constat) (int64, error)
func (*Repository) CreateEvenement ¶
func (repo *Repository) CreateEvenement(ctx *domain.UserContext, typeEvenement models.TypeEvenement, idInspection int64, data map[string]interface{}) error
func (*Repository) CreateEvenementTx ¶
func (repo *Repository) CreateEvenementTx(tx *pg.Tx, ctx *domain.UserContext, typeEvenement models.TypeEvenement, idInspection int64, data map[string]interface{}) error
func (*Repository) CreateInspection ¶
func (repo *Repository) CreateInspection(ctx *domain.UserContext, inspection models.Inspection) (int64, error)
func (*Repository) CreateMessage ¶
func (repo *Repository) CreateMessage(ctx *domain.UserContext, idPointDeControle int64, message models.Message) (int64, error)
func (*Repository) CreatePieceJointe ¶
func (repo *Repository) CreatePieceJointe(pieceJointe models.PieceJointe) (int64, error)
func (*Repository) CreatePointDeControle ¶
func (repo *Repository) CreatePointDeControle(ctx *domain.UserContext, idInspection int64, pointDeControle models.PointDeControle) (int64, error)
func (*Repository) CreateRapport ¶
func (repo *Repository) CreateRapport(idInspection int64, rapport models.Rapport) error
func (*Repository) CreateSuite ¶
func (repo *Repository) CreateSuite(ctx *domain.UserContext, idInspection int64, suite models.Suite) (int64, error)
func (*Repository) CreateTheme ¶
func (repo *Repository) CreateTheme(ctx *domain.UserContext, theme models.Theme) (int64, error)
func (*Repository) DeleteCanevas ¶
func (repo *Repository) DeleteCanevas(ctx *domain.UserContext, id int64) error
func (*Repository) DeleteConstat ¶
func (repo *Repository) DeleteConstat(ctx *domain.UserContext, idPointDeControle int64) error
func (*Repository) DeletePointDeControle ¶
func (repo *Repository) DeletePointDeControle(ctx *domain.UserContext, idPointDeControle int64) error
func (*Repository) DeleteSuite ¶
func (repo *Repository) DeleteSuite(ctx *domain.UserContext, idInspection int64) error
func (*Repository) DeleteTheme ¶
func (repo *Repository) DeleteTheme(ctx *domain.UserContext, idTheme int64) error
func (*Repository) FindEtablissements ¶
func (repo *Repository) FindEtablissements(ctx *domain.UserContext, filter domain.ListEtablissementsFilter) (*models.FindEtablissementResults, error)
func (*Repository) FindUsers ¶
func (repo *Repository) FindUsers(filters domain.ListUsersFilters) ([]models.User, error)
func (*Repository) GetCanevasByID ¶
func (repo *Repository) GetCanevasByID(id int64) (*models.Canevas, error)
func (*Repository) GetEtablissementByID ¶
func (repo *Repository) GetEtablissementByID(ctx *domain.UserContext, id int64) (*models.Etablissement, error)
func (*Repository) GetEtatInspectionByPointDeControleID ¶
func (repo *Repository) GetEtatInspectionByPointDeControleID(idPointDeControle int64) (models.EtatInspection, error)
func (*Repository) GetInspectionByID ¶
func (repo *Repository) GetInspectionByID(ctx *domain.UserContext, id int64, filter domain.InspectionFilter) (*models.Inspection, error)
func (*Repository) GetInspectionTypesConstatsSuiteByID ¶
func (repo *Repository) GetInspectionTypesConstatsSuiteByID(id int64) (*models.Inspection, error)
func (*Repository) GetPieceJointe ¶
func (repo *Repository) GetPieceJointe(ctx *domain.UserContext, idPieceJointe int64) (*models.PieceJointe, error)
func (*Repository) GetRapport ¶
func (repo *Repository) GetRapport(ctx *domain.UserContext, idInspection int64) (*models.Rapport, error)
func (*Repository) GetRecapsValidation ¶
func (repo *Repository) GetRecapsValidation(idInspection int64) ([]domain.RecapValidationInspection, error)
func (*Repository) GetTypeConstatByPointDeControleID ¶
func (repo *Repository) GetTypeConstatByPointDeControleID(idPointDeControle int64) (models.TypeConstat, error)
func (*Repository) GetUserByEmail ¶
func (repo *Repository) GetUserByEmail(email string) (*models.User, error)
func (*Repository) GetUserByID ¶
func (repo *Repository) GetUserByID(id int64) (*models.User, error)
func (*Repository) ImportCanevas ¶
func (repo *Repository) ImportCanevas(ctx *domain.UserContext, inspectionId int64, canevas models.Canevas) error
func (*Repository) ImportPointsDeControlesNonConformes ¶
func (repo *Repository) ImportPointsDeControlesNonConformes(ctx *domain.UserContext, inspectionId int64, previousInspectionId int64) error
func (*Repository) LireMessage ¶
func (repo *Repository) LireMessage(ctx *domain.UserContext, idMessage int64) error
func (*Repository) LireNotifications ¶
func (repo *Repository) LireNotifications(ctx *domain.UserContext, ids []int64) error
func (*Repository) ListCanevas ¶
func (repo *Repository) ListCanevas() ([]models.Canevas, error)
func (*Repository) ListEtablissements ¶
func (repo *Repository) ListEtablissements() ([]models.Etablissement, error)
utilisé seulement dans les tests
func (*Repository) ListInspections ¶
func (repo *Repository) ListInspections(ctx *domain.UserContext, filter domain.ListInspectionsFilter) ([]models.Inspection, error)
func (*Repository) ListInspectionsEcheancesProches ¶
func (repo *Repository) ListInspectionsEcheancesProches(seuilRappelEcheances float32) ([]domain.InspectionEcheancesProches, error)
func (*Repository) ListInspectionsExpirationDelais ¶
func (repo *Repository) ListInspectionsExpirationDelais() ([]domain.InspectionExpirationDelais, error)
func (*Repository) ListInspectionsFavorites ¶
func (repo *Repository) ListInspectionsFavorites(ctx *domain.UserContext) ([]models.Inspection, error)
func (*Repository) ListNotifications ¶
func (repo *Repository) ListNotifications(ctx *domain.UserContext, filter *domain.ListNotificationsFilter) ([]models.Notification, error)
func (*Repository) ListNouveauxMessages ¶
func (repo *Repository) ListNouveauxMessages() ([]domain.NouveauxMessagesUser, error)
func (*Repository) ListThemes ¶
func (repo *Repository) ListThemes() ([]models.Theme, error)
func (*Repository) ListUsersAssignedToInspection ¶
func (repo *Repository) ListUsersAssignedToInspection(idInspection int64) ([]int64, error)
func (*Repository) OrderPointsDeControle ¶
func (repo *Repository) OrderPointsDeControle(ctx *domain.UserContext, idInspection int64, pointsDeControleIds []int64) error
func (*Repository) PublishPointDeControle ¶
func (repo *Repository) PublishPointDeControle(ctx *domain.UserContext, idPointDeControle int64) error
func (*Repository) RejectInspection ¶
func (repo *Repository) RejectInspection(id int64, motifRejet string) error
func (*Repository) RemoveFavoriToInspection ¶
func (repo *Repository) RemoveFavoriToInspection(ctx *domain.UserContext, idInspection int64) error
func (*Repository) ResolveConstat ¶
func (repo *Repository) ResolveConstat(ctx *domain.UserContext, idPointDeControle int64) error
func (*Repository) UpdateConstat ¶
func (repo *Repository) UpdateConstat(ctx *domain.UserContext, idPointDeControle int64, constat models.Constat) error
func (*Repository) UpdateEtatInspection ¶
func (repo *Repository) UpdateEtatInspection(ctx *domain.UserContext, id int64, etat models.EtatInspection) error
func (*Repository) UpdateInspection ¶
func (repo *Repository) UpdateInspection(ctx *domain.UserContext, inspection models.Inspection) error
func (*Repository) UpdateNotificationEcheanceExpireeEnvoyee ¶
func (repo *Repository) UpdateNotificationEcheanceExpireeEnvoyee(constatIds []int64) error
func (*Repository) UpdateNotificationRappelEcheanceEnvoyee ¶
func (repo *Repository) UpdateNotificationRappelEcheanceEnvoyee(constatIds []int64) error
func (*Repository) UpdatePointDeControle ¶
func (repo *Repository) UpdatePointDeControle(ctx *domain.UserContext, idPointDeControle int64, pointDeControle models.PointDeControle) error
func (*Repository) UpdateSuite ¶
func (repo *Repository) UpdateSuite(ctx *domain.UserContext, idInspection int64, suite models.Suite) error
func (*Repository) ValidateInspection ¶
func (repo *Repository) ValidateInspection(id int64, etatCible models.EtatInspection) error
type RepositoryConfig ¶
type RepositoryConfig struct {
PaginationSize int `default:"50"`
}
type RowNouveauMessageUser ¶
Source Files ¶
- canevas_repository.go
- commentaires_repository.go
- constats_repository.go
- database.go
- etablissements_repository.go
- evenements_repository.go
- inspections_repository.go
- messages_repository.go
- notifications_repository.go
- piecesjointes_repository.go
- points_de_controle_repository.go
- rapports_repository.go
- repository.go
- suites_repository.go
- themes_repository.go
- user_repository.go
Click to show internal directories.
Click to hide internal directories.