fixed doc env vars + mongo v2 migration
This commit is contained in:
@@ -12,7 +12,7 @@ require (
|
||||
github.com/sendgrid/sendgrid-go v3.16.1+incompatible
|
||||
github.com/tech/sendico/pkg v0.1.0
|
||||
github.com/xhit/go-simple-mail/v2 v2.16.0
|
||||
go.mongodb.org/mongo-driver v1.17.8
|
||||
go.mongodb.org/mongo-driver/v2 v2.5.0
|
||||
go.uber.org/zap v1.27.1
|
||||
golang.org/x/text v0.33.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
@@ -23,15 +23,13 @@ require (
|
||||
github.com/bmatcuk/doublestar/v4 v4.10.0 // indirect
|
||||
github.com/casbin/casbin/v2 v2.135.0 // indirect
|
||||
github.com/casbin/govaluate v1.10.0 // indirect
|
||||
github.com/casbin/mongodb-adapter/v3 v3.7.0 // indirect
|
||||
github.com/casbin/mongodb-adapter/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/go-test/deep v1.1.1 // indirect
|
||||
github.com/golang/snappy v1.0.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/klauspost/compress v1.18.3 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/nats-io/nats.go v1.48.0 // indirect
|
||||
github.com/nats-io/nkeys v0.4.15 // indirect
|
||||
|
||||
@@ -18,8 +18,8 @@ github.com/casbin/casbin/v2 v2.135.0/go.mod h1:FmcfntdXLTcYXv/hxgNntcRPqAbwOG9xs
|
||||
github.com/casbin/govaluate v1.3.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A=
|
||||
github.com/casbin/govaluate v1.10.0 h1:ffGw51/hYH3w3rZcxO/KcaUIDOLP84w7nsidMVgaDG0=
|
||||
github.com/casbin/govaluate v1.10.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A=
|
||||
github.com/casbin/mongodb-adapter/v3 v3.7.0 h1:w9c3bea1BGK4eZTAmk17JkY52yv/xSZDSHKji8q+z6E=
|
||||
github.com/casbin/mongodb-adapter/v3 v3.7.0/go.mod h1:F1mu4ojoJVE/8VhIMxMedhjfwRDdIXgANYs6Sd0MgVA=
|
||||
github.com/casbin/mongodb-adapter/v4 v4.3.0 h1:yYXky9v1by6vj/0QK7OyHyd/xpz4vzh0lCi7JKrS4qQ=
|
||||
github.com/casbin/mongodb-adapter/v4 v4.3.0/go.mod h1:bOTSYZUjX7I9E0ExEvgq46m3mcDNRII7g8iWjrM1BHE=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
@@ -59,8 +59,6 @@ github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
|
||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||
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 v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
@@ -93,8 +91,6 @@ github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g
|
||||
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
|
||||
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
|
||||
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
|
||||
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/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
|
||||
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
@@ -165,8 +161,8 @@ github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfS
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
|
||||
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
go.mongodb.org/mongo-driver v1.17.8 h1:BDP3+U3Y8K0vTrpqDJIRaXNhb/bKyoVeg6tIJsW5EhM=
|
||||
go.mongodb.org/mongo-driver v1.17.8/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ=
|
||||
go.mongodb.org/mongo-driver/v2 v2.5.0 h1:yXUhImUjjAInNcpTcAlPHiT7bIXhshCTL3jVBkF3xaE=
|
||||
go.mongodb.org/mongo-driver/v2 v2.5.0/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s=
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
mmail "github.com/tech/sendico/notification/internal/server/notificationimp/mail/messagebuilder"
|
||||
"github.com/tech/sendico/pkg/db/storable"
|
||||
"github.com/tech/sendico/pkg/domainprovider"
|
||||
mlogger "github.com/tech/sendico/pkg/mlogger/factory"
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
"github.com/tech/sendico/pkg/mlogger/factory"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// Mock implementations
|
||||
@@ -129,11 +129,11 @@ type mockMessage struct {
|
||||
parameters map[string]any
|
||||
}
|
||||
|
||||
func (m *mockMessage) AccountID() string { return m.accountID }
|
||||
func (m *mockMessage) TemplateID() string { return m.templateID }
|
||||
func (m *mockMessage) Locale() string { return m.locale }
|
||||
func (m *mockMessage) Recipients() []string { return m.recipients }
|
||||
func (m *mockMessage) Parameters() map[string]any { return m.parameters }
|
||||
func (m *mockMessage) AccountID() string { return m.accountID }
|
||||
func (m *mockMessage) TemplateID() string { return m.templateID }
|
||||
func (m *mockMessage) Locale() string { return m.locale }
|
||||
func (m *mockMessage) Recipients() []string { return m.recipients }
|
||||
func (m *mockMessage) Parameters() map[string]any { return m.parameters }
|
||||
func (m *mockMessage) Body(l localizer.Localizer, dp domainprovider.DomainProvider) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
@@ -177,7 +177,7 @@ func TestOnAccount_ValidAccount_SendsWelcomeEmail(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Test User",
|
||||
@@ -231,7 +231,7 @@ func TestOnAccount_LinkGenerationFails_ReturnsError(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Test User",
|
||||
@@ -274,7 +274,7 @@ func TestOnAccount_SendFails_ReturnsError(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Test User",
|
||||
@@ -311,7 +311,7 @@ func TestOnInvitation_ValidInvitation_SendsInvitationEmail(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Inviter User",
|
||||
@@ -323,7 +323,7 @@ func TestOnInvitation_ValidInvitation_SendsInvitationEmail(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
invitationID := primitive.NewObjectID()
|
||||
invitationID := bson.NewObjectID()
|
||||
invitation := &model.Invitation{}
|
||||
invitation.ID = invitationID
|
||||
invitation.Content.Email = "invitee@example.com"
|
||||
@@ -375,7 +375,7 @@ func TestOnInvitation_LinkGenerationFails_ReturnsError(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Inviter User",
|
||||
@@ -387,7 +387,7 @@ func TestOnInvitation_LinkGenerationFails_ReturnsError(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
invitationID := primitive.NewObjectID()
|
||||
invitationID := bson.NewObjectID()
|
||||
invitation := &model.Invitation{}
|
||||
invitation.ID = invitationID
|
||||
invitation.Content.Email = "invitee@example.com"
|
||||
@@ -420,7 +420,7 @@ func TestOnPasswordReset_ValidReset_SendsResetEmail(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Test User",
|
||||
@@ -478,7 +478,7 @@ func TestOnPasswordReset_LinkGenerationFails_ReturnsError(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Test User",
|
||||
@@ -520,7 +520,7 @@ func TestOnPasswordReset_SendFails_ReturnsError(t *testing.T) {
|
||||
AccountPublic: model.AccountPublic{
|
||||
AccountBase: model.AccountBase{
|
||||
Base: storable.Base{
|
||||
ID: primitive.NewObjectID(),
|
||||
ID: bson.NewObjectID(),
|
||||
},
|
||||
Describable: model.Describable{
|
||||
Name: "Test User",
|
||||
|
||||
Reference in New Issue
Block a user