datastore

package
v0.0.0-...-53e80a7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssociateStatusActive   = 1
	AssociateStatusArchived = 2

	AssociateDeactivationReasonNotSpecified  = 0
	AssociateDeactivationReasonOther         = 1
	AssociateDeactivationReasonBlacklisted   = 2
	AssociateDeactivationReasonMoved         = 3
	AssociateDeactivationReasonDeceased      = 4
	AssociateDeactivationReasonDoNotConstact = 5

	AssociateTypeUnassigned  = 1
	AssociateTypeResidential = 2
	AssociateTypeCommercial  = 3

	AssociatePhoneTypeLandline = 1
	AssociatePhoneTypeMobile   = 2
	AssociatePhoneTypeWork     = 3

	AssociateGenderOther          = 1
	AssociateGenderMale           = 2
	AssociateGenderFemale         = 3
	AssociateGenderTransgender    = 4
	AssociateGenderNonBinary      = 5
	AssociateGenderTwoSpirit      = 6
	AssociateGenderPreferNotToSay = 7
	AssociateGenderDoNotKnow      = 8

	AssociateIdentifyAsOther                = 1
	AssociateIdentifyAsPreferNotToSay       = 2
	AssociateIdentifyAsWomen                = 3
	AssociateIdentifyAsNewcomer             = 4
	AssociateIdentifyAsRacializedPerson     = 5
	AssociateIdentifyAsVeteran              = 6
	AssociateIdentifyAsFrancophone          = 7
	AssociateIdentifyAsPersonWithDisability = 8
	AssociateIdentifyAsInuit                = 9
	AssociateIdentifyAsFirstNations         = 10
	AssociateIdentifyAsMetis                = 11

	AssociateIsJobSeekerYes = 1
	AssociateIsJobSeekerNo  = 2

	StatusInCountryOther                      = 1
	StatusInCountryCanadaCitizen              = 2
	StatusInCountryPermanentResident          = 3
	StatusInCountryNaturalizedCanadianCitizen = 4
	StatusInCountryProtectedPersons           = 5
	StatusInCountryPreferNotToSay             = 6
)
View Source
const (
	MaritalStatusOther          = 1
	MaritalStatusMarried        = 2
	MaritalStatusCommonLaw      = 3
	MaritalStatusDivorced       = 4
	MaritalStatusSeparated      = 5
	MaritalStatusWidowed        = 6
	MaritalStatusSingle         = 7
	MaritalStatusPreferNotToSay = 8
)
View Source
const (
	AccomplishedEducationOther                       = 1
	AccomplishedEducationGrade0To8                   = 2
	AccomplishedEducationGrade9                      = 3
	AccomplishedEducationGrade10                     = 4
	AccomplishedEducationGrade11                     = 5
	AccomplishedEducationGrade12OrEquivalent         = 6
	AccomplishedEducationOAC                         = 7
	AccomplishedEducationCertificateOfApprenticeship = 8
	AccomplishedEducationJourneyperson               = 9
	AccomplishedEducationCertificateOrDiploma        = 10
	AccomplishedEducationBachelorsDegree             = 11
	AccomplishedEducationPostGraduate                = 12
)
View Source
const (
	OrderAscending  = 1
	OrderDescending = -1
)

Variables

View Source
var AssociateGenderLabels = map[int8]string{
	AssociateGenderOther:          "Other",
	AssociateGenderMale:           "Male",
	AssociateGenderFemale:         "Female",
	AssociateGenderNonBinary:      "Non-Binary",
	AssociateGenderTwoSpirit:      "Two Spirit",
	AssociateGenderPreferNotToSay: "Prefer Not To Say",
	AssociateGenderDoNotKnow:      "Do Not Know",
}
View Source
var AssociateMaritalStatusLabels = map[int8]string{
	MaritalStatusOther:          "Other",
	MaritalStatusMarried:        "Married",
	MaritalStatusCommonLaw:      "Common Law",
	MaritalStatusDivorced:       "Divorced",
	MaritalStatusSeparated:      "Separated",
	MaritalStatusWidowed:        "Widowed",
	MaritalStatusSingle:         "Single",
	MaritalStatusPreferNotToSay: "Prefer not to say",
}
View Source
var AssociateOrganizationTypeLabels = map[int8]string{
	1: "Unknown",
	2: "Private",
	3: "Non-Profit",
	4: "Government",
}
View Source
var AssociateStateLabels = map[int8]string{
	AssociateStatusActive:   "Active",
	AssociateStatusArchived: "Archived",
}
View Source
var AssociateTelephoneTypeLabels = map[int8]string{
	1: "Landline",
	2: "Mobile",
	3: "Work",
}
View Source
var AssociateTypeLabels = map[int8]string{
	AssociateTypeResidential: "Residential",
	AssociateTypeCommercial:  "Commercial",
	AssociateTypeUnassigned:  "Unassigned",
}

