0.6.11 • Published 1 year ago

@leaddreamer/tufbusiness v0.6.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

view on
npm

@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.FirebaseWrapper(config)

Kind: static method of TUFBusiness

ParamTypeDescription
configFirebaseConfigObjectFirebase 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

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

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

ParamTypeDescription
artistArtistFormType
batchWriteBatch | Transactionbatching 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

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

Payment 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

NameTypeDescription
Idstringdocument Id of this Card Descriptor
labelstringBrand & 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

NameTypeDescription
Idstringsame Id as the associated pledgeTicket
amountnumber
paymentobject
linkstringId of associated payment_intent
paidQstringstring describing status
descriptionstringsupplemental 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

ParamTypeDescription
objectobjectsource object for data
formtypestringindexing 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

ParamTypeDescription
artistArtistFormTypebasic artist information for new account
artist.namestringname of the artist/act
artist.regionstringhome town/region of Artist
managerAccess
manager.Idstringwhen 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.emailstring-
batchWriteBatch | Transactionbatching 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> - --------------------------------------------------------------------

ParamDescription
thisArtistIDID 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

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

fetchArtistsMemberAccess(artist) ⇒ artistMatchArray


Kind: global function
Returns: artistMatchArray - artists/acts this artist is a member of


ParamTypeDescription
artistobject(actually just artist.Id)
artist.Idstring

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)


ParamTypeDescription
childDocumentObjectdocument (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)


ParamTypeDescription
childDocumentObjectdocument (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

ParamTypeDescription
bookingOfferbookingOfferbooking offer object/record to be checked

simpleCanceled(bookingOffer) ⇒ boolean

Function to check whether either party has canceled the event

Kind: global function

ParamTypeDescription
bookingOfferbookingOfferbooking offer object/record to be checked

artistShare(bookingOffer, currentAmount, fullAmount)

Kind: global function

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

createBusinessRecord(artist, batch) ⇒ Promise.<ChainType>

Kind: global function
Returns: Promise.<ChainType> - WriteBatch, Transaction or Void

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

verifies that all needed information has been filled in(account, Business) ⇒ Boolean

Kind: global function

ParamTypeDescription
accountobject
Businessobjectrecord

verifies that all needed information has been filled in(account, Business) ⇒ string | null

Kind: global function

ParamTypeDescription
accountobject
Businessobjectrecord

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

ParamType
accountbaseRecord

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

ParamType
accountbaseRecord

createCityManager

adds a new venue record to the database(venue, batch) ⇒ Promise Kind: global function

ParamTypeDescription
venueCityManagerTyperecord to commit
batchWriteBatch | Transactionbatching 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

ParamTypeDescription
promptstringUsed to query for matching Artists
limitstring | numberUsed 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.


ParamDescription
cityManagera cityManager record, at least including the fields Id and refPath

createBusinessRecord(artist, batch) ⇒ Promise

Kind: global function
Returns: Promise - WriteBatch, Transaction or Void

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

verifies that all needed information has been filled in(account, Business) ⇒ Boolean

Kind: global function

ParamTypeDescription
accountobject
Businessobjectrecord

verifies that all needed information has been filled in(account, Business) ⇒ string | null

Kind: global function

ParamTypeDescription
accountobject
Businessobjectrecord

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

ParamType
accountbaseRecord

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

ParamType
accountbaseRecord

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.

ParamTypeDescription
eventmessageEventthe 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

ParamTypeDescription
recorddocumentRecordobject 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

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

deletePersonById(person)

Kind: global function

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

fetchPeoplePaginated(dataCallback, errCallback) ⇒ PaginatedListener


Kind: global function
Returns: PaginatedListener - object with unsubscribe and pagination methods

ParamTypeDescription
dataCallbackfunctioncallback
errCallbackfunctioncallback

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

ParamTypeDescription
tablestringa properly formatted string representing the requested collection - always an ODD number of elements
filterArrayarrayan (optional) 3xn array of filter(i.e. "where") conditions
sortArrayarraya 2xn array of sort (i.e. "orderBy") conditions
refref(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.
limitnumber(optional)

Properties

NameTypeDescription
QueryQuerythat forms basis for the table read
limitnumberpage size
snapshotQuerySnapshotlast successful snapshot/page fetched
statusenumstatus 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

ParamTypeDescription
requestedPersonObjectUser object requesting access information
roleTypestring

fetchAccessByTarget(requested, target, roleType) ⇒ AccessesObject

Fetches access information for specific account

Kind: global function

ParamType
requestedPersonObject
targetstring
roleTypestring

findUserAndGrantAccess(offer) ⇒ Promise

Kind: global function
Returns: Promise - - resolve if successful, reject if no match

ParamTypeDescription
offerAccessOffer
offer.entityArtistObject | VenueObjectId of entity offering role
offer.entity.IdstringId of entity offering role
offer.entity.refPathstringId of entity offering role
offer.namestringoptional Name for proposed rol
offer.rolestringtype of role offered
offer.emailstringemail of person proposed for role

addAccess(parent, accessItem, batch) ⇒ Promise

Kind: global function
Returns: Promise - WriteBatch, Transaction or Void

ParamTypeDescription
parentArtistFormType | VenueType
parent.refPathstring
accessItemAccessOffer
accessItem.entityIdstringId of entity offering role
accessItem.namestringoptional Name for proposed rol
accessItem.rolestringtype of role offered
accessItem.emailstringemail of person proposed for role
batchWriteBatch | Transactionbatching object. Transaction will be added to the batch

removeAccess(parent, accessItem, batch) ⇒ Promise

Kind: global function
Returns: Promise - WriteBatch, Transaction or Void

ParamTypeDescription
parentArtistFormType | VenueType
accessItemAccess
batchWriteBatch | Transactionbatching 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

ParamTypeDescription
tourStopobject
tourStop.refPathstringonly "required" field
batchobjectTransaction 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)


ParamTypeDescription
tourStopTourStopTypeArray of pledgeLevel objects to be written. If the Id of any entry is null or missing, a new perk document is created
tourTourTypetour to attach perks as sub-collection
tour.refPathstringstring representing full path to tour - only property used
batchobjectTransaction 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

ParamType
tourStopRecordTourStopFormType
childRecord
batchWriteBatch | 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

ParamTypeDescription
summaryobject
summary.refPathstringonly "required" field
batchobjectTransaction 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

ParamType
tourStopTourStopType
tourStop.Idstring
tourStop.refPathstring
ticketsnumber

pushInventory(tourStop, tickets) ⇒ Promise

Kind: global function

ParamType
tourStopTourStopType
tourStop.Idstring
tourStop.refPathstring
ticketsnumber

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

ParamDescription
thisItemobject to create formated string from
thisFormatstring 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

ParamDescription
thisItemone of two objects being compared
anotherItemthe other of two objects being compared
sortstring 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

ParamTypeDescription
argsanyunbounded list of arguments

refPathToBaseRecord(refPath)

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

Kind: global function

ParamTypeDescription
refPathstring"/" separated document path reference

bound(value, lowerBound, upperBound) ⇒ number

clips value to given bounds

Kind: global function

ParamType
valuenumber
lowerBoundnumber
upperBoundnumber

adds a new venue record to the database(venue, batch) ⇒ Promise

Kind: global function

ParamTypeDescription
venueVenueTyperecord to commit
batchWriteBatch | Transactionbatching 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

ParamTypeDescription
promptstringUsed to query for matching Artists
limitstring | numberUsed 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

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

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)


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

