api

package
Version: v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: CC0-1.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Certification  = "CER"
	MedicalRelease = "MEL"
	GeneralRelease = "REL"
	CreditRelease  = "FCR"
)

Attachment document types (dervied from e-QIP identifiers)

View Source
const (
	BasicAuthAudience    = "Basic"
	SingleSignOnAudience = "SSO"
)

Audience types used with Javascript Web Tokens.

BasicAuthAudience is used when basic authentication is used. SingleSignOnAudience is used when SAML/OAuth authentication is used.

View Source
const (
	LayoutAddress                             = "Address"
	LayoutBirthPlace                          = "Birthplace"
	LayoutBirthPlaceWithoutCounty             = "Birthplace without County"
	LayoutCountry                             = "Country"
	LayoutUSCityStateInternationalCity        = "US City, State, International city"
	LayoutUSCityStateInternationalCityCountry = "US City, State, International city country"
	LayoutState                               = "State"
	LayoutCityState                           = "City, State"
	LayoutStreetCityCountry                   = "Street, City, Country"
	LayoutCityCountry                         = "City, Country"
	LayoutUSCityStateZipcodeInternationalCity = "US City, State, Zipcode International city"
	LayoutCityStateCountry                    = "City, State, Country"
	LayoutUSAddress                           = "US Address"
	LayoutStreetCity                          = "Street, City"
	LayoutOffense                             = "Offense"
)

Different potential layouts used by the frontend. File: /src/components/Form/Location/Layouts.js

View Source
const (
	// Country elements with CountriesNoUS type
	LayoutBirthPlaceWithoutCountyNoUS = "Birthplace without County CountriesNoUS"
	LayoutBirthPlaceNoUS              = "Birthplace CountriesNoUS"
	// APOFPO elements
	LayoutMilitaryAddress       = "Military Address"
	LayoutPhysicalDomestic      = "PhysicalDomestic"
	LayoutPhysicalInternational = "PhysicalInternational"
)

Special layout flags for e-QIP integration for...

View Source
const (
	AccountLocked                              = "The account is currently locked"
	AccountUpdateError                         = "Not able to update account information"
	BasicAuthNotImplemented                    = "Basic authentication is not implemented"
	BasicAuthAttemptDenied                     = "An attempt for basic authentication was denied"
	BasicAuthError                             = "Failed to decode JSON for basic authentication"
	BasicAuthInvalid                           = "Basic authentication invalid"
	BasicAuthMissingPassword                   = "Basic authentication failed because missing a password"
	BasicAuthMissingUsername                   = "Basic authentication failed because missing a username"
	CORSDenied                                 = "CORS request denied"
	CookieDomainNotSet                         = "Cookie Domain is not set"
	EntityError                                = "Error getting entity data"
	EntitySaveError                            = "Error getting entity data"
	FormDecodingError                          = "Error serializing form"
	HashingFailure                             = "Error calculating hash"
	InvalidJWT                                 = "Invalid JSON web token"
	JWTError                                   = "Failed to generate JSON web token"
	JWTSecretNotSet                            = "JSON web token secret is not set"
	MiddlewareError                            = "Middleware has thrown an error"
	MigrationUnsupported                       = "Database migrations are not automated for Windows. Please manually execute the migrations."
	NoAccount                                  = "Unable to retrieve account"
	NoAuthorizationToken                       = "No authorization token header found"
	NoUsername                                 = "Unable to retrieve account because no username was provided"
	PayloadDeserializeError                    = "Failed to deserialize payload"
	PayloadEmpty                               = "Payload not provided"
	PayloadEntityError                         = "Error converting payload into valid entity"
	PayloadInvalid                             = "Payload is invalid"
	PayloadMissingType                         = "Payload is missing a type"
	PdfError                                   = "Error generating archival signature PDFs"
	RetrievingAccount                          = "Retrieving account"
	SamlNotImplemented                         = "SAML is not implemented"
	SamlAttemptDenied                          = "An attempt for SAML authentication was denied"
	SamlNotEnabled                             = "SAML is not enabled"
	SamlSLONotEnabled                          = "SAML SLO is not enabled"
	SamlFormError                              = "SAML response form value missing"
	SamlIdentifierMissing                      = "SAML attribute identifier missing"
	SamlInvalid                                = "SAML response invalid"
	SamlParseError                             = "Error parsing SAML response"
	SamlRequestError                           = "Error creating SAML authentication request"
	SamlRequestURLError                        = "Error creating SAML authentication request URL"
	SamlVerificationError                      = "Error verifying SAML response"
	SamlSLORequestGeneration                   = "Error generating SAML SLO Request"
	SamlSLOMissingSessionID                    = "Missing Session ID from AuthNResponse. WSO2 may be mis-configured"
	USPSDecodeError                            = "Error decoding USPS geocoding response"
	USPSKnownErrorCode                         = "USPS known error received"
	USPSMissingKey                             = "USPS API key has not been set"
	USPSRequestError                           = "Error executing USPS geocoding request"
	USPSUnknownErrorCode                       = "USPS known error received"
	WarnFailedMigration                        = "Failed to migrate database"
	WebserviceMissingURL                       = "Missing endpoint URL for web service"
	WebserviceMissingKey                       = "Missing private key for web service"
	WebserviceMissingCallerInfoAgencyID        = "Missing Caller Info Agency ID"
	WebserviceMissingCallerInfoAgencySSN       = "Missing Caller Info Agency SSN"
	WebserviceMissingCallerInfoAgencyPseudoSSN = "Missing Caller Info Agency Pseudo SSN"
	WebserviceCannotGenerateInboundXML         = "Unable to generate XML from Form Application Data"
	WebserviceCannotGetApplicationData         = "Unable to retrieve Form Application Data"
	WebserviceMissingAgencyID                  = "Missing Agency ID"
	WebserviceErrorCreatingImportRequest       = "Unable to create import request"
	TransmissionError                          = "Error transmitting package"
	TransmissionStorageError                   = "Failed to store transmission record"
	AttachmentsNotImplemented                  = "Attachments is not implemented"
	AttachmentDenied                           = "An attempt for attachments was denied"
	AttachmentNoFile                           = "No attachment file found in multipart form data"
	AttachmentCopyBufferError                  = "Could not copy file buffer"
	AttachmentNotSaved                         = "Attachment file failed to save in persistent storage"
	AttachmentNotDeleted                       = "Attachment file failed to delete"
	AttachmentNoID                             = "No identifier for attachment provided"
	AttachmentNotFound                         = "Attachment file not found"
	AttachmentSizeMismatch                     = "Attachment file size mismatch"
	AttachmentSizeExceeded                     = "Attachment file size exceeded maximum allowed"
	AttachmentTypeNotAllowed                   = "Attachment file type not allowed"
)

Warning messages

View Source
const (
	BasicAuthValid       = "Basic authentication validated"
	GeneratingPackage    = "Generating package for transmission"
	LoggedOut            = "Logged out"
	PurgeAccountData     = "Purging account data"
	SamlValid            = "SAML authentication validated"
	StartingServer       = "Starting server"
	StartingServerTLS    = "Starting server with HTTPS/TLS"
	StoppingServer       = "Stopping server"
	TransmissionRecorded = "Transmission recorded"
	TransmissionStarted  = "Transmission began"
	TransmissionStopped  = "Transmission ended"
	ValidatingJWT        = "Validating JSON web token"
	CORSIgnored          = "CORS ignoring OPTION method"
	WebRequest           = "Web server request received"
	JWTSecretSet         = "JSON web token secret is set"
	AttachmentSaved      = "Attachment saved"
	AttachmentDeleted    = "Attachment deleted"
	AttachmentDownloaded = "Attachment downloaded"
	CacheHeaders         = "Applying headers for caching"
)

Informative messages

View Source
const (
	// NodeEnv Sets the Node environment to configure the application for a specific uses:
	//
	//  - `test`: used with unit testing and code coverage
	//  - `development`: for use while developing the application
	//  - `staging`: environment for various usability tests prior to releasing to production
	//  - `production`: minify and optimize all possible assets for optimal use
	//
	// Target: Front-end (web)
	// Default: `development`
	// Values: `test` | `development` | `staging` | `production`
	NodeEnv = "NODE_ENV"

	// GolangEnv Sets the Go environment to configure the application for specific uses:
	//
	//  - `test`: used with unit testing and code coverage
	//  - `development`: for use while developing the application
	//  - `staging`: environment for various usability tests prior to releasing to production
	//  - `production`: compiled for production use only minimum required assets (does **not** include test accounts)
	//
	// Target: Back-end (api)
	// Default: `development`
	// Values: `test` | `development` | `staging` | `production`
	GolangEnv = "GOLANG_ENV"

	// LogLevel Log level for the back-end API. The default source for logging will be standard outputs (`stdout` and `stderr`).
	//
	// Target: Back-end (api)
	// Default: `warning`
	// Values: `debug` | `info` | `warning` | `error` | `fatal` | `panic`
	LogLevel = "LOG_LEVEL"

	// LogFile Path to the local file system log file.
	//
	// Logging to file may be used in conjunction with other logging sources.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	LogFile = "LOG_FILE"

	// LogDirectory Path to the local file system log file.
	//
	// Logging to file may be used in conjunction with other logging sources.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	LogDirectory = "LOG_DIRECTORY"

	// LogSyslog Connection string for a `syslog` server such as `udp://logserver:514`. Both TCP and UDP are supported.
	//
	// Logging to `syslog` may be used in conjunction with other logging sources.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	// Values: `{protocol}://{host}:{port}`
	LogSyslog = "LOG_SYSLOG"

	// LogSyslogCert Providing a path to the PEM certificate will convert all `syslog` communication to use TLS. Only TCP + TLS is supported making the connection string `tcp://logserver:514`.
	//
	// Logging to `syslog` may be used in conjunction with other logging sources.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	LogSyslogCert = "LOG_SYSLOG_CERT"

	// SessionTimeout Session timeout in minutes. Periods of inactivity falling outside of the threshold will be considered invalid and are required to be re-authenticated.
	//
	// Target: Back-end (api)
	// Default: `15`
	SessionTimeout = "SESSION_TIMEOUT"

	// APIRedirect Front-end URL for the back-end to redirect responses to. If this value is not set it will redirect to the same server host but on port 80.
	//
	// Target: Back-end (api)
	// Default: `{server_protocol}://{server_host}`
	APIRedirect = "API_REDIRECT"

	// APIBaseURL Back-end URL for the front-end to direct requests to.
	//
	// Target: Front-end (web), Back-end (api)
	// Default: `{server_protocol}://{server_host}:{server_port}/api`
	APIBaseURL = "API_BASE_URL"

	// Port Port to use for back-end API.
	//
	// Target: Back-end (api)
	// Default: `3000`
	Port = "PORT"

	// HashRouting Flag to enable hash routing. This should only be used in scenarios where push state is not an option.
	//
	// Target: Front-end (web)
	// Default: False: *empty*
	// Values: True: `1`, False: *empty*
	HashRouting = "HASH_ROUTING"

	// DbMigrationTarget Target a specific database migration step for example, `20180212130825_account_lock.sql`. By specifying a target then when migrations are ran it will try to step down **or** up until the target is reached. By not providing a value migrations will always attempt to go to the latest version.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	DbMigrationTarget = "DB_MIGRATION_TARGET"

	// DatabaseURI PostgreSQL database connection string. If a value is set do no set other database connection information.
	//
	// Target: Back-end (api)
	// Default: *none*
	// Values: `postgres://{db-username}:{db-password}@{db-host}:5432/{db-name}`
	DatabaseURI = "DATABASE_URI"

	// DatabaseUser PostgreSQL database user name.
	//
	// Target: Back-end (api)
	// Default: `postgres`
	DatabaseUser = "DATABASE_USER"

	// DatabasePassword PostgreSQL database password.
	//
	// Target: Back-end (api)
	// Default: *none*
	DatabasePassword = "DATABASE_PASSWORD"

	// DatabaseName PostgreSQL database instance name.
	//
	// Target: Back-end (api)
	// Default: `postgres`
	DatabaseName = "DATABASE_NAME"

	// DatabaseHost PostgreSQL database host name and port.
	//
	// Target: Back-end (api)
	// Default: `localhost:5432`
	DatabaseHost = "DATABASE_HOST"

	// CORSAllowed Whitelist of address(es) for cross-origin resource sharing (CORS). CORS restricts resources (e.g. fonts, scripts, images) on a web page to be requested from another domain outside of the domain from which it is served.
	//
	// Examples
	//
	// | Type               | Example                            |
	// | ------------------ | ---------------------------------- |
	// | explicit           | http://localhost                   |
	// | multiple           | http://localhost;https://test\.com |
	// | wildcard           | *                                  |
	// | regular expression | https?://localhost                 |
	//
	// Target: Back-end (api)
	// Default: *empty*
	CORSAllowed = "CORS_ALLOWED"

	// FlushStorage Flag to enable flushing of persisted information for an account during the logon process.
	//
	// Target: Back-end (api)
	// Default: False: *empty*
	// Values: True: `1`, False: *empty*
	FlushStorage = "FLUSH_STORAGE"

	// UspsAPIKey United States Postal Service (USPS) API key for address validation.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	UspsAPIKey = "USPS_API_API_KEY"

	// JwtSecret The HS512 algorithm is used to sign each JavaScript Web Token using a secret random key of at least 512-bits. For example, `openssl rand 64 | base64 --wrap=0` generates an appropriate key. If this value is not specified, one will be automatically generated unique to the instance.
	//
	// Target: Back-end (api)
	// Default: *none*
	JwtSecret = "JWT_SECRET"

	// BasicEnabled Flag to enable basic username and password authentication.
	//
	// Target: Front-end (web), Back-end (api)
	// Default: False: *empty*
	// Values: True: `1`, False: *empty*
	BasicEnabled = "BASIC_ENABLED"

	// SamlEnabled Flag to enable SAML authentication.
	//
	// Target: Front-end (web), Back-end (api)
	// Default: False: *empty*
	// Values: True: `1`, False: *empty*
	SamlEnabled = "SAML_ENABLED"

	// SamlSloEnabled Flag to enable SAML single logout.
	//
	// Target: Front-end (web), Back-end (api)
	// Default: False: *empty*
	// Values: True: `1`, False: *empty*
	SamlSloEnabled = "SAML_SLO_ENABLED"

	// SamlPublicCert File path (absolute or relative) to SAML public certificate.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	SamlPublicCert = "SAML_PUBLIC_CERT"

	// SamlPrivateCert File path (absolute or relative) to SAML private certificate.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	SamlPrivateCert = "SAML_PRIVATE_CERT"

	// SamlIdpSsoURL Endpoint to SAML 2.0 Single Sign-On (SSO) identity provider. The client will be redirected to this URL to complete the authentication process. This value will be provided by the IdAM configuration settings.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	SamlIdpSsoURL = "SAML_IDP_SSO_URL"

	// SamlIdpSsoDescURL The identity provider's issuer URL. This value will be provided by the IdAM configuration settings.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	SamlIdpSsoDescURL = "SAML_IDP_SSO_DESC_URL"

	// SamlIdpPublicCert File path (absolute or relative) to identity data provider's public certificate (X.509 PEM) used to verify the authentication response signature. This certificate will be provided by the IdAM solution.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	SamlIdpPublicCert = "SAML_IDP_PUBLIC_CERT"

	// SamlSignRequest Flag to enable signing of SAML 2.0 requests.
	//
	// Target: Back-end (api)
	// Default: False: *empty*
	// Values: True: `1`, False: *empty*
	SamlSignRequest = "SAML_SIGN_REQUEST"

	// SamlVerifyInsecure Flag to allow insecure validation of SAML 2.0 responses.
	//
	// Target: Back-end (api)
	// Default: False: *empty*
	// Values: True: `1`, False: *empty*
	SamlVerifyInsecure = "SAML_VERIFY_INSECURE"

	// SamlConsumerServiceURL Endpoint for assertion consumer service. After authentication is completed the customer will be redirected to this endpoint for local processes to verify and handle the response.
	//
	// Target: Back-end (api)
	// Default: `{API_BASE_URL}/auth/saml/callback`
	SamlConsumerServiceURL = "SAML_CONSUMER_SERVICE_URL"

	// TLSCert File path (absolute or relative) to TLS public certificate (X.509 PEM) certificate for use with the back-end API.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	TLSCert = "TLS_CERT"

	// TLSKey File path (absolute or relative) to TLS private key (X.509 PEM) for use the back-end API.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	TLSKey = "TLS_KEY"

	// WsEnabled Allows requests to be made to the eqip web service.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	WsEnabled = "WS_ENABLED"

	// WsURL The endpoint for the OPM web service used to submit the package for investigation.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	WsURL = "WS_URL"

	// WsKey File path to private certificate key (PKCS#8 DER) used to sign security tokens for the OPM web service.
	//
	// Target: Back-end (api)
	// Default: *not enabled*
	WsKey = "WS_KEY"

	// WsCallerinfoAgencyID Provided by OPM representing the caller's agency.
	//
	// Target: Back-end (api)
	// Default: *empty*
	WsCallerinfoAgencyID = "WS_CALLERINFO_AGENCY_ID"

	// WsCallerinfoAgencyUserSSN Provided by OPM representing the caller's agency user making the web service call. The value **should not** be a valid SSN.
	//
	// Target: Back-end (api)
	// Default: *empty*
	WsCallerinfoAgencyUserSSN = "WS_CALLERINFO_AGENCY_USER_SSN"

	// WsCallerinfoAgencyUserPseudossn Flag representing whether or not the caller has an SSN.
	//
	// Target: Back-end (api)
	// Default: *empty*
	// Values: True: `1`, False: `0`
	WsCallerinfoAgencyUserPseudossn = "WS_CALLERINFO_AGENCY_USER_PSEUDOSSN"

	// WsAgencyID Provided by OPM representing the destination agency.
	//
	// Target: Back-end (api)
	// Default: *empty*
	WsAgencyID = "WS_AGENCY_ID"

	// WsAgencyGroupID Provided by OPM representing the destination agency's group.
	//
	// Target: Back-end (api)
	// Default: *empty*
	WsAgencyGroupID = "WS_AGENCY_GROUP_ID"

	// AttachmentsEnabled Flag representing whether or not attachments are allowed.
	//
	// Target: Front-end (web), Back-end (api)
	// Default: True: `1`
	// Values: True: `1`, False: *empty*
	AttachmentsEnabled = "ATTACHMENTS_ENABLED"

	// FileMaximumSize Is the maximum file size of an attachment allowed in bytes.
	//
	// Target: Front-end (web), Back-end (api)
	// Default: 5000000
	FileMaximumSize = "FILE_MAXIMUM_SIZE"

	// FileTypes Allowed file types of an attachment.
	//
	// Target: Front-end (web), Back-end (api)
	// Default: ".tiff;.png;.pdf"
	FileTypes = "FILE_TYPES"
)

Variables

View Source
var (
	// ErrPasswordDoesNotMatch is an error when a user inputs an invalid password
	ErrPasswordDoesNotMatch = errors.New("Password does not match")

	// ErrAccoundDoesNotExist is an error when a users account does not exist
	ErrAccoundDoesNotExist = errors.New("Account does not exist")

	// ErrDatastoreConnection is an error when a database connection cannot be made
	ErrDatastoreConnection = errors.New("Unable to connect to datastore")
)

Functions

func Application added in v0.5.3

func Application(context DatabaseService, account int, hashable bool) ([]byte, error)

Application returns the application state in JSON format.

func ApplicationData added in v0.5.3

func ApplicationData(context DatabaseService, account int, hashable bool) (map[string]interface{}, error)

ApplicationData returns the entire application in a JSON structure.

func EqipClient added in v1.0.12

func EqipClient(env Settings) (*eqip.Client, error)

EqipClient returns a new eqip.Client, configured with the WS_* environment variables.

func EqipRequest added in v1.0.12

func EqipRequest(env Settings, application map[string]interface{}, xmlContent string) (*eqip.ImportRequest, error)

EqipRequest returns a new eqip.ImportRequest, configured with the WS_* environment variables.

func FormStatus added in v1.0.14

func FormStatus(context DatabaseService, account int, locked bool) ([]byte, error)

FormStatus returns the application metadata.

func GetFormMetadata added in v1.0.14

func GetFormMetadata(context DatabaseService, accountID int) (map[string]string, error)

GetFormMetadata returns the metadata for the form

func Hash added in v0.5.3

func Hash(context DatabaseService, account int) (string, error)

Hash returns the SHA256 hash of the application state in hexadecimal

func IsDatabaseErrorNotFound added in v1.0.14

func IsDatabaseErrorNotFound(err error) bool

IsDatabaseErrorNotFound returns true if the error is a DatabaseErrorNotFound error

func Package added in v0.5.3

func Package(context DatabaseService, xml XMLService, account int, hashable bool) (template.HTML, error)

Package an application for transmitting to cold storage

func PurgeAccountStorage added in v0.5.3

func PurgeAccountStorage(context DatabaseService, account int)

PurgeAccountStorage removes all data associated with an account

Types

type Account added in v0.5.3

