feat: add public sale invoices module with routing and service integration
- Introduced PUBLIC_SALE_INVOICES_ROUTES for handling sale invoice routes. - Created PublicSaleInvoicesService to fetch single invoice data from the API. - Implemented PublicSaleInvoiceStore for managing invoice state. - Added PublicSaleInvoiceComponent to display invoice details. - Updated app routes to include public sale invoices. - Removed pre-invoice dialog component and its associated files. - Enhanced order submitted dialog with QR code for invoice sharing. - Updated sale invoice single view to reflect new data structure. - Refactored page data list component for improved layout and functionality.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { SharedSaleInvoiceSingleViewComponent } from '@/shared/components/invoices/sale-invoice-single-view.component';
|
||||
import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { PublicSaleInvoiceStore } from '../store/main.store';
|
||||
|
||||
@Component({
|
||||
selector: 'public-saleInvoice',
|
||||
templateUrl: './single.component.html',
|
||||
imports: [SharedSaleInvoiceSingleViewComponent],
|
||||
})
|
||||
export class PublicSaleInvoiceComponent {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly store = inject(PublicSaleInvoiceStore);
|
||||
|
||||
pageParams = computed(() => pageParamsUtils(this.route));
|
||||
invoiceId = signal<string>(this.pageParams()['invoiceId']);
|
||||
|
||||
readonly invoice = computed(() => this.store.entity());
|
||||
readonly loading = computed(() => this.store.loading());
|
||||
|
||||
ngOnInit() {
|
||||
this.store.getData(this.invoiceId());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user