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,182 @@
1
+ # Rate, Pricing & Accounting Lookup Reference
2
+
3
+ ## Contents
4
+ - Rate
5
+ - Lane
6
+ - Discount
7
+ - AccountingItem
8
+ - AccountingAccount
9
+ - PaymentTerm
10
+
11
+ ## Rate
12
+
13
+ Carrier/vendor rates with tariff rules.
14
+
15
+ ### Fields
16
+
17
+ | Field | Type | Notes |
18
+ |-------|------|-------|
19
+ | `rateId` | `int` | PK |
20
+ | `organizationId` | `int` | |
21
+ | `rateNumber` | `string?` | |
22
+ | `rateType` | `RateType` enum | StandardClientRate=0, ClientRate=1, CarrierRate=2, CommissionRate=3 |
23
+ | `carrierId` | `int?` | FK to Contact |
24
+ | `clientId` | `int?` | FK to Contact |
25
+ | `currencyId` | `int?` | FK to Currency |
26
+ | `accountingItemId` | `int?` | FK to AccountingItem |
27
+ | `modeOfTransportationId` | `int?` | FK |
28
+ | `commodityTypeId` | `int?` | FK |
29
+ | `effectiveDate` | `DateTime?` | |
30
+ | `expirationDate` | `DateTime?` | |
31
+ | `contractNumber` | `string?` | |
32
+ | `amendmentNumber` | `string?` | |
33
+ | `transitDaysMin` | `int?` | |
34
+ | `transitDaysMax` | `int?` | |
35
+ | `serviceType` | `ServiceType?` enum | PortToDoor=1, DoorToDoor=2, DoorToPort=3, PortToPort=4 |
36
+ | `frequency` | `Frequency?` enum | Daily=1, Weekly=2, Biweekly=3, Monthly=4, Other=5 |
37
+ | `automaticallyCreateCharge` | `bool` | |
38
+ | `isHazardous` | `bool?` | |
39
+ | `notes` | `string?` | |
40
+ | `tariff` | `TariffOptions` | JSON object (see below) |
41
+ | `routeId` | `int?` | FK to Route |
42
+ | `routeLegId` | `int?` | FK to RouteLeg |
43
+ | `customValues` | `Dictionary` | jsonb |
44
+
45
+ ### Port References (on Rate)
46
+
47
+ | Field | Type |
48
+ |-------|------|
49
+ | `portOfReceiptId` | `string?` → Port |
50
+ | `portOfLoadingId` | `string?` → Port |
51
+ | `portOfUnloadingId` | `string?` → Port |
52
+ | `portOfDeliveryId` | `string?` → Port |
53
+ | `countryOfOriginCode` | `string?` → Country |
54
+ | `countryOfDestinationCode` | `string?` → Country |
55
+
56
+ ### TariffOptions (JSON object)
57
+
58
+ | Field | Type | Notes |
59
+ |-------|------|-------|
60
+ | `baseCharge` | `decimal?` | |
61
+ | `minimum` | `decimal?` | |
62
+ | `maximum` | `decimal?` | |
63
+ | `rateMultiplier` | `decimal?` | |
64
+ | `ratePer` | `decimal?` | |
65
+ | `applyBy` | `ApplyBy?` enum | Pieces, Weight, ChargeableWeight, Volume, Container, Calculated, FlatRate |
66
+ | `unitType` | `Units?` enum | Ft, Vlb, Vkg, M, Lb, Kg |
67
+ | `ratePerType` | `RatePerType?` enum | Unit, Range |
68
+ | `calculatedOf` | `CalculatedOfTypes?` enum | Income, Expense, Profit, IncomeFreight |
69
+ | `percentageOfType` | `PercentageOfType?` enum | Cost, Income, Profit |
70
+ | `minimumChargeableWeight` | `decimal?` | |
71
+ | `minimumWeight` | `decimal?` | |
72
+ | `maximumWeight` | `decimal?` | |
73
+ | `rateData` | `[{rateIndex, rateValue, packageTypeId}]` | |
74
+
75
+ ---
76
+
77
+ ## Lane
78
+
79
+ Shipping lanes linking origin/destination.
80
+
81
+ ### Fields
82
+
83
+ | Field | Type | Notes |
84
+ |-------|------|-------|
85
+ | `id` | `int` | PK |
86
+ | `organizationId` | `int` | |
87
+ | `contactId` | `int` | FK to Contact |
88
+ | `description` | `string?` | |
89
+ | `originPortId` | `string?` | FK to Port |
90
+ | `destinationPortId` | `string?` | FK to Port |
91
+ | `originCityId` | `int?` | FK to City |
92
+ | `destinationCityId` | `int?` | FK to City |
93
+ | `customValues` | `Dictionary` | jsonb |
94
+
95
+ ### Navigation
96
+
97
+ `contact`, `originPort`, `destinationPort`, `originCity`, `destinationCity`, `modeOfTransportations` (M2M)
98
+
99
+ ---
100
+
101
+ ## Discount
102
+
103
+ ### Fields
104
+
105
+ | Field | Type | Notes |
106
+ |-------|------|-------|
107
+ | `discountId` | `int` | PK |
108
+ | `organizationId` | `int` | |
109
+ | `name` | `string?` | |
110
+ | `promoCode` | `string?` | |
111
+ | `description` | `string?` | |
112
+ | `type` | `DiscountType` enum | Percentage=1, FixedAmount=2 |
113
+ | `value` | `decimal` | Percentage or fixed amount |
114
+ | `startDate` | `DateTime` | |
115
+ | `endDate` | `DateTime` | |
116
+ | `isActive` | `bool` | |
117
+ | `usageLimit` | `int?` | Max times discount can be used |
118
+ | `usedCount` | `int` | |
119
+ | `activationLimit` | `int?` | |
120
+ | `activationCount` | `int` | |
121
+ | `minimumChargeAmount` | `decimal?` | |
122
+ | `minimumWeight` | `decimal?` | |
123
+ | `minimumWeightUnit` | `WeightUnit?` | Lb, Kg |
124
+ | `accountingItemId` | `int` | FK |
125
+ | `targetContactTags` | `[string]` | Tag-based targeting |
126
+ | `customValues` | `Dictionary` | jsonb |
127
+
128
+ ### Navigation
129
+
130
+ `carriers` (M2M via ContactDiscount), `transportationModes` (M2M), `destinationCountries` (M2M), `validationWorkflows` (M2M)
131
+
132
+ ---
133
+
134
+ ## AccountingItem
135
+
136
+ Chart of accounts line items.
137
+
138
+ | Field | Type | Notes |
139
+ |-------|------|-------|
140
+ | `accountingItemId` | `int` | PK |
141
+ | `organizationId` | `int` | |
142
+ | `itemCode` | `string?` | |
143
+ | `description` | `string` | |
144
+ | `itemType` | `ItemType` enum | Other=0, Freight=1, Valuation=2, Tax=3, OtherFreight=4, Inventory=5 |
145
+ | `price` | `decimal?` | |
146
+ | `accountId` | `int` | FK to AccountingAccount |
147
+ | `salesTaxId` | `int?` | FK to SalesTax |
148
+ | `tariff` | `TariffOptions?` | Same JSON as Rate |
149
+ | `isInactive` | `bool` | |
150
+ | `customValues` | `Dictionary` | jsonb |
151
+
152
+ ---
153
+
154
+ ## AccountingAccount
155
+
156
+ | Field | Type | Notes |
157
+ |-------|------|-------|
158
+ | `accountId` | `int` | PK |
159
+ | `organizationId` | `int` | |
160
+ | `accountName` | `string` | |
161
+ | `accountNumber` | `string?` | |
162
+ | `accountType` | `AccountType` enum | AccountReceivable=1, AccountPayable=2 |
163
+ | `parentAccountId` | `int?` | Self-referencing FK |
164
+ | `isInactive` | `bool` | |
165
+
166
+ No customValues.
167
+
168
+ ---
169
+
170
+ ## PaymentTerm
171
+
172
+ | Field | Type | Notes |
173
+ |-------|------|-------|
174
+ | `paymentTermId` | `int` | PK |
175
+ | `organizationId` | `int` | |
176
+ | `description` | `string` | |
177
+ | `netDueDays` | `int` | Days until due |
178
+ | `discountPaidWithinDays` | `int?` | Early payment discount window |
179
+ | `discountPercentage` | `int?` | Early payment discount % |
180
+ | `isInactive` | `bool` | |
181
+
182
+ No customValues.
@@ -0,0 +1,176 @@
1
+ # Shared Entity Reference
2
+
3
+ ## Contents
4
+ - Tag
5
+ - Attachment
6
+ - Division
7
+ - EquipmentType
8
+ - PackageType
9
+ - NoteThread
10
+ - Note
11
+
12
+ Tag, Attachment, Division, EquipmentType, PackageType, Note/NoteThread.
13
+
14
+ ## Tag
15
+
16
+ Tagging system for orders, commodities, inventory items.
17
+
18
+ | Field | Type | Notes |
19
+ |-------|------|-------|
20
+ | `tagId` | `int` | PK |
21
+ | `organizationId` | `int` | |
22
+ | `name` | `string` | |
23
+ | `description` | `string?` | |
24
+ | `entityName` | `string` | Discriminator: which entity type this tag belongs to |
25
+ | `isDeleted` | `bool` | Soft delete |
26
+ | `customValues` | `Dictionary` | jsonb |
27
+
28
+ **Join entities** (all have own `customValues`):
29
+ - `OrderTag` — `orderId` + `tagId` + `customValues`
30
+ - `CommodityTag` — `commodityId` + `tagId` + `customValues`
31
+ - `InventoryItemTag` — `inventoryItemId` + `tagId` + `customValues`
32
+
33
+ ---
34
+
35
+ ## Attachment
36
+
37
+ File attachments linked to orders, contacts, jobs, etc.
38
+
39
+ | Field | Type | Notes |
40
+ |-------|------|-------|
41
+ | `attachmentId` | `int` | PK |
42
+ | `attachmentGuid` | `Guid?` | |
43
+ | `fileName` | `string` | |
44
+ | `fileUri` | `string` | Storage path |
45
+ | `fileExtension` | `string` | Computed from fileName |
46
+ | `previewUri` | `string?` | |
47
+ | `thumbnailUri` | `string?` | |
48
+ | `description` | `string?` | |
49
+ | `attachmentType` | `AttachmentType` enum | Picture=1, OtherDocument, Avatar, CustomerDocument |
50
+ | `parentId` | `string?` | Polymorphic FK (entity ID as string) |
51
+ | `parentType` | `AttachmentParentType` enum | None=0, Order=1, Contact=2, AccountingTransaction=3, EquipmentType=4, Job=5, Commodity=6 |
52
+ | `status` | `AttachmentStatus` enum | Active=0, PendingUpload=1, UploadFailed=2 |
53
+ | `category` | `AttachmentCategory` enum | General=0, FieldValue=1 |
54
+ | `organizationId` | `int` | |
55
+ | `customValues` | `Dictionary` | jsonb |
56
+
57
+ ### GraphQL Computed
58
+
59
+ - `isImage`, `isPdf` — computed from extension
60
+ - `presignedFileUri`, `presignedPreviewUri`, `presignedThumbnailUri` — signed URLs
61
+ - `getPresignedUri(expiresInDays, uriType)` — custom resolver
62
+ - `getParentOrder` — resolve parent Order
63
+
64
+ ---
65
+
66
+ ## Division
67
+
68
+ Organization divisions/branches.
69
+
70
+ | Field | Type | Notes |
71
+ |-------|------|-------|
72
+ | `divisionId` | `int` | PK |
73
+ | `organizationId` | `int` | |
74
+ | `divisionName` | `string` | |
75
+ | `email` | `string?` | |
76
+ | `phoneNumber` | `string?` | |
77
+ | `faxNumber` | `string?` | |
78
+ | `streetAndNumber` | `string?` | |
79
+ | `city` | `string?` | |
80
+ | `stateCode` | `string?` | FK to State |
81
+ | `countryCode` | `string?` | FK to Country |
82
+ | `zipCode` | `string?` | |
83
+ | `portId` | `string?` | FK to Port |
84
+ | `comments` | `string?` | |
85
+ | `parentDivisionId` | `int?` | Self-referencing FK |
86
+ | `assignDivisionToEntities` | `bool` | |
87
+ | `useDivisionInDocumentHeaders` | `bool` | |
88
+ | `airAmsOriginatorCode` | `string?` | |
89
+
90
+ **Navigation:** `country`, `state`, `port`, `parentDivision`, `nestedDivisions` (children). No customValues.
91
+
92
+ ---
93
+
94
+ ## EquipmentType
95
+
96
+ | Field | Type | Notes |
97
+ |-------|------|-------|
98
+ | `equipmentTypeId` | `int` | PK |
99
+ | `organizationId` | `int` | |
100
+ | `name` | `string` | |
101
+
102
+ No customValues. Linked to carriers via `CarrierEquipment` join.
103
+
104
+ ---
105
+
106
+ ## PackageType
107
+
108
+ | Field | Type | Notes |
109
+ |-------|------|-------|
110
+ | `packageTypeId` | `int` | PK |
111
+ | `organizationId` | `int` | |
112
+ | `name` | `string` | |
113
+ | `height` | `decimal` | |
114
+ | `length` | `decimal` | |
115
+ | `width` | `decimal` | |
116
+ | `weight` | `decimal` | |
117
+ | `maximumWeight` | `decimal` | |
118
+ | `volume` | `decimal` | |
119
+ | `air` | `bool` | Mode applicability |
120
+ | `ground` | `bool` | |
121
+ | `ocean` | `bool` | |
122
+ | `containerDescriptionCode` | `string?` | FK |
123
+ | `containerTypeCode` | `string?` | FK |
124
+ | `packageCategoryCode` | `string` | FK |
125
+
126
+ **Navigation:** `packageCategory`, `containerDescription`, `containerType`. No customValues.
127
+
128
+ ---
129
+
130
+ ## NoteThread
131
+
132
+ | Field | Type | Notes |
133
+ |-------|------|-------|
134
+ | `id` | `Guid` | PK |
135
+ | `organizationId` | `int` | |
136
+ | `name` | `string` | |
137
+ | `slug` | `string` | Lowercase identifier |
138
+ | `isDeleted` | `bool` | Soft delete |
139
+ | `metadata` | `Dictionary` | jsonb (non-nullable, defaults to {}) |
140
+
141
+ **Collections:** `notes` (one-to-many)
142
+
143
+ ## Note
144
+
145
+ | Field | Type | Notes |
146
+ |-------|------|-------|
147
+ | `id` | `Guid` | PK |
148
+ | `threadId` | `Guid` | FK to NoteThread |
149
+ | `threadName` | `string` | Snapshot of thread name |
150
+ | `content` | `Dictionary` | TipTap document format (root type="doc"), max 256KB |
151
+ | `mentions` | `[Dictionary]?` | Mentioned users/entities |
152
+ | `tags` | `[string]` | Max 20 tags, each max 32 chars |
153
+ | `isPinned` | `bool` | |
154
+ | `isDeleted` | `bool` | Soft delete |
155
+
156
+ **Navigation:** `thread` (NoteThread)
157
+
158
+ ---
159
+
160
+ ## Secret
161
+
162
+ Encrypted key-value store for sensitive configuration (API keys, tokens, credentials). Encrypted at rest with AES-256; scoped to organizations via qualified naming.
163
+
164
+ | Field | Type | Notes |
165
+ |-------|------|-------|
166
+ | `id` | `int` | PK |
167
+ | `secretName` | `string` | Qualified name: `org/{organizationId}/{secretName}`. Unique index. Max 500 chars. |
168
+ | `encryptedValue` | `string` | AES-256 encrypted, base64-encoded (random IV prepended) |
169
+ | `createdAt` | `DateTime` | |
170
+ | `updatedAt` | `DateTime` | |
171
+
172
+ **Table:** `secrets` (snake_case columns)
173
+ **Provider:** `PostgresSecretManager` (default) or `AzureKeyVault` via `SecretManager:Provider` config.
174
+
175
+ **GraphQL mutations:** `setSecret(organizationId, secretName, secretValue)`, `deleteSecret(organizationId, secretName)`.
176
+ **Org scoping:** Commands validate user org membership; qualified name `org/{orgId}/{name}` is built by the command handler.
@@ -0,0 +1,115 @@
1
+ # Warehouse & Inventory Entity Reference
2
+
3
+ ## Contents
4
+ - InventoryItem
5
+ - WarehouseLocation
6
+ - CargoMovement
7
+
8
+ ## InventoryItem
9
+
10
+ SKU-level inventory tracking.
11
+
12
+ | Field | Type | Notes |
13
+ |-------|------|-------|
14
+ | `inventoryItemId` | `int` | PK |
15
+ | `organizationId` | `int` | |
16
+ | `sku` | `string` | Stock keeping unit |
17
+ | `productName` | `string?` | |
18
+ | `modelNumber` | `string?` | |
19
+ | `description` | `string?` | |
20
+ | `availableQuantity` | `int` | |
21
+ | `backOrderQuantity` | `int` | |
22
+ | `height` | `decimal?` | |
23
+ | `length` | `decimal?` | |
24
+ | `width` | `decimal?` | |
25
+ | `weight` | `decimal?` | |
26
+ | `volumePiece` | `decimal?` | |
27
+ | `dimensionsUnit` | `DimensionsUnit` enum | In, Cm, M, Ft |
28
+ | `weightUnit` | `WeightUnit` enum | Lb, Kg |
29
+ | `volumeUnit` | `VolumeUnit` enum | Ft, Vlb, Vkg, M, In, Cm |
30
+ | `useSerialNumbers` | `bool` | |
31
+ | `isInactive` | `bool` | |
32
+ | `customerContactId` | `int?` | FK to Contact |
33
+ | `manufacturerContactId` | `int?` | FK to Contact |
34
+ | `packageTypeId` | `int?` | FK to PackageType |
35
+ | `customValues` | `Dictionary` | jsonb |
36
+
37
+ ### Navigation
38
+
39
+ | Field | Type |
40
+ |-------|------|
41
+ | `customerContact` | `Contact?` |
42
+ | `manufacturerContact` | `Contact?` |
43
+ | `packageType` | `PackageType?` |
44
+ | `commodities` | `[Commodity]` |
45
+ | `inventoryItemTags` | `[InventoryItemTag]` |
46
+ | `allTags` | `[InventoryItemAllTagsView]` |
47
+
48
+ ### GraphQL Computed
49
+
50
+ - `getContact(idPropertyName)` — resolve contact from customValues
51
+
52
+ ---
53
+
54
+ ## WarehouseLocation
55
+
56
+ Physical storage zones/locations in warehouse.
57
+
58
+ | Field | Type | Notes |
59
+ |-------|------|-------|
60
+ | `warehouseLocationId` | `int` | PK |
61
+ | `organizationId` | `int` | |
62
+ | `code` | `string` | Location code |
63
+ | `description` | `string?` | |
64
+ | `locationType` | `LocationType` enum | See below |
65
+ | `height` | `decimal?` | |
66
+ | `length` | `decimal?` | |
67
+ | `width` | `decimal?` | |
68
+ | `maximumWeight` | `decimal?` | |
69
+ | `isInactive` | `bool` | |
70
+ | `customerId` | `int?` | FK to Contact |
71
+ | `parentZoneId` | `int?` | FK to WarehouseZone |
72
+
73
+ ### LocationType Enum
74
+
75
+ Receiving, Storage, Replenishment, Picking, QualityControl, Shipping, Mobile, Other, Packing, Service, PutAway
76
+
77
+ ### Navigation
78
+
79
+ `customer` (Contact), `parentWarehouseZone` (WarehouseZone), `commodities` ([Commodity]). No customValues.
80
+
81
+ ---
82
+
83
+ ## CargoMovement
84
+
85
+ **Not a separate entity** — implemented as `Order` with `orderType = CargoMovement` (value 7).
86
+
87
+ Movement-specific data stored in Order's `customValues`:
88
+
89
+ | CustomValues Key | Type | Notes |
90
+ |-----------------|------|-------|
91
+ | `movementStatus` | `string` | e.g., "Created" |
92
+ | `movementType` | `string` | |
93
+ | `destinationLocationId` | `string/int` | Warehouse location ID |
94
+ | `destinationLocationDescription` | `string` | |
95
+ | `transportationMode` | `string` | |
96
+ | `finalMileCarrier` | `string` | |
97
+
98
+ The Order's `trackingNumber` field serves as the pallet number for cargo movements.
99
+
100
+ ```yaml
101
+ # Example: Query cargo movement in workflow
102
+ - task: "Query/GraphQL@1"
103
+ name: GetMovement
104
+ inputs:
105
+ query: >-
106
+ query($id: Int!, $orgId: Int!) {
107
+ order(organizationId: $orgId, orderId: $id) {
108
+ orderId orderNumber trackingNumber orderType
109
+ customValues
110
+ }
111
+ }
112
+ variables:
113
+ id: "{{ int inputs.orderId }}"
114
+ orgId: "{{ int organizationId }}"
115
+ ```