updatePledgeTicket(pledgeTicket) ⇒ Promise(void)

updates an existing pledgeTicket

Kind: global function

ParamTypeDescription
pledgeTicketpledgeTicketTypeupdated pledgeTicket

deletePledgeTicket(pledgeTicket) ⇒ Promise(void)

deletes a pledgeTicket. Removed from summary in background

Kind: global function

ParamTypeDescription
pledgeTicketpledgeTicketTypeupdated pledgeTicket

serverCheckingIn(fullCheckin) ⇒ Promise.<T>

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

Kind: global function

ParamType
fullCheckinRecordObject

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

ParamType
pledgeTicketRecordObject
pledgeTicket.refPathstring
pledgeTicket.checkinsobject
checkInRecordObject

fetchTourStopPledgeSummary(tourStop) ⇒ PledgeSummary

Kind: global function
Returns: PledgeSummary - //count of tickets, sum of amounts

ParamType
tourStopTourStopType

Properties

NameType
PledgeSummary.ticketsnumber
PledgeSummary.dollarsnumber

summarizePledgeTickets(pledgeTickets) ⇒ fanSummary

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

Kind: global function

ParamType
pledgeTicketsPledgeTicketArray

fetchFansTourStopPledgeSummary(fan, tourStop) ⇒ fanSummary

Kind: global function
Returns: fanSummary - fanSummary

ParamTypeDescription
fanPeopleFormTypefan record
tourStopTourStopFormTypetourStop record

fetchFansPledgeSummary(fan) ⇒ fanSummaryArray


Kind: global function
Returns: fanSummaryArray - fanSummary

ParamTypeDescription
fanPersonObjectfan record

fillPledgeTicket(pledgeTicket) ⇒ pledgeTicketType

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

Kind: global function

ParamType
pledgeTicketpledgeTicketType

describePledgeTicket(pledgeTicket) ⇒ string

