Files
shopit-front/src/app/features/store/store.routes.ts
ncoronel 591f53c102 Squashed commit of the following:
commit 38d03588b1
Merge: 8e987d0 6f4aa3b
Author: ncoronel <ncoronel@quo.ar>
Date:   Wed Aug 26 10:25:23 2026 -0300

    Merge branch 'fix/cart-expiration-notification' of https://gitea.quo.ar/tbianchini/shopit-front into fix/cart-expiration-notification

commit 8e987d0ce6
Author: ncoronel <ncoronel@quo.ar>
Date:   Wed Aug 26 10:02:26 2026 -0300

    fix(purchase-status): clear cart on approved purchase

commit e171b9a233
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 17:06:07 2026 -0300

    refactor(checkout): use purchase id route segment

commit 643d43adea
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 17:05:59 2026 -0300

    fix(checkout): handle expired purchase exits

commit d89d01b511
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 16:47:17 2026 -0300

    fix(checkout): refresh expired carts

commit eeb245209b
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 16:46:12 2026 -0300

    fix(checkout): show backend start errors

commit 9d3754c2d8
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 16:33:44 2026 -0300

    fix(cart): refresh state after expiration

commit 6f4aa3b1bd
Author: ncoronel <ncoronel@quo.ar>
Date:   Wed Aug 26 10:02:26 2026 -0300

    fix(purchase-status): clear cart on approved purchase

commit 2b342ec235
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 17:06:07 2026 -0300

    refactor(checkout): use purchase id route segment

commit d06b146104
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 17:05:59 2026 -0300

    fix(checkout): handle expired purchase exits

commit f4e0a9e028
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 16:47:17 2026 -0300

    fix(checkout): refresh expired carts

commit 8c2b738806
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 16:46:12 2026 -0300

    fix(checkout): show backend start errors

commit 1362d0c163
Author: ncoronel <ncoronel@quo.ar>
Date:   Tue Aug 25 16:33:44 2026 -0300

    fix(cart): refresh state after expiration
2026-08-26 10:29:23 -03:00

209 lines
6.8 KiB
TypeScript

import { Routes } from '@angular/router';
import { SimpleLayoutComponent } from '../../core/layout/simple-layout/simple-layout.component';
import { StoreLayoutComponent } from '../../core/layout/store-layout/store-layout.component';
import { authGuard, guestOnlyGuard } from '../../core/services/auth/auth.guards';
import { LoginPageComponent } from './pages/login-page/login-page.component';
import { hasMenuGuard } from '../../core/guards/menu.guard';
import { productDetailResolver } from './pages/product-detail-page/product-detail-page.resolver';
import { RecoverPasswordCodePageComponent } from './pages/recover-password-code-page/recover-password-code-page.component';
import { RecoverPasswordPageComponent } from './pages/recover-password-page/recover-password-page.component';
import { ResetPasswordPageComponent } from './pages/reset-password-page/reset-password-page.component';
import { RegisterPageComponent } from './pages/register-page/register-page.component';
import { StoreHomePageComponent } from './pages/store-home-page/store-home-page.component';
import { storeHomeCatalogResolver } from './pages/store-home-page/store-home-page.resolver';
import { checkoutPendingPurchaseGuard } from './pages/checkout-page/checkout-page.guard';
export const routes: Routes = [
{
path: '',
component: StoreLayoutComponent,
children: [
{
path: '',
component: StoreHomePageComponent,
canActivate: [hasMenuGuard('index')],
resolve: {
catalogData: storeHomeCatalogResolver,
},
},
{
path: 'login',
canActivate: [guestOnlyGuard],
component: SimpleLayoutComponent,
children: [
{
path: '',
component: LoginPageComponent,
},
],
},
{
path: 'register',
canActivate: [guestOnlyGuard],
component: SimpleLayoutComponent,
children: [
{
path: '',
component: RegisterPageComponent,
},
],
},
{
path: 'recuperar-contrasena',
canActivate: [guestOnlyGuard],
component: SimpleLayoutComponent,
children: [
{
path: '',
component: RecoverPasswordPageComponent,
},
{
path: 'codigo',
component: RecoverPasswordCodePageComponent,
},
{
path: 'restablecer',
component: ResetPasswordPageComponent,
},
],
},
{
path: 'buscar',
loadComponent: () =>
import('./pages/search-page/search-page.component').then((m) => m.SearchPageComponent),
},
{
path: 'categoria/:id',
loadComponent: () =>
import('./pages/category-items-page/category-items-page.component').then(
(m) => m.CategoryItemsPageComponent,
),
},
{
path: 'producto/:id',
canActivate: [hasMenuGuard('product.detail')],
resolve: {
productDetailData: productDetailResolver,
},
loadComponent: () =>
import('./pages/product-detail-page/product-detail-page.component').then(
(m) => m.ProductDetailPageComponent,
),
},
{
path: 'checkout/status',
component: SimpleLayoutComponent,
children: [
{
path: ':id',
loadComponent: () =>
import('./pages/purchase-status-page/purchase-status-page.component').then(
(m) => m.PurchaseStatusPageComponent,
),
},
],
},
{
path: 'checkout/:id',
canActivate: [authGuard, hasMenuGuard('checkout')],
canDeactivate: [checkoutPendingPurchaseGuard],
loadComponent: () =>
import('./pages/checkout-page/checkout-page.component').then(
(m) => m.CheckoutPageComponent,
),
},
{
path: 'ayuda',
canActivate: [hasMenuGuard('help')],
data: {
menuCode: 'help',
navigationLabel: 'Secciones de ayuda',
},
loadComponent: () =>
import('./components/menu-page-layout/menu-page-layout.component').then(
(m) => m.MenuPageLayoutComponent,
),
children: [
{
path: 'preguntas-frecuentes',
canActivate: [hasMenuGuard('help.faq')],
loadComponent: () =>
import('./pages/help-page/pages/faq-page/faq-page').then((m) => m.FaqPage),
},
{
path: 'contacto',
canActivate: [hasMenuGuard('help.contact')],
loadComponent: () =>
import('./pages/help-page/pages/contact-page/contact-page').then(
(m) => m.ContactPage,
),
},
{
path: '',
redirectTo: 'preguntas-frecuentes',
pathMatch: 'full',
},
{
path: '**',
loadComponent: () =>
import('./pages/help-page/pages/pending-help-page/pending-help-page').then(
(m) => m.PendingHelpPage,
),
},
],
},
{
path: 'mi-cuenta',
canActivate: [authGuard, hasMenuGuard('account')],
data: {
menuCode: 'account',
navigationLabel: 'Secciones de mi cuenta',
},
loadComponent: () =>
import('./components/menu-page-layout/menu-page-layout.component').then(
(m) => m.MenuPageLayoutComponent,
),
children: [
{
path: 'datos-personales',
canActivate: [hasMenuGuard('account.profile')],
loadComponent: () =>
import('./pages/account-page/pages/profile-page/profile-page').then(
(m) => m.ProfilePage,
),
},
{
path: 'compras',
canActivate: [hasMenuGuard('account.purchases')],
loadComponent: () =>
import('./pages/account-page/pages/purchases-page/purchases-page').then(
(m) => m.PurchasesPage,
),
},
{
path: 'compras/:id',
loadComponent: () =>
import('./pages/account-page/pages/purchase-detail-page/purchase-detail-page').then(
(m) => m.PurchaseDetailPage,
),
},
{
path: 'tickets',
canActivate: [hasMenuGuard('account.tickets')],
loadComponent: () =>
import('./pages/account-page/pages/tickets-page/tickets-page').then(
(m) => m.TicketsPage,
),
},
{
path: '',
redirectTo: 'datos-personales',
pathMatch: 'full',
},
],
},
],
},
];