models

package
v0.0.0-...-84b6340 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 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 Admin

type Admin struct {
	ID          primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Username    string             `json:"username" binding:"required"` // unique
	Email       string             `json:"email" binding:"required"`    // unique
	Password    string             `json:"password" binding:"required"`
	FirstName   string             `json:"first_name" bson:"first_name" binding:"required"`
	LastName    string             `json:"last_name" bson:"last_name" binding:"required"`
	Gender      string             `json:"gender"`
	PhoneNumber string             `json:"phoneNumber" bson:"phoneNumber" binding:"required"`
	Image       string             `json:"image"`
	Address     struct {
		Province    string `json:"province"`
		District    string `json:"district"`
		SubDistrict string `json:"subdistrict"`
		PostalCode  string `json:"postalCode"`
		Street      string `json:"street"`
		Building    string `json:"building"`
		HouseNumber string `json:"houseNumber"`
	} `json:"address"`
}

admin model from user collection

type AllMasterDataResponse

type AllMasterDataResponse struct {
	Success bool         `json:"success" example:"true"`
	Count   int          `json:"count" example:"1"`
	Data    []MasterData `json:"data"`
}

type BankAccount

type BankAccount struct {
	BankName          string `json:"bank_name" bson:"bank_name"`
	BankAccountName   string `json:"bank_account_name" bson:"bank_account_name"`
	BankAccountNumber string `json:"bank_account_number" bson:"bank_account_number"`
}

BankAccount model

type Buyer

type Buyer struct {
	ID        primitive.ObjectID `json:"id" bson:"_id"`
	FirstName string             `json:"first_name" bson:"first_name"`
	LastName  string             `json:"last_name" bson:"last_name"`
}

type Comments

type Comments struct {
	User_id primitive.ObjectID `json:"user_id" bson:"user_id"`
	Comment string             `json:"comment" bson:"comment"`
	Time    time.Time          `json:"time" bson:"time"`
}

type ConfirmPaymentResponse

type ConfirmPaymentResponse struct {
	Success bool `json:"success" example:"true"`
	Data    struct {
		TransactionID string `json:"transaction_id" example:"60163b3be1e8712c4e7f35cf"`
	} `json:"data"`
}

type CreatePaymentBody

type CreatePaymentBody struct {
	Price    int    `json:"price" example:"100"`
	SellerID string `json:"seller_id" example:"60163b3be1e8712c4e7f35ce"`
	BuyerID  string `json:"buyer_id" example:"60163b3be1e8712c4e7f35cf"`
	PetID    string `json:"pet_id" example:"60163b3be1e8712c4e7f35cf"`
}

type CreatePaymentResponse

type CreatePaymentResponse struct {
	Success bool `json:"success" example:"true"`
	Data    struct {
		TransactionID string `json:"transaction_id" example:"60163b3be1e8712c4e7f35cf"`
		PaymentID     string `json:"payment_id" example:"123456789"`
	} `json:"data"`
}

type DeletePetResponse

type DeletePetResponse struct {
	Success     bool `json:"success" example:"true"`
	DeleteCount int  `json:"delete_count" example:"1"`
}

type ErrorResponse

type ErrorResponse struct {
	Success bool   `json:"success" example:"false"`
	Error   string `json:"error" example:"some error message"`
}

type MasterData

type MasterData struct {
	Category     string   `json:"category" example:"Dog"`
	SpeciesCount int      `json:"species_count" bson:"species_count" example:"5"`
	Species      []string `json:"species" example:"Golden Retriever,Poodle,Bulldog,Pug,Chihuahua"`
}

type MasterDataCategory

type MasterDataCategory struct {
	Categories []string `json:"categories"`
}

type MasterDataCategoryResponse

type MasterDataCategoryResponse struct {
	Success bool `json:"success" example:"true"`
	Count   int  `json:"count" example:"3"`
	Data    struct {
		Categories []string `json:"categories" example:"Dog,Cat,Bird"`
	} `json:"data"`
}

type MasterDataResponse

type MasterDataResponse struct {
	Success bool       `json:"success" example:"true"`
	Data    MasterData `json:"data"`
}

type Medical_record