Functions

This section is empty.

Types

type Associate

type Associate struct {
	ID                                   primitive.ObjectID               `bson:"_id" json:"id"`
	PublicID                             uint64                           `bson:"public_id" json:"public_id"`
	TenantID                             primitive.ObjectID               `bson:"tenant_id" json:"tenant_id,omitempty"`
	FirstName                            string                           `bson:"first_name" json:"first_name"`
	LastName                             string                           `bson:"last_name" json:"last_name"`
	Name                                 string                           `bson:"name" json:"name"`
	LexicalName                          string                           `bson:"lexical_name" json:"lexical_name"`
	Email                                string                           `bson:"email" json:"email"`
	PersonalEmail                        string                           `bson:"personal_email" json:"personal_email"`
	IsOkToEmail                          bool                             `bson:"is_ok_to_email" json:"is_ok_to_email"`
	Phone                                string                           `bson:"phone" json:"phone,omitempty"`
	PhoneType                            int8                             `bson:"phone_type" json:"phone_type"`
	PhoneExtension                       string                           `bson:"phone_extension" json:"phone_extension"`
	IsOkToText                           bool                             `bson:"is_ok_to_text" json:"is_ok_to_text"`
	FaxNumber                            string                           `bson:"fax_number" json:"fax_number"`
	OtherPhone                           string                           `bson:"other_phone" json:"other_phone"`
	OtherPhoneExtension                  string                           `bson:"other_phone_extension" json:"other_phone_extension"`
	OtherPhoneType                       int8                             `bson:"other_phone_type" json:"other_phone_type"`
	Country                              string                           `bson:"country" json:"country,omitempty"`
	Region                               string                           `bson:"region" json:"region,omitempty"`
	City                                 string                           `bson:"city" json:"city,omitempty"`
	PostalCode                           string                           `bson:"postal_code" json:"postal_code,omitempty"`
	AddressLine1                         string                           `bson:"address_line1" json:"address_line1,omitempty"`
	AddressLine2                         string                           `bson:"address_line2" json:"address_line2,omitempty"`
	PostOfficeBoxNumber                  string                           `bson:"post_office_box_number" json:"post_office_box_number"`
	FullAddressWithoutPostalCode         string                           `bson:"full_address_without_postal_code" json:"full_address_without_postal_code,omitempty"` // Compiled value
	FullAddressWithPostalCode            string                           `bson:"full_address_with_postal_code" json:"full_address_with_postal_code,omitempty"`       // Compiled value
	FullAddressURL                       string                           `bson:"full_address_url" json:"full_address_url,omitempty"`                                 // Compiled value
	HasShippingAddress                   bool                             `bson:"has_shipping_address" json:"has_shipping_address,omitempty"`
	ShippingName                         string                           `bson:"shipping_name" json:"shipping_name,omitempty"`
	ShippingPhone                        string                           `bson:"shipping_phone" json:"shipping_phone,omitempty"`
	ShippingCountry                      string                           `bson:"shipping_country" json:"shipping_country,omitempty"`
	ShippingRegion                       string                           `bson:"shipping_region" json:"shipping_region,omitempty"`
	ShippingCity                         string                           `bson:"shipping_city" json:"shipping_city,omitempty"`
	ShippingPostalCode                   string                           `bson:"shipping_postal_code" json:"shipping_postal_code,omitempty"`
	ShippingAddressLine1                 string                           `bson:"shipping_address_line1" json:"shipping_address_line1,omitempty"`
	ShippingAddressLine2                 string                           `bson:"shipping_address_line2" json:"shipping_address_line2,omitempty"`
	ShippingPostOfficeBoxNumber          string                           `bson:"shipping_post_office_box_number" json:"shipping_post_office_box_number"`
	ShippingFullAddressWithoutPostalCode string                           `bson:"shipping_full_address_without_postal_code" json:"shipping_full_address_without_postal_code,omitempty"` // Compiled value
	ShippingFullAddressWithPostalCode    string                           `bson:"shipping_full_address_with_postal_code" json:"shipping_full_address_with_postal_code,omitempty"`       // Compiled value
	ShippingFullAddressURL               string                           `bson:"shipping_full_address_url" json:"shipping_full_address_url,omitempty"`                                 // Compiled value
	HowDidYouHearAboutUsID               primitive.ObjectID               `bson:"how_did_you_hear_about_us_id" json:"how_did_you_hear_about_us_id,omitempty"`
	HowDidYouHearAboutUsText             string                           `bson:"how_did_you_hear_about_us_text" json:"how_did_you_hear_about_us_text,omitempty"`
	IsHowDidYouHearAboutUsOther          bool                             `bson:"is_how_did_you_hear_about_us_other" json:"is_how_did_you_hear_about_us_other,omitempty"`
	HowDidYouHearAboutUsOther            string                           `bson:"how_did_you_hear_about_us_other" json:"how_did_you_hear_about_us_other,omitempty"`
	AgreeTOS                             bool                             `bson:"agree_tos" json:"agree_tos,omitempty"`
	CreatedAt                            time.Time                        `bson:"created_at" json:"created_at,omitempty"`
	CreatedByUserID                      primitive.ObjectID               `bson:"created_by_user_id" json:"created_by_user_id"`
	CreatedByUserName                    string                           `bson:"created_by_user_name" json:"created_by_user_name"`
	CreatedFromIPAddress                 string                           `bson:"created_from_ip_address" json:"created_from_ip_address"`
	ModifiedAt                           time.Time                        `bson:"modified_at" json:"modified_at,omitempty"`
	ModifiedByUserID                     primitive.ObjectID               `bson:"modified_by_user_id" json:"modified_by_user_id"`
	ModifiedByUserName                   string                           `bson:"modified_by_user_name" json:"modified_by_user_name"`
	ModifiedFromIPAddress                string                           `bson:"modified_from_ip_address" json:"modified_from_ip_address"`
	Status                               int8                             `bson:"status" json:"status"`
	Salt                                 string                           `bson:"salt" json:"salt,omitempty"`
	PrAccessCode                         string                           `bson:"pr_access_code" json:"pr_access_code,omitempty"`
	PrExpiryTime                         time.Time                        `bson:"pr_expiry_time" json:"pr_expiry_time,omitempty"`
	Timezone                             string                           `bson:"timezone" json:"timezone,omitempty"`
	HasUserAccount                       bool                             `bson:"has_user_account" json:"has_user_account,omitempty"`
	UserID                               primitive.ObjectID               `bson:"user_id" json:"user_id,omitempty"`
	Type                                 int8                             `bson:"type" json:"type"`
	IsBusiness                           bool                             `bson:"is_business" json:"is_business"`
	IsSenior                             bool                             `bson:"is_senior" json:"is_senior"`
	IsSupport                            bool                             `bson:"is_support" json:"is_support"`
	JobInfoRead                          string                           `bson:"job_info_read" json:"job_info_read"`
	DeactivationReason                   int8                             `bson:"deactivation_reason" json:"deactivation_reason"`
	DeactivationReasonOther              string                           `bson:"deactivation_reason_other" json:"deactivation_reason_other"`
	Description                          string                           `bson:"description" json:"description"`
	IsJobSeeker                          int8                             `bson:"is_job_seeker" json:"is_job_seeker"`
	StatusInCountry                      int8                             `bson:"status_in_country" json:"status_in_country"`
	StatusInCountryOther                 string                           `bson:"status_in_country_other" json:"status_in_country_other"`
	CountryOfOrigin                      string                           `bson:"country_of_origin" json:"country_of_origin"`
	DateOfEntryIntoCountry               time.Time                        `bson:"date_of_entry_into_country" json:"date_of_entry_into_country"`
	JobSeekerID                          string                           `bson:"job_seeker_id" json:"job_seeker_id"`
	MaritalStatus                        int8                             `bson:"marital_status" json:"marital_status"`
	MaritalStatusOther                   string                           `bson:"marital_status_other" json:"marital_status_other"`
	AccomplishedEducation                int8                             `bson:"accomplished_education" json:"accomplished_education"`
	AccomplishedEducationOther           string                           `bson:"accomplished_education_other" json:"accomplished_education_other"`
	AvatarObjectExpiry                   time.Time                        `bson:"avatar_object_expiry" json:"avatar_object_expiry"`
	AvatarObjectURL                      string                           `bson:"avatar_object_url" json:"avatar_object_url"`
	AvatarObjectKey                      string                           `bson:"avatar_object_key" json:"avatar_object_key"`
	AvatarFileType                       string                           `bson:"avatar_file_type" json:"avatar_file_type"`
	AvatarFileName                       string                           `bson:"avatar_file_name" json:"avatar_file_name"`
	BirthDate                            time.Time                        `bson:"birth_date" json:"birth_date"`
	JoinDate                             time.Time                        `bson:"join_date" json:"join_date"`
	Nationality                          string                           `bson:"nationality" json:"nationality"`
	Gender                               int8                             `bson:"gender" json:"gender"`
	GenderOther                          string                           `bson:"gender_other" json:"gender_other"`
	TaxID                                string                           `bson:"tax_id" json:"tax_id"`
	Elevation                            float64                          `bson:"elevation" json:"elevation"`
	Latitude                             float64                          `bson:"latitude" json:"latitude"`
	Longitude                            float64                          `bson:"longitude" json:"longitude"`
	AreaServed                           string                           `bson:"area_served" json:"area_served"`
	PreferredLanguage                    string                           `bson:"preferred_language" json:"preferred_language"`
	ContactType                          string                           `bson:"contact_type" json:"contact_type"`
	OrganizationName                     string                           `bson:"organization_name" json:"organization_name"`
	OrganizationType                     int8                             `bson:"organization_type" json:"organization_type"`
	HourlySalaryDesired                  int64                            `bson:"hourly_salary_desired" json:"hourly_salary_desired"`
	LimitSpecial                         string                           `bson:"limit_special" json:"limit_special"`
	DuesDate                             time.Time                        `bson:"dues_date" json:"dues_date"`
	CommercialInsuranceExpiryDate        time.Time                        `bson:"commercial_insurance_expiry_date" json:"commercial_insurance_expiry_date"`
	AutoInsuranceExpiryDate              time.Time                        `bson:"auto_insurance_expiry_date" json:"auto_insurance_expiry_date"`
	WsibNumber                           string                           `bson:"wsib_number" json:"wsib_number"`
	WsibInsuranceDate                    time.Time                        `bson:"wsib_insurance_date" json:"wsib_insurance_date"`
	PoliceCheck                          time.Time                        `bson:"police_check" json:"police_check"`
	DriversLicenseClass                  string                           `bson:"drivers_license_class" json:"drivers_license_class"`
	Score                                float64                          `bson:"score" json:"score"`
	ServiceFeeID                         primitive.ObjectID               `bson:"service_fee_id" json:"service_fee_id"`
	ServiceFeeName                       string                           `bson:"service_fee_name" json:"service_fee_name"`
	ServiceFeePercentage                 float64                          `bson:"service_fee_percentage" json:"service_fee_percentage"`
	BalanceOwingAmount                   float64                          `bson:"balance_owing_amount" json:"balance_owing_amount"`
	EmergencyContactName                 string                           `bson:"emergency_contact_name" json:"emergency_contact_name"`
	EmergencyContactRelationship         string                           `bson:"emergency_contact_relationship" json:"emergency_contact_relationship"`
	EmergencyContactTelephone            string                           `bson:"emergency_contact_telephone" json:"emergency_contact_telephone"`
	EmergencyContactAlternativeTelephone string                           `bson:"emergency_contact_alternative_telephone" json:"emergency_contact_alternative_telephone"`
	Comments                             []*AssociateComment              `bson:"comments" json:"comments"`
	SkillSets                            []*AssociateSkillSet             `bson:"skill_sets" json:"skill_sets,omitempty"`
	InsuranceRequirements                []*AssociateInsuranceRequirement `bson:"insurance_requirements" json:"insurance_requirements,omitempty"`
	VehicleTypes                         []*AssociateVehicleType          `bson:"vehicle_types" json:"vehicle_types,omitempty"`
	AwayLogs                             []*AssociateAwayLog              `bson:"away_logs" json:"away_logs,omitempty"`
	Tags                                 []*AssociateTag                  `bson:"tags" json:"tags,omitempty"`
	IdentifyAs                           []int8                           `bson:"identify_as" json:"identify_as,omitempty"`

	// OTPEnabled controls whether we force 2FA or not during login for this associate.
	OTPEnabled bool `bson:"otp_enabled" json:"otp_enabled"`
}

func (*Associate) SkillSetIDs

func (a *Associate) SkillSetIDs() []primitive.ObjectID

SkillSetIDs is a convinience function which will return an array of skill set ID values from the associate.

type AssociateAsSelectOption

type AssociateAsSelectOption struct {
	Value primitive.ObjectID `bson:"_id" json:"value"` // Extract from the database `_id` field and output through API as `value`.
	Label string             `bson:"name" json:"label"`
}

type AssociateAwayLog

type AssociateAwayLog struct {
	ID                    primitive.ObjectID `bson:"_id" json:"id"`
	TenantID              primitive.ObjectID `bson:"tenant_id" json:"tenant_id,omitempty"`
	AssociateID           primitive.ObjectID `bson:"associate_id" json:"associate_id"`
	AssociateName         string             `bson:"associate_name" json:"associate_name,omitempty"`
	AssociateLexicalName  string             `bson:"associate_lexical_name" json:"associate_lexical_name,omitempty"`
	Reason                int8               `bson:"reason" json:"reason"`
	ReasonOther           string             `bson:"reason_other" json:"reason_other"`
	UntilFurtherNotice    int8               `bson:"until_further_notice" json:"until_further_notice"`
	UntilDate             time.Time          `bson:"until_date" json:"until_date"`
	StartDate             time.Time          `bson:"start_date" json:"start_date"`
	Status                int8               `bson:"status" json:"status"`
	CreatedAt             time.Time          `bson:"created_at" json:"created_at"`
	CreatedByUserID       primitive.ObjectID `bson:"created_by_user_id" json:"created_by_user_id,omitempty"`
	CreatedByUserName     string             `bson:"created_by_user_name" json:"created_by_user_name"`
	CreatedFromIPAddress  string             `bson:"created_from_ip_address" json:"created_from_ip_address"`
	ModifiedAt            time.Time          `bson:"modified_at" json:"modified_at"`
	ModifiedByUserID      primitive.ObjectID `bson:"modified_by_user_id" json:"modified_by_user_id,omitempty"`
	ModifiedByUserName    string             `bson:"modified_by_user_name" json:"modified_by_user_name"`
	ModifiedFromIPAddress string             `bson:"modified_from_ip_address" json:"modified_from_ip_address"`
	PublicID              uint64             `bson:"public_id" json:"public_id"`
}

type AssociateComment

type AssociateComment struct {
	ID                    primitive.ObjectID `bson:"_id" json:"id"`
	TenantID              primitive.ObjectID `bson:"tenant_id" json:"tenant_id"`
	CreatedAt             time.Time          `bson:"created_at,omitempty" json:"created_at,omitempty"`
	CreatedByUserID       primitive.ObjectID `bson:"created_by_user_id" json:"created_by_user_id"`
	CreatedByUserName     string             `bson:"created_by_user_name" json:"created_by_user_name"`
	CreatedFromIPAddress  string             `bson:"created_from_ip_address" json:"created_from_ip_address"`
	ModifiedAt            time.Time          `bson:"modified_at,omitempty" json:"modified_at,omitempty"`
	ModifiedByUserID      primitive.ObjectID `bson:"modified_by_user_id" json:"modified_by_user_id"`
	ModifiedByUserName    string             `bson:"modified_by_user_name" json:"modified_by_user_name"`
	ModifiedFromIPAddress string             `bson:"modified_from_ip_address" json:"modified_from_ip_address"`
	Content               string             `bson:"content" json:"content"`
	Status                int8               `bson:"status" json:"status"`
	PublicID              uint64             `bson:"public_id" json:"public_id"`
}

type AssociateInsuranceRequirement

