profile

package module
v0.0.59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

README

profile

Getting started

To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Already a pro? Just edit this README.md and make it your own. Want to make it easy? Use the template at the bottom!

Add your files

cd existing_repo
git remote add origin https://gitlab.com/tin-roof/meerchat-aac/profile.git
git branch -M main
git push -uf origin main

Integrate with your tools

Collaborate with your team

Test and Deploy

Use the built-in continuous integration in GitLab.


Editing this README

When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to makeareadme.com for this template.

Suggestions for a good README

Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.

Name

Choose a self-explaining name for your project.

Description

Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.

Badges

On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.

Visuals

Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.

Installation

Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.

Usage

Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.

Support

Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.

Roadmap

If you have ideas for releases in the future, it is a good idea to list them in the README.

Contributing

State if you are open to contributions and what your requirements are for accepting them.

For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.

You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.

Authors and acknowledgment

Show your appreciation to those who have contributed to the project.

License

For open source projects, say how it is licensed.

Project status

If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoSubscription is returned when a user does not have a subscription
	ErrNoSubscription = errors.New("no subscription")
)

Functions

This section is empty.

Types

type Client added in v0.0.51

type Client struct {
	Active      bool       `db:"active" json:"active"`
	CreatedAt   *time.Time `db:"created_at" json:"createdAt,omitempty"`
	TherapistID *uuid.UUID `db:"therapist_id" json:"therapistId,omitempty"`
	ID          *uuid.UUID `db:"id" json:"id,omitempty"`
	ProfileID   *uuid.UUID `db:"user_id" json:"profileId,omitempty"`
	UpdatedAt   *time.Time `db:"updated_at" json:"updatedAt,omitempty"`

	// joined fields
	Profile *Profile `json:"profile,omitempty"`
}

Client is a therapist's client

type Family added in v0.0.12

type Family struct {
	CreatedAt time.Time  `db:"created_at" json:"createdAt,omitempty"`
	ID        *uuid.UUID `db:"id" json:"id,omitempty"`
	UpdatedAt time.Time  `db:"updated_at" json:"updatedAt,omitempty"`

	Members []Membership `json:"members,omitempty"`
}

func NewFamily added in v0.0.36

func NewFamily(ctx context.Context, db database.DB) (*Family, error)

NewFamily creates a new family

func (*Family) GetMembers added in v0.0.12

func (f *Family) GetMembers(ctx context.Context, db database.DB) error

GetMembers gets the family member details for the profile

type Membership added in v0.0.12

type Membership struct {
	AcceptedInvite bool       `db:"accepted_invite" json:"acceptedInvite"`
	CreatedAt      *time.Time `db:"created_at" json:"createdAt,omitempty"`
	FamilyID       *uuid.UUID `db:"family_id" json:"familyId,omitempty"`
	ID             *uuid.UUID `db:"id" json:"id,omitempty"`
	InviteCode     *uuid.UUID `db:"invite_code" json:"inviteCode,omitempty"`
	IsAdmin        bool       `db:"is_admin" json:"isAdmin"`
	ProfileID      *uuid.UUID `db:"f_profile_id" json:"profileId,omitempty"`
	UpdatedAt      *time.Time `db:"updated_at" json:"updatedAt,omitempty"`

	// joined fields
	Profile   *Profile `json:"profile,omitempty"`
	Therapist *Profile `json:"therapist,omitempty"`
}

Membership is a user's relationship to a family

func (*Membership) Delete added in v0.0.36

func (m *Membership) Delete(ctx context.Context, db database.DB) error

Delete deletes a family membership record

func (*Membership) Save added in v0.0.27

func (m *Membership) Save(ctx context.Context, db database.DB) error

Save saves a family membership record

type Profile

type Profile struct {
	CreatedAt      time.Time  `json:"createdAt,omitempty"`
	Email          string     `json:"email,omitempty"`
	ID             *uuid.UUID `json:"id,omitempty"`
	Image          string     `json:"image,omitempty"`
	Name           string     `json:"name,omitempty"`
	SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"`
	IsTherapist    bool       `json:"isTherapist,omitempty"`
	UpdatedAt      time.Time  `json:"updatedAt,omitempty"`

	// joined details
	HomeBoardID *uuid.UUID `json:"homeBoardId,omitempty"`
	IsAdmin     bool       `json:"isAdmin,omitempty"`
}

Profile defines the profile of a user

func (*Profile) Create added in v0.0.27

func (p *Profile) Create(ctx context.Context, db database.DB) (*Profile, error)

Create creates a new profile with some default data

func (*Profile) Delete added in v0.0.36

func (p *Profile) Delete(ctx context.Context, db database.DB) error

Delete removes a profile

func (*Profile) DeleteAllBoards added in v0.0.36

func (p *Profile) DeleteAllBoards(ctx context.Context, db database.DB) error

DeleteAllBoards deletes the users boards

func (*Profile) DeleteSettings added in v0.0.36

func (p *Profile) DeleteSettings(ctx context.Context, db database.DB) error

DeleteSettings deletes the users application settings

func (*Profile) DeleteSubscription added in v0.0.50

