Documentation
¶
Index ¶
- Variables
- func AsignOrderToDriver(order Order, driver Driver)
- func CreateDocument(index *meilisearch.Index, changeEvent bson.M)
- func DeleteDocument(index *meilisearch.Index, changeEvent bson.M)
- func HandleAcceptOrder(data amqp.Delivery)
- func HandleCanceledOrder(data amqp.Delivery)
- func HandleDriverAcceptOrder(data amqp.Delivery)
- func HandleDriverDropOrder(data amqp.Delivery)
- func HandleNewOrder(data amqp.Delivery)
- func HandleOrderAssignment(msg amqp.Delivery)
- func HandleOrderDelivered(data amqp.Delivery)
- func HandleOrderPickuped(data amqp.Delivery)
- func HandleOrderPreparing(data amqp.Delivery)
- func HandleOrderReady(data amqp.Delivery)
- func HandleResetPassword(data amqp.Delivery)
- func HandleVerification(data amqp.Delivery)
- func InitAmqp()
- func InitRedisClient()
- func InitSynchronizer()
- func ProduceMessages(queueName string, body []byte)
- func PublishTopic(topic string, message interface{})
- func RemoveObjectID(objectid string) string
- func RemoveSensitiveFields(data bson.M)
- func ResetPassword(email string)
- func SendEmailNotification(message string, subject string, rec ...string) error
- func SendNotifictionSms(message string, to string) error
- func SendPushNotificationPlatforms(token string, page string, title string, body string) error
- func SendWebsocketNotification(event string, body interface{}, rec string, socket notify.Socket) error
- func UpdateDocument(index *meilisearch.Index, changeEvent bson.M)
- type Customer
- type Device
- type Driver
- type Item
- type Location
- type Merchant
- type Metadata
- type Order
Constants ¶
This section is empty.
Variables ¶
View Source
var Channel *amqp.Channel
View Source
var Ctx = context.Background()
View Source
var Queues map[string]func(amqp.Delivery) = map[string]func(amqp.Delivery){ "new_order": HandleNewOrder, "order_ready": HandleOrderReady, "order_dropped": HandleDriverDropOrder, "order_canceled": HandleCanceledOrder, "order_pickuped": HandleOrderPickuped, "reset_password": HandleResetPassword, "order_preparing": HandleOrderPreparing, "order_delivered": HandleOrderDelivered, "driver_accepted_order": HandleDriverAcceptOrder, "order_ready_assigment": HandleOrderAssignment, "merchant_accpted_order": HandleAcceptOrder, "verification": HandleVerification, }
View Source
var (
RedisClient *redis.Client
)
Functions ¶
func AsignOrderToDriver ¶
func CreateDocument ¶
func CreateDocument(index *meilisearch.Index, changeEvent bson.M)
func DeleteDocument ¶
func DeleteDocument(index *meilisearch.Index, changeEvent bson.M)
func HandleAcceptOrder ¶
func HandleCanceledOrder ¶
func HandleDriverAcceptOrder ¶
func HandleDriverDropOrder ¶
func HandleNewOrder ¶
func HandleOrderAssignment ¶
func HandleOrderDelivered ¶
func HandleOrderPickuped ¶
func HandleOrderPreparing ¶
func HandleOrderReady ¶
func HandleResetPassword ¶
func HandleVerification ¶
func InitRedisClient ¶
func InitRedisClient()
func InitSynchronizer ¶
func InitSynchronizer()
func ProduceMessages ¶
func PublishTopic ¶
func PublishTopic(topic string, message interface{})
publish topic to redis channel
func RemoveObjectID ¶
func RemoveSensitiveFields ¶
func ResetPassword ¶
func ResetPassword(email string)
func SendEmailNotification ¶
func SendNotifictionSms ¶
func UpdateDocument ¶
func UpdateDocument(index *meilisearch.Index, changeEvent bson.M)
Types ¶
type Customer ¶
type Customer struct {
Id string `json:"id,omitempty"`
Email string `json:"email"`
FamilyName string `json:"family_name"`
GivenName string `json:"given_name"`
Address string `json:"address"`
Metadata struct {
WebhookEndpoint string `json:"webhook_endpoint"`
} `json:"metadata"`
Profile string `json:"profile"`
Device Device `json:"device"`
Phone string `json:"phone"`
}
func GetInformationCustomer ¶
type Driver ¶
type Driver struct {
Id string `json:"id"`
GivenName string `json:"given_name"`
Age time.Time `json:"age"`
Metadata struct {
WebhookEndpoint string `json:"webhook_endpoint"`
} `json:"metadata"`
Profile string `json:"profile"`
Device Device `json:"device"`
Location Location `json:"location"`
Status bool `json:"status"`
Vehicle struct {
Model string `json:"model"`
Type string `json:"type" `
Payload float64 `json:"payload"`
} `json:"vehicle"`
Phone string `json:"phone"`
}
func FindBestDriver ¶
driver availability, proximity to the rider, vehicle type or weight or others, and driver ratings // traffic and estimated time of arrival => mongodb
func GetInformationDriver ¶
type Merchant ¶
type Merchant struct {
Id string `json:"id"`
BusinessName string `json:"business_name"`
BusinessPhone string `json:"business_phone"`
Location Location `json:"location"`
Address string `json:"address"`
Metadata struct {
WebhookEndpoint string `json:"webhook_endpoint"`
} `json:"metadata"`
Device Device `json:"-" bson:"device"`
Closed bool `json:"closed"`
}
func GetInformationMer ¶
type Order ¶
type Order struct {
Id string `json:"id,omitempty"`
OrderValue uint `json:"order_value" `
Type string `json:"type" `
Items []Item `json:"items"`
DropOffPhone string `json:"dropoff_phone" `
DropOffExteranlId string `json:"dropoff_external_id" `
DropOffContactName string `json:"dropoff_contact_name" `
DropOffTimeEstimated int `json:"dropoff_time_estimated" `
DropOffAddress string `json:"dropoff_address" `
DroOffLocation Location `json:"dropoff_location" `
DropOffInstruction string `json:"dropoff_instructions" `
Stage string `json:"stage" `
ActionIfUndeliverable string `json:"action_if_undeliverable" `
PickupAddress string `json:"pickup_address" `
PickUpExternalId string `json:"pickup_external_id"`
PickUpName string `json:"pickup_name"`
PickUpPhone string `json:"pickup_phone"`
PickUpLocation Location `json:"pickup_location"`
PickupTime time.Time `json:"pickup_time"`
PickupEstimatedTime int `json:"pickup_estimated_time"`
PickupReferenceTag string `json:"pickup_reference_tag" `
DriverPhone string `json:"driver_phone"`
DriverAllowedVehicles []string `json:"driver_allowed_vehicles" `
DriverExternalId string `json:"driver_external_id"`
Metadata Metadata `json:"metadata" `
CancelReason string `json:"cancel_reason"`
DisplayId string `json:"display_id"`
}
Click to show internal directories.
Click to hide internal directories.