0.1.0-beta.0 • Published 5 months ago

@leaddreamer/esbusiness v0.1.0-beta.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

view on
npm

@leaddreamer/ESBusiness

Business Logic for the Events Services system, wrapped around FirebaseWrapper, to be shared between Back and Front End. This particular library only provides the business "logic" - not browser services.

Modules

ESBusiness

Business Logic for the Event Services system, wrapped around FirebaseWrapper, to be shared between Back and Front End. This particular library only provides the business "logic" - not browser services.

ESBusiness.databasePromise(firebase, config, thisLogger) ⇒ Promise.Firebase

all-in-one wrapper for a solid subset of CLIENT-SIDE Firebase functions, with a consistent interface. There is a parallel set for ADMIN-SIDE functions as well. Call/initialize with Firebase Configuration settings in an object as described below

Kind: static method of ESBusiness

ParamTypeDescription
firebaseFirebase
configFirebaseConfigObjectFirebase Admin object
thisLoggercallback

Example

//this specifically loads ALL the subsections, specifically for
//the Browser.  See later (tbd) notes for NodeJS

import FirebaseWrapper from "@leaddreamer/firebase-wrapper";
FirebaseWrapper(config); //see below
export * from "@leaddreamer/firebase-wrapper";

ESBusiness~FirebaseConfigObject : object

only authDomain, databaseURL and storageBucket are present when called from a cloud environment

Kind: inner typedef of ESBusiness
Properties

NameTypeDescription
apiKeystringrequired api Key from Firebase Console,
appIdstringrequired app ID from Firebase Console
projectIdstringrequired Firebase projectID from Firebase console
authDomainstring(optional) auth domain from Firebase Console
databaseURLstring(optional) Firestore database URL from Firebase console
storageBucket:string(optional) URL of Firestore Storage Bucket
messagingSenderId:string(optional) ID for Messaing service from Firebase Console
measurementId:string(optional) Analytics/Measurement ID from Firebase Console
mapsAPIKeystring(optional) App ID for Google Maps API, from Google

BusinessLogic

A collection of Business logic and database functions. Sahred between ReactJS frontEnd and NodeJS BackEnd

Addresses

Types and functins for handling addresses

Addresses.AddressDefault : AddressType

Kind: static constant of Addresses

Addresses.AddressForm : AddressType

Kind: static constant of Addresses

Addresses.maplink : MapLink

Kind: static constant of Addresses
Read only: true

Addresses.deleteAddress(address) ⇒ Promise.<void>

Deletes an existing address record from the database, based on it's own refPath

Kind: static method of Addresses

ParamType
addressAddressType
address.refPathstring

Addresses.deleteAddressByIdAndParent(addressId, parent, batch) ⇒ Promise.ChainType

Deletes an existing address record from the database, based on it's parent record and Id

Kind: static method of Addresses

ParamType
addressIdstring
parentOrganizationType
parent.refPathstring
batchChainType

Addresses.formatAddress(address) ⇒ string

Builds a formatted string from a provided address record

Kind: static method of Addresses

ParamType
addressAddressType

Addresses.saveAddress(address, paraentRefPath) ⇒ Promise.<AddressType>

Saves an address record to the database below the provided parentRefPath, whether exsiting or not

Kind: static method of Addresses

ParamTypeDescription
addressAddressType
address.refPathstringif present, writes back
paraentRefPathstringrequired if new record

Addresses.extraDataPath(account) ⇒ string

creates the "base path" (refPath) to store addresses based on an account (refPath)

Kind: static method of Addresses

ParamType
accountRecord
account.refPathstring

Addresses.fetchAddresses(account) ⇒ Promise.<Array.AddressType>

Fetches all address records for an account

Kind: static method of Addresses

ParamType
accountRecord
account.refPathstring

Addresses~AddressType : object

Kind: inner typedef of Addresses
Properties

NameTypeDescription
Idstringwill be populated for existing record; null or missing for new/minimal object
refPathstringwill be populated for existing record; null or missing for new/minimal object
address_line_1string
address_line_2string
citystring
regionstringselected from a list of supported Cities/Regions
statestring
zipzip
mapLinkmaplinklink to Google map location

Addresses~MapLink : object

Kind: inner typedef of Addresses
Properties

NameTypeDescription
placeIdstringas defined by Google
latlngobjectcoordinates tuple
latlng.latstringlattitude
latlng.lngstringlongitude
urlstringlink to place/map entry
formatted_addressstringprintable string of address

Addresses~ChainType : WriteBatch | Transaction | void

Kind: inner typedef of Addresses

BookingOffers

types, constants and support functions for BookingOffers

BookingOffers.SHARE_TYPES : enum

Kind: static enum of BookingOffers
Read only: true

BookingOffers.SHARE_BUTTON_LABELS : enum

Kind: static enum of BookingOffers
Read only: true

BookingOffers.BOOKING_STATUS : enum

Kind: static enum of BookingOffers
Read only: true

BookingOffers.BookingOfferDefault : BookingOffer

Kind: static constant of BookingOffers
Read only: true

BookingOffers.BookingOfferDefaultForm : BookingOffer

Kind: static constant of BookingOffers
Read only: true

BookingOffers.updateBookingOfferCounter(bookingOffer) ⇒ Promise.BookingOffer

