@happyvertical/smrt-expenses 0.55.24 → 0.56.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/AGENTS.md +36 -5
- package/README.md +18 -4
- package/dist/actions/expense-actions.d.ts +77 -0
- package/dist/actions/expense-actions.d.ts.map +1 -0
- package/dist/actions/principal.d.ts +54 -0
- package/dist/actions/principal.d.ts.map +1 -0
- package/dist/chunks/{Expense-CY5jw_80.js → Expense-7afLcUTn.js} +12 -7
- package/dist/chunks/Expense-7afLcUTn.js.map +1 -0
- package/dist/chunks/ExpenseReceiptCollection-y1SlmnBS.js +304 -0
- package/dist/chunks/ExpenseReceiptCollection-y1SlmnBS.js.map +1 -0
- package/dist/chunks/expense-actions-Ce5CBaBE.js +132 -0
- package/dist/chunks/expense-actions-Ce5CBaBE.js.map +1 -0
- package/dist/chunks/principal-_1CdcvvW.js +107 -0
- package/dist/chunks/principal-_1CdcvvW.js.map +1 -0
- package/dist/collections/ExpenseCollection.d.ts +55 -3
- package/dist/collections/ExpenseCollection.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +180 -312
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +273 -8
- package/dist/models/Expense.d.ts +9 -5
- package/dist/models/Expense.d.ts.map +1 -1
- package/dist/recipes.d.ts +118 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +277 -10
- package/package.json +9 -8
- package/dist/chunks/Expense-CY5jw_80.js.map +0 -1
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-expenses",
|
|
5
|
-
"packageVersion": "0.
|
|
5
|
+
"packageVersion": "0.56.1",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-expenses:ExpenseCollection": {
|
|
8
8
|
"name": "expensecollection",
|
|
@@ -14,6 +14,94 @@
|
|
|
14
14
|
"packageName": "@happyvertical/smrt-expenses",
|
|
15
15
|
"fields": {},
|
|
16
16
|
"methods": {
|
|
17
|
+
"record": {
|
|
18
|
+
"name": "record",
|
|
19
|
+
"async": true,
|
|
20
|
+
"parameters": [
|
|
21
|
+
{
|
|
22
|
+
"name": "options",
|
|
23
|
+
"type": "RecordExpenseActionInput",
|
|
24
|
+
"optional": false
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"returnType": "Promise<Expense>",
|
|
28
|
+
"isStatic": false,
|
|
29
|
+
"isPublic": true,
|
|
30
|
+
"decoratorConfig": {
|
|
31
|
+
"httpMethod": "POST",
|
|
32
|
+
"path": "record",
|
|
33
|
+
"effect": "write",
|
|
34
|
+
"idempotent": false,
|
|
35
|
+
"openWorld": false,
|
|
36
|
+
"description": "Record a new expense for review (service-backed)."
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"attachReceipt": {
|
|
40
|
+
"name": "attachReceipt",
|
|
41
|
+
"async": true,
|
|
42
|
+
"parameters": [
|
|
43
|
+
{
|
|
44
|
+
"name": "options",
|
|
45
|
+
"type": "AttachExpenseReceiptActionInput",
|
|
46
|
+
"optional": false
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"returnType": "Promise<ExpenseReceipt>",
|
|
50
|
+
"isStatic": false,
|
|
51
|
+
"isPublic": true,
|
|
52
|
+
"decoratorConfig": {
|
|
53
|
+
"httpMethod": "POST",
|
|
54
|
+
"path": "attachReceipt",
|
|
55
|
+
"effect": "write",
|
|
56
|
+
"idempotent": false,
|
|
57
|
+
"openWorld": false,
|
|
58
|
+
"description": "Attach a receipt file to an expense (service-backed)."
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"recordReview": {
|
|
62
|
+
"name": "recordReview",
|
|
63
|
+
"async": true,
|
|
64
|
+
"parameters": [
|
|
65
|
+
{
|
|
66
|
+
"name": "options",
|
|
67
|
+
"type": "ReviewExpenseActionInput",
|
|
68
|
+
"optional": false
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"returnType": "Promise<Expense>",
|
|
72
|
+
"isStatic": false,
|
|
73
|
+
"isPublic": true,
|
|
74
|
+
"decoratorConfig": {
|
|
75
|
+
"httpMethod": "POST",
|
|
76
|
+
"path": "recordReview",
|
|
77
|
+
"effect": "write",
|
|
78
|
+
"idempotent": false,
|
|
79
|
+
"openWorld": false,
|
|
80
|
+
"description": "Approve or reject an expense with a reason (service-backed)."
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"recordReimbursement": {
|
|
84
|
+
"name": "recordReimbursement",
|
|
85
|
+
"async": true,
|
|
86
|
+
"parameters": [
|
|
87
|
+
{
|
|
88
|
+
"name": "options",
|
|
89
|
+
"type": "MarkExpenseReimbursedActionInput",
|
|
90
|
+
"optional": false
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"returnType": "Promise<Expense>",
|
|
94
|
+
"isStatic": false,
|
|
95
|
+
"isPublic": true,
|
|
96
|
+
"decoratorConfig": {
|
|
97
|
+
"httpMethod": "POST",
|
|
98
|
+
"path": "recordReimbursement",
|
|
99
|
+
"effect": "write",
|
|
100
|
+
"idempotent": false,
|
|
101
|
+
"openWorld": false,
|
|
102
|
+
"description": "Record that an expense was reimbursed (service-backed)."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
17
105
|
"forCostObject": {
|
|
18
106
|
"name": "forCostObject",
|
|
19
107
|
"async": true,
|
|
@@ -47,6 +135,20 @@
|
|
|
47
135
|
"isStatic": false,
|
|
48
136
|
"isPublic": true
|
|
49
137
|
},
|
|
138
|
+
"listReviewedTaxFacts": {
|
|
139
|
+
"name": "listReviewedTaxFacts",
|
|
140
|
+
"async": true,
|
|
141
|
+
"parameters": [
|
|
142
|
+
{
|
|
143
|
+
"name": "options",
|
|
144
|
+
"type": "ReviewedExpenseTaxFactsOptions",
|
|
145
|
+
"optional": false
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"returnType": "Promise<ReviewedExpenseTaxFact[]>",
|
|
149
|
+
"isStatic": false,
|
|
150
|
+
"isPublic": true
|
|
151
|
+
},
|
|
50
152
|
"commitmentPosition": {
|
|
51
153
|
"name": "commitmentPosition",
|
|
52
154
|
"async": true,
|
|
@@ -72,7 +174,12 @@
|
|
|
72
174
|
},
|
|
73
175
|
"decoratorConfig": {
|
|
74
176
|
"api": {
|
|
75
|
-
"include": [
|
|
177
|
+
"include": [
|
|
178
|
+
"record",
|
|
179
|
+
"attachReceipt",
|
|
180
|
+
"recordReview",
|
|
181
|
+
"recordReimbursement"
|
|
182
|
+
]
|
|
76
183
|
},
|
|
77
184
|
"mcp": {
|
|
78
185
|
"include": []
|
|
@@ -750,7 +857,8 @@
|
|
|
750
857
|
},
|
|
751
858
|
"recordedAt": {
|
|
752
859
|
"type": "datetime",
|
|
753
|
-
"required": false
|
|
860
|
+
"required": false,
|
|
861
|
+
"_meta": {}
|
|
754
862
|
},
|
|
755
863
|
"recordedByProfileId": {
|
|
756
864
|
"type": "crossPackageRef",
|
|
@@ -780,7 +888,10 @@
|
|
|
780
888
|
"commitmentId": {
|
|
781
889
|
"type": "crossPackageRef",
|
|
782
890
|
"required": false,
|
|
783
|
-
"related": "@happyvertical/smrt-commerce:
|
|
891
|
+
"related": "@happyvertical/smrt-commerce:PurchaseContract",
|
|
892
|
+
"_meta": {
|
|
893
|
+
"validateSubtype": true
|
|
894
|
+
}
|
|
784
895
|
},
|
|
785
896
|
"commitmentLineId": {
|
|
786
897
|
"type": "crossPackageRef",
|
|
@@ -836,7 +947,8 @@
|
|
|
836
947
|
},
|
|
837
948
|
"reimbursedAt": {
|
|
838
949
|
"type": "datetime",
|
|
839
|
-
"required": false
|
|
950
|
+
"required": false,
|
|
951
|
+
"_meta": {}
|
|
840
952
|
},
|
|
841
953
|
"reimbursementReference": {
|
|
842
954
|
"type": "text",
|
|
@@ -989,7 +1101,12 @@
|
|
|
989
1101
|
"decoratorConfig": {
|
|
990
1102
|
"tableName": "expenses",
|
|
991
1103
|
"api": {
|
|
992
|
-
"include": [
|
|
1104
|
+
"include": [
|
|
1105
|
+
"record",
|
|
1106
|
+
"attachReceipt",
|
|
1107
|
+
"recordReview",
|
|
1108
|
+
"recordReimbursement"
|
|
1109
|
+
]
|
|
993
1110
|
},
|
|
994
1111
|
"mcp": {
|
|
995
1112
|
"include": []
|
|
@@ -1577,27 +1694,175 @@
|
|
|
1577
1694
|
}
|
|
1578
1695
|
},
|
|
1579
1696
|
"moduleType": "smrt",
|
|
1697
|
+
"recipes": [
|
|
1698
|
+
{
|
|
1699
|
+
"id": "expenses.tracking",
|
|
1700
|
+
"className": "ExpensesRecipe",
|
|
1701
|
+
"label": "Expenses",
|
|
1702
|
+
"summary": "Record what the business spends, with receipts, and review it.",
|
|
1703
|
+
"synonyms": [
|
|
1704
|
+
"costs",
|
|
1705
|
+
"receipts",
|
|
1706
|
+
"spending",
|
|
1707
|
+
"reimbursements"
|
|
1708
|
+
],
|
|
1709
|
+
"models": [
|
|
1710
|
+
"@happyvertical/smrt-expenses:Expense",
|
|
1711
|
+
"@happyvertical/smrt-expenses:ExpenseReceipt"
|
|
1712
|
+
],
|
|
1713
|
+
"nav": [
|
|
1714
|
+
{
|
|
1715
|
+
"label": "Expenses",
|
|
1716
|
+
"model": "@happyvertical/smrt-expenses:Expense",
|
|
1717
|
+
"icon": "receipt",
|
|
1718
|
+
"description": "Costs you have paid, with the receipt and who paid."
|
|
1719
|
+
}
|
|
1720
|
+
],
|
|
1721
|
+
"requires": [],
|
|
1722
|
+
"section": {
|
|
1723
|
+
"id": "accounting",
|
|
1724
|
+
"label": "Accounting",
|
|
1725
|
+
"icon": "bank",
|
|
1726
|
+
"description": "Your books: accounts, journals and balances."
|
|
1727
|
+
},
|
|
1728
|
+
"options": {
|
|
1729
|
+
"@happyvertical/smrt-expenses:Expense": {
|
|
1730
|
+
"fields": {
|
|
1731
|
+
"description": {
|
|
1732
|
+
"order": 1,
|
|
1733
|
+
"required": true
|
|
1734
|
+
},
|
|
1735
|
+
"amount": {
|
|
1736
|
+
"order": 2
|
|
1737
|
+
},
|
|
1738
|
+
"currency": {
|
|
1739
|
+
"order": 3
|
|
1740
|
+
},
|
|
1741
|
+
"incurredOn": {
|
|
1742
|
+
"label": "Date",
|
|
1743
|
+
"order": 4,
|
|
1744
|
+
"help": "The date on the receipt, as YYYY-MM-DD."
|
|
1745
|
+
},
|
|
1746
|
+
"category": {
|
|
1747
|
+
"order": 5,
|
|
1748
|
+
"help": "One word, such as material, travel, freight or other."
|
|
1749
|
+
},
|
|
1750
|
+
"vendorId": {
|
|
1751
|
+
"label": "Vendor",
|
|
1752
|
+
"order": 6
|
|
1753
|
+
},
|
|
1754
|
+
"paidBy": {
|
|
1755
|
+
"order": 7
|
|
1756
|
+
},
|
|
1757
|
+
"paidByProfileId": {
|
|
1758
|
+
"label": "Person who paid",
|
|
1759
|
+
"order": 8,
|
|
1760
|
+
"help": "Who paid out of their own pocket, when a person paid."
|
|
1761
|
+
},
|
|
1762
|
+
"paidByName": {
|
|
1763
|
+
"order": 9
|
|
1764
|
+
},
|
|
1765
|
+
"reimbursable": {
|
|
1766
|
+
"order": 10
|
|
1767
|
+
},
|
|
1768
|
+
"costObjectId": {
|
|
1769
|
+
"label": "Charged to",
|
|
1770
|
+
"order": 11,
|
|
1771
|
+
"help": "The job, project or client the cost belongs to."
|
|
1772
|
+
},
|
|
1773
|
+
"costObjectType": {
|
|
1774
|
+
"visibility": "hidden"
|
|
1775
|
+
},
|
|
1776
|
+
"financialBreakdown": {
|
|
1777
|
+
"visibility": "hidden"
|
|
1778
|
+
},
|
|
1779
|
+
"refundOfId": {
|
|
1780
|
+
"visibility": "hidden"
|
|
1781
|
+
},
|
|
1782
|
+
"recordedByProfileId": {
|
|
1783
|
+
"visibility": "hidden"
|
|
1784
|
+
},
|
|
1785
|
+
"commitmentId": {
|
|
1786
|
+
"visibility": "hidden"
|
|
1787
|
+
},
|
|
1788
|
+
"commitmentLineId": {
|
|
1789
|
+
"visibility": "hidden"
|
|
1790
|
+
},
|
|
1791
|
+
"reviewedByProfileId": {
|
|
1792
|
+
"visibility": "hidden"
|
|
1793
|
+
},
|
|
1794
|
+
"duplicateOfId": {
|
|
1795
|
+
"visibility": "hidden"
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
},
|
|
1799
|
+
"@happyvertical/smrt-expenses:ExpenseReceipt": {
|
|
1800
|
+
"fields": {
|
|
1801
|
+
"contentSha256": {
|
|
1802
|
+
"visibility": "hidden"
|
|
1803
|
+
},
|
|
1804
|
+
"byteCount": {
|
|
1805
|
+
"visibility": "hidden"
|
|
1806
|
+
},
|
|
1807
|
+
"uploadedByProfileId": {
|
|
1808
|
+
"visibility": "hidden"
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
},
|
|
1813
|
+
"help": {
|
|
1814
|
+
"markdown": "## Overview\n\nExpenses are the costs the business pays: a receipt, who paid it and what it\nwas for. Each expense is reviewed once, and a reimbursable one is marked when\nthe person is paid back.\n\n## Tasks\n\n### Record an expense\n\n1. Create a new expense and write a short **{field:description}**.\n2. Enter the **{field:amount}** and its **{field:currency}**.\n3. Set the **{field:incurredOn}** date from the receipt and pick a\n **{field:category}**.\n4. Choose who **{field:paidBy}**: the company, a person or a third party.\n5. When a person paid, pick the **{field:paidByProfileId}** and tick\n **{field:reimbursable}** when they are owed the money back.\n\n### Review it\n\n1. Open the expense and check the receipt attached to it.\n2. **{field:reviewStatus}** moves from unreviewed to reviewed, or to rejected,\n when someone reviews it. A rejected expense can be reopened.\n",
|
|
1815
|
+
"fieldRefs": [
|
|
1816
|
+
"amount",
|
|
1817
|
+
"category",
|
|
1818
|
+
"currency",
|
|
1819
|
+
"description",
|
|
1820
|
+
"incurredOn",
|
|
1821
|
+
"paidBy",
|
|
1822
|
+
"paidByProfileId",
|
|
1823
|
+
"reimbursable",
|
|
1824
|
+
"reviewStatus"
|
|
1825
|
+
]
|
|
1826
|
+
},
|
|
1827
|
+
"demo": {
|
|
1828
|
+
"mode": "server",
|
|
1829
|
+
"reasons": [
|
|
1830
|
+
"Needs a server because its package does not build for a browser: node:crypto; and its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-commerce, @happyvertical/smrt-jobs, @happyvertical/smrt-ledgers, @happyvertical/smrt-products, @happyvertical/smrt-profiles, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-subscriptions, @happyvertical/smrt-tenancy, @happyvertical/smrt-users, which do not build for a browser (#3615, #3616, #3617, #3624, #3625, #3626, #3627)."
|
|
1831
|
+
]
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
],
|
|
1580
1835
|
"smrtDependencies": [
|
|
1581
1836
|
"@happyvertical/smrt-assets",
|
|
1582
1837
|
"@happyvertical/smrt-commerce",
|
|
1583
1838
|
"@happyvertical/smrt-core",
|
|
1584
|
-
"@happyvertical/smrt-tenancy"
|
|
1839
|
+
"@happyvertical/smrt-tenancy",
|
|
1840
|
+
"@happyvertical/smrt-users"
|
|
1585
1841
|
],
|
|
1586
1842
|
"browser": {
|
|
1587
1843
|
"status": "server-only",
|
|
1588
1844
|
"issues": [
|
|
1589
1845
|
"#3615",
|
|
1846
|
+
"#3616",
|
|
1847
|
+
"#3617",
|
|
1590
1848
|
"#3624",
|
|
1849
|
+
"#3625",
|
|
1591
1850
|
"#3626",
|
|
1592
1851
|
"#3627"
|
|
1593
1852
|
],
|
|
1594
1853
|
"reason": "node:crypto",
|
|
1595
1854
|
"via": [
|
|
1855
|
+
"@happyvertical/smrt-agents",
|
|
1596
1856
|
"@happyvertical/smrt-commerce",
|
|
1597
1857
|
"@happyvertical/smrt-jobs",
|
|
1598
1858
|
"@happyvertical/smrt-ledgers",
|
|
1859
|
+
"@happyvertical/smrt-products",
|
|
1860
|
+
"@happyvertical/smrt-profiles",
|
|
1861
|
+
"@happyvertical/smrt-reports",
|
|
1862
|
+
"@happyvertical/smrt-secrets",
|
|
1599
1863
|
"@happyvertical/smrt-subscriptions",
|
|
1600
|
-
"@happyvertical/smrt-tenancy"
|
|
1864
|
+
"@happyvertical/smrt-tenancy",
|
|
1865
|
+
"@happyvertical/smrt-users"
|
|
1601
1866
|
]
|
|
1602
1867
|
},
|
|
1603
1868
|
"stampsConstructors": true
|
package/dist/models/Expense.d.ts
CHANGED
|
@@ -24,9 +24,13 @@ import { type ExpenseCostBasis, type ExpenseFinancialBreakdown, type ExpenseOpti
|
|
|
24
24
|
* - **Commitment** — optional commerce `Contract` (usually a `PurchaseOrder`)
|
|
25
25
|
* or one of its lines that this actual draws down.
|
|
26
26
|
*
|
|
27
|
-
* The generated
|
|
28
|
-
*
|
|
29
|
-
* expenses through their own routes
|
|
27
|
+
* The generated CRUD surface is closed: cost visibility is permission-gated
|
|
28
|
+
* by every consumer, and generated reads check no read permission, so hosts
|
|
29
|
+
* list expenses through their own routes. The only generated writes are the
|
|
30
|
+
* service-backed actions on {@link ExpenseCollection} (#4001); the runtime
|
|
31
|
+
* REST transport gates a collection-hosted action on this item allowlist.
|
|
32
|
+
* Their names differ from this class's own methods, so allowlisting them never
|
|
33
|
+
* opens `review()` or `markReimbursed()`, which take the actor as input.
|
|
30
34
|
*/
|
|
31
35
|
export declare class Expense extends SmrtObject {
|
|
32
36
|
/** Owning tenant. Nullable: optional tenancy, like every commerce model. */
|
|
@@ -69,8 +73,8 @@ export declare class Expense extends SmrtObject {
|
|
|
69
73
|
/** Optional commerce vendor the cost was paid to. */
|
|
70
74
|
vendorId: string | null;
|
|
71
75
|
/**
|
|
72
|
-
* Optional commitment this actual draws down
|
|
73
|
-
*
|
|
76
|
+
* Optional purchase commitment this actual draws down (normally a
|
|
77
|
+
* `PurchaseOrder`). Must be in the same currency and tenant.
|
|
74
78
|
*/
|
|
75
79
|
commitmentId: string | null;
|
|
76
80
|
/** Optional line of {@link Expense.commitmentId} this actual draws down. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expense.d.ts","sourceRoot":"","sources":["../../src/models/Expense.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAOL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AAsFrB
|
|
1
|
+
{"version":3,"file":"Expense.d.ts","sourceRoot":"","sources":["../../src/models/Expense.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declared recipes for smrt-expenses (#3590, #3604): user-facing units of
|
|
3
|
+
* functionality an app or agent can pick instead of the whole package.
|
|
4
|
+
* The scanner reads these statics into the `recipes` array of `manifest.json`
|
|
5
|
+
* and `smrt-knowledge.json`; nothing here runs at that point.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import { SmrtRecipe } from '@happyvertical/smrt-core';
|
|
10
|
+
import { Expense } from './models/Expense.js';
|
|
11
|
+
import { ExpenseReceipt } from './models/ExpenseReceipt.js';
|
|
12
|
+
/** Expenses: Record what the business spends, with receipts, and review it. */
|
|
13
|
+
export declare class ExpensesRecipe extends SmrtRecipe {
|
|
14
|
+
static id: string;
|
|
15
|
+
static help: string;
|
|
16
|
+
static label: string;
|
|
17
|
+
static summary: string;
|
|
18
|
+
static synonyms: string[];
|
|
19
|
+
static section: {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
icon: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
static models: (typeof ExpenseReceipt | typeof Expense)[];
|
|
26
|
+
static nav: {
|
|
27
|
+
label: string;
|
|
28
|
+
model: typeof Expense;
|
|
29
|
+
icon: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}[];
|
|
32
|
+
static options: {
|
|
33
|
+
readonly Expense: {
|
|
34
|
+
readonly fields: {
|
|
35
|
+
readonly description: {
|
|
36
|
+
readonly order: 1;
|
|
37
|
+
readonly required: true;
|
|
38
|
+
};
|
|
39
|
+
readonly amount: {
|
|
40
|
+
readonly order: 2;
|
|
41
|
+
};
|
|
42
|
+
readonly currency: {
|
|
43
|
+
readonly order: 3;
|
|
44
|
+
};
|
|
45
|
+
readonly incurredOn: {
|
|
46
|
+
readonly label: "Date";
|
|
47
|
+
readonly order: 4;
|
|
48
|
+
readonly help: "The date on the receipt, as YYYY-MM-DD.";
|
|
49
|
+
};
|
|
50
|
+
readonly category: {
|
|
51
|
+
readonly order: 5;
|
|
52
|
+
readonly help: "One word, such as material, travel, freight or other.";
|
|
53
|
+
};
|
|
54
|
+
readonly vendorId: {
|
|
55
|
+
readonly label: "Vendor";
|
|
56
|
+
readonly order: 6;
|
|
57
|
+
};
|
|
58
|
+
readonly paidBy: {
|
|
59
|
+
readonly order: 7;
|
|
60
|
+
};
|
|
61
|
+
readonly paidByProfileId: {
|
|
62
|
+
readonly label: "Person who paid";
|
|
63
|
+
readonly order: 8;
|
|
64
|
+
readonly help: "Who paid out of their own pocket, when a person paid.";
|
|
65
|
+
};
|
|
66
|
+
readonly paidByName: {
|
|
67
|
+
readonly order: 9;
|
|
68
|
+
};
|
|
69
|
+
readonly reimbursable: {
|
|
70
|
+
readonly order: 10;
|
|
71
|
+
};
|
|
72
|
+
readonly costObjectId: {
|
|
73
|
+
readonly label: "Charged to";
|
|
74
|
+
readonly order: 11;
|
|
75
|
+
readonly help: "The job, project or client the cost belongs to.";
|
|
76
|
+
};
|
|
77
|
+
readonly costObjectType: {
|
|
78
|
+
readonly visibility: "hidden";
|
|
79
|
+
};
|
|
80
|
+
readonly financialBreakdown: {
|
|
81
|
+
readonly visibility: "hidden";
|
|
82
|
+
};
|
|
83
|
+
readonly refundOfId: {
|
|
84
|
+
readonly visibility: "hidden";
|
|
85
|
+
};
|
|
86
|
+
readonly recordedByProfileId: {
|
|
87
|
+
readonly visibility: "hidden";
|
|
88
|
+
};
|
|
89
|
+
readonly commitmentId: {
|
|
90
|
+
readonly visibility: "hidden";
|
|
91
|
+
};
|
|
92
|
+
readonly commitmentLineId: {
|
|
93
|
+
readonly visibility: "hidden";
|
|
94
|
+
};
|
|
95
|
+
readonly reviewedByProfileId: {
|
|
96
|
+
readonly visibility: "hidden";
|
|
97
|
+
};
|
|
98
|
+
readonly duplicateOfId: {
|
|
99
|
+
readonly visibility: "hidden";
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
readonly ExpenseReceipt: {
|
|
104
|
+
readonly fields: {
|
|
105
|
+
readonly contentSha256: {
|
|
106
|
+
readonly visibility: "hidden";
|
|
107
|
+
};
|
|
108
|
+
readonly byteCount: {
|
|
109
|
+
readonly visibility: "hidden";
|
|
110
|
+
};
|
|
111
|
+
readonly uploadedByProfileId: {
|
|
112
|
+
readonly visibility: "hidden";
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=recipes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,+EAA+E;AAC/E,qBAAa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,EAAE,SAAuB;IAChC,MAAM,CAAC,IAAI,SAA0B;IACrC,MAAM,CAAC,KAAK,SAAc;IAC1B,MAAM,CAAC,OAAO,SACqD;IACnE,MAAM,CAAC,QAAQ,WAAuD;IACtE,MAAM,CAAC,OAAO;;;;;MAKZ;IACF,MAAM,CAAC,MAAM,6CAA6B;IAC1C,MAAM,CAAC,GAAG;;;;;QAOR;IACF,MAAM,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8CH;CACZ"}
|