domain

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: 2 Imported by: 0

Documentation

Overview

Package domain is the package that holds the very basic domain objects

Package domain is the package that holds the very basic domain objects

Package domain is the package that holds the very basic domain objects

Package domain is the package that holds the very basic domain objects

Package domain is the package that holds the very basic domain objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

type City struct {
	Name   string
	Ballot bool
}

City is the domain object for a city

type ContactDetails

type ContactDetails struct {
	Email string
	Phone string
}

ContactDetails is the domain object for contact details

type Conversation

type Conversation struct {
	TripID            string
	RequestID         string
	ConversationID    string
	RequesterID       string
	RequesterName     string
	SupplierID        string
	SupplierName      string
	RequestedCapacity int
	RequesterApproved bool
	SupplierApproved  bool
	RequesterContact  ContactDetails
	SupplierContact   ContactDetails
	Messages          []Message
}

Conversation is the domain object for a conversation

type Country

type Country struct {
	ID           string
	Name         string
	Cities       []City
	BallotCities []City
}

Country is the domain object for a country

type Message

type Message struct {
	Direction string
	Date      time.Time
	Text      string
	Read      bool
}

Message is the domain object for a message

type Request

type Request struct {
	ID             string
	RequesterID    string
	RequesterName  string
	CountryID      string
	Origin         string
	Destination    string
	RequestedSeats int
	Dates          []time.Time
	State          RequestState
}

Request is the domain object for a request

type RequestState

type RequestState int

RequestState is the state of a request

const (
	// Requested is the initial state of a request, nothing has been done yet
	Requested RequestState = iota
	// BeingServed is the state of a request when one or more conversations are open
	BeingServed
	// Completed is the state of a request when at least one conversation has been completed
	Completed
)

func (RequestState) String

func (r RequestState) String() string

String returns the string representation of a RequestState

type Trip

type Trip struct {
	ID             string
	SupplierID     string
	CountryID      string
	Origin         string
	Destination    string
	Stops          []string
	TripDate       time.Time
	AvailableSeats int
	Note           string
}

Trip is the domain object for a trip

type TripDetail

type TripDetail struct {
	ID             string
	SupplierID     string
	SupplierName   string
	Country        string
	Origin         string
	Destination    string
	Stops          []string
	TripDate       time.Time
	AvailableSeats int
	Note           string
	Conversations  []Conversation
}

TripDetail is the domain object for a trip with conversations

type User

type User struct {
	ID       string
	Name     string
	Email    string
	Password string
	Phone    string
	Active   bool
	Admin    bool
}

User type defines a user of the domain

Jump to

Keyboard shortcuts

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