Documentation ¶
Overview ¶
Package models contains the required data structures.
Index ¶
- type Address
- type AuthCodeItem
- type AuthCodeRequest
- type AuthCodeRequestDataDao
- type AuthCodeRequestResourceDao
- type AuthCodeRequestResourceLinks
- type AuthCodeRequestResourceResponse
- type AuthCodeResourceLinksDao
- type CreatedByDao
- type DataField
- type DateOfBirth
- type EmailSend
- type Officer
- type OfficerListResponse
- type ResponseResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { POBox string `json:"po_box,omitempty"` Premises string `json:"premises,omitempty"` AddressLine1 string `json:"address_line_1,omitempty"` AddressLine2 string `json:"address_line_2,omitempty"` Locality string `json:"locality,omitempty"` Region string `json:"region,omitempty"` PostalCode string `json:"postal_code,omitempty"` Country string `json:"country,omitempty"` }
Address is the address to which the authcode letter should be posted
type AuthCodeItem ¶
type AuthCodeItem struct { Type string `json:"type"` Email string `json:"email"` CompanyNumber string `json:"company_number"` CompanyName string `json:"company_name"` Address Address `json:"ro_address"` Status string `json:"status"` }
AuthCodeItem is authcode data to be sent to chs-queue-api
type AuthCodeRequest ¶
type AuthCodeRequest struct { CompanyNumber string `json:"company_number" validate:"required"` CreatedBy authentication.AuthUserDetails `json:",omitempty" validate:"required"` OfficerID string `json:"officer_id" validate:"required"` Status string `json:"status"` OfficerUraID string `json:"officer_ura_id"` OfficerForename string `json:"officer_forename"` OfficerSurname string `json:"officer_surname"` }
AuthCodeRequest is the data received when creating a new Auth Code Request.
type AuthCodeRequestDataDao ¶
type AuthCodeRequestDataDao struct { CompanyNumber string `bson:"company_number"` CompanyName string `bson:"company_name"` OfficerID string `bson:"officer_id"` OfficerUraID string `bson:"officer_ura_id"` OfficerForename string `bson:"officer_forename"` OfficerSurname string `bson:"officer_surname"` Status string `bson:"status"` CreatedAt *time.Time `bson:"created_at"` SubmittedAt *time.Time `bson:"submitted_at"` Kind string `bson:"kind"` Etag string `bson:"etag"` CreatedBy CreatedByDao `bson:"created_by"` Type string Links AuthCodeResourceLinksDao `bson:"links"` }
AuthCodeRequestDataDao is the data of an auth code request resource
type AuthCodeRequestResourceDao ¶
type AuthCodeRequestResourceDao struct { ID string `bson:"_id"` Data AuthCodeRequestDataDao `bson:"data"` }
AuthCodeRequestResourceDao is the persisted resource for auth code requests
type AuthCodeRequestResourceLinks ¶
type AuthCodeRequestResourceLinks struct {
Self string `json:"self"`
}
AuthCodeRequestResourceLinks is the links object of the auth code resource
type AuthCodeRequestResourceResponse ¶
type AuthCodeRequestResourceResponse struct { CompanyNumber string `json:"company_number"` CompanyName string `json:"company_name"` UserID string `json:"user_id"` UserEmail string `json:"user_email"` OfficerID string `json:"officer_id"` OfficerUraID string `json:"officer_ura_id"` OfficerName string `json:"officer_name"` Status string `json:"status"` CreatedAt *time.Time `json:"created_at"` SubmittedAt *time.Time `json:"submitted_at"` Etag string `json:"etag"` Kind string `json:"kind"` Links AuthCodeRequestResourceLinks `json:"links"` }
AuthCodeRequestResourceResponse is the entity returned in a successful response to creating an auth code request resource
type AuthCodeResourceLinksDao ¶
type AuthCodeResourceLinksDao struct {
Self string `bson:"self"`
}
AuthCodeResourceLinksDao is the links object of the auth code resource
type CreatedByDao ¶
type CreatedByDao struct { Email string `bson:"user_email"` ID string `bson:"user_id"` Forename string `bson:"forename"` Surname string `bson:"surname"` }
CreatedByDao is the object relating to who created the resource
type DataField ¶
type DataField struct { FilingDescription string `json:"filing_description"` To string `json:"to"` Subject string `json:"subject"` CHSURL string `json:"chs_url"` }
DataField represents the data that will be sent to the email consumer and eventually displayed in the email
type DateOfBirth ¶
DateOfBirth is the Date Of Birth of an officer
type EmailSend ¶
type EmailSend struct { AppID string `avro:"app_id"` MessageID string `avro:"message_id"` MessageType string `avro:"message_type"` Data string `avro:"data"` EmailAddress string `avro:"email_address"` CreatedAt string `avro:"created_at"` }
EmailSend represents the avro schema which can be found in the chs-kafka-schemas repo
type Officer ¶
type Officer struct { ID string `json:"id"` Name string `json:"name"` OfficerRole string `json:"officer_role"` DateOfBirth DateOfBirth `json:"date_of_birth"` AppointedOn string `json:"appointed_on"` Nationality string `json:"nationality"` CountryOfResidence string `json:"country_of_residence"` Occupation string `json:"occupation"` }
Officer is a single officer to be returned
type OfficerListResponse ¶
type OfficerListResponse struct { ItemsPerPage int `json:"items_per_page"` StartIndex int `json:"start_index"` TotalResults int `json:"total_results"` Items []Officer `json:"items"` }
OfficerListResponse is the Officer List to be returned
type ResponseResource ¶
type ResponseResource struct {
Message string `json:"message"`
}
ResponseResource is the object returned in an error case
func NewMessageResponse ¶
func NewMessageResponse(message string) *ResponseResource
NewMessageResponse - convenience function for creating a response resource