@leaddreamer/esbusiness v0.1.0-beta.0
@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
- static
- .databasePromise(firebase, config, thisLogger) ⇒ Promise.Firebase
- inner
- ~FirebaseConfigObject : object
- static
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
Param | Type | Description |
---|---|---|
firebase | Firebase | |
config | FirebaseConfigObject | Firebase Admin object |
thisLogger | callback |
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
Name | Type | Description |
---|---|---|
apiKey | string | required api Key from Firebase Console, |
appId | string | required app ID from Firebase Console |
projectId | string | required Firebase projectID from Firebase console |
authDomain | string | (optional) auth domain from Firebase Console |
databaseURL | string | (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 |
mapsAPIKey | string | (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
- static
- .AddressDefault : AddressType
- .AddressForm : AddressType
- .maplink : MapLink
- .deleteAddress(address) ⇒ Promise.<void>
- .deleteAddressByIdAndParent(addressId, parent, batch) ⇒ Promise.ChainType
- .formatAddress(address) ⇒ string
- .saveAddress(address, paraentRefPath) ⇒ Promise.<AddressType>
- .extraDataPath(account) ⇒ string
- .fetchAddresses(account) ⇒ Promise.<Array.AddressType>
- inner
- ~AddressType : object
- ~MapLink : object
- ~ChainType : WriteBatch | Transaction | void
- static
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
Param | Type |
---|---|
address | AddressType |
address.refPath | string |
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
Param | Type |
---|---|
addressId | string |
parent | OrganizationType |
parent.refPath | string |
batch | ChainType |
Addresses.formatAddress(address) ⇒ string
Builds a formatted string from a provided address record
Kind: static method of Addresses
Param | Type |
---|---|
address | AddressType |
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
Param | Type | Description |
---|---|---|
address | AddressType | |
address.refPath | string | if present, writes back |
paraentRefPath | string | required 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
Param | Type |
---|---|
account | Record |
account.refPath | string |
Addresses.fetchAddresses(account) ⇒ Promise.<Array.AddressType>
Fetches all address records for an account
Kind: static method of Addresses
Param | Type |
---|---|
account | Record |
account.refPath | string |
Addresses~AddressType : object
Kind: inner typedef of Addresses
Properties
Name | Type | Description |
---|---|---|
Id | string | will be populated for existing record; null or missing for new/minimal object |
refPath | string | will be populated for existing record; null or missing for new/minimal object |
address_line_1 | string | |
address_line_2 | string | |
city | string | |
region | string | selected from a list of supported Cities/Regions |
state | string | |
zip | zip | |
mapLink | maplink | link to Google map location |
Addresses~MapLink : object
Kind: inner typedef of Addresses
Properties
Name | Type | Description |
---|---|---|
placeId | string | as defined by Google |
latlng | object | coordinates tuple |
latlng.lat | string | lattitude |
latlng.lng | string | longitude |
url | string | link to place/map entry |
formatted_address | string | printable string of address |
Addresses~ChainType : WriteBatch | Transaction | void
Kind: inner typedef of Addresses
BookingOffers
types, constants and support functions for BookingOffers
- BookingOffers
- static
- .SHARE_TYPES : enum
- .SHARE_BUTTON_LABELS : enum
- .BOOKING_STATUS : enum
- .BookingOfferDefault : BookingOffer
- .BookingOfferDefaultForm : BookingOffer
- .updateBookingOfferCounter(bookingOffer) ⇒ Promise.BookingOffer
- .updateBookingOfferOwner(bookingOffer) ⇒ Promise.BookingOffer
- .ownerOfferBooking(bookingOffer) ⇒ Promise.BookingOffer
- .ownerCancelBooking(bookingOffer) ⇒ Promise.BookingOffer
- .ownerRejectBooking(bookingOffer) ⇒ Promise.BookingOffer
- .ownerCounterBooking(bookingOffer) ⇒ Promise.BookingOffer
- .ownerConfirmBooking(bookingOffer) ⇒ Promise.BookingOffer
- .counterOfferBooking(bookingOffer) ⇒ Promise.BookingOffer
- .counterRejectBooking(bookingOffer) ⇒ Promise.BookingOffer
- .counterCounterBooking(bookingOffer) ⇒ Promise.BookingOffer
- .counterAcceptBooking(bookingOffer) ⇒ Promise.BookingOffer
- .counterConfirmBooking(bookingOffer) ⇒ Promise.BookingOffer
- .fetchBookingOffersByCounter(counter) ⇒ Promise.Array.BookingOffer
- .fetchBookingOffersByDateAndOwner(dateString, owner) ⇒ Promise.Array.BookingOffer
- .fetchBookingOffersByOwner(owner) ⇒ Promise.Array.BookingOffer
- .fetchBookingOfferConfirmed(event) ⇒ Promise.BookingOffer
- .fetchBookingOffers(event) ⇒ Promise.Array.BookingOffer
- .fetchBookingOffer(bookingOfferID) ⇒ Promise.BookingOffer
- .fetchAllBookingOffers() ⇒ Promise.Array.BookingOffer
- .buildOwnerBookingOffer(baseOffer, ownerStatus, event, counter, date) ⇒ BookingOffer
- .defaultBookingOffer(owner) ⇒ Promise.BookingOffer
- .saveDefaultBookingOffer(owner) ⇒ Promise.BookingOffer
- .crossConfirmed(bookingOffer) ⇒ boolean
- .simpleCanceled(bookingOffer) ⇒ boolean
- .counterShare(bookingOffer, currentAmount, fullAmount) ⇒ number
- .offerConditions(share_object) ⇒ string
- inner
- ~ShareOffer : object
- ~BookingOffer : object
- static
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
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.updateBookingOfferOwner(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.ownerOfferBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.ownerCancelBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.ownerRejectBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.ownerCounterBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.ownerConfirmBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.counterOfferBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.counterRejectBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.counterCounterBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.counterAcceptBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.counterConfirmBooking(bookingOffer) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOffer | BookingOffer |
BookingOffers.fetchBookingOffersByCounter(counter) ⇒ Promise.Array.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
counter | OrganizationType |
BookingOffers.fetchBookingOffersByDateAndOwner(dateString, owner) ⇒ Promise.Array.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
dateString | DateString |
owner | OrganizationType |
BookingOffers.fetchBookingOffersByOwner(owner) ⇒ Promise.Array.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
owner | OrganizationType |
BookingOffers.fetchBookingOfferConfirmed(event) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
event | EventType |
BookingOffers.fetchBookingOffers(event) ⇒ Promise.Array.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
event | EventType |
BookingOffers.fetchBookingOffer(bookingOfferID) ⇒ Promise.BookingOffer
Kind: static method of BookingOffers
Param | Type |
---|---|
bookingOfferID | string |
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
Param | Type | Description |
---|---|---|
baseOffer | BookingOffer | |
ownerStatus | enum | |
event | EventType | |
counter | Record | |
date | string | booking 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)
Param | Type | Description |
---|---|---|
owner | AccountType | owner 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)
Param | Type | Description |
---|---|---|
owner | AccountType | owner 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
Param | Type | Description |
---|---|---|
bookingOffer | bookingOffer | booking 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
Param | Type | Description |
---|---|---|
bookingOffer | bookingOffer | booking offer object/record to be checked |
BookingOffers.counterShare(bookingOffer, currentAmount, fullAmount) ⇒ number
Kind: static method of BookingOffers
Param | Type | Description |
---|---|---|
bookingOffer | BookingOffer | |
bookingOffer.ticket | object | |
bookingOffer.ticket.limit | number | decimal dollar limit value |
bookingOffer.ticket.share | number | integer percentage, 0 - 100 |
bookingOffer.ticket.type | string | type of |
currentAmount | number | decimal dollar amount to split |
fullAmount | number | decimal 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
Param | Type |
---|---|
share_object | ShareOffer |
BookingOffers~ShareOffer : object
Kind: inner typedef of BookingOffers
Properties
Name | Type | Description |
---|---|---|
type | SHARE_TYPES | type of sharing offer |
share | integer | 0 to 100 integer of share |
limit | number | dollar limit (depending on type) of this share |
BookingOffers~BookingOffer : object
Kind: inner typedef of BookingOffers
Properties
Name | Type | Description |
---|---|---|
owner | object | denormalized info of organizarion that proposes the deal this is a convenience copy - the "owner" is the top of the tree |
owner.Id | string | Id of the booking owner |
owner.capacity | number | |
owner.name | string | |
owner.region | string | redundant, but allows collectionGroup listeners |
owner.bookingStatus | BOOKING_STATUS | |
counter | object | denormalized info of organizarion that accepts the deal |
counter.Id | string | Id of the booking owner |
counter.capacity | number | |
counter.name | string | |
counter.region | string | redundant, but allows collectionGroup listeners |
counter.bookingStatus | BOOKING_STATUS | |
ticket | ShareOffer | |
house | ShareOffer | |
date | string | |
time | string | |
time.Start | string | |
time.Duration | string | |
published | object | |
Q | boolean | published flag |
string | details |
CityManager
types constants and support functions for CityManagers
- CityManager
- static
- .CityManagerDefault : CityManagerType
- .CityManagerDefaultForm : CityManagerType
- .CityManagerCreateForm : CityManagerType
- .CityManagerAccountForm : CityManagerType
- .createCityManager(cityManager, batch) ⇒ Promise.CityManagerType
- .searchCityManagers(prompt, limit) ⇒ Promise.Array.CityManagerType
- .fetchCityManagerData(cityManager) ⇒ PrivateData
- .summarizeCityManager(cityManager) ⇒ string
- .findCityManagerIDFromChild(child) ⇒ string
- .fetchCityManagerFromChild(child) ⇒ Promise.CityManagerType
- inner
- ~CityManagerType : object
- static
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
Param | Type | Description |
---|---|---|
cityManager | CityManagerType | cityManager to commit |
batch | WriteBatch | Transaction | batching 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
Param | Type | Description |
---|---|---|
prompt | string | Used to query for matching CityManagers |
limit | string | number | Used 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.
Param | Type | Description |
---|---|---|
cityManager | CityManagerType | a 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
Param | Type | Description |
---|---|---|
cityManager | CityManagerType | a CityManager record |
CityManager.findCityManagerIDFromChild(child) ⇒ string
finds the CityManager ID from any child document
Kind: static method of CityManager
Returns: string - the cityManager ID
Param | Type | Description |
---|---|---|
child | recordDocument | any 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
Param | Type | Description |
---|---|---|
child | recordDocument | any child record of the CityManager record |
CityManager~CityManagerType : object
Kind: inner typedef of CityManager
Properties
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
name | string | name of CityManager |
business_contact | business_contact | |
region | string | a string representing to CityManager home region SELECTED FROM list of regions |
color | string | HTML/CSS color string or name - general color of profile/display |
borderColor | string | HTML/CSS color string or name - general color of profile/display borders |
textColor | string | HTML/CSS color string or name - general color of profile/display text |
EventGroups
Typedefs, constants, support functions and database operations related to eventGroups
- EventGroups
- static
- .deleteEventGroup(eventGroup) ⇒ Promise.<void>
- .createEventGroup(eventGroup, organization, batch) ⇒ Promise.<EventGroupType>
- .saveEventGroup(eventGroup, organization, batch) ⇒ Promise.<EventGroupType>
- .createDefaultEventGroup(organization, batch) ⇒ Promise.<EventGroupType>
- .fetchDefaultEventGroup(organization) ⇒ Promise.<EventGroupType>
- .fetchAllEventGroups() ⇒ Promise.<Array.EventGroupType>
- .fetchEventGroup(eventGroupID) ⇒ Promise.<EventGroupType>
- .fetchEventGroupFromChild(child, batch) ⇒ Promise.<EventGroupType>
- .fetchEventGroups(organization) ⇒ Promise.<Array.OrganizationType>
- .fetchEventGroupByDateAndOrganization(dateString, organization) ⇒ Promise.<Array.OrganizationType>
- .findEventGroupIDFromChild(child) ⇒ string
- .findEventGroupRefFromChild(child) ⇒ string
- inner
- ~EventGroupDefault : EventGroupType
- ~EventGroupDefaultForm : EventGroupType
- ~EventGroupType : object
- ~ChainType : WriteBatch | Transaction | void
- static
EventGroups.deleteEventGroup(eventGroup) ⇒ Promise.<void>
Deletes an EventGroup record NOTE: Does NOT delete subrecords
Kind: static method of EventGroups
Param | Type |
---|---|
eventGroup | EventGroupType |
EventGroups.createEventGroup(eventGroup, organization, batch) ⇒ Promise.<EventGroupType>
Creates a new eventGroup underneath a given Organization
Kind: static method of EventGroups
Param | Type |
---|---|
eventGroup | EventGroupType |
organization | OrganizationType |
batch | ChainType |
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
Param | Type | Description |
---|---|---|
eventGroup | EventGroupType | |
organization | OrganizationType | optional accountt o save to (for new record) |
batch | ChainType |
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
Param | Type |
---|---|
organization | OrganizationType |
batch | ChainType |
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
Param | Type |
---|---|
organization | OrganizationType |
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
Param | Type |
---|---|
eventGroupID | string |
EventGroups.fetchEventGroupFromChild(child, batch) ⇒ Promise.<EventGroupType>
Uses the refPath of (any) child document to fetch the eventGroup record
Kind: static method of EventGroups
Param | Type | Description |
---|---|---|
child | Record | any child, on any branch |
batch | ChainType |
EventGroups.fetchEventGroups(organization) ⇒ Promise.<Array.OrganizationType>
Fetches all the eventGroup records for an organization
Kind: static method of EventGroups
Param | Type |
---|---|
organization | OrganizationType |
organization.refPath | string |
EventGroups.fetchEventGroupByDateAndOrganization(dateString, organization) ⇒ Promise.<Array.OrganizationType>
Fetches an Organization's eventGroups that bridge a particular day (inclusive)
Kind: static method of EventGroups
Param | Type | Description |
---|---|---|
dateString | string | firestore format |
organization | OrganizationType | |
organization.refPath | string |
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
Param | Type | Description |
---|---|---|
child | Record | any 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
Param | Type | Description |
---|---|---|
child | Record | any 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
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
title | string | short title for eventGroup |
image | string | string URL |
banner | string | string URL |
organization | OrganizationType | //For convenience - can be culled from hierarchy |
organization.name | string | //For convenience - can be culled from hierarchy |
description | string | description of eventGroup |
dateStart | dateString | optional start date for eventGroup |
dateEnd | dateString | optional end date of eventGroup |
perks | Array.perkType | optional 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
- static
- .EVENT_SORT_OPTIONS : Array.string
- .deleteEvent(event) ⇒ Promise.<void>
- .createEvent(eventRecord, eventGroupRecord, batch) ⇒ Promise.<EventType>
- .modifyEvent(event, batch) ⇒ Promise.<EventType>
- .updateEvent(event, eventGroup, batch) ⇒ Promise.<(WriteBatch|Transaction)>
- .updateEventByTree(eventRecord, tree, batch)
- .updateEventByChild(eventRecord, child, batch) ⇒ Promise.<RecordDocument>
- .fetchEventsByRegionFiltered(region, extraFilter) ⇒ Promise.<Array.EventType>
- .fetchEventsByRegion(region) ⇒ Promise.<Array.EventType>
- .fetchEventsByOwner(owner) ⇒ Promise.<Array.EventType>
- .fetchEventsByEventGroupID(eventGroupID) ⇒ Promise.<Array.EventType>
- .fetchEventsByRegionAndDate(region, dateString) ⇒ Promise.<Array.EventType>
- .fetchEventsByDateAndOwner(region, dateString) ⇒ Promise.<Array.EventType>
- .fetchEventById(eventID) ⇒ Promise.EventType
- .fetchEventByTree(tree) ⇒ Promise.EventType
- .fetchEventByParams(params) ⇒ Promise.EventType
- .fetchEventByRef(eventRefPath, batch) ⇒ Promise.EventType
- .fetchEventByBookingOffer(bookingOffer) ⇒ Promise.EventType
- .fetchEventFromChild(child) ⇒ Promise.EventType
- .fetchEvents(eventGroup) ⇒ Promise.Array.EventType
- .fetchAllEvents() ⇒ Promise.Array.EventType
- .findEventRefByParams(params) ⇒ string
- .findEventBasicByParams(params) ⇒ EventType
- .createSummary(event, batch) ⇒ Promise.recordDocument
- .saveSummary(summary, batch) ⇒ Promise.SummaryType
- .updateEventStatus(status, event) ⇒ Promise.SummaryType
- .modifySummary(summary, batch, batch) ⇒ Promise.SummaryType
- .updateEventSummary(summary, event, batch) ⇒ Promise.SummaryType
- .updateSummaryByParams(summary, params) ⇒ Promise.SummaryType
- .findSummaryIdFromChild(child) ⇒ string
- .findSummaryRefFromChild(child) ⇒ string
- .buildSummaryReferenceFromChild(child) ⇒ SummaryType
- .fetchSummaryByTree(tree) ⇒ SummaryType
- .findSummaryBasicByParams(params) ⇒ SummaryType
- .fetchSummaryByParams(params) ⇒ Promise.SummaryType
- .fetchSummary(event) ⇒ Promise.SummaryType
- .fetchSummaryFromChild(child) ⇒ Promise.SummaryType
- .fetchAllSummary() ⇒ Promise.Array.SummaryType
- .fetchSummariesByRegion(region) ⇒ Promise.Array.SummaryType
- .createLogistics(logistics, event, batch) ⇒ Promise.LogisticsType
- .createRawLogistics(event, batch) ⇒ Promise.LogisticsType
- .updateLogistics(logistics, batch) ⇒ Promise.LogisticsType
- .deleteLogistics(logistics) ⇒ Promise.<void>
- .fetchLogistics(event) ⇒ Promise.LogisticsType
- .fetchAllLogistics() ⇒ Promise.Array.LogisticsType
- .findEventsByDateAndOwner(events, date, owner) ⇒ Array.EventType
- .findEventsByDate(events, date) ⇒ Array.EventType
- .findBookingOffersByDate(bookingOffers, date) ⇒ Array.BookingOffer
- .eventDescription(event) ⇒ string
- .pullInventory(event, tickets) ⇒ Promise.EventType
- .pushInventory(event, tickets) ⇒ Promise.EventType
- inner
- ~EventDefault : EventType
- ~logisticsForm : LogisticsType
- ~summaryForm : SummaryType
- ~EventDefaultForm : EventType
- ~EventAccountForm : EventType
- ~EventType : object
- ~LogisticsType : object
- ~SummaryType : object
- ~EventParamObject : object
- static
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
Param | Type |
---|---|
event | EventType |
event.refPath | string |
Events.createEvent(eventRecord, eventGroupRecord, batch) ⇒ Promise.<EventType>
Creates the basic structure for an event, based on passed information
Kind: static method of Events
Param | Type | Description |
---|---|---|
eventRecord | EventType | |
eventGroupRecord | EventGroupType | |
batch | 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.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
Param | Type | Description |
---|---|---|
event | object | |
event.refPath | string | only "required" field |
batch | 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.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)
Param | Type | Description |
---|---|---|
event | EventType | Array of pledgeLevel objects to be written. If the Id of any entry is null or missing, a new perk document is created |
eventGroup | EventGroupType | eventGroup to attach perks as sub-collection |
eventGroup.refPath | string | string representing full path to eventGroup only property used |
batch | 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.updateEventByTree(eventRecord, tree, batch)
uses a "tree" object (likely derived from a sub-record) to update an event
Kind: static method of Events
Param | Type | Description |
---|---|---|
eventRecord | EventType | |
tree | RecordTree | |
batch | Promise.<(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
Param | Type | Description |
---|---|---|
eventRecord | EventFormType | |
child | RecordDocument | |
batch | 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.fetchEventsByRegionFiltered(region, extraFilter) ⇒ Promise.<Array.EventType>
Fetches events by Region with optional extra filter specifications
Kind: static method of Events
Param | Type | Description |
---|---|---|
region | string | string - Always filters query by region |
extraFilter | Array.filterObject | string - optional extra field reference to filter |
Events.fetchEventsByRegion(region) ⇒ Promise.<Array.EventType>
Fetches all events in a region
Kind: static method of Events
Param | Type |
---|---|
region | string |
Events.fetchEventsByOwner(owner) ⇒ Promise.<Array.EventType>
Fetches all events "owned" (proposed by) a particular AccountForm
Kind: static method of Events
Param | Type |
---|---|
owner | RecordDocument |
owner.Id | string |
Events.fetchEventsByEventGroupID(eventGroupID) ⇒ Promise.<Array.EventType>
Fetches all events that are part of a specified eventGroup (by ID)
Kind: static method of Events
Param | Type | Description |
---|---|---|
eventGroupID | string | Id 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
Param | Type | Description |
---|---|---|
region | string | |
dateString | string | firebase 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
Param | Type | Description |
---|---|---|
region | string | |
dateString | string | firebase firestore formatted date |
Events.fetchEventById(eventID) ⇒ Promise.EventType
Fetch a single event by it's Id
Kind: static method of Events
Param | Type | Description |
---|---|---|
eventID | string | Id 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
Param | Type |
---|---|
tree | RecordTree |
Events.fetchEventByParams(params) ⇒ Promise.EventType
Fetch an event using Cloud Function params
Kind: static method of Events
Param | Type |
---|---|
params | CloudParams |
Events.fetchEventByRef(eventRefPath, batch) ⇒ Promise.EventType
Fetch an event by it's refPath string
Kind: static method of Events
Param | Type |
---|---|
eventRefPath | string |
batch | WriteBatch | Transaction |
Events.fetchEventByBookingOffer(bookingOffer) ⇒ Promise.EventType
Fetch an event from a related bookingOffer
Kind: static method of Events
Param | Type |
---|---|
bookingOffer | BookingOffer |
Events.fetchEventFromChild(child) ⇒ Promise.EventType
Fetch an event by any child record
Kind: static method of Events
Param | Type |
---|---|
child | RecordDocument |
Events.fetchEvents(eventGroup) ⇒ Promise.Array.EventType
fetch an array of all events in an EventGroup
Kind: static method of Events
Param | Type |
---|---|
eventGroup | EventGroupType |
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
Param | Type |
---|---|
params | EventParamObject |
params.ownerId | string |
params.eventGroupID | string |
params.eventID | string |
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
Param | Type |
---|---|
params | EventParamObject |
params.ownerId | string |
params.eventGroupID | string |
params.eventID | string |
Events.createSummary(event, batch) ⇒ Promise.recordDocument
Creates the raw Summary record for an event from an Event record
Kind: static method of Events
Param | Type |
---|---|
event | EventType |
batch | WriteBatch | Transaction |
Events.saveSummary(summary, batch) ⇒ Promise.SummaryType
Writes a (changed?) Summary record back to the database
Kind: static method of Events
Param | Type |
---|---|
summary | SummaryType |
batch | WriteBatch | 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
Param | Type |
---|---|
status | string |
event | EventType |
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
Param | Type | Description |
---|---|---|
summary | SummaryType | |
summary.refPath | string | only "required" field |
batch | WriteBatch | Transaction | |
batch | object | Transaction 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
Param | Type |
---|---|
summary | SummaryType |
event | EventType |
batch | WriteBatch | 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
Param | Type |
---|---|
summary | SummaryType |
params | ParamsType |
Events.findSummaryIdFromChild(child) ⇒ string
identifies the Summary Id from any child of an event
Kind: static method of Events
Param | Type |
---|---|
child | RecordDocument |
Events.findSummaryRefFromChild(child) ⇒ string
identifies the Summary refPath from any child of an event
Kind: static method of Events
Param | Type |
---|---|
child | RecordDocument |
Events.buildSummaryReferenceFromChild(child) ⇒ SummaryType
creats a minimal SummaryType object from an event's child objects
Kind: static method of Events
Param | Type |
---|---|
child | RecordDocument |
Events.fetchSummaryByTree(tree) ⇒ SummaryType
Fetches an event summary using a passed RecordTree Map()
Kind: static method of Events
Param | Type | Description |
---|---|---|
tree | RecordTree | a 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
Param | Type |
---|---|
params | EventParamObject |
Events.fetchSummaryByParams(params) ⇒ Promise.SummaryType
fetches a SummaryRecord from the database based on function call params
Kind: static method of Events
Param | Type |
---|---|
params | CloudParamsObject |
Events.fetchSummary(event) ⇒ Promise.SummaryType
Fetches a summary record for a specified event
Kind: static method of Events
Param | Type |
---|---|
event | EventType |
Events.fetchSummaryFromChild(child) ⇒ Promise.SummaryType
Fetches a summary record from database based on ANY child of the event
Kind: static method of Events
Param | Type | Description |
---|---|---|
child | RecordDocument | record 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
Param | Type |
---|---|
region | string |
Events.createLogistics(logistics, event, batch) ⇒ Promise.LogisticsType
Adds a logistics record to a specified event
Kind: static method of Events
Param | Type |
---|---|
logistics | LogisticsType |
event | EventType |
batch | WriteBatch | Transaction |
Events.createRawLogistics(event, batch) ⇒ Promise.LogisticsType
Creates a default logistics record for an event
Kind: static method of Events
Param | Type |
---|---|
event | EventType |
batch | WriteBatch | Transaction |
Events.updateLogistics(logistics, batch) ⇒ Promise.LogisticsType
Writes a (changed?) logistics record back to the database
Kind: static method of Events
Param | Type |
---|---|
logistics | LogisticsType |
logistics.refPath | string |
batch | WriteBatch | Transaction |
Events.deleteLogistics(logistics) ⇒ Promise.<void>
Writes a (changed?) logistics record back to the database
Kind: static method of Events
Param | Type |
---|---|
logistics | LogisticsType |
logistics.refPath | string |
Events.fetchLogistics(event) ⇒ Promise.LogisticsType
Fetches the logistics record for an event
Kind: static method of Events
Param | Type |
---|---|
event | EventType |
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
Param | Type |
---|---|
events | Array.EventType |
date | dateString |
owner | OrganizationType |
owner.Id | string |
Events.findEventsByDate(events, date) ⇒ Array.EventType
Filters an array of EventType events by date
Kind: static method of Events
Param | Type |
---|---|
events | Array.EventType |
date | dateString |
Events.findBookingOffersByDate(bookingOffers, date) ⇒ Array.BookingOffer
Filters an array of BookingOffers by date
Kind: static method of Events
Param | Type |
---|---|
bookingOffers | Array.BookingOffer |
date | dateString |
Events.eventDescription(event) ⇒ string
Creates a standardized Descriptor String for events
Kind: static method of Events
Returns: string - standardized description
Param | Type |
---|---|
event | EventType |
Events.pullInventory(event, tickets) ⇒ Promise.EventType
Kind: static method of Events
Param | Type |
---|---|
event | EventType |
event.Id | string |
event.refPath | string |
tickets | number |
Events.pushInventory(event, tickets) ⇒ Promise.EventType
Returns inventory to an event.
Kind: static method of Events
Param | Type |
---|---|
event | EventType |
event.Id | string |
event.refPath | string |
tickets | number |
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
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
eventGroup | EventGroupType | local copy of parent eventGroup information |
eventGroup.title | string | |
title | string | short title for eventGroup |
image | string | string URL |
banner | string | string URL |
owner | OrganizationType | For convenience - can be culled from hierarchy |
owner.name | string | For convenience - can be culled from hierarchy |
counter | OrganizationType | counter-party to event |
counter.name | string | counter-party to event |
description | string | description of eventGroup |
booked | dateString | null when open; dateString when booked |
dateStart | dateString | optional start date for eventGroup |
dateEnd | dateString | optional end date of eventGroup |
timeStart | dateString | optional start date for eventGroup |
timeEnd | dateString | optional end date of eventGroup |
perks | Array.perkType | optional 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
Name | Type |
---|---|
Id | string |
refPath | string |
soundcheck | timeString |
loadIn | timeString |
loadOut | timeString |
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
Name | Type | Description |
---|---|---|
refPath | string | |
Id | string | |
payout | number | current payout amount total |
region | string | copied from event - used for searches by counters |
tickets | number | number of pledges/tickets, summarized/shared from pledgeTickets |
dollars | number | number of sales of pledge/tickets |
Events~EventParamObject : object
An argument object for passing event references to server functions
Kind: inner typedef of Events
Properties
Name | Type | Description |
---|---|---|
ownerID | string | argument |
eventGroupID | string | argument |
eventId | string | argument |
Favorites
Typedefs, constants, support functions and database operations related to Favorites
- Favorites
- static
- .fetchFavorites(fan) ⇒ FavoriteList
- inner
- ~alertRecord : object
- ~FavoriteDefinition : Record
- ~FavoriteList : FavoriteDefinition
- static
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
Param | Type | Description |
---|---|---|
fan | object | a fan object to reference from |
fan.refPath | string | database pointer to fan record |
Favorites~alertRecord : object
Kind: inner typedef of Favorites
Properties
Name | Type | Description |
---|---|---|
Id | string | Id of record, uuid |
refpath | string | path to alert, includes /TYPE/Id/ ** /alerts/Id |
description | string | description of change? |
timestamp | timestamp | database timestamp of posting change |
Favorites~FavoriteDefinition : Record
Kind: inner typedef of Favorites
Properties
Name | Type | Description |
---|---|---|
Id | string | Id of favorited organization |
refPath | string | refpath to favorite'd business includes /TYPE/Id |
name | string | name of favorite |
image | string | convenient for (quick) display |
Id | string | Id of favorited organization |
reference | FavoriteReference | contains the basic data from favorite account |
lastAlert | alertRecord | copy 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
- static
- .fetchFundamentals() ⇒ Promise.<Fundamentals>
- .fetchRates() ⇒ Promise.<Rates>
- .fetchPayoutRates() ⇒ Promise.<PaymentProcessor>
- .fetchMCCs() ⇒ Promise.<Array.MCCType>
- inner
- ~Rates : Rates
- ~paymentProcessor : PaymentProcessor
- ~MCCDefault : MCCType
- ~Rates : object
- ~PaymentProcessor : object
- ~MCCType : object
- ~Fundamentals : object
- static
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
Name | Type | Description |
---|---|---|
Id | string | |
service_charge | object | |
service_charge.minimum | number | |
service_charge.rate | number | percentage |
service_charge.rounding_factor | number |
Fundamentals~PaymentProcessor : object
Kind: inner typedef of Fundamentals
Properties
Name | Type | Description |
---|---|---|
connected_active | number | allowed active connections |
processing_concurrency | number | |
processing_rate | number | |
processing_time_window | number | |
per_payout | number | |
rate_payout | number | |
rate_payout_scale | number |
Fundamentals~MCCType : object
Kind: inner typedef of Fundamentals
Properties
Name | Type | Description |
---|---|---|
Id | string | |
MCC | string | Merchant Class Code |
name | string | Merchant Class Code |
description | string | description of Merchant Class Code |
long | string | long description of Merchant Class Code |
type | string | Applicable business model - "Artists", "Venues" or "Brands" |
Fundamentals~Fundamentals : object
Kind: inner typedef of Fundamentals
Properties
Name | Type |
---|---|
Rates | Rates |
PaymentProcessor | PaymentProcessor |
Defaults | object |
Defaults.MCC | MCCType |
Gallery
Support for image "Galleries" for accounts (combined Firestore and Storage)
- Gallery
- static
- .galleryList(host, listOptions) ⇒ Promise.<GalleryList>
- .paginateGallery(host, limit) ⇒ Promise.<PaginateList>
- .addURLToGallery(host, urlArray) ⇒ Promise.<null>
- .removeURLFromGallery(host, urlArray) ⇒ Promise.<null>
- inner
- ~GalleryList : object
- ~PaginateList : object
- static
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
Param | Type |
---|---|
host | Record |
listOptions | ListOptions |
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
Param | Type | Description |
---|---|---|
host | Record | |
limit | number | number 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
Param | Type |
---|---|
host | Record |
urlArray | Array.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
Param | Type |
---|---|
host | Record |
urlArray | Array.string |
Gallery~GalleryList : object
Kind: inner typedef of Gallery
Properties
Name | Type | Description |
---|---|---|
maxResults | number | If set, limits the total number of prefixes and items to return. The default and maximum maxResults is 1000. |
items | Array.StorageReference | |
nextPageToken | string |
Gallery~PaginateList : object
Kind: inner typedef of Gallery
Properties
Name | Type |
---|---|
storageReference | StorageReference |
status | number |
limit | number |
listOptions | ListOptions |
Genres
Typedefs, constants, support functions and database operations related to Musical Genres
- Genres
- static
- .GenresForm : GenreRecord
- .createGenre(genreForm) ⇒ Promise.<GenreRecord>
- inner
- ~GenreRecord : object
- static
Genres.GenresForm : GenreRecord
Kind: static constant of Genres
Genres.createGenre(genreForm) ⇒ Promise.<GenreRecord>
writes a genre record tothe database
Kind: static method of Genres
Param | Type |
---|---|
genreForm | GenreRecord |
Genres~GenreRecord : object
Kind: inner constant of Genres
Properties
Name | Type |
---|---|
Id | string |
name | string |
sub_genre_of | string | null |
Messages
Typedefs, constants, support functions and database operations related to Messaging
- Messages
- .logMessageEvent(messageEvent) ⇒ Promise.<RecordDocument>
- .messageStatus(record) ⇒ Promise.<string>
- .messageEvents(record) ⇒ Promise.<Array.<MessageEvent>>
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.
Param | Type | Description |
---|---|---|
messageEvent | MessageEvent | the 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
Param | Type | Description |
---|---|---|
record | documentRecord | object 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
Param | Type | Description |
---|---|---|
record | documentRecord | object 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
- static
- .organizationMember : OrganizationMember
- .organizationMatch : OrganizationMatch
- .organizationMemberForm : OrganizationMatch
- .createNewOrganization(organization, manager, batch) ⇒ WriteBatch | Transaction | null
- .saveOrganization(organization, batch) ⇒ WriteBatch | Transaction | null
- .deleteOrganization(organization) ⇒ Promise.<void>
- .fetchOrganization(organizationID) ⇒ Promise.recordDocument
- .fetchAllOrganizations() ⇒ Promise.Array.OrganizationType
- .searchOrganizations(prompt, limit) ⇒ Promise.Array.OrganizationType
- .cycleListType(profile) ⇒ Promise.OrganizationType
- .addTolineup(neworganizationMember, organization) ⇒ Promise.OrganizationType
- .removeFromLineup(neworganizationMember, organization) ⇒ Promise.OrganizationType
- .fetchOrganizationsAccess(organization) ⇒ Promise.<Array.OrganizationMatch>
- .saveOrganizationAccess(accessArray) ⇒ Promise.<null>
- .findOrganizationIDFromChild(child) ⇒ string
- .findOrganizationRefFromChild(child) ⇒ string
- .fetchOrganizationFromChild(child) ⇒ Promise.recordDocument
- inner
- ~OrganizationDefault : OrganizationType
- ~OrganizationDefaultForm : OrganizationType
- ~OrganizationType : object
- ~OrganizationMember : object
- ~OrganizationMatch : object
- static
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
Param | Type | Description |
---|---|---|
organization | OrganizationType | basic organization information for new account |
organization.name | string | name of the organization/act |
organization.region | string | home town/region of Organization |
manager | Access | |
manager.Id | string | when 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.email | string | - |
batch | WriteBatch | Transaction | batching 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
Param | Type | Description |
---|---|---|
organization | OrganizationType | |
batch | WriteBatch | Transaction | batching 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
Param | Type |
---|---|
organization | OrganizationType |
organization.refPath | string |
Organizations.fetchOrganization(organizationID) ⇒ Promise.recordDocument
retreives an organization record from the database based on it's unique Id
Kind: static method of Organizations
Param | Type |
---|---|
organizationID | string |
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
Param | Type | Description |
---|---|---|
prompt | string | Used to query for matching Organizations |
limit | string | number | Used to limit the number of results |
Organizations.cycleListType(profile) ⇒ Promise.OrganizationType
Changes the "listing style" saved for an organization
Kind: static method of Organizations
Param | Type |
---|---|
profile | OrganizationType |
Organizations.addTolineup(neworganizationMember, organization) ⇒ Promise.OrganizationType
Inserts a new org member into an organization's lineup
Kind: static method of Organizations
Param | Type |
---|---|
neworganizationMember | OrganizationMember |
neworganizationMember.Id | string |
organization | OrganizationType |
organization.Id | string |
organization.name | string |
organization.email | string |
Organizations.removeFromLineup(neworganizationMember, organization) ⇒ Promise.OrganizationType
Removes a lineup entry from an organization
Kind: static method of Organizations
Param | Type |
---|---|
neworganizationMember | organizationMember |
neworganizationMember.Id | string |
organization | OrganizationType |
organization.Id | string |
organization.name | string |
organization.email | string |
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
Param | Type | Description |
---|---|---|
organization | OrganizationType | (actually just organization.Id) |
organization.Id | string |
Organizations.saveOrganizationAccess(accessArray) ⇒ Promise.<null>
Save an array of access records back to the relevant organizations
Kind: static method of Organizations
Param | Type |
---|---|
accessArray | Array.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)
Param | Type | Description |
---|---|---|
child | DocumentObject | document (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
Param | Type |
---|---|
child | recordDocument |
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)
Param | Type | Description |
---|---|---|
child | recordDocument | document (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
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
name | string | name of Organization/Act |
type | string | type of account Artist, Venue, Brand, Other |
image | string | string URL |
banner | string | string URL |
bio | string | biography of Organization/Act |
description | string | description of Organization/Act |
listType | string | |
genres | GenreFormType | array of Genre objects describing Organization/Act |
skills | SkillFormType | array of skill (instrument) objects describing Organization/Act |
lineup | OrganizationType | array of Organization profile summaries of members/subbrands/etc |
website | string | string URL to main Organization/Act website |
social_links | string | array of string URL to additional Organization/Act web properies |
PublicInfo | BusinessDefault | a reduced-copy of business info (address, etc) to be made public Ground truth always in Business record |
region | string | a string representing to Organization/Act home region SELECTED FROM list of regions |
color | string | HTML/CSS color string or name - general color of profile/display |
borderColor | string | HTML/CSS color string or name - general color of profile/display borders |
textColor | string | HTML/CSS color string or name - general color of profile/display text |
Organizations~OrganizationMember : object
Kind: inner typedef of Organizations
Properties
Name | Type |
---|---|
name | string |
image | URL |
skills | Array.string |
Organizations~OrganizationMatch : object
Kind: inner typedef of Organizations
Properties
Name | Type | Description |
---|---|---|
Id | string | |
name | string | |
image | string | URL to image |
role | string |
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
- static
- .ERROR_TYPES : Object
- .PaymentDefault : PaymentData
- .paymentDescriptor : PaymentDescriptorType
- .receiptDefault : ReceiptType
- .createPaymentRecord(account, batch) ⇒ Promise.<(WriteBatch|Transaction|void)>
- .savePaymentData(account, paymentData)
- .fetchPayment(account, paymentData)
- .fetchPaymentByOwnerType(accountId, type, paymentData)
- .addPaymentDescriptor(account, descriptor, batch) ⇒ Promise.PaymentDescriptorType
- .savePaymentDescriptor(descriptor) ⇒ Promise.PaymentDescriptorType
- .removePaymentDescriptor(account, descriptor) ⇒ Promise.<void>
- .fetchPaymentDescriptors(account) ⇒ Promise.Array.PaymentDescriptor
- .listPDSummaries(account) ⇒ Promise.Array.PDSummary
- .fetchLatestPDSummary(account) ⇒ Promise.PaymentDescriptorType
- .fetchPDByFingerprint(account, fingerprint) ⇒ Promise.<PDSummary>
- .fetchPDByOwnerType(accountId, type, fingerprint) ⇒ Promise.<PDSummary>
- .replaceDefaultPDSummary(account, PDSummary) ⇒ Promise.AccountObject
- .saveReceiptRecord(account, receipt, batch) ⇒ Promise.ReceiptType
- .updateReceipt(receipt) ⇒ Promise.ReceiptType
- .saveReceiptRecordByOwnerType(ownerId, type, receipt, batch) ⇒ Promise.ReceiptType
- .anyReceiptsByMonthStamp(account, monthStamp) ⇒ Promise.Array.ReceiptType
- .saveReceiptRecordByChild(child, receipt, batch) ⇒ Promise.ReceiptType
- .fetchReceiptsFiltered(account, filterArray, sortArray, limit) ⇒ Promise.Array.ReceiptType
- .fetchProblemReceipts(account) ⇒ Promise.Array.ReceiptType
- .fetchPledgeTicketReceipt(pledgeTicket) ⇒ Promise.ReceiptType
- .markReceiptFromPledgeTicket(pledgeTicket, label) ⇒ Promise.ReceiptType
- .markReceipt(receipt, label) ⇒ Promise.ReceiptType
- .platformFee(price, rates) ⇒ number
- inner
- ~fetchReceipt(account, receiptId) ⇒ Promise.ReceiptType
- ~PaymentData : object
- ~PaymentDescriptorType : object
- ~PDSummary : object
- ~ReceiptType : object
- ~AccountObject : OrganizationType | PersonObject
- static
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
Param | Type | Description |
---|---|---|
account | AccountObject | |
batch | WriteBatch | Transaction | batching 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
Param | Type |
---|---|
account | AccountType |
account.refPath | string |
paymentData | Promise.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
Param | Type |
---|---|
account | AccountType |
paymentData | Promise.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
Param | Type |
---|---|
accountId | string |
type | string |
paymentData | Promise.PaymentData |
Payment.addPaymentDescriptor(account, descriptor, batch) ⇒ Promise.PaymentDescriptorType
Adds a specific paymentDescriptor to an account payment data
Kind: static method of Payment
Param | Type | Description |
---|---|---|
account | AccountType | |
account.Id | string | |
account.refPath | string | |
descriptor | PaymentDescriptorType | |
descriptor.paymentMethod | string | |
descriptor.fingerprint | string | |
descriptor.label | string | |
batch | WriteBatch | Transaction | batching 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
Param | Type |
---|---|
descriptor | PaymentDescriptorType |
descriptor.Id | string |
descriptor.refPath | string |
Payment.removePaymentDescriptor(account, descriptor) ⇒ Promise.<void>
Removes a paymentDescriptor from an account's paymentData
Kind: static method of Payment
Param | Type |
---|---|
account | AccountType |
descriptor | PaymentDescriptorType |
Payment.fetchPaymentDescriptors(account) ⇒ Promise.Array.PaymentDescriptor
fetch all customer card records IN OUR DATABASE (not payment database)
Kind: static method of Payment
Param | Type |
---|---|
account | AccountType |
account.refPath | string |
Payment.listPDSummaries(account) ⇒ Promise.Array.PDSummary
fetch the front-end list of paymentDescriptors
Kind: static method of Payment
Param | Type |
---|---|
account | AccountType |
account.Id | string |
account.refPath | string |
Payment.fetchLatestPDSummary(account) ⇒ Promise.PaymentDescriptorType
Kind: static method of Payment
Param | Type |
---|---|
account | AccountType |
account.Id | string |
account.refPath | string |
Payment.fetchPDByFingerprint(account, fingerprint) ⇒ Promise.<PDSummary>
retreives a PD, given the account Id and Type
Kind: static method of Payment
Param | Type |
---|---|
account | AccountType |
fingerprint | string |
Payment.fetchPDByOwnerType(accountId, type, fingerprint) ⇒ Promise.<PDSummary>
retreives a PD, given the account Id and Type
Kind: static method of Payment
Param | Type |
---|---|
accountId | string |
type | string |
fingerprint | string |
Payment.replaceDefaultPDSummary(account, PDSummary) ⇒ Promise.AccountObject
Copies a PDSummary tobe the new default (convenience function)
Kind: static method of Payment
Param | Type |
---|---|
account | AccountType |
PDSummary | PDSummary |
Payment.saveReceiptRecord(account, receipt, batch) ⇒ Promise.ReceiptType
Savess a Receipt to an account
Kind: static method of Payment
Param | Type | Description |
---|---|---|
account | AccountType | |
receipt | ReceiptType | |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
Payment.updateReceipt(receipt) ⇒ Promise.ReceiptType
Updates a (changed?) Receipt record
Kind: static method of Payment
Param | Type |
---|---|
receipt | ReceiptType |
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
Param | Type | Description |
---|---|---|
ownerId | string | |
type | string | either ORGANIZATIONS or PEOPLE |
receipt | ReceiptType | |
batch | WriteBatch | Transaction | batching 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
Param | Type |
---|---|
account | AccountObject |
monthStamp | dateString |
Payment.saveReceiptRecordByChild(child, receipt, batch) ⇒ Promise.ReceiptType
Saves a receipt by a child record reference
Kind: static method of Payment
Param | Type | Description |
---|---|---|
child | RecordDocument | |
receipt | ReceiptType | |
batch | WriteBatch | Transaction | batching 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
Param | Type |
---|---|
account | AccountObject |
account.refPath | string |
filterArray | Array.filterObject |
sortArray | Array.sortObject |
limit | number |
Payment.fetchProblemReceipts(account) ⇒ Promise.Array.ReceiptType
Kind: static method of Payment
Param | Type |
---|---|
account | AccountObject |
account.refPath | string |
Payment.fetchPledgeTicketReceipt(pledgeTicket) ⇒ Promise.ReceiptType
Fetches the receipt for a pledgeTicket
Kind: static method of Payment
Param | Type |
---|---|
pledgeTicket | PledgeTicket |
Payment.markReceiptFromPledgeTicket(pledgeTicket, label) ⇒ Promise.ReceiptType
Changes the paidQ label on a receipt associated with a pledgeTicket
Kind: static method of Payment
Param | Type |
---|---|
pledgeTicket | pledgeTicketType |
label | string |
Payment.markReceipt(receipt, label) ⇒ Promise.ReceiptType
Changes the paidQ label on a receipt associated with a pledgeTicket
Kind: static method of Payment
Param | Type |
---|---|
receipt | receiptType |
label | string |
Payment.platformFee(price, rates) ⇒ number
Calculates and returns the platform fee for a sale amount
Kind: static method of Payment
Param | Type |
---|---|
price | number |
rates | Rates |
Payment~fetchReceipt(account, receiptId) ⇒ Promise.ReceiptType
Kind: inner method of Payment
Param | Type |
---|---|
account | AccountObject |
account.refPath | string |
receiptId | string |
Payment~PaymentData : object
Kind: inner typedef of Payment
Properties
Name | Type |
---|---|
Id | string |
payment_gateway | string |
status | string |
tax_ID | string |
Payment~PaymentDescriptorType : object
Kind: inner typedef of Payment
Properties
Name | Type | Description |
---|---|---|
Id | string | document Id of this Card Descriptor (same as fingerprint) |
paymentMethod | string | Id of payment system card item |
fingerprint | string | Unique hash of card info - for checking uniqueness |
label | string | Brand & last4, or other descriptive |
expiry | string | expiry date of payment method (if any) |
timestamp | timestamp | last create or modify server time |
Payment~PDSummary : object
Kind: inner typedef of Payment
Properties
Name | Type | Description |
---|---|---|
Id | string | document Id of this Card Descriptor |
label | string | Brand & last4, or other descriptive |
Payment~ReceiptType : object
Kind: inner typedef of Payment
Properties
Name | Type | Description |
---|---|---|
Id | string | same Id as the associated pledgeTicket |
amount | number | |
payment | object | |
link | string | Id of associated payment_intent |
paidQ | string | string describing status |
description | string | supplemental information |
Payment~AccountObject : OrganizationType | PersonObject
Kind: inner typedef of Payment
People
Typedefs, constants, support functions and database operations related to individual users
- People
- static
- .PeopleAccountForm : PersonObject
- .createPerson ⇒ Promise.PersonObject
- .deletePerson(person) ⇒ Promise.<void>
- .deletePersonById(person) ⇒ Promise.<void>
- .buildPersonRecords(user) ⇒ Promise.<void>
- .updatePersonByID(person) ⇒ promise.PeopleObject
- .updatePerson(person) ⇒ promise.PeopleObject
- .knownPerson(Id) ⇒ Promise.boolean
- .updateUserAccess(accessItem, organization) ⇒ Promise.Access
- .removeUserAccess(accessItem, entity) ⇒ Promise.<void>
- .fetchPeople() ⇒ Array.PeopleObject
- .fetchPeoplePaginated(limit) ⇒ PaginatedFetch
- .fetchAnonymousPaginated(limit) ⇒ PaginatedFetch
- .fetchPerson(personId) ⇒ Promise.PeopleObject
- .fetchPersonName(personId) ⇒ Promise.string
- .fetchPersonEmail(personId) ⇒ Promise.string
- .fetchPersonPaymentById(personId) ⇒ Promise.PaymentData
- .fetchUserByEmail(email) ⇒ Promise.PeopleObject
- .fetchFullPerson(personIdentifier) ⇒ Promise.PeopleObject
- .summarizePerson(person) ⇒ string
- .fetchPersonFromChild(child) ⇒ Promise.PeopleObject
- .personFromId(personId) ⇒ PeopleObject
- inner
- ~PeopleDefault : PersonObject
- ~PeopleDefaultForm : PersonObject
- ~PersonObject : object
- ~PaginatedFetch : object
- static
People.PeopleAccountForm : PersonObject
Kind: static constant of People
Read only: true
People.createPerson ⇒ Promise.PersonObject
Kind: static constant of People
Param | Type | Description |
---|---|---|
person | PersonObject | minimal record of user account |
People.deletePerson(person) ⇒ Promise.<void>
Kind: static method of People
Param | Type |
---|---|
person | PersonObject |
People.deletePersonById(person) ⇒ Promise.<void>
Kind: static method of People
Param | Type | Description |
---|---|---|
person | PersonObject | minimal record of user account |
person.Id | string | record Id of account |
People.buildPersonRecords(user) ⇒ Promise.<void>
Builds a Person record from the authentication "user" data
Kind: static method of People
Param | Type |
---|---|
user | User |
user.isAnonymous | boolean |
user.displayName | string |
user.photoURL | string |
user.email | string |
user.phoneNumber | string |
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
Param | Type | Description |
---|---|---|
person | PeopleObject | a 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
Param | Type | Description |
---|---|---|
person | PeopleObject | a 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
Param | Type | Description |
---|---|---|
Id | string | Id 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
Param | Type |
---|---|
accessItem | AccessType |
organization | OrganizationType |
organization.Id | string |
organization.type | string |
People.removeUserAccess(accessItem, entity) ⇒ Promise.<void>
delete a userAccess document for an indicated user (in the accessItem)
Kind: static method of People
Param | Type |
---|---|
accessItem | Access |
entity | PersonObject |
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
Param | Type |
---|---|
limit | number |
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
Param | Type |
---|---|
limit | number |
People.fetchPerson(personId) ⇒ Promise.PeopleObject
Fetches a single PeopleObject record by Id
Kind: static method of People
Param | Type |
---|---|
personId | string |
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
Param | Type |
---|---|
personId | string |
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
Param | Type |
---|---|
personId | string |
People.fetchPersonPaymentById(personId) ⇒ Promise.PaymentData
Fetches the PaymentRecord for a person using just the ID
Kind: static method of People
Param | Type |
---|---|
personId | string |
People.fetchUserByEmail(email) ⇒ Promise.PeopleObject
Fetch a People record by their email
Kind: static method of People
Param | Type |
---|---|
string |
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
Param | Type |
---|---|
personIdentifier | string | PersonObject |
personIdentifier.Id | string |
People.summarizePerson(person) ⇒ string
Returns a standardized formatted name string
Kind: static method of People
Returns: string - formatted name string
Param | Type |
---|---|
person | PeopleObject |
People.fetchPersonFromChild(child) ⇒ Promise.PeopleObject
Fetches a PersonObject from any child record in any branch
Kind: static method of People
Param | Type |
---|---|
child | RecordDocument |
People.personFromId(personId) ⇒ PeopleObject
builds a minimal PeopleObject from an Id
Kind: static method of People
Param | Type |
---|---|
personId | string |
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
Name | Type | Description |
---|---|---|
Id | string | Id of document from storage |
refPath | string | if from database, full path to document |
first_name | string | could be "Anonymous" |
last_name | string | |
isAnonymous | boolean | flag indicating auto-generated Anonymous user account |
image | url | URL (possibly in app storage) of User image |
region | string | User home region, from fixed list |
social_links | url | array of user social account links |
bio | string | user-maintained biography |
website | url | URL to user personal website |
payment_method | string | summary string of user payment method. Not secure, not source-of-truth |
privateData | PrivateData | when "full account" |
payment | PaymentData | when "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
Name | Type | Description |
---|---|---|
Query | Query | that forms basis for the table read |
limit | number | page size |
snapshot | QuerySnapshot | last successful snapshot/page fetched |
status | enum | status of pagination object |
PageForward | method | pages the fetch forward |
PageBack | method | pages 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
- static
- .recordByIdAndType ⇒ AccountType
- .fetchFullAccount(account) ⇒ Promise.AccountType
- .fetchPrivateData(account) ⇒ Promise.PrivateData
- .accountPage(account, origin)
- .createPrivateData(account, batch) ⇒ Promise.<ChainType>
- .savePrivateData(privateData) ⇒ Promise.<PrivateData>
- .deletePrivateData(privateData) ⇒ Promise.<void>
- .profileComplete(account, privateData) ⇒ Boolean
- .profileIncomplete(account, privateData) ⇒ string | null
- .setOpenIssues(privateData) ⇒ Promise.boolean
- .clearOpenIssues(privateData) ⇒ Promise.boolean
- inner
- ~PrivateDefault : PrivateData
- ~PrivateAccountForm : PrivateData
- ~contact : object
- ~PrivateData : object
- ~ChainType : WriteBatch | Transaction | void
- static
PrivateData.recordByIdAndType ⇒ AccountType
creates and returns a minimal record from an Id and "type"
Kind: static constant of PrivateData
Param | Type |
---|---|
Id | string |
Type | string |
PrivateData.fetchFullAccount(account) ⇒ Promise.AccountType
Fetches a fulll object representation of an account, including ExtraData
Kind: static method of PrivateData
Param | Type |
---|---|
account | AccountType |
PrivateData.fetchPrivateData(account) ⇒ Promise.PrivateData
Fecthes the PrivateData (corporate, addresses, etc) for an account
Kind: static method of PrivateData
Param | Type |
---|---|
account | AccountType |
PrivateData.accountPage(account, origin)
Composes a URL for an "account page" from the account, and passed base URL
Kind: static method of PrivateData
Param | Type | Description |
---|---|---|
account | AccountType | |
origin | string | base URL for the application |
PrivateData.createPrivateData(account, batch) ⇒ Promise.<ChainType>
Kind: static method of PrivateData
Returns: Promise.<ChainType> - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
account | AccountType | |
batch | ChainType | batching 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
Param | Type |
---|---|
privateData | PrivateData |
PrivateData.deletePrivateData(privateData) ⇒ Promise.<void>
Deletes a PrivateData record (rarely used if ever)
Kind: static method of PrivateData
Param | Type |
---|---|
privateData | PrivateData |
privateData.refPath | string |
PrivateData.profileComplete(account, privateData) ⇒ Boolean
verifies that all needed information has been filled in
Kind: static method of PrivateData
Param | Type | Description |
---|---|---|
account | AccountType | |
privateData | PrivateData | record |
PrivateData.profileIncomplete(account, privateData) ⇒ string | null
verifies that all needed information has been filled in
Kind: static method of PrivateData
Param | Type | Description |
---|---|---|
account | AccountType | |
privateData | PrivateData | record |
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
Param | Type |
---|---|
privateData | PrivateData |
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
Param | Type |
---|---|
privateData | PrivateData |
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
Name | Type | Description |
---|---|---|
contact.Id | string | |
contact.first_name | string | |
contact.last_name | string | |
contact.tel | string | |
contact.email | string | must be filled in to make profile public |
PrivateData~PrivateData : object
Kind: inner typedef of PrivateData
Properties
Name | Type | Description |
---|---|---|
string | must be filled in to make profile public | |
contact | contact | |
tel | string | |
business_address | AddressType | |
mailing_address | AddressType | |
billing_address | AddressType |
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
- static
- .saveRegion ⇒ Promise.RegionType
- .createRegion(regionForm) ⇒ Promise.RegionType
- inner
- ~RegionDefault : RegionType
- ~RegionDefaultForm : RegionType
- ~RegionType : object
- static
Regions.saveRegion ⇒ Promise.RegionType
Writes a (changed) RegionType record back to the database
Kind: static constant of Regions
Param | Type |
---|---|
regionForm | RegionType |
Regions.createRegion(regionForm) ⇒ Promise.RegionType
Writes a RegionRecord to the database
Kind: static method of Regions
Param | Type |
---|---|
regionForm | RegionType |
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
Name | Type |
---|---|
Id | string |
name | string |
active | boolean |
maplink | MapLink |
Roles
Typedefs, constants, support functions and database operations related to Roles These are how People relate to Organizations - employess, managers, members, etc
- Roles
- static
- .createRole(roleForm) ⇒ Promise.RoleType
- .fetchRoles() ⇒ Promise.Array.RoleType
- .fetchPersonsAccess(person) ⇒ Promise.Array.RoleType
- .fetchAccessByUser(requested, roleType) ⇒ Promise.<AccessesObject>
- .fetchAccessByTarget(user, targetID, roleType) ⇒ Promise.AccessesObject
- .normalizeAccess(accessItem) ⇒ Promise
- .unnormalizeAccess(accessItem) ⇒ Promise
- .findUserAndGrantAccess(offer) ⇒ Promise.Array.RoleType
- .addAccess(organization, accessItem, batch) ⇒ Promise.<(WriteBatch|Transaction|null)>
- .removeAccess(organization, accessItem, batch) ⇒ Promise.<(WriteBatch|Transaction|null)>
- .summarizeAccess(accessItem) ⇒ string
- .saveAccess(access) ⇒ Promise.AccessType
- inner
- ~RoleDefault : RoleType
- ~RoleDefaultForm : RoleType
- ~AccessEntryDefault : AccessType
- ~AccessEntryForm : AccessType
- ~AccessEntryEdit : AccessType
- ~RoleType : object
- ~AccessOffer : object
- ~AccessType : object
- ~AccessesObject : object
- static
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
Param | Type |
---|---|
roleForm | RoleType |
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
Param | Type |
---|---|
person | AccountType |
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
Param | Type | Description |
---|---|---|
requested | PersonObject | User object requesting access information |
roleType | string |
Roles.fetchAccessByTarget(user, targetID, roleType) ⇒ Promise.AccessesObject
Fetches access information for specific account
Kind: static method of Roles
Param | Type | Description |
---|---|---|
user | PersonObject | for user |
targetID | string | from organziation |
roleType | string | optional 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
Param | Type |
---|---|
accessItem | AccessType |
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
Param | Type |
---|---|
accessItem | AccessType |
Roles.findUserAndGrantAccess(offer) ⇒ Promise.Array.RoleType
Kind: static method of Roles
Returns: Promise.Array.RoleType - Array.RoleType resolve if successful, reject if no match
Param | Type | Description |
---|---|---|
offer | AccessOffer | |
offer.entity | ArtistObject | VenueObject | Array.RoleTypeId of entity offering role |
offer.entity.Id | string | Array.RoleTypeId of entity offering role |
offer.entity.refPath | string | Array.RoleTypeId of entity offering role |
offer.name | string | Array.RoleTypeoptional Name for proposed rol |
offer.role | string | Array.RoleTypetype of role offered |
offer.email | string | Array.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
Param | Type | Description |
---|---|---|
organization | OrganizationType | |
organization.refPath | string | |
accessItem | AccessOffer | |
accessItem.entityId | string | Array.RoleTypeId of entity offering role |
accessItem.name | string | Array.RoleTypeoptional Name for proposed rol |
accessItem.role | string | Array.RoleTypetype of role offered |
accessItem.email | string | Array.RoleTypeemail of person proposed for role |
batch | WriteBatch | Transaction | Array.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
Param | Type | Description |
---|---|---|
organization | OrganizationType | |
organization.refPath | string | |
accessItem | Access | |
batch | WriteBatch | Transaction | Array.RoleTypebatching object. Transaction will be added to the batch |
Roles.summarizeAccess(accessItem) ⇒ string
Kind: static method of Roles
Param | Type |
---|---|
accessItem | AccessType |
Roles.saveAccess(access) ⇒ Promise.AccessType
Kind: static method of Roles
Param | Type |
---|---|
access | AccessType |
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
Name | Type | Description |
---|---|---|
Id | string | Database record Id of role object |
name | string | name of particular role |
active | boolean | status of role in operations |
Roles~AccessOffer : object
Kind: inner typedef of Roles
Properties
Name | Type | Description |
---|---|---|
role | string | type of role offered |
name | string | or proposed role |
string | of person proposed for role | |
uid | string | of 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
Name | Type | Description |
---|---|---|
Id | string | of user given this role, when known |
name | string | for display; name of person having access |
role | string | assigned to this access record |
string | of User to match to this access record |
Roles~AccessesObject : object
Kind: inner typedef of Roles
Properties
Name | Type |
---|---|
cityManagers | Array.AccessType |
venues | Array.AccessType |
artists | Array.AccessType |
accounts | Array.AccessType |
Skills
Typedefs, constants, support functions and database operations related to Skills These are attributes for both individuals and Organizations (generally artists)
- Skills
- static
- .SkillsDefault : SkillsType
- .SkillsForm : SkillsType
- .createSkill(skillForm) ⇒ Promise.SkillsType
- inner
- ~SkillsType : object
- static
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
Param | Type |
---|---|
skillForm | SkillsType |
Skills~SkillsType : object
Kind: inner typedef of Skills
Properties
Name | Type |
---|---|
Id | string |
name | string |
sub_skill_of | string |
Utilities
Typedefs, constants, support functions and database operations for general Utilities
- Utilities
- static
- .saveHost(host) ⇒ Promise.OrganizationType
- .fillForm(object, formtype) ⇒ object
- .simpleObjectCompare(object1, object2) ⇒ boolean
- .formatItem(thisItem, thisFormat) ⇒ string
- .compare(thisItem, anotherItem, sort) ⇒ string
- .anyInAny(findFrom, findIn) ⇒ boolean
- .PromisePoolRunner(entryArray, actionFunction, promiseOptions) ⇒ Promise
- .lesserOf(args) ⇒ number
- .largerOf(args) ⇒ number
- .archiveRecord(record) ⇒ Promise
- .refPathToBaseRecord(refPath) ⇒ RecordDocument
- .bound(value, lowerBound, upperBound) ⇒ number
- .makeHexAsNeeded(color) ⇒ string
- inner
- ~PromisePool
- ~promiseOptionsDefault : PromiseOptions
- ~generateIterator(entryArray, actionFunction)
- ~PromiseOptions : object
- static
Utilities.saveHost(host) ⇒ Promise.OrganizationType
A convenience functin for some shared artist/host front-end pages
Kind: static method of Utilities
Param | Type |
---|---|
host | OrganizationType |
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
Param | Type | Description |
---|---|---|
object | object | source object for data |
formtype | string | indexing 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
Param | Type |
---|---|
object1 | object |
object2 | object |
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
Param | Type | Description |
---|---|---|
thisItem | object | object to create formated string from |
thisFormat | string | string 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
Param | Type | Description |
---|---|---|
thisItem | object | one of two objects being compared |
anotherItem | object | the other of two objects being compared |
sort | string | string 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
Param | Type |
---|---|
findFrom | Array.any |
findIn | Array.any |
Utilities.PromisePoolRunner(entryArray, actionFunction, promiseOptions) ⇒ Promise
Kind: static method of Utilities
Param | Type |
---|---|
entryArray | Array.object |
actionFunction | callback |
promiseOptions | PromiseOptions |
Utilities.lesserOf(args) ⇒ number
A convenience function for legibility
Kind: static method of Utilities
Returns: number - the least of any of the arguments
b
Param | Type | Description |
---|---|---|
args | any | unbounded list of arguments |
Utilities.largerOf(args) ⇒ number
Kind: static method of Utilities
Returns: number - the largest of any of the arguments
Param | Type | Description |
---|---|---|
args | any | unbounded 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
Param | Type |
---|---|
record | RecordDocument |
record.refPath | string |
Utilities.refPathToBaseRecord(refPath) ⇒ RecordDocument
uses a passed refPath to create the most basic document record form
Kind: static method of Utilities
Param | Type | Description |
---|---|---|
refPath | string | "/" separated document path reference |
Utilities.bound(value, lowerBound, upperBound) ⇒ number
clips value to given bounds
Kind: static method of Utilities
Param | Type |
---|---|
value | number |
lowerBound | number |
upperBound | number |
Utilities.makeHexAsNeeded(color) ⇒ string
Kind: static method of Utilities
Returns: string - hex value of named color
Param | Type | Description |
---|---|---|
color | string | name 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
Param | Type |
---|---|
entryArray | Array.any |
actionFunction | callback |
Utilities~PromiseOptions : object
Kind: inner typedef of Utilities
Properties
Name | Type |
---|---|
concurrency | number |
rate | number |
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
- static
- .perkDefault : PerkType
- .perkForm : PerkType
- .GeneralAdmission : PerkType
- .createPerk(perk, eventGroup) ⇒ Promise.PerkType
- .updatePerk(perk) ⇒ Promise.PerkType
- .updatePerks(perks, eventGroup)
- inner
- ~PerkType : object
- static
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
Param | Type |
---|---|
perk | PerkType |
eventGroup | EventGroupType |
perks.updatePerk(perk) ⇒ Promise.PerkType
Kind: static method of perks
Param | Type | Description |
---|---|---|
perk | PerkType | |
perk.refPath | string | from 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
Param | Type | Description |
---|---|---|
perks | Array.PerkType | Array of perk objects to be written. If the Id of any entry is null or missing, a new perk document is created |
eventGroup | EventGroupType | tour to attach perks as sub-collection |
tour.refPath | string | string representing full path to tour - only property used |
T | Transaction 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
Name | Type |
---|---|
Id | string |
merchID | string |
name | string |
description | string |
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>
- ~perkFormArray : perkFormType
- ~pledgeLevelFormType : object
- ~pledgeLevelFormArray : pledgeLevelFormType
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)
Param | Type | Description |
---|---|---|
pledgeLevels | Array.pledgeLevelFormAType | Array of pledgeLevel objects to be written. If the Id of any entry is null or missing, a new perk document is created |
tourStop | TourStopType | tour to attach perks as sub-collection |
tourStop.refPath | string | string representing full path to tour - only property used |
object | Transaction 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
Name | Type |
---|---|
amount | number |
perks | perkFormArray |
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
- static
- .updatePledgeTicket(pledgeTicket) ⇒ Promise(void)
- .deletePledgeTicket(pledgeTicket) ⇒ Promise(void)
- .serverCheckingIn(fullCheckin) ⇒ Promise.<T>
- .createCheckIn(pledgeTicket, checkIn)
- .summarizePledgeTickets(pledgeTickets) ⇒ fanSummary
- .fillPledgeTicket(pledgeTicket) ⇒ pledgeTicketType
- .describePledgeTicket(pledgeTicket) ⇒ string
- .markPledgeTicket(pledgeTicket, label)
- inner
- ~fetchTourStopPledgeSummary(tourStop) ⇒ PledgeSummary
- ~fetchFansTourStopPledgeSummary(fan, tourStop) ⇒ fanSummary
- ~fetchFansPledgeSummary(fan) ⇒ Array.fanSummary
- ~fetchTourStopFromPledge(pledgeTicket, batch) ⇒ Promise.<DocumentObject>
- ~pledgeTicketType : checkinType
- ~checkinType : object
- ~fanSummary : perks
- static
pledgeTickets.updatePledgeTicket(pledgeTicket) ⇒ Promise(void)
updates an existing pledgeTicket
Kind: static method of pledgeTickets
Param | Type | Description |
---|---|---|
pledgeTicket | pledgeTicketType | updated pledgeTicket |
pledgeTickets.deletePledgeTicket(pledgeTicket) ⇒ Promise(void)
deletes a pledgeTicket. Removed from summary in background
Kind: static method of pledgeTickets
Param | Type | Description |
---|---|---|
pledgeTicket | pledgeTicketType | updated 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
Param | Type |
---|---|
fullCheckin | RecordObject |
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
Param | Type |
---|---|
pledgeTicket | RecordObject |
pledgeTicket.refPath | string |
pledgeTicket.checkins | object |
checkIn | RecordObject |
pledgeTickets.summarizePledgeTickets(pledgeTickets) ⇒ fanSummary
summarizes a group of pledgeTickets assumes all are for the same tourStop/event
Kind: static method of pledgeTickets
Param | Type |
---|---|
pledgeTickets | PledgeTicketArray |
pledgeTickets.fillPledgeTicket(pledgeTicket) ⇒ pledgeTicketType
Fills in complete info into a pledgeTicket: tourStop. perks, etc
Kind: static method of pledgeTickets
Param | Type |
---|---|
pledgeTicket | pledgeTicketType |
pledgeTickets.describePledgeTicket(pledgeTicket) ⇒ string
Creates a string describing a Tour Stop
Kind: static method of pledgeTickets
Param | Type |
---|---|
pledgeTicket | pledgeTicketType |
pledgeTickets.markPledgeTicket(pledgeTicket, label)
Changes the paidQ label on a pledgeTicket
Kind: static method of pledgeTickets
Param | Type |
---|---|
pledgeTicket | pledgeTicketType |
label | string |
pledgeTickets~fetchTourStopPledgeSummary(tourStop) ⇒ PledgeSummary
Kind: inner method of pledgeTickets
Returns: PledgeSummary - //count of tickets, sum of amounts
Param | Type |
---|---|
tourStop | TourStopType |
Properties
Name | Type | Description |
---|---|---|
PledgeSummary.tickets | number | |
PledgeSummary.dollars | number | summary information is kept in the "logistics" record (not public) |
pledgeTickets~fetchFansTourStopPledgeSummary(fan, tourStop) ⇒ fanSummary
Kind: inner method of pledgeTickets
Returns: fanSummary - fanSummary
Param | Type | Description |
---|---|---|
fan | PeopleFormType | fan record |
tourStop | TourStopFormType | tourStop record |
pledgeTickets~fetchFansPledgeSummary(fan) ⇒ Array.fanSummary
Kind: inner method of pledgeTickets
Returns: Array.fanSummary - fanSummary(s)
Param | Type | Description |
---|---|---|
fan | PersonObject | fan record |
pledgeTickets~fetchTourStopFromPledge(pledgeTicket, batch) ⇒ Promise.<DocumentObject>
returns the parent tourStop of a pledgeTicket
Kind: inner method of pledgeTickets
Param | Type | Description |
---|---|---|
pledgeTicket | pledgeTicketType | pledgeticket to trace tree from |
batch | Transaction | optional batch chain object |
pledgeTickets~pledgeTicketType : checkinType
Kind: inner typedef of pledgeTickets
Properties
Name | Type | Description |
---|---|---|
amount | number | |
ticketQ | Boolean | flag to inidcate pledge includes ticket(s) |
tickets | number | number of tickets/pledges included in pledge |
pledgeLevel | pledgeLevel | pledgeLevel object from TourStop |
fan | PeopleFormType | link to fan account |
fan.Id | string | Id of fan account |
fan.name | string | fan's name for display |
payment | object | link to payment transaction |
payment.link | string | unique payment transaction identifier (not secure, not fungible) |
paidQ | Boolean | flag to indicate payment made (not secure, not "source of truth") |
checkins | checkinArray | array of door checkin objects |
timestamp | timestamp | server-side timestamp of original pledge |
pledgeTickets~checkinType : object
Kind: inner typedef of pledgeTickets
Properties
Name | Type | Description |
---|---|---|
checkins | number | count of checking used in this transaction |
signature | string | url of signature image in Firestore |
code | string | crytographic verification code for checkin |
timestamp | timestamp | server-side timestamp of checkin transaction |
pledgeTickets~fanSummary : perks
Kind: inner typedef of pledgeTickets
Properties
Name | Type | Description |
---|---|---|
ticketCode | string | unique ID of the first pledgeTicket in summary |
refPath | docRef | Database reference of first pledgeTicket in summary |
perks | perksArray | array of all perks in the summary |
tickets | number | sum count of all pledgeTickets in the summary |
dollars | number | sum of all money spent/committed |
© 2020-2023 Tracy Hall / Dreams and Logic Inc / SaltSweetSpirits
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago