Documentation
¶
Index ¶
- func CheckUserExists(tx *gorm.DB, email string) (bool, error)
- func CreateApplicant(tx *gorm.DB, req ApplicantRequest) error
- func CreateInquiry(tx *gorm.DB, req InquiryRequest) error
- func CreateProduct(tx *gorm.DB, req *CreateProductRequest) error
- func UpdateProduct(tx *gorm.DB, id uuid.UUID, req *CreateProductRequest) error
- func UpdateTransaction(tx *gorm.DB, id string, req *CreateTransactionRequest) error
- func UpdateUser(tx *gorm.DB, id uuid.UUID, req *CreateUserRequest) error
- type ApplicantRequest
- type Applicants
- type CreateProductRequest
- type CreateQrCodeRequest
- type CreateTransactionRequest
- type CreateUserRequest
- type Inquiry
- type InquiryRequest
- type Product
- type QrCodes
- type Transaction
- func CreateTransaction(tx *gorm.DB, req *CreateTransactionRequest) (Transaction, error)
- func GetTransactionByID(tx *gorm.DB, id uuid.UUID) (Transaction, error)
- func GetTransactionByStripePaymentIntentID(tx *gorm.DB, id string) (Transaction, error)
- func GetTransactions(tx *gorm.DB) ([]Transaction, error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateApplicant ¶
func CreateApplicant(tx *gorm.DB, req ApplicantRequest) error
func CreateInquiry ¶
func CreateInquiry(tx *gorm.DB, req InquiryRequest) error
func CreateProduct ¶
func CreateProduct(tx *gorm.DB, req *CreateProductRequest) error
func UpdateProduct ¶
func UpdateTransaction ¶
func UpdateTransaction(tx *gorm.DB, id string, req *CreateTransactionRequest) error
func UpdateUser ¶
Types ¶
type ApplicantRequest ¶
type ApplicantRequest struct { FirstName string `form:"first_name,omitempty" binding:"required"` LastName string `form:"last_name,omitempty" binding:"required"` Email string `form:"email,omitempty" binding:"required"` Phone string `form:"phone,omitempty" binding:"required"` ZipCode string `form:"zip_code,omitempty" binding:"required"` JobTitle string `form:"job_title,omitempty" binding:"required"` LinkedInProfile string `form:"linked_in_profile,omitempty"` ApplicationDate *time.Time `form:"application_date,omitempty"` FileURL string }
type Applicants ¶
type Applicants struct { ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"id"` FirstName string `gorm:"type:varchar(255); not null;" json:"first_name"` LastName string `gorm:"type:varchar(255); not null;" json:"last_name"` Email string `gorm:"type:varchar(255); not null;" json:"email"` Phone string `gorm:"type:varchar(255); not null;" json:"phone"` ZipCode string `gorm:"type:varchar(255); not null;" json:"zip_code"` LinkedInProfile string `gorm:"type:varchar(255); nullable;" json:"linked_in_profile"` JobTitle string `gorm:"type:varchar(255); not null;" json:"job_title"` ApplicationDate *time.Time `gorm:"nullable" json:"application_date,omitempty"` FileURL string `gorm:"type:varchar(255); nullable;" json:"file_url,omitempty"` }
func GetAllApplicants ¶
func GetAllApplicants(tx *gorm.DB) ([]Applicants, error)
func GetApplicantById ¶
func GetApplicantById(tx *gorm.DB, id string) (*Applicants, error)
type CreateProductRequest ¶
type CreateProductRequest struct { Name string `json:"name,omitempty" binding:"required"` Description string `json:"description,omitempty"` BasePrice float64 `json:"basePrice,omitempty" binding:"required"` DiscountedPrice float64 `json:"discountedPrice,omitempty"` Quantity int `json:"quantity,omitempty" binding:"required"` }
type CreateQrCodeRequest ¶
type CreateTransactionRequest ¶
type CreateTransactionRequest struct { ProductID uuid.UUID `json:"product_id,omitempty" binding:"required"` UserID uuid.UUID `json:"user_id,omitempty" binding:"required"` Amount float64 `json:"amount,omitempty" binding:"required"` StripePaymentIntentID string `json:"stripe_payment_intent_id,omitempty" binding:"required"` StripePaymentIntentClientSecret string `json:"stripe_payment_intent_client_secret,omitempty" binding:"required"` }
type CreateUserRequest ¶
type CreateUserRequest struct { FirstName string `json:"first_name,omitempty" binding:"required"` LastName string `json:"last_name,omitempty" binding:"required"` Email string `json:"email,omitempty" binding:"required"` ZipCode string `json:"zip_code,omitempty" binding:"required"` PhoneNumber string `json:"phone_number,omitempty"` IsJoinBeta *time.Time `json:"is_join_beta,omitempty"` }
type Inquiry ¶
type Inquiry struct { ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"id"` FirstName string `gorm:"type:varchar(255); not null;" json:"first_name"` LastName string `gorm:"type:varchar(255); not null;" json:"last_name"` Email string `gorm:"type:varchar(255); not null;" json:"email"` Phone string `gorm:"type:varchar(255); not null;" json:"phone"` Message string `gorm:"type:text; not null;" json:"message"` }
type InquiryRequest ¶
type Product ¶
type Product struct { ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"ID,omitempty"` Name string `gorm:"type:varchar(255)" json:"name,omitempty"` Description string `gorm:"type:varchar(255)" json:"description,omitempty"` BasePrice float64 `gorm:"type:float" json:"basePrice,omitempty"` DiscountedPrice float64 `gorm:"type:float" json:"discountedPrice,omitempty"` Quantity int `gorm:"type:int" json:"quantity,omitempty"` }
type QrCodes ¶
type QrCodes struct { ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"ID,omitempty"` TransactionID uuid.UUID `gorm:"type:uuid;" json:"transaction_id,omitempty"` UserID uuid.UUID `gorm:"type:uuid;" json:"user_id,omitempty"` S3Url string `gorm:"type:text;not null;" json:"s3_url,omitempty"` IsQrUsed *time.Time `gorm:"nullable" json:"is_qr_used,omitempty"` }
func CreateQrCode ¶
func CreateQrCode(tx *gorm.DB, req *CreateQrCodeRequest) (QrCodes, error)
type Transaction ¶
type Transaction struct { ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"ID,omitempty"` ProductID uuid.UUID `gorm:"type:uuid;" json:"product_id,omitempty"` UserID uuid.UUID `gorm:"type:uuid;" json:"user_id,omitempty"` Amount float64 `gorm:"type:float;" json:"amount,omitempty"` StripePaymentIntentID string `json:"stripe_payment_intent_id,omitempty"` StripePaymentIntentClientSecret string `json:"stripe_payment_intent_client_secret,omitempty"` }
func CreateTransaction ¶
func CreateTransaction(tx *gorm.DB, req *CreateTransactionRequest) (Transaction, error)
func GetTransactionByID ¶
func GetTransactionByStripePaymentIntentID ¶
func GetTransactionByStripePaymentIntentID(tx *gorm.DB, id string) (Transaction, error)
func GetTransactions ¶
func GetTransactions(tx *gorm.DB) ([]Transaction, error)
type User ¶
type User struct { ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"ID,omitempty"` FirstName string `gorm:"type:varchar(255); not null;" json:"first_name,omitempty"` LastName string `gorm:"type:varchar(255); not null;" json:"last_name,omitempty"` Email string `gorm:"type:varchar(255); unique; not null;" json:"email,omitempty"` ZipCode string `gorm:"type:varchar(255); not null;" json:"zip_code,omitempty"` PhoneNumber string `gorm:"type:varchar(255)" json:"phone_number,omitempty"` IsJoinBeta *time.Time `gorm:"nullable" json:"is_join_beta,omitempty"` IsUnsubscribed *time.Time `gorm:"nullable" json:"is_join_beta,omitempty"` }
func CreateUser ¶
func CreateUser(tx *gorm.DB, req *CreateUserRequest) (User, error)
Click to show internal directories.
Click to hide internal directories.