models

package
v0.5.76 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 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 Appointment

type Appointment struct {
	ID                     int64         `json:"id"`
	PatientID              *int64        `json:"patient_id"`
	PractitionerID         *int64        `json:"practitioner_id"`
	ScheduledStartDateTime *time.Time    `json:"scheduled_start_date_time"`
	ScheduledEndDateTime   *time.Time    `json:"scheduled_end_date_time"`
	Status                 string        `json:"status"`
	EndedAt                *time.Time    `json:"ended_at"`
	InternalID             string        `json:"internal_id"`
	DurationInSeconds      int64         `json:"duration_in_seconds"`
	ElapsedTimeInSeconds   int64         `json:"elapsed_time_in_seconds"`
	CreatedAt              *time.Time    `json:"created_at"`
	UpdatedAt              *time.Time    `json:"updated_at"`
	BookedAt               *time.Time    `json:"booked_at"`
	ReservedAt             *time.Time    `json:"reserved_at"`
	Price                  float64       `json:"price"`
	BatchID                string        `json:"batch_id"`
	Timezone               string        `json:"timezone"`
	PractitionerUID        *string       `json:"practitioner_uid"`
	PatientUID             *string       `json:"patient_uid"`
	Practitioner           *Practitioner `json:"practitioner,omitempty"`
	Patient                *User         `json:"patient,omitempty"`
	PracticeID             *int64        `json:"practice_id"`

	PlatformFeeAsPercentage                     float64   `json:"platform_fee_as_percentage"`
	PlatformFeeAsFixedAmount                    float64   `json:"platform_fee_as_fixed_amount"`
	CancellationThresholdInHours                int64     `json:"cancellation_threshold_in_hours"`
	CancellationThresholdTime                   time.Time `json:"cancellation_threshold_time"`
	RefundPercentageBeforeCancellationThreshold float64   `json:"refund_percentage_before_cancellation_threshold"`
	RefundPercentageAfterCancellationThreshold  float64   `json:"refund_percentage_after_cancellation_threshold"`
}

type AppointmentAggregated added in v0.0.16

type AppointmentAggregated struct {
	ID                     int64         `json:"id"`
	Patient                *User         `json:"patient"`
	Practitioner           *Practitioner `json:"practitioner"`
	ScheduledStartDateTime *time.Time    `json:"scheduled_start_date_time"`
	ScheduledEndDateTime   *time.Time    `json:"scheduled_end_date_time"`
	Status                 string        `json:"status"`
	EndedAt                *time.Time    `json:"ended_at"`
	InternalID             string        `json:"internal_id"`
	DurationInSeconds      int64         `json:"duration_in_seconds"`
	ElapsedTimeInSeconds   int64         `json:"elapsed_time_in_seconds"`
	CreatedAt              *time.Time    `json:"created_at"`
	UpdatedAt              *time.Time    `json:"updated_at"`
	BookedAt               *time.Time    `json:"booked_at"`
	ReservedAt             *time.Time    `json:"reserved_at"`
	Price                  float64       `json:"price"`
	BatchID                string        `json:"batch_id"`
	Timezone               string        `json:"timezone"`
	PractitionerUID        string        `json:"practitioner_uid"`
	PatientUID             string        `json:"patient_uid"`

	PlatformFeeAsPercentage                     float64   `json:"platform_fee_as_percentage"`
	PlatformFeeAsFixedAmount                    float64   `json:"platform_fee_as_fixed_amount"`
	CancellationThresholdInHours                int64     `json:"cancellation_threshold_in_hours"`
	CancellationThresholdTime                   time.Time `json:"cancellation_threshold_time"`
	RefundPercentageBeforeCancellationThreshold float64   `json:"refund_percentage_before_cancellation_threshold"`
	RefundPercentageAfterCancellationThreshold  float64   `json:"refund_percentage_after_cancellation_threshold"`
}

type Bank added in v0.0.11

type Bank struct {
	ID      int64  `json:"id"`
	Name    string `json:"name"`
	Country string `json:"country"`
}

type BankAccount added in v0.0.11

type BankAccount struct {
	BankID    int64  `json:"bank_id"`
	Number    string `json:"number"`
	Type      string `json:"type"`
	Country   string `json:"country"`
	UID       string `json:"uid"`
	IsPrimary bool   `json:"is_primary"`
}

