Skip to content

Commit

Permalink
feat: no dependency on strongo/strongoapp
Browse files Browse the repository at this point in the history
  • Loading branch information
trakhimenok committed Nov 25, 2023
1 parent 694f404 commit 8149b0a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
24 changes: 18 additions & 6 deletions botsfwmodels/app_user_data.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
package botsfwmodels

import "github.com/strongo/strongoapp/appuser"

// AppUserData holds information about bot app user
type AppUserData interface {
appuser.BaseUserData

// LocaleSettings is an interface to set and get preferred locale
LocaleSettings

// SetBotUserID associates bot user ID with an app user record
SetBotUserID(platform, botID, botUserID string)

// UserNamesHolder is an interface to set and get user's names.
UserNamesHolder

// PreferredLocaleHolder is an interface to set and get preferred locale
PreferredLocaleHolder
}

type UserNamesHolder interface {
// SetName sets a name of a user. It is used to store first name, last name, etc.
// Parameters:
// - field: name of a field to set: "firstName", "lastName", "nickName", "fullName"
SetName(field, value string) error

// GetName returns a name of a user. It is used to store first name, last name, etc.
// Parameters:
// - field: name of a field to set: "firstName", "lastName", "nickName", "fullName"
GetName(field string) string

// GetFullName returns full name of a user
GetFullName() string
}
3 changes: 2 additions & 1 deletion botsfwmodels/locale_settings.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package botsfwmodels

type LocaleSettings interface {
type PreferredLocaleHolder interface {

// SetPreferredLocale sets preferred locale for the chat as code5 (e.g. en-US)
SetPreferredLocale(code5 string) error

Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ module github.com/bots-go-framework/bots-fw-store
go 1.21

require github.com/strongo/validation v0.0.6

require github.com/strongo/strongoapp v0.9.1 // indirect
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
github.com/strongo/strongoapp v0.9.1 h1:M3JqRZtqftTHGqnekW3ncNYYqLv2B1weye7yhPIG9ms=
github.com/strongo/strongoapp v0.9.1/go.mod h1:UWRe4rYG7val1PRumvd+V1TbCHmckfHr3DQ+OzvYnqo=
github.com/strongo/validation v0.0.6 h1:RskXD45ILagVW3jmuKUiq7WshE4kmoQEiUbgfigqHzw=
github.com/strongo/validation v0.0.6/go.mod h1:V4Nu8b8CPsLNwYLKmMHN2ghkoabOpiOW8NNcUczuCWE=

0 comments on commit 8149b0a

Please sign in to comment.