@leaddreamer/tufbusiness v0.6.11
@leaddreamer/tufbusiness
Business Logic for the Tickets Unlimited system, wrapped around FirebaseWrapper, to be shared between Back and Front End. This particular library only provides the business "logic" - not browser services.
Modules
Constants
Functions
Typedefs
TUFBusiness
Business Logic for the Tickets Unlimited system, wrapped around FirebaseWrapper, to be shared between Back and Front End. This particular library only provides the business "logic" - not browser services.
- TUFBusiness
- static
- inner
- ~FirebaseConfigObject : object
TUFBusiness.FirebaseWrapper(config)
Kind: static method of TUFBusiness
Param | Type | Description |
---|---|---|
config | FirebaseConfigObject | Firebase Admin object |
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";
TUFBusiness~FirebaseConfigObject : object
only authDomain, databaseURL and storageBucket are present when called from a cloud environment
Kind: inner typedef of TUFBusiness
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 |
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 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 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.module) ~Creates the ArtistPayment information document(artist, batch)(#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.module..Creates the ArtistPayment information document) ⇒ Promise ~PaymentDescriptors(#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.module_..PaymentDescriptors) : object ~PDSummaryArray(#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.module..PDSummaryArray) : object ~receiptType(#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.module..receiptType) : object ~paymentDescriptorArray(#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.module_..paymentDescriptorArray) : paymentDescriptor
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.~Creates the ArtistPayment information document(artist, batch) ⇒ Promise
Kind: inner method of 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 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.module_)
Returns: Promise - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
artist | ArtistFormType | |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
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.~PaymentDescriptors : object
Kind: inner typedef of 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 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.module_)
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 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.~PDSummaryArray : object
Kind: inner typedef of 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 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.module_)
Properties
Name | Type | Description |
---|---|---|
Id | string | document Id of this Card Descriptor |
label | string | Brand & last4, or other descriptive |
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.~receiptType : object
Kind: inner typedef of 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 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.module_)
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 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.~paymentDescriptorArray : paymentDescriptor
Kind: inner typedef of 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 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.module_)
SHARE_TYPES : enum
Kind: global enum
Read only: true
VENUE_BOOKING_STATUS : enum
Kind: global enum
Read only: true
ARTIST_BOOKING_STATUS : enum
Kind: global enum
Read only: true
updateBookingOfferArtist
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: global constant
fetchRates ⇒ Promise
Kind: global constant
Functions: returns a Promise that resolves with the Rates record from the database
fillForm
Kind: global constant
Sync: @function fillForm
creates an object using ONLY the fields in the specified "form" object
useful for preventing stray data from entering database
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. ---------------------------------------------------------------------- |
createNewArtist(artist, manager, batch) ⇒ Promise
Kind: global function
Returns: Promise - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
artist | ArtistFormType | basic artist information for new account |
artist.name | string | name of the artist/act |
artist.region | string | home town/region of Artist |
manager | Access | |
manager.Id | string | when Id is prescribed (such as a "personal artist 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 |
returns a Promise which resolves with an Artist Object (thisArtistID) ⇒ Promise.<ArtistFormType>
Kind: global function
Returns: Promise.<ArtistFormType> - --------------------------------------------------------------------
Param | Description |
---|---|
thisArtistID | ID for the artist/record to be fetched |
returns a Promise which resolves with an
array of all Artist Objects (or err)() ⇒ Promise.<ArtistFormArray>
Kind: global function
returns a Promise which resolves to an array of all Artists whose
name begins with the provided prompt, optionally limited to a provided number(prompt, limit) ⇒ Promise.<ArtistFormArray> Kind: global function
Param | Type | Description |
---|---|---|
prompt | string | Used to query for matching Artists |
limit | string | number | Used to limit the number of results |
fetchArtistsMemberAccess(artist) ⇒ artistMatchArray
Kind: global function
Returns: artistMatchArray - artists/acts this artist is a member of
Param | Type | Description |
---|---|---|
artist | object | (actually just artist.Id) |
artist.Id | string |
saveArtistMemberAccess()
Kind: global function
findArtistIDFromChild
Extracts the Artists ID from the Document Path (assumes as a child)(child) ⇒ string
Kind: global function
Returns: string - Id of artist Document (which is also ID of artist)
Param | Type | Description |
---|---|---|
child | DocumentObject | document (regardless of depth) of an Artist Document |
fetchArtistFromChild
Extracts the Artists ID from the Document Path (assumes as a child)(child) ⇒ DocumentObject
Kind: global function
Returns: DocumentObject - Id of artist Document (which is also ID of artist)
Param | Type | Description |
---|---|---|
child | DocumentObject | document (regardless of depth) of an Artist Document |
crossConfirmed(bookingOffer) ⇒ boolean
function to verify both venue and artist have confirmed a booking offer (hiding implementation)
Kind: global function
Param | Type | Description |
---|---|---|
bookingOffer | bookingOffer | booking offer object/record to be checked |
simpleCanceled(bookingOffer) ⇒ boolean
Function to check whether either party has canceled the event
Kind: global function
Param | Type | Description |
---|---|---|
bookingOffer | bookingOffer | booking offer object/record to be checked |
artistShare(bookingOffer, currentAmount, fullAmount)
Kind: global function
Param | Type | Description |
---|---|---|
bookingOffer | object | |
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 |
createBusinessRecord(artist, batch) ⇒ Promise.<ChainType>
Kind: global function
Returns: Promise.<ChainType> - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
artist | ArtistFormType | |
batch | ChainType | batching object. Transaction will be added to the batch |
verifies that all needed information has been filled in(account, Business) ⇒ Boolean
Kind: global function
Param | Type | Description |
---|---|---|
account | object | |
Business | object | record |
verifies that all needed information has been filled in(account, Business) ⇒ string | null
Kind: global function
Param | Type | Description |
---|---|---|
account | object | |
Business | object | record |
setOpenIssues(account) ⇒ 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: global function
Param | Type |
---|---|
account | baseRecord |
clearOpenIssues(account) ⇒ 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: global function
Param | Type |
---|---|
account | baseRecord |
createCityManager
adds a new venue record to the database(venue, batch) ⇒ Promise Kind: global function
Param | Type | Description |
---|---|---|
venue | CityManagerType | record to commit |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
returns a Promise which resolves to an array of all cityManagers whose
name begins with the provided prompt, optionally limited to a provided number(prompt, limit) ⇒ Promise.<CityManagerTypeArray>
Kind: global function
Returns: Promise.<CityManagerTypeArray> - - array of cityManager objects
Param | Type | Description |
---|---|---|
prompt | string | Used to query for matching Artists |
limit | string | number | Used to limit the number of results |
fetchCityManagerData returns the cityManagers business data(cityManager) ⇒
Kind: global function
Returns: a cityManagerData record. These records are the ONLY document in
sub-collection CITYMANAGERDATA under the "cityManager" record, and have the SAME
documentId as the parent "cityManager" document.
Param | Description |
---|---|
cityManager | a cityManager record, at least including the fields Id and refPath |
createBusinessRecord(artist, batch) ⇒ Promise
Kind: global function
Returns: Promise - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
artist | ArtistFormType | |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
verifies that all needed information has been filled in(account, Business) ⇒ Boolean
Kind: global function
Param | Type | Description |
---|---|---|
account | object | |
Business | object | record |
verifies that all needed information has been filled in(account, Business) ⇒ string | null
Kind: global function
Param | Type | Description |
---|---|---|
account | object | |
Business | object | record |
setOpenIssues(account) ⇒ 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: global function
Param | Type |
---|---|
account | baseRecord |
clearOpenIssues(account) ⇒ 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: global function
Param | Type |
---|---|
account | baseRecord |
fetchFundamentals() ⇒ Promise.<ArtistFormArray>
returns a Promise which resolves with an array of all Fundamentals Objects (or err)
Kind: global function
returns a Promise that resolves with the Rates record from the database() ⇒ Promise
Kind: global function
fetchMCCs() ⇒ Promise.<MCCArray>
returns an array of all MCC (Merchant Commerce Code) available
Kind: global function
logMessageEvent(event) ⇒ 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
Kind: global function
Returns: recordDocument - - document as written to database - note NOT the stored
document, but the PRE-MERGED document including Id and refPath.
Param | Type | Description |
---|---|---|
event | messageEvent | the webhook event structure |
messageStatus(record) ⇒ string
fetches the most recent status message event on a particular object Could involved multiple messages, statuses, etc
Kind: global function
Returns: string - event type/status - "processed", "bounced", "delivered", etc
Param | Type | Description |
---|---|---|
record | documentRecord | object to find message history for. Currently only Receipts and PledgeTickets |
objectArray(record) ⇒ objectArray
fetches all of the message events associated with a partucular record, sorted by reverse timestamp
Kind: global function
Returns: objectArray - array of message events
Param | Type | Description |
---|---|---|
record | documentRecord | object to find message history for. Currently only Receipts and PledgeTickets |
deletePersonById(person)
Kind: global function
Param | Type | Description |
---|---|---|
person | PersonObject | minimal record of user account |
person.Id | string | record Id of account |
fetchPeoplePaginated(dataCallback, errCallback) ⇒ PaginatedListener
Kind: global function
Returns: PaginatedListener - object with unsubscribe and pagination methods
Param | Type | Description |
---|---|---|
dataCallback | function | callback |
errCallback | function | callback |
PageBack pages the fetch backward
----------------------------------------------------------------------(table, filterArray, sortArray, ref, limit) ⇒ PaginateFetch
Kind: global function
Returns: PaginateFetch - An object to allow for paginating a table read from Firestore. REQUIRES a sorting choice
Param | Type | Description |
---|---|---|
table | string | a properly formatted string representing the requested collection - always an ODD number of elements |
filterArray | array | an (optional) 3xn array of filter(i.e. "where") conditions |
sortArray | array | a 2xn array of sort (i.e. "orderBy") conditions |
ref | ref | (optional) allows "table" parameter to reference a sub-collection of an existing document reference (I use a LOT of structered collections) The array is assumed to be sorted in the correct order - i.e. filterArray0 is added first; filterArraylength-1 last returns data as an array of objects (not dissimilar to Redux State objects) with both the documentID and documentReference added as fields. |
limit | number | (optional) |
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 |
Classifies a users granted accesses.()
Kind: global function
fetchAccessByUser(requested, roleType) ⇒ AccessesObject
searches all businesses/managers for a user's Id (i.e. NOT the user record version)
Kind: global function
Param | Type | Description |
---|---|---|
requested | PersonObject | User object requesting access information |
roleType | string |
fetchAccessByTarget(requested, target, roleType) ⇒ AccessesObject
Fetches access information for specific account
Kind: global function
Param | Type |
---|---|
requested | PersonObject |
target | string |
roleType | string |
findUserAndGrantAccess(offer) ⇒ Promise
Kind: global function
Returns: Promise - - resolve if successful, reject if no match
Param | Type | Description |
---|---|---|
offer | AccessOffer | |
offer.entity | ArtistObject | VenueObject | Id of entity offering role |
offer.entity.Id | string | Id of entity offering role |
offer.entity.refPath | string | Id of entity offering role |
offer.name | string | optional Name for proposed rol |
offer.role | string | type of role offered |
offer.email | string | email of person proposed for role |
addAccess(parent, accessItem, batch) ⇒ Promise
Kind: global function
Returns: Promise - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
parent | ArtistFormType | VenueType | |
parent.refPath | string | |
accessItem | AccessOffer | |
accessItem.entityId | string | Id of entity offering role |
accessItem.name | string | optional Name for proposed rol |
accessItem.role | string | type of role offered |
accessItem.email | string | email of person proposed for role |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
removeAccess(parent, accessItem, batch) ⇒ Promise
Kind: global function
Returns: Promise - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
parent | ArtistFormType | VenueType | |
accessItem | Access | |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
modifyTourStop(tourStop, batch) ⇒ Promise
Saves an updated record. Assumes sourced from database; included fields are merged with database (allows changing single fields)
Kind: global function
Param | Type | Description |
---|---|---|
tourStop | object | |
tourStop.refPath | string | only "required" field |
batch | object | Transaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched |
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>(tourStop, tour, batch) ⇒ Promise
Kind: global function
Returns: Promise - chanied Batch or Void (if singleton)
Param | Type | Description |
---|---|---|
tourStop | TourStopType | Array of pledgeLevel objects to be written. If the Id of any entry is null or missing, a new perk document is created |
tour | TourType | tour to attach perks as sub-collection |
tour.refPath | string | string representing full path to tour - only property used |
batch | object | Transaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched |
updateTourStopByChild(tourStopRecord, child, batch)
Kind: global function
Param | Type |
---|---|
tourStopRecord | TourStopFormType |
child | Record |
batch | WriteBatch | Transaction |
modifySummary(summary, batch) ⇒ Promise
Saves an updated record. Assumes sourced from database; included fields are merged with database (allows changing single fields)
Kind: global function
Param | Type | Description |
---|---|---|
summary | object | |
summary.refPath | string | only "required" field |
batch | object | Transaction or WriteBatch chain object. If included, will return the chained object. if not included, a new WriteBatch will be created and dispatched |
pullInventory(tourStop, tickets) ⇒ Promise
Kind: global function
Param | Type |
---|---|
tourStop | TourStopType |
tourStop.Id | string |
tourStop.refPath | string |
tickets | number |
pushInventory(tourStop, tickets) ⇒ Promise
Kind: global function
Param | Type |
---|---|
tourStop | TourStopType |
tourStop.Id | string |
tourStop.refPath | string |
tickets | number |
formatItem
Props(thisItem, thisFormat) Allows string substitution from an object field names support Dot notation field names allow ":" extension for alternate formatting
Kind: global function
Param | Description |
---|---|
thisItem | object to create formated string from |
thisFormat | string describing formatted output - fieldname wrapped in will be substituted. DOT notation allowed for fields. |
compare utility for sorting objects
Props(thisItem, anotherItem, sort) ⇒ string Kind: global function
Param | Description |
---|---|
thisItem | one of two objects being compared |
anotherItem | the other of two objects being compared |
sort | string describing sort - format "fieldName:sortType" - sort Type is "string, "date" or "number" (default) |
generateIterator()
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: global function
largerOf(args) ⇒ number
Kind: global function
Returns: number - the least of any of the arguments
Param | Type | Description |
---|---|---|
args | any | unbounded list of arguments |
refPathToBaseRecord(refPath)
uses a passed refPath to create the most basic document record form
Kind: global function
Param | Type | Description |
---|---|---|
refPath | string | "/" separated document path reference |
bound(value, lowerBound, upperBound) ⇒ number
clips value to given bounds
Kind: global function
Param | Type |
---|---|
value | number |
lowerBound | number |
upperBound | number |
adds a new venue record to the database(venue, batch) ⇒ Promise
Kind: global function
Param | Type | Description |
---|---|---|
venue | VenueType | record to commit |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
returns a Promise which resolves to an array of all Artists whose
name begins with the provided prompt, optionally limited to a provided number(prompt, limit) ⇒ Promise.<VenueTypeArray>
Kind: global function
Returns: Promise.<VenueTypeArray> - - array of venue objects
Param | Type | Description |
---|---|---|
prompt | string | Used to query for matching Artists |
limit | string | number | Used to limit the number of results |
updatePerks
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>(perks, tour) Kind: global function
Param | Type | Description |
---|---|---|
perks | perkFormTypeArray | Array of perk objects to be written. If the Id of any entry is null or missing, a new perk document is created |
tour | TourFormType | 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 ---------------------------------------------------------------------- |
updatePledgeLevels
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>(pledgeLevels, tourStop) ⇒ Promise
Kind: global function
Returns: Promise - chanied Batch or Void (if singleton)
Param | Type | Description |
---|---|---|
pledgeLevels | pledgeLevelFormArray | 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 |
updatePledgeTicket(pledgeTicket) ⇒ Promise(void)
updates an existing pledgeTicket
Kind: global function
Param | Type | Description |
---|---|---|
pledgeTicket | pledgeTicketType | updated pledgeTicket |
deletePledgeTicket(pledgeTicket) ⇒ Promise(void)
deletes a pledgeTicket. Removed from summary in background
Kind: global function
Param | Type | Description |
---|---|---|
pledgeTicket | pledgeTicketType | updated pledgeTicket |
serverCheckingIn(fullCheckin) ⇒ Promise.<T>
Server Cloud Functions are passed a single consolidated object that includes the pledgeTicket refPath
Kind: global function
Param | Type |
---|---|
fullCheckin | RecordObject |
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: global function
Param | Type |
---|---|
pledgeTicket | RecordObject |
pledgeTicket.refPath | string |
pledgeTicket.checkins | object |
checkIn | RecordObject |
fetchTourStopPledgeSummary(tourStop) ⇒ PledgeSummary
Kind: global function
Returns: PledgeSummary - //count of tickets, sum of amounts
Param | Type |
---|---|
tourStop | TourStopType |
Properties
Name | Type |
---|---|
PledgeSummary.tickets | number |
PledgeSummary.dollars | number |
summarizePledgeTickets(pledgeTickets) ⇒ fanSummary
summarizes a group of pledgeTickets assumes all are for the same tourStop/event
Kind: global function
Param | Type |
---|---|
pledgeTickets | PledgeTicketArray |
fetchFansTourStopPledgeSummary(fan, tourStop) ⇒ fanSummary
Kind: global function
Returns: fanSummary - fanSummary
Param | Type | Description |
---|---|---|
fan | PeopleFormType | fan record |
tourStop | TourStopFormType | tourStop record |
fetchFansPledgeSummary(fan) ⇒ fanSummaryArray
Kind: global function
Returns: fanSummaryArray - fanSummary
Param | Type | Description |
---|---|---|
fan | PersonObject | fan record |
fillPledgeTicket(pledgeTicket) ⇒ pledgeTicketType
Fills in complete info into a pledgeTicket: tourStop. perks, etc
Kind: global function
Param | Type |
---|---|
pledgeTicket | pledgeTicketType |
describePledgeTicket(pledgeTicket) ⇒ string
Creates a string describing a Tour Stop
Kind: global function
Param | Type |
---|---|
pledgeTicket | pledgeTicketType |
markPledgeTicket(pledgeTicket, label)
Changes the paidQ label on a pledgeTicket
Kind: global function
Param | Type |
---|---|
pledgeTicket | pledgeTicketType |
label | string |
AddressType : object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
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 |
maplink : object
Kind: global typedef
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 |
ArtistFormType : object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
name | string | name of Artist/Act |
image | string | string URL |
banner | string | string URL |
bio | string | biography of Artist/Act |
description | string | description of Artist/Act |
genres | GenreFormType | array of Genre objects describing Artist/Act |
skills | SkillFormType | array of skill (instrument) objects describing Artist/Act |
lineup | ArtistFormType | array of Artist profiles of members |
website | string | string URL to main Artist/Act website |
social_links | string | array of string URL to additional Artist/Act web properies |
region | string | a string representing to Artist/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 |
bandMember : object
Kind: global typedef
Properties
Name | Type |
---|---|
name | string |
image | URL |
skills | string |
bookingOffer : object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
venue | object | denormalized booking Venue info |
venue.Id | string | Id of the booking venue |
venue.capacity | number | |
venue.name | string | |
venue.region | string | redundant, but allows collectionGroup listeners |
venue.bookingStatus | VENUE_BOOKING_STATUS | |
artist | object | denormalized booking artist info |
artist.name | string | |
artist.bookingStatus | ARTIST_BOOKING_STATUS | |
ticket | object | |
ticket.share | number | |
ticket.type | SHARE_TYPES | |
ticket.limit | number | |
house | object | |
house.share | number | |
house.type | SHARE_TYPES | |
house.limit | number | |
date | string | |
time | string | |
time.Start | string | |
time.Duration | string | |
published | object | |
Q | boolean | published flag |
string | details |
BusinessDefault : Record
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
business_email | string | must be filled in to make profile public |
business_contact | object | |
business_contact.Id | string | |
business_contact.first_name | string | |
business_contact.last_name | string | |
business_tel | string | |
business_address | AddressType | |
mailing_address | AddressType | |
billing_address | AddressType |
ChainType : WriteBatch | Transaction | void
Kind: global typedef
CityManagerType : object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
name | string | name of CityManager |
business_contact | object | |
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 |
CityManagerDataDefault : Record
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
business_email | string | must be filled in to make profile public |
business_contact | object | |
business_contact.Id | string | |
business_contact.first_name | string | |
business_contact.last_name | string | |
business_contact.tel | string | |
business_address | AddressType |
FavoriteDefinition : Record
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | Id of favorited Artist or Venue |
type | string | type flag |
name | string | name of favorite |
FavoriteEntryDefinition : Record
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | Id of favorited Artist or Venue |
FavoriteEntryDefinitionArray : FavoriteEntryDefinition
Kind: global typedef
FavoriteListDefinition : Record
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | matches Id of User/Fan |
type | string | type flag |
list | FavoriteEntryDefinitionArray |
MCCArray : object
Kind: global typedef
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" or "Venues" |
ArtistFormArray : ArtistFormType
Kind: global typedef
PersonObject : object
Kind: global typedef
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 |
Role : object
Kind: global typedef
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 |
RoleArray : Array:Role
Kind: global typedef
AccessOffer : object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
entityId | string | Id of entity offering role |
name | string | optional Name for proposed rol |
role | string | type of role offered |
string | email of person proposed for role |
Access : 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: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | Id of user given this role, when known |
name | string | for display; name of person having access |
role | string | role assigned to this access record |
string | email of User to match to this access record |
AccessesObject : object
Kind: global typedef
Properties
Name | Type |
---|---|
cityManagers | Access |
venues | Access |
artists | Access |
accounts | Access |
TourStopType : perkFormType
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
tour | TourFormType | local copy of parent tour information |
title | string | short title for tour |
image | string | string URL |
banner | string | string URL |
artist | object | //For convenience - can be culled from hierarchy |
artist.name | string | - //For convenience - can be culled from hierarchy |
description | string | description of tour |
booked | dateString | null when open; dateString when booked |
dateStart | dateString | optional start date for tour |
dateEnd | dateString | optional end date of tour |
timeStart | dateString | optional start date for tour |
timeEnd | dateString | optional end date of tour |
perks | perkFormArray | optional array of perks. Not saved to database; populated from sub-collection |
LogisticsType : object
Kind: global typedef
Properties
Name | Type |
---|---|
soundcheck | timeString |
loadIn | timeString |
loadOut | timeString |
TourFormType : perkFormType
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
title | string | short title for tour |
image | string | string URL |
banner | string | string URL |
artist | ArtistFormType | //For convenience - can be culled from hierarchy |
artist.name | string | - //For convenience - can be culled from hierarchy |
description | string | description of tour |
dateStart | dateString | optional start date for tour |
dateEnd | dateString | optional end date of tour |
perks | perkFormArray | optional array of perks. Not saved to database; populated from sub-collection |
VenueType : string
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Id | string | present if fetch from database |
name | string | name of Venue |
image | string | string URL |
banner | string | string URL |
bio | string | biography of Venue |
description | string | description of Venue |
genres | GenreFormType | array of Genre objects describing Venue |
website | string | string URL to main Venue website |
social_links | stringArray | array of string URL to additional Venue web properies |
region | string | a string representing to Venue home region SELECTED FROM list of regions |
corporate | string | corporate owner, if any |
capacity | number | |
business_contact | object | |
business_contact.first_name | string | |
business_contact.last_name | string | |
business_contact.tel | string | |
business_address | AddressType | |
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 |
perkFormType : object
Kind: global typedef
Properties
Name | Type |
---|---|
Id | string |
merchID | string |
name | string |
description | string |
perkFormTypeArray : perkFormType
Kind: global typedef
perkFormArray : perkFormType
Kind: global typedef
pledgeLevelFormType : object
Kind: global typedef
Properties
Name | Type |
---|---|
amount | number |
perks | perkFormArray |
pledgeLevelFormArray : pledgeLevelFormType
Kind: global typedef
pledgeTicketType : checkinType
Kind: global typedef
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 |
checkinType : object
Kind: global typedef
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 |
fanSummary : perks
Kind: global typedef
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 |
.addTolineup(newBandmember, artist) ⇒ ArtistFormType
Kind: static function
Param | Type |
---|---|
newBandmember | bandMember |
newBandmember.Id | string |
artist | ArtistFormType |
artist.Id | string |
artist.name | string |
artist.email | string |
.removeFromLineup(newBandmember, artist) ⇒ ArtistFormType
Kind: static function
Param | Type |
---|---|
newBandmember | bandMember |
newBandmember.Id | string |
artist | ArtistFormType |
artist.Id | string |
artist.name | string |
artist.email | string |
.createCityManagerData(cityManager, manager, batch) ⇒ Promise
Kind: static function
Returns: Promise - WriteBatch, Transaction or Void
Param | Type | Description |
---|---|---|
cityManager | CityManagerType | |
manager | Access | |
batch | WriteBatch | Transaction | batching object. Transaction will be added to the batch |
.updateUserAccess(accessItem, entity)
Kind: static function
Param | Type |
---|---|
accessItem | Access |
entity | PersonObject |
.removeUserAccess(accessItem, entity)
Kind: static function
Param | Type |
---|---|
accessItem | Access |
entity | PersonObject |
.createRole() ⇒ Role
Kind: static function
Returns: Role - result from the database operation
Note the listener (below) will take care of updating the local copy
.fetchRoles() ⇒ RoleArray
Kind: static function
.normalizeAccess(accessItem)
Kind: static function
Param | Type |
---|---|
accessItem | Access |
.unnormalizeAccess(accessItem)
Kind: static function
Param | Type |
---|---|
accessItem | Access |
.fetchTourStopFromPledge(pledgeTicket, batch) ⇒ Promise.<DocumentObject>
Kind: static function
Param | Type | Description |
---|---|---|
pledgeTicket | pledgeTicketType | pledgeticket to trace tree from |
batch | Transaction | optional batch chain object |
© 2020-2023 Tracy Hall
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago