@open-mercato/core 0.7.1-develop.7113.1.9d83dca10c → 0.7.1-develop.7121.1.734c263bda
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/dist/helpers/integration/crmFixtures.js.map +1 -1
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js +9 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js.map +2 -2
- package/dist/modules/communication_channels/lib/outbound-recipient.js +5 -1
- package/dist/modules/communication_channels/lib/outbound-recipient.js.map +2 -2
- package/dist/modules/communication_channels/lib/test-seed.js +5 -0
- package/dist/modules/communication_channels/lib/test-seed.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js +1 -1
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js.map +1 -1
- package/dist/modules/customers/backend/customers/deals/page.js +4 -3
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.js +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js +1 -1
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js.map +1 -1
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +1 -1
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/cli.js +5 -5
- package/dist/modules/customers/cli.js.map +2 -2
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/components/detail/pipelineStageUtils.js +1 -0
- package/dist/modules/customers/components/detail/pipelineStageUtils.js.map +2 -2
- package/dist/modules/customers/components/linking/adapters/dealAdapter.js +2 -2
- package/dist/modules/customers/components/linking/adapters/dealAdapter.js.map +2 -2
- package/dist/modules/customers/lib/closureStage.js.map +2 -2
- package/dist/modules/customers/lib/dealStatus.js +6 -4
- package/dist/modules/customers/lib/dealStatus.js.map +2 -2
- package/dist/modules/customers/lib/dealsSummaryQueries.js +3 -3
- package/dist/modules/customers/lib/dealsSummaryQueries.js.map +1 -1
- package/dist/modules/customers/migrations/Migration20260824180000_deal_status_lost.js +30 -0
- package/dist/modules/customers/migrations/Migration20260824180000_deal_status_lost.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/config.js.map +1 -1
- package/dist/modules/eudr/notifications.js +5 -0
- package/dist/modules/eudr/notifications.js.map +2 -2
- package/dist/modules/query_index/lib/search-tokens.js +59 -28
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +146 -99
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/returns.js +1 -30
- package/dist/modules/sales/commands/returns.js.map +2 -2
- package/dist/modules/sales/commands/shared.js +1 -4
- package/dist/modules/sales/commands/shared.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js +2 -1
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js.map +2 -2
- package/dist/modules/sales/data/validators.js +3 -0
- package/dist/modules/sales/data/validators.js.map +2 -2
- package/dist/modules/sales/lib/calculations.js +14 -2
- package/dist/modules/sales/lib/calculations.js.map +2 -2
- package/dist/modules/sales/lib/json.js +8 -0
- package/dist/modules/sales/lib/json.js.map +7 -0
- package/dist/modules/sales/lib/lineSnapshots.js +66 -0
- package/dist/modules/sales/lib/lineSnapshots.js.map +7 -0
- package/dist/modules/warranty_claims/notifications.js +5 -0
- package/dist/modules/warranty_claims/notifications.js.map +2 -2
- package/dist/modules/wms/notifications.js +2 -0
- package/dist/modules/wms/notifications.js.map +2 -2
- package/package.json +7 -7
- package/src/helpers/integration/crmFixtures.ts +1 -1
- package/src/modules/communication_channels/api/post/channels/[id]/test-send/route.ts +21 -9
- package/src/modules/communication_channels/lib/adapter.ts +11 -0
- package/src/modules/communication_channels/lib/outbound-recipient.ts +14 -1
- package/src/modules/communication_channels/lib/test-seed.ts +19 -0
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.ts +1 -1
- package/src/modules/customers/backend/customers/deals/page.tsx +4 -3
- package/src/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.tsx +5 -5
- package/src/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.tsx +3 -3
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +2 -2
- package/src/modules/customers/cli.ts +5 -5
- package/src/modules/customers/commands/deals.ts +4 -3
- package/src/modules/customers/components/detail/pipelineStageUtils.ts +1 -0
- package/src/modules/customers/components/linking/adapters/dealAdapter.tsx +2 -2
- package/src/modules/customers/i18n/de.json +1 -1
- package/src/modules/customers/i18n/en.json +1 -1
- package/src/modules/customers/i18n/es.json +1 -1
- package/src/modules/customers/i18n/ko.json +1 -1
- package/src/modules/customers/i18n/pl.json +1 -1
- package/src/modules/customers/lib/closureStage.ts +2 -1
- package/src/modules/customers/lib/dealStatus.ts +23 -12
- package/src/modules/customers/lib/dealsSummaryQueries.ts +3 -3
- package/src/modules/customers/migrations/Migration20260824180000_deal_status_lost.ts +55 -0
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/config.ts +1 -1
- package/src/modules/eudr/notifications.ts +5 -0
- package/src/modules/query_index/lib/search-tokens.ts +100 -43
- package/src/modules/sales/commands/documents.ts +185 -105
- package/src/modules/sales/commands/returns.ts +1 -31
- package/src/modules/sales/commands/shared.ts +1 -4
- package/src/modules/sales/components/documents/SalesOrderDraftLines.tsx +12 -1
- package/src/modules/sales/data/validators.ts +3 -0
- package/src/modules/sales/lib/calculations.ts +33 -7
- package/src/modules/sales/lib/json.ts +4 -0
- package/src/modules/sales/lib/lineSnapshots.ts +98 -0
- package/src/modules/sales/lib/types.ts +20 -0
- package/src/modules/warranty_claims/notifications.ts +5 -0
- package/src/modules/wms/notifications.ts +2 -0
|
@@ -32,6 +32,13 @@ export type SalesLineUomSnapshot = {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* How a caller-supplied `discountAmount` should be read: as a rate per unit, or
|
|
37
|
+
* as the total for the whole line. Persisted rows always hold a line total —
|
|
38
|
+
* see `discountAmountFromStoredRow`, which is a separate signal on purpose.
|
|
39
|
+
*/
|
|
40
|
+
export type SalesLineDiscountBasis = 'unit' | 'line'
|
|
41
|
+
|
|
35
42
|
export type SalesLineSnapshot = {
|
|
36
43
|
id?: string
|
|
37
44
|
lineNumber?: number
|
|
@@ -50,6 +57,19 @@ export type SalesLineSnapshot = {
|
|
|
50
57
|
unitPriceNet?: number | null
|
|
51
58
|
unitPriceGross?: number | null
|
|
52
59
|
discountAmount?: number | null
|
|
60
|
+
/**
|
|
61
|
+
* Caller-supplied ONLY. How to interpret a supplied `discountAmount`.
|
|
62
|
+
* Omitted means 'unit', which is the meaning the API has always documented.
|
|
63
|
+
* Entity-to-snapshot mappers MUST NOT set this: a populated value is what
|
|
64
|
+
* makes this a reliable *caller* signal.
|
|
65
|
+
*/
|
|
66
|
+
discountAmountBasis?: SalesLineDiscountBasis | null
|
|
67
|
+
/**
|
|
68
|
+
* Set by entity-to-snapshot mappers ONLY. Marks `discountAmount` as
|
|
69
|
+
* reconstructed from a persisted row, so it is a line total and is NOT a
|
|
70
|
+
* caller assertion. Never persisted; never accepted from a request.
|
|
71
|
+
*/
|
|
72
|
+
discountAmountFromStoredRow?: boolean
|
|
53
73
|
discountPercent?: number | null
|
|
54
74
|
taxRate?: number | null
|
|
55
75
|
taxAmount?: number | null
|
|
@@ -4,6 +4,7 @@ export const notificationTypes: NotificationTypeDefinition[] = [
|
|
|
4
4
|
{
|
|
5
5
|
type: 'warranty_claims.claim.submitted',
|
|
6
6
|
module: 'warranty_claims',
|
|
7
|
+
channels: ['in_app', 'email'],
|
|
7
8
|
titleKey: 'warranty_claims.notifications.submitted.title',
|
|
8
9
|
bodyKey: 'warranty_claims.notifications.submitted.body',
|
|
9
10
|
icon: 'clipboard-check',
|
|
@@ -23,6 +24,7 @@ export const notificationTypes: NotificationTypeDefinition[] = [
|
|
|
23
24
|
{
|
|
24
25
|
type: 'warranty_claims.claim.assigned',
|
|
25
26
|
module: 'warranty_claims',
|
|
27
|
+
channels: ['in_app', 'email'],
|
|
26
28
|
titleKey: 'warranty_claims.notifications.assigned.title',
|
|
27
29
|
bodyKey: 'warranty_claims.notifications.assigned.body',
|
|
28
30
|
icon: 'user-check',
|
|
@@ -42,6 +44,7 @@ export const notificationTypes: NotificationTypeDefinition[] = [
|
|
|
42
44
|
{
|
|
43
45
|
type: 'warranty_claims.claim.status_changed',
|
|
44
46
|
module: 'warranty_claims',
|
|
47
|
+
channels: ['in_app', 'email'],
|
|
45
48
|
titleKey: 'warranty_claims.notifications.statusChanged.title',
|
|
46
49
|
bodyKey: 'warranty_claims.notifications.statusChanged.body',
|
|
47
50
|
icon: 'refresh-cw',
|
|
@@ -61,6 +64,7 @@ export const notificationTypes: NotificationTypeDefinition[] = [
|
|
|
61
64
|
{
|
|
62
65
|
type: 'warranty_claims.claim.escalated',
|
|
63
66
|
module: 'warranty_claims',
|
|
67
|
+
channels: ['in_app', 'email'],
|
|
64
68
|
titleKey: 'warranty_claims.notifications.escalated.title',
|
|
65
69
|
bodyKey: 'warranty_claims.notifications.escalated.body',
|
|
66
70
|
icon: 'alarm-clock',
|
|
@@ -80,6 +84,7 @@ export const notificationTypes: NotificationTypeDefinition[] = [
|
|
|
80
84
|
{
|
|
81
85
|
type: 'warranty_claims.claim.customer_replied',
|
|
82
86
|
module: 'warranty_claims',
|
|
87
|
+
channels: ['in_app', 'email'],
|
|
83
88
|
titleKey: 'warranty_claims.notifications.customerReplied.title',
|
|
84
89
|
bodyKey: 'warranty_claims.notifications.customerReplied.body',
|
|
85
90
|
icon: 'message-square-reply',
|
|
@@ -4,6 +4,7 @@ export const notificationTypes: NotificationTypeDefinition[] = [
|
|
|
4
4
|
{
|
|
5
5
|
type: 'wms.inventory.low_stock',
|
|
6
6
|
module: 'wms',
|
|
7
|
+
channels: ['in_app', 'email'],
|
|
7
8
|
titleKey: 'wms.notifications.lowStock.title',
|
|
8
9
|
bodyKey: 'wms.notifications.lowStock.body',
|
|
9
10
|
icon: 'alert-triangle',
|
|
@@ -23,6 +24,7 @@ export const notificationTypes: NotificationTypeDefinition[] = [
|
|
|
23
24
|
{
|
|
24
25
|
type: 'wms.inventory.reservation_shortfall',
|
|
25
26
|
module: 'wms',
|
|
27
|
+
channels: ['in_app', 'email'],
|
|
26
28
|
titleKey: 'wms.notifications.reservationShortfall.title',
|
|
27
29
|
bodyKey: 'wms.notifications.reservationShortfall.body',
|
|
28
30
|
icon: 'alert-triangle',
|