type AssociateInsuranceRequirement struct {
	ID          primitive.ObjectID `bson:"_id" json:"id"`
	Name        string             `bson:"name" json:"name"`
	Description string             `bson:"description" json:"description"`
	Status      int8               `bson:"status" json:"status"`
}

type AssociateListFilter

type AssociateListFilter struct {
	// Pagination related.
	Cursor    primitive.ObjectID
	PageSize  int64
	SortField string
	SortOrder int8 // 1=ascending | -1=descending

	// Filter related.
	TenantID         primitive.ObjectID
	Role             int8
	Status           int8
	UUIDs            []string
	Type             int8
	ExcludeArchived  bool
	SearchText       string
	FirstName        string
	LastName         string
	Email            string
	Phone            string
	CreatedAtGTE     time.Time
	SkillSetIDs      []primitive.ObjectID
	OrganizationName string
	IsJobSeeker      int8
	HasTaxID         int8

	// IDs filter is used if you know the `ID` values of all the
	// customers you want to retrieve.
	IDs []primitive.ObjectID
}

type AssociateListResult

type AssociateListResult struct {
	Results     []*Associate       `json:"results"`
	NextCursor  primitive.ObjectID `json:"next_cursor"`
	HasNextPage bool               `json:"has_next_page"`
}

type AssociateLite

type AssociateLite struct {
	ID                  primitive.ObjectID   `bson:"_id" json:"id"`
	FirstName           string               `bson:"first_name" json:"first_name"`
	LastName            string               `bson:"last_name" json:"last_name"`
	Name                string               `bson:"name" json:"name"`
	LexicalName         string               `bson:"lexical_name" json:"lexical_name"`
	Email               string               `bson:"email" json:"email"`
	Phone               string               `bson:"phone" json:"phone,omitempty"`
	PhoneType           int8                 `bson:"phone_type" json:"phone_type"`
	PhoneExtension      string               `bson:"phone_extension" json:"phone_extension"`
	OtherPhone          string               `bson:"other_phone" json:"other_phone"`
	OtherPhoneExtension string               `bson:"other_phone_extension" json:"other_phone_extension"`
	OtherPhoneType      int8                 `bson:"other_phone_type" json:"other_phone_type"`
	Status              int8                 `bson:"status" json:"status"`
	Type                int8                 `bson:"type" json:"type"`
	AvatarObjectKey     string               `bson:"avatar_object_key" json:"avatar_object_key"`
	AvatarFileType      string               `bson:"avatar_file_type" json:"avatar_file_type"`
	AvatarFileName      string               `bson:"avatar_file_name" json:"avatar_file_name"`
	Birthdate           time.Time            `bson:"birthdate" json:"birthdate"`
	JoinDate            time.Time            `bson:"join_date" json:"join_date"`
	Nationality         string               `bson:"nationality" json:"nationality"`
	Gender              int8                 `bson:"gender" json:"gender"`
	GenderOther         string               `bson:"gender_other" json:"gender_other"`
	OrganizationName    string               `bson:"organization_name" json:"organization_name"`
	OrganizationType    int8                 `bson:"organization_type" json:"organization_type"`
	Country             string               `bson:"country" json:"country,omitempty"`
	Region              string               `bson:"region" json:"region,omitempty"`
	City                string               `bson:"city" json:"city,omitempty"`
	PostalCode          string               `bson:"postal_code" json:"postal_code,omitempty"`
	AddressLine1        string               `bson:"address_line1" json:"address_line1,omitempty"`
	AddressLine2        string               `bson:"address_line2" json:"address_line2,omitempty"`
	SkillSets           []*AssociateSkillSet `bson:"skill_sets" json:"skill_sets,omitempty"`
	Tags                []*AssociateTag      `bson:"tags" json:"tags,omitempty"`
}

AssociateLite represents the limited detail of a associate which is to be displayed in a list view.

type AssociatePaginationListAndCountResult

type AssociatePaginationListAndCountResult struct {
	Results     []*Associate `json:"results"`
	NextCursor  string       `json:"next_cursor"`
	HasNextPage bool         `json:"has_next_page"`
	Count       int64        `json:"count"`
}

AssociatePaginationListResult represents the paginated list results for the Associate records (meaning limited).

type AssociatePaginationListFilter

type AssociatePaginationListFilter struct {
	// Pagination related.
	Cursor    string
	PageSize  int64
	SortField string
	SortOrder int8 // 1=ascending | -1=descending

	// Filter related.
	TenantID               primitive.ObjectID
	HowDidYouHearAboutUsID primitive.ObjectID
	Type                   int8
	Role                   int8
	Status                 int8
	UUIDs                  []string
	SearchText             string
	FirstName              string
	LastName               string
	Email                  string
	Phone                  string
	CreatedAtGTE           time.Time
	OrganizationName       string
	IsJobSeeker            int8
	HasTaxID               int8

	CommercialInsuranceExpiryDateGTE time.Time
	CommercialInsuranceExpiryDateGT  time.Time
	CommercialInsuranceExpiryDateLTE time.Time
	CommercialInsuranceExpiryDateLT  time.Time

	PoliceCheckGTE time.Time
	PoliceCheckGT  time.Time
	PoliceCheckLTE time.Time
	PoliceCheckLT  time.Time

	JoinDateGT  time.Time
	JoinDateGTE time.Time
	JoinDateLT  time.Time
	JoinDateLTE time.Time

	// InSkillSetIDs filter is used if you want to find one or more skill set
	// ids inside the associate.
	InSkillSetIDs []primitive.ObjectID

	// AllSkillSetIDs filter is used if you want to find all skill set ids for
	// the associate.
	AllSkillSetIDs []primitive.ObjectID

	// InTagIDs filter is used if you want to find one or more tag
	// ids inside the associate.
	InTagIDs []primitive.ObjectID

	// AllTagIDs filter is used if you want to find all tag ids for
	// the associate.
	AllTagIDs []primitive.ObjectID

	// InInsuranceRequirementIDs filter is used if you want to find one or more tag
	// ids inside the associate.
	InInsuranceRequirementIDs []primitive.ObjectID

	// AllInsuranceRequirementIDs filter is used if you want to find all tag ids for
	// the associate.
	AllInsuranceRequirementIDs []primitive.ObjectID

	// InVehicleTypeIDs filter is used if you want to find one or more tag
	// ids inside the associate.
	InVehicleTypeIDs []primitive.ObjectID

	// AllVehicleTypeIDs filter is used if you want to find all tag ids for
	// the associate.
	AllVehicleTypeIDs []primitive.ObjectID

	// IDs filter is used if you know the `ID` values of all the
	// customers you want to retrieve.
	IDs []primitive.ObjectID
}

type AssociatePaginationListResult

type AssociatePaginationListResult struct {
	Results     []*Associate `json:"results"`
	NextCursor  string       `json:"next_cursor"`
	HasNextPage bool         `json:"has_next_page"`
}

AssociatePaginationLiteListResult represents the paginated list results for the associate records.

type AssociatePaginationLiteListAndCountResult

type AssociatePaginationLiteListAndCountResult struct {
	Results     []*AssociateLite `json:"results"`
	NextCursor  string           `json:"next_cursor"`
	HasNextPage bool             `json:"has_next_page"`
	Count       int64            `json:"count"`
}

AssociatePaginationLiteListResult represents the paginated list results for the Associate lite records (meaning limited).

type AssociatePaginationLiteListResult

type AssociatePaginationLiteListResult struct {
	Results     []*AssociateLite `json:"results"`
	NextCursor  string           `json:"next_cursor"`
	HasNextPage bool             `json:"has_next_page"`
}

AssociatePaginationLiteListResult represents the paginated list results for the associate lite records (meaning limited).

type AssociateSkillSet

type AssociateSkillSet struct {
	ID          primitive.ObjectID `bson:"_id" json:"id"`
	Category    string             `bson:"category" json:"category"`
	SubCategory string             `bson:"sub_category" json:"sub_category"`
	Description string             `bson:"description" json:"description"`
	Status      int8               `bson:"status" json:"status"`
}

type AssociateStorer

type AssociateStorer interface {
	Create(ctx context.Context, m *Associate) error
	GetByID(ctx context.Context, id primitive.ObjectID) (*Associate, error)
	GetByPublicID(ctx context.Context, publicID uint64) (*Associate, error)
	GetByUserID(ctx context.Context, userID primitive.ObjectID) (*Associate, error)
	GetByEmail(ctx context.Context, email string) (*Associate, error)
	GetByVerificationCode(ctx context.Context, verificationCode string) (*Associate, error)
	GetLatestByTenantID(ctx context.Context, tenantID primitive.ObjectID) (*Associate, error)
	CheckIfExistsByEmail(ctx context.Context, email string) (bool, error)
	UpdateByID(ctx context.Context, m *Associate) error
	UpsertByID(ctx context.Context, user *Associate) error
	ListByFilter(ctx context.Context, f *AssociatePaginationListFilter) (*AssociatePaginationListResult, error)
	ListByInsuranceRequirementID(ctx context.Context, irID primitive.ObjectID) (*AssociatePaginationListResult, error)
	ListByHowDidYouHearAboutUsID(ctx context.Context, howDidYouHearAboutUsID primitive.ObjectID) (*AssociatePaginationListResult, error)
	ListAsSelectOptionByFilter(ctx context.Context, f *AssociateListFilter) ([]*AssociateAsSelectOption, error)
	LiteListByFilter(ctx context.Context, f *AssociatePaginationListFilter) (*AssociatePaginationLiteListResult, error)
	ListAndCountByFilter(ctx context.Context, f *AssociatePaginationListFilter) (*AssociatePaginationListAndCountResult, error)
	LiteListAndCountByFilter(ctx context.Context, f *AssociatePaginationListFilter) (*AssociatePaginationLiteListAndCountResult, error)
	DeleteByID(ctx context.Context, id primitive.ObjectID) error
	CountByFilter(ctx context.Context, f *AssociatePaginationListFilter) (int64, error)
	CountAllJobSeekersByTenantID(ctx context.Context, tid primitive.ObjectID) (int64, error)
}