type Medical_record struct {
	Medical_id   string `json:"medical_id" bson:"medical_id" example:"123456789"`
	Medical_date string `json:"medical_date" bson:"medical_date" example:"2024-04-08"`
	Description  string `json:"description" example:"Routine checkup"`
}

type OTP

type OTP struct {
	ID        string    `json:"id,omitempty" bson:"_id,omitempty"`
	Email     string    `json:"email" bson:"email" binding:"required"`
	OTP       string    `json:"otp" bson:"otp" binding:"required"`
	CreatedAt time.Time `json:"created_at" bson:"created_at"`
}

OTP model

type OTPResponse

type OTPResponse struct {
	Email string `json:"email" binding:"required"`
	OTP   string `json:"otp" binding:"required"`
}

type PartyReport

type PartyReport struct {
	ID          primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Reporter_id primitive.ObjectID `json:"reporter_id,omitempty" bson:"reporter_id,omitempty"`
	Reportee_id primitive.ObjectID `json:"reportee_id,omitempty" bson:"reportee_id,omitempty"`
	Description string             `json:"description" bson:"description"`
	Is_solved   bool               `json:"is_solved" bson:"is_solved"`
}

type Password

type Password struct {
	Password string `json:"password" binding:"required"`
}

Password model

type PaymentIntent

type PaymentIntent struct {
	ID            string             `json:"payment_id" bson:"payment_id" example:"123456789"`
	TransactionID primitive.ObjectID `json:"transaction_id" bson:"transaction_id" example:"60163b3be1e8712c4e7f35cf"`
	PaymentMethod string             `json:"payment_method" bson:"payment_method" example:"card" enum:"card,promptpay"`
}

type Pet

type Pet struct {
	ID              primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty" example:"60163b3be1e8712c4e7f35cf"`
	Name            string             `json:"name" example:"Fluffy"`
	Age             float32            `json:"age" example:"3.0"`
	Price           int32              `json:"price" example:"500"`
	Is_sold         bool               `json:"is_sold" example:"false"`
	Description     string             `json:"description" example:"A friendly and playful dog"`
	Weight          float64            `json:"weight" example:"25.5"`
	Sex             string             `json:"sex" example:"male"`
	Category        string             `json:"category" example:"Dog"`
	Species         string             `json:"species" example:"Golden Retriever"`
	Behavior        string             `json:"behavior" example:"Friendly"`
	Media           string             `json:"media" example:"https://example.com/fluffy.jpg"`
	Medical_records []Medical_record   `json:"medical_records" bson:"medical_records"`
	Seller_id       primitive.ObjectID `json:"seller_id,omitempty" bson:"seller_id,omitempty" example:"60163b3be1e8712c4e7f35ce"`
}

pet model from pet collection

type PetCard

type PetCard struct {
	ID            primitive.ObjectID `json:"id" bson:"_id" example:"60163b3be1e8712c4e7f35cf"`
	Name          string             `json:"name" example:"Fluffy"`
	Price         int                `json:"price" example:"100"`
	Category      string             `json:"category" example:"Dog"`
	Species       string             `json:"species" example:"Golden Retriever"`
	Media         string             `json:"media" example:"https://example.com/fluffy.jpg"`
	SellerID      primitive.ObjectID `json:"seller_id" bson:"seller_id" example:"60163b3be1e8712c4e7f35ce"`
	SellerName    string             `json:"seller_name" example:"John"`
	SellerSurname string             `json:"seller_surname" example:"Doe"`
}

type PetCardResponse

type PetCardResponse struct {
	Success bool      `json:"success" example:"true"`
	Count   int       `json:"count" example:"1"`
	Data    []PetCard `json:"data"`
}

type PetDetail

type PetDetail struct {
	Name    string  `json:"name"`
	Age     float32 `json:"age"`
	Sex     string  `json:"sex"`
	Species string  `json:"species"`
	Media   string  `json:"media"`
}

type PetRequest

