@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
|
@@ -1,17 +1,53 @@
|
|
|
1
1
|
import { catalog } from "../catalog/index.js";
|
|
2
|
-
import { browserStorage } from "../cookbook/storage.js";
|
|
2
|
+
import { browserStorage, STORAGE_KEY } from "../cookbook/storage.js";
|
|
3
|
+
import { followSettings } from "../cookbook/store.svelte.js";
|
|
4
|
+
import { parseCookbookText } from "../cookbook/validate.js";
|
|
3
5
|
import { catalogModels } from "../forms/shared.js";
|
|
4
6
|
import { PROFILE_TYPE, stockSamples, VARIANT } from "../forms/stock.js";
|
|
7
|
+
import { ASSET, PRODUCT_ASSET } from "../products/media.js";
|
|
5
8
|
import { recipes } from "../recipes/index.js";
|
|
6
9
|
import { childLinks } from "../recipes/plumbing.js";
|
|
7
10
|
import { recipeState } from "../recipes/state.svelte.js";
|
|
11
|
+
import { DEFAULT_SAMPLE_TAX_RATE, fakeId } from "./fakes.js";
|
|
12
|
+
import { defaultTaxCode, sampleTaxCodes, sampleTaxComponents, } from "./money.js";
|
|
13
|
+
import { getSamplePricing, getSampleTaxRate } from "./packs.js";
|
|
8
14
|
import { createMemoryDataSource } from "./source.js";
|
|
15
|
+
const C = '@happyvertical/smrt-commerce:';
|
|
16
|
+
const TAX_CODE = `${C}TaxCode`;
|
|
17
|
+
const TAX_COMPONENT = `${C}TaxComponent`;
|
|
18
|
+
const TAX_SETTINGS = `${C}TaxSettings`;
|
|
19
|
+
const DOCUMENT_TAX = `${C}DocumentTax`;
|
|
20
|
+
/** The sample tenant's tax codes for the app's current settings. */
|
|
21
|
+
function currentTaxCodes() {
|
|
22
|
+
const rate = getSampleTaxRate() ?? DEFAULT_SAMPLE_TAX_RATE;
|
|
23
|
+
return { codes: sampleTaxCodes(rate), fallback: defaultTaxCode(rate) };
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A page opened straight at a record reads sample rows before the layout
|
|
27
|
+
* hydrates the saved cookbook (its `afterNavigate`), so the rows would be
|
|
28
|
+
* priced by defaults rather than the app's money settings. Read the saved
|
|
29
|
+
* cookbook's settings first; only reads, the store's hydrate does the rest.
|
|
30
|
+
*/
|
|
31
|
+
function primeSampleSettings(storage) {
|
|
32
|
+
try {
|
|
33
|
+
const raw = storage?.getItem(STORAGE_KEY);
|
|
34
|
+
if (!raw)
|
|
35
|
+
return;
|
|
36
|
+
const parsed = parseCookbookText(raw, { dropUnknownRecipes: true });
|
|
37
|
+
if (parsed.ok)
|
|
38
|
+
followSettings(parsed.cookbook);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Unreadable or unavailable: the store's hydrate reports it.
|
|
42
|
+
}
|
|
43
|
+
}
|
|
9
44
|
/**
|
|
10
45
|
* The planner's sample-data source: seeded in-memory fakes whose added, edited
|
|
11
46
|
* and deleted rows survive a reload (Reset clears them). The seam for live
|
|
12
47
|
* objects: swap this for a collection-backed `DataSource`.
|
|
13
48
|
*/
|
|
14
49
|
export function createPlannerDataSource() {
|
|
50
|
+
primeSampleSettings(browserStorage());
|
|
15
51
|
return createMemoryDataSource({
|
|
16
52
|
storage: browserStorage(),
|
|
17
53
|
// Fields the views hide still carry their policy default, e.g. the
|
|
@@ -20,8 +56,89 @@ export function createPlannerDataSource() {
|
|
|
20
56
|
// Variants only make sense under a product a form creates, so they start
|
|
21
57
|
// empty, as do Profile types: a form adds the one it needs. Locations, SKUs
|
|
22
58
|
// and stock are sampled together (one SKU per product).
|
|
23
|
-
|
|
24
|
-
|
|
59
|
+
// A document's tax snapshot is kept on its lines (`taxComponentsJson`),
|
|
60
|
+
// so `DocumentTax` holds no rows of its own.
|
|
61
|
+
empty: [VARIANT, PROFILE_TYPE, DOCUMENT_TAX],
|
|
62
|
+
samples: {
|
|
63
|
+
// The tax codes sample documents resolve against: the seeded ones,
|
|
64
|
+
// the app default and smrt-commerce's example pack (`data/money.ts`).
|
|
65
|
+
[TAX_CODE]: {
|
|
66
|
+
from: [],
|
|
67
|
+
make: () => currentTaxCodes().codes.map((code) => ({
|
|
68
|
+
id: code.id,
|
|
69
|
+
code: code.code,
|
|
70
|
+
name: code.name,
|
|
71
|
+
kind: code.kind,
|
|
72
|
+
appliesTo: code.appliesTo,
|
|
73
|
+
active: code.active,
|
|
74
|
+
componentsJson: JSON.stringify(code.components.map((part) => ({
|
|
75
|
+
taxComponentId: part.id,
|
|
76
|
+
compound: false,
|
|
77
|
+
}))),
|
|
78
|
+
})),
|
|
79
|
+
},
|
|
80
|
+
[TAX_COMPONENT]: {
|
|
81
|
+
from: [],
|
|
82
|
+
make: () => sampleTaxComponents(currentTaxCodes().codes).map((part) => ({
|
|
83
|
+
id: part.id,
|
|
84
|
+
name: part.name,
|
|
85
|
+
percent: part.percent,
|
|
86
|
+
liabilityAccountId: null,
|
|
87
|
+
recoverable: part.recoverable,
|
|
88
|
+
active: true,
|
|
89
|
+
})),
|
|
90
|
+
},
|
|
91
|
+
[TAX_SETTINGS]: {
|
|
92
|
+
from: [],
|
|
93
|
+
make: () => {
|
|
94
|
+
const { fallback } = currentTaxCodes();
|
|
95
|
+
const pricing = getSamplePricing();
|
|
96
|
+
return [
|
|
97
|
+
{
|
|
98
|
+
id: fakeId(`${TAX_SETTINGS}:sample`),
|
|
99
|
+
defaultSalesTaxCodeId: fallback.id,
|
|
100
|
+
defaultPurchaseTaxCodeId: fallback.id,
|
|
101
|
+
defaultLineAmountType: pricing.pricesIncludeTax
|
|
102
|
+
? 'inclusive'
|
|
103
|
+
: 'exclusive',
|
|
104
|
+
taxRoundingScope: pricing.taxRounding,
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
...stockSamples(catalogModels),
|
|
110
|
+
[ASSET]: {
|
|
111
|
+
from: [catalogModels('@happyvertical/smrt-products:Product')],
|
|
112
|
+
make: ([products]) => (products ?? []).map((product, i) => ({
|
|
113
|
+
id: fakeId(`${ASSET}:sample:${product.id}`),
|
|
114
|
+
name: `${String(product.name ?? 'Product')} image`,
|
|
115
|
+
sourceUri: `data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"><rect width="240" height="240" fill="hsl(${(i * 47) % 360} 40% 82%)"/><circle cx="120" cy="94" r="46" fill="hsl(${(i * 47 + 30) % 360} 35% 58%)"/><path d="M44 214c20-55 132-55 152 0" fill="hsl(${(i * 47 + 10) % 360} 30% 46%)"/><text x="120" y="224" text-anchor="middle" font-family="sans-serif" font-size="14" fill="white">${String(product.name ?? '').replace(/[<&>]/g, '')}</text></svg>`)}`,
|
|
116
|
+
mimeType: 'image/svg+xml',
|
|
117
|
+
description: `Sample image for ${String(product.name ?? 'this product')}.`,
|
|
118
|
+
sourceType: 'browser-demo',
|
|
119
|
+
})),
|
|
120
|
+
},
|
|
121
|
+
[PRODUCT_ASSET]: {
|
|
122
|
+
from: [
|
|
123
|
+
catalogModels('@happyvertical/smrt-products:Product'),
|
|
124
|
+
catalogModels(ASSET),
|
|
125
|
+
],
|
|
126
|
+
make: ([products, assets]) => (products ?? []).flatMap((product, i) => {
|
|
127
|
+
const asset = assets?.[i];
|
|
128
|
+
return asset
|
|
129
|
+
? [
|
|
130
|
+
{
|
|
131
|
+
id: fakeId(`${PRODUCT_ASSET}:sample:${product.id}`),
|
|
132
|
+
productId: product.id,
|
|
133
|
+
assetId: asset.id,
|
|
134
|
+
relationship: 'gallery',
|
|
135
|
+
sortOrder: 0,
|
|
136
|
+
},
|
|
137
|
+
]
|
|
138
|
+
: [];
|
|
139
|
+
}),
|
|
140
|
+
},
|
|
141
|
+
},
|
|
25
142
|
// Every sample parent comes with line items: the same parent-to-children
|
|
26
143
|
// lookup the record view uses, so what it shows is what was seeded.
|
|
27
144
|
children: {
|
package/dist/data/source.d.ts
CHANGED
|
@@ -45,6 +45,11 @@ export type RecordWrite = {
|
|
|
45
45
|
};
|
|
46
46
|
export interface DataSource {
|
|
47
47
|
list(model: CatalogModel): Promise<ModelRecord[]>;
|
|
48
|
+
/**
|
|
49
|
+
* The rows whose `field` equals `value` (compared as strings): a record's
|
|
50
|
+
* related rows, by the foreign key that points at it.
|
|
51
|
+
*/
|
|
52
|
+
listWhere(model: CatalogModel, field: string, value: string): Promise<ModelRecord[]>;
|
|
48
53
|
get(model: CatalogModel, id: string): Promise<ModelRecord | undefined>;
|
|
49
54
|
create(model: CatalogModel, values: Record<string, unknown>): Promise<ModelRecord>;
|
|
50
55
|
update(model: CatalogModel, id: string, values: Record<string, unknown>): Promise<ModelRecord | undefined>;
|
|
@@ -63,8 +68,14 @@ export interface DataSource {
|
|
|
63
68
|
*/
|
|
64
69
|
onReset?(listener: () => void): () => void;
|
|
65
70
|
}
|
|
66
|
-
/**
|
|
67
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Prefix of the localStorage keys rows are kept under, one per model. v6:
|
|
73
|
+
* documents are on smrt-commerce's money model (a line's `amount` is its net
|
|
74
|
+
* after discount, or its gross when prices include tax, with tax stored
|
|
75
|
+
* apart; `derived.ts`). Rows kept under an older prefix are left behind for
|
|
76
|
+
* fresh samples, never migrated.
|
|
77
|
+
*/
|
|
78
|
+
export declare const DATA_STORAGE_PREFIX = "smrt-planner:data:v6:";
|
|
68
79
|
/** Remove every stored row. Never throws. */
|
|
69
80
|
export declare function clearStoredData(storage: Storage | null | undefined): void;
|
|
70
81
|
export interface MemoryDataSourceOptions {
|
package/dist/data/source.js
CHANGED
|
@@ -1,14 +1,33 @@
|
|
|
1
|
-
import { fakeChildrenOf,
|
|
2
|
-
import { allocationInvoiceField, allocationPaymentField, isAllocationModel, isLineModel, PAID_PAYMENT_STATUS, settleInvoice,
|
|
3
|
-
import { EPOCH, fakeId, fakeRecords, sampleRowCount, } from "./fakes.js";
|
|
1
|
+
import { fakeChildrenOf, seedMismatch, settleSample, withCarried, } from "./children.js";
|
|
2
|
+
import { allocationInvoiceField, allocationPaymentField, documentLineAmountType, documentRoundingScope, isAllocationModel, isLineModel, PAID_PAYMENT_STATUS, settleInvoice, settleWithLines, tracksPayments, } from "./derived.js";
|
|
3
|
+
import { DEFAULT_SAMPLE_ROWS, DEFAULT_SAMPLE_TAX_RATE, EPOCH, fakeId, fakeRecords, sampleRowCount, } from "./fakes.js";
|
|
4
|
+
import { defaultTaxCode, MoneyValidationError, moneyCurrency, sampleTaxCodes, settleDocument, } from "./money.js";
|
|
5
|
+
import { getSamplePricing, getSampleTaxRate } from "./packs.js";
|
|
4
6
|
import { fakeAllocations } from "./payments.js";
|
|
5
7
|
export function isRecordRef(value) {
|
|
6
8
|
return (typeof value === 'object' &&
|
|
7
9
|
value !== null &&
|
|
8
10
|
typeof value.ref === 'string');
|
|
9
11
|
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Prefix of the localStorage keys rows are kept under, one per model. v6:
|
|
14
|
+
* documents are on smrt-commerce's money model (a line's `amount` is its net
|
|
15
|
+
* after discount, or its gross when prices include tax, with tax stored
|
|
16
|
+
* apart; `derived.ts`). Rows kept under an older prefix are left behind for
|
|
17
|
+
* fresh samples, never migrated.
|
|
18
|
+
*/
|
|
19
|
+
export const DATA_STORAGE_PREFIX = 'smrt-planner:data:v6:';
|
|
20
|
+
const TAX_CODE_MODEL = '@happyvertical/smrt-commerce:TaxCode';
|
|
21
|
+
const TAX_COMPONENT_MODEL = '@happyvertical/smrt-commerce:TaxComponent';
|
|
22
|
+
const TAX_CODE_KINDS = ['taxable', 'zero-rated', 'exempt', 'out-of-scope'];
|
|
23
|
+
/** Has a document left `draft`, freezing the codes its lines were taxed with? */
|
|
24
|
+
function isIssuedRow(model, row) {
|
|
25
|
+
const status = model.fields.find((f) => f.name === 'status');
|
|
26
|
+
return (Boolean(status?.enum?.includes('draft')) &&
|
|
27
|
+
typeof row.status === 'string' &&
|
|
28
|
+
row.status !== '' &&
|
|
29
|
+
row.status !== 'draft');
|
|
30
|
+
}
|
|
12
31
|
const CREATED_KEY = `${DATA_STORAGE_PREFIX}_created`;
|
|
13
32
|
/** Remove every stored row. Never throws. */
|
|
14
33
|
export function clearStoredData(storage) {
|
|
@@ -31,7 +50,7 @@ export function clearStoredData(storage) {
|
|
|
31
50
|
/** Deterministic seeded fakes held in memory, lazily per model. */
|
|
32
51
|
export function createMemoryDataSource(options = {}) {
|
|
33
52
|
const seed = options.seed ?? 1;
|
|
34
|
-
const rows = options.rowsPerModel ??
|
|
53
|
+
const rows = options.rowsPerModel ?? DEFAULT_SAMPLE_ROWS;
|
|
35
54
|
const empty = new Set(options.empty ?? []);
|
|
36
55
|
const tables = new Map();
|
|
37
56
|
const resetListeners = new Set();
|
|
@@ -177,7 +196,7 @@ export function createMemoryDataSource(options = {}) {
|
|
|
177
196
|
// A child's rows come from its parents, never from random fakes.
|
|
178
197
|
const made = empty.has(model.id) || owned.length || allocation
|
|
179
198
|
? []
|
|
180
|
-
: fakeRecords(model, sampleRowCount(model.id, rows), seed);
|
|
199
|
+
: fakeRecords(model, sampleRowCount(model.id, rows), seed, rows);
|
|
181
200
|
// Registered before the other side is built so each finds this table.
|
|
182
201
|
tables.set(model.id, made);
|
|
183
202
|
for (const link of linksOf(model.id))
|
|
@@ -196,15 +215,136 @@ export function createMemoryDataSource(options = {}) {
|
|
|
196
215
|
}
|
|
197
216
|
if (!empty.has(model.id)) {
|
|
198
217
|
for (const { parent, fk } of owned) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
218
|
+
// A child row takes the values a hidden field carries in this app
|
|
219
|
+
// (a line's discount the recipe options leave at 0), as one created
|
|
220
|
+
// through the form would, before its parent's totals are summed.
|
|
221
|
+
const carried = options.defaults?.(model) ?? {};
|
|
222
|
+
table(parent).forEach((row, index) => {
|
|
223
|
+
const items = fakeChildrenOf(model, fk, row, seed, rows).map((item) => withCarried(item, carried));
|
|
224
|
+
if (!isLineModel(model)) {
|
|
225
|
+
made.push(...items);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
made.push(...settleSample(row, parent, items, moneyContext(parent, row)));
|
|
229
|
+
seedMismatch(row, parent, index);
|
|
230
|
+
});
|
|
204
231
|
}
|
|
205
232
|
}
|
|
206
233
|
return made;
|
|
207
234
|
};
|
|
235
|
+
const modelById = new Map((options.children?.models ?? []).map((m) => [m.id, m]));
|
|
236
|
+
/**
|
|
237
|
+
* The sample tenant's tax codes as its tables hold them: the seeded set for
|
|
238
|
+
* the app's rate, with any `TaxCode` row (and the `TaxComponent` rows it
|
|
239
|
+
* names) replacing or adding to it, so a code the visitor added or edited
|
|
240
|
+
* is the one a line resolves.
|
|
241
|
+
*/
|
|
242
|
+
const tenantTaxCodes = (rate) => {
|
|
243
|
+
const base = sampleTaxCodes(rate);
|
|
244
|
+
// Through `table`, so rows saved in an earlier visit count even when
|
|
245
|
+
// nothing has opened the tax tables yet.
|
|
246
|
+
const codeModel = modelById.get(TAX_CODE_MODEL);
|
|
247
|
+
const componentModel = modelById.get(TAX_COMPONENT_MODEL);
|
|
248
|
+
const rows = codeModel ? table(codeModel) : [];
|
|
249
|
+
if (!rows.length)
|
|
250
|
+
return base;
|
|
251
|
+
const parts = new Map(base.flatMap((c) => c.components.map((p) => [p.id, p])));
|
|
252
|
+
for (const row of componentModel ? table(componentModel) : []) {
|
|
253
|
+
parts.set(row.id, {
|
|
254
|
+
id: row.id,
|
|
255
|
+
key: row.id,
|
|
256
|
+
name: String(row.name ?? ''),
|
|
257
|
+
percent: String(row.percent ?? '0'),
|
|
258
|
+
recoverable: row.recoverable === true,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
const fromRows = rows.map((row) => {
|
|
262
|
+
let listed = [];
|
|
263
|
+
try {
|
|
264
|
+
listed = JSON.parse(String(row.componentsJson ?? '[]'));
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
listed = [];
|
|
268
|
+
}
|
|
269
|
+
const components = (Array.isArray(listed) ? listed : []).flatMap((entry) => {
|
|
270
|
+
const found = entry && typeof entry === 'object'
|
|
271
|
+
? parts.get(String(entry.taxComponentId))
|
|
272
|
+
: undefined;
|
|
273
|
+
return found ? [found] : [];
|
|
274
|
+
});
|
|
275
|
+
const kind = TAX_CODE_KINDS.includes(String(row.kind))
|
|
276
|
+
? row.kind
|
|
277
|
+
: 'taxable';
|
|
278
|
+
const appliesTo = ['sales', 'purchases', 'both'].includes(String(row.appliesTo))
|
|
279
|
+
? row.appliesTo
|
|
280
|
+
: 'both';
|
|
281
|
+
return {
|
|
282
|
+
id: row.id,
|
|
283
|
+
code: String(row.code ?? ''),
|
|
284
|
+
name: String(row.name ?? ''),
|
|
285
|
+
kind,
|
|
286
|
+
appliesTo,
|
|
287
|
+
active: row.active !== false,
|
|
288
|
+
components,
|
|
289
|
+
};
|
|
290
|
+
});
|
|
291
|
+
const byId = new Map(fromRows.map((c) => [c.id, c]));
|
|
292
|
+
// A table seeded with the tenant's codes is the whole truth: a code the
|
|
293
|
+
// visitor deleted stays deleted, except the default for the app's current
|
|
294
|
+
// rate, which smrt's activation creates (or reuses) whenever the rate is
|
|
295
|
+
// set, so a rate changed after the table was seeded still has its code.
|
|
296
|
+
// A table that never held them (a source without tax samples) only adds
|
|
297
|
+
// to the seeded set.
|
|
298
|
+
if (base.some((c) => byId.has(c.id))) {
|
|
299
|
+
const fallback = defaultTaxCode(rate);
|
|
300
|
+
const seeded = base
|
|
301
|
+
.filter((c) => byId.has(c.id) || c.id === fallback.id)
|
|
302
|
+
.map((c) => byId.get(c.id) ?? c);
|
|
303
|
+
return [
|
|
304
|
+
...seeded,
|
|
305
|
+
...fromRows.filter((c) => !base.some((b) => b.id === c.id)),
|
|
306
|
+
];
|
|
307
|
+
}
|
|
308
|
+
return [...base, ...fromRows];
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* How a document's money is settled: its own pricing mode and rounding,
|
|
312
|
+
* else the app's; the sample tenant's tax codes, the app default for its
|
|
313
|
+
* tax rate; and what its customer and products say about tax.
|
|
314
|
+
*/
|
|
315
|
+
const moneyContext = (parent, row) => {
|
|
316
|
+
const pricing = getSamplePricing();
|
|
317
|
+
const rate = getSampleTaxRate() ?? DEFAULT_SAMPLE_TAX_RATE;
|
|
318
|
+
const codes = tenantTaxCodes(rate);
|
|
319
|
+
const customerField = parent.fields.find((f) => f.name === 'customerId' && f.related);
|
|
320
|
+
const customerModel = customerField?.related
|
|
321
|
+
? modelById.get(customerField.related)
|
|
322
|
+
: undefined;
|
|
323
|
+
const customer = customerModel
|
|
324
|
+
? table(customerModel).find((c) => c.id === row.customerId)
|
|
325
|
+
: undefined;
|
|
326
|
+
const products = (productId) => {
|
|
327
|
+
for (const [id, rows] of tables) {
|
|
328
|
+
if (!id.endsWith(':Product'))
|
|
329
|
+
continue;
|
|
330
|
+
const found = rows.find((p) => p.id === productId);
|
|
331
|
+
if (found)
|
|
332
|
+
return found;
|
|
333
|
+
}
|
|
334
|
+
return undefined;
|
|
335
|
+
};
|
|
336
|
+
const codeOf = (value) => typeof value === 'string' && value ? value : null;
|
|
337
|
+
return {
|
|
338
|
+
lineAmountType: documentLineAmountType(row, pricing.pricesIncludeTax ? 'inclusive' : 'exclusive'),
|
|
339
|
+
roundingScope: documentRoundingScope(row, pricing.taxRounding),
|
|
340
|
+
currency: moneyCurrency(row.currency, moneyCurrency(pricing.currency)),
|
|
341
|
+
codes,
|
|
342
|
+
appDefaultCodeId: defaultTaxCode(rate).id,
|
|
343
|
+
customerTaxExempt: customer?.taxExempt === true,
|
|
344
|
+
partyCodeId: codeOf(customer?.defaultTaxCodeId),
|
|
345
|
+
productCodeOf: (productId) => codeOf(products(productId)?.defaultSalesTaxCodeId),
|
|
346
|
+
};
|
|
347
|
+
};
|
|
208
348
|
/** Save the model and the tables it is built together with. */
|
|
209
349
|
const persist = (model) => {
|
|
210
350
|
if (!storage)
|
|
@@ -234,37 +374,75 @@ export function createMemoryDataSource(options = {}) {
|
|
|
234
374
|
// Quota or private mode: the rows stay in memory for this visit.
|
|
235
375
|
}
|
|
236
376
|
};
|
|
237
|
-
/**
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
377
|
+
/**
|
|
378
|
+
* A document's line items: a line model that belongs to it through its own
|
|
379
|
+
* key (an Invoice's lines by `invoiceId`), never a model the lines merely
|
|
380
|
+
* point at (a Product or a TaxCode is not the document they are settled in).
|
|
381
|
+
*/
|
|
382
|
+
const lineLink = (parent) => linksOf(parent.id).find((l) => isLineModel(l.model) &&
|
|
383
|
+
ownersOf(l.model.id).some((o) => o.parent.id === parent.id && o.fk === l.fk));
|
|
384
|
+
/**
|
|
385
|
+
* Settle a parent with its lines (they are never typed in): the lines'
|
|
386
|
+
* money and the parent's totals, written back to both tables. Whether the
|
|
387
|
+
* parent was there to settle.
|
|
388
|
+
*/
|
|
389
|
+
const resync = (parent, parentId, lineWrite = false) => {
|
|
241
390
|
const link = lineLink(parent);
|
|
242
391
|
if (!link)
|
|
243
|
-
return;
|
|
392
|
+
return false;
|
|
244
393
|
const list = table(parent);
|
|
245
394
|
const index = list.findIndex((r) => r.id === parentId);
|
|
246
395
|
if (index < 0)
|
|
247
|
-
return;
|
|
248
|
-
const
|
|
249
|
-
|
|
396
|
+
return false;
|
|
397
|
+
const lineRows = table(link.model);
|
|
398
|
+
const lines = lineRows.filter((r) => r[link.fk] === parentId);
|
|
399
|
+
const row = list[index];
|
|
400
|
+
// An issued document's money is frozen, as smrt's money model freezes it
|
|
401
|
+
// when a document leaves draft: its own edits keep the stored figures,
|
|
402
|
+
// and a change to its lines is refused.
|
|
403
|
+
if (isIssuedRow(parent, row)) {
|
|
404
|
+
if (lineWrite) {
|
|
405
|
+
throw new MoneyValidationError('FROZEN_DOCUMENT', `This ${parent.name.toLowerCase()} has been issued, so its lines can no longer change.`);
|
|
406
|
+
}
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
const settled = settleWithLines(parent, row, lines, moneyContext(parent, row));
|
|
410
|
+
list[index] = settled.row;
|
|
411
|
+
for (const line of settled.lines) {
|
|
412
|
+
const at = lineRows.findIndex((r) => r.id === line.id);
|
|
413
|
+
if (at >= 0)
|
|
414
|
+
lineRows[at] = line;
|
|
415
|
+
}
|
|
416
|
+
return true;
|
|
250
417
|
};
|
|
251
|
-
/**
|
|
418
|
+
/**
|
|
419
|
+
* Settle a written row, then the parents whose totals depend on it. Throws
|
|
420
|
+
* smrt's `MoneyValidationError` for money the model refuses.
|
|
421
|
+
*/
|
|
252
422
|
const settle = (model, record) => {
|
|
253
423
|
let settled = record;
|
|
254
|
-
if (isLineModel(model)) {
|
|
255
|
-
settled = settleLine(record);
|
|
256
|
-
const list = table(model);
|
|
257
|
-
const index = list.findIndex((r) => r.id === record.id);
|
|
258
|
-
if (index >= 0)
|
|
259
|
-
list[index] = settled;
|
|
260
|
-
}
|
|
261
424
|
if (lineLink(model)) {
|
|
262
425
|
resync(model, record.id);
|
|
263
426
|
settled = table(model).find((r) => r.id === record.id) ?? settled;
|
|
264
427
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
428
|
+
if (isLineModel(model)) {
|
|
429
|
+
const owned = ownersOf(model.id).some(({ parent, fk }) => resync(parent, record[fk], true));
|
|
430
|
+
const list = table(model);
|
|
431
|
+
const index = list.findIndex((r) => r.id === record.id);
|
|
432
|
+
if (!owned && index >= 0) {
|
|
433
|
+
// A line with no document settles on its own, on the app's terms.
|
|
434
|
+
const pricing = getSamplePricing();
|
|
435
|
+
const rate = getSampleTaxRate() ?? DEFAULT_SAMPLE_TAX_RATE;
|
|
436
|
+
const alone = settleDocument([record], {
|
|
437
|
+
lineAmountType: pricing.pricesIncludeTax ? 'inclusive' : 'exclusive',
|
|
438
|
+
roundingScope: pricing.taxRounding,
|
|
439
|
+
currency: moneyCurrency(pricing.currency),
|
|
440
|
+
codes: tenantTaxCodes(rate),
|
|
441
|
+
appDefaultCodeId: defaultTaxCode(rate).id,
|
|
442
|
+
}).lines[0];
|
|
443
|
+
list[index] = alone;
|
|
444
|
+
}
|
|
445
|
+
settled = table(model).find((r) => r.id === record.id) ?? settled;
|
|
268
446
|
}
|
|
269
447
|
// What an invoice has paid follows its allocations and their payments.
|
|
270
448
|
if (tracksPayments(model)) {
|
|
@@ -286,6 +464,22 @@ export function createMemoryDataSource(options = {}) {
|
|
|
286
464
|
}
|
|
287
465
|
return settled;
|
|
288
466
|
};
|
|
467
|
+
/** Copies of the tables a write to `model` may settle, to undo a refusal. */
|
|
468
|
+
const snapshotFamily = (model) => {
|
|
469
|
+
const family = [
|
|
470
|
+
model,
|
|
471
|
+
...linksOf(model.id).map((l) => l.model),
|
|
472
|
+
...ownersOf(model.id).map((o) => o.parent),
|
|
473
|
+
];
|
|
474
|
+
return new Map(family.map((m) => [m.id, table(m).map((r) => ({ ...r }))]));
|
|
475
|
+
};
|
|
476
|
+
const restore = (snapshot) => {
|
|
477
|
+
for (const [id, rows] of snapshot) {
|
|
478
|
+
const list = tables.get(id);
|
|
479
|
+
if (list)
|
|
480
|
+
list.splice(0, list.length, ...rows);
|
|
481
|
+
}
|
|
482
|
+
};
|
|
289
483
|
const present = (model, record) => ({
|
|
290
484
|
...record,
|
|
291
485
|
...(options.defaults?.(model) ?? {}),
|
|
@@ -296,6 +490,11 @@ export function createMemoryDataSource(options = {}) {
|
|
|
296
490
|
async list(model) {
|
|
297
491
|
return table(model).map((r) => present(model, r));
|
|
298
492
|
},
|
|
493
|
+
async listWhere(model, field, value) {
|
|
494
|
+
return table(model)
|
|
495
|
+
.filter((r) => String(r[field] ?? '') === value)
|
|
496
|
+
.map((r) => present(model, r));
|
|
497
|
+
},
|
|
299
498
|
async get(model, id) {
|
|
300
499
|
const found = table(model).find((r) => r.id === id);
|
|
301
500
|
return found ? present(model, found) : undefined;
|
|
@@ -306,8 +505,17 @@ export function createMemoryDataSource(options = {}) {
|
|
|
306
505
|
...values,
|
|
307
506
|
id: nextId(model),
|
|
308
507
|
};
|
|
508
|
+
const snapshot = snapshotFamily(model);
|
|
309
509
|
table(model).push(record);
|
|
310
|
-
|
|
510
|
+
let settled;
|
|
511
|
+
try {
|
|
512
|
+
settled = settle(model, record);
|
|
513
|
+
}
|
|
514
|
+
catch (error) {
|
|
515
|
+
restore(snapshot);
|
|
516
|
+
created--;
|
|
517
|
+
throw error;
|
|
518
|
+
}
|
|
311
519
|
persist(model);
|
|
312
520
|
return { ...settled };
|
|
313
521
|
},
|
|
@@ -316,9 +524,26 @@ export function createMemoryDataSource(options = {}) {
|
|
|
316
524
|
const index = list.findIndex((r) => r.id === id);
|
|
317
525
|
if (index < 0)
|
|
318
526
|
return undefined;
|
|
319
|
-
const
|
|
527
|
+
const snapshot = snapshotFamily(model);
|
|
528
|
+
const previous = list[index];
|
|
529
|
+
const next = { ...previous, ...values, id };
|
|
320
530
|
list[index] = next;
|
|
321
|
-
|
|
531
|
+
let settled;
|
|
532
|
+
try {
|
|
533
|
+
settled = settle(model, next);
|
|
534
|
+
// A line moved to another document leaves its old one: that one
|
|
535
|
+
// settles without it (refused when it has been issued).
|
|
536
|
+
if (isLineModel(model)) {
|
|
537
|
+
for (const { parent, fk } of ownersOf(model.id)) {
|
|
538
|
+
if (previous[fk] !== next[fk])
|
|
539
|
+
resync(parent, previous[fk], true);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
catch (error) {
|
|
544
|
+
restore(snapshot);
|
|
545
|
+
throw error;
|
|
546
|
+
}
|
|
322
547
|
persist(model);
|
|
323
548
|
return { ...settled };
|
|
324
549
|
},
|
|
@@ -327,13 +552,22 @@ export function createMemoryDataSource(options = {}) {
|
|
|
327
552
|
const index = list.findIndex((r) => r.id === id);
|
|
328
553
|
if (index < 0)
|
|
329
554
|
return false;
|
|
555
|
+
const snapshot = snapshotFamily(model);
|
|
330
556
|
const [gone] = list.splice(index, 1);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
557
|
+
try {
|
|
558
|
+
const spec = allocationSpecOf(model);
|
|
559
|
+
if (spec && gone)
|
|
560
|
+
resettleInvoice(spec.invoice, gone[spec.invoiceFk]);
|
|
561
|
+
for (const { parent, fk } of ownersOf(model.id)) {
|
|
562
|
+
if (isLineModel(model) && gone)
|
|
563
|
+
resync(parent, gone[fk], true);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
catch (error) {
|
|
567
|
+
// The document refused (issued, or a sibling's code was switched
|
|
568
|
+
// off): the line stays, as it was.
|
|
569
|
+
restore(snapshot);
|
|
570
|
+
throw error;
|
|
337
571
|
}
|
|
338
572
|
persist(model);
|
|
339
573
|
return true;
|
|
@@ -28,6 +28,8 @@ export interface PlannerPaletteOptions {
|
|
|
28
28
|
add: (id: string) => void;
|
|
29
29
|
/** In-app path of a Planner tab, with the app query. */
|
|
30
30
|
href: (tab: string) => string;
|
|
31
|
+
/** The group label of the planner's tabs; defaults to "Planner". */
|
|
32
|
+
title?: string;
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* The planner's own providers: its tabs, and "Add <feature>" for every recipe
|
package/dist/features/palette.js
CHANGED
package/dist/forms/stock.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ export declare function stockSamples(models: ModelLookup): NonNullable<MemoryDat
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function stockByProduct(skus: readonly ModelRecord[], levels: readonly ModelRecord[]): Map<string, number>;
|
|
27
27
|
/** Deletes for a product and everything the forms saved under it. */
|
|
28
|
-
export declare function planProductDelete(productId: string, skus: readonly ModelRecord[], models: ModelLookup): RecordWrite[];
|
|
28
|
+
export declare function planProductDelete(productId: string, skus: readonly ModelRecord[], models: ModelLookup, productAssets?: readonly ModelRecord[]): RecordWrite[];
|
package/dist/forms/stock.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fakeId, hashString } from "../data/fakes.js";
|
|
2
2
|
import { getSamplePack } from "../data/packs.js";
|
|
3
|
+
import { planProductImageDelete } from "../products/media.js";
|
|
3
4
|
export const PRODUCT = '@happyvertical/smrt-products:Product';
|
|
4
5
|
export const VARIANT = '@happyvertical/smrt-products:ProductVariant';
|
|
5
6
|
export const SKU = '@happyvertical/smrt-products:Sku';
|
|
@@ -92,8 +93,9 @@ export function stockByProduct(skus, levels) {
|
|
|
92
93
|
return totals;
|
|
93
94
|
}
|
|
94
95
|
/** Deletes for a product and everything the forms saved under it. */
|
|
95
|
-
export function planProductDelete(productId, skus, models) {
|
|
96
|
+
export function planProductDelete(productId, skus, models, productAssets = []) {
|
|
96
97
|
return [
|
|
98
|
+
...planProductImageDelete(productId, productAssets),
|
|
97
99
|
...skus.flatMap((sku) => [
|
|
98
100
|
{ op: 'delete', model: models(STOCK_LEVEL), match: { skuId: sku.id } },
|
|
99
101
|
{ op: 'delete', model: models(SKU), id: sku.id },
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* smrt planner as a package: mount
|
|
2
|
+
* smrt planner as a package: mount `Planner` for the full app shell, or
|
|
3
|
+
* `PlannerControls` inside a host-owned shell,
|
|
3
4
|
* drive it with the typed command set (`./commands` has no UI in it), and read
|
|
4
5
|
* its plan as a compact snapshot.
|
|
5
6
|
*
|
|
@@ -12,6 +13,10 @@ export { type KitchenConfig, type KitchenEndpoint, type KitchenOutcome, type Kit
|
|
|
12
13
|
export { KITCHEN_FRAGMENT_KEY, type KitchenFragment, readKitchenFragment, } from './kitchen/fragment.ts';
|
|
13
14
|
export { createPlannerAssistant, type PlannerAssistant, type PlannerChatInference, type PlannerConfigInference, type PlannerInference, } from './planner/assistant.ts';
|
|
14
15
|
export * from './planner/commands/index.ts';
|
|
16
|
+
export { default as HostPlanner } from './planner/host/HostPlanner.svelte';
|
|
17
|
+
export { type CallKitchenTool, createHostSession, type HostPlan, type HostSession, } from './planner/host/session.svelte.ts';
|
|
15
18
|
export { plannerController } from './planner/instance.ts';
|
|
16
19
|
export { default as Planner } from './planner/Planner.svelte';
|
|
17
|
-
export
|
|
20
|
+
export { default as PlannerControls } from './planner/PlannerControls.svelte';
|
|
21
|
+
export { PLANNER_SHELL_EDGE_TOGGLES, PLANNER_SHELL_PANEL_DEFAULTS, plannerShellProps, } from './planner/shell.ts';
|
|
22
|
+
export type { PlannerBackLink, PlannerHandle, PlannerProps, } from './planner/types.ts';
|