dto

package
Version: v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRecoveryPhonesResponse

type AccountRecoveryPhonesResponse struct {
	MaskedPhoneNumbers   []string `json:"maskedPhoneNumbers"`
	UnMaskedPhoneNumbers []string `json:"unmaskedPhoneNumbers"`
}

AccountRecoveryPhonesResponse payload sent back to the frontend when recovery an account

type Admin

type Admin struct {
	ID string `json:"id"`

	PrimaryPhone string `json:"primaryPhone"`

	PrimaryEmailAddress *string `json:"primaryEmailAddress"`

	SecondaryPhoneNumbers []string `json:"secondaryPhoneNumbers"`

	SecondaryEmailAddresses []string `json:"secondaryEmailAddresses"`

	TermsAccepted bool `json:"termsAccepted,omitempty"`

	Suspended bool `json:"suspended"`

	PhotoUploadID string `json:"photoUploadID,omitempty"`

	UserBioData profileutils.BioData `json:"userBioData,omitempty"`

	// Resend PIN helps inform the whether a send new temporary PIN
	// True when the user hasn't performed the initial sign up to change PIN
	ResendPIN bool `json:"resendPIN"`

	Roles []RoleOutput `json:"roles"`
}

Admin represents agent with details inferred from their user profile

type AfricasTalkingMessage

type AfricasTalkingMessage struct {
	// A unique identifier attached to each incoming message.
	LinkID string `json:"linkId"`
	// The content of the message received.
	Text string `json:"text"`
	// Your registered short code that the sms was sent out to.
	To string `json:"to"`
	// The id of the message.
	ID string `json:"id"`
	// The date when the sms was sent.
	Date string `json:"date"`
	// The sender’s phone number.
	From string `json:"from"`
}

AfricasTalkingMessage contains the SMS message data

type Agent

type Agent struct {
	ID string `json:"id"`

	PrimaryPhone string `json:"primaryPhone"`

	PrimaryEmailAddress *string `json:"primaryEmailAddress"`

	SecondaryPhoneNumbers []string `json:"secondaryPhoneNumbers"`

	SecondaryEmailAddresses []string `json:"secondaryEmailAddresses"`

	TermsAccepted bool `json:"termsAccepted,omitempty"`

	Suspended bool `json:"suspended"`

	PhotoUploadID string `json:"photoUploadID,omitempty"`

	UserBioData profileutils.BioData `json:"userBioData,omitempty"`

	// Resend PIN helps inform the whether a send new temporary PIN
	// True when the user hasn't performed the initial sign up to change PIN
	ResendPIN bool `json:"resendPIN"`

	Roles []RoleOutput `json:"roles"`
}

Agent represents agent with details inferred from their user profile

type AgentConnection

type AgentConnection struct {
	Edges    []AgentEdge            `json:"edges"`
	PageInfo firebasetools.PageInfo `json:"pageInfo"`
}

AgentConnection is used to serialize GraphQL Relay connections for agents

type AgentEdge

type AgentEdge struct {
	Cursor string `json:"cursor"`
	Node   Agent  `json:"node"`
}

AgentEdge is used to serialize GraphQL Edges for an agent

type AgentFilterInput

type AgentFilterInput struct {
	PhoneNumber string `json:"phoneNumber"`
}

AgentFilterInput is used to supply filter parameters for agent filter inputs

type AssignRolePayload added in v0.0.2

type AssignRolePayload struct {
	UserID string `json:"userID"`
	RoleID string `json:"roleID"`
}

AssignRolePayload is the payload used to assign a role to a user

type BranchConnection

type BranchConnection struct {
	Edges    []*BranchEdge           `json:"edges"`
	PageInfo *firebasetools.PageInfo `json:"pageInfo"`
}

BranchConnection is used tu serialize GraphQL Relay connections for locations

type BranchEdge

type BranchEdge struct {
	Cursor *string        `json:"cursor"`
	Node   *domain.Branch `json:"node"`
}

BranchEdge is used to serialize GraphQL Relay edges for locations

type BranchFilterInput