type PetRequest struct {
	Name            string           `json:"name" example:"Fluffy"`
	Age             int32            `json:"age" example:"3"`
	Price           int32            `json:"price" example:"500"`
	Is_sold         bool             `json:"is_sold" example:"false"`
	Description     string           `json:"description" example:"A friendly and playful dog"`
	Weight          float64          `json:"weight" example:"25.5"`
	Sex             string           `json:"sex" example:"male"`
	Category        string           `json:"category" example:"Dog"`
	Species         string           `json:"species" example:"Golden Retriever"`
	Behavior        string           `json:"behavior" example:"Friendly"`
	Media           string           `json:"media" example:"https://example.com/fluffy.jpg"`
	Medical_records []Medical_record `json:"medical_records" bson:"medical_records"`
}

type PetResponse

type PetResponse struct {
	Success bool `json:"success" example:"true"`
	Data    Pet  `json:"data"`
}

type ResetPassword

type ResetPassword struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type Review

type Review struct {
	ID              primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Reviewer_id     primitive.ObjectID `json:"reviewer_id,omitempty" bson:"reviewer_id,omitempty"`
	Reviewee_id     primitive.ObjectID `json:"reviewee_id,omitempty" bson:"reviewee_id,omitempty"`
	Rating_score    float64            `json:"rating_score" bson:"rating_score"`
	Description     string             `json:"description" bson:"description"`
	Comment_records []Comments         `json:"comment_records" bson:"comment_records"`
	Time            time.Time          `json:"time" bson:"time"`
}

type Seller

type Seller struct {
	ID          primitive.ObjectID   `json:"id" bson:"_id"`
	FirstName   string               `json:"first_name" bson:"first_name"`
	LastName    string               `json:"last_name" bson:"last_name"`
	Pets        []primitive.ObjectID `json:"pets"`
	BankAccount BankAccount          `json:"bank_account" bson:"bank_account"`
	License     string               `json:"license" bson:"license"`
	Status      string               `json:"status" bson:"status"`
}

Seller model from seller collection

type SystemReport

type SystemReport struct {
	ID          primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Reporter_id primitive.ObjectID `json:"reporter_id,omitempty" bson:"reporter_id,omitempty"`
	Description string             `json:"description" bson:"description"`
	Is_solved   bool               `json:"is_solved" bson:"is_solved"`
}

type Transaction

type Transaction struct {
	ID            primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	SellerID      primitive.ObjectID `json:"seller_id" bson:"seller_id" binding:"required"`
	PetID         primitive.ObjectID `json:"pet_id" bson:"pet_id" binding:"required"`
	BuyerID       primitive.ObjectID `json:"buyer_id" bson:"buyer_id" binding:"required"`
	PaymentID     string             `json:"payment_id" bson:"payment_id"`
	Price         int64              `json:"price" binding:"required"`
	PaymentMethod string             `json:"payment_method" bson:"payment_method"`
	Status        string             `json:"status"`
	Timestamp     time.Time          `json:"timestamp"`
}

transaction model

type TransactionWithDetails

type TransactionWithDetails struct {
	Transaction
	SellerName string    `json:"seller_name" bson:"seller_name"`
	BuyerName  string    `json:"buyer_name" bson:"buyer_name"`
	PetDetail  PetDetail `json:"pet_detail" bson:"pet_detail"`
}

type User

type User struct {
	// ID represents the unique identifier of a user.
	ID          primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Username    string             `json:"username" binding:"required" validate:"required,min=4,max=20"` // unique
	Email       string             `json:"email" binding:"required" validate:"required,email"`           // unique
	Password    string             `json:"password" binding:"required" validate:"required,min=6"`
	FirstName   string             `json:"first_name" bson:"first_name"`
	LastName    string             `json:"last_name" bson:"last_name"`
	Gender      string             `json:"gender"`
	PhoneNumber string             `json:"phoneNumber" bson:"phoneNumber"`
	Image       string             `json:"image"`
	Role        int32              `json:"role" binding:"required" validate:"required,eq=1|eq=2"`
	License     string             `json:"license,omitempty" bson:"license,omitempty"`
	Address     struct {
		Province    string `json:"province"`
		District    string `json:"district"`
		SubDistrict string `json:"subdistrict"`
		PostalCode  string `json:"postalCode"`
		Street      string `json:"street"`
		Building    string `json:"building"`
		HouseNumber string `json:"houseNumber"`
	} `json:"address"`
}

user model from user collection

Jump to

Keyboard shortcuts

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