domain

package
v0.0.0-...-d785689 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	IsPremium      bool   `bson:"is_premium" json:"is_premium"`
	IsVerified     bool   `bson:"is_verified" json:"is_verified"`
	PremiumFeature string `bson:"premium_feature,omitempty" json:"premium_feature"`
}

type File

type File struct {
	Name string `bson:"name,omitempty" json:"name"`
	Path string `bson:"path,omitempty" json:"path"`
}

type LoginRequest

type LoginRequest struct {
	PhoneNumber string `json:"phone_number" validate:"required"`
	Password    string `json:"password" validate:"required"`
}

type LoginResponse

type LoginResponse struct {
	ID          string `json:"id"`
	AccessToken string `json:"access_token"`
}

type Pagination

type Pagination struct {
	Page      int   `json:"page"`
	TotalData int64 `json:"total_data"`
}

type Profile

type Profile struct {
	ID          string   `json:"id"`
	PhoneNumber string   `json:"phone_number"`
	Email       string   `json:"email"`
	Name        string   `json:"name"`
	DOB         string   `json:"dob"`
	Age         int      `json:"age"`
	Gender      string   `json:"gender"`
	Photos      []string `json:"photos"`
	Feature     Feature  `json:"feature"`
}

type ProfileRequest

type ProfileRequest struct {
	Page int `query:"page"`
}

type ProfileResponse

type ProfileResponse struct {
	Profiles   []*Profile `json:"profiles"`
	Pagination Pagination `json:"pagination"`
}

type PurchasePremium

type PurchasePremium struct {
	PackageType string `json:"package_type" validate:"required,oneof=no_swipe_quota verified_label"`
}

type SignupRequest

type SignupRequest struct {
	PhoneNumber string  `form:"phone_number" validate:"required,min=12,max=15,phone_number"`
	Password    string  `form:"password" validate:"required,min=6,max=64,uppercase,digit,special"`
	Email       string  `form:"email" validate:"required,email"`
	Name        string  `form:"name" validate:"required,min=3,max=30"`
	DOB         string  `form:"dob" validate:"required,dob"`
	Gender      string  `form:"gender" validate:"required,oneof=Male Female"`
	Photos      []*File `form:"photos" validate:"required"`
}

type SignupResponse

type SignupResponse struct {
	ID string `json:"id"`
}

type Swipe

type Swipe struct {
	ID           string    `bson:"_id"`
	UserID       string    `bson:"user_id"`
	TargetUserID string    `bson:"target_user_id"`
	Action       string    `bson:"action"`
	CreatedAt    time.Time `bson:"created_at"`
}

type SwipeRequest

type SwipeRequest struct {
	TargetUserID string `json:"target_user_id" validate:"required"`
	Action       string `json:"action" validate:"required,oneof=like pass"`
}

type User

type User struct {
	ID          string    `bson:"_id" json:"id"`
	PhoneNumber string    `bson:"phone_number" json:"phone_number"`
	Password    []byte    `bson:"password" json:"-"`
	Email       string    `bson:"email" json:"email"`
	Name        string    `bson:"name" json:"name"`
	DOB         string    `bson:"dob" json:"dob"`
	Age         int       `bson:"age" json:"age"`
	Gender      string    `bson:"gender" json:"gender"`
	Photos      []*File   `bson:"photos" json:"photos"`
	Feature     Feature   `bson:"feature,omitempty" json:"feature"`
	CreatedAt   time.Time `bson:"created_at" json:"created_at"`
	UpdatedAt   time.Time `bson:"updated_at" json:"updated_at"`
}

func (*User) CanSwipe

func (u *User) CanSwipe(count int) bool

type UserRecommendation

type UserRecommendation struct {
	SwipedUserIDs []string
	Limit         int64
	Skip          int64
}

type UserSwipe

type UserSwipe struct {
	UserID    string
	CreatedAt time.Time
}

Jump to

Keyboard shortcuts

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