database

package
v0.0.0-...-f9c177b Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateCar

func UpdateCar(ctx context.Context, updateCarInfo UpdateCarInfo) bool

func UpdateDealer

func UpdateDealer(ctx context.Context, updateDealerInfo UpdateDealerInfo)

Types

type Car

type Car struct {
	Id               string   `bson:"_id"`
	Year             int      `bson:"year"`
	Title            string   `bson:"title"`
	Trim             string   `bson:"trim"`
	InteriorColor    string   `bson:"interiorColor"`
	ExteriorColor    string   `bson:"exteriorColor"`
	Mileage          int      `bson:"mileage"`
	LicensePlate     string   `bson:"licensePlate"`
	Pictures         []string `bson:"pictures"`
	MainPicture      string   `bson:"mainPicture"`
	Currency         string   `bson:"currency"`
	Price            int      `bson:"price"`
	Url              string   `bson:"url"`
	DealerId         string   `bson:"dealerId"`
	PicturesUploaded bool     `bson:"picturesUploaded"`
	Spot             string   `bson:"spot"`
	ExteriorPictures []string `bson:"exteriorPictures"`
	InteriorPictures []string `bson:"interiorPictures"`
	Model            string   `bson:"model"`
	Brand            string   `bson:"brand"`
	ModelSlug        string   `bson:"modelSlug"`
	TrimName         string   `bson:"trimName"`
	BodyStyleId      string   `bson:"bodyStyleId"`
	FuelTypeId       string   `bson:"fueltypeId"`
	TransmissionId   string   `bson:"transmissionId"`
	DriveTrainId     string   `bson:"driveTrainId"`
	BrandId          string   `bson:"brandId"`
	ModelId          string   `bson:"modelId"`
}

func BaseGetCars

func BaseGetCars(ctx context.Context, filter Filter) []Car

func GetCars

func GetCars(ctx context.Context) []Car

func GetCarsForModelMatchLayer

func GetCarsForModelMatchLayer(ctx context.Context, layer int) []Car

func GetCarsWithPublishDealers

func GetCarsWithPublishDealers(ctx context.Context) []Car

type Dealer

type Dealer struct {
	Id                       string  `bson:"_id"`
	Name                     string  `bson:"name"`
	Slug                     string  `bson:"slug"`
	Address                  string  `bson:"address"`
	Latitude                 float64 `bson:"latitude"`
	Longitude                float64 `bson:"longitude"`
	TelephoneNumberSanitized string  `bson:"telephoneNumberSanitized"`
	City                     string  `bson:"city"`
	Spot                     string  `bson:"spot"`
	Uploaded                 bool    `bson:"uploaded"`
	Dealer                   string  `bson:"dealer"`
}

func GetDealers

func GetDealers(ctx context.Context) []Dealer

type Feature

type Feature struct {
	Id   string `bson:"id"`
	Name string `bson:"name"`
	Slug string `bson:"slug"`
}

func GetFeatures

func GetFeatures(ctx context.Context) []Feature

type Filter

type Filter struct {
	Match bson.M `bson:"$match"`
}

type UpdateCarInfo

type UpdateCarInfo struct {
	Car Car    `bson:"car"`
	Set bson.M `bson:"$set"`
}

type UpdateDealerInfo

type UpdateDealerInfo struct {
	Id  string `bson:"_id"`
	Set bson.M `bson:"$set"`
}

Jump to

Keyboard shortcuts

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