@open-mercato/core 0.6.6 → 0.6.7-develop.6553.1.2ec7246e04

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 (271) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/dist/generated/entities/gateway_session_initialization/index.js +23 -0
  3. package/dist/generated/entities/gateway_session_initialization/index.js.map +7 -0
  4. package/dist/generated/entities.ids.generated.js +1 -0
  5. package/dist/generated/entities.ids.generated.js.map +2 -2
  6. package/dist/generated/entity-fields-registry.js +12 -0
  7. package/dist/generated/entity-fields-registry.js.map +2 -2
  8. package/dist/modules/api_keys/api/keys/route.js +30 -13
  9. package/dist/modules/api_keys/api/keys/route.js.map +2 -2
  10. package/dist/modules/api_keys/cli.js +2 -1
  11. package/dist/modules/api_keys/cli.js.map +2 -2
  12. package/dist/modules/attachments/api/file/[id]/route.js +9 -7
  13. package/dist/modules/attachments/api/file/[id]/route.js.map +2 -2
  14. package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js +9 -7
  15. package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js.map +2 -2
  16. package/dist/modules/attachments/api/route.js +21 -17
  17. package/dist/modules/attachments/api/route.js.map +2 -2
  18. package/dist/modules/attachments/components/AttachmentContentPreview.js +6 -35
  19. package/dist/modules/attachments/components/AttachmentContentPreview.js.map +2 -2
  20. package/dist/modules/attachments/lib/reconcileOrganization.js +110 -0
  21. package/dist/modules/attachments/lib/reconcileOrganization.js.map +7 -0
  22. package/dist/modules/attachments/lib/requestScope.js +10 -0
  23. package/dist/modules/attachments/lib/requestScope.js.map +7 -0
  24. package/dist/modules/audit_logs/backend/audit-logs/page.js +14 -24
  25. package/dist/modules/audit_logs/backend/audit-logs/page.js.map +2 -2
  26. package/dist/modules/auth/api/autologin.js +85 -0
  27. package/dist/modules/auth/api/autologin.js.map +7 -0
  28. package/dist/modules/auth/api/users/route.js +6 -2
  29. package/dist/modules/auth/api/users/route.js.map +2 -2
  30. package/dist/modules/auth/cli.js +3 -2
  31. package/dist/modules/auth/cli.js.map +2 -2
  32. package/dist/modules/auth/lib/autologin.js +19 -0
  33. package/dist/modules/auth/lib/autologin.js.map +7 -0
  34. package/dist/modules/configs/lib/upgrade-actions.js +22 -0
  35. package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
  36. package/dist/modules/customer_accounts/api/admin/roles/[id]/acl.js +1 -0
  37. package/dist/modules/customer_accounts/api/admin/roles/[id]/acl.js.map +2 -2
  38. package/dist/modules/customer_accounts/api/admin/roles/[id].js +17 -3
  39. package/dist/modules/customer_accounts/api/admin/roles/[id].js.map +2 -2
  40. package/dist/modules/customer_accounts/api/portal/users/[id]/roles.js +6 -1
  41. package/dist/modules/customer_accounts/api/portal/users/[id]/roles.js.map +2 -2
  42. package/dist/modules/customer_accounts/api/portal/users-invite.js +6 -1
  43. package/dist/modules/customer_accounts/api/portal/users-invite.js.map +2 -2
  44. package/dist/modules/customer_accounts/services/customerInvitationService.js +1 -0
  45. package/dist/modules/customer_accounts/services/customerInvitationService.js.map +2 -2
  46. package/dist/modules/customer_accounts/services/customerRbacService.js +6 -1
  47. package/dist/modules/customer_accounts/services/customerRbacService.js.map +2 -2
  48. package/dist/modules/customer_accounts/widgets/injection-table.js +0 -2
  49. package/dist/modules/customer_accounts/widgets/injection-table.js.map +2 -2
  50. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +7 -1
  51. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
  52. package/dist/modules/customers/backend/customers/deals/pipeline/components/ViewTabsRow.js +2 -2
  53. package/dist/modules/customers/backend/customers/deals/pipeline/components/ViewTabsRow.js.map +2 -2
  54. package/dist/modules/customers/components/detail/CompanyDetailTabs.js +37 -43
  55. package/dist/modules/customers/components/detail/CompanyDetailTabs.js.map +2 -2
  56. package/dist/modules/customers/components/detail/DealDetailTabs.js +23 -35
  57. package/dist/modules/customers/components/detail/DealDetailTabs.js.map +2 -2
  58. package/dist/modules/customers/components/detail/DetailTabsLayout.js +6 -21
  59. package/dist/modules/customers/components/detail/DetailTabsLayout.js.map +2 -2
  60. package/dist/modules/customers/components/detail/MobilePersonDetail.js +26 -32
  61. package/dist/modules/customers/components/detail/MobilePersonDetail.js.map +2 -2
  62. package/dist/modules/customers/components/detail/PersonDetailTabs.js +29 -39
  63. package/dist/modules/customers/components/detail/PersonDetailTabs.js.map +2 -2
  64. package/dist/modules/customers/components/detail/useDealsAccess.js +16 -0
  65. package/dist/modules/customers/components/detail/useDealsAccess.js.map +7 -0
  66. package/dist/modules/dashboards/api/roles/widgets/route.js +22 -3
  67. package/dist/modules/dashboards/api/roles/widgets/route.js.map +2 -2
  68. package/dist/modules/dashboards/api/users/widgets/route.js +22 -3
  69. package/dist/modules/dashboards/api/users/widgets/route.js.map +2 -2
  70. package/dist/modules/dashboards/cli.js +4 -3
  71. package/dist/modules/dashboards/cli.js.map +2 -2
  72. package/dist/modules/dashboards/lib/widgetAssignmentScope.js +9 -1
  73. package/dist/modules/dashboards/lib/widgetAssignmentScope.js.map +2 -2
  74. package/dist/modules/dictionaries/commands/entries.js +7 -14
  75. package/dist/modules/dictionaries/commands/entries.js.map +2 -2
  76. package/dist/modules/dictionaries/commands/entry-operations.js +7 -16
  77. package/dist/modules/dictionaries/commands/entry-operations.js.map +2 -2
  78. package/dist/modules/dictionaries/commands/factory.js +9 -3
  79. package/dist/modules/dictionaries/commands/factory.js.map +2 -2
  80. package/dist/modules/dictionaries/fields/dictionary.js +56 -41
  81. package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
  82. package/dist/modules/directory/utils/organizationScope.js +10 -3
  83. package/dist/modules/directory/utils/organizationScope.js.map +2 -2
  84. package/dist/modules/entities/api/records.js +5 -4
  85. package/dist/modules/entities/api/records.js.map +2 -2
  86. package/dist/modules/entities/backend/entities/system/[entityId]/page.meta.js +1 -0
  87. package/dist/modules/entities/backend/entities/system/[entityId]/page.meta.js.map +2 -2
  88. package/dist/modules/entities/backend/entities/user/[entityId]/page.js +49 -49
  89. package/dist/modules/entities/backend/entities/user/[entityId]/page.js.map +2 -2
  90. package/dist/modules/entities/backend/entities/user/[entityId]/page.meta.js +1 -0
  91. package/dist/modules/entities/backend/entities/user/[entityId]/page.meta.js.map +2 -2
  92. package/dist/modules/entities/cli.js +2 -1
  93. package/dist/modules/entities/cli.js.map +2 -2
  94. package/dist/modules/feature_toggles/api/check/boolean/route.js +0 -14
  95. package/dist/modules/feature_toggles/api/check/boolean/route.js.map +2 -2
  96. package/dist/modules/feature_toggles/defaults.json +8 -0
  97. package/dist/modules/integrations/backend/integrations/[id]/page.js +9 -80
  98. package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
  99. package/dist/modules/payment_gateways/data/entities.js +45 -0
  100. package/dist/modules/payment_gateways/data/entities.js.map +2 -2
  101. package/dist/modules/payment_gateways/lib/gateway-service.js +173 -38
  102. package/dist/modules/payment_gateways/lib/gateway-service.js.map +3 -3
  103. package/dist/modules/payment_gateways/lib/session-idempotency.js +104 -0
  104. package/dist/modules/payment_gateways/lib/session-idempotency.js.map +7 -0
  105. package/dist/modules/payment_gateways/migrations/Migration20260709220938_payment_gateways.js +11 -0
  106. package/dist/modules/payment_gateways/migrations/Migration20260709220938_payment_gateways.js.map +7 -0
  107. package/dist/modules/planner/backend/planner/availability-rulesets/[id]/page.js +16 -14
  108. package/dist/modules/planner/backend/planner/availability-rulesets/[id]/page.js.map +2 -2
  109. package/dist/modules/planner/components/AvailabilityRulesEditor.js +18 -30
  110. package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
  111. package/dist/modules/query_index/api/status.js +2 -8
  112. package/dist/modules/query_index/api/status.js.map +2 -2
  113. package/dist/modules/resources/backend/resources/resources/[id]/page.js +24 -24
  114. package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +2 -2
  115. package/dist/modules/sales/backend/sales/channels/create/page.js +6 -0
  116. package/dist/modules/sales/backend/sales/channels/create/page.js.map +2 -2
  117. package/dist/modules/sales/backend/sales/channels/create/page.meta.js +2 -0
  118. package/dist/modules/sales/backend/sales/channels/create/page.meta.js.map +2 -2
  119. package/dist/modules/sales/backend/sales/channels/offers/page.js +6 -0
  120. package/dist/modules/sales/backend/sales/channels/offers/page.js.map +2 -2
  121. package/dist/modules/sales/backend/sales/channels/offers/page.meta.js +2 -0
  122. package/dist/modules/sales/backend/sales/channels/offers/page.meta.js.map +2 -2
  123. package/dist/modules/sales/backend/sales/channels/page.js +6 -0
  124. package/dist/modules/sales/backend/sales/channels/page.js.map +2 -2
  125. package/dist/modules/sales/backend/sales/channels/page.meta.js +2 -0
  126. package/dist/modules/sales/backend/sales/channels/page.meta.js.map +2 -2
  127. package/dist/modules/sales/backend/sales/documents/[id]/page.js +6 -4
  128. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  129. package/dist/modules/sales/commands/documents.js +44 -0
  130. package/dist/modules/sales/commands/documents.js.map +2 -2
  131. package/dist/modules/sales/commands/returns.js +2 -27
  132. package/dist/modules/sales/commands/returns.js.map +2 -2
  133. package/dist/modules/sales/components/SalesChannelsDisabledNotice.js +15 -0
  134. package/dist/modules/sales/components/SalesChannelsDisabledNotice.js.map +7 -0
  135. package/dist/modules/sales/components/documents/AddressesSection.js +6 -2
  136. package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
  137. package/dist/modules/sales/components/documents/ItemsSection.js +1 -0
  138. package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
  139. package/dist/modules/sales/components/documents/LineItemDialog.js +9 -0
  140. package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
  141. package/dist/modules/sales/components/documents/SalesDocumentForm.js +51 -3
  142. package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
  143. package/dist/modules/sales/components/documents/SalesDocumentsTable.js +10 -8
  144. package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
  145. package/dist/modules/sales/components/documents/ShipmentDialog.js +59 -38
  146. package/dist/modules/sales/components/documents/ShipmentDialog.js.map +2 -2
  147. package/dist/modules/sales/components/useSalesChannelsEnabled.js +44 -0
  148. package/dist/modules/sales/components/useSalesChannelsEnabled.js.map +7 -0
  149. package/dist/modules/sales/lib/calculations.js +6 -0
  150. package/dist/modules/sales/lib/calculations.js.map +2 -2
  151. package/dist/modules/sales/lib/salesChannelsToggle.js +18 -0
  152. package/dist/modules/sales/lib/salesChannelsToggle.js.map +7 -0
  153. package/dist/modules/sales/lib/salesChannelsToggleId.js +5 -0
  154. package/dist/modules/sales/lib/salesChannelsToggleId.js.map +7 -0
  155. package/dist/modules/sales/lib/shipments/snapshots.js +27 -1
  156. package/dist/modules/sales/lib/shipments/snapshots.js.map +2 -2
  157. package/dist/modules/staff/backend/staff/team-members/[id]/page.js +22 -25
  158. package/dist/modules/staff/backend/staff/team-members/[id]/page.js.map +2 -2
  159. package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js +12 -14
  160. package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js.map +2 -2
  161. package/dist/modules/staff/lib/timesheets-projects-ui/SavedViewTabs.js +10 -29
  162. package/dist/modules/staff/lib/timesheets-projects-ui/SavedViewTabs.js.map +2 -2
  163. package/dist/modules/sync_excel/lib/adapters/customers.js +19 -20
  164. package/dist/modules/sync_excel/lib/adapters/customers.js.map +2 -2
  165. package/dist/modules/sync_excel/lib/parser.js +185 -0
  166. package/dist/modules/sync_excel/lib/parser.js.map +2 -2
  167. package/dist/modules/sync_excel/lib/upload-storage.js +20 -1
  168. package/dist/modules/sync_excel/lib/upload-storage.js.map +2 -2
  169. package/generated/entities/gateway_session_initialization/index.ts +10 -0
  170. package/generated/entities.ids.generated.ts +1 -0
  171. package/generated/entity-fields-registry.ts +12 -0
  172. package/package.json +9 -8
  173. package/src/modules/api_keys/api/keys/route.ts +36 -13
  174. package/src/modules/api_keys/cli.ts +2 -3
  175. package/src/modules/attachments/api/file/[id]/route.ts +11 -7
  176. package/src/modules/attachments/api/image/[id]/[[...slug]]/route.ts +11 -7
  177. package/src/modules/attachments/api/route.ts +26 -21
  178. package/src/modules/attachments/components/AttachmentContentPreview.tsx +9 -44
  179. package/src/modules/attachments/lib/reconcileOrganization.ts +188 -0
  180. package/src/modules/attachments/lib/requestScope.ts +27 -0
  181. package/src/modules/audit_logs/backend/audit-logs/page.tsx +12 -22
  182. package/src/modules/auth/api/autologin.ts +100 -0
  183. package/src/modules/auth/api/users/route.ts +11 -2
  184. package/src/modules/auth/cli.ts +3 -2
  185. package/src/modules/auth/lib/autologin.ts +36 -0
  186. package/src/modules/configs/i18n/de.json +5 -1
  187. package/src/modules/configs/i18n/en.json +5 -1
  188. package/src/modules/configs/i18n/es.json +5 -1
  189. package/src/modules/configs/i18n/pl.json +5 -1
  190. package/src/modules/configs/lib/upgrade-actions.ts +24 -0
  191. package/src/modules/customer_accounts/AGENTS.md +8 -6
  192. package/src/modules/customer_accounts/api/admin/roles/[id]/acl.ts +1 -0
  193. package/src/modules/customer_accounts/api/admin/roles/[id].ts +17 -3
  194. package/src/modules/customer_accounts/api/portal/users/[id]/roles.ts +6 -1
  195. package/src/modules/customer_accounts/api/portal/users-invite.ts +6 -1
  196. package/src/modules/customer_accounts/services/customerInvitationService.ts +1 -0
  197. package/src/modules/customer_accounts/services/customerRbacService.ts +9 -2
  198. package/src/modules/customer_accounts/widgets/injection-table.ts +0 -2
  199. package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +11 -1
  200. package/src/modules/customers/backend/customers/deals/pipeline/components/ViewTabsRow.tsx +6 -2
  201. package/src/modules/customers/components/detail/CompanyDetailTabs.tsx +39 -55
  202. package/src/modules/customers/components/detail/DealDetailTabs.tsx +24 -49
  203. package/src/modules/customers/components/detail/DetailTabsLayout.tsx +13 -24
  204. package/src/modules/customers/components/detail/MobilePersonDetail.tsx +25 -31
  205. package/src/modules/customers/components/detail/PersonDetailTabs.tsx +29 -50
  206. package/src/modules/customers/components/detail/useDealsAccess.ts +19 -0
  207. package/src/modules/dashboards/api/roles/widgets/route.ts +22 -3
  208. package/src/modules/dashboards/api/users/widgets/route.ts +22 -3
  209. package/src/modules/dashboards/cli.ts +4 -9
  210. package/src/modules/dashboards/lib/widgetAssignmentScope.ts +18 -0
  211. package/src/modules/dictionaries/commands/entries.ts +7 -16
  212. package/src/modules/dictionaries/commands/entry-operations.ts +8 -18
  213. package/src/modules/dictionaries/commands/factory.ts +8 -2
  214. package/src/modules/dictionaries/fields/dictionary.tsx +55 -32
  215. package/src/modules/dictionaries/i18n/de.json +2 -0
  216. package/src/modules/dictionaries/i18n/en.json +2 -0
  217. package/src/modules/dictionaries/i18n/es.json +2 -0
  218. package/src/modules/dictionaries/i18n/pl.json +2 -0
  219. package/src/modules/directory/utils/organizationScope.ts +36 -2
  220. package/src/modules/entities/api/records.ts +5 -7
  221. package/src/modules/entities/backend/entities/system/[entityId]/page.meta.ts +1 -0
  222. package/src/modules/entities/backend/entities/user/[entityId]/page.meta.ts +1 -0
  223. package/src/modules/entities/backend/entities/user/[entityId]/page.tsx +51 -49
  224. package/src/modules/entities/cli.ts +2 -1
  225. package/src/modules/entities/i18n/de.json +34 -0
  226. package/src/modules/entities/i18n/en.json +34 -0
  227. package/src/modules/entities/i18n/es.json +34 -0
  228. package/src/modules/entities/i18n/pl.json +34 -0
  229. package/src/modules/feature_toggles/api/check/boolean/route.ts +0 -15
  230. package/src/modules/feature_toggles/defaults.json +8 -0
  231. package/src/modules/integrations/backend/integrations/[id]/page.tsx +16 -59
  232. package/src/modules/payment_gateways/data/entities.ts +39 -0
  233. package/src/modules/payment_gateways/lib/gateway-service.ts +211 -40
  234. package/src/modules/payment_gateways/lib/session-idempotency.ts +142 -0
  235. package/src/modules/payment_gateways/migrations/.snapshot-open-mercato.json +236 -0
  236. package/src/modules/payment_gateways/migrations/Migration20260709220938_payment_gateways.ts +10 -0
  237. package/src/modules/planner/backend/planner/availability-rulesets/[id]/page.tsx +14 -20
  238. package/src/modules/planner/components/AvailabilityRulesEditor.tsx +16 -34
  239. package/src/modules/query_index/api/status.ts +2 -8
  240. package/src/modules/resources/backend/resources/resources/[id]/page.tsx +27 -37
  241. package/src/modules/sales/backend/sales/channels/create/page.meta.ts +3 -0
  242. package/src/modules/sales/backend/sales/channels/create/page.tsx +7 -0
  243. package/src/modules/sales/backend/sales/channels/offers/page.meta.ts +3 -0
  244. package/src/modules/sales/backend/sales/channels/offers/page.tsx +7 -0
  245. package/src/modules/sales/backend/sales/channels/page.meta.ts +4 -0
  246. package/src/modules/sales/backend/sales/channels/page.tsx +7 -0
  247. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +7 -5
  248. package/src/modules/sales/commands/documents.ts +65 -0
  249. package/src/modules/sales/commands/returns.ts +2 -32
  250. package/src/modules/sales/components/SalesChannelsDisabledNotice.tsx +21 -0
  251. package/src/modules/sales/components/documents/AddressesSection.tsx +6 -2
  252. package/src/modules/sales/components/documents/ItemsSection.tsx +5 -0
  253. package/src/modules/sales/components/documents/LineItemDialog.tsx +10 -0
  254. package/src/modules/sales/components/documents/SalesDocumentForm.tsx +53 -3
  255. package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +10 -8
  256. package/src/modules/sales/components/documents/ShipmentDialog.tsx +65 -40
  257. package/src/modules/sales/components/useSalesChannelsEnabled.ts +59 -0
  258. package/src/modules/sales/i18n/de.json +5 -0
  259. package/src/modules/sales/i18n/en.json +5 -0
  260. package/src/modules/sales/i18n/es.json +5 -0
  261. package/src/modules/sales/i18n/pl.json +5 -0
  262. package/src/modules/sales/lib/calculations.ts +15 -0
  263. package/src/modules/sales/lib/salesChannelsToggle.ts +26 -0
  264. package/src/modules/sales/lib/salesChannelsToggleId.ts +1 -0
  265. package/src/modules/sales/lib/shipments/snapshots.ts +30 -0
  266. package/src/modules/staff/backend/staff/team-members/[id]/page.tsx +25 -34
  267. package/src/modules/staff/backend/staff/teams/[id]/edit/page.tsx +11 -17
  268. package/src/modules/staff/lib/timesheets-projects-ui/SavedViewTabs.tsx +11 -28
  269. package/src/modules/sync_excel/lib/adapters/customers.ts +20 -22
  270. package/src/modules/sync_excel/lib/parser.ts +245 -0
  271. package/src/modules/sync_excel/lib/upload-storage.ts +23 -1
@@ -4,6 +4,211 @@
4
4
  "public"
5
5
  ],
6
6
  "tables": [
7
+ {
8
+ "name": "gateway_session_initializations",
9
+ "schema": "public",
10
+ "columns": {
11
+ "claim_token": {
12
+ "name": "claim_token",
13
+ "type": "uuid",
14
+ "unsigned": false,
15
+ "autoincrement": false,
16
+ "primary": false,
17
+ "nullable": true,
18
+ "unique": false,
19
+ "length": null,
20
+ "precision": null,
21
+ "scale": null,
22
+ "default": null,
23
+ "comment": null,
24
+ "collation": null,
25
+ "enumItems": [],
26
+ "mappedType": "uuid"
27
+ },
28
+ "claimed_at": {
29
+ "name": "claimed_at",
30
+ "type": "timestamptz(6)",
31
+ "unsigned": false,
32
+ "autoincrement": false,
33
+ "primary": false,
34
+ "nullable": true,
35
+ "unique": false,
36
+ "length": 6,
37
+ "precision": null,
38
+ "scale": null,
39
+ "default": null,
40
+ "comment": null,
41
+ "collation": null,
42
+ "enumItems": [],
43
+ "mappedType": "datetime"
44
+ },
45
+ "created_at": {
46
+ "name": "created_at",
47
+ "type": "timestamptz(6)",
48
+ "unsigned": false,
49
+ "autoincrement": false,
50
+ "primary": false,
51
+ "nullable": false,
52
+ "unique": false,
53
+ "length": 6,
54
+ "precision": null,
55
+ "scale": null,
56
+ "default": null,
57
+ "comment": null,
58
+ "collation": null,
59
+ "enumItems": [],
60
+ "mappedType": "datetime"
61
+ },
62
+ "gateway_transaction_id": {
63
+ "name": "gateway_transaction_id",
64
+ "type": "uuid",
65
+ "unsigned": false,
66
+ "autoincrement": false,
67
+ "primary": false,
68
+ "nullable": true,
69
+ "unique": false,
70
+ "length": null,
71
+ "precision": null,
72
+ "scale": null,
73
+ "default": null,
74
+ "comment": null,
75
+ "collation": null,
76
+ "enumItems": [],
77
+ "mappedType": "uuid"
78
+ },
79
+ "id": {
80
+ "name": "id",
81
+ "type": "uuid",
82
+ "unsigned": false,
83
+ "autoincrement": false,
84
+ "primary": true,
85
+ "nullable": false,
86
+ "unique": false,
87
+ "length": null,
88
+ "precision": null,
89
+ "scale": null,
90
+ "default": "gen_random_uuid()",
91
+ "comment": null,
92
+ "collation": null,
93
+ "enumItems": [],
94
+ "mappedType": "uuid"
95
+ },
96
+ "operation_key": {
97
+ "name": "operation_key",
98
+ "type": "text",
99
+ "unsigned": false,
100
+ "autoincrement": false,
101
+ "primary": false,
102
+ "nullable": false,
103
+ "unique": true,
104
+ "length": null,
105
+ "precision": null,
106
+ "scale": null,
107
+ "default": null,
108
+ "comment": null,
109
+ "collation": null,
110
+ "enumItems": [],
111
+ "mappedType": "text"
112
+ },
113
+ "organization_id": {
114
+ "name": "organization_id",
115
+ "type": "uuid",
116
+ "unsigned": false,
117
+ "autoincrement": false,
118
+ "primary": false,
119
+ "nullable": false,
120
+ "unique": false,
121
+ "length": null,
122
+ "precision": null,
123
+ "scale": null,
124
+ "default": null,
125
+ "comment": null,
126
+ "collation": null,
127
+ "enumItems": [],
128
+ "mappedType": "uuid"
129
+ },
130
+ "provider_key": {
131
+ "name": "provider_key",
132
+ "type": "text",
133
+ "unsigned": false,
134
+ "autoincrement": false,
135
+ "primary": false,
136
+ "nullable": false,
137
+ "unique": false,
138
+ "length": null,
139
+ "precision": null,
140
+ "scale": null,
141
+ "default": null,
142
+ "comment": null,
143
+ "collation": null,
144
+ "enumItems": [],
145
+ "mappedType": "text"
146
+ },
147
+ "tenant_id": {
148
+ "name": "tenant_id",
149
+ "type": "uuid",
150
+ "unsigned": false,
151
+ "autoincrement": false,
152
+ "primary": false,
153
+ "nullable": false,
154
+ "unique": false,
155
+ "length": null,
156
+ "precision": null,
157
+ "scale": null,
158
+ "default": null,
159
+ "comment": null,
160
+ "collation": null,
161
+ "enumItems": [],
162
+ "mappedType": "uuid"
163
+ },
164
+ "updated_at": {
165
+ "name": "updated_at",
166
+ "type": "timestamptz(6)",
167
+ "unsigned": false,
168
+ "autoincrement": false,
169
+ "primary": false,
170
+ "nullable": false,
171
+ "unique": false,
172
+ "length": 6,
173
+ "precision": null,
174
+ "scale": null,
175
+ "default": null,
176
+ "comment": null,
177
+ "collation": null,
178
+ "enumItems": [],
179
+ "mappedType": "datetime"
180
+ }
181
+ },
182
+ "indexes": [
183
+ {
184
+ "columnNames": [
185
+ "id"
186
+ ],
187
+ "composite": false,
188
+ "constraint": true,
189
+ "keyName": "gateway_session_initializations_pkey",
190
+ "primary": true,
191
+ "unique": true
192
+ },
193
+ {
194
+ "columnNames": [
195
+ "operation_key",
196
+ "provider_key",
197
+ "organization_id",
198
+ "tenant_id"
199
+ ],
200
+ "composite": true,
201
+ "constraint": true,
202
+ "keyName": "gateway_session_initializations_scope_operation_unique",
203
+ "primary": false,
204
+ "unique": true
205
+ }
206
+ ],
207
+ "checks": [],
208
+ "triggers": [],
209
+ "foreignKeys": {},
210
+ "comment": null
211
+ },
7
212
  {
8
213
  "name": "gateway_transactions",
9
214
  "schema": "public",
@@ -21,6 +226,7 @@
21
226
  "scale": 4,
22
227
  "default": null,
23
228
  "comment": null,
229
+ "collation": null,
24
230
  "enumItems": [],
25
231
  "mappedType": "decimal"
26
232
  },
@@ -37,6 +243,7 @@
37
243
  "scale": null,
38
244
  "default": null,
39
245
  "comment": null,
246
+ "collation": null,
40
247
  "enumItems": [],
41
248
  "mappedType": "text"
42
249
  },
@@ -53,6 +260,7 @@
53
260
  "scale": null,
54
261
  "default": null,
55
262
  "comment": null,
263
+ "collation": null,
56
264
  "enumItems": [],
57
265
  "mappedType": "datetime"
58
266
  },
@@ -69,6 +277,7 @@
69
277
  "scale": null,
70
278
  "default": null,
71
279
  "comment": null,
280
+ "collation": null,
72
281
  "enumItems": [],
73
282
  "mappedType": "text"
74
283
  },
@@ -85,6 +294,7 @@
85
294
  "scale": null,
86
295
  "default": null,
87
296
  "comment": null,
297
+ "collation": null,
88
298
  "enumItems": [],
89
299
  "mappedType": "datetime"
90
300
  },
@@ -101,6 +311,7 @@
101
311
  "scale": null,
102
312
  "default": null,
103
313
  "comment": null,
314
+ "collation": null,
104
315
  "enumItems": [],
105
316
  "mappedType": "datetime"
106
317
  },
@@ -117,6 +328,7 @@
117
328
  "scale": null,
118
329
  "default": null,
119
330
  "comment": null,
331
+ "collation": null,
120
332
  "enumItems": [],
121
333
  "mappedType": "json"
122
334
  },
@@ -133,6 +345,7 @@
133
345
  "scale": null,