type Account struct {
	ID          int
	Username    string
	Firstname   string
	Lastname    string
	Token       string
	TokenUsed   bool
	Email       string
	Locked      bool
	FormType    string `db:"form_type"`
	FormVersion string `db:"form_version"`
}

Account represents a user account

func (*Account) BasicAuthentication added in v0.5.3

func (entity *Account) BasicAuthentication(context DatabaseService, password string) error

BasicAuthentication checks if the username and password are valid and returns the users account

func (*Account) Delete added in v0.5.3

func (entity *Account) Delete(context DatabaseService, account int) (int, error)

Delete the Account entity.

func (*Account) Find added in v0.5.3

func (entity *Account) Find(context DatabaseService) error

Find will search for account by `username` if no identifier is present or by ID if it is.

func (*Account) FormTypeIsKnown added in v1.0.14

func (entity *Account) FormTypeIsKnown() bool

FormTypeIsKnown returns wether the form type and version are known to eApp

func (*Account) Get added in v0.5.3

func (entity *Account) Get(context DatabaseService, account int) (int, error)

Get the Account entity.

func (*Account) GetID added in v0.5.3

func (entity *Account) GetID() int

GetID returns the entity identifier.

func (*Account) Lock added in v0.5.3

func (entity *Account) Lock(context DatabaseService) error

Lock will mark the account in a `locked` status.

func (*Account) Save added in v0.5.3

func (entity *Account) Save(context DatabaseService, account int) (int, error)

Save the Account entity.

func (*Account) SetID added in v0.5.3

func (entity *Account) SetID(id int)

SetID sets the entity identifier.

func (*Account) Unlock added in v0.5.3

func (entity *Account) Unlock(context DatabaseService) error

Unlock will mark the account in an `unlocked` status.

type ArchivalPdf added in v0.5.6

type ArchivalPdf struct {
	Name     string // document type name shown to users (e.g, Certification, Medical Release, etc.)
	Template string // filename of PDF template that will be populated
	Section  string // eApp sub-section where signature information is stored
	DocType  string // document type derived from e-QIP (e.g., CER, MEL, etc.)
}

An ArchivalPdf represents a PDF (Portable Document Format) file that needs to be retained and submitted to e-QIP.

type Attachment added in v0.5.3

type Attachment struct {
	ID          int    `json:"id"`
	AccountID   int    `json:"-"`
	Description string `json:"description"`
	Filename    string `json:"filename"`
	Size        int64  `json:"size"`
	DocType     string `json:"docType"`
	Raw         []byte `json:"-"`
}

Attachment stores information in regards to a file associated with the application.

func (*Attachment) Delete added in v0.5.3

func (entity *Attachment) Delete(context DatabaseService, account int) (int, error)

Delete the attachment.

func (*Attachment) Find added in v0.5.3

func (entity *Attachment) Find(context DatabaseService) error

Find is not used for attachments. Please use the `Get` method.

func (*Attachment) Get added in v0.5.3

func (entity *Attachment) Get(context DatabaseService, account int) (int, error)

Get the attachment.

func (*Attachment) GetID added in v0.5.3

func (entity *Attachment) GetID() int

GetID returns the entity identifier.

func (*Attachment) Marshal added in v0.5.3

func (entity *Attachment) Marshal() Payload

Marshal to payload structure

func (*Attachment) Save added in v0.5.3

func (entity *Attachment) Save(context DatabaseService, account int) (int, error)

Save the attachment.

func (*Attachment) SetID added in v0.5.3

func (entity *Attachment) SetID(id int)

SetID sets the entity identifier.

func (*Attachment) Unmarshal added in v0.5.3

func (entity *Attachment) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Attachment) Valid added in v0.5.3

func (entity *Attachment) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type BasicAuthMembership added in v0.5.3

type BasicAuthMembership struct {
	ID           int
	AccountID    int
	Account      *Account
	PasswordHash string
	Created      time.Time
}

BasicAuthMembership stores basic authentication information for the account.

func (*BasicAuthMembership) Delete added in v0.5.3

func (entity *BasicAuthMembership) Delete(context DatabaseService, account int) (int, error)

Delete the basic membership.

func (*BasicAuthMembership) Find added in v0.5.3

func (entity *BasicAuthMembership) Find(context DatabaseService) error

Find the basic membership.

func (*BasicAuthMembership) Get added in v0.5.3

func (entity *BasicAuthMembership) Get(context DatabaseService, account int) (int, error)

Get the basic membership.

func (*BasicAuthMembership) GetID added in v0.5.3

func (entity *BasicAuthMembership) GetID() int

GetID returns the entity identifier.

func (*BasicAuthMembership) HashPassword added in v0.5.3

func (entity *BasicAuthMembership) HashPassword(password string) error

HashPassword converts a plaintext password and generates a hash and updates the `PasswordHash` value.

func (*BasicAuthMembership) PasswordMatch added in v0.5.3

func (entity *BasicAuthMembership) PasswordMatch(password string) bool

PasswordMatch determines if a plain text password matches its equivalent password hash.

func (*BasicAuthMembership) Save added in v0.5.3

func (entity *BasicAuthMembership) Save(context DatabaseService, account int) (int, error)

Save the basic membership.

func (*BasicAuthMembership) SetID added in v0.5.3

func (entity *BasicAuthMembership) SetID(id int)

SetID sets the entity identifier.

type Benefit added in v0.5.3

type Benefit struct {
	PayloadBegin                         Payload `json:"Began,omitempty" sql:"-"`
	PayloadEnd                           Payload `json:"End,omitempty" sql:"-"`
	PayloadFrequency                     Payload `json:"Frequency,omitempty" sql:"-"`
	PayloadOtherFrequency                Payload `json:"OtherFrequency,omitempty" sql:"-"`
	PayloadOtherFrequencyTypeExplanation Payload `json:"OtherFrequencyTypeExplanation,omitempty" sql:"-"`
	PayloadReceived                      Payload `json:"Received,omitempty" sql:"-"`
	PayloadCountry                       Payload `json:"Country" sql:"-"`
	PayloadValue                         Payload `json:"Value" sql:"-"`
	PayloadValueEstimated                Payload `json:"ValueEstimated" sql:"-"`
	PayloadReason                        Payload `json:"Reason" sql:"-"`
	PayloadObligated                     Payload `json:"Obligated" sql:"-"`
	PayloadObligatedExplanation          Payload `json:"ObligatedExplanation" sql:"-"`

	// Validator specific fields
	Begin                         *DateControl `json:"-"`
	End                           *DateControl `json:"-"`
	Frequency                     *Radio       `json:"-"`
	OtherFrequency                *Textarea    `json:"-"`
	OtherFrequencyTypeExplanation *Textarea    `json:"-"`
	Received                      *DateControl `json:"-"`
	Country                       *Country     `json:"-"`
	Value                         *Number      `json:"-"`
	ValueEstimated                *Checkbox    `json:"-"`
	Reason                        *Textarea    `json:"-"`
	Obligated                     *Branch      `json:"-"`
	ObligatedExplanation          *Textarea    `json:"-"`

	// Persister specific fields
	ID                              int `json:"-"`
	AccountID                       int `json:"-"`
	BeginID                         int `json:"-" pg:",fk:Begin"`
	EndID                           int `json:"-" pg:",fk:End"`
	FrequencyID                     int `json:"-" pg:",fk:Frequency"`
	OtherFrequencyID                int `json:"-" pg:",fk:OtherFrequency"`
	OtherFrequencyTypeExplanationID int `json:"-" pg:",fk:OtherFrequencyTypeExplanation"`
	ReceivedID                      int `json:"-" pg:",fk:Received"`
	CountryID                       int `json:"-" pg:",fk:Country"`
	ValueID                         int `json:"-" pg:",fk:Value"`
	ValueEstimatedID                int `json:"-" pg:",fk:ValueEstimated"`
	ReasonID                        int `json:"-" pg:",fk:Reason"`
	ObligatedID                     int `json:"-" pg:",fk:Obligated"`
	ObligatedExplanationID          int `json:"-" pg:",fk:ObligatedExplanation"`
}

Benefit payload type.

func (*Benefit) Delete added in v0.5.3

func (entity *Benefit) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*Benefit) Find added in v0.5.3

func (entity *Benefit) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*Benefit) Get added in v0.5.3

func (entity *Benefit) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*Benefit) GetID added in v0.5.3

func (entity *Benefit) GetID() int

GetID returns the entity identifier.

func (*Benefit) Marshal added in v0.5.3

func (entity *Benefit) Marshal() Payload

Marshal to payload structure

func (*Benefit) Save added in v0.5.3

func (entity *Benefit) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*Benefit) SetID added in v0.5.3

func (entity *Benefit) SetID(id int)

SetID sets the entity identifier.

func (*Benefit) Unmarshal added in v0.5.3

func (entity *Benefit) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Benefit) Valid added in v0.5.3

func (entity *Benefit) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type Branch added in v0.5.3

type Branch struct {
	ID    int    `json:"-"`
	Value string `json:"value"`
}

Branch is a basic yes/no input.

func (*Branch) Delete added in v0.5.3

func (entity *Branch) Delete(context DatabaseService, account int) (int, error)

Delete the Branch entity.

func (*Branch) Find added in v0.5.3

func (entity *Branch) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*Branch) Get added in v0.5.3

func (entity *Branch) Get(context DatabaseService, account int) (int, error)

Get the Branch entity.

func (*Branch) GetID added in v0.5.3

func (entity *Branch) GetID() int

GetID returns the entity identifier.

func (*Branch) Marshal added in v0.5.3

func (entity *Branch) Marshal() Payload

Marshal to payload structure

func (*Branch) Save added in v0.5.3

func (entity *Branch) Save(context DatabaseService, account int) (int, error)

Save the Branch entity.

func (*Branch) SetID added in v0.5.3

func (entity *Branch) SetID(id int)

SetID sets the entity identifier.

func (*Branch) Unmarshal added in v0.5.3

func (entity *Branch) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Branch) Valid added in v0.5.3

func (entity *Branch) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type Checkbox added in v0.5.3

type Checkbox struct {
	ID      int    `json:"-"`
	Value   string `json:"value"`
	Checked bool   `json:"checked,omitempty"`
}

Checkbox is a basic input.

func (*Checkbox) Delete added in v0.5.3

func (entity *Checkbox) Delete(context DatabaseService, account int) (int, error)

Delete the checkbox from data storage.

func (*Checkbox) Find added in v0.5.3

func (entity *Checkbox) Find(context DatabaseService) error

Find is not used for checkboxes. Please use the `Get` method.

func (*Checkbox) Get added in v0.5.3

func (entity *Checkbox) Get(context DatabaseService, account int) (int, error)

Get the checkbox from data storage.

func (*Checkbox) GetID added in v0.5.3

func (entity *Checkbox) GetID() int