type CommissionConfig added in v0.5.64

type CommissionConfig struct {
	PlatformConsultationCommission float64
}

type Consultation added in v0.0.4

type Consultation struct {
	ID                   uint64     `json:"id"`
	AppointmentID        uint64     `json:"appointment_id"`
	PatientID            uint64     `json:"patient_id"`
	PractitionerID       uint64     `json:"practitioner_id"`
	Status               string     `json:"status"`
	ElapsedTimeInSeconds int64      `json:"elapsed_time_in_seconds"`
	PaymentStatus        string     `json:"payment_status"`
	CreatedAt            *time.Time `json:"created_at"`
	UpdatedAt            *time.Time `json:"updated_at"`
	PractitionerUID      string     `json:"practitioner_uid"`
	PatientUID           string     `json:"patient_uid"`
}

type ConsultationAggregated added in v0.0.16

type ConsultationAggregated struct {
	ID                   uint64       `json:"id"`
	Appointment          Appointment  `json:"appointment"`
	Patient              Patient      `json:"patient"`
	Practitioner         Practitioner `json:"practitioner"`
	Status               string       `json:"status"`
	ElapsedTimeInSeconds int64        `json:"elapsed_time_in_seconds"`
	PaymentStatus        string       `json:"payment_status"`
	PractitionerUID      string       `json:"practitioner_uid"`
	PatientUID           string       `json:"patient_uid"`
	CreatedAt            *time.Time   `json:"created_at"`
	UpdatedAt            *time.Time   `json:"updated_at"`
}

type CreatePaymentRequest

type CreatePaymentRequest struct {
	CommerceOrder   string              `json:"commerce_order"`
	Subject         string              `json:"subject"`
	Currency        string              `json:"currency"`
	Amount          float64             `json:"amount"`
	Email           string              `json:"email"`
	PaymentMethod   int                 `json:"payment_method"`
	URLConfirmation string              `json:"url_confirmation"`
	URLReturn       string              `json:"url_return"`
	Optional        GatewayOptionalData `json:"optional"`
	Timeout         int                 `json:"timeout"`
	MerchantID      string              `json:"merchant_id"`
	PaymentCurrency string              `json:"payment_currency"`
}

type CreatePaymentResponse

type CreatePaymentResponse struct {
	URL                string `json:"url"`
	Token              string `json:"token"`
	FlowOrder          string `json:"flow_order"`
	TimeToPayInSeconds int    `json:"time_to_pay_in_seconds"`
}

type DBOptions added in v0.2.10

type DBOptions struct {
	Host              *string `json:"host"`
	Port              *int    `json:"port"`
	User              *string `json:"user"`
	Password          *string `json:"password"`
	DBName            string  `json:"db_name"`
	URI               *string `json:"uri"`
	WithMonitor       *bool   `json:"with_monitor"`
	ConnectionTimeout *int    `json:"connection_timeout"`
	SocketTimeout     *int    `json:"socket_timeout"`
	MaxPoolSize       *uint64 `json:"max_pool_size"`
	MinPoolSize       *uint64 `json:"min_pool_size"`
	Timeout           int     `json:"timeout"`
	RetryReads        *bool   `json:"retry_reads"`
	RetryWrites       *bool   `json:"retry_writes"`
	TimeZone          *string `json:"time_zone"`
}

type DTOWithSessionData added in v0.5.47

type DTOWithSessionData struct {
	SessionData SessionData `json:"session_data"`
}

type FeelgoodJWTClaims added in v0.1.11

type FeelgoodJWTClaims struct {
	Claims FeelgoodJWTCustomClaims `json:"claims"`
	jwt.StandardClaims
}

type FeelgoodJWTCustomClaims added in v0.1.3

type FeelgoodJWTCustomClaims struct {
	Email string `json:"email"`
	Type  string `json:"type"`
	UID   string `json:"uid"`
}

type FeelgoodJWTPayload added in v0.1.3

type FeelgoodJWTPayload struct {
	UID       string   `json:"uid"`
	Email     string   `json:"email"`
	FirstName string   `json:"first_name"`
	LastName  string   `json:"last_name"`
	Type      string   `json:"type"`
	Roles     []string `json:"roles"`
}

type FlowPaymentData added in v0.2.7

type FlowPaymentData struct {
	Date           string  `json:"date" bson:"date"`
	Media          string  `json:"media" bson:"media"`
	ConversionDate string  `json:"conversionDate" bson:"conversion_date"`
	ConversionRate float64 `json:"conversionRate" bson:"conversion_rate"`
	Amount         string  `json:"amount" bson:"amount"`
	Currency       string  `json:"currency" bson:"currency"`
	Fee            string  `json:"fee" bson:"fee"`
	Balance        float64 `json:"balance" bson:"balance"`
	TransferDate   string  `json:"transferDate" bson:"transfer_date"`
}

type FlowPaymentStatus added in v0.2.7

type FlowPaymentStatus struct {
	FlowOrder     uint                `json:"flowOrder" bson:"flow_order"`
	CommerceOrder string              `json:"commerceOrder" bson:"commerce_order"`
	RequestDate   string              `json:"requestDate" bson:"request_date"`
	Status        uint                `json:"status" bson:"status"`
	Subject       string              `json:"subject" bson:"subject"`
	Currency      string              `json:"currency" bson:"currency"`
	Amount        string              `json:"amount" bson:"amount"`
	Payer         string              `json:"payer" bson:"payer"`
	Optional      GatewayOptionalData `json:"optional" bson:"optional"`
	PendingInfo   FlowPendingInfo     `json:"pendingInfo" bson:"pending_info"`
	PaymentData   FlowPaymentData     `json:"paymentData" bson:"payment_data"`
	MerchantID    string              `json:"merchantId" bson:"merchant_id"`
}

type FlowPendingInfo added in v0.2.7

type FlowPendingInfo struct {
	Media string `json:"media"`
	Date  string `json:"date"`
}

type GatewayOptionalData added in v0.2.2

type GatewayOptionalData struct {
	ResourcePayed string      `json:"resource_payed" bson:"resource_payed"`
	ResourceID    string      `json:"resource_id" bson:"resource_id"`
	Data          interface{} `json:"data" bson:"data"`
}

type GlobalConfig added in v0.5.64

type GlobalConfig struct {
	Thresholds  ThresholdConfig
	Commissions CommissionConfig
}

type KafkaErrorMessage added in v0.3.3

type KafkaErrorMessage struct {
	Offset    int64     `json:"offset"`
	Error     string    `json:"error"`
	Time      time.Time `json:"time"`
	Partition int       `json:"partition"`
	Topic     string    `json:"topic"`
}

type KafkaMessage added in v0.2.0

type KafkaMessage struct {
	Metadata *KafkaMetadata `json:"metadata"`
	Data     interface{}    `json:"data"`
	Code     string         `json:"code"`
}

type KafkaMetadata added in v0.2.0

type KafkaMetadata struct {
	IssuedBy string `json:"issued_by"`
}

type NonPublicUser added in v0.5.21

type NonPublicUser struct {
	UID            string  `json:"uid"`
	FirstName      *string `json:"first_name"`
	SecondName     *string `json:"second_name"`
	LastName       *string `json:"last_name"`
	SecondLastName *string `json:"second_last_name"`
	Gender         *string
	Nationality    *string
	FullName       string `json:"full_name"`
}

type Pagination added in v0.2.25

type Pagination struct {
	Page         int  `json:"page"`
	ItemsPerPage int  `json:"items_per_page"`
	TotalItems   *int `json:"total_items"`
	TotalPages   *int `json:"total_pages"`
}

type Patient added in v0.0.16

type Patient struct {
	ID             int64      `json:"id"`
	UID            string     `json:"uid"`
	FirstName      string     `json:"first_name"`
	SecondName     string     `json:"second_name"`
	LastName       string     `json:"last_name"`
	SecondLastName string     `json:"second_last_name"`
	NationalID     string     `json:"national_id"`
	Email          string     `json:"email"`
	Cellphone      string     `json:"cellphone"`
	FullName       string     `json:"full_name"`
	Gender         string     `json:"gender"`
	CreatedAt      *time.Time `json:"created_at"`
	UpdatedAt      *time.Time `json:"updated_at"`
	DeletedAt      *time.Time `json:"deleted_at"`
}

type Payment added in v0.2.7

type Payment struct {
	ID                                string      `json:"id" bson:"id"`
	Status                            string      `json:"status" bson:"status"`
	Amount                            float64     `json:"amount" bson:"amount"`
	Currency                          string      `json:"currency" bson:"currency"`
	PayerEmail                        string      `json:"payer_email" bson:"payer_email"`
	Data                              interface{} `json:"data" bson:"data"`
	PaymentMethod                     string      `json:"payment_method" bson:"payment_method"`
	ConversionDate                    time.Time   `json:"conversion_date" bson:"conversion_date"`
	ConversionRate                    float64     `json:"conversion_rate" bson:"conversion_rate"`
	GatewayFee                        float64     `json:"gateway_fee" bson:"gateway_fee"`
	GatewayTransferDateToCommerceDate time.Time   `json:"gateway_transfer_date" bson:"gateway_transfer_date_to_commerce_date"`
	Resource                          string      `json:"resource" bson:"resource"`
	ResourceID                        string      `json:"resource_id" bson:"resource_id"`
	Gateway                           *string     `json:"gateway" bson:"gateway"`
	GatewayReferenceID                *string     `json:"gateway_reference_id" bson:"gateway_reference_id"`
	GatewayStatus                     uint        `json:"gateway_status" bson:"gateway_status"`
	InternalReferenceID               *string     `json:"internal_reference_id" bson:"internal_reference_id"`
}

type Practice added in v0.0.13

type Practice struct {
	ID     int64  `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"`
	I18NEs string `json:"i18n_es" gorm:"column:i18n_es"`
}

type Practitioner added in v0.0.10

type Practitioner struct {
	ID                      uint64     `json:"id"`
	UID                     string     `json:"uid"`
	FirstName               string     `json:"first_name"`
	SecondName              string     `json:"second_name"`
	LastName                string     `json:"last_name"`
	SecondLastName          string     `json:"second_last_name"`
	FullName                string     `json:"full_name"`
	Gender                  string     `json:"gender"`
	NationalID              string     `json:"national_id"`
	RegistryID              string     `json:"registry_id"`
	Bio                     string     `json:"bio"`
	PracticeUniversityID    uint64     `json:"practice_university_id"`
	SpecialtyUniversityID   uint64     `json:"specialty_university_id"`
	Image                   string     `json:"image"`
	Email                   string     `json:"email"`
	PracticeID              int64      `json:"practice_id"`
	SpecialtyID             int64      `json:"specialty_id"`
	CreatedAt               *time.Time `json:"created_at"`
	UpdatedAt               *time.Time `json:"updated_at"`
	DeletedAt               *time.Time `json:"deleted_at"`
	InternalID              string     `json:"internal_id"`
	PracticeName            string     `json:"practice_name"`
	SpecialtyName           string     `json:"specialty_name"`
	PracticeUniversityName  string     `json:"practice_university_name"`
	SpecialtyUniversityName string     `json:"specialty_university_name"`
	Status                  string     `json:"status"`
	Slug                    string     `json:"slug"`
}

type PractitionerAggregated added in v0.0.13

type PractitionerAggregated struct {
	ID                  uint64      `json:"id"`
	UID                 string      `json:"uid"`
	FirstName           string      `json:"first_name"`
	SecondName          string      `json:"second_name"`
	LastName            string      `json:"last_name"`
	SecondLastName      string      `json:"second_last_name"`
	FullName            string      `json:"full_name"`
	NationalID          string      `json:"national_id"`
	RegistryID          string      `json:"registry_id"`
	Image               string      `json:"image"`
	Gender              string      `json:"gender"`
	Bio                 string      `json:"bio"`
	PracticeUniversity  *University `json:"practice_university"`
	SpecialtyUniversity *University `json:"specialty_university"`
	Practice            *Practice   `json:"practice"`
	Specialty           *Specialty  `json:"specialty"`
	InternalID          string      `json:"internal_id"`
	Slug                string      `json:"slug"`
	Status              string      `json:"status"`
}

func (*PractitionerAggregated) ToPublicPractitionerAggregated added in v0.5.73

func (p *PractitionerAggregated) ToPublicPractitionerAggregated() PublicPractitionerAggregated

type PublicPractitioner added in v0.5.73