type BranchFilterInput struct {
	Search               *string `json:"search"`
	SladeCode            *string `json:"sladeCode"`
	ParentOrganizationID *string `json:"parentOrganizationID"`
}

BranchFilterInput is used to supply filter parameters for locatioon list queries

func (*BranchFilterInput) ToURLValues

func (i *BranchFilterInput) ToURLValues() url.Values

ToURLValues transforms the filter input to `url.Values`

type BranchSortInput

type BranchSortInput struct {
	Name      *enumutils.SortOrder `json:"name"`
	SladeCode *enumutils.SortOrder `json:"slade_code"`
}

BranchSortInput is used to supply sorting input for location list queries

func (*BranchSortInput) ToURLValues

func (i *BranchSortInput) ToURLValues() (values url.Values)

ToURLValues transforms the sort input to `url.Values`

type BusinessPartnerConnection

type BusinessPartnerConnection struct {
	Edges    []*BusinessPartnerEdge  `json:"edges"`
	PageInfo *firebasetools.PageInfo `json:"pageInfo"`
}

BusinessPartnerConnection is used to serialize GraphQL Relay connections for organizations

type BusinessPartnerEdge

type BusinessPartnerEdge struct {
	Cursor *string                 `json:"cursor"`
	Node   *domain.BusinessPartner `json:"node"`
}

BusinessPartnerEdge is used to serialize GraphQL Relay edges for organization

type BusinessPartnerFilterInput

type BusinessPartnerFilterInput struct {
	Search    *string `json:"search"`
	Name      *string `json:"name"`
	SladeCode *string `json:"slade_code"`
}

BusinessPartnerFilterInput is used to supply filter parameters for organizatiom filter inputs

func (*BusinessPartnerFilterInput) ToURLValues

func (i *BusinessPartnerFilterInput) ToURLValues() (values url.Values)

ToURLValues transforms the filter input to `url.Values`

type BusinessPartnerSortInput

type BusinessPartnerSortInput struct {
	Name      *enumutils.SortOrder `json:"name"`
	SladeCode *enumutils.SortOrder `json:"slade_code"`
}

BusinessPartnerSortInput is used to supply sort input for organization list queries

func (*BusinessPartnerSortInput) ToURLValues

func (i *BusinessPartnerSortInput) ToURLValues() (values url.Values)

ToURLValues transforms the filter input to `url.Values`

type ChangePINRequest

type ChangePINRequest struct {
	PhoneNumber string `json:"phoneNumber"`
	PIN         string `json:"pin"`
	OTP         string `json:"otp"`
}

ChangePINRequest payload to set or change PIN information

type CheckPermissionPayload added in v0.0.2

type CheckPermissionPayload struct {
	UID        *string                  `json:"uid"`
	Permission *profileutils.Permission `json:"permission"`
}

CheckPermissionPayload is the payload used when checking if a user is authorized

type ContactLeadInput

type ContactLeadInput struct {
	ContactType    string                      `json:"contact_type,omitempty"`
	ContactValue   string                      `json:"contact_value,omitempty"`
	FirstName      string                      `json:"first_name,omitempty"`
	LastName       string                      `json:"last_name,omitempty"`
	DateOfBirth    scalarutils.Date            `json:"date_of_birth,omitempty"`
	IsSync         bool                        `json:"isSync"                    firestore:"IsSync"`
	TimeSync       *time.Time                  `json:"timeSync"                  firestore:"TimeSync"`
	OptOut         CRMDomain.GeneralOptionType `json:"opt_out,omitempty"`
	WantCover      bool                        `json:"wantCover"                 firestore:"wantCover"`
	ContactChannel string                      `json:"contact_channel,omitempty"`
	IsRegistered   bool                        `json:"is_registered,omitempty"`
}

ContactLeadInput ...

type CoverInput

type CoverInput struct {
	PayerSladeCode int      `json:"payerSladeCode"`
	MemberNumber   string   `json:"memberNumber"`
	UID            string   `json:"uid"`
	PushToken      []string `json:"pushToken"`
}

CoverInput is used to add covers

type CoverLinkingEvent

