diff --git a/apps/web/src/app/features/account/account.routes.ts b/apps/web/src/app/features/account/account.routes.ts index 77cef4c..d5331b4 100644 --- a/apps/web/src/app/features/account/account.routes.ts +++ b/apps/web/src/app/features/account/account.routes.ts @@ -38,4 +38,9 @@ export const accountRoutes: Routes = [ loadChildren: () => import('./products/products.routes').then((m) => m.productRoutes), }, + { + path: 'prices', + loadChildren: () => + import('./products/prices.routes').then((m) => m.priceRoutes), + }, ]; diff --git a/apps/web/src/app/features/account/products/components/product-form/product-form.component.html b/apps/web/src/app/features/account/products/components/product-form/product-form.component.html index 920542b..fc3e397 100644 --- a/apps/web/src/app/features/account/products/components/product-form/product-form.component.html +++ b/apps/web/src/app/features/account/products/components/product-form/product-form.component.html @@ -270,6 +270,7 @@ [queryParams]="priceQueryParams()" [paginationEnabled]="false" [hideColumnHeadings]="true" + (rowClick)="OnPriceListClick($event)" > diff --git a/apps/web/src/app/features/account/products/components/product-form/product-form.component.ts b/apps/web/src/app/features/account/products/components/product-form/product-form.component.ts index 485147c..15c08c4 100644 --- a/apps/web/src/app/features/account/products/components/product-form/product-form.component.ts +++ b/apps/web/src/app/features/account/products/components/product-form/product-form.component.ts @@ -431,4 +431,8 @@ export class ProductFormComponent implements OnInit, OnChanges { if (!productId) return; this.priceActions.OpenCreate(productId); } + + OnPriceListClick(price: Price): void { + this.priceActions.OpenEdit(price); + } } diff --git a/apps/web/src/app/features/account/products/prices.routes.ts b/apps/web/src/app/features/account/products/prices.routes.ts new file mode 100644 index 0000000..26d86e4 --- /dev/null +++ b/apps/web/src/app/features/account/products/prices.routes.ts @@ -0,0 +1,23 @@ +import { Routes } from '@angular/router'; +import { PriceActionsService } from './services/price-actions.service'; + +export const priceRoutes: Routes = [ + { + path: '', + providers: [PriceActionsService], + children: [ + { + path: '', + redirectTo: '/account/products', + pathMatch: 'full', + }, + { + path: ':priceId', + loadComponent: () => + import('./views/price-detail/price-detail.component').then( + (m) => m.PriceDetailComponent + ), + }, + ], + }, +]; diff --git a/apps/web/src/app/features/account/products/views/price-detail/price-detail.component.html b/apps/web/src/app/features/account/products/views/price-detail/price-detail.component.html new file mode 100644 index 0000000..3f17019 --- /dev/null +++ b/apps/web/src/app/features/account/products/views/price-detail/price-detail.component.html @@ -0,0 +1,219 @@ +@if(price(); as price){ @if(!price.active && archivedBannedOpen()){ +
+} + +| Type | +Flat rate | +|||||
| Currency | +{{ price.currency | uppercase }} | +|||||
| Interval | + @if(price.recurring){ @switch (price.recurring.interval) { @case ('day') { +Daily | + } @case ('week') { +Weekly | + } @case ('month') { +Monthly | + } @case ('year') { +Yearly | + } @default { +— | + } } } @else { +One-time | + } +
| Price per unit | +USDC${{ (price.unit_amount ?? 0) / 100 | number : '1.2-2' }} | +|||||
| Default price | +- | +