diff --git a/backend/src/main/java/com/delivera/config/SecurityConfig.java b/backend/src/main/java/com/delivera/config/SecurityConfig.java index 60eff164..f669f4ff 100644 --- a/backend/src/main/java/com/delivera/config/SecurityConfig.java +++ b/backend/src/main/java/com/delivera/config/SecurityConfig.java @@ -72,7 +72,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http, auth.requestMatchers(HttpMethod.POST, api + "/loyal-users").hasRole(ADMIN); auth.requestMatchers(HttpMethod.PUT, api + "/loyal-users/**").hasRole(ADMIN); - auth.requestMatchers(HttpMethod.GET, api + "/loyal-users/me/orders").hasRole(LOYAL_USER); + auth.requestMatchers(HttpMethod.GET, api + "/loyal-users/me/orders").authenticated(); auth.requestMatchers(HttpMethod.POST, api + "/workers/invite").hasRole(ADMIN); auth.requestMatchers(HttpMethod.PATCH, api + "/workers/*/role").hasRole(ADMIN); diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml index f9139d0c..6df043f2 100644 --- a/frontend/src/locales/en.yml +++ b/frontend/src/locales/en.yml @@ -261,9 +261,9 @@ orders: details: Details priority: label: Priority - HIGH: HIGH - NORMAL: NORMAL - LOW: LOW + HIGH: High + NORMAL: Normal + LOW: Low status: PENDING: Pending IN_TRANSIT: In transit diff --git a/frontend/src/locales/es.yml b/frontend/src/locales/es.yml index ab11e07d..aad3906c 100644 --- a/frontend/src/locales/es.yml +++ b/frontend/src/locales/es.yml @@ -261,9 +261,9 @@ orders: details: Detalles priority: label: Prioridad - HIGH: ALTA + HIGH: Alta NORMAL: Normal - LOW: BAJA + LOW: Baja status: PENDING: Pendiente IN_TRANSIT: En trĂ¡nsito diff --git a/frontend/src/views/auth/OnboardingView.vue b/frontend/src/views/auth/OnboardingView.vue index ef6789a0..13205566 100644 --- a/frontend/src/views/auth/OnboardingView.vue +++ b/frontend/src/views/auth/OnboardingView.vue @@ -14,6 +14,7 @@ const step = ref(1) // 1 = crear unidad, 2 = invitar trabajador // Step 1: unidad const unitName = ref('') const unitType = ref('WAREHOUSE') +const unitAddress = ref('') const unitSaving = ref(false) const unitError = ref('') @@ -30,10 +31,11 @@ const roleOptions = WORKER_ROLES.map(r => ({ label: t('workers.roles.' + r), val async function createUnit() { if (!unitName.value.trim()) { unitError.value = t('validation.required', { field: t('fields.unitName') }); return } + if (!unitAddress.value.trim()) { unitError.value = t('validation.required', { field: t('fields.address') }); return } unitSaving.value = true unitError.value = '' try { - const res = await api.post('/units', { name: unitName.value.trim(), type: unitType.value }) + const res = await api.post('/units', { name: unitName.value.trim(), type: unitType.value, address: unitAddress.value.trim() }) if (res.ok) step.value = 2 else { const d = await res.json(); unitError.value = api.translateError(d, 'error.saveFailed') } } catch { unitError.value = t('error.connection') } @@ -79,6 +81,10 @@ async function inviteWorker() { +
+ + +
{{ unitError }}