134
346
  "default": null,
135
347
  "comment": null,
348
+ "collation": null,
136
349
  "enumItems": [],
137
350
  "mappedType": "text"
138
351
  },
@@ -149,6 +362,7 @@
149
362
  "scale": null,
150
363
  "default": null,
151
364
  "comment": null,
365
+ "collation": null,
152
366
  "enumItems": [],
153
367
  "mappedType": "text"
154
368
  },
@@ -165,6 +379,7 @@
165
379
  "scale": null,
166
380
  "default": null,
167
381
  "comment": null,
382
+ "collation": null,
168
383
  "enumItems": [],
169
384
  "mappedType": "text"
170
385
  },
@@ -181,6 +396,7 @@
181
396
  "scale": null,
182
397
  "default": "gen_random_uuid()",
183
398
  "comment": null,
399
+ "collation": null,
184
400
  "enumItems": [],
185
401
  "mappedType": "uuid"
186
402
  },
@@ -197,6 +413,7 @@
197
413
  "scale": null,
198
414
  "default": null,
199
415
  "comment": null,
416
+ "collation": null,
200
417
  "enumItems": [],
201
418
  "mappedType": "datetime"
202
419
  },
@@ -213,6 +430,7 @@
213
430
  "scale": null,
214
431
  "default": null,
215
432
  "comment": null,
433
+ "collation": null,
216
434
  "enumItems": [],
217
435
  "mappedType": "datetime"
218
436
  },
@@ -229,6 +447,7 @@
229
447
  "scale": null,
230
448
  "default": null,
231
449
  "comment": null,
450
+ "collation": null,
232
451
  "enumItems": [],
233
452
  "mappedType": "uuid"
234
453
  },
@@ -245,6 +464,7 @@
245
464
  "scale": null,
246
465
  "default": null,
247
466
  "comment": null,
467
+ "collation": null,
248
468
  "enumItems": [],
249
469
  "mappedType": "uuid"
250
470
  },
@@ -261,6 +481,7 @@
261
481
  "scale": null,
262
482
  "default": null,
263
483
  "comment": null,
484
+ "collation": null,
264
485
  "enumItems": [],
265
486
  "mappedType": "text"
266
487
  },
@@ -277,6 +498,7 @@
277
498
  "scale": null,
278
499
  "default": null,
279
500
  "comment": null,
501
+ "collation": null,
280
502
  "enumItems": [],
281
503
  "mappedType": "text"
282
504
  },
@@ -293,6 +515,7 @@
293
515
  "scale": null,
294
516
  "default": null,
295
517
  "comment": null,
518
+ "collation": null,
296
519
  "enumItems": [],
297
520
  "mappedType": "text"
298
521
  },
@@ -309,6 +532,7 @@
309
532
  "scale": null,
310
533
  "default": null,
311
534
  "comment": null,
535
+ "collation": null,
312
536
  "enumItems": [],
313
537
  "mappedType": "uuid"
314
538
  },
@@ -325,6 +549,7 @@
325
549
  "scale": null,
326
550
  "default": "'pending'",
327
551
  "comment": null,
552
+ "collation": null,
328
553
  "enumItems": [],
329
554
  "mappedType": "text"
330
555
  },
@@ -341,6 +566,7 @@
341
566
  "scale": null,
342
567
  "default": null,
343
568
  "comment": null,
569
+ "collation": null,
344
570
  "enumItems": [],
345
571
  "mappedType": "datetime"
346
572
  },
@@ -357,6 +583,7 @@
357
583
  "scale": null,
358
584
  "default": null,
359
585
  "comment": null,
586
+ "collation": null,
360
587
  "enumItems": [],
361
588
  "mappedType": "json"
362
589
  }
@@ -410,6 +637,7 @@
410
637
  }
411
638
  ],
412
639
  "checks": [],
640
+ "triggers": [],
413
641
  "foreignKeys": {},
414
642
  "comment": null
415
643
  },
@@ -430,6 +658,7 @@
430
658
  "scale": null,
431
659
  "default": null,
432
660
  "comment": null,
661
+ "collation": null,
433
662
  "enumItems": [],
434
663
  "mappedType": "text"
435
664
  },
@@ -446,6 +675,7 @@
446
675
  "scale": null,
447
676
  "default": "gen_random_uuid()",
448
677
  "comment": null,
678
+ "collation": null,
449
679
  "enumItems": [],
450
680
  "mappedType": "uuid"
451
681
  },
@@ -462,6 +692,7 @@
462
692
  "scale": null,
463
693
  "default": null,
464
694
  "comment": null,
695
+ "collation": null,
465
696
  "enumItems": [],
466
697
  "mappedType": "text"
467
698
  },
@@ -478,6 +709,7 @@
478
709
  "scale": null,
479
710
  "default": null,
480
711
  "comment": null,
712
+ "collation": null,
481
713
  "enumItems": [],
482
714
  "mappedType": "uuid"
483
715
  },
@@ -494,6 +726,7 @@
494
726
  "scale": null,
495
727
  "default": null,
496
728
  "comment": null,
729
+ "collation": null,
497
730
  "enumItems": [],
498
731
  "mappedType": "datetime"
499
732
  },
@@ -510,6 +743,7 @@
510
743
  "scale": null,
511
744
  "default": null,
512
745
  "comment": null,
746
+ "collation": null,
513
747
  "enumItems": [],
514
748
  "mappedType": "text"
515
749
  },
@@ -526,6 +760,7 @@
526
760
  "scale": null,
527
761
  "default": null,
528
762
  "comment": null,
763
+ "collation": null,
529
764
  "enumItems": [],
530
765
  "mappedType": "uuid"
531
766
  }
@@ -556,6 +791,7 @@
556
791
  }
557
792
  ],
558
793
  "checks": [],
794
+ "triggers": [],
559
795
  "foreignKeys": {},
560
796
  "comment": null
561
797
  }
@@ -0,0 +1,10 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+
3
+ export class Migration20260709220938_payment_gateways extends Migration {
4
+
5
+ override up(): void | Promise<void> {
6
+ this.addSql(`create table "gateway_session_initializations" ("id" uuid not null default gen_random_uuid(), "operation_key" text not null, "provider_key" text not null, "claim_token" uuid null, "claimed_at" timestamptz null, "gateway_transaction_id" uuid null, "organization_id" uuid not null, "tenant_id" uuid not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, primary key ("id"));`);
7
+ this.addSql(`alter table "gateway_session_initializations" add constraint "gateway_session_initializations_scope_operation_unique" unique ("operation_key", "provider_key", "organization_id", "tenant_id");`);
8
+ }
9
+
10
+ }
@@ -3,7 +3,7 @@
3
3
  import * as React from 'react'
4
4
  import { useRouter } from 'next/navigation'
5
5
  import { Page, PageBody } from '@open-mercato/ui/backend/Page'
6
- import { Button } from '@open-mercato/ui/primitives/button'
6
+ import { Tabs, TabsList, TabsTrigger } from '@open-mercato/ui/primitives/tabs'
7
7
  import { ErrorMessage, RecordNotFoundState } from '@open-mercato/ui/backend/detail'
8
8
  import { readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'
9
9
  import { updateCrud, deleteCrud } from '@open-mercato/ui/backend/utils/crud'
@@ -196,28 +196,22 @@ export default function PlannerAvailabilityRuleSetDetailPage({ params }: { param
196
196
  <Page>
197
197
  <PageBody>
198
198
  <div className="space-y-6">
199
- <div className="border-b">
200
- <nav className="flex flex-wrap items-center gap-5 text-sm" aria-label={translate('planner.availabilityRuleSets.tabs.label', 'Schedule sections')}>
199
+ <Tabs
200
+ value={activeTab}
201
+ onValueChange={(value) => setActiveTab(value as 'details' | 'availability')}
202
+ variant="underline"
203
+ >
204
+ <TabsList
205
+ className="w-full flex-wrap"
206
+ aria-label={translate('planner.availabilityRuleSets.tabs.label', 'Schedule sections')}
207
+ >
201
208
  {tabs.map((tab) => (
202
- <Button
203
- key={tab.id}
204
- type="button"
205
- role="tab"
206
- aria-selected={activeTab === tab.id}
207
- variant="ghost"
208
- size="sm"
209
- className={`relative -mb-px h-auto rounded-none border-b-2 px-0 py-2 font-medium ${
210
- activeTab === tab.id
211
- ? 'border-accent-indigo text-foreground'
212
- : 'border-transparent text-muted-foreground hover:text-foreground'
213
- }`}
214
- onClick={() => setActiveTab(tab.id as 'details' | 'availability')}
215
- >
209
+ <TabsTrigger key={tab.id} value={tab.id}>
216
210
  {tab.label}
217
- </Button>
211
+ </TabsTrigger>
218
212
  ))}
219
- </nav>
220
- </div>
213
+ </TabsList>
214
+ </Tabs>
221
215
 
222
216
  {activeTab === 'details' ? (
223
217
  <AvailabilityRuleSetForm
@@ -21,6 +21,7 @@ import { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimi
21
21
  import { flash } from '@open-mercato/ui/backend/FlashMessages'
22
22
  import { surfaceRecordConflict } from '@open-mercato/ui/backend/conflicts'
23
23
  import { Spinner } from '@open-mercato/ui/primitives/spinner'
24
+ import { Tabs, TabsList, TabsTrigger } from '@open-mercato/ui/primitives/tabs'
24
25
  import { ComboboxInput, TimePicker } from '@open-mercato/ui/backend/inputs'
25
26
  import { DictionaryEntrySelect, type DictionarySelectLabels } from '@open-mercato/core/modules/dictionaries/components/DictionaryEntrySelect'
26
27
  import {
@@ -1856,44 +1857,25 @@ export function AvailabilityRulesEditor({
1856
1857
  <div className="rounded-lg border bg-muted/30 p-4">
1857
1858
  <div className="space-y-4">
1858
1859
  <div className="space-y-2">
1859
- <div role="tablist" aria-label={listLabels.applyScopeLabel} className="inline-flex rounded-lg border bg-muted p-1 text-xs">
1860
- <Button
1861
- type="button"
1862
- role="tab"
1863
- aria-selected={editorScope === 'date'}
1864
- variant="ghost"
1865
- size="sm"
1866
- className={`h-auto rounded-md px-3 py-1.5 font-medium ${
1867
- editorScope === 'date'
1868
- ? 'bg-background text-foreground shadow-sm'
1869
- : 'text-muted-foreground hover:text-foreground'
1870
- }`}
1871
- onClick={() => setEditorScope('date')}
1872
- >
1873
- {listLabels.applyScopeDate}
1874
- </Button>
1875
- <Button
1876
- type="button"
1877
- role="tab"
1878
- aria-selected={editorScope === 'weekday'}
1879
- variant="ghost"
1880
- size="sm"
1881
- className={`h-auto rounded-md px-3 py-1.5 font-medium ${
1882
- editorScope === 'weekday'
1883
- ? 'bg-background text-foreground shadow-sm'
1884
- : 'text-muted-foreground hover:text-foreground'
1885
- }`}
1886
- onClick={() => {
1887
- setEditorScope('weekday')
1860
+ <Tabs
1861
+ value={editorScope}
1862
+ onValueChange={(value) => {
1863
+ const nextScope = value as 'date' | 'weekday'
1864
+ setEditorScope(nextScope)
1865
+ if (nextScope === 'weekday') {
1888
1866
  setEditorUnavailable(false)
1889
1867
  setEditorNote('')
1890
1868
  setEditorReasonEntryId(null)
1891
1869
  setEditorReasonValue('')
1892
- }}
1893
- >
1894
- {listLabels.editAllLabel}
1895
- </Button>
1896
- </div>
1870
+ }
1871
+ }}
1872
+ variant="underline"
1873
+ >
1874
+ <TabsList aria-label={listLabels.applyScopeLabel}>
1875
+ <TabsTrigger value="date">{listLabels.applyScopeDate}</TabsTrigger>
1876
+ <TabsTrigger value="weekday">{listLabels.editAllLabel}</TabsTrigger>
1877
+ </TabsList>
1878
+ </Tabs>
1897
1879
  </div>
1898
1880
 
1899
1881
  {editorScope === 'date' ? (
@@ -415,10 +415,7 @@ export async function GET(req: Request) {
415
415
  errorQuery = errorQuery.where('tenant_id' as any, 'is', null as any)
416
416
  }
417
417
  if (Array.isArray(organizationScopeIds) && organizationScopeIds.length) {
418
- errorQuery = errorQuery.where((eb: any) => eb.or([
419
- eb('organization_id' as any, 'is', null),
420
- eb('organization_id' as any, 'in', organizationScopeIds),
421
- ]))
418
+ errorQuery = errorQuery.where('organization_id' as any, 'in', organizationScopeIds)
422
419
  } else {
423
420
  errorQuery = errorQuery.where('organization_id' as any, 'is', null as any)
424
421
  }
@@ -456,10 +453,7 @@ export async function GET(req: Request) {
456
453
  logsQuery = logsQuery.where('tenant_id' as any, 'is', null as any)
457
454
  }
458
455
  if (Array.isArray(organizationScopeIds) && organizationScopeIds.length) {
459
- logsQuery = logsQuery.where((eb: any) => eb.or([
460
- eb('organization_id' as any, 'is', null),
461
- eb('organization_id' as any, 'in', organizationScopeIds),
462
- ]))
456
+ logsQuery = logsQuery.where('organization_id' as any, 'in', organizationScopeIds)
463
457
  } else {
464
458
  logsQuery = logsQuery.where('organization_id' as any, 'is', null as any)
465
459
  }