Creates a string describing a Tour Stop

Kind: global function

ParamType
pledgeTicketpledgeTicketType

markPledgeTicket(pledgeTicket, label)

Changes the paidQ label on a pledgeTicket

Kind: global function

ParamType
pledgeTicketpledgeTicketType
labelstring

AddressType : object

Kind: global typedef
Properties

NameTypeDescription
address_line_1string
address_line_2string
citystring
regionstringselected from a list of supported Cities/Regions
statestring
zipzip
mapLinkmaplinklink to Google map location

maplink : object

Kind: global typedef
Properties

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

ArtistFormType : object

Kind: global typedef
Properties

NameTypeDescription
Idstringpresent if fetch from database
namestringname of Artist/Act
imagestringstring URL
bannerstringstring URL
biostringbiography of Artist/Act
descriptionstringdescription of Artist/Act
genresGenreFormTypearray of Genre objects describing Artist/Act
skillsSkillFormTypearray of skill (instrument) objects describing Artist/Act
lineupArtistFormTypearray of Artist profiles of members
websitestringstring URL to main Artist/Act website
social_linksstringarray of string URL to additional Artist/Act web properies
regionstringa string representing to Artist/Act home region SELECTED FROM list of regions
colorstringHTML/CSS color string or name - general color of profile/display
borderColorstringHTML/CSS color string or name - general color of profile/display borders
textColorstringHTML/CSS color string or name - general color of profile/display text

bandMember : object

Kind: global typedef
Properties

NameType
namestring
imageURL
skillsstring

bookingOffer : object

Kind: global typedef
Properties

NameTypeDescription
venueobjectdenormalized booking Venue info
venue.IdstringId of the booking venue
venue.capacitynumber
venue.namestring
venue.regionstringredundant, but allows collectionGroup listeners
venue.bookingStatusVENUE_BOOKING_STATUS
artistobjectdenormalized booking artist info
artist.namestring
artist.bookingStatusARTIST_BOOKING_STATUS
ticketobject
ticket.sharenumber
ticket.typeSHARE_TYPES
ticket.limitnumber
houseobject
house.sharenumber
house.typeSHARE_TYPES
house.limitnumber
datestring
timestring
time.Startstring
time.Durationstring
publishedobject
Qbooleanpublished flag
stringdetails

BusinessDefault : Record

Kind: global typedef
Properties

NameTypeDescription
business_emailstringmust be filled in to make profile public
business_contactobject
business_contact.Idstring
business_contact.first_namestring
business_contact.last_namestring
business_telstring
business_addressAddressType
mailing_addressAddressType
billing_addressAddressType

ChainType : WriteBatch | Transaction | void

Kind: global typedef

CityManagerType : object

Kind: global typedef
Properties

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

CityManagerDataDefault : Record

Kind: global typedef
Properties

NameTypeDescription
business_emailstringmust be filled in to make profile public
business_contactobject
business_contact.Idstring
business_contact.first_namestring
business_contact.last_namestring
business_contact.telstring
business_addressAddressType

FavoriteDefinition : Record

Kind: global typedef
Properties

NameTypeDescription
IdstringId of favorited Artist or Venue
typestringtype flag
namestringname of favorite

FavoriteEntryDefinition : Record

Kind: global typedef
Properties

NameTypeDescription
IdstringId of favorited Artist or Venue

FavoriteEntryDefinitionArray : FavoriteEntryDefinition

Kind: global typedef

FavoriteListDefinition : Record

Kind: global typedef
Properties

NameTypeDescription
Idstringmatches Id of User/Fan
typestringtype flag
listFavoriteEntryDefinitionArray

MCCArray : object

Kind: global typedef
Properties

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

ArtistFormArray : ArtistFormType

Kind: global typedef

PersonObject : object

Kind: global typedef
Properties

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

Role : object

Kind: global typedef
Properties

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

RoleArray : Array:Role

Kind: global typedef

AccessOffer : object

Kind: global typedef
Properties

NameTypeDescription
entityIdstringId of entity offering role
namestringoptional Name for proposed rol
rolestringtype of role offered
emailstringemail 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

NameTypeDescription
IdstringId of user given this role, when known
namestringfor display; name of person having access
rolestringrole assigned to this access record
emailstringemail of User to match to this access record

AccessesObject : object

Kind: global typedef
Properties

NameType
cityManagersAccess
venuesAccess
artistsAccess
accountsAccess

TourStopType : perkFormType

Kind: global typedef
Properties

