Bootstrap copied BFF and local accounts with public Sendico contracts (#34)
This commit is contained in:
1 parent
67dc5b5b1e
commit
7062672a87
556 files changed
+42291
-777
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package mzap
|
||||
|
||||
import (
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/storable"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/model"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func ObjRef(name string, objRef bson.ObjectID) zap.Field {
|
||||
return zap.String(name, objRef.Hex())
|
||||
}
|
||||
|
||||
func StorableRef(obj storable.Storable) zap.Field {
|
||||
return ObjRef(obj.Collection()+"_ref", *obj.GetID())
|
||||
}
|
||||
|
||||
func OrgRef(orgRef bson.ObjectID) zap.Field {
|
||||
return ObjRef("organization_ref", orgRef)
|
||||
}
|
||||
|
||||
func OrganizationRef(obj model.OrganizationBound) zap.Field {
|
||||
return OrgRef(obj.GetOrganizationRef())
|
||||
}
|
||||
|
||||
func PermissionRef(permissionRef bson.ObjectID) zap.Field {
|
||||
return ObjRef("permission_ref", permissionRef)
|
||||
}
|
||||
Reference in new issue
Block a user