func (p *Profile) DeleteSubscription(ctx context.Context, db database.DB) error

DeleteSubscription delete a subscription

func (p *Profile) DeleteTherapistLinks(ctx context.Context, db database.DB) error

deleteTherapistLinks deletes any therapist links for the profile

func (*Profile) GetClientList added in v0.0.51

func (p *Profile) GetClientList(ctx context.Context, db database.DB) ([]Client, error)

GetClientList finds all the patients linked to a therapist

func (*Profile) GetDetails added in v0.0.4

func (p *Profile) GetDetails(ctx context.Context, db database.DB) (*Profile, error)

GetDetails for a profile

func (*Profile) GetFamily added in v0.0.12

func (p *Profile) GetFamily(ctx context.Context, db database.DB) (*Family, error)

GetFamily gets the family details for the profile

func (*Profile) GetID

func (p *Profile) GetID(ctx context.Context, db database.DB) (*Profile, error)

GetID for a profile

func (*Profile) GetSettings added in v0.0.10

func (p *Profile) GetSettings(ctx context.Context, db database.DB) (*Settings, error)

GetSettings finds the users application settings

func (*Profile) GetSubscription added in v0.0.18

func (p *Profile) GetSubscription(ctx context.Context, db database.DB) (*Subscription, error)

GetSubscription finds the subscription for the family

func (*Profile) GetSubscriptionID added in v0.0.18

func (p *Profile) GetSubscriptionID(ctx context.Context, db database.DB) (*Profile, error)

GetSubscriptionID for a profile

func (*Profile) HasSubscription added in v0.0.22

func (p *Profile) HasSubscription() bool

Has subscription returns true if there is a valid subscription id for the user

func (*Profile) LinkTherapist added in v0.0.27

func (p *Profile) LinkTherapist(ctx context.Context, db database.DB, therapist *Profile) (*Profile, error)

LinkTherapist links a therapist to a profile

func (*Profile) New added in v0.0.3

func (p *Profile) New(ctx context.Context, db database.DB) (*Profile, error)

New creates all the rest of the profile

func (*Profile) NewSubscription added in v0.0.46

func (p *Profile) NewSubscription(ctx context.Context, db database.DB, seats int, dashboardAccess bool) (*Subscription, error)

NewSubscription creates a new subscription for a profile

func (*Profile) RemoveSubscription added in v0.0.41

func (p *Profile) RemoveSubscription(ctx context.Context, db database.DB) error

RemoveSubscription from a profile

func (*Profile) Save added in v0.0.2

func (p *Profile) Save(ctx context.Context, db database.DB, isNew bool) (*Profile, error)

Save a profile @TODO: save should be reworked in a way that can be used for both new and existing profiles with and without a family - maybe the issue is actually in registration and not here ie: save the profile then create the family/membership

func (*Profile) SaveSettings added in v0.0.53

func (p *Profile) SaveSettings(ctx context.Context, db database.DB, settings Settings) error

SaveSettings saves the users application settings

func (*Profile) Tokenize added in v0.0.2

func (p *Profile) Tokenize(ctx context.Context, secret string, timestamp time.Time) (string, error)

Tokenize creates a JWT token for the profile

func (*Profile) ValidateToken added in v0.0.2

func (p *Profile) ValidateToken(ctx context.Context, secret string, tokenString string) (*Profile, error)

ValidateToken checks the JWT token for the profile to make sure its valid

type Settings added in v0.0.10

type Settings struct {
	Analytics bool           `db:"analytics" json:"analytics"`
	Speech    SpeechSettings `db:"speech" json:"speech"`
	Theme     ThemeSettings  `db:"theme" json:"theme"`
}

type SpeechSettings added in v0.0.53

type SpeechSettings struct {
	Pitch float64 `db:"pitch" json:"pitch"`
	Speed float64 `db:"speed" json:"speed"`
	Voice string  `db:"voice" json:"voice"`
}

type Subscription added in v0.0.18

type Subscription struct {
	Active          bool       `json:"active"`
	CreatedAt       time.Time  `json:"createdAt,omitempty"`
	DashboardAccess bool       `json:"dashboardAccess"`
	ExpiresOn       time.Time  `json:"expiresOn,omitempty"`
	FamilyID        *uuid.UUID `json:"familyId,omitempty"`
	ID              *uuid.UUID `json:"id,omitempty"`
	Paid            bool       `json:"paid"`
	TotalSeats      int        `json:"totalSeats"`
	UpdatedAt       time.Time  `json:"updated_at,omitempty"`
	UsedSeats       int        `json:"usedSeats"`
	Renew           bool       `json:"renew"`
}

func (*Subscription) Save added in v0.0.46

func (s *Subscription) Save(ctx context.Context, db database.DB) error

Save saves any changes to the subscription

type ThemeSettings added in v0.0.53

type ThemeSettings struct {
	BackgroundColor string `db:"backgroundColor" json:"backgroundColor"`
	BackgroundImage string `db:"backgroundImage" json:"backgroundImage"`
	Theme           string `db:"theme" json:"theme"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL