cxtms 1.9.13

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.
Files changed (215) hide show
  1. package/README.md +384 -0
  2. package/dist/cli.d.ts +6 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +4784 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/extractUtils.d.ts +11 -0
  7. package/dist/extractUtils.d.ts.map +1 -0
  8. package/dist/extractUtils.js +19 -0
  9. package/dist/extractUtils.js.map +1 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +11 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/types.d.ts +129 -0
  15. package/dist/types.d.ts.map +1 -0
  16. package/dist/types.js +6 -0
  17. package/dist/types.js.map +1 -0
  18. package/dist/utils/schemaLoader.d.ts +17 -0
  19. package/dist/utils/schemaLoader.d.ts.map +1 -0
  20. package/dist/utils/schemaLoader.js +134 -0
  21. package/dist/utils/schemaLoader.js.map +1 -0
  22. package/dist/validator.d.ts +72 -0
  23. package/dist/validator.d.ts.map +1 -0
  24. package/dist/validator.js +432 -0
  25. package/dist/validator.js.map +1 -0
  26. package/dist/workflowValidator.d.ts +103 -0
  27. package/dist/workflowValidator.d.ts.map +1 -0
  28. package/dist/workflowValidator.js +753 -0
  29. package/dist/workflowValidator.js.map +1 -0
  30. package/package.json +51 -0
  31. package/schemas/actions/all.json +27 -0
  32. package/schemas/actions/clipboard.json +46 -0
  33. package/schemas/actions/confirm.json +21 -0
  34. package/schemas/actions/consoleLog.json +16 -0
  35. package/schemas/actions/dialog.json +25 -0
  36. package/schemas/actions/fileDownload.json +16 -0
  37. package/schemas/actions/forEach.json +31 -0
  38. package/schemas/actions/if.json +12 -0
  39. package/schemas/actions/mutation.json +25 -0
  40. package/schemas/actions/navigate.json +18 -0
  41. package/schemas/actions/navigateBack.json +22 -0
  42. package/schemas/actions/navigateBackOrClose.json +21 -0
  43. package/schemas/actions/notification.json +19 -0
  44. package/schemas/actions/openBarcodeScanner.json +104 -0
  45. package/schemas/actions/query.json +32 -0
  46. package/schemas/actions/refresh.json +13 -0
  47. package/schemas/actions/resetDirtyState.json +22 -0
  48. package/schemas/actions/setFields.json +21 -0
  49. package/schemas/actions/setStore.json +13 -0
  50. package/schemas/actions/validateForm.json +15 -0
  51. package/schemas/actions/workflow.json +24 -0
  52. package/schemas/components/README.md +147 -0
  53. package/schemas/components/appComponent.json +58 -0
  54. package/schemas/components/barcodeScanner.json +69 -0
  55. package/schemas/components/button.json +123 -0
  56. package/schemas/components/calendar.json +489 -0
  57. package/schemas/components/card.json +176 -0
  58. package/schemas/components/collection.json +54 -0
  59. package/schemas/components/dataGrid.json +119 -0
  60. package/schemas/components/datasource.json +151 -0
  61. package/schemas/components/dropdown.json +57 -0
  62. package/schemas/components/field-collection.json +618 -0
  63. package/schemas/components/field.json +265 -0
  64. package/schemas/components/form.json +234 -0
  65. package/schemas/components/index.json +71 -0
  66. package/schemas/components/layout.json +69 -0
  67. package/schemas/components/module.json +167 -0
  68. package/schemas/components/navDropdown.json +36 -0
  69. package/schemas/components/navbar.json +78 -0
  70. package/schemas/components/navbarItem.json +28 -0
  71. package/schemas/components/navbarLink.json +36 -0
  72. package/schemas/components/row.json +31 -0
  73. package/schemas/components/slot.json +30 -0
  74. package/schemas/components/tab.json +34 -0
  75. package/schemas/components/tabs.json +35 -0
  76. package/schemas/components/timeline.json +172 -0
  77. package/schemas/components/timelineGrid.json +328 -0
  78. package/schemas/fields/README.md +66 -0
  79. package/schemas/fields/attachment.json +156 -0
  80. package/schemas/fields/autocomplete-googleplaces.json +130 -0
  81. package/schemas/fields/checkbox.json +82 -0
  82. package/schemas/fields/date.json +88 -0
  83. package/schemas/fields/datetime.json +75 -0
  84. package/schemas/fields/email.json +75 -0
  85. package/schemas/fields/index.json +53 -0
  86. package/schemas/fields/number.json +91 -0
  87. package/schemas/fields/password.json +70 -0
  88. package/schemas/fields/radio.json +94 -0
  89. package/schemas/fields/rangedatetime.json +56 -0
  90. package/schemas/fields/select-async.json +334 -0
  91. package/schemas/fields/select.json +115 -0
  92. package/schemas/fields/tel.json +79 -0
  93. package/schemas/fields/text.json +86 -0
  94. package/schemas/fields/textarea.json +95 -0
  95. package/schemas/fields/time.json +91 -0
  96. package/schemas/fields/url.json +74 -0
  97. package/schemas/schema.graphql +12248 -0
  98. package/schemas/schemas.json +610 -0
  99. package/schemas/workflows/activity.json +96 -0
  100. package/schemas/workflows/common/condition.json +48 -0
  101. package/schemas/workflows/common/expression.json +76 -0
  102. package/schemas/workflows/common/mapping.json +173 -0
  103. package/schemas/workflows/common/step.json +38 -0
  104. package/schemas/workflows/flow/aggregation.json +44 -0
  105. package/schemas/workflows/flow/entity.json +129 -0
  106. package/schemas/workflows/flow/state.json +105 -0
  107. package/schemas/workflows/flow/transition.json +143 -0
  108. package/schemas/workflows/input.json +122 -0
  109. package/schemas/workflows/output.json +61 -0
  110. package/schemas/workflows/schedule.json +26 -0
  111. package/schemas/workflows/tasks/accounting-transaction.json +95 -0
  112. package/schemas/workflows/tasks/action-event.json +65 -0
  113. package/schemas/workflows/tasks/all.json +152 -0
  114. package/schemas/workflows/tasks/appmodule.json +56 -0
  115. package/schemas/workflows/tasks/attachment.json +97 -0
  116. package/schemas/workflows/tasks/authentication.json +86 -0
  117. package/schemas/workflows/tasks/caching.json +68 -0
  118. package/schemas/workflows/tasks/charge.json +92 -0
  119. package/schemas/workflows/tasks/commodity.json +92 -0
  120. package/schemas/workflows/tasks/contact-address.json +72 -0
  121. package/schemas/workflows/tasks/contact-payment-method.json +72 -0
  122. package/schemas/workflows/tasks/contact.json +82 -0
  123. package/schemas/workflows/tasks/csv.json +81 -0
  124. package/schemas/workflows/tasks/document-render.json +105 -0
  125. package/schemas/workflows/tasks/document-send.json +84 -0
  126. package/schemas/workflows/tasks/edi.json +157 -0
  127. package/schemas/workflows/tasks/email-send.json +110 -0
  128. package/schemas/workflows/tasks/error.json +72 -0
  129. package/schemas/workflows/tasks/export.json +90 -0
  130. package/schemas/workflows/tasks/filetransfer.json +102 -0
  131. package/schemas/workflows/tasks/flow-transition.json +68 -0
  132. package/schemas/workflows/tasks/foreach.json +69 -0
  133. package/schemas/workflows/tasks/generic.json +47 -0
  134. package/schemas/workflows/tasks/graphql.json +78 -0
  135. package/schemas/workflows/tasks/httpRequest.json +161 -0
  136. package/schemas/workflows/tasks/import.json +64 -0
  137. package/schemas/workflows/tasks/inventory.json +67 -0
  138. package/schemas/workflows/tasks/job.json +88 -0
  139. package/schemas/workflows/tasks/log.json +73 -0
  140. package/schemas/workflows/tasks/map.json +58 -0
  141. package/schemas/workflows/tasks/movement.json +54 -0
  142. package/schemas/workflows/tasks/note.json +59 -0
  143. package/schemas/workflows/tasks/number.json +65 -0
  144. package/schemas/workflows/tasks/order-tracking-event.json +109 -0
  145. package/schemas/workflows/tasks/order.json +139 -0
  146. package/schemas/workflows/tasks/payment.json +85 -0
  147. package/schemas/workflows/tasks/pdf-document.json +60 -0
  148. package/schemas/workflows/tasks/postal-codes.json +92 -0
  149. package/schemas/workflows/tasks/resolve-timezone.json +65 -0
  150. package/schemas/workflows/tasks/setVariable.json +76 -0
  151. package/schemas/workflows/tasks/switch.json +75 -0
  152. package/schemas/workflows/tasks/template.json +73 -0
  153. package/schemas/workflows/tasks/tracking-event.json +137 -0
  154. package/schemas/workflows/tasks/transmission.json +185 -0
  155. package/schemas/workflows/tasks/unzip-file.json +68 -0
  156. package/schemas/workflows/tasks/user.json +70 -0
  157. package/schemas/workflows/tasks/validation.json +99 -0
  158. package/schemas/workflows/tasks/while.json +53 -0
  159. package/schemas/workflows/tasks/workflow-execute.json +82 -0
  160. package/schemas/workflows/trigger.json +90 -0
  161. package/schemas/workflows/variable.json +46 -0
  162. package/schemas/workflows/workflow.json +335 -0
  163. package/scripts/postinstall.js +291 -0
  164. package/scripts/setup-vscode.js +80 -0
  165. package/skills/cxtms-developer/SKILL.md +118 -0
  166. package/skills/cxtms-developer/ref-cli-auth.md +120 -0
  167. package/skills/cxtms-developer/ref-entity-accounting.md +180 -0
  168. package/skills/cxtms-developer/ref-entity-commodity.md +239 -0
  169. package/skills/cxtms-developer/ref-entity-contact.md +163 -0
  170. package/skills/cxtms-developer/ref-entity-geography.md +154 -0
  171. package/skills/cxtms-developer/ref-entity-job.md +77 -0
  172. package/skills/cxtms-developer/ref-entity-notification.md +85 -0
  173. package/skills/cxtms-developer/ref-entity-order-sub.md +160 -0
  174. package/skills/cxtms-developer/ref-entity-order.md +183 -0
  175. package/skills/cxtms-developer/ref-entity-organization.md +41 -0
  176. package/skills/cxtms-developer/ref-entity-rate.md +182 -0
  177. package/skills/cxtms-developer/ref-entity-shared.md +176 -0
  178. package/skills/cxtms-developer/ref-entity-warehouse.md +115 -0
  179. package/skills/cxtms-developer/ref-graphql-query.md +309 -0
  180. package/skills/cxtms-module-builder/SKILL.md +477 -0
  181. package/skills/cxtms-module-builder/ref-components-data.md +293 -0
  182. package/skills/cxtms-module-builder/ref-components-display.md +411 -0
  183. package/skills/cxtms-module-builder/ref-components-forms.md +369 -0
  184. package/skills/cxtms-module-builder/ref-components-interactive.md +317 -0
  185. package/skills/cxtms-module-builder/ref-components-layout.md +390 -0
  186. package/skills/cxtms-module-builder/ref-components-specialized.md +477 -0
  187. package/skills/cxtms-workflow-builder/SKILL.md +438 -0
  188. package/skills/cxtms-workflow-builder/ref-accounting.md +66 -0
  189. package/skills/cxtms-workflow-builder/ref-communication.md +169 -0
  190. package/skills/cxtms-workflow-builder/ref-entity.md +342 -0
  191. package/skills/cxtms-workflow-builder/ref-expressions-ncalc.md +128 -0
  192. package/skills/cxtms-workflow-builder/ref-expressions-template.md +161 -0
  193. package/skills/cxtms-workflow-builder/ref-filetransfer.md +80 -0
  194. package/skills/cxtms-workflow-builder/ref-flow.md +210 -0
  195. package/skills/cxtms-workflow-builder/ref-other.md +157 -0
  196. package/skills/cxtms-workflow-builder/ref-query.md +105 -0
  197. package/skills/cxtms-workflow-builder/ref-utilities.md +417 -0
  198. package/templates/module-configuration.yaml +44 -0
  199. package/templates/module-form.yaml +152 -0
  200. package/templates/module-grid.yaml +229 -0
  201. package/templates/module-select.yaml +139 -0
  202. package/templates/module.yaml +84 -0
  203. package/templates/workflow-api-tracking.yaml +189 -0
  204. package/templates/workflow-basic.yaml +76 -0
  205. package/templates/workflow-document.yaml +155 -0
  206. package/templates/workflow-entity-trigger.yaml +90 -0
  207. package/templates/workflow-ftp-edi.yaml +158 -0
  208. package/templates/workflow-ftp-tracking.yaml +161 -0
  209. package/templates/workflow-mcp-tool.yaml +112 -0
  210. package/templates/workflow-public-api.yaml +135 -0
  211. package/templates/workflow-scheduled-execute.yaml +75 -0
  212. package/templates/workflow-scheduled.yaml +125 -0
  213. package/templates/workflow-utility.yaml +96 -0
  214. package/templates/workflow-webhook.yaml +128 -0
  215. package/templates/workflow.yaml +140 -0
@@ -0,0 +1,180 @@
1
+ # Accounting Transaction Entity Field Reference
2
+
3
+ ## Contents
4
+ - AccountingTransaction Fields
5
+ - Charge Entity
6
+ - Payment Entity
7
+ - Accounting Enums
8
+ - Accounting CustomValues
9
+
10
+ Field names as used in workflow expressions: `{{ entity.transactionNumber }}`, `{{ entity.customValues.myField }}`.
11
+
12
+ ## AccountingTransaction Fields
13
+
14
+ ### Scalar Fields
15
+
16
+ | Field | Type | Notes |
17
+ |-------|------|-------|
18
+ | `accountingTransactionId` | `int` | Primary key |
19
+ | `organizationId` | `int` | Tenant scope |
20
+ | `divisionId` | `int` | Division scope |
21
+ | `transactionNumber` | `string` | Business-facing number |
22
+ | `transactionDate` | `DateTime` | Date of transaction |
23
+ | `dueDate` | `DateTime` | Payment due date |
24
+ | `paidDate` | `DateTime?` | When fully paid |
25
+ | `accountingTransactionType` | `AccountingTransactionType` enum | Invoice, Bill, CreditMemo |
26
+ | `accountingTransactionStatus` | `AccountingTransactionStatus` enum | Open, Paid, Void |
27
+ | `amountDue` | `decimal` | Charges total minus payments |
28
+ | `amountPaid` | `decimal` | Sum of applied payments |
29
+ | `paidAs` | `PaidAs` enum | Prepaid, Collect |
30
+ | `isDraft` | `bool` | Not yet submitted |
31
+ | `note` | `string?` | |
32
+ | `accountId` | `int?` | FK to AccountingAccount |
33
+ | `applyToContactID` | `int?` | FK to Contact (customer/vendor) |
34
+ | `billToContactAddressId` | `int?` | FK to ContactAddress |
35
+ | `paymentTermsId` | `int?` | FK to PaymentTerm |
36
+ | `created` | `DateTime` | |
37
+ | `createdBy` | `string` | User ID |
38
+ | `lastModified` | `DateTime` | |
39
+ | `lastModifiedBy` | `string` | User ID |
40
+
41
+ ### Navigation Properties
42
+
43
+ | Field | Type | Notes |
44
+ |-------|------|-------|
45
+ | `applyToContact` | `Contact` | Customer or vendor |
46
+ | `billToContactAddress` | `ContactAddress` | Billing address |
47
+ | `division` | `Division` | |
48
+ | `organization` | `Organization` | |
49
+ | `paymentTerm` | `PaymentTerm` | |
50
+ | `account` | `AccountingAccount` | |
51
+ | `createdUser` | `User` | |
52
+ | `updatedUser` | `User` | |
53
+
54
+ ### Collection Properties
55
+
56
+ | Field | Type | Notes |
57
+ |-------|------|-------|
58
+ | `charges` | `[Charge]` | Via AccountingTransactionCharges join |
59
+ | `payments` | `[Payment]` | Via AccountingTransactionPayment join |
60
+ | `jobs` | `[Job]` | Via JobAccountingTransaction join |
61
+
62
+ ### Computed/Resolved GraphQL Fields
63
+
64
+ | Field | Returns | Notes |
65
+ |-------|---------|-------|
66
+ | `getChargesTotalAmount` | `decimal` | Sum of non-void charges |
67
+ | `getAmountDue` | `decimal` | Charges total minus amountPaid |
68
+ | `getRelatedOrders(filter, orderBy)` | `[Order]` | Orders linked via charges |
69
+ | `getRelatedOrdersByOrderType(orderType)` | `[Order]` | Filtered by order type |
70
+ | `getRelatedOrderByOrderType(orderType)` | `Order` | First match |
71
+ | `changeHistory(startDate, endDate, maxResults)` | `[ChangeHistory]` | Audit trail |
72
+
73
+ ---
74
+
75
+ ## Charge Entity
76
+
77
+ | Field | Type | Notes |
78
+ |-------|------|-------|
79
+ | `chargeId` | `int` | Primary key |
80
+ | `organizationId` | `int?` | |
81
+ | `description` | `string?` | |
82
+ | `chargeType` | `ChargeType` enum | Income, Expense, Credit |
83
+ | `chargeStatus` | `ChargeStatus` enum | Pending, Open, Posted, Paid, Void |
84
+ | `amount` | `decimal` | Calculated: `quantity * price` |
85
+ | `price` | `decimal` | Unit price |
86
+ | `quantity` | `decimal` | |
87
+ | `unit` | `string?` | e.g., "TV", "Pallet", "Kg" |
88
+ | `applyBy` | `ApplyBy` enum | Pieces, Weight, ChargeableWeight, Volume, Container, Calculated, FlatRate |
89
+ | `applyToContactId` | `int` | FK to Contact (who pays) |
90
+ | `paidAs` | `PaidAs` enum | Prepaid, Collect |
91
+ | `currencyId` | `int` | FK to Currency |
92
+ | `accountingItemId` | `int` | FK to AccountingItem |
93
+ | `salesTaxId` | `int?` | FK to SalesTax |
94
+ | `salesTaxRate` | `decimal` | |
95
+ | `salesTaxAmount` | `decimal` | Computed: `salesTaxRate * amount` |
96
+ | `totalAmount` | `decimal` | Computed: `amount + salesTaxAmount` |
97
+ | `showInDocuments` | `bool` | |
98
+ | `isConsolidated` | `bool` | |
99
+ | `allowAutomaticUpdate` | `bool` | |
100
+ | `note` | `string?` | |
101
+ | `rateId` | `int?` | FK to Rate |
102
+ | `customValues` | `Dictionary` | Own customValues |
103
+
104
+ **Navigation:** `applyToContact`, `currency`, `accountingItem`, `salesTax`, `rate`, `orders` (many-to-many)
105
+
106
+ ---
107
+
108
+ ## Payment Entity
109
+
110
+ | Field | Type | Notes |
111
+ |-------|------|-------|
112
+ | `paymentId` | `int` | Primary key |
113
+ | `organizationId` | `int` | |
114
+ | `divisionId` | `int` | |
115
+ | `applyToContactId` | `int` | FK to Contact |
116
+ | `amountReceived` | `decimal` | Total payment amount |
117
+ | `currencyId` | `int` | FK to Currency |
118
+ | `paymentDate` | `DateTime` | |
119
+ | `checkNumber` | `string` | |
120
+ | `memo` | `string` | |
121
+ | `accountingAccountId` | `int` | FK to AccountingAccount |
122
+ | `paymentStatus` | `PaymentStatus` enum | Posted=1, Void=2 |
123
+ | `customValues` | `Dictionary` | Own customValues |
124
+
125
+ **Navigation:** `applyToContact`, `currency`, `accountingAccount`, `division`, `organization`, `accountingTransactions` (many-to-many)
126
+
127
+ **Join entity `AccountingTransactionPayment`** has `amountApplied` field — the amount from this payment applied to a specific transaction.
128
+
129
+ ---
130
+
131
+ ## Enums
132
+
133
+ ### AccountingTransactionType
134
+ | Value | Int | Description |
135
+ |-------|-----|-------------|
136
+ | `Invoice` | 0 | Revenue — billed to customer |
137
+ | `Bill` | 1 | Expense — owed to vendor |
138
+ | `CreditMemo` | 2 | Credit adjustment |
139
+
140
+ ### AccountingTransactionStatus
141
+ `Open=0`, `Paid=1`, `Void=2`
142
+
143
+ ### ChargeType
144
+ `Income`, `Expense`, `Credit`
145
+
146
+ ### ChargeStatus
147
+ `Pending`, `Open`, `Posted`, `Paid`, `Void`
148
+
149
+ ### ApplyBy
150
+ `Pieces`, `Weight`, `ChargeableWeight`, `Volume`, `Container`, `Calculated`, `FlatRate`
151
+
152
+ ### PaymentStatus
153
+ `Posted=1`, `Void=2`
154
+
155
+ ### PaidAs
156
+ `Prepaid=0`, `Collect=1`
157
+
158
+ ---
159
+
160
+ ## CustomValues
161
+
162
+ `Dictionary<string, object?>` stored as PostgreSQL `jsonb`. Present on:
163
+ - `AccountingTransaction.customValues`
164
+ - `Charge.customValues`
165
+ - `Payment.customValues`
166
+
167
+ ```yaml
168
+ # Access in workflow expressions
169
+ invoiceNumber: "{{ entity.transactionNumber }}"
170
+ customerName: "{{ entity.applyToContact.name }}"
171
+ customField: "{{ entity.customValues.myField }}"
172
+
173
+ # Charge access via collection
174
+ chargeAmount: "{{ entity.charges[0].amount }}"
175
+
176
+ # NCalc conditions
177
+ conditions:
178
+ - expression: "[entity.accountingTransactionStatus] = 'Open'"
179
+ - expression: "[entity.amountDue] > 0"
180
+ ```
@@ -0,0 +1,239 @@
1
+ # Commodity Entity Field Reference
2
+
3
+ ## Contents
4
+ - Commodity Scalar Fields
5
+ - Commodity Navigation Properties
6
+ - Commodity Collection Properties
7
+ - Commodity Computed/Resolved GraphQL Fields
8
+ - Commodity Container/Child Pattern (Self-Referencing)
9
+ - CommodityTrackingNumber Sub-Entity
10
+ - OrderCommodity Join Entity
11
+ - Commodity Enums
12
+ - Commodity CustomValues
13
+ - CommodityEvent (Bridge Entity)
14
+
15
+ Field names as used in workflow expressions: `{{ entity.description }}`, `{{ entity.customValues.myField }}`.
16
+
17
+ ## Scalar Fields
18
+
19
+ | Field | Type | Notes |
20
+ |-------|------|-------|
21
+ | `commodityId` | `int` | Primary key |
22
+ | `organizationId` | `int` | Tenant scope |
23
+ | `description` | `string` | Required |
24
+ | `pieces` | `int` | Number of pieces |
25
+ | `quantity` | `int?` | Inner quantity per piece |
26
+ | `unit` | `string?` | Unit of measure (e.g., "TV", "Pallet", "Kg") |
27
+ | `note` | `string?` | |
28
+ | `serialNumber` | `string?` | Domain only (not in GraphQL) |
29
+ | `isDeleted` | `bool?` | Soft delete |
30
+
31
+ ### Weight Fields
32
+
33
+ | Field | Type | Notes |
34
+ |-------|------|-------|
35
+ | `weight` | `decimal?` | Per piece (or total if `weightByTotal`) |
36
+ | `weightTotal` | `decimal?` | Calculated: `weight * pieces` |
37
+ | `weightUnit` | `WeightUnit` enum | Lb, Kg |
38
+ | `weightByTotal` | `bool` | When true, weight = sum of children |
39
+
40
+ ### Dimension Fields
41
+
42
+ | Field | Type | Notes |
43
+ |-------|------|-------|
44
+ | `length` | `decimal?` | |
45
+ | `width` | `decimal?` | |
46
+ | `height` | `decimal?` | |
47
+ | `dimensionsUnit` | `DimensionsUnit` enum | In, Cm, M, Ft |
48
+
49
+ ### Volume Fields
50
+
51
+ | Field | Type | Notes |
52
+ |-------|------|-------|
53
+ | `volumePiece` | `decimal?` | Calculated: `L * W * H` converted to volumeUnit |
54
+ | `volumeTotal` | `decimal?` | Calculated: `pieces * volumePiece` |
55
+ | `volumeUnit` | `VolumeUnit` enum | Ft, Vlb, Vkg, M, In, Cm |
56
+
57
+ ### Value Fields
58
+
59
+ | Field | Type | Notes |
60
+ |-------|------|-------|
61
+ | `unitaryValue` | `decimal?` | Value per unit |
62
+ | `unitaryValueTotal` | `decimal?` | Calculated: `unitaryValue * quantity * pieces` |
63
+ | `valueByTotal` | `bool` | When true, value = sum of children |
64
+
65
+ ### Foreign Keys
66
+
67
+ | Field | Type | Notes |
68
+ |-------|------|-------|
69
+ | `commodityStatusId` | `int?` | FK to CommodityStatus |
70
+ | `commodityTypeId` | `int?` | FK to CommodityType |
71
+ | `packageTypeId` | `int?` | FK to PackageType |
72
+ | `warehouseLocationId` | `int?` | FK — cascades to children |
73
+ | `containerCommodityId` | `int?` | FK self-ref (parent commodity) |
74
+ | `jobId` | `Guid?` | FK to Job |
75
+ | `inventoryItemId` | `int?` | FK to InventoryItem |
76
+ | `billToContactId` | `int?` | FK to Contact |
77
+ | `created` | `DateTime` | |
78
+ | `createdBy` | `string` | User ID |
79
+ | `lastModified` | `DateTime` | |
80
+ | `lastModifiedBy` | `string` | User ID |
81
+
82
+ ## Navigation Properties
83
+
84
+ | Field | Type | Notes |
85
+ |-------|------|-------|
86
+ | `commodityStatus` | `CommodityStatus` | `.statusName`, `.statusStage` |
87
+ | `commodityType` | `CommodityType` | `.code`, `.description` |
88
+ | `packageType` | `PackageType` | `.name` |
89
+ | `warehouseLocation` | `WarehouseLocation` | |
90
+ | `containerCommodity` | `Commodity` | Parent commodity |
91
+ | `job` | `Job` | |
92
+ | `inventoryItem` | `InventoryItem` | |
93
+ | `billToContact` | `Contact` | |
94
+ | `createdUser` | `User` | |
95
+ | `updatedUser` | `User` | |
96
+
97
+ ## Collection Properties
98
+
99
+ | Field | Type | Notes |
100
+ |-------|------|-------|
101
+ | `containerCommodities` | `[Commodity]` | Child commodities in this container |
102
+ | `orderCommodities` | `[OrderCommodity]` | Join to orders (has own `customValues`) |
103
+ | `commodityTrackingNumbers` | `[CommodityTrackingNumber]` | Tracking numbers |
104
+ | `commodityTags` | `[CommodityTag]` | Tags (has own `customValues`) |
105
+ | `allTags` | `[CommodityAllTagsView]` | View: includes inherited tags |
106
+ | `trackingEvents` | `[TrackingEvent]` | |
107
+ | `shipments` | `[Order]` | Related orders (GraphQL) |
108
+
109
+ ## Computed/Resolved GraphQL Fields
110
+
111
+ | Field | Returns | Notes |
112
+ |-------|---------|-------|
113
+ | `totalAmount` | `decimal` | Computed: `unitaryValue * quantity` |
114
+ | `packageTypeName` | `string` | From packageType.name |
115
+ | `trackingNumbers` | `[TrackingNumber]` | From commodityTrackingNumbers |
116
+ | `getChildCommodities(filter)` | `[Commodity]` | Child commodities |
117
+ | `getParentCommodity` | `Commodity` | Parent commodity |
118
+ | `getRelatedOrders(filter)` | `[Order]` | Related orders |
119
+ | `getRelatedOrder(filter)` | `Order` | First related order |
120
+ | `getCommodityTrackingNumber(idPropertyName)` | `TrackingNumber` | Lookup |
121
+ | `getCommodityAttachments(filter)` | `[Attachment]` | |
122
+ | `changeHistory(startDate, endDate, maxResults)` | `[ChangeHistory]` | Audit trail |
123
+
124
+ ## Container/Child Pattern (Self-Referencing)
125
+
126
+ Commodities form a tree via `containerCommodityId`:
127
+
128
+ ```
129
+ Container Commodity (parent)
130
+ ├── Child Commodity 1
131
+ ├── Child Commodity 2
132
+ └── Child Commodity 3
133
+ ```
134
+
135
+ - Parent → children: `containerCommodities` collection
136
+ - Child → parent: `containerCommodity` navigation
137
+ - When `weightByTotal=true`, weight is computed as sum of children
138
+ - Changing warehouse location on parent cascades to children
139
+ - Changing commodity status on parent cascades to children
140
+ - Deleting parent cascades to children
141
+
142
+ ## CommodityTrackingNumber Sub-Entity
143
+
144
+ | Field | Type | Notes |
145
+ |-------|------|-------|
146
+ | `commodityTrackingNumberId` | `int` | PK |
147
+ | `trackingNumber` | `string` | |
148
+ | `trackingNumberType` | `string?` | BOL, PRO, PO, etc. |
149
+ | `isPrimary` | `bool` | |
150
+ | `syncOrderId` | `int?` | |
151
+
152
+ ## OrderCommodity Join Entity
153
+
154
+ Links commodities to orders with per-association metadata:
155
+
156
+ | Field | Type | Notes |
157
+ |-------|------|-------|
158
+ | `commodityId` | `int` | |
159
+ | `orderId` | `int` | |
160
+ | `customValues` | `Dictionary` | **Own** customValues, separate from Commodity |
161
+ | `commodity` | `Commodity` | Navigation |
162
+ | `order` | `Order` | Navigation |
163
+
164
+ ## Enums
165
+
166
+ ### WeightUnit
167
+ `Lb`, `Kg`
168
+
169
+ ### DimensionsUnit
170
+ `In`, `Cm`, `M`, `Ft`
171
+
172
+ ### VolumeUnit
173
+ | Value | Description |
174
+ |-------|-------------|
175
+ | `Ft` | Cubic feet |
176
+ | `Vlb` | Volumetric lbs |
177
+ | `Vkg` | Volumetric kg |
178
+ | `M` | Cubic meters |
179
+ | `In` | Cubic inches |
180
+ | `Cm` | Cubic cm |
181
+
182
+ ### CommodityStatusStage
183
+ `Pending=1`, `InProgress`, `Completed`
184
+
185
+ ### CommodityStatus (enum, distinct from entity)
186
+ `Pending`, `OnRoute`, `Delivered`, `Cancelled`, `InQuote`, `OnHand`, `OnPacking`, `InTransit`
187
+
188
+ ## CustomValues
189
+
190
+ `Dictionary<string, object?>` stored as PostgreSQL `jsonb`. Access in workflows:
191
+
192
+ ```yaml
193
+ # Template expressions
194
+ value: "{{ entity.description }}"
195
+ value: "{{ entity.customValues.myField }}"
196
+ value: "{{ entity.containerCommodity.description }}"
197
+
198
+ # Access weight with unit conversion
199
+ weight: "{{ entity.weight }}"
200
+
201
+ # NCalc conditions
202
+ conditions:
203
+ - expression: "[entity.pieces] > 0 AND isNullOrEmpty([entity.customValues.lotNumber?]) = false"
204
+
205
+ # Update via Commodity/Update task
206
+ inputs:
207
+ commodityId: "{{ entity.commodityId }}"
208
+ commodity:
209
+ CustomValues.lotNumber: "LOT-001"
210
+ CustomValues.hazmat: true
211
+ ```
212
+
213
+ **Entities with own customValues:**
214
+ - `Commodity.customValues` — commodity-level fields
215
+ - `OrderCommodity.customValues` — per-order-per-commodity fields
216
+ - `CommodityType.customValues` — type-level fields
217
+ - `CommodityTag.customValues` — tag-level fields
218
+
219
+ ---
220
+
221
+ ## CommodityEvent (Bridge Entity)
222
+
223
+ Links tracking events to individual commodities for granular item-level tracking.
224
+
225
+ | Field | Type | Notes |
226
+ |-------|------|-------|
227
+ | `commodityEventId` | `int` | PK |
228
+ | `commodityId` | `int` | FK to Commodity |
229
+ | `trackingEventId` | `int` | FK to TrackingEvent |
230
+
231
+ **Navigation:** `commodity`, `trackingEvent` (with `eventDefinition`)
232
+
233
+ Used in Flow workflow aggregations:
234
+ ```yaml
235
+ aggregations:
236
+ - name: "hasCommodityEvent"
237
+ parameter: "eventCode"
238
+ expression: "any([Commodity.CommodityEvents], [each.TrackingEvent.EventDefinition.EventCode] = [eventCode])"
239
+ ```
@@ -0,0 +1,163 @@
1
+ # Contact Entity Field Reference
2
+
3
+ ## Contents
4
+ - Contact Scalar Fields
5
+ - Contact Navigation Properties
6
+ - Contact Collection Properties
7
+ - Contact Computed/Resolved GraphQL Fields
8
+ - ContactType Enum
9
+ - ContactAddress Sub-Entity
10
+ - Contact Other Related Enums
11
+ - Contact CustomValues
12
+
13
+ Field names as used in workflow expressions: `{{ entity.name }}`, `{{ entity.customValues.myField }}`.
14
+
15
+ ## Scalar Fields
16
+
17
+ | Field | Type | Notes |
18
+ |-------|------|-------|
19
+ | `contactId` | `int` | Primary key |
20
+ | `organizationId` | `int` | Tenant scope |
21
+ | `name` | `string` | Required. Company/display name |
22
+ | `contactFirstName` | `string?` | |
23
+ | `contactLastName` | `string?` | |
24
+ | `contactType` | `ContactType` enum | See enum below |
25
+ | `accountNumber` | `string?` | |
26
+ | `emailAddress` | `string?` | |
27
+ | `phoneNumber` | `string?` | |
28
+ | `mobilePhoneNumber` | `string?` | |
29
+ | `faxNumber` | `string?` | |
30
+ | `website` | `string?` | |
31
+ | `idNumber` | `string?` | EIN, DUNS, etc. |
32
+ | `idNumberType` | `IDNumberType?` enum | EIN, DUNS, ForeignEntityId, Other |
33
+ | `divisionId` | `int` | Primary division FK |
34
+ | `paymentTermId` | `int?` | FK to PaymentTerm |
35
+ | `creditLimit` | `decimal?` | |
36
+ | `paidAs` | `PaidAs?` enum | Prepaid, Collect |
37
+ | `isACorporation` | `bool?` | |
38
+ | `isDeleted` | `bool` | Soft delete flag |
39
+ | `contactStatusId` | `int?` | FK to ContactStatus |
40
+ | `entityTypeId` | `int?` | FK to EntityType |
41
+ | `parentContactId` | `int?` | Self-referencing FK |
42
+ | `tags` | `[string]` | String array |
43
+ | `created` | `DateTime` | |
44
+ | `createdBy` | `string` | User ID |
45
+ | `lastModified` | `DateTime` | |
46
+ | `lastModifiedBy` | `string` | User ID |
47
+
48
+ ## Navigation Properties
49
+
50
+ | Field | Type | Notes |
51
+ |-------|------|-------|
52
+ | `division` | `Division` | Primary division |
53
+ | `paymentTerm` | `PaymentTerm` | |
54
+ | `contactStatus` | `ContactStatus` | `.statusName`, `.statusStage` (Active/Inactive) |
55
+ | `entityType` | `EntityType` | |
56
+ | `parentContact` | `Contact` | Self-referencing parent |
57
+ | `createdUser` | `User` | |
58
+ | `updatedUser` | `User` | |
59
+
60
+ ## Collection Properties
61
+
62
+ | Field | Type | Notes |
63
+ |-------|------|-------|
64
+ | `contactAddresses` | `[ContactAddress]` | Addresses with types (Billing, Shipping, Other) |
65
+ | `contacts` | `[Contact]` | Linked contacts (TO this contact) |
66
+ | `linksToContacts` | `[Contact]` | Contacts this one links TO |
67
+ | `contactLinks` | `[ContactLink]` | Link details (type: ParentContact, FactoringCompany, SalesPerson) |
68
+ | `equipmentTypes` | `[EquipmentType]` | Carrier only |
69
+ | `discounts` | `[Discount]` | Via ContactDiscount join |
70
+ | `rates` | `[Rate]` | Carrier rates |
71
+ | `additionalDivisions` | `[Division]` | Beyond primary division |
72
+ | `orders` | `[Order]` | Via OrderCarrier |
73
+
74
+ ## Computed/Resolved GraphQL Fields
75
+
76
+ | Field | Returns | Notes |
77
+ |-------|---------|-------|
78
+ | `getContactAddressByType(addressType)` | `[ContactAddress]` | Filter by "Billing", "Shipping", "Other" |
79
+ | `getFirstContactAddressByType(addressType)` | `ContactAddress` | First match |
80
+ | `getContactAttachments(filter, orderBy)` | `[Attachment]` | |
81
+ | `getCustomValuesAttachment(filter)` | `Attachment` | From customValues `attachmentId` key |
82
+ | `availableCredit` | `[AvailableCreditByCurrency]` | Carrier/Customer only |
83
+ | `changeHistory(startDate, endDate, maxResults)` | `[ChangeHistory]` | Audit trail |
84
+
85
+ ## ContactType Enum
86
+
87
+ | Value | Int | Notes |
88
+ |-------|-----|-------|
89
+ | `Customer` | 1 | Can have accounting |
90
+ | `Carrier` | 2 | Can have accounting, equipment types |
91
+ | `Vendor` | 3 | |
92
+ | `Contact` | 4 | Generic, must have linked contact |
93
+ | `Driver` | 5 | |
94
+ | `Employee` | 6 | Can have user account |
95
+ | `SalesPerson` | 7 | |
96
+ | `ForwardingAgent` | 8 | |
97
+ | `FactoringCompany` | 9 | |
98
+ | `Lead` | 10 | |
99
+ | `PoolPoint` | 11 | |
100
+ | `DistributionCenter` | 12 | |
101
+ | `Store` | 13 | |
102
+ | `ContactUser` | 14 | User associated with contact |
103
+ | `USPPI` | 15 | US Principal Party in Interest |
104
+
105
+ ## ContactAddress Sub-Entity
106
+
107
+ | Field | Type | Notes |
108
+ |-------|------|-------|
109
+ | `contactAddressId` | `int` | PK |
110
+ | `addressLine` | `string?` | |
111
+ | `addressLine2` | `string?` | |
112
+ | `addressType` | `AddressType` enum | Billing=1, Shipping=2, Other=3 |
113
+ | `cityName` | `string?` | |
114
+ | `countryCode` | `string?` | FK to Country |
115
+ | `stateCode` | `string?` | FK to State |
116
+ | `postalCode` | `string?` | |
117
+ | `isInactive` | `bool?` | |
118
+ | `latitude` | `double?` | From Location.Y (GraphQL resolved) |
119
+ | `longitude` | `double?` | From Location.X (GraphQL resolved) |
120
+ | `customValues` | `Dictionary` | Own customValues (separate from Contact) |
121
+ | `country` | `Country` | Navigation |
122
+ | `state` | `State` | Navigation |
123
+
124
+ GraphQL resolver: `formattedAddress(outputFormat, addressFormat, lang, multiline)` — formatted string.
125
+
126
+ ## Other Related Enums
127
+
128
+ | Enum | Values |
129
+ |------|--------|
130
+ | `IDNumberType` | EIN, DUNS, ForeignEntityId, Other |
131
+ | `PaidAs` | Prepaid, Collect |
132
+ | `AddressType` | Billing=1, Shipping=2, Other=3 |
133
+ | `ContactLinkType` | ParentContact=1, FactoringCompany, SalesPerson, ContactAddressLink |
134
+ | `ContactStatusStage` | Active=0, Inactive=1 |
135
+ | `PaymentType` | Card=1, AccountCredit=2, Cash=3, Check=4, BankTransfer=5, Other=7 |
136
+
137
+ ## CustomValues
138
+
139
+ `Dictionary<string, object?>` stored as PostgreSQL `jsonb`. Access in workflows:
140
+
141
+ ```yaml
142
+ # Template expressions
143
+ value: "{{ entity.name }}"
144
+ value: "{{ entity.customValues.myField }}"
145
+
146
+ # Access contact address
147
+ address: "{{ entity.contactAddresses[0].addressLine }}"
148
+
149
+ # NCalc conditions
150
+ conditions:
151
+ - expression: "[entity.contactType] = 'Customer'"
152
+
153
+ # Update via Contact/Update task
154
+ inputs:
155
+ contactId: "{{ entity.contactId }}"
156
+ contact:
157
+ CustomValues.myField: "newValue"
158
+ ```
159
+
160
+ **Entities with own customValues:**
161
+ - `Contact.customValues` — contact-level custom fields
162
+ - `ContactAddress.customValues` — address-level custom fields
163
+ - `ContactPaymentMethod.customValues` — payment method custom fields