type CoverLinkingEvent struct {
	ID                    string     `firestore:"id"`
	CoverLinkingEventTime *time.Time `firestore:"coverLinkingEventTime"`
	CoverStatus           string     `firestore:"coverStatus"`
	MemberNumber          string     `firestore:"memberNumber"`
	PhoneNumber           string     `firestore:"phoneNumber"`
}

CoverLinkingEvent is a cover linking struct for cover linking events(started or completed)

type CreatedUserResponse

type CreatedUserResponse struct {
	UID         string `json:"uid,omitempty"`
	DisplayName string `json:"display_name,omitempty"`
	Email       string `json:"email,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`
	PhotoURL    string `json:"photo_url,omitempty"`
	ProviderID  string `json:"provider_id,omitempty"`
}

CreatedUserResponse is used to return a created user

type CustomerPayload

type CustomerPayload struct {
	Active       bool                     `json:"active"`
	PartnerName  string                   `json:"partner_name"`
	Country      string                   `json:"country"`
	Currency     string                   `json:"currency"`
	IsCustomer   bool                     `json:"is_customer"`
	CustomerType profileutils.PartnerType `json:"customer_type"`
}

CustomerPayload is the customer data used to create a customer business partner in the ERP

type CustomerPubSubMessage

type CustomerPubSubMessage struct {
	CustomerPayload CustomerPayload `json:"customerPayload"`
	UID             string          `json:"uid"`
}

CustomerPubSubMessage is an `onboarding` PubSub message struct

type CustomerPubSubMessagePayload

type CustomerPubSubMessagePayload struct {
	CustomerPayload dm.CustomerPayload `json:"customerPayload"`
	UID             string             `json:"uid"`
}

CustomerPubSubMessagePayload is an `onboarding` PubSub message struct for commontools

type DeleteRolePayload added in v0.0.2

type DeleteRolePayload struct {
	Name   string `json:"name"`
	RoleID string `json:"roleID"`
}

DeleteRolePayload is the payload used to delete a role

type EDICoverLinkingPubSubMessage added in v0.0.23

type EDICoverLinkingPubSubMessage struct {
	PayerSladeCode int    `json:"payersladecode"`
	MemberNumber   string `json:"membernumber"`
	PhoneNumber    string `json:"phonenumber"`
}

EDICoverLinkingPubSubMessage holds the data required to add a cover to the profile of EDI members who received a message with the bewell link an went ahead to download the app

type EmailNotificationPayload

type EmailNotificationPayload struct {
	SupplierName string `json:"supplier_name"`
	PartnerType  string `json:"partner_type"`
	AccountType  string `json:"account_type"`
	SubjectTitle string `json:"subject_title"`
	EmailBody    string `json:"email_body"`
	EmailAddress string `json:"email_address"`
	PrimaryPhone string `json:"primary_phone"`
}

EmailNotificationPayload is the email payload used to send email supplier and admins for KYC requests

type GroupedNavigationActions added in v0.0.2

type GroupedNavigationActions struct {
	Primary   []domain.NavigationAction `json:"primary,omitempty"`
	Secondary []domain.NavigationAction `json:"secondary,omitempty"`
}

GroupedNavigationActions is the list of Navigation Actions sorted into primary and secondary actions

type LinkCoverPubSubMessage

type LinkCoverPubSubMessage struct {
	PhoneNumber string   `json:"phoneNumber"`
	UID         string   `json:"uid"`
	PushToken   []string `json:"pushToken"`
}

LinkCoverPubSubMessage is a `cover linking` pub sub message struct

type LoginPayload

type LoginPayload struct {
	PhoneNumber *string         `json:"phoneNumber"`
	PIN         *string         `json:"pin"`
	Flavour     feedlib.Flavour `json:"flavour"`
}

LoginPayload used when calling the REST API to log a user in

type NHIFDetailsInput

type NHIFDetailsInput struct {
	MembershipNumber          string                          `json:"membershipNumber"`
	Employment                domain.EmploymentType           `json:"employmentType"`
	IDDocType                 enumutils.IdentificationDocType `json:"IDDocType"`
	IDNumber                  string                          `json:"IDNumber"`
	IdentificationCardPhotoID string                          `json:"identificationCardPhotoID"`
	NHIFCardPhotoID           string                          `json:"nhifCardPhotoID"`
}

NHIFDetailsInput represents a user's thin NHIF input details

type OKResp

type OKResp struct {
	Status   string      `json:"status,omitempty"`
	Response interface{} `json:"response,omitempty"`
}

OKResp is used to return OK response in inter-service calls

func NewOKResp

func NewOKResp(rawResponse interface{}) *OKResp

NewOKResp a shortcut to create an instance of OKResp

type OtpPayload added in v0.0.2

type OtpPayload struct {
	PhoneNumber *string `json:"phoneNumber"`
	AppID       *string `json:"appId"`
}

OtpPayload used when sending OTP messages

type PermissionInput

type PermissionInput struct {
	Action   string
	Resource string
}

PermissionInput input required to create a permission

type PhoneNumberPayload

type PhoneNumberPayload struct {
	PhoneNumber *string `json:"phoneNumber"`
}

PhoneNumberPayload used when verifying a phone number.

type PostVisitSurveyInput

type PostVisitSurveyInput struct {
	LikelyToRecommend int    `json:"likelyToRecommend" firestore:"likelyToRecommend"`
	Criticism         string `json:"criticism"         firestore:"criticism"`
	Suggestions       string `json:"suggestions"       firestore:"suggestions"`
}

PostVisitSurveyInput is used to send the results of post-visit surveys to the server.

type ProfileSuspensionInput added in v0.0.2

type ProfileSuspensionInput struct {
	ID      string   `json:"id"`
	RoleIDs []string `json:"roleIDs"`
	Reason  string   `json:"reason"`
}

ProfileSuspensionInput is the input required to suspend/unsuspend a PRO account

type PushTokenPayload

type PushTokenPayload struct {
	PushToken string `json:"pushTokens"`
	UID       string `json:"uid"`
}

PushTokenPayload represents user device push token

type RefreshTokenExchangePayload

type RefreshTokenExchangePayload struct {
	GrantType    string `json:"grant_type"`
	RefreshToken string `json:"refresh_token"`
}

RefreshTokenExchangePayload is marshalled into JSON and sent to the Firebase Auth REST API when exchanging a refresh token for an ID token that can be used to make API calls

type RefreshTokenPayload

type RefreshTokenPayload struct {
	RefreshToken *string `json:"refreshToken"`
}

RefreshTokenPayload is used when calling the REST API to exchange a Refresh Token for new ID Token

type RegisterAdminInput

type RegisterAdminInput struct {
	FirstName   string           `json:"lastName"`
	LastName    string           `json:"firstName"`
	Gender      enumutils.Gender `json:"gender"`
	PhoneNumber string           `json:"phoneNumber"`
	Email       string           `json:"email"`
	DateOfBirth scalarutils.Date `json:"dateOfBirth"`
	// ID of the Role being assigned to the new employee
	RoleIDs []string `json:"roleIDs"`
}

RegisterAdminInput provides the data payload required to create an Admin

type RegisterAgentInput

type RegisterAgentInput struct {
	FirstName   string           `json:"lastName"`
	LastName    string           `json:"firstName"`
	Gender      enumutils.Gender `json:"gender"`
	PhoneNumber string           `json:"phoneNumber"`
	Email       string           `json:"email"`
	DateOfBirth scalarutils.Date `json:"dateOfBirth"`
	// ID of the Role being assigned to the new agent
	RoleIDs []string `json:"roleIDs"`
}

RegisterAgentInput provides the data payload required to create an Agent

type RegisterUserInput added in v0.0.10

type RegisterUserInput struct {
	UID            *string           `json:"uid,omitempty"`
	FirstName      *string           `json:"firstName,omitempty"`
	LastName       *string           `json:"lastName,omitempty"`
	Gender         *enumutils.Gender `json:"gender,omitempty"`
	PhoneNumber    *string           `json:"phoneNumber,omitempty"`
	Email          *string           `json:"email,omitempty"`
	DateOfBirth    *scalarutils.Date `json:"dateOfBirth,omitempty"`
	RoleIDs        []string          `json:"roleIDs,omitempty"`
	WelcomeMessage *string           `json:"welcomeMessage,omitempty"`
}

RegisterUserInput is the data required to creat a new user. this data can be used by cross service requests

type RegisteredUserResponse added in v0.0.23

type RegisteredUserResponse struct {
	ID          string `json:"id,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
}

RegisteredUserResponse is used to return by creating a new user in ISC

type RetrieveUserProfileInput added in v0.0.2

type RetrieveUserProfileInput struct {
	Email       *string `json:"email" firestore:"emailAddress"`
	PhoneNumber *string `json:"phone" firestore:"phoneNumber"`
}

RetrieveUserProfileInput will be used to fetch a user profile by either email address or phone

type RoleInput

type RoleInput struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Scopes      []string `json:"scopes"`
}

RoleInput represents the information required when creating a role

type RoleOutput

type RoleOutput struct {
	ID          string                      `json:"id"`
	Name        string                      `json:"name"`
	Description string                      `json:"description"`
	Active      bool                        `json:"active"`
	Scopes      []string                    `json:"scopes"`
	Permissions []profileutils.Permission   `json:"permissions"`
	Users       []*profileutils.UserProfile `json:"users"`
}

RoleOutput is the formatted output with scopes and permissions

type RolePayload

type RolePayload struct {
	PhoneNumber *string                `json:"phoneNumber"`
	Role        *profileutils.RoleType `json:"role"`
}

RolePayload used when adding roles to a user

type RolePermissionInput

type RolePermissionInput struct {
	RoleID string   `json:"roleID"`
	Scopes []string `json:"scopes"`
}

RolePermissionInput input required to create a permission

type RoleRevocationInput added in v0.0.2

type RoleRevocationInput struct {
	ProfileID string
	RoleID    string
	Reason    string
}

RoleRevocationInput is the input when revoking a user's role

type Segment

type Segment struct {
	Properties     crmDomain.ContactProperties `json:"properties"       firestore:"properties"`
	Wing           string                      `json:"wing"             firestore:"wing"`
	MessageSent    string                      `json:"message_sent"     firestore:"message_sent"`
	IsSynced       string                      `json:"is_synced"        firestore:"is_synced"`
	TimeSynced     string                      `json:"time_synced"      firestore:"time_synced"`
	PayerSladeCode string                      `json:"payer_slade_code" firestore:"payersladecode"`
	MemberNumber   string                      `json:"member_number"    firestore:"membernumber"`
}

Segment represents the Segments data

type SendRetryOTPPayload

type SendRetryOTPPayload struct {
	Phone     *string `json:"phoneNumber"`
	RetryStep *int    `json:"retryStep"`
	AppID     *string `json:"appId"`
}

SendRetryOTPPayload is used when calling the REST API to resend an otp

type SessionDetails

type SessionDetails struct {
	SessionID   string  `json:"sessionID"`
	PhoneNumber *string `json:"phoneNumber"`
	Level       int     `json:"level"`
	Text        string  `json:"text"`
}

SessionDetails input for ussd

type SetPrimaryPhoneNumberPayload

type SetPrimaryPhoneNumberPayload struct {
	PhoneNumber *string `json:"phoneNumber"`
	OTP         *string `json:"otp"`
}

SetPrimaryPhoneNumberPayload used when veriying and setting a user's primary phone number via REST

type SignUpInput

type SignUpInput struct {
	PhoneNumber *string         `json:"phoneNumber"`
	PIN         *string         `json:"pin"`
	Flavour     feedlib.Flavour `json:"flavour"`
	OTP         *string         `json:"otp"`
}

SignUpInput represents the user information required to create a new account

type SupplierLogin

type SupplierLogin struct {
	Branches *BranchConnection      `json:"branches,omitempty"`
	Supplier *profileutils.Supplier `json:"supplier,omitempty"`
}

SupplierLogin is the response returned after the user has successfully login to edi

type SupplierPayload

type SupplierPayload struct {
	Active       bool                     `json:"active"`
	PartnerName  string                   `json:"partner_name"`
	Country      string                   `json:"country"`
	Currency     string                   `json:"currency"`
	IsSupplier   bool                     `json:"is_supplier"`
	SupplierType profileutils.PartnerType `json:"supplier_type"`
}

SupplierPayload is the supplier data used to create a supplier business partner in the ERP

type SupplierPubSubMessage

type SupplierPubSubMessage struct {
	SupplierPayload SupplierPayload `json:"supplierPayload"`
	UID             string          `json:"uid"`
}

SupplierPubSubMessage is an `onboarding` PubSub message struct

type SupplierPubSubMessagePayload

type SupplierPubSubMessagePayload struct {
	SupplierPayload dm.SupplierPayload `json:"supplierPayload"`
	UID             string             `json:"uid"`
}

SupplierPubSubMessagePayload is an `onboarding` PubSub message struct for commontools

type UIDPayload

type UIDPayload struct {
	UID *string `json:"uid"`
}

UIDPayload is the user ID used in some inter-service requests

type UIDsPayload

type UIDsPayload struct {
	UIDs []string `json:"uids"`
}

UIDsPayload is an input of a slice of users' UIDs used for ISC requests to retrieve contact details of the users

type USSDEvent

type USSDEvent struct {
	SessionID         string     `firestore:"sessionID"`
	PhoneNumber       string     `firestore:"phoneNumber"`
	USSDEventDateTime *time.Time `firestore:"ussdEventDateTime"`
	Level             int        `firestore:"level"`
	USSDEventName     string     `firestore:"ussdEventName"`
}

USSDEvent records any USSD event(e.g. entering firstname, lastname etc.) that happens for every session and the time

type UpdateCoversPayload

type UpdateCoversPayload struct {
	UID                   *string    `json:"uid"`
	PayerName             *string    `json:"payerName"`
	MemberName            *string    `json:"memberName"`
	MemberNumber          *string    `json:"memberNumber"`
	PayerSladeCode        *int       `json:"payerSladeCode"`
	BeneficiaryID         *int       `json:"beneficiaryID"`
	EffectivePolicyNumber *string    `json:"effectivePolicyNumber"`
	ValidFrom             *time.Time `json:"validFrom"`
	ValidTo               *time.Time `json:"validTo"`
}

UpdateCoversPayload is used to make a REST request to update a user's covers in their user profile

type UserAddressInput

type UserAddressInput struct {
	Latitude         float64 `json:"latitude"`
	Longitude        float64 `json:"longitude"`
	Locality         *string `json:"locality"`
	Name             *string `json:"name"`
	PlaceID          *string `json:"placeID"`
	FormattedAddress *string `json:"formattedAddress"`
}

UserAddressInput represents a user's geo location input

type UserInfo

type UserInfo struct {
	DisplayName string `json:"displayName,omitempty"`
	Email       string `json:"email,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
	PhotoURL    string `json:"photoUrl,omitempty"`
	// In the ProviderUserInfo[] ProviderID can be a short domain name (e.g. google.com),
	// or the identity of an OpenID identity provider.
	// In UserRecord.UserInfo it will return the constant string "firebase".
	ProviderID string `json:"providerId,omitempty"`
	UID        string `json:"rawId,omitempty"`
}

UserInfo is a collection of standard profile information for a user.

type UserProfileInput

type UserProfileInput struct {
	PhotoUploadID *string           `json:"photoUploadID"`
	DateOfBirth   *scalarutils.Date `json:"dateOfBirth,omitempty"`
	Gender        *enumutils.Gender `json:"gender,omitempty"`
	FirstName     *string           `json:"lastName"`
	LastName      *string           `json:"firstName"`
}

UserProfileInput is used to create or update a user's profile.

type UserProfilePayload

type UserProfilePayload struct {
	UID           *string           `json:"uid"`
	PhotoUploadID *string           `json:"photoUploadID"`
	DateOfBirth   *scalarutils.Date `json:"dateOfBirth,omitempty"`
	Gender        *enumutils.Gender `json:"gender,omitempty"`
	FirstName     *string           `json:"lastName"`
	LastName      *string           `json:"firstName"`
}

UserProfilePayload is used to update a user's profile. This payload is used for REST endpoints

Jump to

Keyboard shortcuts

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