@happyvertical/smrt-planner 0.0.2 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -8
- package/app/404.html +42 -49
- package/app/_app/immutable/assets/0.DUow1OzM.css +1 -0
- package/app/_app/immutable/assets/10.CdYxvH4G.css +1 -0
- package/app/_app/immutable/assets/11.nOT5Z4Fv.css +1 -0
- package/app/_app/immutable/assets/12.F7A7zP4J.css +1 -0
- package/app/_app/immutable/assets/13.JoySu8W5.css +1 -0
- package/app/_app/immutable/assets/14.nsp62-4b.css +1 -0
- package/app/_app/immutable/assets/2.CbPiqdz5.css +1 -0
- package/app/_app/immutable/assets/3.D518dbB5.css +1 -0
- package/app/_app/immutable/assets/4.B3vt1gMJ.css +1 -0
- package/app/_app/immutable/assets/AiSetup.4fXjMpTZ.css +1 -0
- package/app/_app/immutable/assets/AppShell.DOvXbUZo.css +1 -0
- package/app/_app/immutable/assets/ConnectTools.DTleL8YA.css +1 -0
- package/app/_app/immutable/assets/FieldMapForm.C8SZ3t4N.css +1 -0
- package/app/_app/immutable/assets/ModelPage.DbXvPbHE.css +1 -0
- package/app/_app/immutable/assets/SectionActions.BE1CPmxk.css +1 -0
- package/app/_app/immutable/assets/SectionIcons.BGFcFuOf.css +1 -0
- package/app/_app/immutable/assets/SegmentedControl.BkyuoCEJ.css +1 -0
- package/app/_app/immutable/assets/app.eM0k786r.css +1 -0
- package/app/_app/immutable/assets/currency-metadata.DDyu8_ub.css +1 -0
- package/app/_app/immutable/assets/data.bGq43K60.css +1 -0
- package/app/_app/immutable/assets/feedback.xBpOq9ef.css +1 -0
- package/app/_app/immutable/assets/forms.B3_bbIMe.css +1 -0
- package/app/_app/immutable/assets/labels.BiuUjqHs.css +1 -0
- package/app/_app/immutable/assets/percent.DbwvwMhf.css +1 -0
- package/app/_app/immutable/assets/state.CJipYvSU.css +1 -0
- package/app/_app/immutable/assets/webmcp-ui-context.BnR-DUfO.css +1 -0
- package/app/_app/immutable/assets/workspace.B5Xq-5pJ.css +1 -0
- package/app/_app/immutable/chunks/1ElZWh_R.js +10 -0
- package/app/_app/immutable/chunks/B-CpwO-j.js +1 -0
- package/app/_app/immutable/chunks/{BnRri03M.js → B7KB-rhH.js} +1 -1
- package/app/_app/immutable/chunks/BUhghcIm.js +1 -0
- package/app/_app/immutable/chunks/BV3NwM01.js +1 -0
- package/app/_app/immutable/chunks/BZVZZ6VY.js +1 -0
- package/app/_app/immutable/chunks/Ba1g71Sq.js +1 -0
- package/app/_app/immutable/chunks/BeJD7_hy.js +1 -0
- package/app/_app/immutable/chunks/BiO_bqNH.js +2 -0
- package/app/_app/immutable/chunks/{DkR8_Ws6.js → BqBuCJB_.js} +2 -2
- package/app/_app/immutable/chunks/BsJoBmTA.js +1 -0
- package/app/_app/immutable/chunks/Bxbz6_Mb.js +1 -0
- package/app/_app/immutable/chunks/Bz5uCkjV.js +2 -0
- package/app/_app/immutable/chunks/BzMfoxBk.js +1 -0
- package/app/_app/immutable/chunks/CF6zSg_o.js +2 -0
- package/app/_app/immutable/chunks/CFL0B6dk.js +1 -0
- package/app/_app/immutable/chunks/CRu55ZTy.js +4 -0
- package/app/_app/immutable/chunks/{CyUMm_Wp.js → Cv2EcCr0.js} +1 -1
- package/app/_app/immutable/chunks/D-3Ri0zJ.js +1 -0
- package/app/_app/immutable/chunks/{BWPhGFHl.js → D0FW0z6R.js} +1 -1
- package/app/_app/immutable/chunks/D7d5GssF.js +1 -0
- package/app/_app/immutable/chunks/DCsSRJsN.js +1 -0
- package/app/_app/immutable/chunks/DGqV6_5v.js +1 -0
- package/app/_app/immutable/chunks/DNSRTkf6.js +11 -0
- package/app/_app/immutable/chunks/DQNX_XPY.js +1 -0
- package/app/_app/immutable/chunks/DSyIMN4M.js +1 -0
- package/app/_app/immutable/chunks/DUTtmM1Y.js +1 -0
- package/app/_app/immutable/chunks/DYuawOB3.js +980 -0
- package/app/_app/immutable/chunks/DfCLzLZc.js +1 -0
- package/app/_app/immutable/chunks/Dh5fne6n.js +1 -0
- package/app/_app/immutable/chunks/LruoUXGC.js +1 -0
- package/app/_app/immutable/chunks/ZLqixH7j.js +9 -0
- package/app/_app/immutable/chunks/_pYwB_Eb.js +4 -0
- package/app/_app/immutable/chunks/aoU3lIZI.js +1 -0
- package/app/_app/immutable/chunks/c57ZlocB.js +24 -0
- package/app/_app/immutable/chunks/h8ppmjOm.js +1 -0
- package/app/_app/immutable/chunks/jhcy_jeO.js +1 -0
- package/app/_app/immutable/chunks/vNEnXNLV.js +3 -0
- package/app/_app/immutable/chunks/vwntRvfV.js +1 -0
- package/app/_app/immutable/entry/app.D5LoTsNA.js +2 -0
- package/app/_app/immutable/entry/start.Sb_s0NGC.js +1 -0
- package/app/_app/immutable/nodes/0.Cuo9-RQc.js +9 -0
- package/app/_app/immutable/nodes/1.BW8Ar5T3.js +1 -0
- package/app/_app/immutable/nodes/10.CpLYjN7r.js +3 -0
- package/app/_app/immutable/nodes/11.BMPKD4M3.js +1 -0
- package/app/_app/immutable/nodes/12.WYpy0AHE.js +4 -0
- package/app/_app/immutable/nodes/13.BYo05X9B.js +1 -0
- package/app/_app/immutable/nodes/14.DN0MT3KB.js +1 -0
- package/app/_app/immutable/nodes/2.DM6k_pqu.js +24 -0
- package/app/_app/immutable/nodes/3.YgEwJ-vF.js +1 -0
- package/app/_app/immutable/nodes/4.A3Y6Lax0.js +1 -0
- package/app/_app/immutable/nodes/5.D9Vd85hG.js +1 -0
- package/app/_app/immutable/nodes/6.C5c56bSW.js +1 -0
- package/app/_app/immutable/nodes/7.CDBMbYlD.js +1 -0
- package/app/_app/immutable/nodes/8.8olDkDou.js +1 -0
- package/app/_app/immutable/nodes/9.CWgx__8Z.js +1 -0
- package/app/_app/version.json +1 -1
- package/app/advanced-styles/index.html +84 -0
- package/app/ai/index.html +60 -52
- package/app/blueprint/index.html +46 -53
- package/app/cookbook/index.html +46 -53
- package/app/index.html +92 -64
- package/app/m/ads/AdDeliveryTier/index.html +52 -59
- package/app/m/ads/AdEvent/index.html +52 -59
- package/app/m/ads/AdFormat/index.html +52 -59
- package/app/m/ads/AdGroup/index.html +52 -59
- package/app/m/ads/AdVariation/index.html +52 -59
- package/app/m/analytics/AnalyticsDataStream/index.html +52 -59
- package/app/m/analytics/AnalyticsEvent/index.html +52 -59
- package/app/m/analytics/AnalyticsProperty/index.html +52 -59
- package/app/m/analytics/AnalyticsReport/index.html +52 -59
- package/app/m/approvals/ApprovalEvent/index.html +52 -59
- package/app/m/approvals/ApprovalPolicy/index.html +52 -59
- package/app/m/approvals/ApprovalRequest/index.html +52 -59
- package/app/m/assets/Asset/attachments/index.html +91 -0
- package/app/m/assets/Asset/index.html +52 -59
- package/app/m/assets/AssetAssociation/index.html +53 -60
- package/app/m/assets/AssetMetafield/index.html +52 -59
- package/app/m/assets/AssetStatus/index.html +52 -59
- package/app/m/assets/AssetType/index.html +52 -59
- package/app/m/assets/Folder/index.html +52 -59
- package/app/m/chat/AgentSession/index.html +52 -59
- package/app/m/chat/ChatMessage/index.html +53 -60
- package/app/m/chat/ChatParticipant/index.html +53 -60
- package/app/m/chat/ChatReaction/index.html +52 -59
- package/app/m/chat/ChatRoom/index.html +52 -59
- package/app/m/chat/ChatThread/index.html +53 -60
- package/app/m/chat/VoiceGatewayTurn/index.html +52 -59
- package/app/m/chat/VoiceSession/index.html +52 -59
- package/app/m/commerce/Agreement/index.html +52 -59
- package/app/m/commerce/Cart/index.html +52 -59
- package/app/m/commerce/Contract/index.html +52 -59
- package/app/m/commerce/ContractLineItem/index.html +53 -60
- package/app/m/commerce/Customer/index.html +52 -59
- package/app/m/commerce/DocumentTax/index.html +89 -0
- package/app/m/commerce/Estimate/index.html +52 -59
- package/app/m/commerce/Fulfillment/index.html +52 -59
- package/app/m/commerce/FulfillmentLineItem/index.html +53 -60
- package/app/m/commerce/Invoice/index.html +52 -59
- package/app/m/commerce/InvoiceLineItem/index.html +53 -60
- package/app/m/commerce/Lease/index.html +52 -59
- package/app/m/commerce/LicenseSale/index.html +52 -59
- package/app/m/commerce/Order/index.html +52 -59
- package/app/m/commerce/Payment/index.html +52 -59
- package/app/m/commerce/PaymentAllocation/index.html +53 -60
- package/app/m/commerce/PaymentInstrument/index.html +52 -59
- package/app/m/commerce/PaymentIntent/index.html +52 -59
- package/app/m/commerce/Payout/index.html +52 -59
- package/app/m/commerce/ProductionOrder/index.html +52 -59
- package/app/m/commerce/PurchaseContract/index.html +89 -0
- package/app/m/commerce/PurchaseOrder/index.html +52 -59
- package/app/m/commerce/SalesContract/index.html +89 -0
- package/app/m/commerce/SupplierQuote/index.html +89 -0
- package/app/m/commerce/TaxCode/index.html +89 -0
- package/app/m/commerce/TaxComponent/index.html +89 -0
- package/app/m/commerce/TaxSettings/index.html +89 -0
- package/app/m/commerce/TaxSummaryReport/index.html +89 -0
- package/app/m/commerce/Vendor/index.html +52 -59
- package/app/m/commerce/WholesaleOrder/index.html +52 -59
- package/app/m/content/Content/index.html +52 -59
- package/app/m/content/ContentContribution/index.html +52 -59
- package/app/m/content/ContentContributionAttachment/index.html +52 -59
- package/app/m/content/ContentContributionRevision/index.html +52 -59
- package/app/m/content/ContentContributionType/index.html +52 -59
- package/app/m/content/ContentContributor/index.html +52 -59
- package/app/m/content/ContentCorrection/index.html +52 -59
- package/app/m/content/ContentFeedSource/index.html +52 -59
- package/app/m/content/ContentGovernanceAssignment/index.html +52 -59
- package/app/m/content/ContentGovernancePolicy/index.html +52 -59
- package/app/m/content/ContentGovernanceProfile/index.html +52 -59
- package/app/m/content/ContentReference/index.html +52 -59
- package/app/m/content/ContentReview/index.html +52 -59
- package/app/m/content/ContentVersion/index.html +52 -59
- package/app/m/events/Event/index.html +52 -59
- package/app/m/events/EventParticipant/index.html +53 -60
- package/app/m/events/EventSeries/index.html +52 -59
- package/app/m/events/EventType/index.html +52 -59
- package/app/m/expenses/Expense/index.html +89 -0
- package/app/m/facts/Fact/index.html +52 -59
- package/app/m/facts/FactContent/index.html +52 -59
- package/app/m/facts/FactEvidence/index.html +52 -59
- package/app/m/facts/FactSource/index.html +52 -59
- package/app/m/facts/FactSubject/index.html +52 -59
- package/app/m/facts/FactTag/index.html +52 -59
- package/app/m/fields/FieldPolicy/index.html +52 -59
- package/app/m/fields/FieldPolicySuggestion/index.html +52 -59
- package/app/m/fields/FieldUsageCounter/index.html +52 -59
- package/app/m/images/Image/index.html +52 -59
- package/app/m/inventory/InventoryLocation/index.html +52 -59
- package/app/m/inventory/StockLevel/index.html +52 -59
- package/app/m/inventory/StockMovement/index.html +52 -59
- package/app/m/ledgers/Account/index.html +52 -59
- package/app/m/ledgers/Journal/index.html +52 -59
- package/app/m/ledgers/JournalEntry/index.html +53 -60
- package/app/m/manufacturing/Assembly/index.html +52 -59
- package/app/m/manufacturing/BillOfMaterials/index.html +52 -59
- package/app/m/manufacturing/BomLine/index.html +52 -59
- package/app/m/manufacturing/Operation/index.html +52 -59
- package/app/m/manufacturing/ProductionRun/index.html +52 -59
- package/app/m/manufacturing/ProductionRunCompletion/index.html +52 -59
- package/app/m/manufacturing/RoutingStep/index.html +52 -59
- package/app/m/marketing/Campaign/index.html +52 -59
- package/app/m/marketing/CampaignChannel/index.html +52 -59
- package/app/m/marketing/CampaignMetricSnapshot/index.html +52 -59
- package/app/m/messages/Account/index.html +52 -59
- package/app/m/messages/Attachment/index.html +52 -59
- package/app/m/messages/Blacklist/index.html +52 -59
- package/app/m/messages/Email/failed-sends/index.html +54 -59
- package/app/m/messages/Email/index.html +52 -59
- package/app/m/messages/Email/mailbox/index.html +54 -59
- package/app/m/messages/EmailAccount/index.html +52 -59
- package/app/m/messages/EmailAttachment/index.html +89 -0
- package/app/m/messages/EmailFolder/index.html +52 -59
- package/app/m/messages/Message/index.html +52 -59
- package/app/m/messages/MessagingEndpoint/index.html +52 -59
- package/app/m/messages/PersonaMessageRoute/index.html +52 -59
- package/app/m/messages/SlackAccount/index.html +52 -59
- package/app/m/messages/SlackMessage/index.html +52 -59
- package/app/m/messages/TelegramAccount/index.html +52 -59
- package/app/m/messages/Tweet/index.html +52 -59
- package/app/m/messages/TwitterAccount/index.html +52 -59
- package/app/m/messages/Whitelist/index.html +52 -59
- package/app/m/messages/ZulipAccount/index.html +52 -59
- package/app/m/places/Place/index.html +52 -59
- package/app/m/places/PlaceType/index.html +52 -59
- package/app/m/products/Category/index.html +52 -59
- package/app/m/products/Material/index.html +52 -59
- package/app/m/products/Product/index.html +52 -59
- package/app/m/products/Product/ingredients/index.html +54 -59
- package/app/m/products/ProductVariant/index.html +53 -60
- package/app/m/products/Sku/index.html +53 -60
- package/app/m/profiles/ApiKey/index.html +52 -59
- package/app/m/profiles/Bot/index.html +52 -59
- package/app/m/profiles/MagicLinkToken/index.html +52 -59
- package/app/m/profiles/NostrIdentity/index.html +52 -59
- package/app/m/profiles/OidcIdentity/index.html +52 -59
- package/app/m/profiles/Organization/index.html +52 -59
- package/app/m/profiles/Person/index.html +52 -59
- package/app/m/profiles/Profile/index.html +52 -59
- package/app/m/profiles/ProfileMetadata/index.html +52 -59
- package/app/m/profiles/ProfileMetafield/index.html +52 -59
- package/app/m/profiles/ProfileRelationship/index.html +52 -59
- package/app/m/profiles/ProfileRelationshipTerm/index.html +52 -59
- package/app/m/profiles/ProfileRelationshipType/index.html +52 -59
- package/app/m/profiles/ProfileType/index.html +52 -59
- package/app/m/projects/Comment/index.html +53 -60
- package/app/m/projects/Issue/index.html +52 -59
- package/app/m/projects/Label/index.html +52 -59
- package/app/m/projects/Project/index.html +52 -59
- package/app/m/projects/ProjectIntegration/index.html +52 -59
- package/app/m/projects/PullRequest/index.html +52 -59
- package/app/m/projects/Repository/index.html +52 -59
- package/app/m/properties/Property/index.html +52 -59
- package/app/m/properties/Zone/index.html +52 -59
- package/app/m/reports/RuntimeReport/index.html +52 -59
- package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +52 -59
- package/app/m/reports/SmrtReportLock/index.html +52 -59
- package/app/m/reports/SmrtReportRefreshTask/index.html +52 -59
- package/app/m/reports/SmrtReportRun/index.html +52 -59
- package/app/m/reports/SmrtReportSchedule/index.html +52 -59
- package/app/m/reports/SmrtReportWatermark/index.html +52 -59
- package/app/m/sales/AttributionException/index.html +52 -59
- package/app/m/sales/AttributionPolicy/index.html +52 -59
- package/app/m/sales/Commission/index.html +52 -59
- package/app/m/sales/CommissionAdjustment/index.html +52 -59
- package/app/m/sales/CommissionPayout/index.html +52 -59
- package/app/m/sales/CommissionPlan/index.html +52 -59
- package/app/m/sales/Earner/index.html +52 -59
- package/app/m/sales/EarnerSourceAttribution/index.html +52 -59
- package/app/m/sales/EarningEvent/index.html +52 -59
- package/app/m/sales/ExecutedAgreement/index.html +52 -59
- package/app/m/sales/Lead/index.html +52 -59
- package/app/m/sales/Opportunity/index.html +52 -59
- package/app/m/sales/OpportunityConversion/index.html +52 -59
- package/app/m/sales/PipelineDefinition/index.html +52 -59
- package/app/m/sales/PipelineStage/index.html +53 -60
- package/app/m/sales/Referral/index.html +52 -59
- package/app/m/sales/ReferralAgreement/index.html +52 -59
- package/app/m/sales/ReferralLink/index.html +52 -59
- package/app/m/sales/ReferralProgram/index.html +52 -59
- package/app/m/sales/ReferralTermSnapshot/index.html +52 -59
- package/app/m/sales/ReferralTouch/index.html +52 -59
- package/app/m/sales/Referrer/index.html +52 -59
- package/app/m/sales/SalesActivity/index.html +52 -59
- package/app/m/sales/SalesRepresentative/index.html +52 -59
- package/app/m/sites/Site/index.html +52 -59
- package/app/m/sites/SiteAgentBinding/index.html +52 -59
- package/app/m/social/OAuthState/index.html +52 -59
- package/app/m/social/SocialAccount/index.html +52 -59
- package/app/m/social/SocialPost/index.html +52 -59
- package/app/m/social/SocialPostAnalyticsSnapshot/index.html +52 -59
- package/app/m/subscriptions/BillingAdjustment/index.html +52 -59
- package/app/m/subscriptions/ClientCharge/index.html +52 -59
- package/app/m/subscriptions/CreditGrant/index.html +52 -59
- package/app/m/subscriptions/PricingRule/index.html +52 -59
- package/app/m/subscriptions/RetailCharge/index.html +52 -59
- package/app/m/subscriptions/SpendingPolicy/index.html +52 -59
- package/app/m/subscriptions/SubscriptionPlan/index.html +52 -59
- package/app/m/subscriptions/TenantSubscription/index.html +52 -59
- package/app/m/subscriptions/TenantUsageMetric/index.html +52 -59
- package/app/m/support/ServiceTimeEntry/index.html +52 -59
- package/app/m/support/SupportAiRun/index.html +52 -59
- package/app/m/support/SupportAvailability/index.html +52 -59
- package/app/m/support/SupportCase/index.html +52 -59
- package/app/m/support/SupportCaseEvent/index.html +52 -59
- package/app/m/support/SupportChannelBinding/index.html +52 -59
- package/app/m/support/SupportCharge/index.html +52 -59
- package/app/m/support/SupportCompensation/index.html +52 -59
- package/app/m/support/SupportCompensationPlan/index.html +52 -59
- package/app/m/support/SupportEscalation/index.html +52 -59
- package/app/m/support/SupportInteraction/index.html +52 -59
- package/app/m/support/SupportPlan/index.html +52 -59
- package/app/m/support/SupportPolicy/index.html +52 -59
- package/app/m/support/SupportQualification/index.html +52 -59
- package/app/m/support/SupportServiceTarget/index.html +52 -59
- package/app/m/support/SupportSpecialist/index.html +52 -59
- package/app/m/support/SupportWorkLink/index.html +52 -59
- package/app/m/tags/Tag/index.html +52 -59
- package/app/m/tags/TagAlias/index.html +52 -59
- package/app/m/timesheets/AttendanceBreak/index.html +52 -59
- package/app/m/timesheets/AttendancePunch/index.html +52 -59
- package/app/m/timesheets/AttendanceSegment/index.html +89 -0
- package/app/m/timesheets/ServiceChargeSnapshot/index.html +52 -59
- package/app/m/timesheets/ServiceCompensationSnapshot/index.html +52 -59
- package/app/m/timesheets/ServiceTimeEntry/index.html +52 -59
- package/app/m/users/Group/index.html +52 -59
- package/app/m/users/GroupMember/index.html +52 -59
- package/app/m/users/GroupRole/index.html +52 -59
- package/app/m/users/Membership/index.html +53 -60
- package/app/m/users/MembershipOverride/index.html +52 -59
- package/app/m/users/Permission/index.html +52 -59
- package/app/m/users/Role/index.html +52 -59
- package/app/m/users/RolePermission/index.html +52 -59
- package/app/m/users/Session/index.html +52 -59
- package/app/m/users/Tenant/index.html +52 -59
- package/app/m/users/TenantIntegration/index.html +52 -59
- package/app/m/users/TenantPermissionOverride/index.html +52 -59
- package/app/m/users/User/index.html +52 -59
- package/app/m/video/Character/index.html +52 -59
- package/app/m/video/CharacterAsset/index.html +52 -59
- package/app/m/video/CompositeJob/index.html +52 -59
- package/app/m/video/Performer/index.html +52 -59
- package/app/m/video/PerformerAsset/index.html +52 -59
- package/app/m/video/Scene/index.html +52 -59
- package/app/m/video/SceneAsset/index.html +52 -59
- package/app/m/video/VideoComposition/index.html +52 -59
- package/app/m/video/VideoCompositionAsset/index.html +52 -59
- package/app/m/video/VideoSequence/index.html +52 -59
- package/app/m/video/VideoSequenceAsset/index.html +52 -59
- package/app/m/video/VideoShot/index.html +52 -59
- package/app/m/video/VideoShotAsset/index.html +52 -59
- package/app/m/video/VideoShotCharacter/index.html +52 -59
- package/app/m/video/VideoWorkflow/index.html +52 -59
- package/app/m/voice/VoiceOutput/index.html +52 -59
- package/app/m/voice/VoiceProfile/index.html +52 -59
- package/app/m/voice/VoiceSample/index.html +52 -59
- package/app/packages/ads/index.html +50 -57
- package/app/packages/analytics/index.html +50 -57
- package/app/packages/approvals/index.html +50 -57
- package/app/packages/assets/index.html +50 -57
- package/app/packages/chat/index.html +50 -57
- package/app/packages/comments/index.html +50 -57
- package/app/packages/commerce/index.html +50 -57
- package/app/packages/content/index.html +50 -57
- package/app/packages/events/index.html +50 -57
- package/app/packages/expenses/index.html +50 -57
- package/app/packages/facts/index.html +50 -57
- package/app/packages/fields/index.html +50 -57
- package/app/packages/human-resources/index.html +50 -57
- package/app/packages/images/index.html +50 -57
- package/app/packages/index.html +49 -55
- package/app/packages/ingestion/index.html +85 -0
- package/app/packages/inventory/index.html +50 -57
- package/app/packages/ledgers/index.html +50 -57
- package/app/packages/manufacturing/index.html +50 -57
- package/app/packages/marketing/index.html +50 -57
- package/app/packages/messages/index.html +50 -57
- package/app/packages/places/index.html +50 -57
- package/app/packages/preferences/index.html +50 -57
- package/app/packages/products/index.html +50 -57
- package/app/packages/profiles/index.html +50 -57
- package/app/packages/projects/index.html +50 -57
- package/app/packages/properties/index.html +50 -57
- package/app/packages/reports/index.html +50 -57
- package/app/packages/sales/index.html +50 -57
- package/app/packages/sites/index.html +50 -57
- package/app/packages/social/index.html +50 -57
- package/app/packages/subscriptions/index.html +50 -57
- package/app/packages/support/index.html +50 -57
- package/app/packages/tags/index.html +50 -57
- package/app/packages/timesheets/index.html +50 -57
- package/app/packages/users/index.html +50 -57
- package/app/packages/video/index.html +50 -57
- package/app/packages/voice/index.html +50 -57
- package/app/packages/webhooks/index.html +85 -0
- package/app/recipes/account-access/help/index.html +52 -57
- package/app/recipes/account-access/index.html +57 -59
- package/app/recipes/activity/help/index.html +52 -57
- package/app/recipes/activity/index.html +57 -59
- package/app/recipes/agreements/help/index.html +52 -57
- package/app/recipes/agreements/index.html +57 -59
- package/app/recipes/analytics.reports/help/index.html +52 -57
- package/app/recipes/analytics.reports/index.html +57 -59
- package/app/recipes/assets/help/index.html +52 -57
- package/app/recipes/assets/index.html +57 -59
- package/app/recipes/billing/help/index.html +52 -57
- package/app/recipes/billing/index.html +57 -59
- package/app/recipes/chat.assistant/help/index.html +52 -57
- package/app/recipes/chat.assistant/index.html +57 -59
- package/app/recipes/comments/help/index.html +52 -57
- package/app/recipes/comments/index.html +57 -59
- package/app/recipes/commerce.customers/help/index.html +52 -57
- package/app/recipes/commerce.customers/index.html +57 -59
- package/app/recipes/commerce.estimates/help/index.html +52 -57
- package/app/recipes/commerce.estimates/index.html +57 -59
- package/app/recipes/commerce.purchases/help/index.html +52 -57
- package/app/recipes/commerce.purchases/index.html +57 -59
- package/app/recipes/commerce.sales/help/index.html +52 -57
- package/app/recipes/commerce.sales/index.html +57 -59
- package/app/recipes/commerce.vendors/help/index.html +52 -57
- package/app/recipes/commerce.vendors/index.html +57 -59
- package/app/recipes/commerce.wholesale/help/index.html +52 -57
- package/app/recipes/commerce.wholesale/index.html +57 -59
- package/app/recipes/events.calendar/help/index.html +52 -57
- package/app/recipes/events.calendar/index.html +57 -59
- package/app/recipes/expenses.tracking/help/index.html +88 -0
- package/app/recipes/expenses.tracking/index.html +92 -0
- package/app/recipes/fields.form-customization/help/index.html +52 -57
- package/app/recipes/fields.form-customization/index.html +57 -59
- package/app/recipes/ingestion/help/index.html +88 -0
- package/app/recipes/ingestion/index.html +93 -0
- package/app/recipes/integrations/help/index.html +88 -0
- package/app/recipes/integrations/index.html +92 -0
- package/app/recipes/inventory.stock/help/index.html +52 -57
- package/app/recipes/inventory.stock/index.html +57 -59
- package/app/recipes/ledgers.bookkeeping/help/index.html +52 -57
- package/app/recipes/ledgers.bookkeeping/index.html +57 -59
- package/app/recipes/messages/help/index.html +52 -57
- package/app/recipes/messages/index.html +57 -59
- package/app/recipes/products/help/index.html +52 -57
- package/app/recipes/products/index.html +57 -59
- package/app/recipes/projects.tracker/help/index.html +52 -57
- package/app/recipes/projects.tracker/index.html +57 -59
- package/app/recipes/reports.materialized/help/index.html +52 -57
- package/app/recipes/reports.materialized/index.html +57 -59
- package/app/recipes/reports.runtime/help/index.html +88 -0
- package/app/recipes/reports.runtime/index.html +92 -0
- package/app/recipes/sales.pipeline/help/index.html +52 -57
- package/app/recipes/sales.pipeline/index.html +57 -59
- package/app/recipes/tags.taxonomy/help/index.html +52 -57
- package/app/recipes/tags.taxonomy/index.html +57 -59
- package/app/recipes/team-collaboration/help/index.html +52 -57
- package/app/recipes/team-collaboration/index.html +57 -59
- package/app/recipes/timesheets.time-entries/help/index.html +88 -0
- package/app/recipes/timesheets.time-entries/index.html +92 -0
- package/app/s/custom-accounts/index.html +82 -0
- package/app/s/custom-appointments/index.html +82 -0
- package/app/s/custom-billing/index.html +47 -54
- package/app/s/custom-buying/index.html +47 -54
- package/app/s/custom-checkout/index.html +82 -0
- package/app/s/custom-classes/index.html +47 -54
- package/app/s/custom-clients/index.html +82 -0
- package/app/s/custom-events/index.html +82 -0
- package/app/s/custom-fleet/index.html +82 -0
- package/app/s/custom-giving/index.html +82 -0
- package/app/s/custom-jobs/index.html +47 -54
- package/app/s/custom-kitchen/index.html +47 -54
- package/app/s/custom-material/index.html +47 -54
- package/app/s/custom-meetings/index.html +82 -0
- package/app/s/custom-members/index.html +47 -54
- package/app/s/custom-parts/index.html +47 -54
- package/app/s/custom-rentals/index.html +82 -0
- package/app/s/custom-roastery/index.html +82 -0
- package/app/s/custom-schedule/index.html +47 -54
- package/app/s/custom-shelf/index.html +82 -0
- package/app/s/custom-shop/index.html +47 -54
- package/app/s/custom-wholesale/index.html +47 -54
- package/app/s/custom-work/index.html +82 -0
- package/app/s/custom-yard/index.html +82 -0
- package/app/s/section-access-control/index.html +47 -54
- package/app/s/section-account-security/index.html +47 -54
- package/app/s/section-accounting/index.html +47 -54
- package/app/s/section-activity/index.html +47 -54
- package/app/s/section-agreements/index.html +47 -54
- package/app/s/section-analytics/index.html +47 -54
- package/app/s/section-assets/index.html +47 -54
- package/app/s/section-billing/index.html +47 -54
- package/app/s/section-calendar/index.html +47 -54
- package/app/s/section-catalog/index.html +47 -54
- package/app/s/section-chat.assistant/index.html +47 -54
- package/app/s/section-comments/index.html +47 -54
- package/app/s/section-fields.form-customization/index.html +47 -54
- package/app/s/section-ingestion/index.html +82 -0
- package/app/s/section-integrations/index.html +82 -0
- package/app/s/section-messages/index.html +47 -54
- package/app/s/section-more/index.html +47 -54
- package/app/s/section-operations/index.html +47 -54
- package/app/s/section-projects/index.html +47 -54
- package/app/s/section-purchasing/index.html +47 -54
- package/app/s/section-reports.materialized/index.html +47 -54
- package/app/s/section-reports.runtime/index.html +82 -0
- package/app/s/section-sales/index.html +47 -54
- package/app/s/section-taxonomy/index.html +47 -54
- package/app/s/section-team/index.html +47 -54
- package/app/s/section-work/index.html +82 -0
- package/dist/ai/state.svelte.d.ts +13 -0
- package/dist/ai/state.svelte.js +33 -0
- package/dist/assistant/change.d.ts +14 -3
- package/dist/assistant/change.js +26 -3
- package/dist/assistant/engine.js +5 -1
- package/dist/assistant/prompt.js +7 -3
- package/dist/catalog/catalog.json +11263 -14455
- package/dist/catalog/generate/exclusions.d.ts +2 -0
- package/dist/catalog/generate/exclusions.js +14 -0
- package/dist/catalog/generate/extract.js +28 -7
- package/dist/catalog/types.d.ts +7 -0
- package/dist/components/AdvancedStyles.svelte +138 -0
- package/dist/components/AdvancedStyles.svelte.d.ts +6 -0
- package/dist/components/AiModelsPage.svelte +40 -0
- package/dist/components/AiModelsPage.svelte.d.ts +7 -0
- package/dist/components/AiSetup.svelte +9 -6
- package/dist/components/AiStatusIcons.svelte +8 -5
- package/dist/components/AppSettings.svelte +105 -1
- package/dist/components/BrowserAssistant.svelte +16 -17
- package/dist/components/BrowserAssistant.svelte.d.ts +2 -0
- package/dist/components/ChildRecords.svelte +61 -14
- package/dist/components/ChildRecords.svelte.d.ts +1 -0
- package/dist/components/ConnectTools.svelte +5 -2
- package/dist/components/CookbooksPanel.svelte +56 -33
- package/dist/components/CopyButton.svelte +65 -0
- package/dist/components/CopyButton.svelte.d.ts +24 -0
- package/dist/components/ExportPanel.svelte +292 -57
- package/dist/components/ExportPanel.svelte.d.ts +10 -1
- package/dist/components/FeatureCard.svelte +21 -10
- package/dist/components/FeaturesPanel.svelte +4 -1
- package/dist/components/FieldInput.svelte +6 -3
- package/dist/components/FieldMapForm.svelte +6 -10
- package/dist/components/FieldMapForm.svelte.d.ts +1 -0
- package/dist/components/FormWorkspace.svelte +80 -9
- package/dist/components/FormWorkspace.svelte.d.ts +1 -0
- package/dist/components/HeaderIconLink.svelte +86 -0
- package/dist/components/HeaderIconLink.svelte.d.ts +14 -0
- package/dist/components/HelpView.svelte +3 -0
- package/dist/components/ModelOptions.svelte +13 -2
- package/dist/components/ModelPage.svelte +33 -5
- package/dist/components/ModelPage.svelte.d.ts +4 -0
- package/dist/components/ModelWorkspace.svelte +148 -50
- package/dist/components/ModelWorkspace.svelte.d.ts +4 -0
- package/dist/components/PackagePage.svelte +96 -0
- package/dist/components/PackagePage.svelte.d.ts +9 -0
- package/dist/components/ProductMedia.svelte +95 -0
- package/dist/components/ProductMedia.svelte.d.ts +10 -0
- package/dist/components/RecipeCards.svelte +13 -1
- package/dist/components/RecipeHelp.svelte +3 -0
- package/dist/components/RecipeOptions.svelte +13 -1
- package/dist/components/RecordFeatures.svelte +22 -8
- package/dist/components/RecordView.svelte +354 -0
- package/dist/components/RecordView.svelte.d.ts +14 -0
- package/dist/components/RelationField.svelte +5 -2
- package/dist/components/SectionActions.svelte +8 -5
- package/dist/components/SectionHeading.svelte +63 -0
- package/dist/components/SectionHeading.svelte.d.ts +11 -0
- package/dist/components/SectionIcons.svelte +15 -3
- package/dist/components/SectionOverview.svelte +33 -3
- package/dist/components/SectionOverview.svelte.d.ts +4 -0
- package/dist/components/SectionPage.svelte +25 -165
- package/dist/components/SectionView.svelte +172 -0
- package/dist/components/SectionView.svelte.d.ts +18 -0
- package/dist/components/SettingsPanel.svelte +3 -9
- package/dist/components/SettingsPanel.svelte.d.ts +1 -5
- package/dist/components/ThemeBridge.svelte +80 -4
- package/dist/components/ThemeBridge.svelte.d.ts +5 -1
- package/dist/components/ThemeSection.svelte +208 -117
- package/dist/components/ThemeSection.svelte.d.ts +3 -7
- package/dist/components/VariantGridForm.svelte +9 -13
- package/dist/components/VariantGridForm.svelte.d.ts +1 -0
- package/dist/components/VoiceTyping.svelte +3 -0
- package/dist/cookbook/describe.d.ts +29 -0
- package/dist/cookbook/describe.js +164 -0
- package/dist/cookbook/file.d.ts +6 -0
- package/dist/cookbook/file.js +18 -4
- package/dist/cookbook/prompt.d.ts +49 -0
- package/dist/cookbook/prompt.js +96 -0
- package/dist/cookbook/store.svelte.d.ts +13 -0
- package/dist/cookbook/store.svelte.js +36 -8
- package/dist/core/prompt.js +10 -1
- package/dist/core/reply.d.ts +6 -1
- package/dist/data/children.d.ts +50 -6
- package/dist/data/children.js +146 -16
- package/dist/data/derived.d.ts +37 -29
- package/dist/data/derived.js +49 -30
- package/dist/data/display.d.ts +21 -8
- package/dist/data/display.js +74 -11
- package/dist/data/fakes.d.ts +48 -9
- package/dist/data/fakes.js +146 -22
- package/dist/data/labels.d.ts +7 -2
- package/dist/data/labels.js +12 -2
- package/dist/data/list-sort.d.ts +8 -0
- package/dist/data/list-sort.js +45 -0
- package/dist/data/money.d.ts +225 -0
- package/dist/data/money.js +411 -0
- package/dist/data/packs.d.ts +13 -0
- package/dist/data/packs.js +1224 -0
- package/dist/data/planner-source.js +120 -3
- package/dist/data/source.d.ts +13 -2
- package/dist/data/source.js +274 -40
- package/dist/features/palette.d.ts +2 -0
- package/dist/features/palette.js +1 -1
- package/dist/forms/stock.d.ts +1 -1
- package/dist/forms/stock.js +3 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +6 -1
- package/dist/kitchen/LiveKitchenBridge.svelte +73 -0
- package/dist/kitchen/LiveKitchenBridge.svelte.d.ts +8 -0
- package/dist/kitchen/live.d.ts +7 -0
- package/dist/kitchen/live.js +51 -0
- package/dist/library/icons.js +34 -0
- package/dist/library/library.json +1546 -15
- package/dist/library/pending.json +5 -0
- package/dist/library/types.d.ts +4 -0
- package/dist/motion/tokens.d.ts +6 -0
- package/dist/motion/tokens.js +32 -0
- package/dist/motion/view-transition.d.ts +13 -0
- package/dist/motion/view-transition.js +17 -0
- package/dist/overviews/definitions.d.ts +41 -2
- package/dist/overviews/definitions.js +111 -4
- package/dist/overviews/models.d.ts +10 -0
- package/dist/overviews/models.js +19 -0
- package/dist/overviews/registry.d.ts +92 -5
- package/dist/overviews/registry.js +468 -58
- package/dist/overviews/validate.js +2 -2
- package/dist/planner/Planner.svelte +374 -166
- package/dist/planner/PlannerControls.svelte +255 -0
- package/dist/planner/PlannerControls.svelte.d.ts +17 -0
- package/dist/planner/PlannerLifecycle.svelte +73 -0
- package/dist/planner/PlannerLifecycle.svelte.d.ts +9 -0
- package/dist/planner/app.svelte.d.ts +12 -2
- package/dist/planner/app.svelte.js +13 -3
- package/dist/planner/assistant.js +20 -2
- package/dist/planner/commands/adapter.js +9 -2
- package/dist/planner/commands/types.d.ts +1 -1
- package/dist/planner/commands/types.js +1 -0
- package/dist/planner/header-icons.d.ts +12 -0
- package/dist/planner/header-icons.js +12 -0
- package/dist/planner/host/HostPlanner.svelte +70 -0
- package/dist/planner/host/HostPlanner.svelte.d.ts +17 -0
- package/dist/planner/host/session.svelte.d.ts +28 -0
- package/dist/planner/host/session.svelte.js +186 -0
- package/dist/planner/routes.d.ts +49 -0
- package/dist/planner/routes.js +64 -0
- package/dist/planner/shell.d.ts +40 -0
- package/dist/planner/shell.js +56 -0
- package/dist/planner/tab.svelte.d.ts +6 -3
- package/dist/planner/tab.svelte.js +11 -4
- package/dist/planner/title.d.ts +15 -0
- package/dist/planner/title.js +21 -0
- package/dist/planner/title.svelte.d.ts +6 -0
- package/dist/planner/title.svelte.js +11 -0
- package/dist/planner/types.d.ts +39 -7
- package/dist/products/media.d.ts +20 -0
- package/dist/products/media.js +65 -0
- package/dist/recipes/help/descriptions.json +1 -3
- package/dist/recipes/index.d.ts +2 -0
- package/dist/recipes/index.js +6 -0
- package/dist/recipes/plumbing.d.ts +35 -1
- package/dist/recipes/plumbing.js +74 -0
- package/dist/screens/definition.d.ts +35 -0
- package/dist/screens/definition.js +132 -0
- package/dist/screens/relations.d.ts +17 -0
- package/dist/screens/relations.js +98 -0
- package/dist/screens/totals.d.ts +37 -0
- package/dist/screens/totals.js +65 -0
- package/dist/sections/info.d.ts +1 -1
- package/dist/sections/info.js +2 -2
- package/dist/settings/app-settings.d.ts +17 -1
- package/dist/settings/app-settings.js +40 -3
- package/dist/smrt-version.d.ts +2 -0
- package/dist/smrt-version.js +4 -0
- package/dist/styles/planner-forms.css +53 -0
- package/dist/styles/planner-lists.css +43 -0
- package/dist/theme/css-highlight.d.ts +6 -0
- package/dist/theme/css-highlight.js +34 -0
- package/dist/theme/custom-css.svelte.d.ts +34 -0
- package/dist/theme/custom-css.svelte.js +246 -0
- package/dist/theme/runtime.js +25 -5
- package/dist/theme/theme.d.ts +26 -3
- package/dist/theme/theme.js +70 -2
- package/dist/upstream/overlay.d.ts +14 -5
- package/dist/upstream/overlay.js +20 -2
- package/package.json +12 -6
- package/app/_app/immutable/assets/0.B5zXkXe_.css +0 -1
- package/app/_app/immutable/assets/10.hpcnxvK1.css +0 -1
- package/app/_app/immutable/assets/11.D7zoXfVV.css +0 -1
- package/app/_app/immutable/assets/12.CPobm1ED.css +0 -1
- package/app/_app/immutable/assets/2.CyaWdRdI.css +0 -1
- package/app/_app/immutable/assets/3.BlPQOes8.css +0 -1
- package/app/_app/immutable/assets/8.2gQeKBp_.css +0 -1
- package/app/_app/immutable/assets/9.HOPT4xtg.css +0 -1
- package/app/_app/immutable/assets/AiSetup.Cb22AigN.css +0 -1
- package/app/_app/immutable/assets/Button.DkP0qkG9.css +0 -1
- package/app/_app/immutable/assets/ConnectTools.BgIJOOGW.css +0 -1
- package/app/_app/immutable/assets/FieldMapForm.BCU-4pO4.css +0 -1
- package/app/_app/immutable/assets/ModelPage.Dd3LcMta.css +0 -1
- package/app/_app/immutable/assets/SectionActions.CTkVuNMF.css +0 -1
- package/app/_app/immutable/assets/SectionIcons.5Udq9vN-.css +0 -1
- package/app/_app/immutable/assets/SegmentedControl.B8SrQacd.css +0 -1
- package/app/_app/immutable/assets/dist.C5nHBk_O.css +0 -1
- package/app/_app/immutable/assets/feedback.BVKAwFck.css +0 -1
- package/app/_app/immutable/assets/forms.BChZ2RWM.css +0 -1
- package/app/_app/immutable/assets/percent.LH0z-ozZ.css +0 -1
- package/app/_app/immutable/assets/store.CGDwHkkF.css +0 -1
- package/app/_app/immutable/assets/ui.B1A1Zl2p.css +0 -1
- package/app/_app/immutable/assets/workspace.BIMkuZDb.css +0 -1
- package/app/_app/immutable/chunks/1okeBSoq.js +0 -1
- package/app/_app/immutable/chunks/2jFBkS1C.js +0 -1
- package/app/_app/immutable/chunks/6P9zxrzU.js +0 -1
- package/app/_app/immutable/chunks/B32EWqI8.js +0 -9
- package/app/_app/immutable/chunks/B4Kevpe0.js +0 -1
- package/app/_app/immutable/chunks/BKwRT_1p.js +0 -1
- package/app/_app/immutable/chunks/BS4h9ES-.js +0 -1
- package/app/_app/immutable/chunks/CMhpRMKg.js +0 -1
- package/app/_app/immutable/chunks/CPRHZZeW.js +0 -1
- package/app/_app/immutable/chunks/CRQ1Pmzr.js +0 -1
- package/app/_app/immutable/chunks/CWtfVMDz.js +0 -1
- package/app/_app/immutable/chunks/Chyo8rdT.js +0 -3
- package/app/_app/immutable/chunks/Ci0DUht6.js +0 -34
- package/app/_app/immutable/chunks/CmmuWmp6.js +0 -2
- package/app/_app/immutable/chunks/CrFNLK0f.js +0 -1
- package/app/_app/immutable/chunks/CsprTb3f.js +0 -2
- package/app/_app/immutable/chunks/CygC84VT.js +0 -2
- package/app/_app/immutable/chunks/D0VgZnk1.js +0 -1
- package/app/_app/immutable/chunks/DD7gpKb2.js +0 -1
- package/app/_app/immutable/chunks/DNRgqfTx.js +0 -1
- package/app/_app/immutable/chunks/DVRKjN-E.js +0 -1
- package/app/_app/immutable/chunks/D_J_XtJy.js +0 -846
- package/app/_app/immutable/chunks/Dp9GVO-9.js +0 -1
- package/app/_app/immutable/chunks/DqcD-WtP.js +0 -1
- package/app/_app/immutable/chunks/QukgIHDX.js +0 -1
- package/app/_app/immutable/chunks/WxSPP8QW.js +0 -4
- package/app/_app/immutable/chunks/Xp1g1t4n.js +0 -3
- package/app/_app/immutable/chunks/leQCwW2d.js +0 -1
- package/app/_app/immutable/chunks/p6bgzXiY.js +0 -1
- package/app/_app/immutable/entry/app.IZIJXhgq.js +0 -2
- package/app/_app/immutable/entry/start.BuaYHD1N.js +0 -1
- package/app/_app/immutable/nodes/0.m_U8WC7E.js +0 -10
- package/app/_app/immutable/nodes/1.Crw8ULhB.js +0 -1
- package/app/_app/immutable/nodes/10.1nQxyH9H.js +0 -4
- package/app/_app/immutable/nodes/11.Cw0JnQF3.js +0 -1
- package/app/_app/immutable/nodes/12.BIocA1aI.js +0 -1
- package/app/_app/immutable/nodes/2.CR5BwGnt.js +0 -17
- package/app/_app/immutable/nodes/3.1B56hgAG.js +0 -1
- package/app/_app/immutable/nodes/4.SSIC7sUh.js +0 -1
- package/app/_app/immutable/nodes/5.DgdwleDQ.js +0 -1
- package/app/_app/immutable/nodes/6.DmD9rqLU.js +0 -1
- package/app/_app/immutable/nodes/7.DdngsBmo.js +0 -1
- package/app/_app/immutable/nodes/8.D2Mszsua.js +0 -3
- package/app/_app/immutable/nodes/9.CLYsywul.js +0 -1
- package/app/m/content/Contents/index.html +0 -96
- package/app/m/preferences/UiPreferenceRecord/index.html +0 -96
- package/app/m/users/AccessRequest/index.html +0 -96
- package/app/m/users/ResourceGrant/index.html +0 -96
- package/app/m/users/UsersCliAuthRequest/index.html +0 -96
- package/app/m/users/UsersMagicLinkToken/index.html +0 -96
package/dist/data/fakes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { getModelByQualifiedName } from "../catalog/index.js";
|
|
1
2
|
import { isLineModel } from "./derived.js";
|
|
2
|
-
import { GENERIC_PACK, getSamplePack, getSampleTaxRate, } from "./packs.js";
|
|
3
|
+
import { GENERIC_PACK, getSamplePack, getSamplePricing, getSampleTaxRate, } from "./packs.js";
|
|
3
4
|
/** Deterministic PRNG (mulberry32): the same seed always yields the same run. */
|
|
4
5
|
export function createRandom(seed) {
|
|
5
6
|
let state = seed >>> 0;
|
|
@@ -20,16 +21,26 @@ export function hashString(value) {
|
|
|
20
21
|
}
|
|
21
22
|
return hash >>> 0;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
// `...Minor` is smrt's name for an amount in minor units (`DocumentTax`'s
|
|
25
|
+
// `taxableMinor`, `TaxSummaryReport`'s `ledgerMovementMinor`).
|
|
26
|
+
const MONEY_NAME = /(price|amount|cost|total|balance|fee|tax|revenue|budget|salary|wage|subtotal|discount|spend|payout|commission|credit|debit|charge|refund|fare|rent|[a-z]Minor$)/i;
|
|
27
|
+
// A count is not money; a dis-count is (`discountTotal`).
|
|
28
|
+
const NOT_MONEY_NAME = /((?<!dis)count|quantity|qty|percent|ratio|level)/i;
|
|
25
29
|
/**
|
|
26
|
-
* Money is stored as integer minor units (cents).
|
|
27
|
-
*
|
|
30
|
+
* Money is stored as integer minor units (cents). An integer field is money
|
|
31
|
+
* when the manifest says so (`ui.format === 'money'`); a field that declares
|
|
32
|
+
* any other format is not, and neither is a framework-managed one. With no
|
|
33
|
+
* declared format the field's name decides.
|
|
28
34
|
*/
|
|
29
35
|
export function isMoneyField(field) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
if (field.type !== 'integer')
|
|
37
|
+
return false;
|
|
38
|
+
const format = field.ui?.format;
|
|
39
|
+
if (format !== undefined)
|
|
40
|
+
return format === 'money';
|
|
41
|
+
if (field.system)
|
|
42
|
+
return false;
|
|
43
|
+
return MONEY_NAME.test(field.name) && !NOT_MONEY_NAME.test(field.name);
|
|
33
44
|
}
|
|
34
45
|
const WORDS = [
|
|
35
46
|
'Harbor',
|
|
@@ -76,6 +87,8 @@ const SENTENCES = [
|
|
|
76
87
|
];
|
|
77
88
|
/** Fixed clock so seeded timestamps never change between runs. */
|
|
78
89
|
export const EPOCH = Date.UTC(2026, 0, 1);
|
|
90
|
+
/** Sample rows per model unless a pack or {@link SAMPLE_ROW_COUNTS} says otherwise. */
|
|
91
|
+
export const DEFAULT_SAMPLE_ROWS = 8;
|
|
79
92
|
const YEAR = 365 * 24 * 60 * 60 * 1000;
|
|
80
93
|
function pick(random, list) {
|
|
81
94
|
return list[Math.floor(random() * list.length)];
|
|
@@ -110,6 +123,12 @@ const CHANNELS = ['web', 'retail', 'phone', 'marketplace', 'wholesale'];
|
|
|
110
123
|
const PERIODS = ['monthly', 'quarterly', 'annual'];
|
|
111
124
|
/** Fractions a tax rate takes: 0%, 5%, 8.25%, 13% and 20%. */
|
|
112
125
|
export const TAX_RATES = [0, 0.05, 0.0825, 0.13, 0.2];
|
|
126
|
+
/**
|
|
127
|
+
* The sample tax rate when neither the app's setting nor the pack names one:
|
|
128
|
+
* every line of every document is taxed at it, so a document's tax is one
|
|
129
|
+
* rate of its subtotal, as on a real invoice.
|
|
130
|
+
*/
|
|
131
|
+
export const DEFAULT_SAMPLE_TAX_RATE = 0.05;
|
|
113
132
|
function fakeText(field, random, modelName = '') {
|
|
114
133
|
const name = field.name.toLowerCase();
|
|
115
134
|
if (/terms/.test(name))
|
|
@@ -158,7 +177,7 @@ function fakeText(field, random, modelName = '') {
|
|
|
158
177
|
return pick(random, ['active', 'pending', 'archived', 'draft']);
|
|
159
178
|
}
|
|
160
179
|
if (/(currency)/.test(name))
|
|
161
|
-
return
|
|
180
|
+
return getSamplePricing().currency;
|
|
162
181
|
if (/(person|owner|author|contact|assignee|worker)/.test(name)) {
|
|
163
182
|
return `${pick(random, FIRST)} ${pick(random, LAST)}`;
|
|
164
183
|
}
|
|
@@ -175,7 +194,41 @@ export const SAMPLE_ROW_COUNTS = {
|
|
|
175
194
|
'@happyvertical/smrt-profiles:Profile': 13,
|
|
176
195
|
'@happyvertical/smrt-commerce:Vendor': 5,
|
|
177
196
|
};
|
|
178
|
-
|
|
197
|
+
const CUSTOMER_MODEL = '@happyvertical/smrt-commerce:Customer';
|
|
198
|
+
/**
|
|
199
|
+
* How many rows of each customer-linked model (orders, quotes, invoices,
|
|
200
|
+
* payments: any model with a FK to a Customer) point at each sample customer:
|
|
201
|
+
* 3 to 6, uneven, seeded by the customer's index so it never changes. The
|
|
202
|
+
* slots interleave (every customer once, then again...), so a list's first
|
|
203
|
+
* rows still show different customers and row `n < customers` points at
|
|
204
|
+
* customer `n`.
|
|
205
|
+
*/
|
|
206
|
+
export function customerSlots(customers) {
|
|
207
|
+
const cached = slotCache.get(customers);
|
|
208
|
+
if (cached)
|
|
209
|
+
return cached;
|
|
210
|
+
const counts = Array.from({ length: customers }, (_, k) => 3 + (hashString(`customer-rows:${k}`) % 4));
|
|
211
|
+
const slots = [];
|
|
212
|
+
for (let round = 0; round < 6; round++) {
|
|
213
|
+
counts.forEach((count, k) => {
|
|
214
|
+
if (count > round)
|
|
215
|
+
slots.push(k);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
slotCache.set(customers, slots);
|
|
219
|
+
return slots;
|
|
220
|
+
}
|
|
221
|
+
const slotCache = new Map();
|
|
222
|
+
/** Does the model's rows belong to a customer (a FK to Customer, not its Profile)? */
|
|
223
|
+
function isCustomerLinked(modelId) {
|
|
224
|
+
const model = getModelByQualifiedName(modelId)?.model;
|
|
225
|
+
return (model?.fields.some((f) => (f.type === 'foreignKey' || f.type === 'crossPackageRef') &&
|
|
226
|
+
f.related === CUSTOMER_MODEL) ?? false);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Sample rows for a model: the pack's count, else the shared one, else, for a
|
|
230
|
+
* customer-linked model, one per {@link customerSlots} slot, else `fallback`.
|
|
231
|
+
*/
|
|
179
232
|
export function sampleRowCount(modelId, fallback) {
|
|
180
233
|
// Profiles: customers, then vendors, then the pack's instructors.
|
|
181
234
|
if (modelId === PROFILE_MODEL) {
|
|
@@ -185,13 +238,19 @@ export function sampleRowCount(modelId, fallback) {
|
|
|
185
238
|
}
|
|
186
239
|
return (getSamplePack().rowCounts?.[modelId] ??
|
|
187
240
|
SAMPLE_ROW_COUNTS[modelId] ??
|
|
188
|
-
|
|
241
|
+
(isCustomerLinked(modelId)
|
|
242
|
+
? customerSlots(sampleRowCount(CUSTOMER_MODEL, fallback)).length
|
|
243
|
+
: fallback));
|
|
189
244
|
}
|
|
190
245
|
/**
|
|
191
246
|
* Which row of the target a sample relation points at. Rows are seeded with
|
|
192
|
-
* ids from `(model, index)`, so pointing at index `n` points at a real row
|
|
247
|
+
* ids from `(model, index)`, so pointing at index `n` points at a real row;
|
|
248
|
+
* spread over every row of the target, so each sample record has related
|
|
249
|
+
* records (a customer several orders, quotes and invoices), not just the
|
|
250
|
+
* first few.
|
|
193
251
|
*/
|
|
194
|
-
function relatedIndex(field, context) {
|
|
252
|
+
export function relatedIndex(field, context) {
|
|
253
|
+
const rows = context.rows ?? DEFAULT_SAMPLE_ROWS;
|
|
195
254
|
const instructors = getSamplePack().instructors;
|
|
196
255
|
if (field.name === 'organizerId' && instructors?.length) {
|
|
197
256
|
// Organizers lead classes and jobs; they are staff, never customers.
|
|
@@ -206,7 +265,13 @@ function relatedIndex(field, context) {
|
|
|
206
265
|
? context.index
|
|
207
266
|
: context.index % 8;
|
|
208
267
|
}
|
|
209
|
-
|
|
268
|
+
const target = field.related ?? '';
|
|
269
|
+
if (target === CUSTOMER_MODEL) {
|
|
270
|
+
// Several rows per customer, 3 to 6 each (see `customerSlots`).
|
|
271
|
+
const slots = customerSlots(sampleRowCount(CUSTOMER_MODEL, rows));
|
|
272
|
+
return slots[context.index % slots.length] ?? 0;
|
|
273
|
+
}
|
|
274
|
+
return (context.index % (target.includes(':') ? sampleRowCount(target, rows) : rows));
|
|
210
275
|
}
|
|
211
276
|
/** One fake value for a field. Money is an integer number of minor units. */
|
|
212
277
|
export function fakeValue(field, random, context) {
|
|
@@ -233,12 +298,12 @@ export function fakeValue(field, random, context) {
|
|
|
233
298
|
}
|
|
234
299
|
case 'decimal':
|
|
235
300
|
if (/taxrate|vatrate/i.test(field.name)) {
|
|
236
|
-
//
|
|
237
|
-
|
|
238
|
-
return rate ?? pick(random, TAX_RATES);
|
|
301
|
+
// The app's setting, else the pack's (0: untaxed), else 5%.
|
|
302
|
+
return getSampleTaxRate() ?? DEFAULT_SAMPLE_TAX_RATE;
|
|
239
303
|
}
|
|
304
|
+
// Exact percent text, as smrt's money model reads it ("10" is 10%).
|
|
240
305
|
if (/discountrate/i.test(field.name))
|
|
241
|
-
return pick(random, [
|
|
306
|
+
return pick(random, ['5', '10']);
|
|
242
307
|
if (/(quantity|qty)/i.test(field.name))
|
|
243
308
|
return 1 + Math.floor(random() * 5);
|
|
244
309
|
return Math.round(random() * 10000) / 100;
|
|
@@ -422,7 +487,7 @@ export function packLine(index) {
|
|
|
422
487
|
return lines?.length ? lines[index % lines.length] : undefined;
|
|
423
488
|
}
|
|
424
489
|
/** A single seeded record for a model. */
|
|
425
|
-
export function fakeRecord(model, index, seed) {
|
|
490
|
+
export function fakeRecord(model, index, seed, rows) {
|
|
426
491
|
const random = createRandom(hashString(`${seed}:${model.id}:${index}`));
|
|
427
492
|
const record = { id: fakeId(`${model.id}:${index}`) };
|
|
428
493
|
for (const field of model.fields) {
|
|
@@ -431,13 +496,72 @@ export function fakeRecord(model, index, seed) {
|
|
|
431
496
|
record[field.name] = fakeValue(field, random, {
|
|
432
497
|
modelId: model.id,
|
|
433
498
|
index,
|
|
499
|
+
rows,
|
|
434
500
|
});
|
|
435
501
|
}
|
|
436
502
|
orderDates(model, record, createRandom(hashString(`${seed}:${model.id}:${index}:dates`)));
|
|
437
503
|
nameThings(model, record, index, random);
|
|
504
|
+
sampleMoneyFields(model, record, index);
|
|
438
505
|
return record;
|
|
439
506
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
507
|
+
const COMMERCE = '@happyvertical/smrt-commerce:';
|
|
508
|
+
/** Every `EXEMPT_EVERY`th sample customer does not pay sales tax. */
|
|
509
|
+
export const EXEMPT_EVERY = 8;
|
|
510
|
+
/**
|
|
511
|
+
* The money-model fields of a sample record, set on purpose rather than
|
|
512
|
+
* drawn: a document is priced the app's way (`lineAmountType`,
|
|
513
|
+
* `taxRoundingScope`) and is an invoice or a payment, never a credit note or
|
|
514
|
+
* a refund (those answer an issued document), with no reversal journal or
|
|
515
|
+
* party tax snapshot; its totals and a line's money
|
|
516
|
+
* are its document's to settle; tax codes come from the app default, so no
|
|
517
|
+
* party or product names one of its own; and one customer in eight is tax
|
|
518
|
+
* exempt.
|
|
519
|
+
*/
|
|
520
|
+
function sampleMoneyFields(model, record, index) {
|
|
521
|
+
const set = (name, value) => {
|
|
522
|
+
if (has(model, name))
|
|
523
|
+
record[name] = value;
|
|
524
|
+
};
|
|
525
|
+
for (const name of [
|
|
526
|
+
'defaultTaxCodeId',
|
|
527
|
+
'defaultSalesTaxCodeId',
|
|
528
|
+
'defaultPurchaseTaxCodeId',
|
|
529
|
+
]) {
|
|
530
|
+
set(name, null);
|
|
531
|
+
}
|
|
532
|
+
if (!model.id.startsWith(COMMERCE))
|
|
533
|
+
return;
|
|
534
|
+
const pricing = getSamplePricing();
|
|
535
|
+
set('lineAmountType', pricing.pricesIncludeTax ? 'inclusive' : 'exclusive');
|
|
536
|
+
set('taxRoundingScope', pricing.taxRounding);
|
|
537
|
+
set('discountTotal', 0);
|
|
538
|
+
if (model.name === 'Invoice')
|
|
539
|
+
set('kind', 'invoice');
|
|
540
|
+
if (model.name === 'Payment')
|
|
541
|
+
set('kind', 'payment');
|
|
542
|
+
set('creditedInvoiceId', null);
|
|
543
|
+
set('creditedLineId', null);
|
|
544
|
+
set('creditedAmount', 0);
|
|
545
|
+
// Only a cancelled posted invoice has a reversal journal, and the party's
|
|
546
|
+
// tax id is snapshotted from the customer when a document is issued.
|
|
547
|
+
set('arReversalJournalId', null);
|
|
548
|
+
set('partyTaxId', null);
|
|
549
|
+
if (isLineModel(model))
|
|
550
|
+
set('taxAmount', 0);
|
|
551
|
+
set('taxMode', 'inherit');
|
|
552
|
+
set('taxCodeId', null);
|
|
553
|
+
set('taxCodeCode', null);
|
|
554
|
+
set('taxCodeName', null);
|
|
555
|
+
if (has(model, 'discountType')) {
|
|
556
|
+
set('discountType', 'none');
|
|
557
|
+
set('discountRate', null);
|
|
558
|
+
set('discount', 0);
|
|
559
|
+
}
|
|
560
|
+
if (model.name === 'Customer') {
|
|
561
|
+
set('taxExempt', index % EXEMPT_EVERY === EXEMPT_EVERY - 1);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
/** `count` seeded records for a model; `rows` is the source's rows per model. */
|
|
565
|
+
export function fakeRecords(model, count, seed = 1, rows) {
|
|
566
|
+
return Array.from({ length: count }, (_, i) => fakeRecord(model, i, seed, rows));
|
|
443
567
|
}
|
package/dist/data/labels.d.ts
CHANGED
|
@@ -19,8 +19,13 @@ export declare const VENDOR = "@happyvertical/smrt-commerce:Vendor";
|
|
|
19
19
|
export declare function shortId(id: unknown): string;
|
|
20
20
|
/** Does the model get its name from a Profile (`profileId` referencing one)? */
|
|
21
21
|
export declare function isProfileLabelled(model: CatalogModel): boolean;
|
|
22
|
-
/**
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The text that names one record. Never an empty string. `omitParty` names
|
|
24
|
+
* a party field (`customerId`) whose label to leave out when the record has
|
|
25
|
+
* a name of its own without it: a customer's page lists its orders as
|
|
26
|
+
* `TIM-8288`, not `Ridgeline Construction · TIM-8288`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function recordLabel(source: DataSource, model: CatalogModel, record: ModelRecord, depth?: number, omitParty?: string): Promise<string>;
|
|
24
29
|
/**
|
|
25
30
|
* The labels of every record the `fields` of `rows` point at, keyed by
|
|
26
31
|
* {@link labelKey}. A pointer to a record that is gone has no entry, so a view
|
package/dist/data/labels.js
CHANGED
|
@@ -36,8 +36,13 @@ async function profileOf(source, record) {
|
|
|
36
36
|
}
|
|
37
37
|
/** How many relations deep a label may reach (allocation > invoice > customer). */
|
|
38
38
|
const LABEL_DEPTH = 3;
|
|
39
|
-
/**
|
|
40
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The text that names one record. Never an empty string. `omitParty` names
|
|
41
|
+
* a party field (`customerId`) whose label to leave out when the record has
|
|
42
|
+
* a name of its own without it: a customer's page lists its orders as
|
|
43
|
+
* `TIM-8288`, not `Ridgeline Construction · TIM-8288`.
|
|
44
|
+
*/
|
|
45
|
+
export async function recordLabel(source, model, record, depth = 0, omitParty) {
|
|
41
46
|
if (isProfileLabelled(model)) {
|
|
42
47
|
const profile = await profileOf(source, record);
|
|
43
48
|
const name = profile && displayLabel(modelNamed(PROFILE), profile);
|
|
@@ -45,6 +50,11 @@ export async function recordLabel(source, model, record, depth = 0) {
|
|
|
45
50
|
return name;
|
|
46
51
|
}
|
|
47
52
|
const party = partyField(model.fields, record);
|
|
53
|
+
if (party && party.name === omitParty) {
|
|
54
|
+
const own = recordName(model, record, () => undefined);
|
|
55
|
+
if (own)
|
|
56
|
+
return own;
|
|
57
|
+
}
|
|
48
58
|
const target = party?.related
|
|
49
59
|
? getModelByQualifiedName(party.related)?.model
|
|
50
60
|
: undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Sort state belongs to a rendered list, never to its data source. */
|
|
2
|
+
export interface ListSort {
|
|
3
|
+
key: string;
|
|
4
|
+
direction: 'ascending' | 'descending';
|
|
5
|
+
}
|
|
6
|
+
export declare function nextListSort(current: ListSort | null, key: string): ListSort;
|
|
7
|
+
/** Stable, non-mutating sort. Empty values remain last in both directions. */
|
|
8
|
+
export declare function sortListRows<T>(rows: readonly T[], sort: ListSort | null, readValue: (row: T, key: string) => unknown): T[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function nextListSort(current, key) {
|
|
2
|
+
return {
|
|
3
|
+
key,
|
|
4
|
+
direction: current?.key === key && current.direction === 'ascending'
|
|
5
|
+
? 'descending'
|
|
6
|
+
: 'ascending',
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const collator = new Intl.Collator(undefined, {
|
|
10
|
+
numeric: true,
|
|
11
|
+
sensitivity: 'base',
|
|
12
|
+
});
|
|
13
|
+
function missing(value) {
|
|
14
|
+
return (value === null ||
|
|
15
|
+
value === undefined ||
|
|
16
|
+
value === '' ||
|
|
17
|
+
(typeof value === 'number' && !Number.isFinite(value)));
|
|
18
|
+
}
|
|
19
|
+
function compare(a, b) {
|
|
20
|
+
if (typeof a === 'number' && typeof b === 'number')
|
|
21
|
+
return a - b;
|
|
22
|
+
if (typeof a === 'boolean' && typeof b === 'boolean')
|
|
23
|
+
return Number(a) - Number(b);
|
|
24
|
+
const left = a instanceof Date ? a.getTime() : a;
|
|
25
|
+
const right = b instanceof Date ? b.getTime() : b;
|
|
26
|
+
if (typeof left === 'number' && typeof right === 'number')
|
|
27
|
+
return left - right;
|
|
28
|
+
return collator.compare(String(left), String(right));
|
|
29
|
+
}
|
|
30
|
+
/** Stable, non-mutating sort. Empty values remain last in both directions. */
|
|
31
|
+
export function sortListRows(rows, sort, readValue) {
|
|
32
|
+
if (!sort)
|
|
33
|
+
return [...rows];
|
|
34
|
+
return rows
|
|
35
|
+
.map((row, index) => ({ row, index, value: readValue(row, sort.key) }))
|
|
36
|
+
.sort((a, b) => {
|
|
37
|
+
const aMissing = missing(a.value);
|
|
38
|
+
const bMissing = missing(b.value);
|
|
39
|
+
if (aMissing !== bMissing)
|
|
40
|
+
return aMissing ? 1 : -1;
|
|
41
|
+
const order = aMissing ? 0 : compare(a.value, b.value);
|
|
42
|
+
return ((sort.direction === 'ascending' ? order : -order) || a.index - b.index);
|
|
43
|
+
})
|
|
44
|
+
.map(({ row }) => row);
|
|
45
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sample document money on smrt-commerce's money model (smrt#3988, released
|
|
3
|
+
* in 0.56.1). The arithmetic is the package's own: `calculateMoneyDocument`
|
|
4
|
+
* and `resolveLineTaxCode` from `@happyvertical/smrt-commerce/money` (pure,
|
|
5
|
+
* browser-safe), never a copy. This module only supplies the sample tenant's
|
|
6
|
+
* tax codes and maps sample rows to and from the calculator.
|
|
7
|
+
*
|
|
8
|
+
* What a settled document holds (minor units throughout):
|
|
9
|
+
*
|
|
10
|
+
* line amount = quantity x unitPrice - discount
|
|
11
|
+
* exclusive: the line's net; inclusive: its gross, and
|
|
12
|
+
* net = amount - taxAmount
|
|
13
|
+
* line taxAmount = the line's tax from its resolved tax code, one entry
|
|
14
|
+
* per component in `taxComponentsJson`
|
|
15
|
+
* subtotal = the lines' net
|
|
16
|
+
* taxAmount = the lines' tax
|
|
17
|
+
* totalAmount = subtotal + taxAmount
|
|
18
|
+
* discountTotal = the lines' discounts, informational only: they are
|
|
19
|
+
* already inside every line amount and must never be
|
|
20
|
+
* subtracted again
|
|
21
|
+
*
|
|
22
|
+
* A line's discount is `discountType` `none`, `percent` (`discountRate` is
|
|
23
|
+
* exact percent text, "10" is 10%) or `amount` (`discount` in minor units).
|
|
24
|
+
* Tax codes resolve per line: a line override (`taxMode: 'override'` with
|
|
25
|
+
* `taxCodeId`), an exempt customer, the product's code, the customer's code,
|
|
26
|
+
* then the app default.
|
|
27
|
+
*/
|
|
28
|
+
import { type LineAmountType, type MoneyDiscountInput, type TaxCodeAppliesTo, type TaxCodeKind, type TaxRoundingScope } from '@happyvertical/smrt-commerce/money';
|
|
29
|
+
export { MoneyValidationError } from '@happyvertical/smrt-commerce/money';
|
|
30
|
+
export type { LineAmountType, TaxRoundingScope };
|
|
31
|
+
type Row = Readonly<Record<string, unknown>>;
|
|
32
|
+
export interface SampleTaxComponent {
|
|
33
|
+
id: string;
|
|
34
|
+
/** The example pack's key, or `cookbook-<percent>` for the default. */
|
|
35
|
+
key: string;
|
|
36
|
+
name: string;
|
|
37
|
+
/** Exact percent text: "7" is 7%. */
|
|
38
|
+
percent: string;
|
|
39
|
+
recoverable: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface SampleTaxCode {
|
|
42
|
+
id: string;
|
|
43
|
+
code: string;
|
|
44
|
+
name: string;
|
|
45
|
+
kind: TaxCodeKind;
|
|
46
|
+
appliesTo: TaxCodeAppliesTo;
|
|
47
|
+
active: boolean;
|
|
48
|
+
components: readonly SampleTaxComponent[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The codes every tenant is seeded with, which report differently and carry
|
|
52
|
+
* no components.
|
|
53
|
+
*/
|
|
54
|
+
export declare const SEEDED_TAX_CODES: readonly SampleTaxCode[];
|
|
55
|
+
/**
|
|
56
|
+
* smrt-commerce's `COMMON_TAX_CODE_EXAMPLE_PACK` (Canada GST, BC GST+PST,
|
|
57
|
+
* Ontario HST, UK VAT, Australian GST, New Zealand GST), as the planner's
|
|
58
|
+
* tenant has imported it (`applyTaxCodeExamplePack`). The pack is exported
|
|
59
|
+
* only from the package root, which is not browser-safe, so it is restated
|
|
60
|
+
* here and `tests/money.test.ts` compares it with the package's; delete the
|
|
61
|
+
* copy when `./money` exports it (smrt#4023).
|
|
62
|
+
*/
|
|
63
|
+
export declare const TAX_CODE_EXAMPLE_PACK: {
|
|
64
|
+
readonly id: "common-sales-taxes-v1";
|
|
65
|
+
readonly components: readonly [{
|
|
66
|
+
readonly key: "ca-gst-5";
|
|
67
|
+
readonly name: "Canada GST 5%";
|
|
68
|
+
readonly percent: "5";
|
|
69
|
+
readonly recoverable: true;
|
|
70
|
+
}, {
|
|
71
|
+
readonly key: "ca-pst-bc-7";
|
|
72
|
+
readonly name: "BC PST 7%";
|
|
73
|
+
readonly percent: "7";
|
|
74
|
+
readonly recoverable: false;
|
|
75
|
+
}, {
|
|
76
|
+
readonly key: "ca-hst-on-13";
|
|
77
|
+
readonly name: "Ontario HST 13%";
|
|
78
|
+
readonly percent: "13";
|
|
79
|
+
readonly recoverable: true;
|
|
80
|
+
}, {
|
|
81
|
+
readonly key: "uk-vat-20";
|
|
82
|
+
readonly name: "UK VAT 20%";
|
|
83
|
+
readonly percent: "20";
|
|
84
|
+
readonly recoverable: true;
|
|
85
|
+
}, {
|
|
86
|
+
readonly key: "au-gst-10";
|
|
87
|
+
readonly name: "Australia GST 10%";
|
|
88
|
+
readonly percent: "10";
|
|
89
|
+
readonly recoverable: true;
|
|
90
|
+
}, {
|
|
91
|
+
readonly key: "nz-gst-15";
|
|
92
|
+
readonly name: "New Zealand GST 15%";
|
|
93
|
+
readonly percent: "15";
|
|
94
|
+
readonly recoverable: true;
|
|
95
|
+
}];
|
|
96
|
+
readonly codes: readonly [{
|
|
97
|
+
readonly code: "ca-gst";
|
|
98
|
+
readonly name: "Canada GST";
|
|
99
|
+
readonly appliesTo: "both";
|
|
100
|
+
readonly componentKeys: readonly ["ca-gst-5"];
|
|
101
|
+
}, {
|
|
102
|
+
readonly code: "ca-gst-pst-bc";
|
|
103
|
+
readonly name: "BC GST + PST";
|
|
104
|
+
readonly appliesTo: "both";
|
|
105
|
+
readonly componentKeys: readonly ["ca-gst-5", "ca-pst-bc-7"];
|
|
106
|
+
}, {
|
|
107
|
+
readonly code: "ca-hst-on";
|
|
108
|
+
readonly name: "Ontario HST";
|
|
109
|
+
readonly appliesTo: "both";
|
|
110
|
+
readonly componentKeys: readonly ["ca-hst-on-13"];
|
|
111
|
+
}, {
|
|
112
|
+
readonly code: "uk-vat-standard";
|
|
113
|
+
readonly name: "UK VAT standard";
|
|
114
|
+
readonly appliesTo: "both";
|
|
115
|
+
readonly componentKeys: readonly ["uk-vat-20"];
|
|
116
|
+
}, {
|
|
117
|
+
readonly code: "au-gst";
|
|
118
|
+
readonly name: "Australia GST";
|
|
119
|
+
readonly appliesTo: "both";
|
|
120
|
+
readonly componentKeys: readonly ["au-gst-10"];
|
|
121
|
+
}, {
|
|
122
|
+
readonly code: "nz-gst";
|
|
123
|
+
readonly name: "New Zealand GST";
|
|
124
|
+
readonly appliesTo: "both";
|
|
125
|
+
readonly componentKeys: readonly ["nz-gst-15"];
|
|
126
|
+
}];
|
|
127
|
+
};
|
|
128
|
+
/** The example pack's codes with their components. */
|
|
129
|
+
export declare const EXAMPLE_TAX_CODES: readonly SampleTaxCode[];
|
|
130
|
+
/** A fraction (0.0825) as exact percent text ("8.25"). */
|
|
131
|
+
export declare function percentText(rate: number): string;
|
|
132
|
+
/**
|
|
133
|
+
* The app's default sales tax code for its tax-rate setting, exactly as
|
|
134
|
+
* smrt-commerce's cookbook activation (`applyCommerceCookbookSettings`)
|
|
135
|
+
* creates it, so the planner prices what an exported cookbook will: no rate
|
|
136
|
+
* (0) is `out-of-scope`, any other rate the `default-<rate>` code with one
|
|
137
|
+
* `Cookbook <rate>%` component. The example pack's codes are only ever chosen
|
|
138
|
+
* explicitly, on a line (`examplePackCodeFor`).
|
|
139
|
+
*/
|
|
140
|
+
export declare function defaultTaxCode(rate: number): SampleTaxCode;
|
|
141
|
+
/**
|
|
142
|
+
* The example-pack code a sample line in an app of this currency may choose
|
|
143
|
+
* for itself: the pack's code with the most components for that country
|
|
144
|
+
* (BC GST + PST for CAD), else none.
|
|
145
|
+
*/
|
|
146
|
+
export declare function examplePackCodeFor(currency: string): SampleTaxCode | undefined;
|
|
147
|
+
/** Every tax code of the sample tenant: the seeded ones, the default, the pack. */
|
|
148
|
+
export declare function sampleTaxCodes(rate: number): SampleTaxCode[];
|
|
149
|
+
/** The components of the sample tenant's codes, each once. */
|
|
150
|
+
export declare function sampleTaxComponents(codes: readonly SampleTaxCode[]): SampleTaxComponent[];
|
|
151
|
+
/** What a settled line stores per tax component (smrt's `taxComponentsJson`). */
|
|
152
|
+
export interface LineTaxComponent {
|
|
153
|
+
taxComponentId: string;
|
|
154
|
+
name: string;
|
|
155
|
+
percent: string;
|
|
156
|
+
taxMinor: number;
|
|
157
|
+
}
|
|
158
|
+
/** One `DocumentTax`-shaped row: a code/component's taxable base and tax. */
|
|
159
|
+
export interface DocumentTaxRow {
|
|
160
|
+
taxCodeId: string | null;
|
|
161
|
+
taxComponentId: string | null;
|
|
162
|
+
name: string;
|
|
163
|
+
percent: string;
|
|
164
|
+
taxable: number;
|
|
165
|
+
tax: number;
|
|
166
|
+
}
|
|
167
|
+
export interface MoneyContext {
|
|
168
|
+
lineAmountType: LineAmountType;
|
|
169
|
+
roundingScope: TaxRoundingScope;
|
|
170
|
+
currency: string;
|
|
171
|
+
codes: readonly SampleTaxCode[];
|
|
172
|
+
/** The app's default sales code. */
|
|
173
|
+
appDefaultCodeId: string | null;
|
|
174
|
+
/** The document's customer is tax exempt. */
|
|
175
|
+
customerTaxExempt?: boolean;
|
|
176
|
+
/** The customer's own code (`Customer.defaultTaxCodeId`). */
|
|
177
|
+
partyCodeId?: string | null;
|
|
178
|
+
/** A line's product code (`Product.defaultSalesTaxCodeId`), by product id. */
|
|
179
|
+
productCodeOf?: (productId: string) => string | null | undefined;
|
|
180
|
+
}
|
|
181
|
+
/** The fields a document's calculation writes on each of its lines. */
|
|
182
|
+
export type SettledLineMoney = {
|
|
183
|
+
discount: number;
|
|
184
|
+
amount: number;
|
|
185
|
+
taxAmount: number;
|
|
186
|
+
taxCodeId: string | null;
|
|
187
|
+
taxCodeCode: string | null;
|
|
188
|
+
taxCodeName: string | null;
|
|
189
|
+
taxComponentsJson: string;
|
|
190
|
+
taxRate: number;
|
|
191
|
+
};
|
|
192
|
+
export interface SettledDocument<L extends Row> {
|
|
193
|
+
lines: (L & SettledLineMoney)[];
|
|
194
|
+
subtotal: number;
|
|
195
|
+
discountTotal: number;
|
|
196
|
+
taxAmount: number;
|
|
197
|
+
totalAmount: number;
|
|
198
|
+
taxes: DocumentTaxRow[];
|
|
199
|
+
}
|
|
200
|
+
/** A line's discount as the calculator takes it. */
|
|
201
|
+
export declare function lineDiscount(line: Row): MoneyDiscountInput;
|
|
202
|
+
/** A supported ISO 4217 code for the calculator: the row's, else the app's. */
|
|
203
|
+
export declare function moneyCurrency(value: unknown, fallback?: string): string;
|
|
204
|
+
/**
|
|
205
|
+
* A document's lines and totals on the money model. Each line keeps its own
|
|
206
|
+
* fields and gains `discount` (what was taken off, in minor units),
|
|
207
|
+
* `amount`, `taxAmount`, `taxCodeId` / `taxCodeCode` / `taxCodeName`,
|
|
208
|
+
* `taxComponentsJson` and `taxRate` (the sum of its components' percents as a
|
|
209
|
+
* fraction, the field smrt keeps beside them). Throws smrt's
|
|
210
|
+
* `MoneyValidationError` on money the model refuses (a discount above the
|
|
211
|
+
* line's price, an unknown override code).
|
|
212
|
+
*/
|
|
213
|
+
export declare function settleDocument<L extends Row>(lines: readonly L[], context: MoneyContext): SettledDocument<L>;
|
|
214
|
+
/** The per-component snapshot a settled line stores, or `[]`. */
|
|
215
|
+
export declare function lineTaxComponents(line: Row): LineTaxComponent[];
|
|
216
|
+
/**
|
|
217
|
+
* A document's per-component tax as its stored line snapshots say: each
|
|
218
|
+
* component's tax is the sum of what the lines stored for it, and its taxable
|
|
219
|
+
* base the sum of those lines' net (`amount`, less `taxAmount` when prices
|
|
220
|
+
* include tax). Sums of stored values only: nothing is recalculated, the way
|
|
221
|
+
* smrt's `DocumentTax` rows are written from the same calculation.
|
|
222
|
+
*/
|
|
223
|
+
export declare function storedTaxRows(lines: readonly Row[], lineAmountType: LineAmountType): DocumentTaxRow[];
|
|
224
|
+
/** What a line comes to before tax is resolved: its price less its discount. */
|
|
225
|
+
export declare function lineAmount(line: Row): number;
|