resolve conflicts
This commit is contained in:
commit
2660b82bdb
27
go.mod
27
go.mod
|
@ -27,7 +27,7 @@ require (
|
|||
golang.org/x/image v0.5.0
|
||||
golang.org/x/oauth2 v0.23.0
|
||||
google.golang.org/grpc v1.68.0
|
||||
google.golang.org/protobuf v1.34.2
|
||||
google.golang.org/protobuf v1.35.2
|
||||
)
|
||||
|
||||
require (
|
||||
|
@ -44,8 +44,16 @@ require (
|
|||
github.com/xuri/excelize/v2 v2.7.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/sagikazarmark/locafero v0.6.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
ariga.io/atlas v0.12.0 // indirect
|
||||
git.coopgo.io/coopgo-platform/diags v0.0.0-20241120133550-917ed8705c73
|
||||
github.com/agext/levenshtein v1.2.1 // indirect
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
|
@ -59,7 +67,7 @@ require (
|
|||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/golang/snappy v0.0.1 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/hcl/v2 v2.10.0 // indirect
|
||||
|
@ -79,40 +87,35 @@ require (
|
|||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
|
||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/richardlehane/mscfb v1.0.4 // indirect
|
||||
github.com/richardlehane/msoleps v1.0.3 // indirect
|
||||
github.com/rs/xid v1.5.0 // indirect
|
||||
github.com/sagikazarmark/locafero v0.6.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
|
||||
github.com/sergi/go-diff v1.1.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/cast v1.7.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/tidwall/pretty v1.1.0 // indirect
|
||||
github.com/twpayne/go-geom v1.5.7 // indirect
|
||||
github.com/wneessen/go-mail v0.5.2 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.1.1 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.3 // indirect
|
||||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
|
||||
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
github.com/zclconf/go-cty v1.8.0 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
|
||||
go.mongodb.org/mongo-driver v1.11.4 // indirect
|
||||
go.mongodb.org/mongo-driver v1.17.1 // indirect
|
||||
go.uber.org/atomic v1.11.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.21.0 // indirect
|
||||
golang.org/x/crypto v0.28.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/sync v0.9.0 // indirect
|
||||
golang.org/x/sys v0.27.0 // indirect
|
||||
|
|
37
go.sum
37
go.sum
|
@ -2,6 +2,8 @@ ariga.io/atlas v0.12.0 h1:jDfjxT3ppKhzqLS26lZv9ni7p9TVNrhy7SQquaF7bPs=
|
|||
ariga.io/atlas v0.12.0/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk=
|
||||
git.coopgo.io/coopgo-platform/agenda v1.0.0 h1:rTHgva1JKKO0wAPlINegifMkHm+xOg3IWW4yQRy334w=
|
||||
git.coopgo.io/coopgo-platform/agenda v1.0.0/go.mod h1:/hToSla0p6SeWn1zo1MDrfxdmo7RBdZDkbLqCVituIM=
|
||||
git.coopgo.io/coopgo-platform/diags v0.0.0-20241120133550-917ed8705c73 h1:Xyc2Xuf7VnaOVD7sro2GPD1gzwo+R9lyfkWjyrTYlqY=
|
||||
git.coopgo.io/coopgo-platform/diags v0.0.0-20241120133550-917ed8705c73/go.mod h1:diyq11WNkgJ0kYHdT7SphXPMQUyoq4lRk7T6IgM5yPA=
|
||||
git.coopgo.io/coopgo-platform/emailing v0.0.0-20241119141913-9836b30191c1 h1:gAhJ9wwlitMiETmnD4U2L6xLnVd5xE4hPX72IJ5s7+I=
|
||||
git.coopgo.io/coopgo-platform/emailing v0.0.0-20241119141913-9836b30191c1/go.mod h1:EXy6NRvFfpW6yIHoZUixldkXrj1qzjCbTHpumDvzaKI=
|
||||
git.coopgo.io/coopgo-platform/fleets v0.0.0-20230310144446-feb935f8bf4e h1:eHahRTKlC8aBWYCd6LbXNcX8HoQhuZj31OFWrw0EL0U=
|
||||
|
@ -82,11 +84,10 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
|
|||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
|
@ -112,7 +113,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
|
|||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
|
||||
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
|
@ -168,8 +168,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
|
|||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
|
||||
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
||||
|
@ -237,9 +237,6 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
|
|||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=
|
||||
github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/twpayne/go-geom v1.2.1/go.mod h1:90yvs0wf/gyT5eQ9W4v5WOZ9w/Xnrj5RMlA9XNKqxyA=
|
||||
github.com/twpayne/go-geom v1.5.7 h1:7fdceDUr03/MP7rAKOaTV6x9njMiQdxB/D0PDzMTCDc=
|
||||
github.com/twpayne/go-geom v1.5.7/go.mod h1:y4fTAQtLedXW8eG2Yo4tYrIGN1yIwwKkmA+K3iSHKBA=
|
||||
|
@ -252,18 +249,18 @@ github.com/wneessen/go-mail v0.5.2 h1:MZKwgHJoRboLJ+EHMLuHpZc95wo+u1xViL/4XSswDT
|
|||
github.com/wneessen/go-mail v0.5.2/go.mod h1:kRroJvEq2hOSEPFRiKjN7Csrz0G1w+RpiGR3b6yo+Ck=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E=
|
||||
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||
github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs=
|
||||
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
|
||||
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
|
||||
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
|
||||
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
|
||||
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 h1:6932x8ltq1w4utjmfMPVj09jdMlkY0aiA6+Skbtl3/c=
|
||||
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
|
||||
github.com/xuri/excelize/v2 v2.7.1 h1:gm8q0UCAyaTt3MEF5wWMjVdmthm2EHAWesGSKS9tdVI=
|
||||
github.com/xuri/excelize/v2 v2.7.1/go.mod h1:qc0+2j4TvAUrBw36ATtcTeC1VCM0fFdAXZOmcF4nTpY=
|
||||
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 h1:OAmKAfT06//esDdpi/DZ8Qsdt4+M5+ltca05dA5bG2M=
|
||||
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
|
@ -280,8 +277,8 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.12 h1:EYDL6pWwyOsylrQyLp2w+HkQ46ATiOvoEdMarin
|
|||
go.etcd.io/etcd/client/pkg/v3 v3.5.12/go.mod h1:seTzl2d9APP8R5Y2hFL3NVlD6qC/dOT+3kvrqPyTas4=
|
||||
go.etcd.io/etcd/client/v3 v3.5.12 h1:v5lCPXn1pf1Uu3M4laUE2hp/geOTc5uPcYYsNe1lDxg=
|
||||
go.etcd.io/etcd/client/v3 v3.5.12/go.mod h1:tSbBCakoWmmddL+BKVAJHa9km+O/E+bumDe9mSbPiqw=
|
||||
go.mongodb.org/mongo-driver v1.11.4 h1:4ayjakA013OdpGyL2K3ZqylTac/rMjrJOMZ1EHizXas=
|
||||
go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
|
||||
go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM=
|
||||
go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
|
||||
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||
|
@ -299,7 +296,6 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh
|
|||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
|
@ -399,6 +395,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
|
@ -429,8 +426,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:
|
|||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
|
||||
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
|
||||
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
|
||||
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
|
@ -27,6 +27,8 @@ import (
|
|||
"git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
|
||||
diags "git.coopgo.io/coopgo-platform/diags/grpcapi"
|
||||
diagsstorage "git.coopgo.io/coopgo-platform/diags/storage"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
@ -310,6 +312,26 @@ func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.R
|
|||
}
|
||||
sortByDate(events_list)
|
||||
|
||||
diag := []diagsstorage.Diag{}
|
||||
|
||||
diagsrequest := &diags.GetDiagsRequest{
|
||||
Namespaces: []string{"parcoursmob_beneficiaries"},
|
||||
}
|
||||
|
||||
diagsresp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), diagsrequest)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
for _, d := range diagsresp.Diags {
|
||||
diagData := d.Data.AsMap()
|
||||
if beneficiary, ok := diagData["beneficiary"].(string); ok && beneficiary == beneficiaryID {
|
||||
diag = append(diag, d.ToStorageType())
|
||||
}
|
||||
}
|
||||
|
||||
groupsrequest := &groupsmanagement.GetGroupsRequest{
|
||||
Namespaces: []string{"parcoursmob_organizations"},
|
||||
Member: beneficiaryID,
|
||||
|
@ -328,7 +350,11 @@ func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.R
|
|||
beneficiaries_file_types := h.config.GetStringSlice("modules.beneficiaries.documents_types")
|
||||
file_types_map := h.config.GetStringMapString("storage.files.file_types")
|
||||
|
||||
h.Renderer.BeneficiaryDisplay(w, r, resp.Account.ToStorageType(), bookings, organizations, beneficiaries_file_types, file_types_map, documents, events_list)
|
||||
diagsAny := make([]any, len(diag))
|
||||
for i, d := range diag {
|
||||
diagsAny[i] = d
|
||||
}
|
||||
h.Renderer.BeneficiaryDisplay(w, r, resp.Account.ToStorageType(), bookings, organizations, beneficiaries_file_types, file_types_map, documents, events_list, diagsAny)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) BeneficiaryUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
@ -0,0 +1,496 @@
|
|||
package application
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
// "io"
|
||||
"net/http"
|
||||
// "strconv"
|
||||
"strings"
|
||||
// "time"
|
||||
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/services"
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||
// filestorage "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
|
||||
diags "git.coopgo.io/coopgo-platform/diags/grpcapi"
|
||||
diagsstorage "git.coopgo.io/coopgo-platform/diags/storage"
|
||||
|
||||
// groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||
// "git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||
// mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||
// "github.com/google/uuid"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/rs/zerolog/log"
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
// "google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
type DiagsForm struct {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Namespace string `json:"namespace" validate:"required"`
|
||||
JsonSchema string `json:"json_schema"`
|
||||
UiSchema string `json:"ui_schema"`
|
||||
Data map[string]any `json:"data"`
|
||||
Deleted bool `json:"deleted"`
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) DiagsHome(w http.ResponseWriter, r *http.Request) {
|
||||
resp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), &diags.GetDiagsRequest{
|
||||
Namespaces: []string{"parcoursmob_beneficiaries", "parcoursmob_diagnostiques", "parcoursmob_vehicles", "parcoursmob_bookings"},
|
||||
// Mindate: timestamppb.New(time.Now().Add(-24 * time.Hour)),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
responses := []diagsstorage.Diag{}
|
||||
|
||||
for _, e := range resp.Diags {
|
||||
responses = append(responses, e.ToStorageType())
|
||||
}
|
||||
|
||||
h.Renderer.DiagsHome(w, r, responses)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) DiagsHistory(w http.ResponseWriter, r *http.Request) {
|
||||
resp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), &diags.GetDiagsRequest{
|
||||
Namespaces: []string{"parcoursmob_beneficiaries", "parcoursmob_diagnostiques", "parcoursmob_vehicles", "parcoursmob_bookings"},
|
||||
//Maxdate: timestamppb.New(time.Now().Add(24 * time.Hour)),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
responses := []diagsstorage.Diag{}
|
||||
|
||||
for _, e := range resp.Diags {
|
||||
if e.Deleted {
|
||||
responses = append(responses, e.ToStorageType())
|
||||
}
|
||||
}
|
||||
|
||||
h.Renderer.DiagsHistory(w, r, responses)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) BeneficiariesCreateDiag(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
beneficiaryID := vars["beneficiaryid"]
|
||||
|
||||
if h.services == nil || (h.services.GRPC == services.GRPCServices{}) || h.services.GRPC.Diags == nil {
|
||||
log.Error().Msg("Diags service is not initialized")
|
||||
http.Error(w, "Internal server error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if r.Method == http.MethodPost {
|
||||
g := r.Context().Value(identification.GroupKey)
|
||||
if g == nil {
|
||||
http.Error(w, "Missing group information", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
diagForm, err := parseDiagsForm(r)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Invalid form data")
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
log.Debug().Interface("diagForm", diagForm).Msg("Form data parsed")
|
||||
|
||||
data, err := structpb.NewStruct(map[string]any{
|
||||
"beneficiary": beneficiaryID,
|
||||
})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create protobuf struct")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
request := &diags.CreateDiagRequest{
|
||||
Diag: &diags.Diag{
|
||||
Name: diagForm.Name,
|
||||
Namespace: diagForm.Namespace,
|
||||
JsonSchema: diagForm.JsonSchema,
|
||||
UiSchema: diagForm.UiSchema,
|
||||
Data: data,
|
||||
Deleted: diagForm.Deleted,
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.CreateDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create diagnostic")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("/app/diags/%s", resp.Diag.Id), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
h.Renderer.BeneficiariesCreateDiag(w, r, beneficiaryID)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) VehiclesCreateDiag(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
vehicleID := vars["vehicleid"]
|
||||
|
||||
if h.services == nil || (h.services.GRPC == services.GRPCServices{}) || h.services.GRPC.Diags == nil {
|
||||
log.Error().Msg("Diags service is not initialized")
|
||||
http.Error(w, "Internal server error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if r.Method == http.MethodPost {
|
||||
g := r.Context().Value(identification.GroupKey)
|
||||
if g == nil {
|
||||
http.Error(w, "Missing group information", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
diagForm, err := parseDiagsForm(r)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Invalid form data")
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
log.Debug().Interface("diagForm", diagForm).Msg("Form data parsed")
|
||||
|
||||
data, err := structpb.NewStruct(map[string]any{
|
||||
"vehicle": vehicleID,
|
||||
})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create protobuf struct")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
request := &diags.CreateDiagRequest{
|
||||
Diag: &diags.Diag{
|
||||
Name: diagForm.Name,
|
||||
Namespace: diagForm.Namespace,
|
||||
JsonSchema: diagForm.JsonSchema,
|
||||
UiSchema: diagForm.UiSchema,
|
||||
Data: data,
|
||||
Deleted: diagForm.Deleted,
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.CreateDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create diagnostic")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("/app/diags/%s", resp.Diag.Id), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
h.Renderer.VehiclesCreateDiag(w, r, vehicleID)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) BookingsCreateDiag(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
bookingID := vars["bookingid"]
|
||||
|
||||
if h.services == nil || (h.services.GRPC == services.GRPCServices{}) || h.services.GRPC.Diags == nil {
|
||||
log.Error().Msg("Diags service is not initialized")
|
||||
http.Error(w, "Internal server error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if r.Method == http.MethodPost {
|
||||
g := r.Context().Value(identification.GroupKey)
|
||||
if g == nil {
|
||||
http.Error(w, "Missing group information", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
diagForm, err := parseDiagsForm(r)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Invalid form data")
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
log.Debug().Interface("diagForm", diagForm).Msg("Form data parsed")
|
||||
|
||||
data, err := structpb.NewStruct(map[string]any{
|
||||
"booking": bookingID,
|
||||
})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create protobuf struct")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
request := &diags.CreateDiagRequest{
|
||||
Diag: &diags.Diag{
|
||||
Name: diagForm.Name,
|
||||
Namespace: diagForm.Namespace,
|
||||
JsonSchema: diagForm.JsonSchema,
|
||||
UiSchema: diagForm.UiSchema,
|
||||
Data: data,
|
||||
Deleted: diagForm.Deleted,
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.CreateDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create diagnostic")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("/app/diags/%s", resp.Diag.Id), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
h.Renderer.BookingsCreateDiag(w, r, bookingID)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) VehicleBookingsCreateDiag(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
bookingID := vars["bookingid"]
|
||||
|
||||
if h.services == nil || (h.services.GRPC == services.GRPCServices{}) || h.services.GRPC.Diags == nil {
|
||||
log.Error().Msg("Diags service is not initialized")
|
||||
http.Error(w, "Internal server error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if r.Method == http.MethodPost {
|
||||
g := r.Context().Value(identification.GroupKey)
|
||||
if g == nil {
|
||||
http.Error(w, "Missing group information", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
diagForm, err := parseDiagsForm(r)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Invalid form data")
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
log.Debug().Interface("diagForm", diagForm).Msg("Form data parsed")
|
||||
|
||||
data, err := structpb.NewStruct(map[string]any{
|
||||
"booking": bookingID,
|
||||
})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create protobuf struct")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
request := &diags.CreateDiagRequest{
|
||||
Diag: &diags.Diag{
|
||||
Name: diagForm.Name,
|
||||
Namespace: diagForm.Namespace,
|
||||
JsonSchema: diagForm.JsonSchema,
|
||||
UiSchema: diagForm.UiSchema,
|
||||
Data: data,
|
||||
Deleted: diagForm.Deleted,
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.CreateDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create diagnostic")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("/app/diags/%s", resp.Diag.Id), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
h.Renderer.VehicleBookingsCreateDiag(w, r, bookingID)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) DiagsDisplayDiag(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
diagid := vars["diagid"]
|
||||
|
||||
request := &diags.GetDiagRequest{
|
||||
Id: diagid,
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.GetDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
g := r.Context().Value(identification.GroupKey)
|
||||
if g == nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
h.Renderer.DiagsDisplayDiag(w, r, resp.Diag.ToStorageType())
|
||||
}
|
||||
|
||||
func parseDiagsForm(r *http.Request) (*DiagsForm, error) {
|
||||
if err := r.ParseForm(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
formData := &DiagsForm{
|
||||
Name: r.PostFormValue("name"),
|
||||
Namespace: r.PostFormValue("namespace"), // Récupère le namespace
|
||||
JsonSchema: r.PostFormValue("json_schema"),
|
||||
UiSchema: r.PostFormValue("ui_schema"),
|
||||
Deleted: false,
|
||||
}
|
||||
|
||||
if formData.Name == "" || formData.Namespace == "" {
|
||||
return nil, errors.New("missing required fields: 'name' or 'namespace'")
|
||||
}
|
||||
|
||||
// Gestion de la valeur JSON dans `data`
|
||||
if rawData := r.PostFormValue("data"); rawData != "" {
|
||||
data := map[string]any{}
|
||||
if err := json.Unmarshal([]byte(rawData), &data); err != nil {
|
||||
return nil, errors.New("invalid 'data' field: must be a valid JSON object")
|
||||
}
|
||||
formData.Data = data
|
||||
}
|
||||
|
||||
return formData, nil
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) DiagUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
adm := strings.Split(r.URL.Path, "/")
|
||||
diagID := adm[3]
|
||||
request := &diags.GetDiagRequest{
|
||||
Id: diagID,
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.GetDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if r.Method == "POST" {
|
||||
g := r.Context().Value(identification.GroupKey)
|
||||
if g == nil {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
diagForm, err := parseDiagsForm(r)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
data, _ := structpb.NewStruct(map[string]any{})
|
||||
|
||||
request := &diags.UpdateDiagRequest{
|
||||
Diag: &diags.Diag{
|
||||
Namespace: diagForm.Namespace,
|
||||
Id: diagID,
|
||||
Name: diagForm.Name,
|
||||
JsonSchema: diagForm.JsonSchema,
|
||||
UiSchema: diagForm.UiSchema,
|
||||
Data: data,
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.UpdateDiag(context.TODO(), request)
|
||||
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("/app/diags/%s", resp.Diag.Id), http.StatusFound)
|
||||
return
|
||||
}
|
||||
h.Renderer.DiagUpdate(w, r, resp.Diag.ToStorageType())
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) DiagDelete(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
vars := mux.Vars(r)
|
||||
diagID := vars["diagid"]
|
||||
request := &diags.GetDiagRequest{
|
||||
Id: diagID,
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.GetDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
if r.Method == "POST" {
|
||||
|
||||
request := &diags.UpdateDiagRequest{
|
||||
Diag: &diags.Diag{
|
||||
Namespace: resp.Diag.Namespace,
|
||||
Id: resp.Diag.Id,
|
||||
Name: resp.Diag.Name,
|
||||
JsonSchema: resp.Diag.JsonSchema,
|
||||
UiSchema: resp.Diag.UiSchema,
|
||||
Data: resp.Diag.Data,
|
||||
Deleted: true,
|
||||
},
|
||||
}
|
||||
|
||||
_, err := h.services.GRPC.Diags.UpdateDiag(context.TODO(), request)
|
||||
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, "/app/diags/", http.StatusFound)
|
||||
return
|
||||
}
|
||||
h.Renderer.DiagDelete(w, r, resp.Diag.ToStorageType())
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) DiagsHistoryDiag(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
diagId := vars["diagid"]
|
||||
request := &diags.GetDiagRequest{
|
||||
Id: diagId,
|
||||
}
|
||||
|
||||
resp, err := h.services.GRPC.Diags.GetDiag(context.TODO(), request)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
h.Renderer.DiagsHistoryDiag(w, r, resp.Diag.ToStorageType())
|
||||
}
|
|
@ -11,6 +11,8 @@ import (
|
|||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/sorting"
|
||||
filestorage "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
|
||||
diags "git.coopgo.io/coopgo-platform/diags/grpcapi"
|
||||
diagsstorage "git.coopgo.io/coopgo-platform/diags/storage"
|
||||
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
|
||||
fleetsstorage "git.coopgo.io/coopgo-platform/fleets/storage"
|
||||
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||
|
@ -203,8 +205,32 @@ func (h *ApplicationHandler) VehiclesFleetDisplay(w http.ResponseWriter, r *http
|
|||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
diag := []diagsstorage.Diag{}
|
||||
|
||||
h.Renderer.VehiclesFleetDisplay(w, r, resp.Vehicle.ToStorageType(), beneficiaries)
|
||||
diagsrequest := &diags.GetDiagsRequest{
|
||||
Namespaces: []string{"parcoursmob_vehicles"},
|
||||
}
|
||||
|
||||
diagsresp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), diagsrequest)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("did not retrieve diags")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
for _, d := range diagsresp.Diags {
|
||||
diagData := d.Data.AsMap()
|
||||
if vehicle, ok := diagData["vehicle"].(string); ok && vehicle == vehicleid {
|
||||
diag = append(diag, d.ToStorageType())
|
||||
}
|
||||
}
|
||||
|
||||
diagsAny := make([]any, len(diag))
|
||||
for i, d := range diag {
|
||||
diagsAny[i] = d
|
||||
}
|
||||
|
||||
h.Renderer.VehiclesFleetDisplay(w, r, resp.Vehicle.ToStorageType(), beneficiaries, diagsAny)
|
||||
}
|
||||
|
||||
func filterVehicle(r *http.Request, v *fleets.Vehicle) bool {
|
||||
|
@ -336,7 +362,32 @@ func (h ApplicationHandler) VehicleManagementBookingDisplay(w http.ResponseWrite
|
|||
documents := h.filestorage.List(filestorage.PREFIX_BOOKINGS + "/" + bookingid)
|
||||
file_types_map := h.config.GetStringMapString("storage.files.file_types")
|
||||
|
||||
h.Renderer.VehicleManagementBookingDisplay(w, r, booking, booking.Vehicle, beneficiary, groupresp.Group.ToStorageType(), documents, file_types_map, alternatives)
|
||||
diag := []diagsstorage.Diag{}
|
||||
|
||||
diagsrequest := &diags.GetDiagsRequest{
|
||||
Namespaces: []string{"parcoursmob_bookings"},
|
||||
}
|
||||
|
||||
diagsresp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), diagsrequest)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
for _, d := range diagsresp.Diags {
|
||||
diagData := d.Data.AsMap()
|
||||
if booking, ok := diagData["booking"].(string); ok && booking == bookingid {
|
||||
diag = append(diag, d.ToStorageType())
|
||||
}
|
||||
}
|
||||
|
||||
diagsAny := make([]any, len(diag))
|
||||
for i, d := range diag {
|
||||
diagsAny[i] = d
|
||||
}
|
||||
|
||||
h.Renderer.VehicleManagementBookingDisplay(w, r, booking, booking.Vehicle, beneficiary, groupresp.Group.ToStorageType(), documents, file_types_map, alternatives, diagsAny)
|
||||
}
|
||||
|
||||
func (h ApplicationHandler) VehicleManagementBookingChangeVehicle(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
@ -12,6 +12,8 @@ import (
|
|||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/sorting"
|
||||
filestorage "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
|
||||
diags "git.coopgo.io/coopgo-platform/diags/grpcapi"
|
||||
diagsstorage "git.coopgo.io/coopgo-platform/diags/storage"
|
||||
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
|
||||
"git.coopgo.io/coopgo-platform/fleets/storage"
|
||||
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||
|
@ -305,7 +307,32 @@ func (h ApplicationHandler) VehicleBookingDisplay(w http.ResponseWriter, r *http
|
|||
documents := h.filestorage.List(filestorage.PREFIX_BOOKINGS + "/" + bookingid)
|
||||
file_types_map := h.config.GetStringMapString("storage.files.file_types")
|
||||
|
||||
h.Renderer.VehicleBookingDisplay(w, r, booking, booking.Vehicle, beneficiaryresp.Account.ToStorageType(), groupresp.Group.ToStorageType(), documents, file_types_map)
|
||||
diag := []diagsstorage.Diag{}
|
||||
|
||||
diagsrequest := &diags.GetDiagsRequest{
|
||||
Namespaces: []string{"parcoursmob_bookings"},
|
||||
}
|
||||
|
||||
diagsresp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), diagsrequest)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
for _, d := range diagsresp.Diags {
|
||||
diagData := d.Data.AsMap()
|
||||
if booking, ok := diagData["booking"].(string); ok && booking == bookingid {
|
||||
diag = append(diag, d.ToStorageType())
|
||||
}
|
||||
}
|
||||
|
||||
diagsAny := make([]any, len(diag))
|
||||
for i, d := range diag {
|
||||
diagsAny[i] = d
|
||||
}
|
||||
|
||||
h.Renderer.VehicleBookingDisplay(w, r, booking, booking.Vehicle, beneficiaryresp.Account.ToStorageType(), groupresp.Group.ToStorageType(), documents, file_types_map, diagsAny)
|
||||
}
|
||||
|
||||
func (h ApplicationHandler) VehiclesBookingsList(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
27
main.go
27
main.go
|
@ -177,6 +177,33 @@ func main() {
|
|||
//////////////////Add documents in event////////////////////////
|
||||
application.HandleFunc("/agenda/{eventid}/documents", applicationHandler.EventDocuments)
|
||||
application.HandleFunc("/agenda/{eventid}/documents/{document}", applicationHandler.EventDocumentDownload)
|
||||
////////////////////////////////////////////////////////////////
|
||||
//////////////////Diag in event////////////////////////
|
||||
// application.HandleFunc("/agenda/{eventid}/create-diag", applicationHandler.DiagsCreateDiag)
|
||||
application.HandleFunc("/agenda/{eventid}/diags", applicationHandler.DiagsHome)
|
||||
application.HandleFunc("/agenda/{eventid}/diags/{diagid}", applicationHandler.DiagsDisplayDiag)
|
||||
application.HandleFunc("/agenda/{eventid}/diags/history", applicationHandler.DiagsHistory)
|
||||
application.HandleFunc("/agenda/{eventid}/diags/{diagid}/history", applicationHandler.DiagsHistoryDiag)
|
||||
////////////////////////////////////////////////////////////////
|
||||
//////////////////Diag in benefeciaries////////////////////////
|
||||
application.HandleFunc("/beneficiaries/{beneficiaryid}/create-diag", applicationHandler.BeneficiariesCreateDiag)
|
||||
application.HandleFunc("/beneficiaries/{beneficiaryid}/diags/{diagid}", applicationHandler.DiagsDisplayDiag)
|
||||
////////////////////////////////////////////////////////////////
|
||||
//////////////////Diag in vehicules////////////////////////
|
||||
application.HandleFunc("/vehicles-management/fleet/{vehicleid}/create-diag", applicationHandler.VehiclesCreateDiag)
|
||||
application.HandleFunc("/vehicles-management/fleet/{vehicleid}/diags", applicationHandler.DiagsHome)
|
||||
application.HandleFunc("/vehicles-management/fleet/{vehicleid}/diags/{diagid}", applicationHandler.DiagsDisplayDiag)
|
||||
////////////////////////////////////////////////////////////////
|
||||
//////////////////Diag in bookings////////////////////////
|
||||
application.HandleFunc("/vehicles-management/bookings/{bookingid}/create-diag", applicationHandler.BookingsCreateDiag)
|
||||
application.HandleFunc("/vehicles/bookings/{vehicleid}/diags", applicationHandler.DiagsHome)
|
||||
application.HandleFunc("/vehicles/bookings/{bookingid}/create-diag", applicationHandler.VehicleBookingsCreateDiag)
|
||||
//////////////////Diags////////////////////////
|
||||
application.HandleFunc("/diags/", applicationHandler.DiagsHome)
|
||||
application.HandleFunc("/diags/{diagid}", applicationHandler.DiagsDisplayDiag)
|
||||
application.HandleFunc("/diags/{diagid}/update", applicationHandler.DiagUpdate)
|
||||
application.HandleFunc("/diags/{diagid}/delete", applicationHandler.DiagDelete)
|
||||
// application.HandleFunc("/diags/history", applicationHandler.DiagsHistory)
|
||||
|
||||
export := r.PathPrefix("/exports").Subrouter()
|
||||
export.HandleFunc("/fleets/bookings", exportsHandler.Bookings)
|
||||
|
|
|
@ -53,7 +53,7 @@ type BeneficiariesDisplayState struct {
|
|||
Beneficiary any
|
||||
}
|
||||
|
||||
func (renderer *Renderer) BeneficiaryDisplay(w http.ResponseWriter, r *http.Request, beneficiary any, bookings []fleetsstorage.Booking, organizations []any, beneficiaries_file_types []string, file_types_map map[string]string, documents any, event interface{}) {
|
||||
func (renderer *Renderer) BeneficiaryDisplay(w http.ResponseWriter, r *http.Request, beneficiary any, bookings []fleetsstorage.Booking, organizations []any, beneficiaries_file_types []string, file_types_map map[string]string, documents any, event interface{}, diags []any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.display.files")
|
||||
state := NewState(r, renderer.ThemeConfig, beneficiariesMenu)
|
||||
state.ViewState = map[string]any{
|
||||
|
@ -64,6 +64,7 @@ func (renderer *Renderer) BeneficiaryDisplay(w http.ResponseWriter, r *http.Requ
|
|||
"documents": documents,
|
||||
"organizations": organizations,
|
||||
"event": event,
|
||||
"diags": diags,
|
||||
}
|
||||
renderer.Render("beneficiaries_display", w, r, files, state)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
package renderer
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
diagsstorage "git.coopgo.io/coopgo-platform/diags/storage"
|
||||
)
|
||||
|
||||
const diagsMenu = "diags"
|
||||
|
||||
func (renderer *Renderer) DiagsHome(w http.ResponseWriter, r *http.Request, diags []diagsstorage.Diag) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.diags.list.files")
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
state.ViewState = map[string]any{
|
||||
"diags": diags,
|
||||
}
|
||||
|
||||
renderer.Render("diags home", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) DiagsHistory(w http.ResponseWriter, r *http.Request, diags []diagsstorage.Diag) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.diags.history.files")
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
state.ViewState = map[string]any{
|
||||
"diags": diags,
|
||||
}
|
||||
|
||||
renderer.Render("diags history", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) BeneficiariesCreateDiag(w http.ResponseWriter, r *http.Request, beneficiary string) {
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.create_diag.files")
|
||||
state.ViewState = map[string]any{
|
||||
"beneficiary": beneficiary,
|
||||
}
|
||||
renderer.Render("diag create for beneficiary", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) VehiclesCreateDiag(w http.ResponseWriter, r *http.Request, vehicle string) {
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.create_vehicle_diag.files")
|
||||
state.ViewState = map[string]any{
|
||||
"vehicle": vehicle,
|
||||
}
|
||||
renderer.Render("diag create for vehicle", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) BookingsCreateDiag(w http.ResponseWriter, r *http.Request, booking string) {
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.create_booking_diag.files")
|
||||
state.ViewState = map[string]any{
|
||||
"booking": booking,
|
||||
}
|
||||
renderer.Render("diag create for booking", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) VehicleBookingsCreateDiag(w http.ResponseWriter, r *http.Request, booking string) {
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles.create_booking_diag.files")
|
||||
state.ViewState = map[string]any{
|
||||
"booking": booking,
|
||||
}
|
||||
renderer.Render("diag create for booking", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) DiagsDisplayDiag(w http.ResponseWriter, r *http.Request, diag any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.diags.display_diag.files")
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
|
||||
state.ViewState = map[string]any{
|
||||
"diag": diag,
|
||||
}
|
||||
|
||||
renderer.Render("diags create diag", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) DiagsHistoryDiag(w http.ResponseWriter, r *http.Request, diag any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.diags.history_diag.files")
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
state.ViewState = map[string]any{
|
||||
"diag": diag,
|
||||
}
|
||||
|
||||
renderer.Render("diags history diag", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) DiagUpdate(w http.ResponseWriter, r *http.Request, diag any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.diags.update.files")
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
|
||||
state.ViewState = map[string]any{
|
||||
"diag": diag,
|
||||
}
|
||||
|
||||
renderer.Render("diag_update", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) DiagDelete(w http.ResponseWriter, r *http.Request, diag any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.diags.delete.files")
|
||||
state := NewState(r, renderer.ThemeConfig, diagsMenu)
|
||||
|
||||
state.ViewState = map[string]any{
|
||||
"diag": diag,
|
||||
}
|
||||
|
||||
renderer.Render("diag_deleteDiag", w, r, files, state)
|
||||
}
|
|
@ -252,6 +252,14 @@ func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) Rende
|
|||
Icon: "hero:outline/user-group",
|
||||
})
|
||||
}
|
||||
if modules["diags"] != nil && modules["diags"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Diagnostics",
|
||||
Link: "/app/diags/",
|
||||
Active: menuState == diagsMenu,
|
||||
Icon: "hero:outline/document-text",
|
||||
})
|
||||
}
|
||||
return RenderState{
|
||||
IconSet: icons.NewIconSet(iconset),
|
||||
Group: group,
|
||||
|
|
|
@ -46,12 +46,13 @@ func (renderer *Renderer) VehiclesFleetAdd(w http.ResponseWriter, r *http.Reques
|
|||
renderer.Render("fleet add vehicle", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) VehiclesFleetDisplay(w http.ResponseWriter, r *http.Request, vehicle any, beneficiaries any) {
|
||||
func (renderer *Renderer) VehiclesFleetDisplay(w http.ResponseWriter, r *http.Request, vehicle any, beneficiaries any, diags []any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.fleet_display.files")
|
||||
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
||||
state.ViewState = map[string]any{
|
||||
"vehicle": vehicle,
|
||||
"beneficiaries": beneficiaries,
|
||||
"diags": diags,
|
||||
}
|
||||
|
||||
renderer.Render("fleet display vehicle", w, r, files, state)
|
||||
|
@ -68,7 +69,7 @@ func (renderer *Renderer) VehiclesFleetUpdate(w http.ResponseWriter, r *http.Req
|
|||
renderer.Render("fleet display vehicle", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) VehicleManagementBookingDisplay(w http.ResponseWriter, r *http.Request, booking any, vehicle any, beneficiary any, group any, documents []filestorage.FileInfo, file_types_map map[string]string, alternative_vehicles []any) {
|
||||
func (renderer *Renderer) VehicleManagementBookingDisplay(w http.ResponseWriter, r *http.Request, booking any, vehicle any, beneficiary any, group any, documents []filestorage.FileInfo, file_types_map map[string]string, alternative_vehicles []any, diags []any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.booking_display.files")
|
||||
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
||||
state.ViewState = map[string]any{
|
||||
|
@ -79,6 +80,7 @@ func (renderer *Renderer) VehicleManagementBookingDisplay(w http.ResponseWriter,
|
|||
"documents": documents,
|
||||
"file_types_map": file_types_map,
|
||||
"alternative_vehicles": alternative_vehicles,
|
||||
"diags": diags,
|
||||
}
|
||||
|
||||
renderer.Render("vehicles search", w, r, files, state)
|
||||
|
|
|
@ -52,7 +52,7 @@ func (renderer *Renderer) VehiclesSearch(w http.ResponseWriter, r *http.Request,
|
|||
renderer.Render("vehicles search", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) VehicleBookingDisplay(w http.ResponseWriter, r *http.Request, booking any, vehicle any, beneficiary any, group any, documents []filestorage.FileInfo, file_types_map map[string]string) {
|
||||
func (renderer *Renderer) VehicleBookingDisplay(w http.ResponseWriter, r *http.Request, booking any, vehicle any, beneficiary any, group any, documents []filestorage.FileInfo, file_types_map map[string]string, diags []any) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles.booking_display.files")
|
||||
state := NewState(r, renderer.ThemeConfig, vehiclesMenu)
|
||||
state.ViewState = map[string]any{
|
||||
|
@ -62,6 +62,7 @@ func (renderer *Renderer) VehicleBookingDisplay(w http.ResponseWriter, r *http.R
|
|||
"group": group,
|
||||
"documents": documents,
|
||||
"file_types_map": file_types_map,
|
||||
"diags": diags,
|
||||
}
|
||||
|
||||
renderer.Render("vehicles search", w, r, files, state)
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
// "time"
|
||||
|
||||
diags "git.coopgo.io/coopgo-platform/diags/grpcapi"
|
||||
"git.coopgo.io/coopgo-platform/diags/storage"
|
||||
"google.golang.org/grpc"
|
||||
// "google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
type DiagsService struct {
|
||||
diags.DiagsClient
|
||||
}
|
||||
|
||||
func NewDiagsService(dial string) (*DiagsService, error) {
|
||||
conn, err := grpc.Dial(dial, grpc.WithInsecure())
|
||||
|
||||
client := diags.NewDiagsClient(conn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &DiagsService{
|
||||
DiagsClient: client,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetDiagsDiags() ([]DiagsDiag, error) {
|
||||
resp, err := s.GRPC.Diags.GetDiags(context.TODO(), &diags.GetDiagsRequest{
|
||||
Namespaces: []string{"parcoursmob_beneficiaires", "parcoursmob_diagnostiques"},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
diags := []DiagsDiag{}
|
||||
|
||||
for _, e := range resp.Diags {
|
||||
newDiag := DiagsDiag{
|
||||
Diag: e.ToStorageType(),
|
||||
}
|
||||
diags = append(diags, newDiag)
|
||||
}
|
||||
|
||||
return diags, nil
|
||||
}
|
||||
|
||||
// Enriched types
|
||||
|
||||
type DiagsDiag struct {
|
||||
OwnersGroups []GroupsManagementGroup
|
||||
storage.Diag
|
||||
}
|
|
@ -5,6 +5,7 @@ import (
|
|||
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
|
||||
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
|
||||
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||
diags "git.coopgo.io/coopgo-platform/diags/grpcapi"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
|
@ -17,6 +18,7 @@ type GRPCServices struct {
|
|||
GroupsManagement groupsmanagement.GroupsManagementClient
|
||||
Fleets fleets.FleetsClient
|
||||
Agenda agenda.AgendaClient
|
||||
Diags diags.DiagsClient
|
||||
}
|
||||
|
||||
func NewServicesHandler(cfg *viper.Viper) (*ServicesHandler, error) {
|
||||
|
@ -25,6 +27,7 @@ func NewServicesHandler(cfg *viper.Viper) (*ServicesHandler, error) {
|
|||
groupsManagementDial = cfg.GetString("services.grpc.groupsmanagement.dial")
|
||||
fleetsDial = cfg.GetString("services.grpc.fleets.dial")
|
||||
agendaDial = cfg.GetString("services.grpc.agenda.dial")
|
||||
diagsDial = cfg.GetString("services.grpc.diags.dial")
|
||||
)
|
||||
mobilityAccounts, err := NewMobilityAccountService(mobilityAccountsDial)
|
||||
if err != nil {
|
||||
|
@ -46,12 +49,18 @@ func NewServicesHandler(cfg *viper.Viper) (*ServicesHandler, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
diagsSvc, err := NewDiagsService(diagsDial)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &ServicesHandler{
|
||||
GRPC: GRPCServices{
|
||||
MobilityAccounts: mobilityAccounts,
|
||||
GroupsManagement: groupsManagement,
|
||||
Fleets: fleetsSvc,
|
||||
Agenda: agendaSvc,
|
||||
Diags: diagsSvc,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue