postgres

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyCareHubDb

type MyCareHubDb struct {
	// contains filtered or unexported fields
}

MyCareHubDb struct implements the service's business specific calls to the database

func NewMyCareHubDb

func NewMyCareHubDb(c gorm.Create, q gorm.Query, d gorm.Delete, u gorm.Update) *MyCareHubDb

NewMyCareHubDb initializes a new instance of the MyCareHubDb struct

func (*MyCareHubDb) AcceptTerms

func (d *MyCareHubDb) AcceptTerms(ctx context.Context, userID *string, termsID *int) (bool, error)

AcceptTerms can be used to accept or review terms of service

func (*MyCareHubDb) AddCaregiverToClient

func (d *MyCareHubDb) AddCaregiverToClient(ctx context.Context, clientCaregiver *domain.CaregiverClient) error

AddCaregiverToClient is used to assign a caregiver to a client

func (*MyCareHubDb) AddFacilitiesToClientProfile

func (d *MyCareHubDb) AddFacilitiesToClientProfile(ctx context.Context, clientID string, facilities []string) error

AddFacilitiesToClientProfile updates the current facility list of a client

func (*MyCareHubDb) AddFacilitiesToStaffProfile

func (d *MyCareHubDb) AddFacilitiesToStaffProfile(ctx context.Context, staffID string, facilities []string) error

AddFacilitiesToStaffProfile updates the current facility list of a client

func (*MyCareHubDb) AddFacilityToProgram

func (d *MyCareHubDb) AddFacilityToProgram(ctx context.Context, programID string, facilityIDs []string) ([]*domain.Facility, error)

AddFacilityToProgram is used to add a facility to a program which the currently logged in staff member belongs to.

func (*MyCareHubDb) CanRecordHeathDiary

func (d *MyCareHubDb) CanRecordHeathDiary(ctx context.Context, userID string) (bool, error)

CanRecordHeathDiary is used to check if the user can record their health diary

func (*MyCareHubDb) CheckAppointmentExistsByExternalID

func (d *MyCareHubDb) CheckAppointmentExistsByExternalID(ctx context.Context, externalID string) (bool, error)

CheckAppointmentExistsByExternalID checks if an appointment with the external id exists

func (*MyCareHubDb) CheckCaregiverExists

func (d *MyCareHubDb) CheckCaregiverExists(ctx context.Context, userID string) (bool, error)

CheckCaregiverExists checks if there is a caregiver profile that exists for a user

func (*MyCareHubDb) CheckClientExists

func (d *MyCareHubDb) CheckClientExists(ctx context.Context, userID string) (bool, error)

CheckClientExists checks if there is a client profile that exists for a user

func (*MyCareHubDb) CheckFacilityExistsByIdentifier

func (d *MyCareHubDb) CheckFacilityExistsByIdentifier(ctx context.Context, identifier *dto.FacilityIdentifierInput) (bool, error)

CheckFacilityExistsByIdentifier checks whether a facility exists using the mfl code. Used to validate existence of a facility

func (*MyCareHubDb) CheckIdentifierExists

func (d *MyCareHubDb) CheckIdentifierExists(ctx context.Context, identifierType enums.UserIdentifierType, identifierValue string) (bool, error)

CheckIdentifierExists checks whether an identifier of a certain type and value exists Used to validate uniqueness and prevent duplicates

func (*MyCareHubDb) CheckIfClientExistsInProgram

func (d *MyCareHubDb) CheckIfClientExistsInProgram(ctx context.Context, userID, programID string) (bool, error)

CheckIfClientExistsInProgram checks if a client exists in a program

func (*MyCareHubDb) CheckIfClientHasPendingSurveyServiceRequest

func (d *MyCareHubDb) CheckIfClientHasPendingSurveyServiceRequest(ctx context.Context, clientID string, projectID int, formID string) (bool, error)

CheckIfClientHasPendingSurveyServiceRequest returns true if client has a pending survey service request

func (*MyCareHubDb) CheckIfClientHasUnresolvedServiceRequests

func (d *MyCareHubDb) CheckIfClientHasUnresolvedServiceRequests(ctx context.Context, clientID string, serviceRequestType string) (bool, error)

CheckIfClientHasUnresolvedServiceRequests checks if a client has an unresolved service request

func (*MyCareHubDb) CheckIfFacilityExistsInProgram

func (d *MyCareHubDb) CheckIfFacilityExistsInProgram(ctx context.Context, programID, facilityID string) (bool, error)

CheckIfFacilityExistsInProgram checks if a facility is associated with a program

func (*MyCareHubDb) CheckIfPhoneNumberExists

func (d *MyCareHubDb) CheckIfPhoneNumberExists(ctx context.Context, phone string, isOptedIn bool, flavour feedlib.Flavour) (bool, error)

CheckIfPhoneNumberExists checks if phone exists in the database

func (*MyCareHubDb) CheckIfProgramNameExists

func (d *MyCareHubDb) CheckIfProgramNameExists(ctx context.Context, organisationID string, programName string) (bool, error)

CheckIfProgramNameExists checks if a program exists in the organization the program name should be unique for each program in a given organization

func (*MyCareHubDb) CheckIfStaffHasUnresolvedServiceRequests

func (d *MyCareHubDb) CheckIfStaffHasUnresolvedServiceRequests(ctx context.Context, staffID string, serviceRequestType string) (bool, error)

CheckIfStaffHasUnresolvedServiceRequests checks if a staff has unresolved service requests

func (*MyCareHubDb) CheckIfSuperUserExists

func (d *MyCareHubDb) CheckIfSuperUserExists(ctx context.Context) (bool, error)

CheckIfSuperUserExists checks if there is a platform superuser

func (*MyCareHubDb) CheckIfUsernameExists

func (d *MyCareHubDb) CheckIfUsernameExists(ctx context.Context, username string) (bool, error)

CheckIfUsernameExists checks whether the provided username exists

func (*MyCareHubDb) CheckOrganisationExists

func (d *MyCareHubDb) CheckOrganisationExists(ctx context.Context, organisationID string) (bool, error)

CheckOrganisationExists check whether an organisation exists

func (*MyCareHubDb) CheckPhoneExists

func (d *MyCareHubDb) CheckPhoneExists(ctx context.Context, phone string) (bool, error)

CheckPhoneExists is used to check if the phone number exists

func (*MyCareHubDb) CheckStaffExists

func (d *MyCareHubDb) CheckStaffExists(ctx context.Context, userID string) (bool, error)

CheckStaffExists checks if there is a staff profile that exists for a user

func (*MyCareHubDb) CheckStaffExistsInProgram

func (d *MyCareHubDb) CheckStaffExistsInProgram(ctx context.Context, userID, programID string) (bool, error)

CheckStaffExistsInProgram checks if a staff user is registered in a program

func (*MyCareHubDb) CheckUserHasPin

func (d *MyCareHubDb) CheckUserHasPin(ctx context.Context, userID string) (bool, error)

CheckUserHasPin performs a look up on the pins table to check whether a user has a pin

func (*MyCareHubDb) CompleteOnboardingTour

func (d *MyCareHubDb) CompleteOnboardingTour(ctx context.Context, userID string, flavour feedlib.Flavour) (bool, error)

CompleteOnboardingTour updates the user's pin change required from true to false. It'll be used to determine the onboarding journey for a user.

func (*MyCareHubDb) CreateAccessToken

func (d *MyCareHubDb) CreateAccessToken(ctx context.Context, token *domain.AccessToken) error

CreateAccessToken creates a new access token.

func (*MyCareHubDb) CreateAppointment

func (d *MyCareHubDb) CreateAppointment(ctx context.Context, appointment domain.Appointment) error

CreateAppointment creates a new appointment

func (*MyCareHubDb) CreateAuthorizationCode

func (d *MyCareHubDb) CreateAuthorizationCode(ctx context.Context, code *domain.AuthorizationCode) error

CreateAuthorizationCode creates a new authorization code.

func (*MyCareHubDb) CreateBooking

func (d *MyCareHubDb) CreateBooking(ctx context.Context, booking *domain.Booking) (*domain.Booking, error)

CreateBooking is used to book for a certain service e.g picking up medicine or getting help with regard to certain service

func (*MyCareHubDb) CreateCaregiver

func (d *MyCareHubDb) CreateCaregiver(ctx context.Context, caregiver domain.Caregiver) (*domain.Caregiver, error)

CreateCaregiver creates a caregiver record using the provided input

func (*MyCareHubDb) CreateClient

func (d *MyCareHubDb) CreateClient(ctx context.Context, client domain.ClientProfile, contactID, identifierID string) (*domain.ClientProfile, error)

CreateClient creates a new client

func (*MyCareHubDb) CreateCommunity

func (d *MyCareHubDb) CreateCommunity(ctx context.Context, community *domain.Community) (*domain.Community, error)

CreateCommunity creates a channel in the database

func (*MyCareHubDb) CreateFacilities

func (d *MyCareHubDb) CreateFacilities(ctx context.Context, facilities []*domain.Facility) ([]*domain.Facility, error)

CreateFacilities inserts multiple facility records in the database

func (*MyCareHubDb) CreateHealthDiaryEntry

func (d *MyCareHubDb) CreateHealthDiaryEntry(ctx context.Context, healthDiaryInput *domain.ClientHealthDiaryEntry) (*domain.ClientHealthDiaryEntry, error)

CreateHealthDiaryEntry is used to add a health diary record to the database.

func (*MyCareHubDb) CreateIdentifier

func (d *MyCareHubDb) CreateIdentifier(ctx context.Context, identifier domain.Identifier) (*domain.Identifier, error)

CreateIdentifier creates a new identifier

func (*MyCareHubDb) CreateMetric

func (d *MyCareHubDb) CreateMetric(ctx context.Context, payload *domain.Metric) error

CreateMetric saves a metric to the database

func (*MyCareHubDb) CreateOauthClient

func (d *MyCareHubDb) CreateOauthClient(ctx context.Context, client *domain.OauthClient) error

CreateOauthClient creates a new oauth client

func (*MyCareHubDb) CreateOauthClientJWT

func (d *MyCareHubDb) CreateOauthClientJWT(ctx context.Context, jwt *domain.OauthClientJWT) error

CreateOauthClientJWT creates a new oauth jwt client

func (*MyCareHubDb) CreateOrUpdateSession

func (d *MyCareHubDb) CreateOrUpdateSession(ctx context.Context, session *domain.Session) error

CreateOrUpdateSession creates a new session or updates an existing session

func (*MyCareHubDb) CreateOrganisation

func (d *MyCareHubDb) CreateOrganisation(ctx context.Context, organisation *domain.Organisation, programs []*domain.Program) (*domain.Organisation, error)

CreateOrganisation is used to create a new organisation in the database

func (*MyCareHubDb) CreateProgram

func (d *MyCareHubDb) CreateProgram(ctx context.Context, input *dto.ProgramInput) (*domain.Program, error)

CreateProgram enables the creation of a new program

func (*MyCareHubDb) CreateRefreshToken

func (d *MyCareHubDb) CreateRefreshToken(ctx context.Context, token *domain.RefreshToken) error

CreateRefreshToken creates a new refresh token.

func (*MyCareHubDb) CreateScreeningTool

func (d *MyCareHubDb) CreateScreeningTool(ctx context.Context, input *domain.ScreeningTool) error

CreateScreeningTool maps the screening tool domain model to database model to create screening tools

func (*MyCareHubDb) CreateScreeningToolResponse

func (d *MyCareHubDb) CreateScreeningToolResponse(ctx context.Context, input *domain.QuestionnaireScreeningToolResponse) (*string, error)

CreateScreeningToolResponse saves a screening tool response to the database

func (*MyCareHubDb) CreateSecurityQuestions

func (d *MyCareHubDb) CreateSecurityQuestions(ctx context.Context, securityQuestions []*domain.SecurityQuestion) ([]*domain.SecurityQuestion, error)

CreateSecurityQuestions inserts multiple security questions in the database

func (*MyCareHubDb) CreateServiceRequest

func (d *MyCareHubDb) CreateServiceRequest(ctx context.Context, serviceRequestInput *dto.ServiceRequestInput) error

CreateServiceRequest creates a service request which will be handled by a staff user. This happens in a transaction because we do not want to create a health diary entry without a subsequent service request when the client's mood is "VERY_BAD"

func (*MyCareHubDb) CreateStaffServiceRequest

func (d *MyCareHubDb) CreateStaffServiceRequest(ctx context.Context, serviceRequestInput *dto.ServiceRequestInput) error

CreateStaffServiceRequest creates a new service request for the specified staff

func (*MyCareHubDb) CreateTermsOfService

func (d *MyCareHubDb) CreateTermsOfService(ctx context.Context, termsOfService *domain.TermsOfService) (*domain.TermsOfService, error)

CreateTermsOfService inserts terms of service in the database

func (*MyCareHubDb) CreateUser

func (d *MyCareHubDb) CreateUser(ctx context.Context, user domain.User) (*domain.User, error)

CreateUser creates a new user

func (*MyCareHubDb) CreateUserSurveys

func (d *MyCareHubDb) CreateUserSurveys(ctx context.Context, surveys []*dto.UserSurveyInput) error

CreateUserSurveys creates a new user survey

func (*MyCareHubDb) DeleteAccessToken

func (d *MyCareHubDb) DeleteAccessToken(ctx context.Context, signature string) error

DeleteAccessToken retrieves an access token using the signature

func (*MyCareHubDb) DeleteClientProfile

func (d *MyCareHubDb) DeleteClientProfile(ctx context.Context, clientID string, userID *string) error

DeleteClientProfile method is used to delete a client user from the system

func (*MyCareHubDb) DeleteCommunity

func (d *MyCareHubDb) DeleteCommunity(ctx context.Context, communityID string) error

DeleteCommunity deletes the specified community from the database

func (*MyCareHubDb) DeleteFacility

func (d *MyCareHubDb) DeleteFacility(ctx context.Context, identifier *dto.FacilityIdentifierInput) (bool, error)

DeleteFacility does the actual delete of a facility from the database.

func (*MyCareHubDb) DeleteOrganisation

func (d *MyCareHubDb) DeleteOrganisation(ctx context.Context, organisation *domain.Organisation) error

DeleteOrganisation deletes the specified organisation from the database

func (*MyCareHubDb) DeleteRefreshToken

func (d *MyCareHubDb) DeleteRefreshToken(ctx context.Context, signature string) error

DeleteRefreshToken retrieves a refresh token using the signature

func (*MyCareHubDb) DeleteStaffProfile

func (d *MyCareHubDb) DeleteStaffProfile(ctx context.Context, staffID string) error

DeleteStaffProfile is used to delete a staff from the application

func (*MyCareHubDb) FindContacts

func (d *MyCareHubDb) FindContacts(ctx context.Context, contactType, contactValue string) ([]*domain.Contact, error)

FindContacts retrieves all the contacts that match the given contact type and value. Contacts can be shared by users thus the same contact can have multiple records stored

func (*MyCareHubDb) GetAccessToken

func (d *MyCareHubDb) GetAccessToken(ctx context.Context, token domain.AccessToken) (*domain.AccessToken, error)

GetAccessToken retrieves an access token using the signature

func (*MyCareHubDb) GetAllScreeningTools

func (d *MyCareHubDb) GetAllScreeningTools(ctx context.Context, pagination *domain.Pagination) ([]*domain.ScreeningTool, *domain.Pagination, error)

GetAllScreeningTools fetches all screening tools for a client based on set criteria settings

func (*MyCareHubDb) GetAppointment

func (d *MyCareHubDb) GetAppointment(ctx context.Context, params domain.Appointment) (*domain.Appointment, error)

GetAppointment fetches an appointment given the provided parameters

func (*MyCareHubDb) GetAppointmentServiceRequests

func (d *MyCareHubDb) GetAppointmentServiceRequests(ctx context.Context, lastSyncTime time.Time, mflCode string) ([]domain.AppointmentServiceRequests, error)

GetAppointmentServiceRequests fetches all service requests of request type appointment given the last sync time

func (*MyCareHubDb) GetAuthorizationCode

func (d *MyCareHubDb) GetAuthorizationCode(ctx context.Context, code string) (*domain.AuthorizationCode, error)

GetAuthorizationCode retrieves an authorization code using the code

func (*MyCareHubDb) GetAvailableScreeningTools

func (d *MyCareHubDb) GetAvailableScreeningTools(ctx context.Context, clientID string, screeningTool domain.ScreeningTool, screeningToolIDs []string) ([]*domain.ScreeningTool, error)

GetAvailableScreeningTools fetches available screening tools for a client based on set criteria settings

func (*MyCareHubDb) GetCaregiverByUserID

func (d *MyCareHubDb) GetCaregiverByUserID(ctx context.Context, userID string) (*domain.Caregiver, error)

GetCaregiverByUserID returns the caregiver record of the provided user ID

func (*MyCareHubDb) GetCaregiverManagedClients

func (d *MyCareHubDb) GetCaregiverManagedClients(ctx context.Context, userID string, pagination *domain.Pagination) ([]*domain.ManagedClient, *domain.Pagination, error)

GetCaregiverManagedClients lists clients who are managed by the caregivers The clients should have given their consent to be managed by the caregivers

func (*MyCareHubDb) GetCaregiverProfileByCaregiverID

func (d *MyCareHubDb) GetCaregiverProfileByCaregiverID(ctx context.Context, caregiverID string) (*domain.CaregiverProfile, error)

GetCaregiverProfileByCaregiverID retrieves the caregivers profile based on the caregiver ID provided

func (*MyCareHubDb) GetCaregiverProfileByUserID

func (d *MyCareHubDb) GetCaregiverProfileByUserID(ctx context.Context, userID string, organisationID string) (*domain.CaregiverProfile, error)

GetCaregiverProfileByUserID gets the caregiver profile by user ID and organisation ID.

func (*MyCareHubDb) GetCaregiversClient

func (d *MyCareHubDb) GetCaregiversClient(ctx context.Context, caregiverClient domain.CaregiverClient) ([]*domain.CaregiverClient, error)

GetCaregiversClient gets the caregivers clients details

func (*MyCareHubDb) GetClientFacilities

func (d *MyCareHubDb) GetClientFacilities(ctx context.Context, input dto.ClientFacilityInput, pagination *domain.Pagination) ([]*domain.Facility, *domain.Pagination, error)

GetClientFacilities gets a list of client facilities

func (*MyCareHubDb) GetClientHealthDiaryEntries

func (d *MyCareHubDb) GetClientHealthDiaryEntries(ctx context.Context, clientID string, moodType *enums.Mood, shared *bool) ([]*domain.ClientHealthDiaryEntry, error)

GetClientHealthDiaryEntries queries the database to return a clients all health diary records

func (*MyCareHubDb) GetClientHealthDiaryQuote

func (d *MyCareHubDb) GetClientHealthDiaryQuote(ctx context.Context, limit int) ([]*domain.ClientHealthDiaryQuote, error)

GetClientHealthDiaryQuote fetches the health diary quote for the specified user

func (*MyCareHubDb) GetClientIdentifiers

func (d *MyCareHubDb) GetClientIdentifiers(ctx context.Context, clientID string) ([]*domain.Identifier, error)

GetClientIdentifiers retrieves a client's ccc identifier record

func (*MyCareHubDb) GetClientJWT

func (d *MyCareHubDb) GetClientJWT(ctx context.Context, jti string) (*domain.OauthClientJWT, error)

GetClientJWT retrieves a JWT by unique JTI

func (*MyCareHubDb) GetClientProfile

func (d *MyCareHubDb) GetClientProfile(ctx context.Context, userID string, programID string) (*domain.ClientProfile, error)

GetClientProfile fetched a client profile using the supplied user ID. This will be used to return the client details as part of the login response

func (*MyCareHubDb) GetClientProfileByClientID

func (d *MyCareHubDb) GetClientProfileByClientID(ctx context.Context, clientID string) (*domain.ClientProfile, error)

GetClientProfileByClientID retrieves the client for the specified clientID

func (*MyCareHubDb) GetClientProfilesByIdentifier

func (d *MyCareHubDb) GetClientProfilesByIdentifier(ctx context.Context, identifierType, value string) ([]*domain.ClientProfile, error)

GetClientProfilesByIdentifier fetches all client profiles that match the given identifier

func (*MyCareHubDb) GetClientScreeningToolServiceRequestByToolType

func (d *MyCareHubDb) GetClientScreeningToolServiceRequestByToolType(ctx context.Context, clientID, toolType, status string) (*domain.ServiceRequest, error)

GetClientScreeningToolServiceRequestByToolType fetches a screening tool service request by tooltype, client ID and status

func (*MyCareHubDb) GetClientServiceRequestByID

func (d *MyCareHubDb) GetClientServiceRequestByID(ctx context.Context, serviceRequestID string) (*domain.ServiceRequest, error)

GetClientServiceRequestByID fetches a service request by id

func (*MyCareHubDb) GetClientServiceRequests

func (d *MyCareHubDb) GetClientServiceRequests(ctx context.Context, requestType, status, clientID, facilityID string) ([]*domain.ServiceRequest, error)

GetClientServiceRequests fetches all client service requests generated by the system given the status

func (*MyCareHubDb) GetClientUserPrograms

func (d *MyCareHubDb) GetClientUserPrograms(ctx context.Context, userID string) ([]*domain.Program, error)

GetClientUserPrograms retrieves all programs associated with a client user

func (*MyCareHubDb) GetClientsByFilterParams

func (d *MyCareHubDb) GetClientsByFilterParams(ctx context.Context, facilityID *string, filterParams *dto.ClientFilterParamsInput) ([]*domain.ClientProfile, error)

GetClientsByFilterParams fetches clients by filter params

func (*MyCareHubDb) GetClientsByParams

func (d *MyCareHubDb) GetClientsByParams(ctx context.Context, params gorm.Client, lastSyncTime *time.Time) ([]*domain.ClientProfile, error)

GetClientsByParams retrieves client profiles matching the provided parameters

func (*MyCareHubDb) GetClientsInAFacility

func (d *MyCareHubDb) GetClientsInAFacility(ctx context.Context, facilityID string) ([]*domain.ClientProfile, error)

GetClientsInAFacility fetches all the clients that belong to a specific facility

func (*MyCareHubDb) GetCommunityByID

func (d *MyCareHubDb) GetCommunityByID(ctx context.Context, communityID string) (*domain.Community, error)

GetCommunityByID fetches the community by ID

func (*MyCareHubDb) GetContactByUserID

func (d *MyCareHubDb) GetContactByUserID(ctx context.Context, userID *string, contactType string) (*domain.Contact, error)

GetContactByUserID fetches and returns a contact using their user ID

func (*MyCareHubDb) GetCurrentTerms

func (d *MyCareHubDb) GetCurrentTerms(ctx context.Context) (*domain.TermsOfService, error)

GetCurrentTerms fetches the current terms service

func (*MyCareHubDb) GetFacilitiesWithoutFHIRID

func (d *MyCareHubDb) GetFacilitiesWithoutFHIRID(ctx context.Context) ([]*domain.Facility, error)

GetFacilitiesWithoutFHIRID fetches all facilities without FHIR Organisation ID

func (*MyCareHubDb) GetFacilityRespondedScreeningTools

func (d *MyCareHubDb) GetFacilityRespondedScreeningTools(ctx context.Context, facilityID, programID string, pagination *domain.Pagination) ([]*domain.ScreeningTool, *domain.Pagination, error)

GetFacilityRespondedScreeningTools fetches responded screening tools for a given facility

func (*MyCareHubDb) GetFacilityStaffs

func (d *MyCareHubDb) GetFacilityStaffs(ctx context.Context, facilityID string) ([]*domain.StaffProfile, error)

GetFacilityStaffs returns a list of staff at a particular facility

func (*MyCareHubDb) GetHealthDiaryEntryByID

func (d *MyCareHubDb) GetHealthDiaryEntryByID(ctx context.Context, healthDiaryEntryID string) (*domain.ClientHealthDiaryEntry, error)

GetHealthDiaryEntryByID gets the health diary entry with the given ID

func (*MyCareHubDb) GetNotification

func (d *MyCareHubDb) GetNotification(ctx context.Context, notificationID string) (*domain.Notification, error)

GetNotification retrieve a notification using the provided ID

func (*MyCareHubDb) GetOTP

func (d *MyCareHubDb) GetOTP(ctx context.Context, phoneNumber string, flavour feedlib.Flavour) (*domain.OTP, error)

GetOTP fetches the OTP for the specified user.

func (*MyCareHubDb) GetOauthClient

func (d *MyCareHubDb) GetOauthClient(ctx context.Context, id string) (*domain.OauthClient, error)

GetOauthClient retrieves a client by ID

func (*MyCareHubDb) GetOrCreateContact

func (d *MyCareHubDb) GetOrCreateContact(ctx context.Context, contact *domain.Contact) (*domain.Contact, error)

GetOrCreateContact creates a contact

func (*MyCareHubDb) GetOrCreateNextOfKin

func (d *MyCareHubDb) GetOrCreateNextOfKin(ctx context.Context, person *dto.NextOfKinPayload, clientID, contactID string) error

GetOrCreateNextOfKin creates a related person who is a next of kin

func (*MyCareHubDb) GetOrganisation

func (d *MyCareHubDb) GetOrganisation(ctx context.Context, id string) (*domain.Organisation, error)

GetOrganisation retrieves an organisation using the provided id

func (*MyCareHubDb) GetPendingServiceRequestsCount

func (d *MyCareHubDb) GetPendingServiceRequestsCount(ctx context.Context, facilityID string, programID string) (*domain.ServiceRequestsCountResponse, error)

GetPendingServiceRequestsCount gets the total number of service requests

func (*MyCareHubDb) GetProgramByID

func (d *MyCareHubDb) GetProgramByID(ctx context.Context, programID string) (*domain.Program, error)

GetProgramByID retrieves a program by its ID

func (*MyCareHubDb) GetProgramClientProfileByIdentifier

func (d *MyCareHubDb) GetProgramClientProfileByIdentifier(ctx context.Context, programID, identifierType, value string) (*domain.ClientProfile, error)

GetProgramClientProfileByIdentifier fetches a client using their CCC number

func (*MyCareHubDb) GetProgramFacilities

func (d *MyCareHubDb) GetProgramFacilities(ctx context.Context, programID string) ([]*domain.Facility, error)

GetProgramFacilities gets the facilities that belong the program

func (*MyCareHubDb) GetRecentHealthDiaryEntries

func (d *MyCareHubDb) GetRecentHealthDiaryEntries(
	ctx context.Context,
	lastSyncTime time.Time,
	client *domain.ClientProfile,
) ([]*domain.ClientHealthDiaryEntry, error)

GetRecentHealthDiaryEntries queries the database for health diary entries that were recorded after the last time the entries were synced to KenyaEMR.

func (*MyCareHubDb) GetRefreshToken

func (d *MyCareHubDb) GetRefreshToken(ctx context.Context, token domain.RefreshToken) (*domain.RefreshToken, error)

GetRefreshToken retrieves a refresh token using the signature

func (*MyCareHubDb) GetScreeningToolByID

func (d *MyCareHubDb) GetScreeningToolByID(ctx context.Context, toolID string) (*domain.ScreeningTool, error)

GetScreeningToolByID fetches a screening tool by ID including the whole questions payload

func (*MyCareHubDb) GetScreeningToolRespondents

func (d *MyCareHubDb) GetScreeningToolRespondents(ctx context.Context, facilityID, programID string, screeningToolID string, searchTerm string, paginationInput *dto.PaginationsInput) ([]*domain.ScreeningToolRespondent, *domain.Pagination, error)

GetScreeningToolRespondents fetches the respondents for a screening tool

func (*MyCareHubDb) GetScreeningToolResponseByID

func (d *MyCareHubDb) GetScreeningToolResponseByID(ctx context.Context, id string) (*domain.QuestionnaireScreeningToolResponse, error)

GetScreeningToolResponseByID fetches a screening tool response by ID

func (*MyCareHubDb) GetScreeningToolResponsesWithPendingServiceRequests

func (d *MyCareHubDb) GetScreeningToolResponsesWithPendingServiceRequests(ctx context.Context, clientID, programID string) ([]*domain.QuestionnaireScreeningToolResponse, error)

GetScreeningToolResponsesWithPendingServiceRequests gets the user screening response that have pending service requests

func (*MyCareHubDb) GetScreeningToolResponsesWithin24Hours

func (d *MyCareHubDb) GetScreeningToolResponsesWithin24Hours(ctx context.Context, clientID, programID string) ([]*domain.QuestionnaireScreeningToolResponse, error)

GetScreeningToolResponsesWithin24Hours gets the user screening response that are within 24 hours

func (*MyCareHubDb) GetSecurityQuestionByID

func (d *MyCareHubDb) GetSecurityQuestionByID(ctx context.Context, securityQuestionID *string) (*domain.SecurityQuestion, error)

GetSecurityQuestionByID fetches a security question by ID

func (*MyCareHubDb) GetSecurityQuestionResponse

func (d *MyCareHubDb) GetSecurityQuestionResponse(ctx context.Context, questionID string, userID string) (*domain.SecurityQuestionResponse, error)

GetSecurityQuestionResponse returns the security question response from the database

func (*MyCareHubDb) GetSecurityQuestions

func (d *MyCareHubDb) GetSecurityQuestions(ctx context.Context, flavour feedlib.Flavour) ([]*domain.SecurityQuestion, error)

GetSecurityQuestions fetches all the security questions

func (*MyCareHubDb) GetServiceRequests

func (d *MyCareHubDb) GetServiceRequests(ctx context.Context, requestType, requestStatus *string, facilityID string, programID string, flavour feedlib.Flavour, pagination *domain.Pagination) ([]*domain.ServiceRequest, *domain.Pagination, error)

GetServiceRequests retrieves the service requests by the type passed in the parameters

func (*MyCareHubDb) GetServiceRequestsForKenyaEMR

func (d *MyCareHubDb) GetServiceRequestsForKenyaEMR(ctx context.Context, payload *dto.ServiceRequestPayload) ([]*domain.ServiceRequest, error)

GetServiceRequestsForKenyaEMR retrieves from the database all service requests belonging to a specific facility

func (*MyCareHubDb) GetSharedHealthDiaryEntries

func (d *MyCareHubDb) GetSharedHealthDiaryEntries(ctx context.Context, clientID string, facilityID string) ([]*domain.ClientHealthDiaryEntry, error)

GetSharedHealthDiaryEntries fetches the most recent shared health diary entry

func (*MyCareHubDb) GetStaffFacilities

func (d *MyCareHubDb) GetStaffFacilities(ctx context.Context, input dto.StaffFacilityInput, pagination *domain.Pagination) ([]*domain.Facility, *domain.Pagination, error)

GetStaffFacilities gets a list of staff facilities

func (*MyCareHubDb) GetStaffProfile

func (d *MyCareHubDb) GetStaffProfile(ctx context.Context, userID string, programID string) (*domain.StaffProfile, error)

GetStaffProfile fetches the staff's profile using the user's ID and returns the staff's profile in the login response.

func (*MyCareHubDb) GetStaffProfileByStaffID

func (d *MyCareHubDb) GetStaffProfileByStaffID(ctx context.Context, staffID string) (*domain.StaffProfile, error)

GetStaffProfileByStaffID is used to retrieve staff profile using their staff ID

func (*MyCareHubDb) GetStaffServiceRequestByID

func (d *MyCareHubDb) GetStaffServiceRequestByID(ctx context.Context, serviceRequestID string) (*domain.ServiceRequest, error)

GetStaffServiceRequestByID gets the specified staff service request by ID

func (*MyCareHubDb) GetStaffUserPrograms

func (d *MyCareHubDb) GetStaffUserPrograms(ctx context.Context, userID string) ([]*domain.Program, error)

GetStaffUserPrograms retrieves all programs associated with a staff user

func (*MyCareHubDb) GetSurveyServiceRequestUser

func (d *MyCareHubDb) GetSurveyServiceRequestUser(ctx context.Context, facilityID string, projectID int, formID string, pagination *domain.Pagination) ([]*domain.SurveyServiceRequestUser, *domain.Pagination, error)

GetSurveyServiceRequestUser returns a list of users who have a survey service request

func (*MyCareHubDb) GetSurveysWithServiceRequests

func (d *MyCareHubDb) GetSurveysWithServiceRequests(ctx context.Context, facilityID, programID string) ([]*dto.SurveysWithServiceRequest, error)

GetSurveysWithServiceRequests fetches all the surveys with a service request for a given facility

func (*MyCareHubDb) GetUserClientProfiles

func (d *MyCareHubDb) GetUserClientProfiles(ctx context.Context, userID string) ([]*domain.ClientProfile, error)

GetUserClientProfiles gets all client profiles for a given user

func (*MyCareHubDb) GetUserPINByUserID

func (d *MyCareHubDb) GetUserPINByUserID(ctx context.Context, userID string) (*domain.UserPIN, error)

GetUserPINByUserID fetches a user pin by the user ID

func (*MyCareHubDb) GetUserProfileByPhoneNumber

func (d *MyCareHubDb) GetUserProfileByPhoneNumber(ctx context.Context, phoneNumber string) (*domain.User, error)

GetUserProfileByPhoneNumber fetches and returns a userprofile using their phonenumber

func (*MyCareHubDb) GetUserProfileByPushToken

func (d *MyCareHubDb) GetUserProfileByPushToken(ctx context.Context, pushToken string) (*domain.User, error)

GetUserProfileByPushToken is used to fetch user's profile using their device token. Device token is unique for every user

func (*MyCareHubDb) GetUserProfileByStaffID

func (d *MyCareHubDb) GetUserProfileByStaffID(ctx context.Context, staffID string) (*domain.User, error)

GetUserProfileByStaffID fetches a user profile using their staff ID

func (*MyCareHubDb) GetUserProfileByUserID

func (d *MyCareHubDb) GetUserProfileByUserID(ctx context.Context, userID string) (*domain.User, error)

GetUserProfileByUserID fetches and returns a userprofile using their user ID

func (*MyCareHubDb) GetUserProfileByUsername

func (d *MyCareHubDb) GetUserProfileByUsername(ctx context.Context, username string) (*domain.User, error)

GetUserProfileByUsername retrieves a user using their username

func (*MyCareHubDb) GetUserSecurityQuestionsResponses

func (d *MyCareHubDb) GetUserSecurityQuestionsResponses(ctx context.Context, userID, flavour string) ([]*domain.SecurityQuestionResponse, error)

GetUserSecurityQuestionsResponses fetches all the security questions that the user has responded to

func (*MyCareHubDb) GetUserStaffProfiles

func (d *MyCareHubDb) GetUserStaffProfiles(ctx context.Context, userID string) ([]*domain.StaffProfile, error)

GetUserStaffProfiles gets all staff profiles for a given user

func (*MyCareHubDb) GetUserSurveyForms

func (d *MyCareHubDb) GetUserSurveyForms(ctx context.Context, params map[string]interface{}) ([]*domain.UserSurvey, error)

GetUserSurveyForms retrives all user survey forms

func (*MyCareHubDb) GetValidClientJWT

func (d *MyCareHubDb) GetValidClientJWT(ctx context.Context, jti string) (*domain.OauthClientJWT, error)

GetValidClientJWT retrieves a JWT that is still valid i.e not expired

func (*MyCareHubDb) InactivateFacility

func (d *MyCareHubDb) InactivateFacility(ctx context.Context, identifier *dto.FacilityIdentifierInput) (bool, error)

InactivateFacility changes the status of an active facility from true to false

func (*MyCareHubDb) InvalidatePIN

func (d *MyCareHubDb) InvalidatePIN(ctx context.Context, userID string) (bool, error)

InvalidatePIN invalidates a pin that is linked to the user profile. This is done by toggling the IsValid field to false

func (*MyCareHubDb) ListAppointments

func (d *MyCareHubDb) ListAppointments(ctx context.Context, params *domain.Appointment, filters []*firebasetools.FilterParam, pagination *domain.Pagination) ([]*domain.Appointment, *domain.Pagination, error)

ListAppointments lists appointments at a facility

func (*MyCareHubDb) ListAvailableNotificationTypes

func (d *MyCareHubDb) ListAvailableNotificationTypes(ctx context.Context, params *domain.Notification) ([]enums.NotificationType, error)

ListAvailableNotificationTypes retrieves the distinct notification types available for a user

func (*MyCareHubDb) ListBookings

func (d *MyCareHubDb) ListBookings(ctx context.Context, clientID string, bookingState enums.BookingState, pagination *domain.Pagination) ([]*domain.Booking, *domain.Pagination, error)

ListBookings is used to list available bookings, whether active or not

func (*MyCareHubDb) ListClientsCaregivers

func (d *MyCareHubDb) ListClientsCaregivers(ctx context.Context, clientID string, pagination *domain.Pagination) (*domain.ClientCaregivers, *domain.Pagination, error)

ListClientsCaregivers retrieves a list of clients caregivers

func (*MyCareHubDb) ListCommunities

func (d *MyCareHubDb) ListCommunities(ctx context.Context, programID string, organisationID string) ([]*domain.Community, error)

ListCommunities is used to list Matrix communities(rooms)

func (*MyCareHubDb) ListFacilities

func (d *MyCareHubDb) ListFacilities(ctx context.Context, searchTerm *string, filterInput []*dto.FiltersInput, paginationsInput *domain.Pagination) ([]*domain.Facility, *domain.Pagination, error)

ListFacilities returns a slice of healthcare facilities in the platform.

func (*MyCareHubDb) ListNotifications

func (d *MyCareHubDb) ListNotifications(ctx context.Context, params *domain.Notification, filters []*firebasetools.FilterParam, pagination *domain.Pagination) ([]*domain.Notification, *domain.Pagination, error)

ListNotifications lists notifications based on the provided parameters

func (*MyCareHubDb) ListOrganisations

func (d *MyCareHubDb) ListOrganisations(ctx context.Context, pagination *domain.Pagination) ([]*domain.Organisation, *domain.Pagination, error)

ListOrganisations lists all organisations

func (*MyCareHubDb) ListProgramFacilities

func (d *MyCareHubDb) ListProgramFacilities(ctx context.Context, programID, searchTerm *string, filterInput []*dto.FiltersInput, paginationsInput *domain.Pagination) ([]*domain.Facility, *domain.Pagination, error)

ListProgramFacilities gets facilities that are filtered from search and filter, the results are also paginated

func (*MyCareHubDb) ListPrograms

func (d *MyCareHubDb) ListPrograms(ctx context.Context, organisationID *string, pagination *domain.Pagination) ([]*domain.Program, *domain.Pagination, error)

ListPrograms gets a list of programs

func (*MyCareHubDb) ListSurveyRespondents

func (d *MyCareHubDb) ListSurveyRespondents(ctx context.Context, params *domain.UserSurvey, facilityID string, pagination *domain.Pagination) ([]*domain.SurveyRespondent, *domain.Pagination, error)

ListSurveyRespondents lists survey respondents based on the provided parameters

func (*MyCareHubDb) ReactivateFacility

func (d *MyCareHubDb) ReactivateFacility(ctx context.Context, identifier *dto.FacilityIdentifierInput) (bool, error)

ReactivateFacility changes the status of an active facility from false to true

func (*MyCareHubDb) RegisterCaregiver

func (d *MyCareHubDb) RegisterCaregiver(ctx context.Context, input *domain.CaregiverRegistration) (*domain.CaregiverProfile, error)

RegisterCaregiver registers a new caregiver on the platform

func (*MyCareHubDb) RegisterClient

RegisterClient registers a client in the database

func (*MyCareHubDb) RegisterExistingUserAsCaregiver

func (d *MyCareHubDb) RegisterExistingUserAsCaregiver(ctx context.Context, input *domain.CaregiverRegistration) (*domain.CaregiverProfile, error)

RegisterExistingUserAsCaregiver registers an existing user as a caregiver

func (*MyCareHubDb) RegisterExistingUserAsClient

func (d *MyCareHubDb) RegisterExistingUserAsClient(ctx context.Context, payload *domain.ClientRegistrationPayload) (*domain.ClientProfile, error)

RegisterExistingUserAsClient registers an existing user as a client and returns the client profile

func (*MyCareHubDb) RegisterExistingUserAsStaff

func (d *MyCareHubDb) RegisterExistingUserAsStaff(ctx context.Context, payload *domain.StaffRegistrationPayload) (*domain.StaffProfile, error)

RegisterExistingUserAsStaff is used to create a staff profile of an already existing user in a certain program

func (*MyCareHubDb) RegisterStaff

func (d *MyCareHubDb) RegisterStaff(ctx context.Context, payload *domain.StaffRegistrationPayload) (*domain.StaffProfile, error)

RegisterStaff registers a new staff member into the portal

func (*MyCareHubDb) RemoveFacilitiesFromClientProfile

func (d *MyCareHubDb) RemoveFacilitiesFromClientProfile(ctx context.Context, clientID string, facilities []string) error

RemoveFacilitiesFromClientProfile updates the client profile and removes the specified facilities in their assigned facilities

func (*MyCareHubDb) RemoveFacilitiesFromStaffProfile

func (d *MyCareHubDb) RemoveFacilitiesFromStaffProfile(ctx context.Context, staffID string, facilities []string) error

RemoveFacilitiesFromStaffProfile updates the staff profile and removes the specified facilities in their assigned facilities

func (*MyCareHubDb) ResolveServiceRequest

func (d *MyCareHubDb) ResolveServiceRequest(ctx context.Context, staffID *string, serviceRequestID *string, status string, action []string, comment *string) error

ResolveServiceRequest resolves a service request

func (*MyCareHubDb) ResolveStaffServiceRequest

func (d *MyCareHubDb) ResolveStaffServiceRequest(ctx context.Context, staffID *string, serviceRequestID *string, verificationStatus string) (bool, error)

ResolveStaffServiceRequest resolves a staff's service request

func (*MyCareHubDb) RetrieveFacility

func (d *MyCareHubDb) RetrieveFacility(ctx context.Context, id *string, isActive bool) (*domain.Facility, error)

RetrieveFacility gets a facility by ID from the database

func (*MyCareHubDb) RetrieveFacilityByIdentifier

func (d *MyCareHubDb) RetrieveFacilityByIdentifier(ctx context.Context, identifier *dto.FacilityIdentifierInput, isActive bool) (*domain.Facility, error)

RetrieveFacilityByIdentifier gets a facility by ID from the database

func (*MyCareHubDb) ReturnClientsServiceRequests

func (d *MyCareHubDb) ReturnClientsServiceRequests(ctx context.Context, clientServiceRequests []*gorm.ClientServiceRequest) ([]*domain.ServiceRequest, error)

ReturnClientsServiceRequests returns all the clients service requests

func (*MyCareHubDb) ReturnStaffServiceRequests

func (d *MyCareHubDb) ReturnStaffServiceRequests(ctx context.Context, staffServiceRequests []*gorm.StaffServiceRequest) ([]*domain.ServiceRequest, error)

ReturnStaffServiceRequests returns a response of all the staffs service requests

func (*MyCareHubDb) SaveFeedback

func (d *MyCareHubDb) SaveFeedback(ctx context.Context, payload *domain.FeedbackResponse) error

SaveFeedback saves a feedback to the database

func (*MyCareHubDb) SaveNotification

func (d *MyCareHubDb) SaveNotification(ctx context.Context, payload *domain.Notification) error

SaveNotification saves a notification in the database

func (*MyCareHubDb) SaveOTP

func (d *MyCareHubDb) SaveOTP(ctx context.Context, otpInput *domain.OTP) error

SaveOTP saves the otp to the database

func (*MyCareHubDb) SavePin

func (d *MyCareHubDb) SavePin(ctx context.Context, pinInput *domain.UserPIN) (bool, error)

SavePin gets the pin details from the user and saves it in the database

func (*MyCareHubDb) SaveSecurityQuestionResponse

func (d *MyCareHubDb) SaveSecurityQuestionResponse(ctx context.Context, securityQuestionResponse []*dto.SecurityQuestionResponseInput) error

SaveSecurityQuestionResponse saves the security question response to the database

func (*MyCareHubDb) SaveTemporaryUserPin

func (d *MyCareHubDb) SaveTemporaryUserPin(ctx context.Context, pinData *domain.UserPIN) (bool, error)

SaveTemporaryUserPin does the actual saving of the users PIN in the database

func (*MyCareHubDb) SearchCaregiverUser

func (d *MyCareHubDb) SearchCaregiverUser(ctx context.Context, searchParameter string) ([]*domain.CaregiverProfile, error)

SearchCaregiverUser searches for the caregiver user(s) based on the passed parameter. Search parameter can be username, phonenumber or caregiver number. the results are scoped to the program of the healthcare worker

func (*MyCareHubDb) SearchClientProfile

func (d *MyCareHubDb) SearchClientProfile(ctx context.Context, searchParameter string) ([]*domain.ClientProfile, error)

SearchClientProfile searches for client profiles with the specified CCC number, phonenumber or username It returns a list of profiles that match the passed parameter

func (*MyCareHubDb) SearchClientServiceRequests

func (d *MyCareHubDb) SearchClientServiceRequests(ctx context.Context, searchParameter string, requestType string, facilityID string) ([]*domain.ServiceRequest, error)

SearchClientServiceRequests is used to query(search) for client service requests depending on the search parameter

func (*MyCareHubDb) SearchOrganisation

func (d *MyCareHubDb) SearchOrganisation(ctx context.Context, searchParameter string) ([]*domain.Organisation, error)

SearchOrganisation searches for organisations based on the search parameter provided

func (*MyCareHubDb) SearchPlatformCaregivers

func (d *MyCareHubDb) SearchPlatformCaregivers(ctx context.Context, searchParameter string) ([]*domain.CaregiverProfile, error)

SearchPlatformCaregivers searches for the caregiver user(s) based on the passed parameter. Search parameter can be username, phonenumber or caregiver number. the results are scoped to the whole platform

func (*MyCareHubDb) SearchPrograms

func (d *MyCareHubDb) SearchPrograms(ctx context.Context, searchParameter string, organisationID string, pagination *domain.Pagination) ([]*domain.Program, *domain.Pagination, error)

SearchPrograms searches for programs based on the search parameter provided and from the provided organisation

func (*MyCareHubDb) SearchStaffProfile

func (d *MyCareHubDb) SearchStaffProfile(ctx context.Context, searchParameter string, programID *string) ([]*domain.StaffProfile, error)

SearchStaffProfile searches for the staff profile(s) based on the passed parameter. It might be a username, phonenumber or staff number. It uses pattern matching and returns all values that match the parameter passed

func (*MyCareHubDb) SearchStaffServiceRequests

func (d *MyCareHubDb) SearchStaffServiceRequests(ctx context.Context, searchParameter string, requestType string, facilityID string) ([]*domain.ServiceRequest, error)

SearchStaffServiceRequests is used to query(search) for staff's service requests depending on the search parameter

func (*MyCareHubDb) SetInProgressBy

func (d *MyCareHubDb) SetInProgressBy(ctx context.Context, requestID string, staffID string) (bool, error)

SetInProgressBy updates the the value of the staff assigned to a service request

func (*MyCareHubDb) UpdateAccessToken

func (d *MyCareHubDb) UpdateAccessToken(ctx context.Context, token *domain.AccessToken, updateData map[string]interface{}) error

UpdateAccessToken updates the details of a given access token

func (*MyCareHubDb) UpdateAppointment

func (d *MyCareHubDb) UpdateAppointment(ctx context.Context, appointment *domain.Appointment, updateData map[string]interface{}) (*domain.Appointment, error)

UpdateAppointment updates an appointment

func (*MyCareHubDb) UpdateAuthorizationCode

func (d *MyCareHubDb) UpdateAuthorizationCode(ctx context.Context, code *domain.AuthorizationCode, updateData map[string]interface{}) error

UpdateAuthorizationCode updates the details of a given code

func (*MyCareHubDb) UpdateBooking

func (d *MyCareHubDb) UpdateBooking(ctx context.Context, booking *domain.Booking, updateData map[string]interface{}) error

UpdateBooking updates the booking model given the models data and the update data

func (*MyCareHubDb) UpdateCaregiver

func (d *MyCareHubDb) UpdateCaregiver(ctx context.Context, caregiver *domain.CaregiverProfile, updates map[string]interface{}) error

UpdateCaregiver updates the caregiver profile

func (*MyCareHubDb) UpdateCaregiverClient

func (d *MyCareHubDb) UpdateCaregiverClient(ctx context.Context, caregiverClient *domain.CaregiverClient, updateData map[string]interface{}) error

UpdateCaregiverClient updates the caregiver client details for either the caregiver or client.

func (*MyCareHubDb) UpdateClient

func (d *MyCareHubDb) UpdateClient(ctx context.Context, client *domain.ClientProfile, updates map[string]interface{}) (*domain.ClientProfile, error)

UpdateClient updates the client details for a particular client

func (*MyCareHubDb) UpdateClientIdentifier

func (d *MyCareHubDb) UpdateClientIdentifier(ctx context.Context, clientID string, identifierType string, identifierValue string, programID string) error

UpdateClientIdentifier updates the client identifier details for a particular client

func (*MyCareHubDb) UpdateClientServiceRequest

func (d *MyCareHubDb) UpdateClientServiceRequest(ctx context.Context, clientServiceRequest *domain.ServiceRequest, updateData map[string]interface{}) error

UpdateClientServiceRequest updates the service request with the provided service request details

func (*MyCareHubDb) UpdateFacility

func (d *MyCareHubDb) UpdateFacility(ctx context.Context, facility *domain.Facility, updateData map[string]interface{}) error

UpdateFacility updates the facility with the provided facility details

func (*MyCareHubDb) UpdateFailedSecurityQuestionsAnsweringAttempts

func (d *MyCareHubDb) UpdateFailedSecurityQuestionsAnsweringAttempts(ctx context.Context, userID string, failCount int) error

UpdateFailedSecurityQuestionsAnsweringAttempts resets the failed attempts for answered security questions

func (*MyCareHubDb) UpdateHealthDiary

func (d *MyCareHubDb) UpdateHealthDiary(ctx context.Context, clientHealthDiaryEntry *domain.ClientHealthDiaryEntry, updateData map[string]interface{}) error

UpdateHealthDiary updates the status of the specified health diary

func (*MyCareHubDb) UpdateIsCorrectSecurityQuestionResponse

func (d *MyCareHubDb) UpdateIsCorrectSecurityQuestionResponse(ctx context.Context, userID string, isCorrectSecurityQuestionResponse bool) (bool, error)

UpdateIsCorrectSecurityQuestionResponse updates the user's security question response

func (*MyCareHubDb) UpdateNotification

func (d *MyCareHubDb) UpdateNotification(ctx context.Context, notification *domain.Notification, updateData map[string]interface{}) error

UpdateNotification updates the notification with the provided notification details

func (*MyCareHubDb) UpdateProgram

func (d *MyCareHubDb) UpdateProgram(ctx context.Context, program *domain.Program, updateData map[string]interface{}) error

UpdateProgram update the details of a particular program

func (*MyCareHubDb) UpdateRefreshToken

func (d *MyCareHubDb) UpdateRefreshToken(ctx context.Context, token *domain.RefreshToken, updateData map[string]interface{}) error

UpdateRefreshToken updates the details of a given refresh token

func (*MyCareHubDb) UpdateServiceRequests

func (d *MyCareHubDb) UpdateServiceRequests(ctx context.Context, payload *domain.UpdateServiceRequestsPayload) (bool, error)

UpdateServiceRequests updates service requests

func (*MyCareHubDb) UpdateStaff

func (d *MyCareHubDb) UpdateStaff(ctx context.Context, staff *domain.StaffProfile, updates map[string]interface{}) error

UpdateStaff updates the staff details for a particular staff

func (*MyCareHubDb) UpdateUser

func (d *MyCareHubDb) UpdateUser(ctx context.Context, user *domain.User, updateData map[string]interface{}) error

UpdateUser updates the user details

func (*MyCareHubDb) UpdateUserContact

func (d *MyCareHubDb) UpdateUserContact(ctx context.Context, contact *domain.Contact, updateData map[string]interface{}) error

UpdateUserContact is used to updates the user's contact details

func (*MyCareHubDb) UpdateUserPinChangeRequiredStatus

func (d *MyCareHubDb) UpdateUserPinChangeRequiredStatus(ctx context.Context, userID string, flavour feedlib.Flavour, status bool) error

UpdateUserPinChangeRequiredStatus updates a users pin_change_required status. This will be used to redirect a user to the change pin page on the app

func (*MyCareHubDb) UpdateUserPinUpdateRequiredStatus

func (d *MyCareHubDb) UpdateUserPinUpdateRequiredStatus(ctx context.Context, userID string, flavour feedlib.Flavour, status bool) error

UpdateUserPinUpdateRequiredStatus updates a users pin_update_required status. This will enable to redirect a user to the change pin page on the app

func (*MyCareHubDb) UpdateUserSurveys

func (d *MyCareHubDb) UpdateUserSurveys(ctx context.Context, survey *domain.UserSurvey, updateData map[string]interface{}) error

UpdateUserSurveys updates the user surveys. The update is performed with regard to the data passed in the survey model.

func (*MyCareHubDb) VerifyOTP

func (d *MyCareHubDb) VerifyOTP(ctx context.Context, payload *dto.VerifyOTPInput) (bool, error)

VerifyOTP performs the checking of OTP's existence for the specified user.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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