Due to security rule design, bookingOffers need certain data to remain the same to protect against malicious writes. Unfortunately it means there is no way merge in only SPECIFIC fields

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.updateBookingOfferOwner(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.ownerOfferBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.ownerCancelBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.ownerRejectBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.ownerCounterBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.ownerConfirmBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.counterOfferBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.counterRejectBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.counterCounterBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.counterAcceptBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.counterConfirmBooking(bookingOffer) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferBookingOffer

BookingOffers.fetchBookingOffersByCounter(counter) ⇒ Promise.Array.BookingOffer

Kind: static method of BookingOffers

ParamType
counterOrganizationType

BookingOffers.fetchBookingOffersByDateAndOwner(dateString, owner) ⇒ Promise.Array.BookingOffer

Kind: static method of BookingOffers

ParamType
dateStringDateString
ownerOrganizationType

BookingOffers.fetchBookingOffersByOwner(owner) ⇒ Promise.Array.BookingOffer

Kind: static method of BookingOffers

ParamType
ownerOrganizationType

BookingOffers.fetchBookingOfferConfirmed(event) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
eventEventType

BookingOffers.fetchBookingOffers(event) ⇒ Promise.Array.BookingOffer

Kind: static method of BookingOffers

ParamType
eventEventType

BookingOffers.fetchBookingOffer(bookingOfferID) ⇒ Promise.BookingOffer

Kind: static method of BookingOffers

ParamType
bookingOfferIDstring

BookingOffers.fetchAllBookingOffers() ⇒ Promise.Array.BookingOffer

Kind: static method of BookingOffers

BookingOffers.buildOwnerBookingOffer(baseOffer, ownerStatus, event, counter, date) ⇒ BookingOffer

utility to build bookingOffer record (hides implementation details)

Kind: static method of BookingOffers
Returns: BookingOffer - bookingOffer object

ParamTypeDescription
baseOfferBookingOffer
ownerStatusenum
eventEventType
counterRecord
datestringbooking date, string, stardate format

BookingOffers.defaultBookingOffer(owner) ⇒ Promise.BookingOffer

retrieve or build the default bookingOffer

Kind: static method of BookingOffers
Returns: Promise.BookingOffer - default booking offer with owner info (no counter)

ParamTypeDescription
ownerAccountTypeowner record for adding info to offer

BookingOffers.saveDefaultBookingOffer(owner) ⇒ Promise.BookingOffer

Save the owner's default bookingOffer

Kind: static method of BookingOffers
Returns: Promise.BookingOffer - default booking offer with owner info (no counter)

ParamTypeDescription
ownerAccountTypeowner record for adding info to offer

BookingOffers.crossConfirmed(bookingOffer) ⇒ boolean

function to verify both owner and counter have confirmed a booking offer (hiding implementation)

Kind: static method of BookingOffers

ParamTypeDescription
bookingOfferbookingOfferbooking offer object/record to be checked

BookingOffers.simpleCanceled(bookingOffer) ⇒ boolean

Function to check whether either party has canceled the event

Kind: static method of BookingOffers

ParamTypeDescription
bookingOfferbookingOfferbooking offer object/record to be checked

BookingOffers.counterShare(bookingOffer, currentAmount, fullAmount) ⇒ number

Kind: static method of BookingOffers

ParamTypeDescription
bookingOfferBookingOffer
bookingOffer.ticketobject
bookingOffer.ticket.limitnumberdecimal dollar limit value
bookingOffer.ticket.sharenumberinteger percentage, 0 - 100
bookingOffer.ticket.typestringtype of
currentAmountnumberdecimal dollar amount to split
fullAmountnumberdecimal dollar full amount that will end up shared

BookingOffers.offerConditions(share_object) ⇒ string

Returns a string representation of the sharing offer

Kind: static method of BookingOffers

ParamType
share_objectShareOffer

BookingOffers~ShareOffer : object

Kind: inner typedef of BookingOffers
Properties

NameTypeDescription
typeSHARE_TYPEStype of sharing offer
shareinteger0 to 100 integer of share
limitnumberdollar limit (depending on type) of this share

BookingOffers~BookingOffer : object

Kind: inner typedef of BookingOffers
Properties

NameTypeDescription
ownerobjectdenormalized info of organizarion that proposes the deal this is a convenience copy - the "owner" is the top of the tree
owner.IdstringId of the booking owner
owner.capacitynumber
owner.namestring
owner.regionstringredundant, but allows collectionGroup listeners
owner.bookingStatusBOOKING_STATUS
counterobjectdenormalized info of organizarion that accepts the deal
counter.IdstringId of the booking owner
counter.capacitynumber
counter.namestring
counter.regionstringredundant, but allows collectionGroup listeners
counter.bookingStatusBOOKING_STATUS
ticketShareOffer
houseShareOffer
datestring
timestring
time.Startstring
time.Durationstring
publishedobject
Qbooleanpublished flag
stringdetails

CityManager

types constants and support functions for CityManagers

CityManager.CityManagerDefault : CityManagerType

Kind: static constant of CityManager
Read only: true

CityManager.CityManagerDefaultForm : CityManagerType

Kind: static constant of CityManager
Read only: true

CityManager.CityManagerCreateForm : CityManagerType

Kind: static constant of CityManager
Read only: true

CityManager.CityManagerAccountForm : CityManagerType

Kind: static constant of CityManager
Read only: true

CityManager.createCityManager(cityManager, batch) ⇒ Promise.CityManagerType

adds a new cityManager record to the database

Kind: static method of CityManager

ParamTypeDescription
cityManagerCityManagerTypecityManager to commit
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

CityManager.searchCityManagers(prompt, limit) ⇒ Promise.Array.CityManagerType

returns a Promise which resolves to an array of all cityManagers whose name begins with the provided prompt, optionally limited to a provided number

Kind: static method of CityManager
Returns: Promise.Array.CityManagerType - array of cityManager objects

ParamTypeDescription
promptstringUsed to query for matching CityManagers
limitstring | numberUsed to limit the number of results

CityManager.fetchCityManagerData(cityManager) ⇒ PrivateData

returns the cityManager's private data

Kind: static method of CityManager
Returns: PrivateData - a PrivateData record. These records are the ONLY document in sub-collection PrivateData under the "cityManager" record, and have the SAME documentId as the parent "cityManager" document.

ParamTypeDescription
cityManagerCityManagerTypea cityManager record, at least including the fields Id and refPath

CityManager.summarizeCityManager(cityManager) ⇒ string

Takes a CityManager record and returns a "summary" of it

Kind: static method of CityManager
Returns: string - the region of the city manager is it's only summary

ParamTypeDescription
cityManagerCityManagerTypea CityManager record

CityManager.findCityManagerIDFromChild(child) ⇒ string

finds the CityManager ID from any child document

Kind: static method of CityManager
Returns: string - the cityManager ID

ParamTypeDescription
childrecordDocumentany child record of the CityManager record

CityManager.fetchCityManagerFromChild(child) ⇒ Promise.CityManagerType

retreives a CityManager record given any child record of it

Kind: static method of CityManager
Returns: Promise.CityManagerType - the CityManager record

ParamTypeDescription
childrecordDocumentany child record of the CityManager record

CityManager~CityManagerType : object

Kind: inner typedef of CityManager
Properties

NameTypeDescription
Idstringpresent if fetch from database
namestringname of CityManager
business_contactbusiness_contact
regionstringa string representing to CityManager home region SELECTED FROM list of regions
colorstringHTML/CSS color string or name - general color of profile/display
borderColorstringHTML/CSS color string or name - general color of profile/display borders
textColorstringHTML/CSS color string or name - general color of profile/display text

EventGroups

Typedefs, constants, support functions and database operations related to eventGroups

EventGroups.deleteEventGroup(eventGroup) ⇒ Promise.<void>

Deletes an EventGroup record NOTE: Does NOT delete subrecords

Kind: static method of EventGroups

ParamType
eventGroupEventGroupType

EventGroups.createEventGroup(eventGroup, organization, batch) ⇒ Promise.<EventGroupType>

Creates a new eventGroup underneath a given Organization

Kind: static method of EventGroups

ParamType
eventGroupEventGroupType
organizationOrganizationType
batchChainType

EventGroups.saveEventGroup(eventGroup, organization, batch) ⇒ Promise.<EventGroupType>

Save an eventGroup to the database. If the record has a refPath, sva eit back to the same location in the database If not, then use organization record to save as a new record

Kind: static method of EventGroups

ParamTypeDescription
eventGroupEventGroupType
organizationOrganizationTypeoptional accountt o save to (for new record)
batchChainType

EventGroups.createDefaultEventGroup(organization, batch) ⇒ Promise.<EventGroupType>

Creates a "default" eventgroup, with minimal pre-filled data The "default" eventGroup has the same record Id as the organization (convenience)

Kind: static method of EventGroups

ParamType
organizationOrganizationType
batchChainType

EventGroups.fetchDefaultEventGroup(organization) ⇒ Promise.<EventGroupType>

Fetches the default event group The "default" eventGroup has the same record Id as the organization

Kind: static method of EventGroups

ParamType
organizationOrganizationType

EventGroups.fetchAllEventGroups() ⇒ Promise.<Array.EventGroupType>

Fetches *all** event groups. Not likely to be used (too many records)

Kind: static method of EventGroups

EventGroups.fetchEventGroup(eventGroupID) ⇒ Promise.<EventGroupType>

Fetches a single eventGroup record by Id

Kind: static method of EventGroups

ParamType
eventGroupIDstring

EventGroups.fetchEventGroupFromChild(child, batch) ⇒ Promise.<EventGroupType>

Uses the refPath of (any) child document to fetch the eventGroup record

Kind: static method of EventGroups

ParamTypeDescription
childRecordany child, on any branch
batchChainType

EventGroups.fetchEventGroups(organization) ⇒ Promise.<Array.OrganizationType>

Fetches all the eventGroup records for an organization

Kind: static method of EventGroups

ParamType
organizationOrganizationType
organization.refPathstring

EventGroups.fetchEventGroupByDateAndOrganization(dateString, organization) ⇒ Promise.<Array.OrganizationType>

Fetches an Organization's eventGroups that bridge a particular day (inclusive)

Kind: static method of EventGroups

ParamTypeDescription
dateStringstringfirestore format
organizationOrganizationType
organization.refPathstring

EventGroups.findEventGroupIDFromChild(child) ⇒ string

uses the refPath of (any) child document to find the eventGroup.Id

Kind: static method of EventGroups
Returns: string - the Id of the eventGroup record

ParamTypeDescription
childRecordany child, on any branch

EventGroups.findEventGroupRefFromChild(child) ⇒ string

uses the refPath of (any) child document to find the eventGroup.refPath

Kind: static method of EventGroups
Returns: string - the refPath of the eventGroup record

ParamTypeDescription
childRecordany child, on any branch

EventGroups~EventGroupDefault : EventGroupType

Kind: inner constant of EventGroups

EventGroups~EventGroupDefaultForm : EventGroupType

Kind: inner constant of EventGroups

EventGroups~EventGroupType : object

Kind: inner typedef of EventGroups
Properties

NameTypeDescription
Idstringpresent if fetch from database
titlestringshort title for eventGroup
imagestringstring URL
bannerstringstring URL
organizationOrganizationType//For convenience - can be culled from hierarchy
organization.namestring//For convenience - can be culled from hierarchy
descriptionstringdescription of eventGroup
dateStartdateStringoptional start date for eventGroup
dateEnddateStringoptional end date of eventGroup
perksArray.perkTypeoptional array of perks. Not saved to database; populated from sub-collection

EventGroups~ChainType : WriteBatch | Transaction | void

Kind: inner typedef of EventGroups

Events

Typedefs, constants, support functions and database operations related to Events

Events.EVENT_SORT_OPTIONS : Array.string

Kind: static constant of Events

Events.deleteEvent(event) ⇒ Promise.<void>

Directly deletes an event record. Part of a larger archival process

Kind: static method of Events

ParamType
eventEventType
event.refPathstring

Events.createEvent(eventRecord, eventGroupRecord, batch) ⇒ Promise.<EventType>

Creates the basic structure for an event, based on passed information

Kind: static method of Events

ParamTypeDescription
eventRecordEventType
eventGroupRecordEventGroupType
batchWriteBatch | TransactionTransaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched

Events.modifyEvent(event, batch) ⇒ Promise.<EventType>

Saves an updated record. Assumes sourced from database; included fields are merged with database (allows changing single fields)

Kind: static method of Events

ParamTypeDescription
eventobject
event.refPathstringonly "required" field
batchWriteBatch | TransactionTransaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched

Events.updateEvent(event, eventGroup, batch) ⇒ Promise.<(WriteBatch|Transaction)>

Updates/adds a set of perks to the provided EventGroup. if batch is provided, adds these to the provided <WriteBatch|Transaction> and returns a chained <WriteBatch|Transaction>

Kind: static method of Events
Returns: Promise.<(WriteBatch|Transaction)> - chanied Batch or Void (if singleton)

ParamTypeDescription
eventEventTypeArray of pledgeLevel objects to be written. If the Id of any entry is null or missing, a new perk document is created
eventGroupEventGroupTypeeventGroup to attach perks as sub-collection
eventGroup.refPathstringstring representing full path to eventGroup only property used
batchWriteBatch | TransactionTransaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched

Events.updateEventByTree(eventRecord, tree, batch)

uses a "tree" object (likely derived from a sub-record) to update an event

Kind: static method of Events

ParamTypeDescription
eventRecordEventType
treeRecordTree
batchPromise.<(WriteBatch|Transaction)>Transaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched

Events.updateEventByChild(eventRecord, child, batch) ⇒ Promise.<RecordDocument>

Updates a event when only a child object is available (summary, logistics, pledgeLevels, pledgeTickets, bookingOffers) ASSUMES a merge

Kind: static method of Events

ParamTypeDescription
eventRecordEventFormType
childRecordDocument
batchWriteBatch | TransactionTransaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched

Events.fetchEventsByRegionFiltered(region, extraFilter) ⇒ Promise.<Array.EventType>

Fetches events by Region with optional extra filter specifications

Kind: static method of Events

ParamTypeDescription
regionstringstring - Always filters query by region
extraFilterArray.filterObjectstring - optional extra field reference to filter

Events.fetchEventsByRegion(region) ⇒ Promise.<Array.EventType>

Fetches all events in a region

Kind: static method of Events

ParamType
regionstring

Events.fetchEventsByOwner(owner) ⇒ Promise.<Array.EventType>

Fetches all events "owned" (proposed by) a particular AccountForm

Kind: static method of Events

ParamType
ownerRecordDocument
owner.Idstring

Events.fetchEventsByEventGroupID(eventGroupID) ⇒ Promise.<Array.EventType>

Fetches all events that are part of a specified eventGroup (by ID)

Kind: static method of Events

ParamTypeDescription
eventGroupIDstringId of an eventGroup Record

Events.fetchEventsByRegionAndDate(region, dateString) ⇒ Promise.<Array.EventType>

Fetches all events in a given region on/around a given date

Kind: static method of Events
Returns: Promise.<Array.EventType> - returns in an Array for compatibility; usually should only find one

ParamTypeDescription
regionstring
dateStringstringfirebase firestore formatted date

Events.fetchEventsByDateAndOwner(region, dateString) ⇒ Promise.<Array.EventType>

Fetches all events of a given owner on/around a given date

Kind: static method of Events
Returns: Promise.<Array.EventType> - returns in an Array for compatibility; usually should only find one

ParamTypeDescription
regionstring
dateStringstringfirebase firestore formatted date

Events.fetchEventById(eventID) ⇒ Promise.EventType

Fetch a single event by it's Id

Kind: static method of Events

ParamTypeDescription
eventIDstringId of a specific event / event record

Events.fetchEventByTree(tree) ⇒ Promise.EventType

Fetch an event from a RecordTree Map - assumed to be derived from a child recordx

Kind: static method of Events

ParamType
treeRecordTree

Events.fetchEventByParams(params) ⇒ Promise.EventType

Fetch an event using Cloud Function params

Kind: static method of Events

ParamType
paramsCloudParams

Events.fetchEventByRef(eventRefPath, batch) ⇒ Promise.EventType

Fetch an event by it's refPath string

Kind: static method of Events

ParamType
eventRefPathstring
batchWriteBatch | Transaction

Events.fetchEventByBookingOffer(bookingOffer) ⇒ Promise.EventType

Fetch an event from a related bookingOffer

Kind: static method of Events

ParamType
bookingOfferBookingOffer

Events.fetchEventFromChild(child) ⇒ Promise.EventType

Fetch an event by any child record

Kind: static method of Events

ParamType
childRecordDocument

Events.fetchEvents(eventGroup) ⇒ Promise.Array.EventType

fetch an array of all events in an EventGroup

Kind: static method of Events

ParamType
eventGroupEventGroupType

Events.fetchAllEvents() ⇒ Promise.Array.EventType

fetches and returns promise of array of all events (using collectionGroup)

Kind: static method of Events

Events.findEventRefByParams(params) ⇒ string

creates an EventRef from arguments passed in param object (for example, firebase function calls)

Kind: static method of Events
Returns: string - a refPath string to the eventRecord

ParamType
paramsEventParamObject
params.ownerIdstring
params.eventGroupIDstring
params.eventIDstring

Events.findEventBasicByParams(params) ⇒ EventType

creates an EventRObject from arguments passed in param object (for example, firebase function calls)

Kind: static method of Events
Returns: EventType - a refPath string to the eventRecord

ParamType
paramsEventParamObject
params.ownerIdstring
params.eventGroupIDstring
params.eventIDstring

Events.createSummary(event, batch) ⇒ Promise.recordDocument

Creates the raw Summary record for an event from an Event record

Kind: static method of Events

ParamType
eventEventType
batchWriteBatch | Transaction

Events.saveSummary(summary, batch) ⇒ Promise.SummaryType

Writes a (changed?) Summary record back to the database

Kind: static method of Events

ParamType
summarySummaryType
batchWriteBatch | Transaction

Events.updateEventStatus(status, event) ⇒ Promise.SummaryType

Writes a status value to the status field of an event's summary object

Kind: static method of Events

ParamType
statusstring
eventEventType

Events.modifySummary(summary, batch, batch) ⇒ Promise.SummaryType

Saves an updated record. Assumes sourced from database; included fields are merged with database (allows changing single fields)

Kind: static method of Events

ParamTypeDescription
summarySummaryType
summary.refPathstringonly "required" field
batchWriteBatch | Transaction
batchobjectTransaction or WriteBatch chain object

Events.updateEventSummary(summary, event, batch) ⇒ Promise.SummaryType

writes a summary object for an event. The summary record need not exist

Kind: static method of Events

ParamType
summarySummaryType
eventEventType
batchWriteBatch | Transaction

Events.updateSummaryByParams(summary, params) ⇒ Promise.SummaryType

writes a summary object for an event. The summary record need not exist

Kind: static method of Events

ParamType
summarySummaryType
paramsParamsType

Events.findSummaryIdFromChild(child) ⇒ string

identifies the Summary Id from any child of an event

Kind: static method of Events

ParamType
childRecordDocument

Events.findSummaryRefFromChild(child) ⇒ string

identifies the Summary refPath from any child of an event

Kind: static method of Events

ParamType
childRecordDocument

Events.buildSummaryReferenceFromChild(child) ⇒ SummaryType

creats a minimal SummaryType object from an event's child objects

Kind: static method of Events

ParamType
childRecordDocument

Events.fetchSummaryByTree(tree) ⇒ SummaryType

Fetches an event summary using a passed RecordTree Map()

Kind: static method of Events

ParamTypeDescription
treeRecordTreea RecordTree Map(), likely from a child record

Events.findSummaryBasicByParams(params) ⇒ SummaryType

Builds the minimal "record" to refer to a summary using function call params

Kind: static method of Events

ParamType
paramsEventParamObject

Events.fetchSummaryByParams(params) ⇒ Promise.SummaryType

fetches a SummaryRecord from the database based on function call params

Kind: static method of Events

ParamType
paramsCloudParamsObject

Events.fetchSummary(event) ⇒ Promise.SummaryType

Fetches a summary record for a specified event

Kind: static method of Events

ParamType
eventEventType

Events.fetchSummaryFromChild(child) ⇒ Promise.SummaryType

Fetches a summary record from database based on ANY child of the event

Kind: static method of Events

ParamTypeDescription
childRecordDocumentrecord object of ANY child of the relevant event

Events.fetchAllSummary() ⇒ Promise.Array.SummaryType

Fecthes ALL Summaries in the database. Not very useful.

Kind: static method of Events

Events.fetchSummariesByRegion(region) ⇒ Promise.Array.SummaryType

Fetches All Summary Records in a region

Kind: static method of Events

ParamType
regionstring

Events.createLogistics(logistics, event, batch) ⇒ Promise.LogisticsType

Adds a logistics record to a specified event

Kind: static method of Events

ParamType
logisticsLogisticsType
eventEventType
batchWriteBatch | Transaction

Events.createRawLogistics(event, batch) ⇒ Promise.LogisticsType

Creates a default logistics record for an event

Kind: static method of Events

ParamType
eventEventType
batchWriteBatch | Transaction

Events.updateLogistics(logistics, batch) ⇒ Promise.LogisticsType

Writes a (changed?) logistics record back to the database

Kind: static method of Events

ParamType
logisticsLogisticsType
logistics.refPathstring
batchWriteBatch | Transaction

Events.deleteLogistics(logistics) ⇒ Promise.<void>

Writes a (changed?) logistics record back to the database

Kind: static method of Events

ParamType
logisticsLogisticsType
logistics.refPathstring

Events.fetchLogistics(event) ⇒ Promise.LogisticsType

Fetches the logistics record for an event

Kind: static method of Events

ParamType
eventEventType

Events.fetchAllLogistics() ⇒ Promise.Array.LogisticsType

Fetches all logistics records in the database. Not very useful

Kind: static method of Events

Events.findEventsByDateAndOwner(events, date, owner) ⇒ Array.EventType

Filters an array of EventType events by date and owner

Kind: static method of Events

ParamType
eventsArray.EventType
datedateString
ownerOrganizationType
owner.Idstring

Events.findEventsByDate(events, date) ⇒ Array.EventType

Filters an array of EventType events by date

Kind: static method of Events

ParamType
eventsArray.EventType
datedateString

Events.findBookingOffersByDate(bookingOffers, date) ⇒ Array.BookingOffer

Filters an array of BookingOffers by date

Kind: static method of Events

ParamType
bookingOffersArray.BookingOffer
datedateString

Events.eventDescription(event) ⇒ string

Creates a standardized Descriptor String for events

Kind: static method of Events
Returns: string - standardized description

ParamType
eventEventType

Events.pullInventory(event, tickets) ⇒ Promise.EventType

Kind: static method of Events

ParamType
eventEventType
event.Idstring
event.refPathstring
ticketsnumber

Events.pushInventory(event, tickets) ⇒ Promise.EventType

Returns inventory to an event.

Kind: static method of Events

ParamType
eventEventType
event.Idstring
event.refPathstring
ticketsnumber

Events~EventDefault : EventType

Kind: inner constant of Events
Default: {"Id":null,"eventGroup":"","owner":"","counter":"","title":null,"image":null,"banner":null,"booked":null,"dateStart":null,"dateEnd":null,"timeStart":null,"timeEnd":null,"description":null,"region":null}

Events~logisticsForm : LogisticsType

Kind: inner constant of Events
Default: {"Id":null,"refPath":null,"soundCheck":null,"loadIn":null,"loadOut":null,"accommodations":"","digitalListings":"","facebookEvents":"","press":"","posterStatus":null,"socialVideo":""}

Events~summaryForm : SummaryType

Kind: inner constant of Events
Default: {"payout":0,"region":null,"tickets":0,"dollars":0}

Events~EventDefaultForm : EventType

Kind: inner constant of Events
Default: {"title":"text","description":"textarea","image":"uploadImage","banner":"uploadImage","dateStart":"date","dateEnd":"date","booked":"date","region":"lookup:Regions"}

Events~EventAccountForm : EventType

Kind: inner constant of Events
Default: {"title":"text","description":"textarea","dateStart":"date","dateEnd":"date","region":"lookup:Regions"}

Events~EventType : object

Kind: inner typedef of Events
Properties

NameTypeDescription
Idstringpresent if fetch from database
eventGroupEventGroupTypelocal copy of parent eventGroup information
eventGroup.titlestring
titlestringshort title for eventGroup
imagestringstring URL
bannerstringstring URL
ownerOrganizationTypeFor convenience - can be culled from hierarchy
owner.namestringFor convenience - can be culled from hierarchy
counterOrganizationTypecounter-party to event
counter.namestringcounter-party to event
descriptionstringdescription of eventGroup
bookeddateStringnull when open; dateString when booked
dateStartdateStringoptional start date for eventGroup
dateEnddateStringoptional end date of eventGroup
timeStartdateStringoptional start date for eventGroup
timeEnddateStringoptional end date of eventGroup
perksArray.perkTypeoptional array of perks. Not saved to database; populated from sub-collection

Events~LogisticsType : object

type definition for a logistics record (sub-record to events)

Kind: inner typedef of Events
Properties

NameType
Idstring
refPathstring
soundchecktimeString
loadIntimeString
loadOuttimeString

Events~SummaryType : object

Type definition for a Summary record (a sub-record of an Event) Useful to reduce database accesses - "eventually consistent"

Kind: inner typedef of Events
Properties

NameTypeDescription
refPathstring
Idstring
payoutnumbercurrent payout amount total
regionstringcopied from event - used for searches by counters
ticketsnumbernumber of pledges/tickets, summarized/shared from pledgeTickets
dollarsnumbernumber of sales of pledge/tickets

Events~EventParamObject : object

An argument object for passing event references to server functions

Kind: inner typedef of Events
Properties

NameTypeDescription
ownerIDstringargument
eventGroupIDstringargument
eventIdstringargument

Favorites

Typedefs, constants, support functions and database operations related to Favorites

Favorites.fetchFavorites(fan) ⇒ FavoriteList

Returns the set of favorited accounts for a Fan/User Brute-force; returns FULL list - see browser functions for pagination

Kind: static method of Favorites
Returns: FavoriteList - - returns an array of objects

ParamTypeDescription
fanobjecta fan object to reference from
fan.refPathstringdatabase pointer to fan record

Favorites~alertRecord : object

Kind: inner typedef of Favorites
Properties

NameTypeDescription
IdstringId of record, uuid
refpathstringpath to alert, includes /TYPE/Id/ ** /alerts/Id
descriptionstringdescription of change?
timestamptimestampdatabase timestamp of posting change

Favorites~FavoriteDefinition : Record

Kind: inner typedef of Favorites
Properties

NameTypeDescription
IdstringId of favorited organization
refPathstringrefpath to favorite'd business includes /TYPE/Id
namestringname of favorite
imagestringconvenient for (quick) display
IdstringId of favorited organization
referenceFavoriteReferencecontains the basic data from favorite account
lastAlertalertRecordcopy of last alertRecord observed by the Fan

Favorites~FavoriteList : FavoriteDefinition

Kind: inner typedef of Favorites

Fundamentals

Typedefs, constants, support functions and database operations related to Fundamental setting from the Database *

Fundamentals.fetchFundamentals() ⇒ Promise.<Fundamentals>

returns a Promise which resolves with an array of all Fundamentals Objects (or err)

Kind: static method of Fundamentals

Fundamentals.fetchRates() ⇒ Promise.<Rates>

returns a Promise that resolves with the Rates record from the database

Kind: static method of Fundamentals

Fundamentals.fetchPayoutRates() ⇒ Promise.<PaymentProcessor>

returns a Promise that resolves with the Rates record from the database

Kind: static method of Fundamentals

Fundamentals.fetchMCCs() ⇒ Promise.<Array.MCCType>

returns an array of all MCC (Merchant Commerce Code) available

Kind: static method of Fundamentals

Fundamentals~Rates : Rates

Kind: inner constant of Fundamentals
Default: {"Id":null,"service_charge":""}

Fundamentals~paymentProcessor : PaymentProcessor

Kind: inner constant of Fundamentals
Default: {"connected_active":200,"processing_concurrency":10,"processing_rate":25,"processing_time_window":1000,"per_payout":25,"rate_payout":25,"rate_payout_scale":10000}

Fundamentals~MCCDefault : MCCType

Kind: inner constant of Fundamentals
Default: {"Id":null,"MCC":null,"name":null,"description":null,"long":null,"type":null}

Fundamentals~Rates : object

Kind: inner typedef of Fundamentals
Properties

NameTypeDescription
Idstring
service_chargeobject
service_charge.minimumnumber
service_charge.ratenumberpercentage
service_charge.rounding_factornumber

Fundamentals~PaymentProcessor : object

Kind: inner typedef of Fundamentals
Properties

NameTypeDescription
connected_activenumberallowed active connections
processing_concurrencynumber
processing_ratenumber
processing_time_windownumber
per_payoutnumber
rate_payoutnumber
rate_payout_scalenumber

Fundamentals~MCCType : object

Kind: inner typedef of Fundamentals
Properties

NameTypeDescription
Idstring
MCCstringMerchant Class Code
namestringMerchant Class Code
descriptionstringdescription of Merchant Class Code
longstringlong description of Merchant Class Code
typestringApplicable business model - "Artists", "Venues" or "Brands"

Fundamentals~Fundamentals : object

Kind: inner typedef of Fundamentals
Properties

NameType
RatesRates
PaymentProcessorPaymentProcessor
Defaultsobject
Defaults.MCCMCCType

Gallery

Support for image "Galleries" for accounts (combined Firestore and Storage)

Gallery.galleryList(host, listOptions) ⇒ Promise.<GalleryList>

returns an object with the listOptions provided, an array of StorageReferences from the associated host Gallery,and the next Page Token, if any

Kind: static method of Gallery

ParamType
hostRecord
listOptionsListOptions

Gallery.paginateGallery(host, limit) ⇒ Promise.<PaginateList>

Returns a paginating control object for the Gallery images of a host/organization Record

Kind: static method of Gallery

ParamTypeDescription
hostRecord
limitnumbernumber of results per "page". null indicates no limit

Gallery.addURLToGallery(host, urlArray) ⇒ Promise.<null>

adds url strings (as an array) to a Gallery Array Field in the Host

Kind: static method of Gallery

ParamType
hostRecord
urlArrayArray.string

Gallery.removeURLFromGallery(host, urlArray) ⇒ Promise.<null>

removes url strings (as an array) from a Gallery Array Field in the Host. Each must match exactly

Kind: static method of Gallery

ParamType
hostRecord
urlArrayArray.string

Gallery~GalleryList : object

Kind: inner typedef of Gallery
Properties

NameTypeDescription
maxResultsnumberIf set, limits the total number of prefixes and items to return. The default and maximum maxResults is 1000.
itemsArray.StorageReference
nextPageTokenstring

Gallery~PaginateList : object

Kind: inner typedef of Gallery
Properties

NameType
storageReferenceStorageReference
statusnumber
limitnumber
listOptionsListOptions

Genres

Typedefs, constants, support functions and database operations related to Musical Genres

Genres.GenresForm : GenreRecord

Kind: static constant of Genres

Genres.createGenre(genreForm) ⇒ Promise.<GenreRecord>

writes a genre record tothe database

Kind: static method of Genres

ParamType
genreFormGenreRecord

Genres~GenreRecord : object

Kind: inner constant of Genres
Properties

NameType
Idstring
namestring
sub_genre_ofstring | null

Messages

Typedefs, constants, support functions and database operations related to Messaging

Messages.logMessageEvent(messageEvent) ⇒ Promise.<RecordDocument>

Message "receipts" are saved in a MESSAGES collection directly under the relevant object. Each is saved as distinct object. They can be queried by the parent event, sorted by the timestamp, to find the latest status. Note that the messaging systens ADDS the rlevant .Id and .refPath to the "message" so we can do this.

Kind: static method of Messages
Returns: Promise.<RecordDocument> - - document as written to database - note NOT the stored document, but the PRE-MERGED document including Id and refPath.

ParamTypeDescription
messageEventMessageEventthe webhook event structure

Messages.messageStatus(record) ⇒ Promise.<string>

fetches the most recent status message event on a particular object Could involve multiple messages, statuses, etc

Kind: static method of Messages
Returns: Promise.<string> - event type/status - "processed", "bounced", "delivered", etc

ParamTypeDescription
recorddocumentRecordobject to find message history for. Currently only Receipts and PledgeTickets

Messages.messageEvents(record) ⇒ Promise.<Array.<MessageEvent>>

fetches all of the message events associated with a partucular record, sorted by reverse timestamp

Kind: static method of Messages
Returns: Promise.<Array.<MessageEvent>> - array of message events

ParamTypeDescription
recorddocumentRecordobject to find message history for. Currently only Receipts and PledgeTickets

Organizations

Typedefs, constants, support functions and database operations related to Business Ornanizations (Artists, Venues, Brands, etc)

Organizations.organizationMember : OrganizationMember

Kind: static constant of Organizations

Organizations.organizationMatch : OrganizationMatch

Kind: static constant of Organizations

Organizations.organizationMemberForm : OrganizationMatch

Kind: static constant of Organizations

Organizations.createNewOrganization(organization, manager, batch) ⇒ WriteBatch | Transaction | null

Creates a new Organization account, including the sub-documents Business and OrganizationsPayment. Also establishes the initiating account as the Manager for the Organization account IF an individual user creates an organization, their account is passed as the "owner", and is made manager IF a venue account creates an organization (for calendar reasons), then an email is passed in the owner object, to be claimed by organization later Q: CAN an organization create an organization (org members, for example?)

Kind: static method of Organizations
Returns: WriteBatch | Transaction | null - WriteBatch, Transaction or Void

ParamTypeDescription
organizationOrganizationTypebasic organization information for new account
organization.namestringname of the organization/act
organization.regionstringhome town/region of Organization
managerAccess
manager.Idstringwhen Id is prescribed (such as a "personal organization account" for a user) this value will be used. If it is not present a new Unique Id will be generated
manager.emailstring-
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

Organizations.saveOrganization(organization, batch) ⇒ WriteBatch | Transaction | null

Takes an object with organization data and saves it as a record in the database If it originated from the database, just use the record data to write it directly If not, cherrypick appropriate data and create a new record (works consolidated because top-level)

Kind: static method of Organizations
Returns: WriteBatch | Transaction | null - WriteBatch, Transaction or Void

ParamTypeDescription
organizationOrganizationType
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

Organizations.deleteOrganization(organization) ⇒ Promise.<void>

deletes an organization record. DOES NOT clear the entire structure

Kind: static method of Organizations

ParamType
organizationOrganizationType
organization.refPathstring

Organizations.fetchOrganization(organizationID) ⇒ Promise.recordDocument

retreives an organization record from the database based on it's unique Id

Kind: static method of Organizations

ParamType
organizationIDstring

Organizations.fetchAllOrganizations() ⇒ Promise.Array.OrganizationType

returns a Promise which resolves with an array of all Organization Objects (or err)

Kind: static method of Organizations

Organizations.searchOrganizations(prompt, limit) ⇒ Promise.Array.OrganizationType

returns a Promise which resolves to an array of all Organization's whose name begins with the provided prompt, optionally limited to a provided number CASE SENSITIVE FOR NOW

Kind: static method of Organizations

ParamTypeDescription
promptstringUsed to query for matching Organizations
limitstring | numberUsed to limit the number of results

Organizations.cycleListType(profile) ⇒ Promise.OrganizationType

Changes the "listing style" saved for an organization

Kind: static method of Organizations

ParamType
profileOrganizationType

Organizations.addTolineup(neworganizationMember, organization) ⇒ Promise.OrganizationType

Inserts a new org member into an organization's lineup

Kind: static method of Organizations

ParamType
neworganizationMemberOrganizationMember
neworganizationMember.Idstring
organizationOrganizationType
organization.Idstring
organization.namestring
organization.emailstring

Organizations.removeFromLineup(neworganizationMember, organization) ⇒ Promise.OrganizationType

Removes a lineup entry from an organization

Kind: static method of Organizations

ParamType
neworganizationMemberorganizationMember
neworganizationMember.Idstring
organizationOrganizationType
organization.Idstring
organization.namestring
organization.emailstring

Organizations.fetchOrganizationsAccess(organization) ⇒ Promise.<Array.OrganizationMatch>

Fetches the array of Access records for an organization

Kind: static method of Organizations
Returns: Promise.<Array.OrganizationMatch> - organizations/acts this organization is a member of

ParamTypeDescription
organizationOrganizationType(actually just organization.Id)
organization.Idstring

Organizations.saveOrganizationAccess(accessArray) ⇒ Promise.<null>

Save an array of access records back to the relevant organizations

Kind: static method of Organizations

ParamType
accessArrayArray.AccessEntryForm

Organizations.findOrganizationIDFromChild(child) ⇒ string

Extracts the Organizations ID from the Document Path (assumes as a child)

Kind: static method of Organizations
Returns: string - Id of organization Document (which is also ID of organization)

ParamTypeDescription
childDocumentObjectdocument (regardless of depth) of an Organization Document

Organizations.findOrganizationRefFromChild(child) ⇒ string

Fetches the database record for an organization based on ANY child record

Kind: static method of Organizations

ParamType
childrecordDocument

Organizations.fetchOrganizationFromChild(child) ⇒ Promise.recordDocument

Extracts the Organizations ID from the Document Path (assumes as a child)

Kind: static method of Organizations
Returns: Promise.recordDocument - Id of organization Document (which is also ID of organization)

ParamTypeDescription
childrecordDocumentdocument (regardless of depth) of an Organization Document

Organizations~OrganizationDefault : OrganizationType

Kind: inner constant of Organizations
Default: {"Id":null,"name":null,"image":null,"banner":null,"bio":null,"description":null,"genres":"","skills":"","lineup":"","Gallery":"","website":null,"social_links":null,"region":null,"color":null,"borderColor":null,"textColor":null}

Organizations~OrganizationDefaultForm : OrganizationType

Kind: inner constant of Organizations
Default: {"name":"text","region":"lookup:Regions","banner":"uploadImage","bio":"textarea","description":"textarea","website":"url:web","social_links":"array:url","genres":"arrayLookup:Genres","skills":"arrayLookup:Skills"}

Organizations~OrganizationType : object

Kind: inner typedef of Organizations
Properties

NameTypeDescription
Idstringpresent if fetch from database
namestringname of Organization/Act
typestringtype of account Artist, Venue, Brand, Other
imagestringstring URL
bannerstringstring URL
biostringbiography of Organization/Act
descriptionstringdescription of Organization/Act
listTypestring
genresGenreFormTypearray of Genre objects describing Organization/Act
skillsSkillFormTypearray of skill (instrument) objects describing Organization/Act
lineupOrganizationTypearray of Organization profile summaries of members/subbrands/etc
websitestringstring URL to main Organization/Act website
social_linksstringarray of string URL to additional Organization/Act web properies
PublicInfoBusinessDefaulta reduced-copy of business info (address, etc) to be made public Ground truth always in Business record
regionstringa string representing to Organization/Act home region SELECTED FROM list of regions
colorstringHTML/CSS color string or name - general color of profile/display
borderColorstringHTML/CSS color string or name - general color of profile/display borders
textColorstringHTML/CSS color string or name - general color of profile/display text

Organizations~OrganizationMember : object

Kind: inner typedef of Organizations
Properties

NameType
namestring
imageURL
skillsArray.string

Organizations~OrganizationMatch : object

Kind: inner typedef of Organizations
Properties

NameTypeDescription
Idstring
namestring
imagestringURL to image
rolestring

Payment

"Payment Descriptor" handling operations. These descriptors represent paymentMethods, each tied to an individual user. These do not particularly represent a paymentProvider - they are meant as an abstraction above a specific payment processor.

Payment.ERROR_TYPES : Object

Kind: static constant of Payment

Payment.PaymentDefault : PaymentData

Kind: static constant of Payment

Payment.paymentDescriptor : PaymentDescriptorType

Kind: static constant of Payment

Payment.receiptDefault : ReceiptType

Kind: static constant of Payment

Payment.createPaymentRecord(account, batch) ⇒ Promise.<(WriteBatch|Transaction|void)>

Creates the ArtistPayment information document

Kind: static method of Payment
Returns: Promise.<(WriteBatch|Transaction|void)> - WriteBatch, Transaction or Void

ParamTypeDescription
accountAccountObject
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

Payment.savePaymentData(account, paymentData)

Saves a payment data record to a given account (organization or person) ALL OF fans, artists and venues save the payment data in the same collection name under the parent, with the SAME Id as the parent

Kind: static method of Payment

ParamType
accountAccountType
account.refPathstring
paymentDataPromise.PaymentData

Payment.fetchPayment(account, paymentData)

fetches a paymentData record from the database for an account ALL OF fans, artists and venues save the payment data in the same collection name under the parent, with the SAME Id as the parent

Kind: static method of Payment

ParamType
accountAccountType
paymentDataPromise.PaymentData

Payment.fetchPaymentByOwnerType(accountId, type, paymentData)

fetches a paymentData record from the database for an account when only accountID and type are known ALL OF fans, artists and venues save the payment data in the same collection name under the parent, with the SAME Id as the parent

Kind: static method of Payment

ParamType
accountIdstring
typestring
paymentDataPromise.PaymentData

Payment.addPaymentDescriptor(account, descriptor, batch) ⇒ Promise.PaymentDescriptorType

Adds a specific paymentDescriptor to an account payment data

Kind: static method of Payment

ParamTypeDescription
accountAccountType
account.Idstring
account.refPathstring
descriptorPaymentDescriptorType
descriptor.paymentMethodstring
descriptor.fingerprintstring
descriptor.labelstring
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

Payment.savePaymentDescriptor(descriptor) ⇒ Promise.PaymentDescriptorType

Saves a modified paymentDescriptor back to the database

Kind: static method of Payment

ParamType
descriptorPaymentDescriptorType
descriptor.Idstring
descriptor.refPathstring

Payment.removePaymentDescriptor(account, descriptor) ⇒ Promise.<void>

Removes a paymentDescriptor from an account's paymentData

Kind: static method of Payment

ParamType
accountAccountType
descriptorPaymentDescriptorType

Payment.fetchPaymentDescriptors(account) ⇒ Promise.Array.PaymentDescriptor

fetch all customer card records IN OUR DATABASE (not payment database)

Kind: static method of Payment

ParamType
accountAccountType
account.refPathstring

Payment.listPDSummaries(account) ⇒ Promise.Array.PDSummary

fetch the front-end list of paymentDescriptors

Kind: static method of Payment

ParamType
accountAccountType
account.Idstring
account.refPathstring

Payment.fetchLatestPDSummary(account) ⇒ Promise.PaymentDescriptorType

Kind: static method of Payment

ParamType
accountAccountType
account.Idstring
account.refPathstring

Payment.fetchPDByFingerprint(account, fingerprint) ⇒ Promise.<PDSummary>

retreives a PD, given the account Id and Type

Kind: static method of Payment

ParamType
accountAccountType
fingerprintstring

Payment.fetchPDByOwnerType(accountId, type, fingerprint) ⇒ Promise.<PDSummary>

retreives a PD, given the account Id and Type

Kind: static method of Payment

ParamType
accountIdstring
typestring
fingerprintstring

Payment.replaceDefaultPDSummary(account, PDSummary) ⇒ Promise.AccountObject

Copies a PDSummary tobe the new default (convenience function)

Kind: static method of Payment

ParamType
accountAccountType
PDSummaryPDSummary

Payment.saveReceiptRecord(account, receipt, batch) ⇒ Promise.ReceiptType

Savess a Receipt to an account

Kind: static method of Payment

ParamTypeDescription
accountAccountType
receiptReceiptType
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

Payment.updateReceipt(receipt) ⇒ Promise.ReceiptType

Updates a (changed?) Receipt record

Kind: static method of Payment

ParamType
receiptReceiptType

Payment.saveReceiptRecordByOwnerType(ownerId, type, receipt, batch) ⇒ Promise.ReceiptType

Saves a new receipt to an account referrred by ID and type

Kind: static method of Payment

ParamTypeDescription
ownerIdstring
typestringeither ORGANIZATIONS or PEOPLE
receiptReceiptType
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

Payment.anyReceiptsByMonthStamp(account, monthStamp) ⇒ Promise.Array.ReceiptType

Fetches an array of receipts in any particular month by monthStampt

Kind: static method of Payment

ParamType
accountAccountObject
monthStampdateString

Payment.saveReceiptRecordByChild(child, receipt, batch) ⇒ Promise.ReceiptType

Saves a receipt by a child record reference

Kind: static method of Payment

ParamTypeDescription
childRecordDocument
receiptReceiptType
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

Payment.fetchReceiptsFiltered(account, filterArray, sortArray, limit) ⇒ Promise.Array.ReceiptType

Fetches receipts based on a filter set

Kind: static method of Payment

ParamType
accountAccountObject
account.refPathstring
filterArrayArray.filterObject
sortArrayArray.sortObject
limitnumber

Payment.fetchProblemReceipts(account) ⇒ Promise.Array.ReceiptType

Kind: static method of Payment

ParamType
accountAccountObject
account.refPathstring

Payment.fetchPledgeTicketReceipt(pledgeTicket) ⇒ Promise.ReceiptType

Fetches the receipt for a pledgeTicket

Kind: static method of Payment

ParamType
pledgeTicketPledgeTicket

Payment.markReceiptFromPledgeTicket(pledgeTicket, label) ⇒ Promise.ReceiptType

Changes the paidQ label on a receipt associated with a pledgeTicket

Kind: static method of Payment

ParamType
pledgeTicketpledgeTicketType
labelstring

Payment.markReceipt(receipt, label) ⇒ Promise.ReceiptType

Changes the paidQ label on a receipt associated with a pledgeTicket

Kind: static method of Payment

ParamType
receiptreceiptType
labelstring

Payment.platformFee(price, rates) ⇒ number

Calculates and returns the platform fee for a sale amount

Kind: static method of Payment

ParamType
pricenumber
ratesRates

Payment~fetchReceipt(account, receiptId) ⇒ Promise.ReceiptType

Kind: inner method of Payment

ParamType
accountAccountObject
account.refPathstring
receiptIdstring

Payment~PaymentData : object

Kind: inner typedef of Payment
Properties

NameType
Idstring
payment_gatewaystring
statusstring
tax_IDstring

Payment~PaymentDescriptorType : object

Kind: inner typedef of Payment
Properties

NameTypeDescription
Idstringdocument Id of this Card Descriptor (same as fingerprint)
paymentMethodstringId of payment system card item
fingerprintstringUnique hash of card info - for checking uniqueness
labelstringBrand & last4, or other descriptive
expirystringexpiry date of payment method (if any)
timestamptimestamplast create or modify server time

Payment~PDSummary : object

Kind: inner typedef of Payment
Properties

NameTypeDescription
Idstringdocument Id of this Card Descriptor
labelstringBrand & last4, or other descriptive

Payment~ReceiptType : object

Kind: inner typedef of Payment
Properties

NameTypeDescription
Idstringsame Id as the associated pledgeTicket
amountnumber
paymentobject
linkstringId of associated payment_intent
paidQstringstring describing status
descriptionstringsupplemental information

Payment~AccountObject : OrganizationType | PersonObject

Kind: inner typedef of Payment

People

Typedefs, constants, support functions and database operations related to individual users

People.PeopleAccountForm : PersonObject

Kind: static constant of People
Read only: true

People.createPerson ⇒ Promise.PersonObject

Kind: static constant of People

ParamTypeDescription
personPersonObjectminimal record of user account

People.deletePerson(person) ⇒ Promise.<void>

Kind: static method of People

ParamType
personPersonObject

People.deletePersonById(person) ⇒ Promise.<void>

Kind: static method of People

ParamTypeDescription
personPersonObjectminimal record of user account
person.Idstringrecord Id of account

People.buildPersonRecords(user) ⇒ Promise.<void>

Builds a Person record from the authentication "user" data

Kind: static method of People

ParamType
userUser
user.isAnonymousboolean
user.displayNamestring
user.photoURLstring
user.emailstring
user.phoneNumberstring

People.updatePersonByID(person) ⇒ promise.PeopleObject

writes record back to database. Assumes only Id is valid

Kind: static method of People
Returns: promise.PeopleObject - a copy of the data written

ParamTypeDescription
personPeopleObjecta partially-populated people record for updates

People.updatePerson(person) ⇒ promise.PeopleObject

writes record back to database. Assumes only Id is valid

Kind: static method of People
Returns: promise.PeopleObject - a copy of the data written

ParamTypeDescription
personPeopleObjecta partially-populated people record for updates

People.knownPerson(Id) ⇒ Promise.boolean

Checks if this is a known PersonObject Id

Kind: static method of People
Returns: Promise.boolean - true is this Id is in database

ParamTypeDescription
IdstringId value to check

People.updateUserAccess(accessItem, organization) ⇒ Promise.Access

updates or adds a userAccessRole document for an indicated user (in the accessItem)

Kind: static method of People

ParamType
accessItemAccessType
organizationOrganizationType
organization.Idstring
organization.typestring

People.removeUserAccess(accessItem, entity) ⇒ Promise.<void>

delete a userAccess document for an indicated user (in the accessItem)

Kind: static method of People

ParamType
accessItemAccess
entityPersonObject

People.fetchPeople() ⇒ Array.PeopleObject

Fecthes ALL people records. Not very useful

Kind: static method of People

People.fetchPeoplePaginated(limit) ⇒ PaginatedFetch

Fetchs an object to fetch pages of people data, ascending by name, "limit" at a time

Kind: static method of People
Returns: PaginatedFetch - object with pagination methods

ParamType
limitnumber

People.fetchAnonymousPaginated(limit) ⇒ PaginatedFetch

Fetchs an object to fetch pages of anonymous people data, ascending by name, "limit" at a time

Kind: static method of People
Returns: PaginatedFetch - object with pagination methods

ParamType
limitnumber

People.fetchPerson(personId) ⇒ Promise.PeopleObject

Fetches a single PeopleObject record by Id

Kind: static method of People

ParamType
personIdstring

People.fetchPersonName(personId) ⇒ Promise.string

Fetches and returns the summarized name from a PeopleObject record

Kind: static method of People
Returns: Promise.string - the summarized name from the record

ParamType
personIdstring

People.fetchPersonEmail(personId) ⇒ Promise.string

Fetches and returns the email from a PeopleObject record

Kind: static method of People
Returns: Promise.string - the email from the record

ParamType
personIdstring

People.fetchPersonPaymentById(personId) ⇒ Promise.PaymentData

Fetches the PaymentRecord for a person using just the ID

Kind: static method of People

ParamType
personIdstring

People.fetchUserByEmail(email) ⇒ Promise.PeopleObject

Fetch a People record by their email

Kind: static method of People

ParamType
emailstring

People.fetchFullPerson(personIdentifier) ⇒ Promise.PeopleObject

fetches a full person object (address, payment, private, etc) given EITHER just the Id, OR a PersonObject

Kind: static method of People

ParamType
personIdentifierstring | PersonObject
personIdentifier.Idstring

People.summarizePerson(person) ⇒ string

Returns a standardized formatted name string

Kind: static method of People
Returns: string - formatted name string

ParamType
personPeopleObject

People.fetchPersonFromChild(child) ⇒ Promise.PeopleObject

Fetches a PersonObject from any child record in any branch

Kind: static method of People

ParamType
childRecordDocument

People.personFromId(personId) ⇒ PeopleObject

builds a minimal PeopleObject from an Id

Kind: static method of People

ParamType
personIdstring

People~PeopleDefault : PersonObject

Kind: inner constant of People
Default: {"Id":null,"refPath":null,"first_name":null,"last_name":null,"isAnonymous":true,"image":null,"region":null,"social_links":"","bio":null,"website":null,"payment_method":null,"admin_status":null}
Read only: true

People~PeopleDefaultForm : PersonObject

Kind: inner constant of People
Default: {"first_name":"text","last_name":"text","region":"lookup:Regions","social_links":"array:url","website":"url","bio":"textarea"}
Read only: true

People~PersonObject : object

Kind: inner typedef of People
Properties

NameTypeDescription
IdstringId of document from storage
refPathstringif from database, full path to document
first_namestringcould be "Anonymous"
last_namestring
isAnonymousbooleanflag indicating auto-generated Anonymous user account
imageurlURL (possibly in app storage) of User image
regionstringUser home region, from fixed list
social_linksurlarray of user social account links
biostringuser-maintained biography
websiteurlURL to user personal website
payment_methodstringsummary string of user payment method. Not secure, not source-of-truth
privateDataPrivateDatawhen "full account"
paymentPaymentDatawhen "full account"

People~PaginatedFetch : object

An object to allow for paginating a table read from Firestore. REQUIRES a sorting choice

Kind: inner typedef of People
Properties

NameTypeDescription
QueryQuerythat forms basis for the table read
limitnumberpage size
snapshotQuerySnapshotlast successful snapshot/page fetched
statusenumstatus of pagination object
PageForwardmethodpages the fetch forward
PageBackmethodpages the fetch backward

PrivateData

Functions for managing (potentially)private data for a user or organization. Unified structure as a sub-record of fan, organization, or CityManager accounts

PrivateData.recordByIdAndType ⇒ AccountType

creates and returns a minimal record from an Id and "type"

Kind: static constant of PrivateData

ParamType
Idstring
Typestring

PrivateData.fetchFullAccount(account) ⇒ Promise.AccountType

Fetches a fulll object representation of an account, including ExtraData

Kind: static method of PrivateData

ParamType
accountAccountType

PrivateData.fetchPrivateData(account) ⇒ Promise.PrivateData

Fecthes the PrivateData (corporate, addresses, etc) for an account

Kind: static method of PrivateData

ParamType
accountAccountType

PrivateData.accountPage(account, origin)

Composes a URL for an "account page" from the account, and passed base URL

Kind: static method of PrivateData

ParamTypeDescription
accountAccountType
originstringbase URL for the application

PrivateData.createPrivateData(account, batch) ⇒ Promise.<ChainType>

Kind: static method of PrivateData
Returns: Promise.<ChainType> - WriteBatch, Transaction or Void

ParamTypeDescription
accountAccountType
batchChainTypebatching object. Transaction will be added to the batch

PrivateData.savePrivateData(privateData) ⇒ Promise.<PrivateData>

Writes the "private" data to the database

Kind: static method of PrivateData

ParamType
privateDataPrivateData

PrivateData.deletePrivateData(privateData) ⇒ Promise.<void>

Deletes a PrivateData record (rarely used if ever)

Kind: static method of PrivateData

ParamType
privateDataPrivateData
privateData.refPathstring

PrivateData.profileComplete(account, privateData) ⇒ Boolean

verifies that all needed information has been filled in

Kind: static method of PrivateData

ParamTypeDescription
accountAccountType
privateDataPrivateDatarecord

PrivateData.profileIncomplete(account, privateData) ⇒ string | null

verifies that all needed information has been filled in

Kind: static method of PrivateData

ParamTypeDescription
accountAccountType
privateDataPrivateDatarecord

PrivateData.setOpenIssues(privateData) ⇒ Promise.boolean

Sets the "openIssues" flag in an account's Payment record The account's refPath is attached to the Payment system's record, and used here to find the Payment Account

Kind: static method of PrivateData

ParamType
privateDataPrivateData

PrivateData.clearOpenIssues(privateData) ⇒ Promise.boolean

Clears the "openIssues" flag in an account's Payment record The account's refPath is attached to the Payment system's record, and used here to find the Payment Account

Kind: static method of PrivateData

ParamType
privateDataPrivateData

PrivateData~PrivateDefault : PrivateData

Kind: inner constant of PrivateData
Default: {"Id":null,"business_email":null,"contact":null,"business_address":null,"mailing_address":null,"billing_address":null,"tel":null,"mcc":null,"tax_rate":null,"openIssues":false}

PrivateData~PrivateAccountForm : PrivateData

Kind: inner constant of PrivateData
Default: {"refPath":"hidden:text","business_email":"email","contact":"","business_address":"","mailing_address":"","billing_address":"","tel":"tel","mcc":""}

PrivateData~contact : object

Kind: inner typedef of PrivateData
Properties

NameTypeDescription
contact.Idstring
contact.first_namestring
contact.last_namestring
contact.telstring
contact.emailstringmust be filled in to make profile public

PrivateData~PrivateData : object

Kind: inner typedef of PrivateData
Properties

NameTypeDescription
emailstringmust be filled in to make profile public
contactcontact
telstring
business_addressAddressType
mailing_addressAddressType
billing_addressAddressType

PrivateData~ChainType : WriteBatch | Transaction | void

Kind: inner typedef of PrivateData

Regions

Typedefs, constants, support functions and database operations related to Regions All events and services are grouped under Regions, which define our service areas

Regions.saveRegion ⇒ Promise.RegionType

Writes a (changed) RegionType record back to the database

Kind: static constant of Regions

ParamType
regionFormRegionType

Regions.createRegion(regionForm) ⇒ Promise.RegionType

Writes a RegionRecord to the database

Kind: static method of Regions

ParamType
regionFormRegionType

Regions~RegionDefault : RegionType

Kind: inner constant of Regions
Default: {"Id":null,"name":null,"active":false,"maplink":null}
Read only: true

Regions~RegionDefaultForm : RegionType

Kind: inner constant of Regions
Default: {"name":"text"}
Read only: true

Regions~RegionType : object

Kind: inner typedef of Regions
Properties

NameType
Idstring
namestring
activeboolean
maplinkMapLink

Roles

Typedefs, constants, support functions and database operations related to Roles These are how People relate to Organizations - employess, managers, members, etc

Roles.createRole(roleForm) ⇒ Promise.RoleType

Adds a new role object to the list of roles

Kind: static method of Roles
Returns: Promise.RoleType - result from the database operation

ParamType
roleFormRoleType

Roles.fetchRoles() ⇒ Promise.Array.RoleType

loads the ABSTRACT list of roles/role-types from Redux store This is NOT specific to a user; this is the database-maintained list of POSSIBLE Roles.

Kind: static method of Roles

Roles.fetchPersonsAccess(person) ⇒ Promise.Array.RoleType

Classifies a person's granted accesses.

Kind: static method of Roles

ParamType
personAccountType

Roles.fetchAccessByUser(requested, roleType) ⇒ Promise.<AccessesObject>

searches all businesses/managers for a user's Id (i.e. NOT the user record version)

Kind: static method of Roles

ParamTypeDescription
requestedPersonObjectUser object requesting access information
roleTypestring

Roles.fetchAccessByTarget(user, targetID, roleType) ⇒ Promise.AccessesObject

Fetches access information for specific account

Kind: static method of Roles

ParamTypeDescription
userPersonObjectfor user
targetIDstringfrom organziation
roleTypestringoptional specific role

Roles.normalizeAccess(accessItem) ⇒ Promise

called from a FirestoreUpdate event, to send changes to an accessItem to the various denormalized destination

Kind: static method of Roles

ParamType
accessItemAccessType

Roles.unnormalizeAccess(accessItem) ⇒ Promise

called from a FirestoreUpdate event, to send changes to an accessItem to the various denormalized destination

Kind: static method of Roles

ParamType
accessItemAccessType

Roles.findUserAndGrantAccess(offer) ⇒ Promise.Array.RoleType

Kind: static method of Roles
Returns: Promise.Array.RoleType - Array.RoleType resolve if successful, reject if no match

ParamTypeDescription
offerAccessOffer
offer.entityArtistObject | VenueObjectArray.RoleTypeId of entity offering role
offer.entity.IdstringArray.RoleTypeId of entity offering role
offer.entity.refPathstringArray.RoleTypeId of entity offering role
offer.namestringArray.RoleTypeoptional Name for proposed rol
offer.rolestringArray.RoleTypetype of role offered
offer.emailstringArray.RoleTypeemail of person proposed for role

Roles.addAccess(organization, accessItem, batch) ⇒ Promise.<(WriteBatch|Transaction|null)>

Kind: static method of Roles
Returns: Promise.<(WriteBatch|Transaction|null)> - WriteBatch, Transaction or Void

ParamTypeDescription
organizationOrganizationType
organization.refPathstring
accessItemAccessOffer
accessItem.entityIdstringArray.RoleTypeId of entity offering role
accessItem.namestringArray.RoleTypeoptional Name for proposed rol
accessItem.rolestringArray.RoleTypetype of role offered
accessItem.emailstringArray.RoleTypeemail of person proposed for role
batchWriteBatch | TransactionArray.RoleTypebatching object. Transaction will be added to the batch

Roles.removeAccess(organization, accessItem, batch) ⇒ Promise.<(WriteBatch|Transaction|null)>

Kind: static method of Roles
Returns: Promise.<(WriteBatch|Transaction|null)> - WriteBatch, Transaction or Void

ParamTypeDescription
organizationOrganizationType
organization.refPathstring
accessItemAccess
batchWriteBatch | TransactionArray.RoleTypebatching object. Transaction will be added to the batch

Roles.summarizeAccess(accessItem) ⇒ string

Kind: static method of Roles

ParamType
accessItemAccessType

Roles.saveAccess(access) ⇒ Promise.AccessType

Kind: static method of Roles

ParamType
accessAccessType

Roles~RoleDefault : RoleType

Kind: inner constant of Roles
Default: {"Id":null,"name":null,"active":false}
Read only: true

Roles~RoleDefaultForm : RoleType

Kind: inner constant of Roles
Default: {"name":"text"}
Read only: true

Roles~AccessEntryDefault : AccessType

Kind: inner constant of Roles
Default: {"Id":null,"name":null,"role":null,"email":null}
Read only: true

Roles~AccessEntryForm : AccessType

Kind: inner constant of Roles
Default: {"name":"text","role":"lookup:Roles","email":"email"}
Read only: true

Roles~AccessEntryEdit : AccessType

Kind: inner constant of Roles
Default: {"name":"text:{disabled=true}","role":"lookup:Roles","email":"email:{disabled=true}"}
Read only: true

Roles~RoleType : object

Kind: inner typedef of Roles
Properties

NameTypeDescription
IdstringDatabase record Id of role object
namestringname of particular role
activebooleanstatus of role in operations

Roles~AccessOffer : object

Kind: inner typedef of Roles
Properties

NameTypeDescription
rolestringtype of role offered
namestringor proposed role
emailstringof person proposed for role
uidstringof organization offering role

Roles~AccessType : object

This object is used to describe a user's access to an Artist's account. The user that creates an artist account is always given "Manager" access, filling in name, role and Id. A user can be invited to a role by assigning just Role and email - we will send the email inviting the user to our system (if they aren't already) They will then create a new user account if needed, and can find roles they've been invited to. When accepted, their name and Id will be copied to the access record.

Kind: inner typedef of Roles
Properties

NameTypeDescription
Idstringof user given this role, when known
namestringfor display; name of person having access
rolestringassigned to this access record
emailstringof User to match to this access record

Roles~AccessesObject : object

Kind: inner typedef of Roles
Properties

NameType
cityManagersArray.AccessType
venuesArray.AccessType
artistsArray.AccessType
accountsArray.AccessType

Skills

Typedefs, constants, support functions and database operations related to Skills These are attributes for both individuals and Organizations (generally artists)

Skills.SkillsDefault : SkillsType

Kind: static constant of Skills
Read only: true

Skills.SkillsForm : SkillsType

Kind: static constant of Skills
Read only: true

Skills.createSkill(skillForm) ⇒ Promise.SkillsType

Kind: static method of Skills

ParamType
skillFormSkillsType

Skills~SkillsType : object

Kind: inner typedef of Skills
Properties

NameType
Idstring
namestring
sub_skill_ofstring

Utilities

Typedefs, constants, support functions and database operations for general Utilities

Utilities.saveHost(host) ⇒ Promise.OrganizationType

A convenience functin for some shared artist/host front-end pages

Kind: static method of Utilities

ParamType
hostOrganizationType

Utilities.fillForm(object, formtype) ⇒ object

creates an object using ONLY the fields in the specified "form" object useful for preventing stray data from entering database

Kind: static method of Utilities

ParamTypeDescription
objectobjectsource object for data
formtypestringindexing name of the form to use to specify fields to include - uses schema specific Forms.Base.formtype.

Utilities.simpleObjectCompare(object1, object2) ⇒ boolean

Simple top-level object compare - assumes objects have similar structure - or AT LEAST all the fields of object1 are present in object2

Kind: static method of Utilities

ParamType
object1object
object2object

Utilities.formatItem(thisItem, thisFormat) ⇒ string

Allows string substitution from an object field names support Dot notation field names allow ":" extension for alternate formatting

Kind: static method of Utilities

ParamTypeDescription
thisItemobjectobject to create formated string from
thisFormatstringstring describing formatted output - fieldname wrapped in {} will be substituted. DOT notation allowed for fields.

Utilities.compare(thisItem, anotherItem, sort) ⇒ string

Kind: static method of Utilities

ParamTypeDescription
thisItemobjectone of two objects being compared
anotherItemobjectthe other of two objects being compared
sortstringstring describing sort - format "fieldName:sortType" - sort Type is "string, "date" or "number" (default)

Utilities.anyInAny(findFrom, findIn) ⇒ boolean

An array based compare function - is any entry of findFrom present in findIn

Kind: static method of Utilities

ParamType
findFromArray.any
findInArray.any

Utilities.PromisePoolRunner(entryArray, actionFunction, promiseOptions) ⇒ Promise

Kind: static method of Utilities

ParamType
entryArrayArray.object
actionFunctioncallback
promiseOptionsPromiseOptions

Utilities.lesserOf(args) ⇒ number

A convenience function for legibility

Kind: static method of Utilities
Returns: number - the least of any of the arguments b

ParamTypeDescription
argsanyunbounded list of arguments

Utilities.largerOf(args) ⇒ number

Kind: static method of Utilities
Returns: number - the largest of any of the arguments

ParamTypeDescription
argsanyunbounded list of arguments

Utilities.archiveRecord(record) ⇒ Promise

"Moves" a record from our standard tree structureto a parallel archival structure, by prepending a "_" to the collection names in the path This prevents the archived record from appearing in collectionGroup queries

Kind: static method of Utilities

ParamType
recordRecordDocument
record.refPathstring

Utilities.refPathToBaseRecord(refPath) ⇒ RecordDocument

uses a passed refPath to create the most basic document record form

Kind: static method of Utilities

ParamTypeDescription
refPathstring"/" separated document path reference

Utilities.bound(value, lowerBound, upperBound) ⇒ number

clips value to given bounds

Kind: static method of Utilities

ParamType
valuenumber
lowerBoundnumber
upperBoundnumber

Utilities.makeHexAsNeeded(color) ⇒ string

Kind: static method of Utilities
Returns: string - hex value of named color

ParamTypeDescription
colorstringname of color

Utilities~PromisePool

Kind: inner constant of Utilities

Utilities~promiseOptionsDefault : PromiseOptions

Kind: inner constant of Utilities
Default: {"concurrency":3,"rate":10}
Read only: true

Utilities~generateIterator(entryArray, actionFunction)

An Action Iterator Generator. Cycles through the entries in the passed array, yielding the result of a function for each entry. Only cares that inputs are an array, and a function that returns a promise

Kind: inner method of Utilities

ParamType
entryArrayArray.any
actionFunctioncallback

Utilities~PromiseOptions : object

Kind: inner typedef of Utilities
Properties

NameType
concurrencynumber
ratenumber

Boilerplate

Shared constants and symbols

Boilerplate.listingTypes : Array.string

Kind: static constant of Boilerplate

perks

Typedefs, constants, support functions and database operations related to event perks (defined in EventGroups, made available in Events)

perks.perkDefault : PerkType

Kind: static constant of perks
Read only: true

perks.perkForm : PerkType

Kind: static constant of perks
Read only: true

perks.GeneralAdmission : PerkType

Kind: static constant of perks
Read only: true

perks.createPerk(perk, eventGroup) ⇒ Promise.PerkType

Creates a new perk database record for the indicated EventGroup

Kind: static method of perks

ParamType
perkPerkType
eventGroupEventGroupType

perks.updatePerk(perk) ⇒ Promise.PerkType

Kind: static method of perks

ParamTypeDescription
perkPerkType
perk.refPathstringfrom the database

perks.updatePerks(perks, eventGroup)

Updates/adds a set of perks to the provided Tour. if batch is provided, adds these to the provided <WriteBatch|Transaction> and returns a chained <WriteBatch|Transaction>

Kind: static method of perks

ParamTypeDescription
perksArray.PerkTypeArray of perk objects to be written. If the Id of any entry is null or missing, a new perk document is created
eventGroupEventGroupTypetour to attach perks as sub-collection
tour.refPathstringstring representing full path to tour - only property used
TTransaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched

perks~PerkType : object

Kind: inner typedef of perks
Properties

NameType
Idstring
merchIDstring
namestring
descriptionstring

pledgeLevels

Typedefs, constants, support functions and database operations related to pledgeLevels These are associated with actual and/or proposed Events

pledgeLevels~updatePledgeLevels(pledgeLevels, tourStop) ⇒ Promise.<T>

Updates/adds a set of pledgeLevels to the provided TourStop. if batch is provided, adds these to the provided <WriteBatch|Transaction> and returns a chained <WriteBatch|Transaction>

Kind: inner method of pledgeLevels
Returns: Promise.<T> - chanied Batch or Void (if singleton)

ParamTypeDescription
pledgeLevelsArray.pledgeLevelFormATypeArray of pledgeLevel objects to be written. If the Id of any entry is null or missing, a new perk document is created
tourStopTourStopTypetour to attach perks as sub-collection
tourStop.refPathstringstring representing full path to tour - only property used
objectTransaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched

pledgeLevels~perkFormArray : perkFormType

Kind: inner typedef of pledgeLevels

pledgeLevels~pledgeLevelFormType : object

Kind: inner typedef of pledgeLevels
Properties

NameType
amountnumber
perksperkFormArray

pledgeLevels~pledgeLevelFormArray : pledgeLevelFormType

Kind: inner typedef of pledgeLevels

pledgeTickets

Typedefs, constants, support functions and database operations related to pledgeTickets These serve as both "pledges" - promises to support - as well as "tickets" to scheduled Events

pledgeTickets.updatePledgeTicket(pledgeTicket) ⇒ Promise(void)

updates an existing pledgeTicket

Kind: static method of pledgeTickets

ParamTypeDescription
pledgeTicketpledgeTicketTypeupdated pledgeTicket

pledgeTickets.deletePledgeTicket(pledgeTicket) ⇒ Promise(void)

deletes a pledgeTicket. Removed from summary in background

Kind: static method of pledgeTickets

ParamTypeDescription
pledgeTicketpledgeTicketTypeupdated pledgeTicket

pledgeTickets.serverCheckingIn(fullCheckin) ⇒ Promise.<T>

Server Cloud Functions are passed a single consolidated object that includes the pledgeTicket refPath

Kind: static method of pledgeTickets

ParamType
fullCheckinRecordObject

pledgeTickets.createCheckIn(pledgeTicket, checkIn)

Takes a pledgeTicket Record (or at least refPath) and a checkin object; stores the image in the checkin as a file and adds the URL to said file to the checkin in the pledgeTicket.

Kind: static method of pledgeTickets

ParamType
pledgeTicketRecordObject
pledgeTicket.refPathstring
pledgeTicket.checkinsobject
checkInRecordObject

pledgeTickets.summarizePledgeTickets(pledgeTickets) ⇒ fanSummary

summarizes a group of pledgeTickets assumes all are for the same tourStop/event

Kind: static method of pledgeTickets

ParamType
pledgeTicketsPledgeTicketArray

pledgeTickets.fillPledgeTicket(pledgeTicket) ⇒ pledgeTicketType

Fills in complete info into a pledgeTicket: tourStop. perks, etc

Kind: static method of pledgeTickets

ParamType
pledgeTicketpledgeTicketType

pledgeTickets.describePledgeTicket(pledgeTicket) ⇒ string

Creates a string describing a Tour Stop

Kind: static method of pledgeTickets

ParamType
pledgeTicketpledgeTicketType

pledgeTickets.markPledgeTicket(pledgeTicket, label)

Changes the paidQ label on a pledgeTicket

Kind: static method of pledgeTickets

ParamType
pledgeTicketpledgeTicketType
labelstring

pledgeTickets~fetchTourStopPledgeSummary(tourStop) ⇒ PledgeSummary

Kind: inner method of pledgeTickets
Returns: PledgeSummary - //count of tickets, sum of amounts

ParamType
tourStopTourStopType

Properties

NameTypeDescription
PledgeSummary.ticketsnumber
PledgeSummary.dollarsnumbersummary information is kept in the "logistics" record (not public)

pledgeTickets~fetchFansTourStopPledgeSummary(fan, tourStop) ⇒ fanSummary

Kind: inner method of pledgeTickets
Returns: fanSummary - fanSummary

ParamTypeDescription
fanPeopleFormTypefan record
tourStopTourStopFormTypetourStop record

pledgeTickets~fetchFansPledgeSummary(fan) ⇒ Array.fanSummary

Kind: inner method of pledgeTickets
Returns: Array.fanSummary - fanSummary(s)

ParamTypeDescription
fanPersonObjectfan record

pledgeTickets~fetchTourStopFromPledge(pledgeTicket, batch) ⇒ Promise.<DocumentObject>

returns the parent tourStop of a pledgeTicket

Kind: inner method of pledgeTickets

ParamTypeDescription
pledgeTicketpledgeTicketTypepledgeticket to trace tree from
batchTransactionoptional batch chain object

pledgeTickets~pledgeTicketType : checkinType

Kind: inner typedef of pledgeTickets
Properties

NameTypeDescription
amountnumber
ticketQBooleanflag to inidcate pledge includes ticket(s)
ticketsnumbernumber of tickets/pledges included in pledge
pledgeLevelpledgeLevelpledgeLevel object from TourStop
fanPeopleFormTypelink to fan account
fan.IdstringId of fan account
fan.namestringfan's name for display
paymentobjectlink to payment transaction
payment.linkstringunique payment transaction identifier (not secure, not fungible)
paidQBooleanflag to indicate payment made (not secure, not "source of truth")
checkinscheckinArrayarray of door checkin objects
timestamptimestampserver-side timestamp of original pledge

pledgeTickets~checkinType : object

Kind: inner typedef of pledgeTickets
Properties

NameTypeDescription
checkinsnumbercount of checking used in this transaction
signaturestringurl of signature image in Firestore
codestringcrytographic verification code for checkin
timestamptimestampserver-side timestamp of checkin transaction

pledgeTickets~fanSummary : perks

Kind: inner typedef of pledgeTickets
Properties

NameTypeDescription
ticketCodestringunique ID of the first pledgeTicket in summary
refPathdocRefDatabase reference of first pledgeTicket in summary
perksperksArrayarray of all perks in the summary
ticketsnumbersum count of all pledgeTickets in the summary
dollarsnumbersum of all money spent/committed

© 2020-2023 Tracy Hall / Dreams and Logic Inc / SaltSweetSpirits

0.1.0-beta.122

5 months ago

0.1.0-beta.121

5 months ago

0.1.0-beta.120

5 months ago

0.1.0-beta.119

5 months ago

0.1.0-beta.118

5 months ago

0.1.0-beta.117

5 months ago

0.1.0-beta.116

5 months ago

0.1.0-beta.115

5 months ago

0.1.0-beta.114

5 months ago

0.1.0-beta.113

5 months ago

0.1.0-beta.112

5 months ago

0.1.0-beta.111

5 months ago

0.1.0-beta.109

5 months ago

0.1.0-beta.107

6 months ago

0.1.0-beta.106

6 months ago

0.1.0-beta.105

6 months ago

0.1.0-beta.104

6 months ago

0.1.0-beta.103

6 months ago

0.1.0-beta.102

6 months ago

0.1.0-beta.101

6 months ago

0.1.0-beta.100

6 months ago

0.1.0-beta.99

6 months ago

0.1.0-beta.98

6 months ago

0.1.0-beta.97

6 months ago

0.1.0-beta.96

6 months ago

0.1.0-beta.95

6 months ago

0.1.0-beta.94

6 months ago

0.1.0-beta.93

6 months ago

0.1.0-beta.92

6 months ago

0.1.0-beta.91

6 months ago

0.1.0-beta.89

6 months ago

0.1.0-beta.88

6 months ago

0.1.0-beta.87

6 months ago

0.1.0-beta.86

6 months ago

0.1.0-beta.85

6 months ago

0.1.0-beta.84

6 months ago

0.1.0-beta.83

6 months ago

0.1.0-beta.81

6 months ago

0.1.0-beta.80

6 months ago

0.1.0-beta.79

6 months ago

0.1.0-beta.78

7 months ago

0.1.0-beta.77

7 months ago

0.1.0-beta.76

7 months ago

0.1.0-beta.75

7 months ago

0.1.0-beta.74

7 months ago

0.1.0-beta.73

7 months ago

0.1.0-beta.72

7 months ago

0.1.0-beta.71

7 months ago

0.1.0-beta.70

7 months ago

0.1.0-beta.69

7 months ago

0.1.0-beta.68

7 months ago

0.1.0-beta.67

7 months ago

0.1.0-beta.66

7 months ago

0.1.0-beta.65

7 months ago

0.1.0-beta.64

7 months ago

0.1.0-beta.63

7 months ago

0.1.0-beta.62

7 months ago

0.1.0-beta.61

7 months ago

0.1.0-beta.60

7 months ago

0.1.0-beta.56

7 months ago

0.1.0-beta.55

7 months ago

0.1.0-beta.54

8 months ago

0.1.0-beta.53

8 months ago

0.1.0-beta.52

8 months ago

0.1.0-beta.51

8 months ago

0.1.0-beta.50

8 months ago

0.1.0-beta.49

8 months ago

0.1.0-beta.48

8 months ago

0.1.0-beta.47

8 months ago

0.1.0-beta.46

8 months ago

0.1.0-beta.45

8 months ago

0.1.0-beta.44

8 months ago

0.1.0-beta.43

8 months ago

0.1.0-beta.42

8 months ago

0.1.0-beta.41

8 months ago

0.1.0-beta.40

8 months ago

0.1.0-beta.39

8 months ago

0.1.0-beta.38

8 months ago

0.1.0-beta.37

8 months ago

0.1.0-beta.36

8 months ago

0.1.0-beta.35

8 months ago

0.1.0-beta.34

8 months ago

0.1.0-beta.33

8 months ago

0.1.0-beta.32

8 months ago

0.1.0-beta.31

8 months ago

0.1.0-beta.30

8 months ago

0.1.0-beta.29

8 months ago

0.1.0-beta.28

8 months ago

0.1.0-beta.27

8 months ago

0.1.0-beta.26

8 months ago

0.1.0-beta.25

8 months ago

0.1.0-beta.24

8 months ago

0.1.0-beta.23

8 months ago

0.1.0-beta.22

8 months ago

0.1.0-beta.21

8 months ago

0.1.0-beta.20

8 months ago

0.1.0-beta.19

9 months ago

0.1.0-beta.18

9 months ago

0.1.0-beta.17

9 months ago

0.1.0-beta.16

9 months ago

0.1.0-beta.15

9 months ago

0.1.0-beta.14

9 months ago

0.1.0-beta.13

9 months ago

0.1.0-beta.12

9 months ago

0.1.0-beta.11

9 months ago

0.1.0-beta.10

9 months ago

0.1.0-beta.9

9 months ago

0.1.0-beta.8

9 months ago

0.1.0-beta.7

9 months ago

0.1.0-beta.6

9 months ago

0.1.0-beta.5

9 months ago

0.1.0-beta.4

9 months ago

0.1.0-beta.3

9 months ago

0.1.0-beta.2

9 months ago

0.1.0-beta.1

10 months ago

0.1.0-beta.0

10 months ago