Documentation
¶
Index ¶
- Constants
- func ErrorFile() string
- func ErrorLine() int
- type Account
- type AccountContact
- type Address
- type Agent
- type AllocationGroupAgency
- type Aspect
- type Auth
- type Availability
- type Bathrooms
- type Bedrooms
- type Building
- type Carspaces
- type Company
- func (c *Company) AddUser(u *User, permissionlevel int64) error
- func (c *Company) AddUsers(u []*UserAdd) error
- func (c *Company) Delete() error
- func (c *Company) GetAccountsContacts() ([]*Account, []*Contact, error)
- func (c *Company) GetAssignedProjects() ([]*CompanyProject, error)
- func (c *Company) Update() error
- type CompanyProject
- type Contact
- type CreateProspectPayload
- type Deposit
- type Event
- type EventDate
- type ExportListing
- type ExternalArea
- type ExternalID
- type Floor
- type ID
- type InternalArea
- type Listing
- type ListingActivity
- type ListingStatusActivity
- type LotNumber
- type MarketingPlan
- type Name
- type Offer
- type OfferAttachment
- type OpportunityPayload
- type OriginalPrice
- type PermissionGroup
- type Price
- type Project
- type ProjectPayload
- type Prospect
- type ProspectAttachment
- type ProspectBuyer
- type ProspectSolicitor
- type Schedule
- type Session
- func (s *Session) CreateAccount(account *Account) error
- func (s *Session) CreateCompany(company *Company) (*Company, error)
- func (s *Session) CreateContact(c *Contact) error
- func (s *Session) CreateEvent(e *Event) error
- func (s *Session) CreateListing(l *ExportListing) (error, string)
- func (s *Session) CreateOffer(o *Offer) (*Offer, error)
- func (s *Session) CreateProject(p *ProjectPayload) error
- func (s *Session) CreateProspect(payload CreateProspectPayload) (*Prospect, error)
- func (s *Session) CreateUser(u *User) (*User, int, error)
- func (s *Session) CreateUserProject(up *UserProject) error
- func (s *Session) Delete(list []*Account) error
- func (s *Session) GetAccount(id string) (*Account, error)
- func (s *Session) GetActivityByID(l *Listing) (*ListingActivity, error)
- func (s *Session) GetAllAccounts() ([]*Account, error)
- func (s *Session) GetAllActivity() ([]*ListingActivity, error)
- func (s *Session) GetAllCompanies() ([]*Company, error)
- func (s *Session) GetAllEventProspects(eventID string) ([]*Prospect, error)
- func (s *Session) GetAllOffers() ([]*Offer, error)
- func (s *Session) GetAllProjects() ([]*Project, error)
- func (s *Session) GetAllStatusActivity() ([]*ListingStatusActivity, error)
- func (s *Session) GetAllUserCompanies() ([]*UserCompany, error)
- func (s *Session) GetAvailableProspectBuyers() ([]*ProspectBuyer, error)
- func (s *Session) GetCompany(id string) (*Company, error)
- func (s *Session) GetCompanyByExtId(extId string) (*Company, error)
- func (s *Session) GetCompletedOffers() ([]*Offer, error)
- func (s *Session) GetContactByEmail(email string) (*Contact, error)
- func (s *Session) GetContactByID(id string) (*Contact, error)
- func (s *Session) GetContactByName(firstname string, lastname string) (*Contact, error)
- func (s *Session) GetContacts() ([]*Contact, error)
- func (s *Session) GetEOIUsers() ([]*User, error)
- func (s *Session) GetEventByID(id string) (*Event, error)
- func (s *Session) GetEvents() ([]*Event, error)
- func (s *Session) GetListingByExtId(extId string) (*Listing, error)
- func (s *Session) GetListings() ([]*Listing, error)
- func (s *Session) GetOfferByExtID(extId string) (*Offer, error)
- func (s *Session) GetOfferByID(id string) (*Offer, error)
- func (s *Session) GetPendingOffers() ([]*Offer, error)
- func (s *Session) GetProjectByID(id string) (*Project, error)
- func (s *Session) GetProjectByName(name string) (*Project, error)
- func (s *Session) GetProspectBuyers() ([]*ProspectBuyer, error)
- func (s *Session) GetSolicitor() (*ProspectSolicitor, error)
- func (s *Session) GetUserByExtId(extId string) (*User, error)
- func (s *Session) GetUserByID(id string) (*User, error)
- func (s *Session) GetUserProjects() ([]*UserProject, error)
- func (s *Session) GetUsers() ([]*User, error)
- func (s *Session) UpdateListingContractStatus(payload OpportunityPayload, listingId string, prospectId string) (error, string)
- type TotalArea
- type User
- type UserAdd
- type UserCompany
- type UserProject
Constants ¶
const ( // MasterAgent is the admin of this agency MasterAgent = iota // RegularAgent is a regular member of an agency RegularAgent = iota )
const CreateProspectFromContact = prospectEndpoint + "/createFromContact"
const GetCompanyByExtIdEndpoint = companyEndpoint + "/getByExternalId"
const GetContactByEmailEndpoint = contactEndpoint + "/getbyemail"
const GetListingByExtIdEndpoint = listingEndpoint + "/getByExternalId"
const GetOfferByExtIdEndpoint = offerEndpoint + "/getByExternalId"
const GetUserByExtIdEndpoint = userEndpoint + "/getByExternalId"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"`
Phone string `json:"phone"`
Mobile string `json:"mobile"`
Email string `json:"email"`
Name string `json:"accountname"`
Type string `json:"accounttype"`
Industry string `json:"industry"`
Website string `json:"website"`
AddressID string `json:"addressid"`
Address Address `json:"address"`
ReferralCode string `json:"referralcode"`
OwnerID string `json:"ownerid"`
Owner Company `json:"owner"`
AgentID string `json:"agentid"`
Agent Agent `json:"agent"`
Notes string `json:"notes"`
AccountContacts []AccountContact `json:"accountcontacts"`
S Session `json:"S"`
}
func (*Account) GetOwnedContacts ¶
func (a *Account) GetOwnedContacts() ([]*AccountContact, error)
GetOwnedContacts GETs a list of AccountContacts that belong to the Account, using their ID
func (*Account) GetOwnedDeposits ¶
GetAccountDeposits GETs a list of all DepositResponses belonging to the Account, using their ID
type AccountContact ¶
type Address ¶
type Address struct {
ID string `json:"id"`
AddressLine1 string `json:"address_line_1"`
AddressLine2 string `json:"address_line_2"`
City string `json:"city"`
Country string `json:"country"`
Postcode string `json:"postcode"`
State string `json:"state"`
}
Address holds any address information
type Agent ¶
type Agent struct {
ID string `json:"id"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
Active bool `json:"active"`
Superuser bool `json:"superuser"`
LastLoggedIn string `json:"lastloggedin"`
CreatedDate string `json:"createddate"`
ArchivedOn string `json:"archivedon"`
}
Agent 'User' holds the agent details
type AllocationGroupAgency ¶
AllocationGroupAgency holds information about a AllocationGroupAgency
type Availability ¶
type Availability struct {
String string `json:"string"`
}
type Carspaces ¶
type Carspaces struct {
String string `json:"string"`
}
type Study struct {
String string `json:"string"`
}
type Company ¶
type Company struct {
ID string `json:"id"`
Name string `json:"name"`
Active bool `json:"active"`
StripeAccountID string `json:"stripeaccountid"`
CreatedByID string `json:"createdbyid"`
CreatedDate string `json:"createddate"`
CreatedBy Agent `json:"createdby"`
Projects []Project `json:"projects"`
UserCompanies []UserCompany `json:"usercompanies"`
Events []Event `json:"events"`
ExternalID string `json:"externalid"`
S Session `json:"S"`
}
Company holds information about companies
func (*Company) GetAccountsContacts ¶
GetCompanyAccountsContacts GETs all existing accounts and contacts for this company
func (*Company) GetAssignedProjects ¶
func (c *Company) GetAssignedProjects() ([]*CompanyProject, error)
type CompanyProject ¶
type Contact ¶
type Contact struct {
ID string `json:"id"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Mobile string `json:"mobile"`
Phone string `json:"phone"`
Email string `json:"email"`
DOB string `json:"dob"`
Nationality string `json:"nationality"`
HasDeposit bool `json:"hasdeposit"`
AddressID string `json:"addressid"`
Address Address `json:"address"`
AgentID string `json:"agentid"`
ManageByID string `json:"managebyid"`
OwnerID string `json:"ownerid"`
FIRB int `json:"firb"`
ExternalID string `json:"externalid"`
// contains filtered or unexported fields
}
Contact holds information of a contact
type CreateProspectPayload ¶
type Deposit ¶
type Deposit struct {
ID string
CompanyID string
ProjectID string
AccountID string
ProspectID string
ProspectBuyerID string
Amount int
DepositType string
DepositStatus string
StripeChargeID string
CreatedDate string
}
Deposit holds the deposit data
type Event ¶
type Event struct {
ID string `json:"id"`
Name string `json:"name"`
CompanyID string `json:"companyid"`
Company Company
ProjectID string `json:"projectid"`
Project Project
Terminals int32 `json:"terminals"`
CreatedDate string `json:"createddate"`
TZInfo string `json:"timezoneinfoid"`
Dates []EventDate
ArchivedOn string `json:"archivedon"`
// contains filtered or unexported fields
}
Event holds information about an event
type ExportListing ¶
type ExportListing struct {
ID ID `json:"id"`
ExternalID ExternalID `json:"externalid"`
Name Name `json:"Name"`
Availability Availability `json:"Sale_Stage__c"`
Floor Floor `json:"ds_rep_level"`
Building Building `json:"Building__r"`
Price Price `json:"ds_live_price"`
OriginalPrice OriginalPrice `json:"Sales_Price__c"`
MarketingPlan MarketingPlan `json:"marketing_plan"`
Bedrooms Bedrooms `json:"Bedrooms__c"`
Bathrooms Bathrooms `json:"Bathrooms__c"`
Carspaces Carspaces `json:"Parking_Allocations__c"`
Aspect Aspect `json:"Aspect__c"`
InternalArea InternalArea `json:"Interior_Space__c"`
ExternalArea ExternalArea `json:"Exterior_Space__c"`
TotalArea TotalArea `json:"Total_Space_M__c"`
LotNumber LotNumber `json:"Lot_Number__c"`
S Session `json:"S"`
}
type ExternalArea ¶
type ExternalArea struct {
Float float32 `json:"float"`
}
type ExternalID ¶
type ExternalID struct {
String string `json:"string"`
}
type InternalArea ¶
type InternalArea struct {
Float float32 `json:"float"`
}
type Listing ¶
type Listing struct {
ID string `json:"id"`
ExternalID string `json:"externalid"`
Name string `json:"listing_name"`
Availability string `json:"availability"`
Floor string `json:"floor"`
Building string `json:"building"`
Price float32 `json:"live_price"`
OriginalPrice float32 `json:"price"`
Bedrooms string `json:"bedrooms"`
Bathrooms string `json:"bathrooms"`
Study string `json:"study"`
Carspaces string `json:"carspaces"`
Aspect string `json:"aspect_orientation"`
MarketingPlan string `json:"marketing_plan"`
InternalArea float32 `json:"internal_area"`
ExternalArea float32 `json:"external_area"`
TotalArea float32 `json:"total_area"`
LotNumber int `json:"Lot_Number__c"`
S Session `json:"S"`
}
type ListingActivity ¶
type ListingActivity struct {
ID string `json:"id"`
Timestamp string `json:"timestamp"`
User string `json:"user"`
ChangedField string `json:"changedfield"`
}
ListingActivity handles the returned JSON listing activity
type ListingStatusActivity ¶
type ListingStatusActivity struct {
ID string `json:"id"`
Timestamp string `json:"timestamp"`
User string `json:"user"`
}
ListingStatusActivity handles the specifically returned JSON listing status activity
type MarketingPlan ¶
type MarketingPlan struct {
String string `json:"string"`
}
type Offer ¶
type Offer struct {
ID string
CompanyID string
Company Company
ProjectID string
Project Project
ListingID string
Listing Listing
AgentID string
Agent Agent
ProspectID string
Prospect Prospect
Attachments []OfferAttachment
TimeOfOffer string
Price string
FundsReceived float64
Status string
OfferStatusChangedDate string
// contains filtered or unexported fields
}
func (*Offer) Cancel ¶
CancelOffer sets an offer's status to cancelled and reverts a listing to available
type OfferAttachment ¶
type OpportunityPayload ¶
type OriginalPrice ¶
type OriginalPrice struct {
Float float32 `json:"float"`
}
type PermissionGroup ¶
type Project ¶
type Project struct {
ID string `json:"id"`
Name string `json:"name"`
CompanyID string `json:"companyid"`
Company Company `json:"omitempty"`
Active bool `json:"active"`
Listings []Listing `json:"omitempty"`
Events []Event `json:"omitempty"`
Offers []Offer `json:"omitempty"`
ExternalID string `json:"externalid"`
S Session `json:"S"`
}
TODO: Not all modelled fields have yet been included Project holds information about a project
func (*Project) AddCompany ¶
AddCompany includes a company in a project
type ProjectPayload ¶
type Prospect ¶
type Prospect struct {
ID string `json:"id"`
//BuyerCode string “
OwnerID string `json:"ownerid"`
Owner Company
CompanyID string `json:"companyid"`
Company Company
ProjectID string `json:"projectid"`
Project Project
AgentID string `json:"agentid"`
Agent Agent
SolicitorID string `json:"solicitorid"`
Solicitor ProspectSolicitor
DateCreated string `json:"DateCreated"`
Buyers []ProspectBuyer
EventID string `json:"eventid"`
SeatCount int `json:"seatcount"`
// ScheduleID string
// Schedule Schedule
WasScheduled bool `json:"wasscheduled"`
HasPaid bool `json:"haspaid"`
//HasArrived string `json:"hasarrived"`
//ArrivalSent bool
//ArrivalTime string
Offers []Offer
Attachments []ProspectAttachment
Deposits []Deposit
// contains filtered or unexported fields
}
Prospect holds the data for a prospect
func (*Prospect) Update ¶
UpdateProspect PUTs updates a prospect with new data, using the prospect object
func (*Prospect) UpdateAgent ¶
UpdateAgent POSTs a newly assigned Agent to the Prospect
func (*Prospect) UpdateSchedule ¶
UpdateSchedule updates the schedules assigned to a prospect
type ProspectAttachment ¶
type ProspectBuyer ¶
type ProspectBuyer struct {
ID string `json:"id"`
Phone string `json:"phone"`
Mobile string `json:"mobile"`
Email string `json:"email"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
DOB string `json:"dob"`
Nationality string `json:"nationality"`
AddressID string `json:"addressid"`
Address Address
ProspectID string `json:"prospectid"`
Prospect Prospect
CompanyID string `json:"company"`
ProjectID string `json:"project"`
FIRB int `json:"firb"`
Primary bool `json:"primary"`
OriginContactUser string `json:"origincontactuser"`
OriginatingContact string `json:"originatingcontact"`
OriginAccountUser string `json:"originaccountuser"`
OriginatingAccount string `json:"originatingaccount"`
}
type ProspectSolicitor ¶
type ProspectSolicitor struct {
ID string `json:"id"`
Phone string `json:"phone"`
Mobile string `json:"mobile"`
Email string `json:"email"`
CompanyName string `json:"company_name"`
FullName string `json:"full_name"`
AddressID string `json:"addressid"`
Address Address
CompanyID string `json:"companyid"`
ProjectID string `json:"projectid"`
// contains filtered or unexported fields
}
func (*ProspectSolicitor) Create ¶
func (ps *ProspectSolicitor) Create() error
Create POSTs new solicitor information to a Prospect
func (*ProspectSolicitor) Update ¶
func (ps *ProspectSolicitor) Update() error
Update PUTs new information to an existing solicitor
type Session ¶
Session holds information about the current session
func (*Session) CreateAccount ¶
CreateAccount POSTs a new Account to the portal
func (*Session) CreateCompany ¶
CreateCompany POSTs a new company to the portal
func (*Session) CreateContact ¶
Create generates a new contact from the supplied data Create should return the contact that was just created.
func (*Session) CreateEvent ¶
CreateEvent POSTs new event data to the endpoint
func (*Session) CreateListing ¶
func (s *Session) CreateListing(l *ExportListing) (error, string)
CreateListing POSTs a new Listing to the portal
func (*Session) CreateOffer ¶
CreateOffer POSTs a new offer and reserves the relevant listing
func (*Session) CreateProject ¶
func (s *Session) CreateProject(p *ProjectPayload) error
func (*Session) CreateProspect ¶
func (s *Session) CreateProspect(payload CreateProspectPayload) (*Prospect, error)
UpdateProspect POSTs updates a prospect with new data, using the prospect object
func (*Session) CreateUser ¶
Create generates a new contact from the supplied data Create should return the user that was just created.
func (*Session) CreateUserProject ¶
func (s *Session) CreateUserProject(up *UserProject) error
func (*Session) GetAccount ¶
GetAccount GETs one account, using their ID
func (*Session) GetActivityByID ¶
func (s *Session) GetActivityByID(l *Listing) (*ListingActivity, error)
GetActivityByID GETs all the activity data for a particular listing (using ID)
func (*Session) GetAllAccounts ¶
GetAllAccounts GETs a list of all accounts
func (*Session) GetAllActivity ¶
func (s *Session) GetAllActivity() ([]*ListingActivity, error)
GetAllActivity GETs all the activity for all portal listings
func (*Session) GetAllCompanies ¶
GetAllCompanies creates the appropriate get request and calls the service function to execute and handle the request
func (*Session) GetAllEventProspects ¶
GetAllEventProspects GETs a list of all prospects for an event
func (*Session) GetAllOffers ¶
GetAllOffers returns a list of Offers -- this won't work yet
func (*Session) GetAllProjects ¶
func (*Session) GetAllStatusActivity ¶
func (s *Session) GetAllStatusActivity() ([]*ListingStatusActivity, error)
GetAllStatusActivity GETs all listing status activity for every portal listing
func (*Session) GetAllUserCompanies ¶
func (s *Session) GetAllUserCompanies() ([]*UserCompany, error)
GetAllCompanies creates the appropriate get request and calls the service function to execute and handle the request
func (*Session) GetAvailableProspectBuyers ¶
func (s *Session) GetAvailableProspectBuyers() ([]*ProspectBuyer, error)
GetAvailableProspectBuyers GETs a list of ProspectBuyers where none of their Offers have been cancelled that belong to the session
func (*Session) GetCompany ¶
GetCompany creates the appropriate get request and calls the service function to execute and handle the request
func (*Session) GetCompanyByExtId ¶
GetCompany creates the appropriate get request and calls the service function to execute and handle the request
func (*Session) GetCompletedOffers ¶
GetCompletedOffers returns a list of offers where status is complete
func (*Session) GetContactByEmail ¶
GetContactByEmail gets the first contact that matches the provided email
func (*Session) GetContactByID ¶
GetContactByID gets a single contact by its ID
func (*Session) GetContactByName ¶
GetContactByName gets the first contact that matches the provided name
func (*Session) GetContacts ¶
GetContacts gets all contacts
func (*Session) GetEventByID ¶
GetEventByID GETs an individual event using the event ID
func (*Session) GetListingByExtId ¶
GetListings returns a slice of all Listing
func (*Session) GetListings ¶
GetListings returns a slice of all Listing
func (*Session) GetOfferByExtID ¶
GetOfferByID returns a single offer given the offer ID
func (*Session) GetOfferByID ¶
GetOfferByID returns a single offer given the offer ID
func (*Session) GetPendingOffers ¶
GetPendingOffers returns a list of offers where status is pending
func (*Session) GetProjectByID ¶
GetProjectByID returns a project qußeried by ID
func (*Session) GetProjectByName ¶
GetProjectByName returns a project queried by name
func (*Session) GetProspectBuyers ¶
func (s *Session) GetProspectBuyers() ([]*ProspectBuyer, error)
GetProspectBuyers GETs a list of ProspectBuyers that belong to the session
func (*Session) GetSolicitor ¶
func (s *Session) GetSolicitor() (*ProspectSolicitor, error)
GetSolicitor GETs a Solicitor
func (*Session) GetUserByExtId ¶
GetUserByID gets a single contact by its ID
func (*Session) GetUserByID ¶
GetUserByID gets a single contact by its ID
func (*Session) GetUserProjects ¶
func (s *Session) GetUserProjects() ([]*UserProject, error)
func (*Session) UpdateListingContractStatus ¶
func (s *Session) UpdateListingContractStatus(payload OpportunityPayload, listingId string, prospectId string) (error, string)
UpdateListingContractStatus POSTs a new opportunity status to the portal
type User ¶
type User struct {
ID string `json:"id"`
Active bool `json:"active"`
SuperUser bool `json:"superuser"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Email string `json:"email"`
Username string `json:"username"`
Password string `json:"password"`
ArchivedOn string `json:"archivedon"`
LastLoggedIn string `json:"lastloggedin"`
CreatedDate string `json:"createddate"`
ExternalID string `json:"externalid"`
S Session `json:"S"`
}
User holds information of a user
func (*User) GetAccountsContacts ¶
func (*User) GetCompanyUsers ¶
func (*User) TriggerPasswordResetEmail ¶
TriggerPasswordResetEmail sends the user a password reset email
type UserCompany ¶
type UserCompany struct {
User User `json:"user, omitempty"`
Company Company `json:"company, omitempty"`
ID string `json:"id"`
UserID string `json:"userid"`
CompanyID string `json:"companyid"`
Role int `json:"role"`
CreatedDate string `json:"createddate"`
}
UserCompany holds information about a UserCompany
type UserProject ¶
type UserProject struct {
ID string `json:"Id"`
User User `json:"user"`
UserID string `json:"userid"`
CompanyID string `json:"companyid"`
Project Project `json:"project"`
ProjectID string `json:"projectid"`
AddedBy User `json:"addedby"`
AddedByID string `json:"addedbyid"`
ManagedBy User `json:"managedby"`
ManagedByID string `json:"managedbyid"`
PermissionGroup PermissionGroup `json:"permissiongroup"`
PermissionGroupID string `json:"permissiongroupid"`
CreatedDate string `json:"createddate"`
S Session `json:"S"`
}
func (*UserProject) DeleteUserProject ¶
func (up *UserProject) DeleteUserProject() error
func (*UserProject) GetAccountsContacts ¶
func (up *UserProject) GetAccountsContacts() ([]*Account, []*Contact, error)
func (*UserProject) Update ¶
func (up *UserProject) Update() (*User, error)
Source Files
¶
- accountcontact.go
- accounts.go
- activity.go
- address.go
- agent.go
- allocationgroupagencies.go
- auth.go
- company.go
- contacts.go
- debug.go
- deposit.go
- event.go
- eventdate.go
- listings.go
- offer.go
- offerattachment.go
- permissiongroup.go
- projects.go
- prospect.go
- prospectattachment.go
- prospectbuyer.go
- prospectsolicitor.go
- requests.go
- schedule.go
- session.go
- usercompany.go
- userproject.go
- users.go