0.1.0-beta.3 • Published 1 year ago

@leaddreamer/pricinglogic v0.1.0-beta.3

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

view on
npm

@leaddreamer/ESBusiness

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

Modules

ESBusiness

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

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

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

Kind: static method of ESBusiness

ParamTypeDescription
firebaseFirebase
configFirebaseConfigObjectFirebase Admin object
thisLoggercallback

Example

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

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

ESBusiness~FirebaseConfigObject : object

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

Kind: inner typedef of ESBusiness
Properties

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

PricingLogic

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

Commodities

Typedefs, constants, support functions and database operations related to Commodity Matrials users

Commodities.createCommodity ⇒ Promise.Commodity

Kind: static constant of Commodities

ParamTypeDescription
commodityCommodityminimal record of user account
personPersonminimal record of person this commodity belongs to (if any)

Commodities.deleteCommodity(commodity, person) ⇒ Promise.<void>

Kind: static method of Commodities

ParamTypeDescription
commodityCommodityDefault
personPersonminimal record of person this commodity belongs to (if any)

Commodities.deleteCommodityById(commodity, person) ⇒ Promise.<void>

Kind: static method of Commodities

ParamTypeDescription
commodityCommodityDefaultminimal record of user account
commodity.Idstringrecord Id of account
personPersonminimal record of person this commodity belongs to (if any)

Commodities.updateCommodityByID(commodity, person) ⇒ promise.Commodity

writes record back to database. Assumes only Id is valid

Kind: static method of Commodities
Returns: promise.Commodity - a copy of the data written

ParamTypeDescription
commodityCommoditya partially-populated commodity record for updates
personPersonminimal record of person this commodity belongs to (if any)

Commodities.updateCommodity(commodity, person) ⇒ promise.Commodity

writes record back to database. Assumes only Id is valid

Kind: static method of Commodities
Returns: promise.Commodity - a copy of the data written

ParamTypeDescription
commodityCommoditya partially-populated commodity record for updates
personPersonminimal record of person this commodity belongs to (if any)

Commodities.knownCommodity(Id, person) ⇒ Promise.boolean

Checks if this is a known Commodity Id

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

ParamTypeDescription
IdstringId value to check
personPersonminimal record of person this commodity belongs to (if any)

Commodities.fetchCommodities(person) ⇒ Array.Commodity

Fetches ALL Commodity records. Not very useful

Kind: static method of Commodities

ParamTypeDescription
personPersonminimal record of person this commodity belongs to (if any)

Commodities.fetchCommoditiesPaginated(limit, person) ⇒ PaginatedFetch

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

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

ParamTypeDescription
limitnumber
personPersonminimal record of person this commodity belongs to (if any)

Commodities.fetchCommodity(commodityId, person) ⇒ Promise.Commodity

Fetches a single Commodity record by Id

Kind: static method of Commodities

ParamTypeDescription
commodityIdstring
personPersonminimal record of person this commodity belongs to (if any)

Commodities.fetchCommodityName(commodityId, person) ⇒ Promise.string

Fetches and returns the summarized name from a Commodity record

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

ParamTypeDescription
commodityIdstring
personPersonminimal record of person this commodity belongs to (if any)

Commodities.summarizeCommodity(commodity) ⇒ string

Returns a standardized formatted name string

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

ParamType
commodityCommodity

Commodities~CommodityDefault : Commodity

Kind: inner constant of Commodities
Default: {"Id":null,"refPath":null,"description":null,"unit":null,"rate":0,"HighValue":true,"image":null}
Read only: true

Commodities~CommodityDefaultForm : Commodity

Kind: inner constant of Commodities
Default: {"description":"text","unit":"lookup:units","rate":"number","HighValue":"boolean","image":"url"}
Read only: true

Commodities~Commodity : object

a record

Kind: inner typedef of Commodities
Properties

NameTypeDescription
IdstringId of document (redundant for convenience)
refPathstringif from database, full path to document
descriptionstringdescription, e.g. "Wire, Silver, Sterling, 20ga"
unitstringusage/measurement unit (for unit conversion)
ratenumberthe per unit cost of this commodity
HighValuebooleanboolean flag to indicate "High Value" (lower markup) commodities
imageurla reference image for the commodity