GetID returns the entity identifier.

func (*Checkbox) Marshal added in v0.5.3

func (entity *Checkbox) Marshal() Payload

Marshal to payload structure

func (*Checkbox) Save added in v0.5.3

func (entity *Checkbox) Save(context DatabaseService, account int) (int, error)

Save the checkbox to data storage.

func (*Checkbox) SetID added in v0.5.3

func (entity *Checkbox) SetID(id int)

SetID sets the entity identifier.

func (*Checkbox) Unmarshal added in v0.5.3

func (entity *Checkbox) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Checkbox) Valid added in v0.5.3

func (entity *Checkbox) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type CheckboxGroup added in v0.5.3

type CheckboxGroup struct {
	ID     int      `json:"-"`
	Values []string `json:"values"`
}

CheckboxGroup is a basic input.

func (*CheckboxGroup) Delete added in v0.5.3

func (entity *CheckboxGroup) Delete(context DatabaseService, account int) (int, error)

Delete the checkbox group to data storage.

func (*CheckboxGroup) Find added in v0.5.3

func (entity *CheckboxGroup) Find(context DatabaseService) error

Find is not used for checkbox groups. Please use the `Get` method.

func (*CheckboxGroup) Get added in v0.5.3

func (entity *CheckboxGroup) Get(context DatabaseService, account int) (int, error)

Get the checkbox group to data storage.

func (*CheckboxGroup) GetID added in v0.5.3

func (entity *CheckboxGroup) GetID() int

GetID returns the entity identifier.

func (*CheckboxGroup) Marshal added in v0.5.3

func (entity *CheckboxGroup) Marshal() Payload

Marshal to payload structure

func (*CheckboxGroup) Save added in v0.5.3

func (entity *CheckboxGroup) Save(context DatabaseService, account int) (int, error)

Save the checkbox group to data storage.

func (*CheckboxGroup) SetID added in v0.5.3

func (entity *CheckboxGroup) SetID(id int)

SetID sets the entity identifier.

func (*CheckboxGroup) Unmarshal added in v0.5.3

func (entity *CheckboxGroup) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*CheckboxGroup) Valid added in v0.5.3

func (entity *CheckboxGroup) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type CitizenshipMultiple added in v0.5.3

type CitizenshipMultiple struct {
	PayloadHasMultiple Payload `json:"HasMultiple" sql:"-"`
	PayloadList        Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasMultiple *Branch     `json:"-"`
	List        *Collection `json:"-"`

	// Persister specific fields
	ID            int `json:"-"`
	HasMultipleID int `json:"-" pg:", fk:HasMultiple"`
	ListID        int `json:"-" pg:", fk:List"`
}

CitizenshipMultiple represents the payload for the citizenship multiple section.

func (*CitizenshipMultiple) Delete added in v0.5.3

func (entity *CitizenshipMultiple) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*CitizenshipMultiple) Find added in v0.5.3

func (entity *CitizenshipMultiple) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*CitizenshipMultiple) Get added in v0.5.3

func (entity *CitizenshipMultiple) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*CitizenshipMultiple) GetID added in v0.5.3

func (entity *CitizenshipMultiple) GetID() int

GetID returns the entity identifier.

func (*CitizenshipMultiple) Marshal added in v0.5.3

func (entity *CitizenshipMultiple) Marshal() Payload

Marshal to payload structure

func (*CitizenshipMultiple) Save added in v0.5.3

func (entity *CitizenshipMultiple) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*CitizenshipMultiple) SetID added in v0.5.3

func (entity *CitizenshipMultiple) SetID(id int)

SetID sets the entity identifier.

func (*CitizenshipMultiple) Unmarshal added in v0.5.3

func (entity *CitizenshipMultiple) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*CitizenshipMultiple) Valid added in v0.5.3

func (entity *CitizenshipMultiple) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type CitizenshipPassports added in v0.5.3

type CitizenshipPassports struct {
	PayloadPassports Payload `json:"Passports" sql:"-"`

	// Validator specific fields
	Passports *Collection `json:"-"`

	// Persister specific fields
	ID          int `json:"-"`
	PassportsID int `json:"-" pg:", fk:Passports"`
}

CitizenshipPassports represents the payload for the citizenship passports section.

func (*CitizenshipPassports) Delete added in v0.5.3

func (entity *CitizenshipPassports) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*CitizenshipPassports) Find added in v0.5.3

func (entity *CitizenshipPassports) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*CitizenshipPassports) Get added in v0.5.3

func (entity *CitizenshipPassports) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*CitizenshipPassports) GetID added in v0.5.3

func (entity *CitizenshipPassports) GetID() int

GetID returns the entity identifier.

func (*CitizenshipPassports) Marshal added in v0.5.3

func (entity *CitizenshipPassports) Marshal() Payload

Marshal to payload structure

func (*CitizenshipPassports) Save added in v0.5.3

func (entity *CitizenshipPassports) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*CitizenshipPassports) SetID added in v0.5.3

func (entity *CitizenshipPassports) SetID(id int)

SetID sets the entity identifier.

func (*CitizenshipPassports) Unmarshal added in v0.5.3

func (entity *CitizenshipPassports) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*CitizenshipPassports) Valid added in v0.5.3

func (entity *CitizenshipPassports) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type CitizenshipStatus added in v0.5.3

type CitizenshipStatus struct {
	PayloadCitizenshipStatus           Payload `json:"CitizenshipStatus" sql:"-"`
	PayloadAbroadDocumentation         Payload `json:"AbroadDocumentation" sql:"-"`
	PayloadExplanation                 Payload `json:"Explanation" sql:"-"`
	PayloadDocumentNumber              Payload `json:"DocumentNumber" sql:"-"`
	PayloadDocumentIssued              Payload `json:"DocumentIssued" sql:"-"`
	PayloadDocumentName                Payload `json:"DocumentName" sql:"-"`
	PayloadDocumentExpiration          Payload `json:"DocumentExpiration" sql:"-"`
	PayloadDocumentType                Payload `json:"DocumentType" sql:"-"`
	PayloadPlaceIssued                 Payload `json:"PlaceIssued" sql:"-"`
	PayloadCertificateNumber           Payload `json:"CertificateNumber" sql:"-"`
	PayloadCertificateIssued           Payload `json:"CertificateIssued" sql:"-"`
	PayloadCertificateName             Payload `json:"CertificateName" sql:"-"`
	PayloadCertificateCourtName        Payload `json:"CertificateCourtName" sql:"-"`
	PayloadCertificateCourtAddress     Payload `json:"CertificateCourtAddress" sql:"-"`
	PayloadBornOnMilitaryInstallation  Payload `json:"BornOnMilitaryInstallation" sql:"-"`
	PayloadMilitaryBase                Payload `json:"MilitaryBase" sql:"-"`
	PayloadEntryDate                   Payload `json:"EntryDate" sql:"-"`
	PayloadEntryLocation               Payload `json:"EntryLocation" sql:"-"`
	PayloadPriorCitizenship            Payload `json:"PriorCitizenship" sql:"-"`
	PayloadHasAlienRegistration        Payload `json:"HasAlienRegistration" sql:"-"`
	PayloadAlienRegistrationNumber     Payload `json:"AlienRegistrationNumber" sql:"-"`
	PayloadAlienRegistrationExpiration Payload `json:"AlienRegistrationExpiration" sql:"-"`
	PayloadBasis                       Payload `json:"Basis" sql:"-"`
	PayloadPermanentResidentCardNumber Payload `json:"PermanentResidentCardNumber" sql:"-"`
	PayloadResidenceStatus             Payload `json:"ResidenceStatus" sql:"-"`

	// Validator specific fields
	CitizenshipStatus           *Radio       `json:"-"`
	AbroadDocumentation         *Radio       `json:"-"`
	Explanation                 *Textarea    `json:"-"`
	DocumentNumber              *Text        `json:"-"`
	DocumentIssued              *DateControl `json:"-"`
	DocumentName                *Name        `json:"-"`
	DocumentExpiration          *DateControl `json:"-"`
	DocumentType                *Radio       `json:"-"`
	PlaceIssued                 *Location    `json:"-"`
	CertificateNumber           *Text        `json:"-"`
	CertificateIssued           *DateControl `json:"-"`
	CertificateName             *Name        `json:"-"`
	CertificateCourtName        *Text        `json:"-"`
	CertificateCourtAddress     *Location    `json:"-"`
	BornOnMilitaryInstallation  *Branch      `json:"-"`
	MilitaryBase                *Text        `json:"-"`
	EntryDate                   *DateControl `json:"-"`
	EntryLocation               *Location    `json:"-"`
	PriorCitizenship            *Country     `json:"-"`
	HasAlienRegistration        *Branch      `json:"-"`
	AlienRegistrationNumber     *Text        `json:"-"`
	AlienRegistrationExpiration *DateControl `json:"-"`
	Basis                       *Radio       `json:"-"`
	PermanentResidentCardNumber *Text        `json:"-"`
	ResidenceStatus             *Text        `json:"-"`

	// Persister specific fields
	ID                            int `json:"-"`
	CitizenshipStatusID           int `json:"-" pg:", fk:CitizenshipStatus"`
	AbroadDocumentationID         int `json:"-" pg:", fk:AbroadDocumentation"`
	ExplanationID                 int `json:"-" pg:", fk:Explanation"`
	DocumentNumberID              int `json:"-" pg:", fk:DocumentNumber"`
	DocumentIssuedID              int `json:"-" pg:", fk:DocumentIssued"`
	DocumentNameID                int `json:"-" pg:", fk:DocumentName"`
	DocumentExpirationID          int `json:"-" pg:", fk:DocumentExpiration"`
	DocumentTypeID                int `json:"-" pg:", fk:DocumentType"`
	PlaceIssuedID                 int `json:"-" pg:", fk:PlaceIssued"`
	CertificateNumberID           int `json:"-" pg:", fk:CertificateNumber"`
	CertificateIssuedID           int `json:"-" pg:", fk:CertificateIssued"`
	CertificateNameID             int `json:"-" pg:", fk:CertificateName"`
	CertificateCourtNameID        int `json:"-" pg:", fk:CertificateCourtName"`
	CertificateCourtAddressID     int `json:"-" pg:", fk:CertificateCourtAddress"`
	BornOnMilitaryInstallationID  int `json:"-" pg:", fk:BornOnMilitaryInstallation"`
	MilitaryBaseID                int `json:"-" pg:", fk:MilitaryBase"`
	EntryDateID                   int `json:"-" pg:", fk:EntryDate"`
	EntryLocationID               int `json:"-" pg:", fk:EntryLocation"`
	PriorCitizenshipID            int `json:"-" pg:", fk:PriorCitizenship"`
	HasAlienRegistrationID        int `json:"-" pg:", fk:HasAlienRegistration"`
	AlienRegistrationNumberID     int `json:"-" pg:", fk:AlienRegistrationNumber"`
	AlienRegistrationExpirationID int `json:"-" pg:", fk:AlienRegistrationExpiration"`
	BasisID                       int `json:"-" pg:", fk:Basis"`
	PermanentResidentCardNumberID int `json:"-" pg:", fk:PermanentResidentCardNumber"`
	ResidenceStatusID             int `json:"-" pg:", fk:ResidenceStatus"`
}

CitizenshipStatus represents the payload for the citizenship status section.

func (*CitizenshipStatus) Delete added in v0.5.3

func (entity *CitizenshipStatus) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*CitizenshipStatus) Find added in v0.5.3

func (entity *CitizenshipStatus) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*CitizenshipStatus) Get added in v0.5.3

func (entity *CitizenshipStatus) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*CitizenshipStatus) GetID added in v0.5.3

func (entity *CitizenshipStatus) GetID() int

GetID returns the entity identifier.

func (*CitizenshipStatus) Marshal added in v0.5.3

func (entity *CitizenshipStatus) Marshal() Payload

Marshal to payload structure

func (*CitizenshipStatus) Save added in v0.5.3

func (entity *CitizenshipStatus) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*CitizenshipStatus) SetID added in v0.5.3

func (entity *CitizenshipStatus) SetID(id int)

SetID sets the entity identifier.

func (*CitizenshipStatus) Unmarshal added in v0.5.3

func (entity *CitizenshipStatus) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*CitizenshipStatus) Valid added in v0.5.3

func (entity *CitizenshipStatus) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type CivilUnion added in v0.5.3

type CivilUnion struct {
	PayloadAddress                       Payload `json:"Address" sql:"-"`
	PayloadAddressSeparated              Payload `json:"AddressSeparated" sql:"-"`
	PayloadAddressSeparatedNotApplicable Payload `json:"AddressSeparatedNotApplicable" sql:"-"`
	PayloadAlternateAddress              Payload `json:"AlternateAddress" sql:"-"`
	PayloadBirthPlace                    Payload `json:"BirthPlace" sql:"-"`
	PayloadBirthdate                     Payload `json:"Birthdate" sql:"-"`
	PayloadCitizenship                   Payload `json:"Citizenship" sql:"-"`
	PayloadDateSeparated                 Payload `json:"DateSeparated" sql:"-"`
	PayloadDivorced                      Payload `json:"Divorced" sql:"-"`
	PayloadEmail                         Payload `json:"Email" sql:"-"`
	PayloadEmailNotApplicable            Payload `json:"EmailNotApplicable" sql:"-"`
	PayloadEnteredCivilUnion             Payload `json:"EnteredCivilUnion" sql:"-"`
	PayloadForeignBornDocument           Payload `json:"ForeignBornDocument" sql:"-"`
	PayloadLocation                      Payload `json:"Location" sql:"-"`
	PayloadName                          Payload `json:"Name" sql:"-"`
	PayloadOtherNames                    Payload `json:"OtherNames" sql:"-"`
	PayloadSSN                           Payload `json:"SSN" sql:"-"`
	PayloadSeparated                     Payload `json:"Separated" sql:"-"`
	PayloadTelephone                     Payload `json:"Telephone" sql:"-"`
	PayloadUseCurrentAddress             Payload `json:"UseCurrentAddress" sql:"-"`

	// Validator specific fields
	Address                       *Location            `json:"-"`
	AddressSeparated              *Location            `json:"-"`
	AddressSeparatedNotApplicable *NotApplicable       `json:"-"`
	AlternateAddress              *PhysicalAddress     `json:"-"`
	BirthPlace                    *Location            `json:"-"`
	Birthdate                     *DateControl         `json:"-"`
	Citizenship                   *Country             `json:"-"`
	DateSeparated                 *DateControl         `json:"-"`
	Divorced                      *Branch              `json:"-"`
	Email                         *Email               `json:"-"`
	EmailNotApplicable            *NotApplicable       `json:"-"`
	EnteredCivilUnion             *DateControl         `json:"-"`
	ForeignBornDocument           *ForeignBornDocument `json:"-"`
	Location                      *Location            `json:"-"`
	Name                          *Name                `json:"-"`
	OtherNames                    *Collection          `json:"-"`
	SSN                           *SSN                 `json:"-" sql:"-"`
	Separated                     *Branch              `json:"-"`
	Telephone                     *Telephone           `json:"-"`
	UseCurrentAddress             *NotApplicable       `json:"-"`

	// Persister specific fields
	ID                              int `json:"-" sql:",pk"`
	AccountID                       int `json:"-" sql:",pk"`
	AddressID                       int `json:"-"`
	AddressSeparatedID              int `json:"-"`
	AddressSeparatedNotApplicableID int `json:"-"`
	AlternateAddressID              int `json:"-"`
	BirthPlaceID                    int `json:"-"`
	BirthdateID                     int `json:"-"`
	CitizenshipID                   int `json:"-"`
	DateSeparatedID                 int `json:"-"`
	DivorcedID                      int `json:"-"`
	EmailID                         int `json:"-"`
	EmailNotApplicableID            int `json:"-"`
	EnteredCivilUnionID             int `json:"-"`
	ForeignBornDocumentID           int `json:"-"`
	LocationID                      int `json:"-"`
	NameID                          int `json:"-"`
	OtherNamesID                    int `json:"-"`
	SSNID                           int `json:"-"`
	SeparatedID                     int `json:"-"`
	TelephoneID                     int `json:"-"`
	UseCurrentAddressID             int `json:"-"`
}

CivilUnion is an item of named payloads.

func (*CivilUnion) Delete added in v0.5.3

func (entity *CivilUnion) Delete(context DatabaseService, account int) (int, error)

Delete the CivilUnion entity.

func (*CivilUnion) Find added in v0.5.3

func (entity *CivilUnion) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*CivilUnion) Get added in v0.5.3

func (entity *CivilUnion) Get(context DatabaseService, account int) (int, error)

Get the CivilUnion entity.

func (*CivilUnion) GetID added in v0.5.3

func (entity *CivilUnion) GetID() int

GetID returns the entity identifier.

func (*CivilUnion) Marshal added in v0.5.3

func (entity *CivilUnion) Marshal() Payload

Marshal to payload structure

func (*CivilUnion) Save added in v0.5.3

func (entity *CivilUnion) Save(context DatabaseService, account int) (int, error)

Save the CivilUnion entity.

func (*CivilUnion) SetID added in v0.5.3

func (entity *CivilUnion) SetID(id int)

SetID sets the entity identifier.

func (*CivilUnion) Unmarshal added in v0.5.3

func (entity *CivilUnion) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*CivilUnion) Valid added in v0.5.3

func (entity *CivilUnion) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type ClearanceLevel added in v0.5.3

type ClearanceLevel struct {
	PayloadLevel       Payload `json:"Level" sql:"-"`
	PayloadExplanation Payload `json:"Explanation" sql:"-"`

	// Validator specific fields
	Level       *Radio    `json:"-"`
	Explanation *Textarea `json:"-"`

	// Persister specific fields
	ID            int `json:"-"`
	AccountID     int `json:"-"`
	LevelID       int `json:"-"`
	ExplanationID int `json:"-"`
}

ClearanceLevel is a basic input.

func (*ClearanceLevel) Delete added in v0.5.3

func (entity *ClearanceLevel) Delete(context DatabaseService, account int) (int, error)

Delete the ClearanceLevel entity.

func (*ClearanceLevel) Find added in v0.5.3

func (entity *ClearanceLevel) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*ClearanceLevel) Get added in v0.5.3

func (entity *ClearanceLevel) Get(context DatabaseService, account int) (int, error)

Get the ClearanceLevel entity.

func (*ClearanceLevel) GetID added in v0.5.3

func (entity *ClearanceLevel) GetID() int

GetID returns the entity identifier.

func (*ClearanceLevel) Marshal added in v0.5.3

func (entity *ClearanceLevel) Marshal() Payload

Marshal to payload structure

func (*ClearanceLevel) Save added in v0.5.3

func (entity *ClearanceLevel) Save(context DatabaseService, account int) (int, error)

Save the ClearanceLevel entity.

func (*ClearanceLevel) SetID added in v0.5.3

func (entity *ClearanceLevel) SetID(id int)

SetID sets the entity identifier.

func (*ClearanceLevel) Unmarshal added in v0.5.3

func (entity *ClearanceLevel) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*ClearanceLevel) Valid added in v0.5.3

func (entity *ClearanceLevel) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type CoOwners added in v0.5.3

type CoOwners struct {
	PayloadList Payload `json:"List" sql:"-"`

	// Validator specific fields
	List *Collection `json:"-"`

	// Persister specific fields
	ID        int `json:"-"`
	AccountID int `json:"-"`
	ListID    int `json:"-"`
}

CoOwners payload.

func (*CoOwners) Delete added in v0.5.3

func (entity *CoOwners) Delete(context DatabaseService, account int) (int, error)

Delete the CoOwners entity.

func (*CoOwners) Find added in v0.5.3

func (entity *CoOwners) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*CoOwners) Get added in v0.5.3

func (entity *CoOwners) Get(context DatabaseService, account int) (int, error)

Get the CoOwners entity.

func (*CoOwners) GetID added in v0.5.3

func (entity *CoOwners) GetID() int

GetID returns the entity identifier.

func (*CoOwners) Marshal added in v0.5.3

func (entity *CoOwners) Marshal() Payload

Marshal to payload structure

func (*CoOwners) Save added in v0.5.3

func (entity *CoOwners) Save(context DatabaseService, account int) (int, error)

Save the CoOwners entity.

func (*CoOwners) SetID added in v0.5.3

func (entity *CoOwners) SetID(id int)

SetID sets the entity identifier.

func (*CoOwners) Unmarshal added in v0.5.3

func (entity *CoOwners) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*CoOwners) Valid added in v0.5.3

func (entity *CoOwners) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type Collection added in v0.5.3

type Collection struct {
	PayloadBranch Payload `json:"branch" sql:"-"`

	// Validator specific fields
	Branch *Branch           `json:"-" sql:"-"`
	Items  []*CollectionItem `json:"items" sql:"-"`

	// Persister specific fields
	ID        int `json:"-"`
	AccountID int `json:"-"`
	BranchID  int `json:"-" pg:",fk:Branch"`
}

Collection represents a structure composed of zero or more items.

func (*Collection) Delete added in v0.5.3

func (entity *Collection) Delete(context DatabaseService, account int) (int, error)

Delete the Collection entity.

func (*Collection) Find added in v0.5.3

func (entity *Collection) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*Collection) Get added in v0.5.3

func (entity *Collection) Get(context DatabaseService, account int) (int, error)

Get the Collection entity.

func (*Collection) GetID added in v0.5.3

func (entity *Collection) GetID() int

GetID returns the entity identifier.

func (*Collection) Marshal added in v0.5.3

func (entity *Collection) Marshal() Payload

Marshal to payload structure

func (*Collection) Save added in v0.5.3

func (entity *Collection) Save(context DatabaseService, account int) (int, error)

Save the Collection entity.

func (*Collection) SetID added in v0.5.3

func (entity *Collection) SetID(id int)

SetID sets the entity identifier.

func (*Collection) Unmarshal added in v0.5.3

func (entity *Collection) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Collection) Valid added in v0.5.3

func (entity *Collection) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type CollectionItem added in v0.5.3

type CollectionItem struct {
	Item map[string]json.RawMessage `json:"Item" sql:"-"`

	ID     int    `json:"-" sql:",pk"`
	Index  int    `json:"-" sql:",pk"`
	Name   string `json:"-" sql:",pk"`
	Type   string `json:"-"`
	ItemID int    `json:"-"`
}

CollectionItem is an item of named payloads directly used in a `Collection`.

func (*CollectionItem) Delete added in v0.5.3

func (ci *CollectionItem) Delete(context DatabaseService, account, collectionID, index int) (int, error)

Delete the collection item

func (CollectionItem) Each added in v0.5.3

func (ci CollectionItem) Each(action func(string, string, Entity, error) error) error

Each loops through each entity in the collection item performing a given action

func (*CollectionItem) Find added in v0.5.3

func (ci *CollectionItem) Find(context DatabaseService) error

Find is not used for collection items. Please use the `Get` method.

func (*CollectionItem) Get added in v0.5.3

func (ci *CollectionItem) Get(context DatabaseService, account, collectionID, index int) (int, error)

Get the collection item

func (*CollectionItem) GetID added in v0.5.3

func (ci *CollectionItem) GetID() int

GetID returns the entity identifier.

func (*CollectionItem) Save added in v0.5.3

func (ci *CollectionItem) Save(context DatabaseService, account, collectionID, index int) (int, error)

Save the collection item

func (*CollectionItem) SetID added in v0.5.3

func (ci *CollectionItem) SetID(id int)

SetID sets the entity identifier.

func (*CollectionItem) Valid added in v0.5.3

func (ci *CollectionItem) Valid() (bool, error)

Valid iterates through each named property of an item validating each payload.

type Contacts added in v0.5.3

type Contacts struct {
	PayloadList Payload `json:"List" sql:"-"`

	// Validator specific fields
	List *Collection `json:"-"`

	// Persister specific fields
	ID        int `json:"-"`
	AccountID int `json:"-"`
	ListID    int `json:"-"`
}

Contacts payload.

func (*Contacts) Delete added in v0.5.3

func (entity *Contacts) Delete(context DatabaseService, account int) (int, error)

Delete the Contacts entity.

func (*Contacts) Find added in v0.5.3

func (entity *Contacts) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*Contacts) Get added in v0.5.3

func (entity *Contacts) Get(context DatabaseService, account int) (int, error)

Get the Contacts entity.

func (*Contacts) GetID added in v0.5.3

func (entity *Contacts) GetID() int

GetID returns the entity identifier.

func (*Contacts) Marshal added in v0.5.3

func (entity *Contacts) Marshal() Payload

Marshal to payload structure

func (*Contacts) Save added in v0.5.3

func (entity *Contacts) Save(context DatabaseService, account int) (int, error)

Save the Contacts entity.

func (*Contacts) SetID added in v0.5.3

func (entity *Contacts) SetID(id int)

SetID sets the entity identifier.

func (*Contacts) Unmarshal added in v0.5.3

func (entity *Contacts) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Contacts) Valid added in v0.5.3

func (entity *Contacts) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type Country added in v0.5.3

type Country struct {
	ID       int      `json:"-"`
	Value    []string `json:"value" pg:",array"`
	Comments string   `json:"comments,omitempty"`
}

Country is a basic input.

func (*Country) Delete added in v0.5.3

func (entity *Country) Delete(context DatabaseService, account int) (int, error)

Delete the country from data storage.

func (*Country) Find added in v0.5.3

func (entity *Country) Find(context DatabaseService) error

Find is not used for countries. Please use the `Get` method.

func (*Country) Get added in v0.5.3

func (entity *Country) Get(context DatabaseService, account int) (int, error)

Get the country from data storage.

func (*Country) GetID added in v0.5.3

func (entity *Country) GetID() int

GetID returns the entity identifier.

func (*Country) Marshal added in v0.5.3

func (entity *Country) Marshal() Payload

Marshal to payload structure

func (*Country) Save added in v0.5.3

func (entity *Country) Save(context DatabaseService, account int) (int, error)

Save the country to data storage.

func (*Country) SetID added in v0.5.3

func (entity *Country) SetID(id int)

SetID sets the entity identifier.

func (*Country) Unmarshal added in v0.5.3

func (entity *Country) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Country) Valid added in v0.5.3

func (entity *Country) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type DatabaseErrorNotFound added in v1.0.14

type DatabaseErrorNotFound string

DatabaseErrorNotFound is an error that indicates that the function failed because the seach returned zero results. It is expected to be returned by Select et al.

func (DatabaseErrorNotFound) Error added in v1.0.14

func (d DatabaseErrorNotFound) Error() string

type DatabaseService added in v0.5.3

type DatabaseService interface {
	Configure()
	CheckTable(entity interface{}) error
	Raw(query interface{}, params ...interface{}) error
	Find(query interface{}, callback func(query interface{}))
	FindAll(model interface{}) error
	Where(model interface{}, condition string, params ...interface{}) error
	ColumnsWhere(model interface{}, columns []string, condition string, params ...interface{}) error
	Insert(query ...interface{}) error
	Update(query interface{}) error
	Save(query ...interface{}) error
	Delete(query interface{}) error
	Select(query interface{}) error
	Count(model interface{}, condition string, params ...interface{}) int
	CountExpr(model interface{}, expr string, retval interface{}, condition string, params ...interface{})
	Array(model interface{}, expr string, retval interface{}, condition string, params ...interface{})
}

DatabaseService represents a persisted data storage.

type DateControl added in v0.5.3

type DateControl struct {
	ID        int    `json:"-"`
	Month     string `json:"month"`
	Day       string `json:"day"`
	Year      string `json:"year"`
	Estimated bool   `json:"estimated"`
}

DateControl is a basic input.

func (*DateControl) Date added in v0.5.3

func (entity *DateControl) Date() time.Time

Date is composed from the structure properties

func (*DateControl) Delete added in v0.5.3

func (entity *DateControl) Delete(context DatabaseService, account int) (int, error)

Delete the date control from data storage.

func (*DateControl) Find added in v0.5.3

func (entity *DateControl) Find(context DatabaseService) error

Find is not used for date controls. Please use the `Get` method.

func (*DateControl) Get added in v0.5.3

func (entity *DateControl) Get(context DatabaseService, account int) (int, error)

Get the date control from data storage.

func (*DateControl) GetID added in v0.5.3

func (entity *DateControl) GetID() int

GetID returns the entity identifier.

func (*DateControl) Marshal added in v0.5.3

func (entity *DateControl) Marshal() Payload

Marshal to payload structure

func (*DateControl) Save added in v0.5.3

func (entity *DateControl) Save(context DatabaseService, account int) (int, error)

Save the date control to data storage.

func (*DateControl) SetID added in v0.5.3

func (entity *DateControl) SetID(id int)

SetID sets the entity identifier.

func (*DateControl) Unmarshal added in v0.5.3

func (entity *DateControl) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*DateControl) Valid added in v0.5.3

func (entity *DateControl) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type DateRange added in v0.5.3

type DateRange struct {
	PayloadFrom Payload `json:"from" sql:"-"`
	PayloadTo   Payload `json:"to" sql:"-"`
	Present     bool    `json:"present"`

	// Validator specific fields
	From *DateControl `json:"-"`
	To   *DateControl `json:"-"`

	// Persister specific fields
	ID        int `json:"-"`
	AccountID int `json:"-"`
	FromID    int `json:"-"`
	ToID      int `json:"-"`
}

DateRange is a basic input.

func (*DateRange) Delete added in v0.5.3

func (entity *DateRange) Delete(context DatabaseService, account int) (int, error)

Delete the DateRange entity.

func (*DateRange) Find added in v0.5.3

func (entity *DateRange) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*DateRange) Get added in v0.5.3

func (entity *DateRange) Get(context DatabaseService, account int) (int, error)

Get the DateRange entity.

func (*DateRange) GetID added in v0.5.3

func (entity *DateRange) GetID() int

GetID returns the entity identifier.

func (*DateRange) Marshal added in v0.5.3

func (entity *DateRange) Marshal() Payload

Marshal to payload structure

func (*DateRange) Save added in v0.5.3

func (entity *DateRange) Save(context DatabaseService, account int) (int, error)

Save the DateRange entity.

func (*DateRange) SetID added in v0.5.3

func (entity *DateRange) SetID(id int)

SetID sets the entity identifier.

func (*DateRange) Unmarshal added in v0.5.3

func (entity *DateRange) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*DateRange) Valid added in v0.5.3

func (entity *DateRange) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type Email added in v0.5.3

type Email struct {
	ID    int    `json:"-"`
	Value string `json:"value"`
}

Email is a basic input.

func (*Email) Delete added in v0.5.3

func (entity *Email) Delete(context DatabaseService, account int) (int, error)

Delete the email from data storage.

func (*Email) Find added in v0.5.3

func (entity *Email) Find(context DatabaseService) error

Find is not used for emails. Please use the `Get` method.

func (*Email) Get added in v0.5.3

func (entity *Email) Get(context DatabaseService, account int) (int, error)

Get the email from data storage.

func (*Email) GetID added in v0.5.3

func (entity *Email) GetID() int

GetID returns the entity identifier.

func (*Email) Marshal added in v0.5.3

func (entity *Email) Marshal() Payload

Marshal to payload structure

func (*Email) Save added in v0.5.3

func (entity *Email) Save(context DatabaseService, account int) (int, error)

Save the email to data storage.

func (*Email) SetID added in v0.5.3

func (entity *Email) SetID(id int)

SetID sets the entity identifier.

func (*Email) Unmarshal added in v0.5.3

func (entity *Email) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*Email) Valid added in v0.5.3

func (entity *Email) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type EmploymentActivity added in v0.5.3

type EmploymentActivity struct {
	ID               int    `json:"-"`
	Value            string `json:"value"`
	OtherExplanation string `json:"otherExplanation,omitempty"`
}

EmploymentActivity is a basic input.

func (*EmploymentActivity) Delete added in v0.5.3

func (entity *EmploymentActivity) Delete(context DatabaseService, account int) (int, error)

Delete the employment activity from data storage.

func (*EmploymentActivity) Find added in v0.5.3

func (entity *EmploymentActivity) Find(context DatabaseService) error

Find is not used for employment activities. Please use the `Get` method.

func (*EmploymentActivity) Get added in v0.5.3

func (entity *EmploymentActivity) Get(context DatabaseService, account int) (int, error)

Get the employment activity from data storage.

func (*EmploymentActivity) GetID added in v0.5.3

func (entity *EmploymentActivity) GetID() int

GetID returns the entity identifier.

func (*EmploymentActivity) Marshal added in v0.5.3

func (entity *EmploymentActivity) Marshal() Payload

Marshal to payload structure

func (*EmploymentActivity) Save added in v0.5.3

func (entity *EmploymentActivity) Save(context DatabaseService, account int) (int, error)

Save the employment activity to data storage.

func (*EmploymentActivity) SetID added in v0.5.3

func (entity *EmploymentActivity) SetID(id int)

SetID sets the entity identifier.

func (*EmploymentActivity) Unmarshal added in v0.5.3

func (entity *EmploymentActivity) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*EmploymentActivity) Valid added in v0.5.3

func (entity *EmploymentActivity) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type Entity added in v0.5.3

type Entity interface {
	Identifier
	Marshaller
	Validator
	Persister
	Finder
}

Entity is a structure which can marshall, validate, and persist.

type ErrFieldInvalid added in v0.5.3

type ErrFieldInvalid struct {
	Message string
}

ErrFieldInvalid represents an error for a field with an invalid value.

func (ErrFieldInvalid) Error added in v0.5.3

func (e ErrFieldInvalid) Error() string

Error returns the string representation of a Field Invalid error.

func (ErrFieldInvalid) Result added in v0.5.3

func (e ErrFieldInvalid) Result(fieldname string) interface{}

Result creates a struct that is properly formatted for the client-side validation.

type ErrFieldRequired added in v0.5.3

type ErrFieldRequired struct {
	Message string
}

ErrFieldRequired represents an error for a field that requires data.

func (ErrFieldRequired) Error added in v0.5.3

func (e ErrFieldRequired) Error() string

Error is a basic representation of a Require Field error.

func (ErrFieldRequired) Result added in v0.5.3

func (e ErrFieldRequired) Result(fieldname string) interface{}

Result creates a struct that is properly formatted for the client-side validation.

type ErrInvalidLocation added in v0.5.3

type ErrInvalidLocation struct {
	Message     string
	Suggestions []GeocodeResult
}

ErrInvalidLocation represents an error for location information with additional options.

func (ErrInvalidLocation) Error added in v0.5.3

func (e ErrInvalidLocation) Error() string

Error returns the error message.

func (ErrInvalidLocation) Result added in v0.5.3

func (e ErrInvalidLocation) Result(fieldname string) interface{}

Result creates a struct that is properly formatted for the client-side validation.

type ErrorStack added in v0.5.3

type ErrorStack []ErrorStackResults

ErrorStack contains a list of ErrorStackResults that have been captured.

func NewErrorStack added in v0.5.3

func NewErrorStack(fieldname string, err error) ErrorStack

NewErrorStack creates a new stack of errors for a particular field.

func (*ErrorStack) Append added in v0.5.3

func (stack *ErrorStack) Append(fieldname string, err error)

Append adds an error to the list of errors. For those that implement the ValidationResult interface, the return value for Result(fieldname) will be used to populate the stack. This is to properly format error/validation information that is to be returned to the client-side.

func (ErrorStack) Error added in v0.5.3

func (stack ErrorStack) Error() string

Error is string representation of an ErrorStack and displays the total number of errors. This is to implement the error type.

func (ErrorStack) HasErrors added in v0.5.3

func (stack ErrorStack) HasErrors() bool

HasErrors checks if any errors exist

func (ErrorStack) Result added in v0.5.3

func (stack ErrorStack) Result(fieldname string) interface{}

Result creates a struct that is properly formatted for the client-validation.

type ErrorStackResults added in v0.5.3

type ErrorStackResults interface{}

ErrorStackResults is an interface to be used to represent a collection of interfaces. This currently has no additional methods

type FinancialBankruptcy added in v0.5.3

type FinancialBankruptcy struct {
	PayloadHasBankruptcy Payload `json:"HasBankruptcy" sql:"-"`
	PayloadList          Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasBankruptcy *Branch     `json:"-"`
	List          *Collection `json:"-"`

	// Persister specific fields
	ID              int `json:"-"`
	HasBankruptcyID int `json:"-" pg:", fk:HasBankruptcy"`
	ListID          int `json:"-" pg:", fk:List"`
}

FinancialBankruptcy represents the payload for the financial bankruptcy section.

func (*FinancialBankruptcy) Delete added in v0.5.3

func (entity *FinancialBankruptcy) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*FinancialBankruptcy) Find added in v0.5.3

func (entity *FinancialBankruptcy) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*FinancialBankruptcy) Get added in v0.5.3

func (entity *FinancialBankruptcy) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*FinancialBankruptcy) GetID added in v0.5.3

func (entity *FinancialBankruptcy) GetID() int

GetID returns the entity identifier.

func (*FinancialBankruptcy) Marshal added in v0.5.3

func (entity *FinancialBankruptcy) Marshal() Payload

Marshal to payload structure

func (*FinancialBankruptcy) Save added in v0.5.3

func (entity *FinancialBankruptcy) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*FinancialBankruptcy) SetID added in v0.5.3

func (entity *FinancialBankruptcy) SetID(id int)

SetID sets the entity identifier.

func (*FinancialBankruptcy) Unmarshal added in v0.5.3

func (entity *FinancialBankruptcy) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*FinancialBankruptcy) Valid added in v0.5.3

func (entity *FinancialBankruptcy) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type FinancialCard added in v0.5.3

type FinancialCard struct {
	PayloadHasCardAbuse Payload `json:"HasCardAbuse" sql:"-"`
	PayloadList         Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasCardAbuse *Branch     `json:"-"`
	List         *Collection `json:"-"`

	// Persister specific fields
	ID             int `json:"-"`
	HasCardAbuseID int `json:"-" pg:", fk:HasCardAbuse"`
	ListID         int `json:"-" pg:", fk:List"`
}

FinancialCard represents the payload for the financial card section.

func (*FinancialCard) Delete added in v0.5.3

func (entity *FinancialCard) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*FinancialCard) Find added in v0.5.3

func (entity *FinancialCard) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*FinancialCard) Get added in v0.5.3

func (entity *FinancialCard) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*FinancialCard) GetID added in v0.5.3

func (entity *FinancialCard) GetID() int

GetID returns the entity identifier.

func (*FinancialCard) Marshal added in v0.5.3

func (entity *FinancialCard) Marshal() Payload

Marshal to payload structure

func (*FinancialCard) Save added in v0.5.3

func (entity *FinancialCard) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*FinancialCard) SetID added in v0.5.3

func (entity *FinancialCard) SetID(id int)

SetID sets the entity identifier.

func (*FinancialCard) Unmarshal added in v0.5.3

func (entity *FinancialCard) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*FinancialCard) Valid added in v0.5.3

func (entity *FinancialCard) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type FinancialCredit added in v0.5.3

type FinancialCredit struct {
	PayloadHasCreditCounseling Payload `json:"HasCreditCounseling" sql:"-"`
	PayloadList                Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasCreditCounseling *Branch     `json:"-"`
	List                *Collection `json:"-"`

	// Persister specific fields
	ID                    int `json:"-"`
	HasCreditCounselingID int `json:"-" pg:", fk:HasCreditCounseling"`
	ListID                int `json:"-" pg:", fk:List"`
}

FinancialCredit represents the payload for the financial credit section.

func (*FinancialCredit) Delete added in v0.5.3

func (entity *FinancialCredit) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*FinancialCredit) Find added in v0.5.3

func (entity *FinancialCredit) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*FinancialCredit) Get added in v0.5.3

func (entity *FinancialCredit) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*FinancialCredit) GetID added in v0.5.3

func (entity *FinancialCredit) GetID() int

GetID returns the entity identifier.

func (*FinancialCredit) Marshal added in v0.5.3

func (entity *FinancialCredit) Marshal() Payload

Marshal to payload structure

func (*FinancialCredit) Save added in v0.5.3

func (entity *FinancialCredit) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*FinancialCredit) SetID added in v0.5.3

func (entity *FinancialCredit) SetID(id int)

SetID sets the entity identifier.

func (*FinancialCredit) Unmarshal added in v0.5.3

func (entity *FinancialCredit) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*FinancialCredit) Valid added in v0.5.3

func (entity *FinancialCredit) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type FinancialDelinquent added in v0.5.3

type FinancialDelinquent struct {
	PayloadHasDelinquent Payload `json:"HasDelinquent" sql:"-"`
	PayloadList          Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasDelinquent *Branch     `json:"-"`
	List          *Collection `json:"-"`

	// Persister specific fields
	ID              int `json:"-"`
	HasDelinquentID int `json:"-" pg:", fk:HasDelinquent"`
	ListID          int `json:"-" pg:", fk:List"`
}

FinancialDelinquent represents the payload for the financial delinquent section.

func (*FinancialDelinquent) Delete added in v0.5.3

func (entity *FinancialDelinquent) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*FinancialDelinquent) Find added in v0.5.3

func (entity *FinancialDelinquent) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*FinancialDelinquent) Get added in v0.5.3

func (entity *FinancialDelinquent) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*FinancialDelinquent) GetID added in v0.5.3

func (entity *FinancialDelinquent) GetID() int

GetID returns the entity identifier.

func (*FinancialDelinquent) Marshal added in v0.5.3

func (entity *FinancialDelinquent) Marshal() Payload

Marshal to payload structure

func (*FinancialDelinquent) Save added in v0.5.3

func (entity *FinancialDelinquent) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*FinancialDelinquent) SetID added in v0.5.3

func (entity *FinancialDelinquent) SetID(id int)

SetID sets the entity identifier.

func (*FinancialDelinquent) Unmarshal added in v0.5.3

func (entity *FinancialDelinquent) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*FinancialDelinquent) Valid added in v0.5.3

func (entity *FinancialDelinquent) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type FinancialGambling added in v0.5.3

type FinancialGambling struct {
	PayloadHasGamblingDebt Payload `json:"HasGamblingDebt" sql:"-"`
	PayloadList            Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasGamblingDebt *Branch     `json:"-"`
	List            *Collection `json:"-"`

	// Persister specific fields
	ID                int `json:"-"`
	HasGamblingDebtID int `json:"-" pg:", fk:HasGamblingDebt"`
	ListID            int `json:"-" pg:", fk:List"`
}

FinancialGambling represents the payload for the financial gambling section.

func (*FinancialGambling) Delete added in v0.5.3

func (entity *FinancialGambling) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*FinancialGambling) Find added in v0.5.3

func (entity *FinancialGambling) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*FinancialGambling) Get added in v0.5.3

func (entity *FinancialGambling) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*FinancialGambling) GetID added in v0.5.3

func (entity *FinancialGambling) GetID() int

GetID returns the entity identifier.

func (*FinancialGambling) Marshal added in v0.5.3

func (entity *FinancialGambling) Marshal() Payload

Marshal to payload structure

func (*FinancialGambling) Save added in v0.5.3

func (entity *FinancialGambling) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*FinancialGambling) SetID added in v0.5.3

func (entity *FinancialGambling) SetID(id int)

SetID sets the entity identifier.

func (*FinancialGambling) Unmarshal added in v0.5.3

func (entity *FinancialGambling) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*FinancialGambling) Valid added in v0.5.3

func (entity *FinancialGambling) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type FinancialNonpayment added in v0.5.3

type FinancialNonpayment struct {
	PayloadHasNonpayment Payload `json:"HasNonpayment" sql:"-"`
	PayloadList          Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasNonpayment *Branch     `json:"-"`
	List          *Collection `json:"-"`

	// Persister specific fields
	ID              int `json:"-"`
	HasNonpaymentID int `json:"-" pg:", fk:HasNonpayment"`
	ListID          int `json:"-" pg:", fk:List"`
}

FinancialNonpayment represents the payload for the financial nonpayment section.

func (*FinancialNonpayment) Delete added in v0.5.3

func (entity *FinancialNonpayment) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*FinancialNonpayment) Find added in v0.5.3

func (entity *FinancialNonpayment) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*FinancialNonpayment) Get added in v0.5.3

func (entity *FinancialNonpayment) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*FinancialNonpayment) GetID added in v0.5.3

func (entity *FinancialNonpayment) GetID() int

GetID returns the entity identifier.

func (*FinancialNonpayment) Marshal added in v0.5.3

func (entity *FinancialNonpayment) Marshal() Payload

Marshal to payload structure

func (*FinancialNonpayment) Save added in v0.5.3

func (entity *FinancialNonpayment) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*FinancialNonpayment) SetID added in v0.5.3

func (entity *FinancialNonpayment) SetID(id int)

SetID sets the entity identifier.

func (*FinancialNonpayment) Unmarshal added in v0.5.3

func (entity *FinancialNonpayment) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*FinancialNonpayment) Valid added in v0.5.3

func (entity *FinancialNonpayment) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type FinancialTaxes added in v0.5.3

type FinancialTaxes struct {
	PayloadHasTaxes Payload `json:"HasTaxes" sql:"-"`
	PayloadList     Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasTaxes *Branch     `json:"-"`
	List     *Collection `json:"-"`

	// Persister specific fields
	ID         int `json:"-"`
	HasTaxesID int `json:"-" pg:", fk:HasTaxes"`
	ListID     int `json:"-" pg:", fk:List"`
}

FinancialTaxes represents the payload for the financial taxes section.

func (*FinancialTaxes) Delete added in v0.5.3

func (entity *FinancialTaxes) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*FinancialTaxes) Find added in v0.5.3

func (entity *FinancialTaxes) Find(context DatabaseService) error

Find is not used for attachments. Please use the `Get` method.

func (*FinancialTaxes) Get added in v0.5.3

func (entity *FinancialTaxes) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*FinancialTaxes) GetID added in v0.5.3

func (entity *FinancialTaxes) GetID() int

GetID returns the entity identifier.

func (*FinancialTaxes) Marshal added in v0.5.3

func (entity *FinancialTaxes) Marshal() Payload

Marshal to payload structure

func (*FinancialTaxes) Save added in v0.5.3

func (entity *FinancialTaxes) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*FinancialTaxes) SetID added in v0.5.3

func (entity *FinancialTaxes) SetID(id int)

SetID sets the entity identifier.

func (*FinancialTaxes) Unmarshal added in v0.5.3

func (entity *FinancialTaxes) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*FinancialTaxes) Valid added in v0.5.3

func (entity *FinancialTaxes) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type Finder added in v0.5.3

type Finder interface {
	Find(context DatabaseService) error
}

Finder interface provides common functionality for finding persisted data using properties other than the primary key.

type ForeignActivitiesBenefits added in v0.5.3

type ForeignActivitiesBenefits struct {
	PayloadHasBenefits Payload `json:"HasBenefits" sql:"-"`
	PayloadList        Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasBenefits *Branch     `json:"-"`
	List        *Collection `json:"-"`

	// Persister specific fields
	ID            int `json:"-"`
	HasBenefitsID int `json:"-" pg:", fk:HasBenefits"`
	ListID        int `json:"-" pg:", fk:List"`
}

ForeignActivitiesBenefits represents the payload for the foreign activities benefits section.

func (*ForeignActivitiesBenefits) Delete added in v0.5.3

func (entity *ForeignActivitiesBenefits) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*ForeignActivitiesBenefits) Find added in v0.5.3

func (entity *ForeignActivitiesBenefits) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*ForeignActivitiesBenefits) Get added in v0.5.3

func (entity *ForeignActivitiesBenefits) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*ForeignActivitiesBenefits) GetID added in v0.5.3

func (entity *ForeignActivitiesBenefits) GetID() int

GetID returns the entity identifier.

func (*ForeignActivitiesBenefits) Marshal added in v0.5.3

func (entity *ForeignActivitiesBenefits) Marshal() Payload

Marshal to payload structure

func (*ForeignActivitiesBenefits) Save added in v0.5.3

func (entity *ForeignActivitiesBenefits) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*ForeignActivitiesBenefits) SetID added in v0.5.3

func (entity *ForeignActivitiesBenefits) SetID(id int)

SetID sets the entity identifier.

func (*ForeignActivitiesBenefits) Unmarshal added in v0.5.3

func (entity *ForeignActivitiesBenefits) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*ForeignActivitiesBenefits) Valid added in v0.5.3

func (entity *ForeignActivitiesBenefits) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type ForeignActivitiesDirect added in v0.5.3

type ForeignActivitiesDirect struct {
	PayloadHasInterests Payload `json:"HasInterests" sql:"-"`
	PayloadList         Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasInterests *Branch     `json:"-"`
	List         *Collection `json:"-"`

	// Persister specific fields
	ID             int `json:"-"`
	HasInterestsID int `json:"-" pg:", fk:HasInterests"`
	ListID         int `json:"-" pg:", fk:List"`
}

ForeignActivitiesDirect represents the payload for the foreign activities direct section.

func (*ForeignActivitiesDirect) Delete added in v0.5.3

func (entity *ForeignActivitiesDirect) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*ForeignActivitiesDirect) Find added in v0.5.3

func (entity *ForeignActivitiesDirect) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*ForeignActivitiesDirect) Get added in v0.5.3

func (entity *ForeignActivitiesDirect) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*ForeignActivitiesDirect) GetID added in v0.5.3

func (entity *ForeignActivitiesDirect) GetID() int

GetID returns the entity identifier.

func (*ForeignActivitiesDirect) Marshal added in v0.5.3

func (entity *ForeignActivitiesDirect) Marshal() Payload

Marshal to payload structure

func (*ForeignActivitiesDirect) Save added in v0.5.3

func (entity *ForeignActivitiesDirect) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*ForeignActivitiesDirect) SetID added in v0.5.3

func (entity *ForeignActivitiesDirect) SetID(id int)

SetID sets the entity identifier.

func (*ForeignActivitiesDirect) Unmarshal added in v0.5.3

func (entity *ForeignActivitiesDirect) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*ForeignActivitiesDirect) Valid added in v0.5.3

func (entity *ForeignActivitiesDirect) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type ForeignActivitiesIndirect added in v0.5.3

type ForeignActivitiesIndirect struct {
	PayloadHasInterests Payload `json:"HasInterests" sql:"-"`
	PayloadList         Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasInterests *Branch     `json:"-"`
	List         *Collection `json:"-"`

	// Persister specific fields
	ID             int `json:"-"`
	HasInterestsID int `json:"-" pg:", fk:HasInterests"`
	ListID         int `json:"-" pg:", fk:List"`
}

ForeignActivitiesIndirect represents the payload for the foreign activities indirect section.

func (*ForeignActivitiesIndirect) Delete added in v0.5.3

func (entity *ForeignActivitiesIndirect) Delete(context DatabaseService, account int) (int, error)

Delete will remove the entity from the database.

func (*ForeignActivitiesIndirect) Find added in v0.5.3

func (entity *ForeignActivitiesIndirect) Find(context DatabaseService) error

Find the previous entity stored if one is available.

func (*ForeignActivitiesIndirect) Get added in v0.5.3

func (entity *ForeignActivitiesIndirect) Get(context DatabaseService, account int) (int, error)

Get will retrieve the entity from the database.

func (*ForeignActivitiesIndirect) GetID added in v0.5.3

func (entity *ForeignActivitiesIndirect) GetID() int

GetID returns the entity identifier.

func (*ForeignActivitiesIndirect) Marshal added in v0.5.3

func (entity *ForeignActivitiesIndirect) Marshal() Payload

Marshal to payload structure

func (*ForeignActivitiesIndirect) Save added in v0.5.3

func (entity *ForeignActivitiesIndirect) Save(context DatabaseService, account int) (int, error)

Save will create or update the database.

func (*ForeignActivitiesIndirect) SetID added in v0.5.3

func (entity *ForeignActivitiesIndirect) SetID(id int)

SetID sets the entity identifier.

func (*ForeignActivitiesIndirect) Unmarshal added in v0.5.3

func (entity *ForeignActivitiesIndirect) Unmarshal(raw []byte) error

Unmarshal bytes in to the entity properties.

func (*ForeignActivitiesIndirect) Valid added in v0.5.3

func (entity *ForeignActivitiesIndirect) Valid() (bool, error)

Valid checks the value(s) against an battery of tests.

type ForeignActivitiesRealEstate added in v0.5.3

type ForeignActivitiesRealEstate struct {
	PayloadHasInterests Payload `json:"HasInterests" sql:"-"`
	PayloadList         Payload `json:"List" sql:"-"`

	// Validator specific fields
	HasInterests *Branch     `json:"-"`
	List         *Collection `json:"-"`

	// Persister specific fields
	ID             int `json:"-"`
	HasInterestsID int `json:"-" pg:", fk:HasInterests"`
	ListID