dto

package
v0.0.0-...-f26ca9b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package dto is the package that defines types for data transfer

Package dto is the package that defines types for data transfer

Package dto is the package that defines types for data transfer

Package dto is the package that defines types for data transfer

Package dto is the package that defines types for data transfer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddConversationRequest

type AddConversationRequest struct {
	TripID   string `json:"tripId" validate:"required"`
	Message  string `json:"message" validate:"required"`
	Capacity int    `json:"capacity" validate:"required"`
}

AddConversationRequest is the request object for adding a message

type AddMessageRequest

type AddMessageRequest struct {
	Text string `json:"text" validate:"required"`
}

AddMessageRequest is the request object for adding a message

type AddRequestRequest

type AddRequestRequest struct {
	CountryID      string   `json:"countryid" validate:"required"`
	Origin         string   `json:"origin" validate:"required"`
	Destination    string   `json:"destination" validate:"required"`
	RequestedSeats int      `json:"requestedseats" validate:"required"`
	Dates          []string `json:"dates" validate:"required"`
}

AddRequestRequest is the request object for adding a request

type AddTripRequest

type AddTripRequest struct {
	CountryID      string   `json:"countryid" validate:"required"`
	Origin         string   `json:"origin" validate:"required"`
	Destination    string   `json:"destination" validate:"required"`
	Stops          []string `json:"stops"`
	TripDate       string   `json:"tripdate" validate:"required"`
	AvailableSeats int      `json:"availableseats" validate:"required"`
	Note           string   `json:"note"`
}

AddTripRequest is the request object for adding a trip

type AddUserRequest

type AddUserRequest struct {
	Name     string `json:"name" validate:"required"`
	Password string `json:"password" validate:"required"`
	Email    string `json:"email" validate:"required,email"`
	Phone    string `json:"phone" validate:"required,e164"`
}

AddUserRequest type defines a model for adding an user

type CityDTO

type CityDTO struct {
	Name string `json:"name"`
}

CityDTO is the response object for a city

type ConfirmUserRequest

type ConfirmUserRequest struct {
	Code string `json:"code" validate:"required"`
}

ConfirmUserRequest type defines a model for accepting a confirmation code for a user

type ContactDetails

type ContactDetails struct {
	Email string `json:"email"`
	Phone string `json:"phone"`
}

ContactDetails is the response object for contact details

type ConversationResponse

type ConversationResponse struct {
	ConversationID    string            `json:"conversationid"`
	ViewPointOf       string            `json:"viewpointof"`
	RequesterName     string            `json:"requestername"`
	RequesterApproved bool              `json:"requesterapproved"`
	SupplierApproved  bool              `json:"supplierapproved"`
	RequestedCapacity int               `json:"requestedcapacity"`
	RequesterContact  ContactDetails    `json:"requestercontact,omitempty"`
	SupplierContact   ContactDetails    `json:"suppliercontact,omitempty"`
	Messages          []MessageResponse `json:"messages"`
}

ConversationResponse is the response object for a conversation

type CountryDTO

type CountryDTO struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Cities       []CityDTO `json:"cities"`
	BallotCities []CityDTO `json:"ballotCities"`
}

CountryDTO is the response object for a country

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required"`
}

LoginRequest type defines a model for getting an user's data for login operation

type LongUserResponse

type LongUserResponse struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
	Phone string `json:"phone"`
}

LongUserResponse type defines a model for returning a user shy including its personal details

type MessageResponse

type MessageResponse struct {
	Direction string    `json:"direction"`
	Date      time.Time `json:"date"`
	Text      string    `json:"text"`
	Read      bool      `json:"read"`
}

MessageResponse is the response object for a message

type RequestListResponse

type RequestListResponse struct {
	ID             string   `json:"id"`
	Origin         string   `json:"origin"`
	Destination    string   `json:"destination"`
	RequestedSeats int      `json:"requestedseats"`
	Dates          []string `json:"dates"`
	State          string
}

RequestListResponse is the response object for a list of requests, which lacks some fields

type RequestResponse

type RequestResponse struct {
	ID             string   `json:"id"`
	RequesterID    string   `json:"requesterid"`
	RequesterName  string   `json:"requestername"`
	CountryID      string   `json:"countryid"`
	Origin         string   `json:"origin"`
	Destination    string   `json:"destination"`
	RequestedSeats int      `json:"requestedseats"`
	Dates          []string `json:"dates"`
	State          string   `json:"state"`
}

RequestResponse is the response object for a request in full

type ShortUserResponse

type ShortUserResponse struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ShortUserResponse type defines a model for returning a user shy of its personal details

type TripDetailResponse

type TripDetailResponse struct {
	ID             string                 `json:"id"`
	SupplierName   string                 `json:"suppliername"`
	Country        string                 `json:"country"`
	Origin         string                 `json:"origin"`
	Destination    string                 `json:"destination"`
	Stops          []string               `json:"stops"`
	TripDate       time.Time              `json:"tripdate"`
	AvailableSeats int                    `json:"availableseats"`
	Note           string                 `json:"note"`
	Conversation   []ConversationResponse `json:"conversation,omitempty"`
}

TripDetailResponse is the response object for a trip in full

type TripListItem

type TripListItem struct {
	ID             string    `json:"id"`
	Origin         string    `json:"origin"`
	Destination    string    `json:"destination"`
	TripDate       time.Time `json:"tripdate"`
	AvailableSeats int       `json:"availableseats"`
}

TripListItem is the response object for a trip, which lacks some fields

type UpdateApprovalRequest

type UpdateApprovalRequest struct {
	Approved *bool `json:"approved" validate:"required"`
}

UpdateApprovalRequest is the request object for updating the approval status

type UpdateUserRequest

type UpdateUserRequest struct {
	ID       string `json:"id" validate:"required"`
	Name     string `json:"name" validate:"required"`
	Password string `json:"password" validate:"required"`
}

UpdateUserRequest type defines a model for updating an user

Jump to

Keyboard shortcuts

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