Commodities~PaginatedFetch : object

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

Kind: inner typedef of Commodities
Properties

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

LineItems

Typedefs, constants, support functions and database operations related to LineItem Matrials users

LineItems.createLineItem ⇒ Promise.LineItem

Kind: static constant of LineItems

ParamTypeDescription
lineItemLineItemminimal record of user account
productProductminimal record of product this lineItem belongs to

LineItems.deleteLineItem(lineItem) ⇒ Promise.<void>

Kind: static method of LineItems

ParamType
lineItemLineItemDefault

LineItems.deleteLineItemById(lineItem, minimal) ⇒ Promise.<void>

Kind: static method of LineItems

ParamTypeDescription
lineItemLineItemDefaultminimal record of lineItem in question
lineItem.Idstringrecord Id of account
minimalProductrecord of product this lineItem belongs to

LineItems.updateLineItemByID(lineItem, product) ⇒ promise.LineItem

writes record back to database. Assumes only Id is valid

Kind: static method of LineItems
Returns: promise.LineItem - a copy of the data written

ParamTypeDescription
lineItemLineItema minimal lineItem record for updates
productProductminimal record of product this lineItem belongs to

LineItems.updateLineItem(lineItem, product) ⇒ promise.LineItem

writes record back to database. Assumes only Id is valid

Kind: static method of LineItems
Returns: promise.LineItem - a copy of the data written

ParamTypeDescription
lineItemLineItema partially-populated lineItem record for updates
productProductminimal record of product this lineItem belongs to

LineItems.knownLineItem(Id, product) ⇒ Promise.boolean

Checks if this is a known LineItem Id

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

ParamTypeDescription
IdstringId value to check
productProductminimal record of product this lineItem belongs to

LineItems.fetchLineItems() ⇒ Array.LineItem

Fetches ALL LineItem records. Not very useful

Kind: static method of LineItems

LineItems.fetchProductLineItems(product, stage) ⇒ Array.LineItem

Fetches ALL LineItem records for a specific product. Not very useful

Kind: static method of LineItems

ParamTypeDescription
productProductminimal record of product this lineItem belongs to
stageStageoptional stage selection, to get a subset of the line items

LineItems.paginateProductLineItems(product, stage, limit) ⇒ PaginatedFetch

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

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

ParamTypeDescription
productProduct
stageStageoptional stage selection, to get a subset of the line items
limitnumber

LineItems.fetchLineItem(lineItemId, product) ⇒ Promise.LineItem

Fetches a single LineItem record by Id

Kind: static method of LineItems

ParamTypeDescription
lineItemIdstring
productProductminimal record of product this lineItem belongs to

LineItems.fetchLineItemName(lineItemId, product) ⇒ Promise.string

Fetches and returns the summarized name from a LineItem record

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

ParamTypeDescription
lineItemIdstring
productProductminimal record of product this lineItem belongs to

LineItems.summarizeLineItem(lineItem) ⇒ string

Returns a standardized formatted name string

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

ParamType
lineItemLineItem

LineItems~LineItemDefault : LineItem

Kind: inner constant of LineItems
Default: {"Id":null,"refPath":null,"stage":"fabrication","commodity":null,"description":null,"unit":null,"rate":0,"amount":0,"HighValue":true,"image":null}
Read only: true

LineItems~LineItemDefaultForm : LineItem

Kind: inner constant of LineItems
Default: {"product":"lookup","stage":"lookup","commodity":"lookupLink","description":"text","unit":"lookup:units","rate":"number","amount":"number","HighValue":"boolean","image":"url"}
Read only: true

LineItems~LineItem : object

a record

Kind: inner typedef of LineItems
Properties

NameTypeDescription
IdstringId of document (redundant for convenience)
refPathstringif from database, full path to document
stagestring"fabrication", "wholesale", or other to be defined
commoditynull | stringId of a commodity item/material (optional)
descriptionstring | nulldescription, e.g. "Wire, Silver, Sterling, 20ga"
unitstring | nullusage/measurement unit (for unit conversion)
ratenumberthe per unit cost of this lineItem
amountnumberamount of material/item useed
HighValuebooleanboolean flag to indicate "High Value" (lower markup) commodities
timestampdatetimeinitial time of creation for sorting
imageurl | nulla reference image for the lineItem

