package model

type UserDataBase struct {
	Login  string `bson:"login" json:"login"`
	Locale string `bson:"locale" json:"locale"`
}

type LoginData struct {
	UserDataBase `bson:",inline" json:",inline"`
	Password     string ` bson:"-" json:"password"`
}

type AccountData struct {
	LoginData   `bson:",inline" json:",inline"`
	Describable `bson:",inline" json:",inline"`
	LastName    string `bson:"lastName" json:"lastName"`
}

func (ad *AccountData) ToAccount() *Account {
	return &Account{
		AccountPublic: AccountPublic{
			AccountBase: AccountBase{
				Describable: ad.Describable,
				LastName:    ad.LastName,
			},
			UserDataBase: ad.UserDataBase,
		},
		Password: ad.Password,
	}
}