type PublicPractitioner struct {
	ID             uint64 `json:"id"`
	UID            string `json:"uid"`
	FirstName      string `json:"first_name"`
	SecondName     string `json:"second_name"`
	LastName       string `json:"last_name"`
	SecondLastName string `json:"second_last_name"`
	FullName       string `json:"full_name"`
	RegistryID     string `json:"registry_id"`
	Image          string `json:"image"`
	Gender         string `json:"gender"`
	Bio            string `json:"bio"`
}

func (*PublicPractitioner) ToPublicPractitioner added in v0.5.73

func (p *PublicPractitioner) ToPublicPractitioner() PublicPractitioner

type PublicPractitionerAggregated added in v0.5.73

type PublicPractitionerAggregated struct {
	ID                  uint64      `json:"id"`
	UID                 string      `json:"uid"`
	FirstName           string      `json:"first_name"`
	SecondName          string      `json:"second_name"`
	LastName            string      `json:"last_name"`
	SecondLastName      string      `json:"second_last_name"`
	FullName            string      `json:"full_name"`
	RegistryID          string      `json:"registry_id"`
	Image               string      `json:"image"`
	Gender              string      `json:"gender"`
	Bio                 string      `json:"bio"`
	PracticeUniversity  *University `json:"practice_university"`
	SpecialtyUniversity *University `json:"specialty_university"`
	Practice            *Practice   `json:"practice"`
	Specialty           *Specialty  `json:"specialty"`
	Slug                string      `json:"slug"`
}

type Refund added in v0.2.19

type Refund struct {
	ID                string    `json:"id" bson:"id"`
	Status            uint      `json:"status" bson:"status"`
	Amount            float64   `json:"amount" bson:"amount"`
	Currency          string    `json:"currency" bson:"currency"`
	Fee               float64   `json:"fee" bson:"fee"`
	RefundRequestDate time.Time `json:"refundRequestDate" bson:"refund_request_date"`
}

type SessionData added in v0.5.45

type SessionData struct {
	UID       string   `json:"uid"`
	Email     string   `json:"email"`
	Token     string   `json:"token"`
	UserType  string   `json:"user_type"`
	UserRoles []string `json:"user_roles"`
}

SessionData holds information about the current user/session in a transaction. It is used to pass information about the current session to different components, usually services. In the context of an HTTP request, the request could have user data coming from the session.

type Specialty added in v0.0.13

type Specialty struct {
	Id         int64  `json:"id"`
	Name       string `json:"name"`
	PracticeID int64  `json:"practice_id"`
	Status     string `json:"status"`
	I18NEs     string `json:"i18n_es" gorm:"column:i18n_es"`
}

type SubSpecialty added in v0.0.17

type SubSpecialty struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	PracticeID  int64  `json:"practice_id"`
	SpecialtyID int64  `json:"specialty_id"`
	I18NEs      string `json:"i18n_es" gorm:"column:i18n_es"`
}

type ThresholdConfig added in v0.5.64

type ThresholdConfig struct {
	AppointmentCancellationThresholdInHours int
}

type University added in v0.0.13

type University struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Country     string `json:"country"`
}

type User added in v0.0.8

type User struct {
	UID            string   `json:"uid"`
	FirstName      *string  `json:"first_name"`
	SecondName     *string  `json:"second_name"`
	LastName       *string  `json:"last_name"`
	SecondLastName *string  `json:"second_last_name"`
	Gender         *string  `json:"gender"`
	Nationality    *string  `json:"nationality"`
	NationalID     *string  `json:"national_id"`
	Email          *string  `json:"email"`
	Type           *string  `json:"type"`
	Roles          []string `json:"roles"`
	FullName       string   `json:"full_name"`
}

func (*User) GetFullName added in v0.2.16

func (u *User) GetFullName() string

func (*User) GetFullNameWithSecondLastName added in v0.2.16

func (u *User) GetFullNameWithSecondLastName() string

func (*User) GetFullNameWithSecondName added in v0.2.16

func (u *User) GetFullNameWithSecondName() string

func (*User) IsProfileCompleted added in v0.2.16

func (u *User) IsProfileCompleted() bool

func (*User) ToNonPublicUser added in v0.5.21

func (u *User) ToNonPublicUser() *NonPublicUser

Jump to

Keyboard shortcuts

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