Import initail de calcul-astreintes v0.9.4 pour passage en paycheck 1.0
This commit is contained in:
28
cmd/checkprofiles/main.go
Normal file
28
cmd/checkprofiles/main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"sort"
|
||||
|
||||
"git.dumerain.org/alban/calcul-astreintes/internal/profiles"
|
||||
)
|
||||
|
||||
func main() {
|
||||
repo, rules, err := profiles.NewEmbeddedRepo()
|
||||
if err != nil {
|
||||
log.Fatalf("Erreur chargement profils: %v", err)
|
||||
}
|
||||
items, _ := repo.List()
|
||||
fmt.Printf("OK: %d profil(s) charge(s) - forfait=%.2f\n", len(items), rules.ForfaitDimFerie)
|
||||
|
||||
keys := make([]string, 0, len(items))
|
||||
for _, it := range items {
|
||||
keys = append(keys, it.ID)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
for _, id := range keys {
|
||||
p, _ := repo.Get(id)
|
||||
fmt.Printf("- %s: label=%q t456=%.2f t458=%.2f t459=%.2f t471=%.2f\n", id, p.Label, p.T456, p.T458, p.T459, p.T471)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user