@open-mercato/core 0.6.7-develop.6553.1.2ec7246e04 → 0.6.7-develop.6566.1.15385fa179
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/modules/attachments/api/partitions/route.js.map +1 -1
- package/dist/modules/attachments/lib/reconcileOrganization.js +9 -7
- package/dist/modules/attachments/lib/reconcileOrganization.js.map +2 -2
- package/dist/modules/catalog/api/products/route.js.map +1 -1
- package/dist/modules/customers/api/companies/[id]/people/route.js +2 -2
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js +4 -4
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/entity-roles-factory.js +3 -3
- package/dist/modules/customers/api/entity-roles-factory.js.map +2 -2
- package/dist/modules/customers/api/labels/assign/route.js +2 -2
- package/dist/modules/customers/api/labels/assign/route.js.map +2 -2
- package/dist/modules/customers/api/labels/unassign/route.js +2 -2
- package/dist/modules/customers/api/labels/unassign/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js +3 -7
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/context.js +3 -3
- package/dist/modules/customers/api/people/[id]/companies/context.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +2 -2
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +2 -2
- package/dist/modules/customers/api/todos/route.js +2 -2
- package/dist/modules/customers/api/todos/route.js.map +2 -2
- package/dist/modules/customers/commands/addresses.js +3 -3
- package/dist/modules/customers/commands/addresses.js.map +2 -2
- package/dist/modules/customers/commands/comments.js +3 -3
- package/dist/modules/customers/commands/comments.js.map +2 -2
- package/dist/modules/customers/commands/companies.js +2 -2
- package/dist/modules/customers/commands/companies.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +3 -3
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/dictionaries.js +3 -3
- package/dist/modules/customers/commands/dictionaries.js.map +2 -2
- package/dist/modules/customers/commands/entity-roles.js +3 -3
- package/dist/modules/customers/commands/entity-roles.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js +6 -6
- package/dist/modules/customers/commands/interactions.js.map +2 -2
- package/dist/modules/customers/commands/labels.js +7 -7
- package/dist/modules/customers/commands/labels.js.map +2 -2
- package/dist/modules/customers/commands/people.js +3 -3
- package/dist/modules/customers/commands/people.js.map +2 -2
- package/dist/modules/customers/commands/personCompanyLinks.js +6 -6
- package/dist/modules/customers/commands/personCompanyLinks.js.map +2 -2
- package/dist/modules/customers/commands/pipeline-stages.js +3 -3
- package/dist/modules/customers/commands/pipeline-stages.js.map +2 -2
- package/dist/modules/customers/commands/pipelines.js +3 -3
- package/dist/modules/customers/commands/pipelines.js.map +2 -2
- package/dist/modules/customers/commands/shared.js +3 -3
- package/dist/modules/customers/commands/shared.js.map +2 -2
- package/dist/modules/customers/commands/tags.js +7 -7
- package/dist/modules/customers/commands/tags.js.map +2 -2
- package/dist/modules/customers/commands/todos.js +3 -3
- package/dist/modules/customers/commands/todos.js.map +2 -2
- package/dist/modules/customers/lib/personCompanies.js +4 -4
- package/dist/modules/customers/lib/personCompanies.js.map +2 -2
- package/dist/modules/perspectives/data/validators.js +4 -0
- package/dist/modules/perspectives/data/validators.js.map +2 -2
- package/dist/modules/sales/api/notes/route.js +2 -4
- package/dist/modules/sales/api/notes/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/accept/route.js +2 -2
- package/dist/modules/sales/api/quotes/accept/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/public/[token]/route.js +3 -7
- package/dist/modules/sales/api/quotes/public/[token]/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/send/route.js +2 -2
- package/dist/modules/sales/api/quotes/send/route.js.map +2 -2
- package/dist/modules/sales/api/returns/[id]/route.js +2 -2
- package/dist/modules/sales/api/returns/[id]/route.js.map +2 -2
- package/dist/modules/sales/commands/configuration.js +11 -11
- package/dist/modules/sales/commands/configuration.js.map +2 -2
- package/dist/modules/sales/commands/documentAddresses.js +3 -3
- package/dist/modules/sales/commands/documentAddresses.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +31 -39
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/notes.js +7 -7
- package/dist/modules/sales/commands/notes.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +2 -2
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/commands/returns.js +8 -8
- package/dist/modules/sales/commands/returns.js.map +2 -2
- package/dist/modules/sales/commands/shared.js +2 -2
- package/dist/modules/sales/commands/shared.js.map +2 -2
- package/dist/modules/sales/commands/shipments.js +5 -5
- package/dist/modules/sales/commands/shipments.js.map +2 -2
- package/dist/modules/sales/commands/statuses.js +2 -2
- package/dist/modules/sales/commands/statuses.js.map +2 -2
- package/dist/modules/sales/commands/tags.js +3 -3
- package/dist/modules/sales/commands/tags.js.map +2 -2
- package/package.json +8 -8
- package/src/modules/attachments/api/partitions/route.ts +1 -1
- package/src/modules/attachments/lib/reconcileOrganization.ts +16 -7
- package/src/modules/catalog/api/products/route.ts +1 -1
- package/src/modules/customer_accounts/i18n/de.json +12 -0
- package/src/modules/customer_accounts/i18n/en.json +12 -0
- package/src/modules/customer_accounts/i18n/es.json +34 -22
- package/src/modules/customer_accounts/i18n/pl.json +32 -20
- package/src/modules/customers/api/companies/[id]/people/route.ts +2 -2
- package/src/modules/customers/api/deals/[id]/companies/route.ts +2 -2
- package/src/modules/customers/api/deals/[id]/people/route.ts +2 -2
- package/src/modules/customers/api/dictionaries/[kind]/[id]/route.ts +4 -4
- package/src/modules/customers/api/entity-roles-factory.ts +3 -3
- package/src/modules/customers/api/labels/assign/route.ts +2 -2
- package/src/modules/customers/api/labels/unassign/route.ts +2 -2
- package/src/modules/customers/api/people/[id]/companies/[linkId]/route.ts +3 -7
- package/src/modules/customers/api/people/[id]/companies/context.ts +3 -3
- package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +2 -2
- package/src/modules/customers/api/todos/route.ts +2 -2
- package/src/modules/customers/commands/addresses.ts +3 -3
- package/src/modules/customers/commands/comments.ts +3 -3
- package/src/modules/customers/commands/companies.ts +2 -2
- package/src/modules/customers/commands/deals.ts +3 -3
- package/src/modules/customers/commands/dictionaries.ts +3 -3
- package/src/modules/customers/commands/entity-roles.ts +3 -3
- package/src/modules/customers/commands/interactions.ts +6 -6
- package/src/modules/customers/commands/labels.ts +7 -7
- package/src/modules/customers/commands/people.ts +3 -3
- package/src/modules/customers/commands/personCompanyLinks.ts +6 -6
- package/src/modules/customers/commands/pipeline-stages.ts +3 -3
- package/src/modules/customers/commands/pipelines.ts +3 -3
- package/src/modules/customers/commands/shared.ts +3 -3
- package/src/modules/customers/commands/tags.ts +7 -7
- package/src/modules/customers/commands/todos.ts +3 -3
- package/src/modules/customers/lib/personCompanies.ts +4 -4
- package/src/modules/perspectives/data/validators.ts +4 -0
- package/src/modules/sales/api/notes/route.ts +2 -4
- package/src/modules/sales/api/quotes/accept/route.ts +2 -2
- package/src/modules/sales/api/quotes/public/[token]/route.ts +3 -7
- package/src/modules/sales/api/quotes/send/route.ts +2 -2
- package/src/modules/sales/api/returns/[id]/route.ts +2 -2
- package/src/modules/sales/commands/configuration.ts +11 -11
- package/src/modules/sales/commands/documentAddresses.ts +3 -3
- package/src/modules/sales/commands/documents.ts +23 -31
- package/src/modules/sales/commands/notes.ts +7 -7
- package/src/modules/sales/commands/payments.ts +2 -2
- package/src/modules/sales/commands/returns.ts +8 -8
- package/src/modules/sales/commands/shared.ts +2 -2
- package/src/modules/sales/commands/shipments.ts +5 -5
- package/src/modules/sales/commands/statuses.ts +2 -2
- package/src/modules/sales/commands/tags.ts +3 -3
- package/tsconfig.json +0 -2
|
@@ -104,7 +104,9 @@
|
|
|
104
104
|
"customer_accounts.admin.flash.deleted": "User deleted",
|
|
105
105
|
"customer_accounts.admin.inactive": "Inactive",
|
|
106
106
|
"customer_accounts.admin.portalFeatures.addresses.manage": "Manage addresses",
|
|
107
|
+
"customer_accounts.admin.portalFeatures.addresses.manage.description": "Allows adding, editing, and removing addresses",
|
|
107
108
|
"customer_accounts.admin.portalFeatures.addresses.view": "View addresses",
|
|
109
|
+
"customer_accounts.admin.portalFeatures.addresses.view.description": "Allows viewing saved shipping and billing addresses",
|
|
108
110
|
"customer_accounts.admin.portalFeatures.groups.addresses": "Addresses",
|
|
109
111
|
"customer_accounts.admin.portalFeatures.groups.invoices": "Invoices",
|
|
110
112
|
"customer_accounts.admin.portalFeatures.groups.orders": "Orders",
|
|
@@ -112,15 +114,25 @@
|
|
|
112
114
|
"customer_accounts.admin.portalFeatures.groups.quotes": "Quotes",
|
|
113
115
|
"customer_accounts.admin.portalFeatures.groups.users": "Users",
|
|
114
116
|
"customer_accounts.admin.portalFeatures.invoices.view": "View invoices",
|
|
117
|
+
"customer_accounts.admin.portalFeatures.invoices.view.description": "Allows viewing invoices and payment history",
|
|
115
118
|
"customer_accounts.admin.portalFeatures.orders.create": "Create orders",
|
|
119
|
+
"customer_accounts.admin.portalFeatures.orders.create.description": "Allows placing new orders through the portal",
|
|
116
120
|
"customer_accounts.admin.portalFeatures.orders.view": "View orders",
|
|
121
|
+
"customer_accounts.admin.portalFeatures.orders.view.description": "Allows viewing order history and order details",
|
|
117
122
|
"customer_accounts.admin.portalFeatures.profile.edit": "Edit profile",
|
|
123
|
+
"customer_accounts.admin.portalFeatures.profile.edit.description": "Allows editing display name and other profile settings",
|
|
118
124
|
"customer_accounts.admin.portalFeatures.profile.view": "View profile",
|
|
125
|
+
"customer_accounts.admin.portalFeatures.profile.view.description": "Allows viewing own profile information and account details",
|
|
119
126
|
"customer_accounts.admin.portalFeatures.quotes.request": "Request quotes",
|
|
127
|
+
"customer_accounts.admin.portalFeatures.quotes.request.description": "Allows requesting new quotes from the company",
|
|
120
128
|
"customer_accounts.admin.portalFeatures.quotes.view": "View quotes",
|
|
129
|
+
"customer_accounts.admin.portalFeatures.quotes.view.description": "Allows viewing received quotes and their details",
|
|
121
130
|
"customer_accounts.admin.portalFeatures.users.invite": "Invite team members",
|
|
131
|
+
"customer_accounts.admin.portalFeatures.users.invite.description": "Allows sending portal invitations to new team members",
|
|
122
132
|
"customer_accounts.admin.portalFeatures.users.manage": "Manage team members",
|
|
133
|
+
"customer_accounts.admin.portalFeatures.users.manage.description": "Allows editing roles and removing team members",
|
|
123
134
|
"customer_accounts.admin.portalFeatures.users.view": "View team members",
|
|
135
|
+
"customer_accounts.admin.portalFeatures.users.view.description": "Allows viewing other team members in the organization",
|
|
124
136
|
"customer_accounts.admin.portalInfo.credentials": "Demo credentials: alice.johnson@example.com / Password123!",
|
|
125
137
|
"customer_accounts.admin.portalInfo.description": "Manage customer portal accounts. Customers can self-register, log in, and access orders, quotes, and invoices through the portal.",
|
|
126
138
|
"customer_accounts.admin.portalInfo.open": "Open Portal",
|
|
@@ -103,24 +103,36 @@
|
|
|
103
103
|
"customer_accounts.admin.flash.deactivated": "User deactivated",
|
|
104
104
|
"customer_accounts.admin.flash.deleted": "User deleted",
|
|
105
105
|
"customer_accounts.admin.inactive": "Inactive",
|
|
106
|
-
"customer_accounts.admin.portalFeatures.addresses.manage": "
|
|
107
|
-
"customer_accounts.admin.portalFeatures.addresses.
|
|
108
|
-
"customer_accounts.admin.portalFeatures.
|
|
109
|
-
"customer_accounts.admin.portalFeatures.
|
|
110
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
111
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
112
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
113
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
114
|
-
"customer_accounts.admin.portalFeatures.
|
|
115
|
-
"customer_accounts.admin.portalFeatures.
|
|
116
|
-
"customer_accounts.admin.portalFeatures.
|
|
117
|
-
"customer_accounts.admin.portalFeatures.
|
|
118
|
-
"customer_accounts.admin.portalFeatures.
|
|
119
|
-
"customer_accounts.admin.portalFeatures.
|
|
120
|
-
"customer_accounts.admin.portalFeatures.
|
|
121
|
-
"customer_accounts.admin.portalFeatures.
|
|
122
|
-
"customer_accounts.admin.portalFeatures.
|
|
123
|
-
"customer_accounts.admin.portalFeatures.
|
|
106
|
+
"customer_accounts.admin.portalFeatures.addresses.manage": "Gestionar direcciones",
|
|
107
|
+
"customer_accounts.admin.portalFeatures.addresses.manage.description": "Permite añadir, editar y eliminar direcciones",
|
|
108
|
+
"customer_accounts.admin.portalFeatures.addresses.view": "Ver direcciones",
|
|
109
|
+
"customer_accounts.admin.portalFeatures.addresses.view.description": "Permite ver las direcciones de envío y facturación guardadas",
|
|
110
|
+
"customer_accounts.admin.portalFeatures.groups.addresses": "Direcciones",
|
|
111
|
+
"customer_accounts.admin.portalFeatures.groups.invoices": "Facturas",
|
|
112
|
+
"customer_accounts.admin.portalFeatures.groups.orders": "Pedidos",
|
|
113
|
+
"customer_accounts.admin.portalFeatures.groups.profile": "Perfil",
|
|
114
|
+
"customer_accounts.admin.portalFeatures.groups.quotes": "Presupuestos",
|
|
115
|
+
"customer_accounts.admin.portalFeatures.groups.users": "Usuarios",
|
|
116
|
+
"customer_accounts.admin.portalFeatures.invoices.view": "Ver facturas",
|
|
117
|
+
"customer_accounts.admin.portalFeatures.invoices.view.description": "Permite ver las facturas y el historial de pagos",
|
|
118
|
+
"customer_accounts.admin.portalFeatures.orders.create": "Crear pedidos",
|
|
119
|
+
"customer_accounts.admin.portalFeatures.orders.create.description": "Permite realizar nuevos pedidos a través del portal",
|
|
120
|
+
"customer_accounts.admin.portalFeatures.orders.view": "Ver pedidos",
|
|
121
|
+
"customer_accounts.admin.portalFeatures.orders.view.description": "Permite ver el historial y los detalles de los pedidos",
|
|
122
|
+
"customer_accounts.admin.portalFeatures.profile.edit": "Editar perfil",
|
|
123
|
+
"customer_accounts.admin.portalFeatures.profile.edit.description": "Permite editar el nombre visible y otros ajustes del perfil",
|
|
124
|
+
"customer_accounts.admin.portalFeatures.profile.view": "Ver perfil",
|
|
125
|
+
"customer_accounts.admin.portalFeatures.profile.view.description": "Permite ver la información del propio perfil y los detalles de la cuenta",
|
|
126
|
+
"customer_accounts.admin.portalFeatures.quotes.request": "Solicitar presupuestos",
|
|
127
|
+
"customer_accounts.admin.portalFeatures.quotes.request.description": "Permite solicitar nuevos presupuestos a la empresa",
|
|
128
|
+
"customer_accounts.admin.portalFeatures.quotes.view": "Ver presupuestos",
|
|
129
|
+
"customer_accounts.admin.portalFeatures.quotes.view.description": "Permite ver los presupuestos recibidos y sus detalles",
|
|
130
|
+
"customer_accounts.admin.portalFeatures.users.invite": "Invitar a miembros del equipo",
|
|
131
|
+
"customer_accounts.admin.portalFeatures.users.invite.description": "Permite enviar invitaciones al portal a nuevos miembros del equipo",
|
|
132
|
+
"customer_accounts.admin.portalFeatures.users.manage": "Gestionar miembros del equipo",
|
|
133
|
+
"customer_accounts.admin.portalFeatures.users.manage.description": "Permite editar roles y eliminar miembros del equipo",
|
|
134
|
+
"customer_accounts.admin.portalFeatures.users.view": "Ver miembros del equipo",
|
|
135
|
+
"customer_accounts.admin.portalFeatures.users.view.description": "Permite ver a otros miembros del equipo en la organización",
|
|
124
136
|
"customer_accounts.admin.portalInfo.credentials": "Demo credentials: alice.johnson@example.com / Password123!",
|
|
125
137
|
"customer_accounts.admin.portalInfo.description": "Manage customer portal accounts. Customers can self-register, log in, and access orders, quotes, and invoices through the portal.",
|
|
126
138
|
"customer_accounts.admin.portalInfo.open": "Open Portal",
|
|
@@ -162,10 +174,10 @@
|
|
|
162
174
|
"customer_accounts.admin.roleDetail.fields.name": "Name",
|
|
163
175
|
"customer_accounts.admin.roleDetail.flash.saved": "Role updated",
|
|
164
176
|
"customer_accounts.admin.roleDetail.loading": "Loading role...",
|
|
165
|
-
"customer_accounts.admin.roleDetail.sections.details": "
|
|
166
|
-
"customer_accounts.admin.roleDetail.sections.options": "
|
|
167
|
-
"customer_accounts.admin.roleDetail.sections.permissions": "
|
|
168
|
-
"customer_accounts.admin.roleDetail.selectAll": "
|
|
177
|
+
"customer_accounts.admin.roleDetail.sections.details": "Detalles del rol",
|
|
178
|
+
"customer_accounts.admin.roleDetail.sections.options": "Opciones",
|
|
179
|
+
"customer_accounts.admin.roleDetail.sections.permissions": "Permisos del portal",
|
|
180
|
+
"customer_accounts.admin.roleDetail.selectAll": "Seleccionar todo",
|
|
169
181
|
"customer_accounts.admin.roles": "Roles",
|
|
170
182
|
"customer_accounts.admin.roles.actions.create": "Create Role",
|
|
171
183
|
"customer_accounts.admin.roles.actions.delete": "Delete",
|
|
@@ -103,24 +103,36 @@
|
|
|
103
103
|
"customer_accounts.admin.flash.deactivated": "Użytkownik dezaktywowany",
|
|
104
104
|
"customer_accounts.admin.flash.deleted": "Użytkownik usunięty",
|
|
105
105
|
"customer_accounts.admin.inactive": "Nieaktywny",
|
|
106
|
-
"customer_accounts.admin.portalFeatures.addresses.manage": "
|
|
107
|
-
"customer_accounts.admin.portalFeatures.addresses.
|
|
108
|
-
"customer_accounts.admin.portalFeatures.
|
|
109
|
-
"customer_accounts.admin.portalFeatures.
|
|
110
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
111
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
112
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
113
|
-
"customer_accounts.admin.portalFeatures.groups.
|
|
114
|
-
"customer_accounts.admin.portalFeatures.
|
|
115
|
-
"customer_accounts.admin.portalFeatures.
|
|
116
|
-
"customer_accounts.admin.portalFeatures.
|
|
117
|
-
"customer_accounts.admin.portalFeatures.
|
|
118
|
-
"customer_accounts.admin.portalFeatures.
|
|
119
|
-
"customer_accounts.admin.portalFeatures.
|
|
120
|
-
"customer_accounts.admin.portalFeatures.
|
|
121
|
-
"customer_accounts.admin.portalFeatures.
|
|
122
|
-
"customer_accounts.admin.portalFeatures.
|
|
123
|
-
"customer_accounts.admin.portalFeatures.
|
|
106
|
+
"customer_accounts.admin.portalFeatures.addresses.manage": "Zarządzanie adresami",
|
|
107
|
+
"customer_accounts.admin.portalFeatures.addresses.manage.description": "Umożliwia dodawanie, edycję i usuwanie adresów",
|
|
108
|
+
"customer_accounts.admin.portalFeatures.addresses.view": "Wyświetlanie adresów",
|
|
109
|
+
"customer_accounts.admin.portalFeatures.addresses.view.description": "Umożliwia przeglądanie zapisanych adresów wysyłki i rozliczeniowych",
|
|
110
|
+
"customer_accounts.admin.portalFeatures.groups.addresses": "Adresy",
|
|
111
|
+
"customer_accounts.admin.portalFeatures.groups.invoices": "Faktury",
|
|
112
|
+
"customer_accounts.admin.portalFeatures.groups.orders": "Zamówienia",
|
|
113
|
+
"customer_accounts.admin.portalFeatures.groups.profile": "Profil",
|
|
114
|
+
"customer_accounts.admin.portalFeatures.groups.quotes": "Oferty",
|
|
115
|
+
"customer_accounts.admin.portalFeatures.groups.users": "Użytkownicy",
|
|
116
|
+
"customer_accounts.admin.portalFeatures.invoices.view": "Wyświetlanie faktur",
|
|
117
|
+
"customer_accounts.admin.portalFeatures.invoices.view.description": "Umożliwia przeglądanie faktur i historii płatności",
|
|
118
|
+
"customer_accounts.admin.portalFeatures.orders.create": "Tworzenie zamówień",
|
|
119
|
+
"customer_accounts.admin.portalFeatures.orders.create.description": "Umożliwia składanie nowych zamówień przez portal",
|
|
120
|
+
"customer_accounts.admin.portalFeatures.orders.view": "Wyświetlanie zamówień",
|
|
121
|
+
"customer_accounts.admin.portalFeatures.orders.view.description": "Umożliwia przeglądanie historii i szczegółów zamówień",
|
|
122
|
+
"customer_accounts.admin.portalFeatures.profile.edit": "Edycja profilu",
|
|
123
|
+
"customer_accounts.admin.portalFeatures.profile.edit.description": "Umożliwia edycję nazwy wyświetlanej i innych ustawień profilu",
|
|
124
|
+
"customer_accounts.admin.portalFeatures.profile.view": "Wyświetlanie profilu",
|
|
125
|
+
"customer_accounts.admin.portalFeatures.profile.view.description": "Umożliwia przeglądanie własnych informacji profilowych i szczegółów konta",
|
|
126
|
+
"customer_accounts.admin.portalFeatures.quotes.request": "Prośba o oferty",
|
|
127
|
+
"customer_accounts.admin.portalFeatures.quotes.request.description": "Umożliwia zamawianie nowych ofert od firmy",
|
|
128
|
+
"customer_accounts.admin.portalFeatures.quotes.view": "Wyświetlanie ofert",
|
|
129
|
+
"customer_accounts.admin.portalFeatures.quotes.view.description": "Umożliwia przeglądanie otrzymanych ofert i ich szczegółów",
|
|
130
|
+
"customer_accounts.admin.portalFeatures.users.invite": "Zapraszanie członków zespołu",
|
|
131
|
+
"customer_accounts.admin.portalFeatures.users.invite.description": "Umożliwia wysyłanie zaproszeń do portalu nowym członkom zespołu",
|
|
132
|
+
"customer_accounts.admin.portalFeatures.users.manage": "Zarządzanie członkami zespołu",
|
|
133
|
+
"customer_accounts.admin.portalFeatures.users.manage.description": "Umożliwia edycję ról i usuwanie członków zespołu",
|
|
134
|
+
"customer_accounts.admin.portalFeatures.users.view": "Wyświetlanie członków zespołu",
|
|
135
|
+
"customer_accounts.admin.portalFeatures.users.view.description": "Umożliwia przeglądanie innych członków zespołu w organizacji",
|
|
124
136
|
"customer_accounts.admin.portalInfo.credentials": "Demo credentials: alice.johnson@example.com / Password123!",
|
|
125
137
|
"customer_accounts.admin.portalInfo.description": "Manage customer portal accounts. Customers can self-register, log in, and access orders, quotes, and invoices through the portal.",
|
|
126
138
|
"customer_accounts.admin.portalInfo.open": "Open Portal",
|
|
@@ -163,9 +175,9 @@
|
|
|
163
175
|
"customer_accounts.admin.roleDetail.flash.saved": "Rola zaktualizowana",
|
|
164
176
|
"customer_accounts.admin.roleDetail.loading": "Ładowanie roli...",
|
|
165
177
|
"customer_accounts.admin.roleDetail.sections.details": "Szczegóły roli",
|
|
166
|
-
"customer_accounts.admin.roleDetail.sections.options": "
|
|
178
|
+
"customer_accounts.admin.roleDetail.sections.options": "Opcje",
|
|
167
179
|
"customer_accounts.admin.roleDetail.sections.permissions": "Uprawnienia portalu",
|
|
168
|
-
"customer_accounts.admin.roleDetail.selectAll": "
|
|
180
|
+
"customer_accounts.admin.roleDetail.selectAll": "Zaznacz wszystko",
|
|
169
181
|
"customer_accounts.admin.roles": "Role",
|
|
170
182
|
"customer_accounts.admin.roles.actions.create": "Utwórz rolę",
|
|
171
183
|
"customer_accounts.admin.roles.actions.delete": "Usuń",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
4
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
4
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
5
5
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
6
6
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
7
7
|
import { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'
|
|
@@ -116,7 +116,7 @@ export async function GET(req: Request, ctx: { params?: { id?: string } }) {
|
|
|
116
116
|
decryptionScope,
|
|
117
117
|
)
|
|
118
118
|
if (!company) {
|
|
119
|
-
throw
|
|
119
|
+
throw notFound(translate('customers.errors.company_not_found', 'Company not found'))
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
if (!isOrganizationReadAccessAllowed({ scope, auth, organizationId: company.organizationId })) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
4
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
4
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
5
5
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
6
6
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
7
7
|
import { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'
|
|
@@ -98,7 +98,7 @@ export async function GET(req: Request, ctx: { params?: { id?: string } }) {
|
|
|
98
98
|
decryptionScope,
|
|
99
99
|
)
|
|
100
100
|
if (!deal) {
|
|
101
|
-
throw
|
|
101
|
+
throw notFound(translate('customers.errors.deal_not_found', 'Deal not found'))
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if (!isOrganizationReadAccessAllowed({ scope, auth, organizationId: deal.organizationId })) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
4
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
4
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
5
5
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
6
6
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
7
7
|
import { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'
|
|
@@ -98,7 +98,7 @@ export async function GET(req: Request, ctx: { params?: { id?: string } }) {
|
|
|
98
98
|
decryptionScope,
|
|
99
99
|
)
|
|
100
100
|
if (!deal) {
|
|
101
|
-
throw
|
|
101
|
+
throw notFound(translate('customers.errors.deal_not_found', 'Deal not found'))
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if (!isOrganizationReadAccessAllowed({ scope, auth, organizationId: deal.organizationId })) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
4
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
4
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
5
5
|
import type { CommandBus } from '@open-mercato/shared/lib/commands'
|
|
6
6
|
import { serializeOperationMetadata } from '@open-mercato/shared/lib/commands/operationMetadata'
|
|
7
7
|
import type { CommandExecuteResult } from '@open-mercato/shared/lib/commands/types'
|
|
@@ -86,7 +86,7 @@ export async function PATCH(req: Request, ctx: { params?: { kind?: string; id?:
|
|
|
86
86
|
} catch (err) {
|
|
87
87
|
if (isCrudHttpError(err)) {
|
|
88
88
|
if (err.status === 404) {
|
|
89
|
-
throw
|
|
89
|
+
throw notFound(routeContext.translate('customers.errors.lookup_failed', 'Dictionary entry not found'))
|
|
90
90
|
}
|
|
91
91
|
if (err.status === 409) {
|
|
92
92
|
if ((err.body as Record<string, unknown> | undefined)?.code === 'role_type_in_use') {
|
|
@@ -123,7 +123,7 @@ export async function PATCH(req: Request, ctx: { params?: { kind?: string; id?:
|
|
|
123
123
|
},
|
|
124
124
|
)
|
|
125
125
|
if (!entry) {
|
|
126
|
-
throw
|
|
126
|
+
throw notFound(routeContext.translate('customers.errors.lookup_failed', 'Dictionary entry not found'))
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
if (result.changed) {
|
|
@@ -218,7 +218,7 @@ export async function DELETE(req: Request, ctx: { params?: { kind?: string; id?:
|
|
|
218
218
|
})) as CommandExecuteResult<{ entryId: string }>
|
|
219
219
|
} catch (err) {
|
|
220
220
|
if (isCrudHttpError(err) && err.status === 404) {
|
|
221
|
-
throw
|
|
221
|
+
throw notFound(routeContext.translate('customers.errors.lookup_failed', 'Dictionary entry not found'))
|
|
222
222
|
}
|
|
223
223
|
if (isCrudHttpError(err) && err.status === 409 && (err.body as Record<string, unknown> | undefined)?.code === 'role_type_in_use') {
|
|
224
224
|
const usageCount = Number((err.body as Record<string, unknown> | undefined)?.usageCount ?? 0)
|
|
@@ -4,7 +4,7 @@ import type { CommandBus } from '@open-mercato/shared/lib/commands'
|
|
|
4
4
|
import type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
5
5
|
import { readJsonSafe } from '@open-mercato/shared/lib/http/readJsonSafe'
|
|
6
6
|
import { validateCrudMutationGuard, runCrudMutationGuardAfterSuccess } from '@open-mercato/shared/lib/crud/mutation-guard'
|
|
7
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
7
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
8
8
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
9
9
|
import { findOneWithDecryption, findWithDecryption } from '@open-mercato/shared/lib/encryption/find'
|
|
10
10
|
import { isOrganizationReadAccessAllowed } from '@open-mercato/core/modules/directory/utils/organizationScopeGuard'
|
|
@@ -130,7 +130,7 @@ async function resolveEntityRouteScope(
|
|
|
130
130
|
{ tenantId: auth.tenantId, organizationId: scope?.selectedId ?? auth.orgId ?? null },
|
|
131
131
|
)
|
|
132
132
|
if (!entity || entity.tenantId !== auth.tenantId) {
|
|
133
|
-
throw
|
|
133
|
+
throw notFound(translate('customers.errors.customer_not_found', 'Customer not found'))
|
|
134
134
|
}
|
|
135
135
|
ensureRouteOrganizationAccess(entity.organizationId, scope, auth, translate)
|
|
136
136
|
return {
|
|
@@ -162,7 +162,7 @@ async function resolveRoleRouteScope(
|
|
|
162
162
|
role.entityType !== entityType ||
|
|
163
163
|
role.entityId !== entityId
|
|
164
164
|
) {
|
|
165
|
-
throw
|
|
165
|
+
throw notFound(translate('customers.errors.role_not_found', 'Role not found'))
|
|
166
166
|
}
|
|
167
167
|
ensureRouteOrganizationAccess(role.organizationId, scope, auth, translate)
|
|
168
168
|
return {
|
|
@@ -4,7 +4,7 @@ import { labelAssignCommandSchema, labelAssignmentSchema, type LabelAssignComman
|
|
|
4
4
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
5
5
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
6
6
|
import { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'
|
|
7
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
7
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
8
8
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
9
9
|
import type { CommandBus } from '@open-mercato/shared/lib/commands'
|
|
10
10
|
import type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
@@ -80,7 +80,7 @@ export async function POST(req: Request) {
|
|
|
80
80
|
{ tenantId: auth.tenantId, organizationId },
|
|
81
81
|
)
|
|
82
82
|
if (!targetEntity) {
|
|
83
|
-
throw
|
|
83
|
+
throw notFound(translate('customers.errors.entity_not_found', 'Entity not found'))
|
|
84
84
|
}
|
|
85
85
|
const entityKind = targetEntity.kind === 'person' || targetEntity.kind === 'company' ? targetEntity.kind : null
|
|
86
86
|
const resourceKind = resolveResourceKind(entityKind)
|
|
@@ -4,7 +4,7 @@ import { labelUnassignCommandSchema, labelAssignmentSchema, type LabelUnassignCo
|
|
|
4
4
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
5
5
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
6
6
|
import { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'
|
|
7
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
7
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
8
8
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
9
9
|
import type { CommandBus } from '@open-mercato/shared/lib/commands'
|
|
10
10
|
import type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
@@ -80,7 +80,7 @@ export async function POST(req: Request) {
|
|
|
80
80
|
{ tenantId: auth.tenantId, organizationId },
|
|
81
81
|
)
|
|
82
82
|
if (!targetEntity) {
|
|
83
|
-
throw
|
|
83
|
+
throw notFound(translate('customers.errors.entity_not_found', 'Entity not found'))
|
|
84
84
|
}
|
|
85
85
|
const entityKind = targetEntity.kind === 'person' || targetEntity.kind === 'company' ? targetEntity.kind : null
|
|
86
86
|
const resourceKind = resolveResourceKind(entityKind)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { z } from 'zod'
|
|
3
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
3
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
4
4
|
import {
|
|
5
5
|
runCrudMutationGuardAfterSuccess,
|
|
6
6
|
validateCrudMutationGuard,
|
|
@@ -147,9 +147,7 @@ export async function PATCH(req: Request, ctx: { params?: { id?: string; linkId?
|
|
|
147
147
|
selectedOrganizationId,
|
|
148
148
|
)
|
|
149
149
|
if (!resolvedLinkId) {
|
|
150
|
-
throw
|
|
151
|
-
error: translate('customers.errors.person_company_link_not_found', 'Person-company link not found'),
|
|
152
|
-
})
|
|
150
|
+
throw notFound(translate('customers.errors.person_company_link_not_found', 'Person-company link not found'))
|
|
153
151
|
}
|
|
154
152
|
|
|
155
153
|
const commandInput = personCompanyLinkUpdateSchema.parse({
|
|
@@ -265,9 +263,7 @@ export async function DELETE(req: Request, ctx: { params?: { id?: string; linkId
|
|
|
265
263
|
selectedOrganizationId,
|
|
266
264
|
)
|
|
267
265
|
if (!resolvedLinkId) {
|
|
268
|
-
throw
|
|
269
|
-
error: translate('customers.errors.person_company_link_not_found', 'Person-company link not found'),
|
|
270
|
-
})
|
|
266
|
+
throw notFound(translate('customers.errors.person_company_link_not_found', 'Person-company link not found'))
|
|
271
267
|
}
|
|
272
268
|
|
|
273
269
|
const commandInput = personCompanyLinkDeleteSchema.parse({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
2
|
-
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
2
|
+
import { CrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
3
3
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
4
4
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
5
5
|
import {
|
|
@@ -35,7 +35,7 @@ export async function loadPersonContext(req: Request, personId: string) {
|
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
if (!person) {
|
|
38
|
-
throw
|
|
38
|
+
throw notFound(translate('customers.errors.person_not_found', 'Person not found'))
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (!isOrganizationReadAccessAllowed({ scope, auth: authenticatedAuth, organizationId: person.organizationId })) {
|
|
@@ -53,7 +53,7 @@ export async function loadPersonContext(req: Request, personId: string) {
|
|
|
53
53
|
},
|
|
54
54
|
)
|
|
55
55
|
if (!profile) {
|
|
56
|
-
throw
|
|
56
|
+
throw notFound(translate('customers.errors.person_profile_not_found', 'Person profile not found'))
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
4
|
-
import { CrudHttpError, isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
4
|
+
import { CrudHttpError, isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
5
5
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
6
6
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
7
7
|
import { resolveOrganizationScopeForRequest } from '@open-mercato/core/modules/directory/utils/organizationScope'
|
|
@@ -174,7 +174,7 @@ export async function GET(req: Request, ctx: { params?: { id?: string } }) {
|
|
|
174
174
|
const decryptionScope = { tenantId: auth.tenantId, organizationId: auth.orgId ?? null }
|
|
175
175
|
const person = await findOneWithDecryption(em, CustomerEntity, { id, kind: 'person', tenantId: auth.tenantId, deletedAt: null }, {}, decryptionScope)
|
|
176
176
|
if (!person) {
|
|
177
|
-
throw
|
|
177
|
+
throw notFound(translate('customers.errors.person_not_found', 'Person not found'))
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
if (!isOrganizationReadAccessAllowed({ scope, auth, organizationId: person.organizationId })) {
|
|
@@ -7,7 +7,7 @@ import { z } from 'zod'
|
|
|
7
7
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
8
8
|
import type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
9
9
|
import type { CommandBus } from '@open-mercato/shared/lib/commands'
|
|
10
|
-
import {
|
|
10
|
+
import { isCrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
11
11
|
import { parseBooleanToken } from '@open-mercato/shared/lib/boolean'
|
|
12
12
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
13
13
|
import {
|
|
@@ -218,7 +218,7 @@ async function resolveCanonicalTodoTargetId(
|
|
|
218
218
|
|
|
219
219
|
const legacyLink = await findLegacyTodoLink(em, target, tenantId)
|
|
220
220
|
if (!legacyLink) {
|
|
221
|
-
if (!target.todoId) throw
|
|
221
|
+
if (!target.todoId) throw notFound('Todo not found')
|
|
222
222
|
return target.todoId
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
resolveParentResourceKind,
|
|
15
15
|
} from './shared'
|
|
16
16
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
17
|
-
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
17
|
+
import { CrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
18
18
|
import type { CrudIndexerConfig, CrudEventsConfig } from '@open-mercato/shared/lib/crud/types'
|
|
19
19
|
import { E } from '#generated/entities.ids.generated'
|
|
20
20
|
import { withAtomicFlush } from '@open-mercato/shared/lib/commands/flush'
|
|
@@ -288,7 +288,7 @@ const updateAddressCommand: CommandHandler<AddressUpdateInput, { addressId: stri
|
|
|
288
288
|
const parsed = addressUpdateSchema.parse(rawInput)
|
|
289
289
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
290
290
|
const address = await em.findOne(CustomerAddress, { id: parsed.id })
|
|
291
|
-
if (!address) throw
|
|
291
|
+
if (!address) throw notFound('Address not found')
|
|
292
292
|
ensureTenantScope(ctx, address.tenantId)
|
|
293
293
|
ensureOrganizationScope(ctx, address.organizationId)
|
|
294
294
|
|
|
@@ -477,7 +477,7 @@ const deleteAddressCommand: CommandHandler<{ body?: Record<string, unknown>; que
|
|
|
477
477
|
const id = requireId(input, 'Address id required')
|
|
478
478
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
479
479
|
const address = await em.findOne(CustomerAddress, { id })
|
|
480
|
-
if (!address) throw
|
|
480
|
+
if (!address) throw notFound('Address not found')
|
|
481
481
|
ensureTenantScope(ctx, address.tenantId)
|
|
482
482
|
ensureOrganizationScope(ctx, address.organizationId)
|
|
483
483
|
em.remove(address)
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
resolveParentResourceKind,
|
|
16
16
|
} from './shared'
|
|
17
17
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
18
|
-
import {
|
|
18
|
+
import { notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
19
19
|
import type { CrudIndexerConfig, CrudEventsConfig } from '@open-mercato/shared/lib/crud/types'
|
|
20
20
|
import { E } from '#generated/entities.ids.generated'
|
|
21
21
|
import { makeCreateRedo } from '@open-mercato/shared/lib/commands/redo'
|
|
@@ -196,7 +196,7 @@ const updateCommentCommand: CommandHandler<CommentUpdateInput, { commentId: stri
|
|
|
196
196
|
const parsed = commentUpdateSchema.parse(rawInput)
|
|
197
197
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
198
198
|
const comment = await em.findOne(CustomerComment, { id: parsed.id })
|
|
199
|
-
if (!comment) throw
|
|
199
|
+
if (!comment) throw notFound('Comment not found')
|
|
200
200
|
ensureTenantScope(ctx, comment.tenantId)
|
|
201
201
|
ensureOrganizationScope(ctx, comment.organizationId)
|
|
202
202
|
|
|
@@ -332,7 +332,7 @@ const deleteCommentCommand: CommandHandler<{ body?: Record<string, unknown>; que
|
|
|
332
332
|
const id = requireId(input, 'Comment id required')
|
|
333
333
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
334
334
|
const comment = await em.findOne(CustomerComment, { id })
|
|
335
|
-
if (!comment) throw
|
|
335
|
+
if (!comment) throw notFound('Comment not found')
|
|
336
336
|
ensureTenantScope(ctx, comment.tenantId)
|
|
337
337
|
ensureOrganizationScope(ctx, comment.organizationId)
|
|
338
338
|
em.remove(comment)
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import type { DataEngine } from '@open-mercato/shared/lib/data/engine'
|
|
12
12
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
13
13
|
import type { CommandRuntimeContext } from '@open-mercato/shared/lib/commands'
|
|
14
|
-
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
14
|
+
import { CrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
15
15
|
import {
|
|
16
16
|
CustomerAddress,
|
|
17
17
|
CustomerComment,
|
|
@@ -738,7 +738,7 @@ const updateCompanyCommand: CommandHandler<CompanyUpdateInput, { entityId: strin
|
|
|
738
738
|
ensureTenantScope(ctx, record.tenantId)
|
|
739
739
|
ensureOrganizationScope(ctx, record.organizationId)
|
|
740
740
|
const profile = await em.findOne(CustomerCompanyProfile, { entity: record })
|
|
741
|
-
if (!profile) throw
|
|
741
|
+
if (!profile) throw notFound('Company profile not found')
|
|
742
742
|
|
|
743
743
|
await withAtomicFlush(em, [
|
|
744
744
|
() => {
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
buildCustomFieldResetMap,
|
|
41
41
|
type CustomFieldChangeSet,
|
|
42
42
|
} from '@open-mercato/shared/lib/commands/customFieldSnapshots'
|
|
43
|
-
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
43
|
+
import { CrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
44
44
|
import type { CrudIndexerConfig, CrudEventsConfig } from '@open-mercato/shared/lib/crud/types'
|
|
45
45
|
import { E } from '#generated/entities.ids.generated'
|
|
46
46
|
import { findWithDecryption, findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'
|
|
@@ -625,7 +625,7 @@ const updateDealCommand: CommandHandler<DealUpdateInput, { dealId: string }> = {
|
|
|
625
625
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
626
626
|
const deal = await findOneWithDecryption(em, CustomerDeal, { id: parsed.id, deletedAt: null })
|
|
627
627
|
const record = deal ?? null
|
|
628
|
-
if (!record) throw
|
|
628
|
+
if (!record) throw notFound('Deal not found')
|
|
629
629
|
ensureTenantScope(ctx, record.tenantId)
|
|
630
630
|
ensureOrganizationScope(ctx, record.organizationId)
|
|
631
631
|
|
|
@@ -936,7 +936,7 @@ const deleteDealCommand: CommandHandler<{ body?: Record<string, unknown>; query?
|
|
|
936
936
|
const em = (ctx.container.resolve('em') as EntityManager).fork()
|
|
937
937
|
const deal = await findOneWithDecryption(em, CustomerDeal, { id, deletedAt: null })
|
|
938
938
|
const record = deal ?? null
|
|
939
|
-
if (!record) throw
|
|
939
|
+
if (!record) throw notFound('Deal not found')
|
|
940
940
|
ensureTenantScope(ctx, record.tenantId)
|
|
941
941
|
ensureOrganizationScope(ctx, record.organizationId)
|
|
942
942
|
await deleteDealStageTransitions(em, record)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registerCommand, type CommandHandler } from '@open-mercato/shared/lib/commands'
|
|
2
2
|
import type { CommandRuntimeContext } from '@open-mercato/shared/lib/commands'
|
|
3
3
|
import { buildChanges } from '@open-mercato/shared/lib/commands/helpers'
|
|
4
|
-
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
4
|
+
import { CrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
5
5
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
6
6
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
7
7
|
import { invalidateDictionaryCache } from '../api/dictionaries/cache'
|
|
@@ -425,7 +425,7 @@ const updateDictionaryEntryCommand: CommandHandler<CustomerDictionaryEntryUpdate
|
|
|
425
425
|
},
|
|
426
426
|
)
|
|
427
427
|
if (!entry || entry.organizationId !== parsed.organizationId || entry.tenantId !== parsed.tenantId || entry.kind !== parsed.kind) {
|
|
428
|
-
throw
|
|
428
|
+
throw notFound('Dictionary entry not found')
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
let changed = false
|
|
@@ -611,7 +611,7 @@ const deleteDictionaryEntryCommand: CommandHandler<CustomerDictionaryEntryDelete
|
|
|
611
611
|
},
|
|
612
612
|
)
|
|
613
613
|
if (!entry || entry.organizationId !== parsed.organizationId || entry.tenantId !== parsed.tenantId || entry.kind !== parsed.kind) {
|
|
614
|
-
throw
|
|
614
|
+
throw notFound('Dictionary entry not found')
|
|
615
615
|
}
|
|
616
616
|
if (entry.kind === 'person_company_role') {
|
|
617
617
|
const usage = await loadRoleTypeUsage(em, {
|
|
@@ -2,7 +2,7 @@ import { registerCommand } from '@open-mercato/shared/lib/commands'
|
|
|
2
2
|
import type { CommandHandler } from '@open-mercato/shared/lib/commands'
|
|
3
3
|
import type { CrudEventsConfig } from '@open-mercato/shared/lib/crud/types'
|
|
4
4
|
import { emitCrudSideEffects, emitCrudUndoSideEffects } from '@open-mercato/shared/lib/commands/helpers'
|
|
5
|
-
import { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
5
|
+
import { CrudHttpError, notFound } from '@open-mercato/shared/lib/crud/errors'
|
|
6
6
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
7
7
|
import { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'
|
|
8
8
|
import type { DataEngine } from '@open-mercato/shared/lib/data/engine'
|
|
@@ -345,7 +345,7 @@ const updateEntityRoleCommand: CommandHandler<EntityRoleUpdateInput, { roleId: s
|
|
|
345
345
|
{ tenantId: parsed.tenantId, organizationId: parsed.organizationId },
|
|
346
346
|
)
|
|
347
347
|
if (!role) {
|
|
348
|
-
throw
|
|
348
|
+
throw notFound('Role not found')
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
role.userId = parsed.userId
|
|
@@ -448,7 +448,7 @@ const deleteEntityRoleCommand: CommandHandler<EntityRoleDeleteInput, { roleId: s
|
|
|
448
448
|
{ tenantId: parsed.tenantId, organizationId: parsed.organizationId },
|
|
449
449
|
)
|
|
450
450
|
if (!role) {
|
|
451
|
-
throw
|
|
451
|
+
throw notFound('Role not found')
|
|
452
452
|
}
|
|
453
453
|
|
|
454
454
|
role.deletedAt = new Date()
|