LineItems~PaginatedFetch : object

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

Kind: inner typedef of LineItems
Properties

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

Payment

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

Payment.ERROR_TYPES : Object

Kind: static constant of Payment

Payment.PaymentDefault : PaymentData

Kind: static constant of Payment

Payment.paymentDescriptor : PaymentDescriptorType

Kind: static constant of Payment

Payment.receiptDefault : ReceiptType

Kind: static constant of Payment

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

Creates the Organization Payment information document

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

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

Payment.savePaymentData(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 PaymentData COMES FROM payement processor, and should INCLUDE the record Id and refPath

Kind: static method of Payment

ParamType
paymentDataPaymentDataRecord

Payment.fetchPayment(account, paymentData)

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

Kind: static method of Payment

ParamType
accountAccountType
paymentDataPromise.PaymentData

Payment.fetchPaymentByPerson(accountId, type, paymentData)

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

Kind: static method of Payment

ParamType
accountIdstring
typestring
paymentDataPromise.PaymentData

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

Adds a specific paymentDescriptor to an account payment data

Kind: static method of Payment

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

Payment.savePaymentDescriptor(descriptor) ⇒ Promise.PaymentDescriptorType

Saves a modified paymentDescriptor back to the database

Kind: static method of Payment

ParamType
descriptorPaymentDescriptorType
descriptor.Idstring
descriptor.refPathstring

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

Removes a paymentDescriptor from an account's paymentData

Kind: static method of Payment

ParamType
accountAccountType
descriptorPaymentDescriptorType

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

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

Kind: static method of Payment

ParamType
accountAccountType
account.refPathstring

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

fetch the front-end list of paymentDescriptors

Kind: static method of Payment

ParamType
accountAccountType
account.Idstring
account.refPathstring

Payment.fetchLatestPDSummary(account) ⇒ Promise.PaymentDescriptorType

Kind: static method of Payment

ParamType
accountAccountType
account.Idstring
account.refPathstring

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

retreives a PD, given the account Id and Type

Kind: static method of Payment

ParamType
accountAccountType
fingerprintstring

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

retreives a PD, given the account Id and Type

Kind: static method of Payment

ParamType
accountIdstring
typestring
fingerprintstring

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

Copies a PDSummary tobe the new default (convenience function)

Kind: static method of Payment

ParamType
accountAccountType
PDSummaryPDSummary

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

Savess a Receipt to an account

Kind: static method of Payment

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

Payment.updateReceipt(receipt) ⇒ Promise.ReceiptType

Updates a (changed?) Receipt record

Kind: static method of Payment

ParamType
receiptReceiptType

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

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

Kind: static method of Payment

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

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

Fetches an array of receipts in any particular month by monthStampt

Kind: static method of Payment

ParamType
accountAccountObject
monthStampdateString

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

Saves a receipt by a child record reference

Kind: static method of Payment

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

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

Fetches receipts based on a filter set

Kind: static method of Payment

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

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

Kind: static method of Payment

ParamType
accountAccountObject
account.refPathstring

Payment.fetchPledgeTicketReceipt(pledgeTicket) ⇒ Promise.ReceiptType

Fetches the receipt for a pledgeTicket

Kind: static method of Payment

ParamType
pledgeTicketPledgeTicket

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

Changes the paidQ label on a receipt associated with a pledgeTicket

Kind: static method of Payment

ParamType
pledgeTicketpledgeTicketType
labelstring

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

Changes the paidQ label on a receipt associated with a pledgeTicket

Kind: static method of Payment

ParamType
receiptreceiptType
labelstring

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

Kind: inner method of Payment

ParamType
accountAccountObject
account.refPathstring
receiptIdstring

Payment~PaymentData : object

Kind: inner typedef of Payment
Properties

NameType
Idstring
payment_gatewaystring
statusstring

Payment~PaymentDescriptorType : object

Kind: inner typedef of Payment
Properties

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

Payment~PDSummary : object

Kind: inner typedef of Payment
Properties

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

Payment~ReceiptType : object

Kind: inner typedef of Payment
Properties

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

Payment~AccountObject : OrganizationType | PersonObject

Kind: inner typedef of Payment

People

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

People.createPerson ⇒ Promise.PersonObject

Kind: static constant of People

ParamTypeDescription
personPersonObjectminimal record of user account

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

Kind: static method of People

ParamType
personPersonObject

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

Kind: static method of People

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

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

Builds a Person record from the authentication "user" data

Kind: static method of People

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

People.updatePersonByID(person) ⇒ promise.PeopleObject

writes record back to database. Assumes only Id is valid

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

ParamTypeDescription
personPeopleObjecta partially-populated people record for updates

People.updatePerson(person) ⇒ promise.PeopleObject

writes record back to database. Assumes only Id is valid

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

ParamTypeDescription
personPeopleObjecta partially-populated people record for updates

People.knownPerson(Id) ⇒ Promise.boolean

Checks if this is a known PersonObject Id

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

ParamTypeDescription
IdstringId value to check

People.fetchPeople() ⇒ Array.PeopleObject

Fecthes ALL people records. Not very useful

Kind: static method of People

People.fetchPeoplePaginated(limit) ⇒ PaginatedFetch

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

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

ParamType
limitnumber

People.fetchAnonymousPaginated(limit) ⇒ PaginatedFetch

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

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

ParamType
limitnumber

People.fetchPerson(personId) ⇒ Promise.PeopleObject

Fetches a single PeopleObject record by Id

Kind: static method of People

ParamType
personIdstring

People.fetchPersonName(personId) ⇒ Promise.string

Fetches and returns the summarized name from a PeopleObject record

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

ParamType
personIdstring

People.fetchPersonEmail(personId) ⇒ Promise.string

Fetches and returns the email from a PeopleObject record

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

ParamType
personIdstring

People.fetchPersonPaymentById(personId) ⇒ Promise.PaymentData

Fetches the PaymentRecord for a person using just the ID

Kind: static method of People

ParamType
personIdstring

People.fetchUserByEmail(email) ⇒ Promise.PeopleObject

Fetch a People record by their email

Kind: static method of People

ParamType
emailstring

People.fetchFullPerson(personIdentifier) ⇒ Promise.PeopleObject

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

Kind: static method of People

ParamType
personIdentifierstring | PersonObject
personIdentifier.Idstring

People.summarizePerson(person) ⇒ string

Returns a standardized formatted name string

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

ParamType
personPeopleObject

People.fetchPersonFromChild(child) ⇒ Promise.PeopleObject

Fetches a PersonObject from any child record in any branch

Kind: static method of People

ParamType
childRecordDocument

People.personFromId(personId) ⇒ PeopleObject

builds a minimal PeopleObject from an Id

Kind: static method of People

ParamType
personIdstring

People~PeopleDefault : PersonObject

Kind: inner constant of People
Default: {"Id":null,"refPath":null,"name":null,"email":null,"tel":null,"isAnonymous":true,"payment_method":null,"admin_status":null}
Read only: true

People~PeopleDefaultForm : PersonObject

Kind: inner constant of People
Default: {"name":"text","email":"email","tel":"tel"}
Read only: true

People~PersonObject : object

Kind: inner typedef of People
Properties

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

People~PaginatedFetch : object

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

Kind: inner typedef of People
Properties

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

Product

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

Product.saveProduct(person) ⇒ Promise.<void>

Saves a Product object to the database

Kind: static method of Product

ParamTypeDescription
personPersonminimal record of person this commodity belongs to (if any)

Properties

NameType
productProduct

Product~ProductDefault : Product

Kind: inner constant of Product
Default: {"Id":null,"refPath":null,"name":""}
Read only: true

Product~ProductDefaultForm : Product

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

Product~Product : object

a record

Kind: inner typedef of Product
Properties

NameTypeDescription
IdstringId of document (redundant for convenience)
refPathstringif from database, full path to document
namenumbername for the Product

Stages

Typedefs, constants, support functions and database operations related to product creation stages users

Stages.saveStage(parent) ⇒ Promise.<void>

Saves a default Stage Settings object to the database

Kind: static method of Stages

ParamTypeDescription
parentPerson | Productminimal record of person this commodity belongs to (if any)

Properties

NameType
stageStage

Stages~StageDefault : Stage

Kind: inner constant of Stages
Default: {"Id":null,"refPath":null,"base":2.5,"highValue":1.5,"overhead":5,"rate":20,"unit":"hour","hours":0,"minutes":0,"stage":"fabrication"}
Read only: true

Stages~StageDefaultForm : Stage

Kind: inner constant of Stages
Default: {"base":"number","highValue":"number","overhead":"number","rate":"number","unit":"lookup","hours":"number","minutes":"number","stage":"lookup"}
Read only: true

Stages~Stage : object

a record

Kind: inner typedef of Stages
Properties

NameTypeDescription
IdstringId of document (redundant for convenience)
refPathstringif from database, full path to document
basenumberMultiplier/Markup from this stage to the next
highValuenumberMultiplier/Markup for hgih value materials/items from this stage to the next
overheadnumberunit charge for business overhead
ratenumberunit charge for direct labor expenses
unitstringlookup unit of measure for overhead and rate
hoursnumberactual hours of labor at this stage
minutesnumberactual minutes of labor at this stage
stagenumberlookup name of corresponding production stage

Boilerplate

Shared constants and symbols

Boilerplate.recordByIdAndType ⇒ AccountType

creates and returns a minimal record from an Id and type

Kind: static constant of Boilerplate

ParamType
Idstring
Typestring

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

0.3.0-beta.4

1 year ago

0.3.0-beta.3

1 year ago

0.3.0-beta.2

1 year ago

0.3.0-beta.1

1 year ago

0.3.0-beta.0

1 year ago

0.2.0-beta.30

1 year ago

0.2.0-beta.26

1 year ago

0.2.0-beta.28

1 year ago

0.2.0-beta.29

1 year ago

0.2.0-beta.24

1 year ago

0.2.0-beta.25

1 year ago

0.2.0-beta.23

1 year ago

0.2.0-beta.22

1 year ago

0.2.0-beta.21

1 year ago

0.2.0-beta.20

1 year ago

0.2.0-beta.18

1 year ago

0.2.0-beta.19

1 year ago

0.2.0-beta.17

1 year ago

0.2.0-beta.16

1 year ago

0.2.0-beta.12

1 year ago

0.2.0-beta.13

1 year ago

0.2.0-beta.14

1 year ago

0.2.0-beta.15

1 year ago

0.2.0-beta.10

1 year ago

0.2.0-beta.11

1 year ago

0.2.0-beta.6

1 year ago

0.2.0-beta.5

1 year ago

0.2.0-beta.9

1 year ago

0.2.0-beta.8

1 year ago

0.2.0-beta.7

1 year ago

0.2.0-beta.4

1 year ago

0.2.0-beta.2

1 year ago

0.2.0-beta.1

1 year ago

0.1.0-beta.30

1 year ago

0.1.0-beta.18

1 year ago

0.1.0-beta.19

1 year ago

0.1.0-beta.21

1 year ago

0.1.0-beta.20

1 year ago

0.1.0-beta.23

1 year ago

0.1.0-beta.22

1 year ago

0.1.0-beta.29

1 year ago

0.1.0-beta.28

1 year ago

0.1.0-beta.25

1 year ago

0.1.0-beta.24

1 year ago

0.1.0-beta.27

1 year ago

0.1.0-beta.26

1 year ago

0.1.0-beta.17

1 year ago

0.1.0-beta.16

1 year ago

0.1.0-beta.15

1 year ago

0.1.0-beta.12

1 year ago

0.1.0-beta.11

1 year ago

0.1.0-beta.10

1 year ago

0.1.0-beta.9

1 year ago

0.1.0-beta.7

1 year ago

0.1.0-beta.6

1 year ago

0.1.0-beta.8

1 year ago

0.1.0-beta.5

1 year ago

0.1.0-beta.4

2 years ago

0.1.0-beta.3

2 years ago