AssociateStorer Interface for user.

func NewDatastore

func NewDatastore(appCfg *c.Conf, loggerp *slog.Logger, client *mongo.Client) AssociateStorer

type AssociateStorerImpl

type AssociateStorerImpl struct {
	Logger     *slog.Logger
	DbClient   *mongo.Client
	Collection *mongo.Collection
}

func (AssociateStorerImpl) CheckIfExistsByEmail

func (impl AssociateStorerImpl) CheckIfExistsByEmail(ctx context.Context, email string) (bool, error)

func (AssociateStorerImpl) CountAllJobSeekersByTenantID

func (impl AssociateStorerImpl) CountAllJobSeekersByTenantID(ctx context.Context, tid primitive.ObjectID) (int64, error)

func (AssociateStorerImpl) CountByFilter

func (AssociateStorerImpl) Create

func (impl AssociateStorerImpl) Create(ctx context.Context, u *Associate) error

func (AssociateStorerImpl) DeleteByID

func (impl AssociateStorerImpl) DeleteByID(ctx context.Context, id primitive.ObjectID) error

func (AssociateStorerImpl) GetByEmail

func (impl AssociateStorerImpl) GetByEmail(ctx context.Context, email string) (*Associate, error)

func (AssociateStorerImpl) GetByID

func (AssociateStorerImpl) GetByPublicID

func (impl AssociateStorerImpl) GetByPublicID(ctx context.Context, publicID uint64) (*Associate, error)

func (AssociateStorerImpl) GetByUserID

func (impl AssociateStorerImpl) GetByUserID(ctx context.Context, userID primitive.ObjectID) (*Associate, error)

func (AssociateStorerImpl) GetByVerificationCode

func (impl AssociateStorerImpl) GetByVerificationCode(ctx context.Context, verificationCode string) (*Associate, error)

func (AssociateStorerImpl) GetLatestByTenantID

func (impl AssociateStorerImpl) GetLatestByTenantID(ctx context.Context, tenantID primitive.ObjectID) (*Associate, error)

func (AssociateStorerImpl) ListAsSelectOptionByFilter

func (impl AssociateStorerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *AssociateListFilter) ([]*AssociateAsSelectOption, error)

func (AssociateStorerImpl) ListByFilter

func (AssociateStorerImpl) ListByHowDidYouHearAboutUsID

func (impl AssociateStorerImpl) ListByHowDidYouHearAboutUsID(ctx context.Context, howDidYouHearAboutUsID primitive.ObjectID) (*AssociatePaginationListResult, error)

func (AssociateStorerImpl) ListByInsuranceRequirementID

func (impl AssociateStorerImpl) ListByInsuranceRequirementID(ctx context.Context, irID primitive.ObjectID) (*AssociatePaginationListResult, error)

func (AssociateStorerImpl) UpdateByID

func (impl AssociateStorerImpl) UpdateByID(ctx context.Context, m *Associate) error

func (AssociateStorerImpl) UpsertByID

func (impl AssociateStorerImpl) UpsertByID(ctx context.Context, user *Associate) error

type AssociateTag

type AssociateTag struct {
	ID          primitive.ObjectID `bson:"_id" json:"id"`
	Text        string             `bson:"text" json:"text"`
	Description string             `bson:"description" json:"description"`
	Status      int8               `bson:"status" json:"status"`
}

type AssociateVehicleType

type AssociateVehicleType struct {
	ID          primitive.ObjectID `bson:"_id" json:"id"`
	Name        string             `bson:"name" json:"name"`
	Description string             `bson:"description" json:"description"`
	Status      int8               `bson:"status" json:"status"`
}

Jump to

Keyboard shortcuts

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