Documentation
¶
Index ¶
- Constants
- Variables
- type BeneficiaryRelationship
- type ChangePINRequest
- type EmploymentType
- type FivePointRating
- type Microservice
- type MicroserviceStatus
- type NavigationAction
- type NavigationGroup
- type PIN
- type PostVisitSurvey
- type PractitionerCadre
- type PractitionerService
- type RoleRevocationLog
- type SetPINRequest
- type ThinAddress
- type UserAddresses
Constants ¶
const ( EmployeeRegistrationActionSequence AgentRegistrationActionSequence )
Determines the sequence number of a navigation action Order of the constants matters!!
Variables ¶
var ( NavigationAction{ Group: HomeGroup, Title: common.HomeNavActionTitle, OnTapRoute: common.HomeRoute, Icon: common.HomeNavActionIcon, RequiredPermission: nil, SequenceNumber: HomeNavActionSequence, } HelpNavAction = NavigationAction{ Group: HelpGroup, Title: common.HelpNavActionTitle, OnTapRoute: common.GetHelpRouteRoute, Icon: common.HelpNavActionIcon, RequiredPermission: nil, SequenceNumber: HelpNavActionSequence, } )HomeNavAction =
the structure and definition of all navigation actions
var ( // it has nested navigation actions below RoleNavActions = NavigationAction{ Group: RoleGroup, Title: common.RoleNavActionTitle, Icon: common.RoleNavActionIcon, RequiredPermission: &profileutils.CanViewRole, SequenceNumber: RoleNavActionSequence, } RoleCreationNavAction = NavigationAction{ Group: RoleGroup, Title: common.RoleCreationActionTitle, OnTapRoute: common.RoleCreationRoute, RequiredPermission: &profileutils.CanCreateRole, HasParent: true, SequenceNumber: RoleCreationNavActionSequence, } RoleViewNavAction = NavigationAction{ Group: RoleGroup, Title: common.RoleViewActionTitle, OnTapRoute: common.RoleViewRoute, RequiredPermission: &profileutils.CanViewRole, HasParent: true, SequenceNumber: RoleViewingNavActionSequence, } )
var ( // it has nested navigation actions below EmployeeNavActions = NavigationAction{ Group: EmployeeGroup, Title: common.EmployeeNavActionTitle, Icon: common.EmployeeNavActionIcon, RequiredPermission: &profileutils.CanViewEmployee, SequenceNumber: EmployeeNavActionSequence, } EmployeeRegistrationNavAction = NavigationAction{ Group: EmployeeGroup, Title: common.EmployeeRegistrationActionTitle, OnTapRoute: common.EmployeeRegistrationRoute, RequiredPermission: &profileutils.CanCreateEmployee, HasParent: true, SequenceNumber: EmployeeRegistrationActionSequence, } EmployeeidentificationNavAction = NavigationAction{ Group: EmployeeGroup, Title: common.EmployeeIdentificationActionTitle, OnTapRoute: common.EmployeeIdentificationRoute, RequiredPermission: &profileutils.CanViewEmployee, HasParent: true, SequenceNumber: EmployeeSearchNavActionSequence, } )
var ( // it has nested navigation actions below PatientNavActions = NavigationAction{ Group: PatientGroup, Title: common.PatientNavActionTitle, Icon: common.PatientNavActionIcon, RequiredPermission: &profileutils.CanViewPatient, SequenceNumber: PatientNavActionSequence, } PatientRegistrationNavAction = NavigationAction{ Group: PatientGroup, Title: common.PatientRegistrationActionTitle, OnTapRoute: common.PatientRegistrationRoute, RequiredPermission: &profileutils.CanCreatePatient, HasParent: true, SequenceNumber: PatientRegistrationNavActionSequence, } PatientIdentificationNavAction = NavigationAction{ Group: PatientGroup, Title: common.PatientIdentificationActionTitle, OnTapRoute: common.PatientIdentificationRoute, RequiredPermission: &profileutils.CanIdentifyPatient, HasParent: true, SequenceNumber: PatientSearchNavActionSequence, } )
var (
// TimeLocation ...
TimeLocation, _ = time.LoadLocation("Africa/Nairobi")
// TimeFormatStr date time string format
TimeFormatStr = "2006-01-02T15:04:05+03:00"
// Repo the env to identify which repo to use
Repo = "REPOSITORY"
//FirebaseRepository is the value of the env when using firebase
FirebaseRepository = "firebase"
//PostgresRepository is the value of the env when using postgres
PostgresRepository = "postgres"
)
var AllBeneficiaryRelationship = []BeneficiaryRelationship{ BeneficiaryRelationshipSpouse, BeneficiaryRelationshipChild, }
AllBeneficiaryRelationship is a list of all known beneficiary relationships
var AllEmploymentType = []EmploymentType{ EmploymentTypeEmployed, EmploymentTypeSelfEmployed, }
AllEmploymentType ..
var AllFivePointRating = []FivePointRating{ FivePointRatingPoor, FivePointRatingUnsatisfactory, FivePointRatingAverage, FivePointRatingSatisfactory, FivePointRatingExcellent, }
AllFivePointRating is a list of all known ratings
HomeNavAction, HelpNavAction, KYCNavActions, PartnerNavActions, ConsumerNavActions, EmployeeNavActions, EmployeeRegistrationNavAction, EmployeeidentificationNavAction, PatientNavActions, PatientRegistrationNavAction, PatientIdentificationNavAction, RoleNavActions, RoleCreationNavAction, RoleViewNavAction, }
AllNavigationActions is a grouping of all navigation actions
var AllPractitionerCadre = []PractitionerCadre{ PractitionerCadreDoctor, PractitionerCadreClinicalOfficer, PractitionerCadreNurse, }
AllPractitionerCadre is the set of known valid practitioner cadres
var AllPractitionerService = []PractitionerService{ PractitionerServiceOutpatientServices, PractitionerServiceInpatientServices, PractitionerServicePharmacy, PractitionerServiceMaternity, PractitionerServiceLabServices, PractitionerServiceOther, }
AllPractitionerService is a list of all known practitioner service
var ( NavigationAction{ Group: ConsumerGroup, Title: common.ConsumerNavActionTitle, OnTapRoute: "", Icon: common.ConsumerNavActionIcon, RequiredPermission: &profileutils.CanViewConsumers, SequenceNumber: ConsumerNavactionSequence, } )ConsumerNavActions =
var ( NavigationAction{ Group: KYCGroup, Title: common.RequestsNavActionTitle, OnTapRoute: common.RequestsRoute, Icon: common.RequestNavActionIcon, RequiredPermission: &profileutils.CanProcessKYC, SequenceNumber: RequestsNavActionSequence, } )KYCNavActions =
var ( NavigationAction{ Group: PartnerGroup, Title: common.PartnerNavActionTitle, OnTapRoute: "", Icon: common.PartnerNavActionIcon, RequiredPermission: &profileutils.CanViewPartner, SequenceNumber: PartnerNavactionSequence, } )PartnerNavActions =
var WelcomeMessage = "" /* 142-byte string literal not displayed */
WelcomeMessage is the default message formart for sending temporary PIN to users
Functions ¶
This section is empty.
Types ¶
type BeneficiaryRelationship ¶
type BeneficiaryRelationship string
BeneficiaryRelationship defines the various relationships with beneficiaries
const ( BeneficiaryRelationshipSpouse BeneficiaryRelationship = "SPOUSE" BeneficiaryRelationshipChild BeneficiaryRelationship = "CHILD" )
BeneficiaryRelationshipSpouse is a constant of beneficiary spouse relationship
func (BeneficiaryRelationship) IsValid ¶
func (e BeneficiaryRelationship) IsValid() bool
IsValid returns true for valid beneficiary relationship
func (BeneficiaryRelationship) MarshalGQL ¶
func (e BeneficiaryRelationship) MarshalGQL(w io.Writer)
MarshalGQL converts the beneficiary relationship into a valid JSON string
func (BeneficiaryRelationship) String ¶
func (e BeneficiaryRelationship) String() string
func (*BeneficiaryRelationship) UnmarshalGQL ¶
func (e *BeneficiaryRelationship) UnmarshalGQL(v interface{}) error
UnmarshalGQL converts the input, if valid, into a beneficiary relationship value
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 EmploymentType ¶
type EmploymentType string
EmploymentType ...
const ( EmploymentTypeEmployed EmploymentType = "EMPLOYED" EmploymentTypeSelfEmployed EmploymentType = "SELF_EMPLOYED" )
EmploymentTypeEmployed ..
func (EmploymentType) String ¶
func (e EmploymentType) String() string
func (*EmploymentType) UnmarshalGQL ¶
func (e *EmploymentType) UnmarshalGQL(v interface{}) error
UnmarshalGQL ..
type FivePointRating ¶
type FivePointRating string
FivePointRating is used to implement
const ( FivePointRatingPoor FivePointRating = "POOR" FivePointRatingUnsatisfactory FivePointRating = "UNSATISFACTORY" FivePointRatingAverage FivePointRating = "AVERAGE" FivePointRatingSatisfactory FivePointRating = "SATISFACTORY" FivePointRatingExcellent FivePointRating = "EXCELLENT" )
known ratings
func (FivePointRating) IsValid ¶
func (e FivePointRating) IsValid() bool
IsValid returns true for valid ratings
func (FivePointRating) MarshalGQL ¶
func (e FivePointRating) MarshalGQL(w io.Writer)
MarshalGQL converts the rating into a valid JSON string
func (FivePointRating) String ¶
func (e FivePointRating) String() string
func (*FivePointRating) UnmarshalGQL ¶
func (e *FivePointRating) UnmarshalGQL(v interface{}) error
UnmarshalGQL converts the input, if valid, into a rating value
type Microservice ¶
type Microservice struct { ID string `json:"id" firestore:"id"` Name string `json:"name" firestore:"name"` URL string `json:"url" firestore:"url"` Description string `json:"description" firestore:"description"` }
Microservice identifies a micro-service that conforms to the Apollo Graphqql federation specification. These microservices are composed by an Apollo Gateway into a single data graph.
func (*Microservice) GetID ¶
func (m *Microservice) GetID() firebasetools.ID
GetID returns the micro-service's ID
func (*Microservice) IsEntity ¶
func (m *Microservice) IsEntity()
IsEntity marks the struct as an Apollo Federation entity
func (*Microservice) IsNode ¶
func (m *Microservice) IsNode()
IsNode marks this model as a GraphQL Relay Node
func (*Microservice) SetID ¶
func (m *Microservice) SetID(id string)
SetID sets the microservice's ID
type MicroserviceStatus ¶
type MicroserviceStatus struct { Service *Microservice `json:"service"` Active bool `json:"active"` }
MicroserviceStatus denotes the status of a deployed microservice shows if the revision is serving HTTP request
type NavigationAction ¶ added in v0.0.2
type NavigationAction struct { // the number is used when sorting/ordering navigation actions // Actions with a higher sequence number appear at the top i.e ascending order SequenceNumber int `json:"sequenceNumber"` }
NavigationAction is the menu rendered to PRO users for navigating the app
type NavigationGroup ¶ added in v0.0.2
type NavigationGroup string
NavigationGroup is the grouping of related navigation actions based on resource
const ( //HomeGroup groups all actions under the home resource HomeGroup NavigationGroup = "home" //RoleGroup groups all actions under the role resource RoleGroup NavigationGroup = "role" //HelpGroup groups all actions under the help resource HelpGroup NavigationGroup = "help" //AgentGroup groups all actions under the agent resource AgentGroup NavigationGroup = "agents" //KYCGroup groups all actions under the kyc resource KYCGroup NavigationGroup = "kyc" //EmployeeGroup groups all actions under the employees resource EmployeeGroup NavigationGroup = "employees" //CoversGroup groups all actions under the covers resource CoversGroup NavigationGroup = "covers" //PatientGroup groups all actions under the patient resource PatientGroup NavigationGroup = "patient" //PartnerGroup groups all actions under the partner resource PartnerGroup NavigationGroup = "partner" //RolesGroup groups all actions under the role resource RolesGroup NavigationGroup = "role" //ConsumerGroup groups all actions under the consumer resource ConsumerGroup NavigationGroup = "consumer" )
type PIN ¶
type PIN struct { ID string `json:"id" firestore:"id"` ProfileID string `json:"profileID" firestore:"profileID"` PINNumber string `json:"pinNumber" firestore:"pinNumber"` Salt string `json:"salt" firestore:"salt"` // Flags the PIN as temporary and should be changed by user IsOTP bool `json:"isOTP" firestore:"isOTP"` }
PIN represents a user's PIN information
type PostVisitSurvey ¶
type PostVisitSurvey struct { LikelyToRecommend int `json:"likelyToRecommend" firestore:"likelyToRecommend"` Criticism string `json:"criticism" firestore:"criticism"` Suggestions string `json:"suggestions" firestore:"suggestions"` UID string `json:"uid" firestore:"uid"` Timestamp time.Time `json:"timestamp" firestore:"timestamp"` }
PostVisitSurvey is used to record and retrieve post visit surveys from Firebase
type PractitionerCadre ¶
type PractitionerCadre string
PractitionerCadre is a list of health worker cadres.
const ( PractitionerCadreDoctor PractitionerCadre = "DOCTOR" PractitionerCadreClinicalOfficer PractitionerCadre = "CLINICAL_OFFICER" PractitionerCadreNurse PractitionerCadre = "NURSE" )
practitioner cadre constants
func (PractitionerCadre) IsValid ¶
func (e PractitionerCadre) IsValid() bool
IsValid returns true if a practitioner cadre is valid
func (PractitionerCadre) MarshalGQL ¶
func (e PractitionerCadre) MarshalGQL(w io.Writer)
MarshalGQL writes the practitioner cadre to the supplied writer
func (PractitionerCadre) String ¶
func (e PractitionerCadre) String() string
func (*PractitionerCadre) UnmarshalGQL ¶
func (e *PractitionerCadre) UnmarshalGQL(v interface{}) error
UnmarshalGQL converts the supplied value to a practitioner cadre
type PractitionerService ¶
type PractitionerService string
PractitionerService defines the various services practitioners offer
const ( PractitionerServiceOutpatientServices PractitionerService = "OUTPATIENT_SERVICES" PractitionerServiceInpatientServices PractitionerService = "INPATIENT_SERVICES" PractitionerServicePharmacy PractitionerService = "PHARMACY" PractitionerServiceMaternity PractitionerService = "MATERNITY" PractitionerServiceLabServices PractitionerService = "LAB_SERVICES" PractitionerServiceOther PractitionerService = "OTHER" )
PractitionerServiceOutpatientServices is a constant of all known practitioner service
func (PractitionerService) IsValid ¶
func (e PractitionerService) IsValid() bool
IsValid returns true for valid practitioner service
func (PractitionerService) MarshalGQL ¶
func (e PractitionerService) MarshalGQL(w io.Writer)
MarshalGQL converts the practitioner service into a valid JSON string
func (PractitionerService) String ¶
func (e PractitionerService) String() string
func (*PractitionerService) UnmarshalGQL ¶
func (e *PractitionerService) UnmarshalGQL(v interface{}) error
UnmarshalGQL converts the input, if valid, into a practitioner service value
type RoleRevocationLog ¶ added in v0.0.2
type RoleRevocationLog struct { // Unique identifier for a revocation ID string `json:"id" firestore:"id"` // profile of user whose role is being revoked ProfileID string `json:"profileID" firestore:"profileID"` // ID of role being revoked RoleID string `json:"roleID" firestore:"roleID"` // Reason role is being revoked Reason string `json:"reason" firestore:"reason"` // CreatedBy is the Profile ID of the user removing the role. CreatedBy string `json:"createdBy,omitempty" firestore:"createdBy"` // Created is the timestamp indicating when the role was created Created time.Time `json:"created" firestore:"created"` }
RoleRevocationLog represents a log for revoking a users role used when removing a role from a user i.e user deactivation
type SetPINRequest ¶
SetPINRequest payload to set PIN information
type ThinAddress ¶
ThinAddress represents an addresses lat-long
type UserAddresses ¶
type UserAddresses struct { HomeAddress ThinAddress `json:"homeAddress"` WorkAddress ThinAddress `json:"workAddress"` }
UserAddresses represents a user's home and work addresses