NameTypeDescription
Idstringpresent if fetch from database
tourTourFormTypelocal copy of parent tour information
titlestringshort title for tour
imagestringstring URL
bannerstringstring URL
artistobject//For convenience - can be culled from hierarchy
artist.namestring- //For convenience - can be culled from hierarchy
descriptionstringdescription of tour
bookeddateStringnull when open; dateString when booked
dateStartdateStringoptional start date for tour
dateEnddateStringoptional end date of tour
timeStartdateStringoptional start date for tour
timeEnddateStringoptional end date of tour
perksperkFormArrayoptional array of perks. Not saved to database; populated from sub-collection

LogisticsType : object

Kind: global typedef
Properties

NameType
soundchecktimeString
loadIntimeString
loadOuttimeString

TourFormType : perkFormType

Kind: global typedef
Properties

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

VenueType : string

Kind: global typedef
Properties

NameTypeDescription
Idstringpresent if fetch from database
namestringname of Venue
imagestringstring URL
bannerstringstring URL
biostringbiography of Venue
descriptionstringdescription of Venue
genresGenreFormTypearray of Genre objects describing Venue
websitestringstring URL to main Venue website
social_linksstringArrayarray of string URL to additional Venue web properies
regionstringa string representing to Venue home region SELECTED FROM list of regions
corporatestringcorporate owner, if any
capacitynumber
business_contactobject
business_contact.first_namestring
business_contact.last_namestring
business_contact.telstring
business_addressAddressType
colorstringHTML/CSS color string or name - general color of profile/display
borderColorstringHTML/CSS color string or name - general color of profile/display borders
textColorstringHTML/CSS color string or name - general color of profile/display text

perkFormType : object

Kind: global typedef
Properties

NameType
Idstring
merchIDstring
namestring
descriptionstring

perkFormTypeArray : perkFormType

Kind: global typedef

perkFormArray : perkFormType

Kind: global typedef

pledgeLevelFormType : object

Kind: global typedef
Properties

NameType
amountnumber
perksperkFormArray

pledgeLevelFormArray : pledgeLevelFormType

Kind: global typedef

pledgeTicketType : checkinType

Kind: global typedef
Properties

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

checkinType : object

Kind: global typedef
Properties

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

fanSummary : perks

Kind: global typedef
Properties

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

.addTolineup(newBandmember, artist) ⇒ ArtistFormType

Kind: static function

ParamType
newBandmemberbandMember
newBandmember.Idstring
artistArtistFormType
artist.Idstring
artist.namestring
artist.emailstring

.removeFromLineup(newBandmember, artist) ⇒ ArtistFormType

Kind: static function

ParamType
newBandmemberbandMember
newBandmember.Idstring
artistArtistFormType
artist.Idstring
artist.namestring
artist.emailstring

.createCityManagerData(cityManager, manager, batch) ⇒ Promise

Kind: static function
Returns: Promise - WriteBatch, Transaction or Void

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

.updateUserAccess(accessItem, entity)

Kind: static function

ParamType
accessItemAccess
entityPersonObject

.removeUserAccess(accessItem, entity)

Kind: static function

ParamType
accessItemAccess
entityPersonObject

.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

ParamType
accessItemAccess

.unnormalizeAccess(accessItem)

Kind: static function

ParamType
accessItemAccess

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

Kind: static function

ParamTypeDescription
pledgeTicketpledgeTicketTypepledgeticket to trace tree from
batchTransactionoptional batch chain object

© 2020-2023 Tracy Hall

0.6.10

1 year ago

0.6.10-beta.0

1 year ago

0.6.11

1 year ago

0.6.10-beta.1

1 year ago

0.6.10-beta.2

1 year ago

0.6.12-beta.0

1 year ago

0.4.1-beta.7

1 year ago

0.4.1-beta.6

1 year ago

0.6.7

1 year ago

0.4.1-beta.5

1 year ago

0.6.6

1 year ago

0.4.1-beta.4

1 year ago

0.6.9

1 year ago

0.4.1-beta.3

1 year ago

0.6.8

1 year ago

0.4.1-beta.2

1 year ago

0.4.1-beta.1

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.0.3-beta.18

1 year ago

0.0.3-beta.17

1 year ago

0.0.3-beta.16

1 year ago

0.0.3-beta.15

1 year ago

0.0.3-beta.14

1 year ago

0.0.3-beta.13

1 year ago

0.0.3-beta.12

1 year ago

0.0.3-beta.11

1 year ago

0.0.3-beta.10

1 year ago

0.0.3-beta.9

1 year ago

0.0.3-beta.8

1 year ago

0.0.3-beta.7

1 year ago

0.0.3-beta.6

1 year ago

0.0.3-beta.5

1 year ago

0.0.3-beta.4

1 year ago

0.0.3-beta.2

1 year ago

0.0.3-beta.1

1 year ago

0.0.3-beta.0

1 year ago

0.0.2

1 year ago