@isaiahiroko/tilmart-ngx-apps-admin 0.2.0

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.
Files changed (75) hide show
  1. package/README.md +9 -0
  2. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-articles.module-OeLRnPwN.mjs +154 -0
  3. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-articles.module-OeLRnPwN.mjs.map +1 -0
  4. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-audit.module-C9gvw8X2.mjs +84 -0
  5. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-audit.module-C9gvw8X2.mjs.map +1 -0
  6. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-baskets.module-_lHPl1dT.mjs +294 -0
  7. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-baskets.module-_lHPl1dT.mjs.map +1 -0
  8. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-Bvx2tVOi.mjs +224 -0
  9. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-Bvx2tVOi.mjs.map +1 -0
  10. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Ccsd8Yx3.mjs +106 -0
  11. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Ccsd8Yx3.mjs.map +1 -0
  12. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-compatibility-rules.module-xN-JUWwp.mjs +261 -0
  13. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-compatibility-rules.module-xN-JUWwp.mjs.map +1 -0
  14. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-content.module-DLdKAUqc.mjs +365 -0
  15. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-content.module-DLdKAUqc.mjs.map +1 -0
  16. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-CQNCSlsd.mjs +106 -0
  17. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-CQNCSlsd.mjs.map +1 -0
  18. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-customers.module-12XdV9zo.mjs +106 -0
  19. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-customers.module-12XdV9zo.mjs.map +1 -0
  20. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-data-quality.module-Bfgh3zE5.mjs +286 -0
  21. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-data-quality.module-Bfgh3zE5.mjs.map +1 -0
  22. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-data-requests.module-C6tPNlup.mjs +104 -0
  23. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-data-requests.module-C6tPNlup.mjs.map +1 -0
  24. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-disputes.module-DmUoAS0Z.mjs +73 -0
  25. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-disputes.module-DmUoAS0Z.mjs.map +1 -0
  26. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BZ3UmxE3.mjs +404 -0
  27. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BZ3UmxE3.mjs.map +1 -0
  28. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-inbox.module-BZDTa1L-.mjs +290 -0
  29. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-inbox.module-BZDTa1L-.mjs.map +1 -0
  30. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-macros.module-BO4bdER2.mjs +112 -0
  31. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-macros.module-BO4bdER2.mjs.map +1 -0
  32. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-moderation.module-CZOCrias.mjs +116 -0
  33. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-moderation.module-CZOCrias.mjs.map +1 -0
  34. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-navigation.module-DoKzzRgn.mjs +281 -0
  35. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-navigation.module-DoKzzRgn.mjs.map +1 -0
  36. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-order-board.module-DIOjhptn.mjs +115 -0
  37. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-order-board.module-DIOjhptn.mjs.map +1 -0
  38. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-Ddw49QW0.mjs +185 -0
  39. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-Ddw49QW0.mjs.map +1 -0
  40. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-BhqAtTZs.mjs +106 -0
  41. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-BhqAtTZs.mjs.map +1 -0
  42. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payouts.module-CoiscPIZ.mjs +70 -0
  43. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payouts.module-CoiscPIZ.mjs.map +1 -0
  44. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-procurement.module-qXW-g0pf.mjs +274 -0
  45. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-procurement.module-qXW-g0pf.mjs.map +1 -0
  46. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-DG9uTDqX.mjs +106 -0
  47. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-DG9uTDqX.mjs.map +1 -0
  48. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-queues.module-K-zYYVFy.mjs +84 -0
  49. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-queues.module-K-zYYVFy.mjs.map +1 -0
  50. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-Hm2dO_bC.mjs +106 -0
  51. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-Hm2dO_bC.mjs.map +1 -0
  52. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-QLNhuh7q.mjs +106 -0
  53. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-QLNhuh7q.mjs.map +1 -0
  54. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DBZov0We.mjs +104 -0
  55. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DBZov0We.mjs.map +1 -0
  56. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-Bd2gdo6_.mjs +106 -0
  57. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-Bd2gdo6_.mjs.map +1 -0
  58. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-rich-editor.module-DW9Gy_QQ.mjs +81 -0
  59. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-rich-editor.module-DW9Gy_QQ.mjs.map +1 -0
  60. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BkVY06ci.mjs +105 -0
  61. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BkVY06ci.mjs.map +1 -0
  62. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-DKeZTldO.mjs +222 -0
  63. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-DKeZTldO.mjs.map +1 -0
  64. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-XuaOKr8v.mjs +150 -0
  65. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-XuaOKr8v.mjs.map +1 -0
  66. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-DYiAkF7E.mjs +107 -0
  67. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-DYiAkF7E.mjs.map +1 -0
  68. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-trace.module-Pwr-82Rc.mjs +92 -0
  69. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-trace.module-Pwr-82Rc.mjs.map +1 -0
  70. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-users.module-Bx_7fI2g.mjs +111 -0
  71. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-users.module-Bx_7fI2g.mjs.map +1 -0
  72. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs +475 -0
  73. package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs.map +1 -0
  74. package/package.json +34 -0
  75. package/types/isaiahiroko-tilmart-ngx-apps-admin.d.ts +32 -0
@@ -0,0 +1,185 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, TemplateRef, ViewChild, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/router';
4
+ import { ActivatedRoute, RouterModule } from '@angular/router';
5
+ import { BaseDirective, using, notify, titleCase, SharedModule } from '@thescaffold/ngx-core';
6
+ import * as i1$1 from '@thescaffold/ngx-ui';
7
+ import { FlyoutService, ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
8
+ import { BehaviorSubject, takeUntil, map } from 'rxjs';
9
+ import * as i2 from '@angular/common';
10
+
11
+ function naira(amount, currency = 'NGN') {
12
+ return `${currency} ${Math.round(amount).toLocaleString('en-US')}`;
13
+ }
14
+ // Ops action buttons per current status — each entry is a permitted
15
+ // `OrderWorkflow.transition` target. Matches the PRD Appendix B matrix;
16
+ // fulfilment-driven statuses (dispatched, delivered, …) are set by the
17
+ // Shipments page, not here.
18
+ const ACTIONS = {
19
+ payment_received: [{ to: 'confirmed', label: 'Confirm' }, { to: 'on_hold', label: 'Hold' }],
20
+ on_hold: [{ to: 'confirmed', label: 'Release' }, { to: 'cancelled', label: 'Cancel' }],
21
+ confirmed: [{ to: 'processing', label: 'Start preparing' }, { to: 'cancelled', label: 'Cancel' }],
22
+ processing: [{ to: 'cancelled', label: 'Cancel' }],
23
+ pending_payment: [{ to: 'cancelled', label: 'Cancel' }],
24
+ };
25
+ class OrdersComponent extends BaseDirective {
26
+ constructor() {
27
+ super(...arguments);
28
+ this.flyoutService = inject(FlyoutService);
29
+ this.route = inject(ActivatedRoute);
30
+ this.orderSource = this.apiService.on('apps/commerce/order');
31
+ this.lineSource = this.apiService.on('apps/commerce/order-line');
32
+ this.historySource = this.apiService.on('apps/commerce/order-status-history');
33
+ this.paymentSource = this.apiService.on('apps/commerce/payment');
34
+ this.shipmentSource = this.apiService.on('apps/commerce/shipment');
35
+ this.columns = [
36
+ { key: 'orderNumber', value: 'Order' },
37
+ { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },
38
+ { key: 'grandTotalLabel', value: 'Total' },
39
+ { key: 'paidLabel', value: 'Paid' },
40
+ { key: 'placedAt', value: 'Placed', type: 'date' },
41
+ ];
42
+ this.page = 1;
43
+ this.perPage = 25;
44
+ this.query = '';
45
+ this.list$ = new BehaviorSubject(null);
46
+ this.detail = null;
47
+ this.detailActions = [];
48
+ this.naira = naira;
49
+ this.init = () => {
50
+ this.query = this.route.snapshot.queryParamMap.get('q') ?? '';
51
+ this.list();
52
+ };
53
+ }
54
+ list(page = this.page, perPage = this.perPage) {
55
+ const params = { page, perPage };
56
+ if (this.query)
57
+ params.query = this.query;
58
+ this.orderSource
59
+ .getMany(params)
60
+ .pipe(takeUntil(this.$), map((response) => this.toCollection(response)))
61
+ .subscribe(using((data) => this.list$.next(data)));
62
+ }
63
+ view(item) {
64
+ this.detail = null;
65
+ this.detailActions = ACTIONS[item.status] ?? [];
66
+ this.flyoutService.open(this.detailFlyout);
67
+ this.lineSource
68
+ .getMany({ orderId: item.id, page: 1, perPage: 200 })
69
+ .pipe(takeUntil(this.$))
70
+ .subscribe(using(({ data: lines }) => {
71
+ this.detail = {
72
+ id: item.id,
73
+ orderNumber: item.orderNumber,
74
+ status: item.status,
75
+ currency: item.currency,
76
+ businessName: item.businessName,
77
+ recipientName: item.recipientName,
78
+ recipientPhone: item.recipientPhone,
79
+ subtotal: Number(item.subtotal ?? 0),
80
+ deliveryTotal: Number(item.deliveryTotal ?? 0),
81
+ taxTotal: Number(item.taxTotal ?? 0),
82
+ grandTotal: Number(item.grandTotal ?? 0),
83
+ amountPaid: Number(item.amountPaid ?? 0),
84
+ codAmountDue: Number(item.codAmountDue ?? 0),
85
+ lines: lines ?? [],
86
+ history: [],
87
+ payments: [],
88
+ shipments: [],
89
+ };
90
+ this.historySource
91
+ .getMany({ orderId: item.id, page: 1, perPage: 100 })
92
+ .pipe(takeUntil(this.$))
93
+ .subscribe(using(({ data }) => {
94
+ if (this.detail)
95
+ this.detail.history = data ?? [];
96
+ }));
97
+ this.paymentSource
98
+ .getMany({ orderId: item.id, page: 1, perPage: 20 })
99
+ .pipe(takeUntil(this.$))
100
+ .subscribe(using(({ data }) => {
101
+ if (this.detail)
102
+ this.detail.payments = data ?? [];
103
+ }));
104
+ this.shipmentSource
105
+ .getMany({ orderId: item.id, page: 1, perPage: 50 })
106
+ .pipe(takeUntil(this.$))
107
+ .subscribe(using(({ data }) => {
108
+ if (this.detail)
109
+ this.detail.shipments = data ?? [];
110
+ }));
111
+ }));
112
+ }
113
+ transition(to) {
114
+ if (!this.detail)
115
+ return;
116
+ this.apiService
117
+ .post(`apps/commerce/order/${this.detail.id}/transition`, { toStatus: to })
118
+ .pipe(takeUntil(this.$))
119
+ .subscribe(using((res) => {
120
+ if (res?.status === 'error') {
121
+ notify(res.message || 'That transition is not allowed.', undefined, 'error');
122
+ return;
123
+ }
124
+ notify(`Order moved to ${to.replace(/_/g, ' ')}.`, undefined, 'success');
125
+ this.flyoutService.dismiss();
126
+ this.list();
127
+ }));
128
+ }
129
+ toCollection(response) {
130
+ const rows = (response?.data ?? []).map((order) => ({
131
+ ...order,
132
+ grandTotalLabel: naira(Number(order.grandTotal ?? 0), order.currency),
133
+ paidLabel: naira(Number(order.amountPaid ?? 0), order.currency),
134
+ }));
135
+ return {
136
+ title: titleCase('orders'),
137
+ columns: this.columns,
138
+ rows,
139
+ hasHeaders: true,
140
+ hasTextFilter: true,
141
+ page: response?.meta?.current_page,
142
+ perPage: response?.meta?.per_page,
143
+ total: response?.meta?.total,
144
+ onPage: (page) => this.list(page),
145
+ links: {
146
+ secondary: [{ title: 'View', fn: (_link, item) => this.view(item) }],
147
+ },
148
+ };
149
+ }
150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
151
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: OrdersComponent, isStandalone: false, selector: "x-orders", viewQueries: [{ propertyName: "detailFlyout", first: true, predicate: ["detailFlyout"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Orders</div>\n <div class=\"x-page-subtitle\">Every order \u2014 search, drill in, move it forward.</div>\n</div>\n\n@if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n} @else {\n <x-element-loader></x-element-loader>\n}\n\n<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Order detail' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <div class=\"fw-bold font-monospace\">\n {{ detail.orderNumber }}\n <a\n class=\"small ms-2\"\n [routerLink]=\"['/admin/trace']\"\n [queryParams]=\"{ ref: detail.orderNumber }\"\n >full trace \u2192</a>\n </div>\n <span class=\"badge text-bg-light border mt-1\">{{ detail.status }}</span>\n @if (detail.businessName) {\n <div class=\"text-secondary small mt-1\">Invoice to: {{ detail.businessName }}</div>\n }\n @if (detail.recipientName) {\n <div class=\"text-secondary small\">Recipient: {{ detail.recipientName }} \u00B7 {{ detail.recipientPhone }}</div>\n }\n </div>\n\n @if (detailActions.length) {\n <div class=\"d-flex flex-wrap gap-2\">\n @for (action of detailActions; track action.to) {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"transition(action.to)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <table class=\"table table-sm\">\n <thead><tr><th>Item</th><th>Qty</th><th class=\"text-end\">Amount</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td>{{ line.nameSnapshot || line.variantId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"text-end\">{{ naira(line.unitPrice * line.quantity, detail.currency) }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div class=\"small\">\n <div class=\"d-flex justify-content-between\"><span>Subtotal</span><span>{{ naira(detail.subtotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Delivery</span><span>{{ naira(detail.deliveryTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>VAT (incl.)</span><span>{{ naira(detail.taxTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between fw-bold\"><span>Total</span><span>{{ naira(detail.grandTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Paid</span><span>{{ naira(detail.amountPaid, detail.currency) }}</span></div>\n @if (detail.codAmountDue > 0) {\n <div class=\"d-flex justify-content-between text-warning\"><span>Due on delivery</span><span>{{ naira(detail.codAmountDue, detail.currency) }}</span></div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div>\n <div class=\"fw-bold small mb-1\">Payments</div>\n @for (payment of detail.payments; track payment.id) {\n <div class=\"small text-secondary\">\n {{ payment.provider }} \u00B7 {{ payment.method || 'card' }} \u00B7 {{ payment.status }}\n \u00B7 {{ naira(payment.amount, payment.currency) }}\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">Shipments</div>\n @for (shipment of detail.shipments; track shipment.id) {\n <div class=\"small text-secondary\">\n {{ shipment.status }}@if (shipment.trackingRef) { \u00B7 {{ shipment.trackingRef }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None yet \u2014 create one on the Shipments page.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">History</div>\n @for (row of detail.history; track row.id) {\n <div class=\"small text-secondary\">\n {{ row.toStatus }} \u00B7 {{ row.createdAt | date: 'MMM d, h:mm a' }}\n @if (row.reason) { \u2014 {{ row.reason }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">No transitions recorded.</div>\n }\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}\n"], dependencies: [{ kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1$1.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i1$1.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "component", type: i1$1.FlyoutComponent, selector: "x-webget-flyout", inputs: ["data"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.DatePipe, name: "date" }] }); }
152
+ }
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersComponent, decorators: [{
154
+ type: Component,
155
+ args: [{ standalone: false, selector: 'x-orders', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Orders</div>\n <div class=\"x-page-subtitle\">Every order \u2014 search, drill in, move it forward.</div>\n</div>\n\n@if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n} @else {\n <x-element-loader></x-element-loader>\n}\n\n<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Order detail' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <div class=\"fw-bold font-monospace\">\n {{ detail.orderNumber }}\n <a\n class=\"small ms-2\"\n [routerLink]=\"['/admin/trace']\"\n [queryParams]=\"{ ref: detail.orderNumber }\"\n >full trace \u2192</a>\n </div>\n <span class=\"badge text-bg-light border mt-1\">{{ detail.status }}</span>\n @if (detail.businessName) {\n <div class=\"text-secondary small mt-1\">Invoice to: {{ detail.businessName }}</div>\n }\n @if (detail.recipientName) {\n <div class=\"text-secondary small\">Recipient: {{ detail.recipientName }} \u00B7 {{ detail.recipientPhone }}</div>\n }\n </div>\n\n @if (detailActions.length) {\n <div class=\"d-flex flex-wrap gap-2\">\n @for (action of detailActions; track action.to) {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"transition(action.to)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <table class=\"table table-sm\">\n <thead><tr><th>Item</th><th>Qty</th><th class=\"text-end\">Amount</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td>{{ line.nameSnapshot || line.variantId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"text-end\">{{ naira(line.unitPrice * line.quantity, detail.currency) }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div class=\"small\">\n <div class=\"d-flex justify-content-between\"><span>Subtotal</span><span>{{ naira(detail.subtotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Delivery</span><span>{{ naira(detail.deliveryTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>VAT (incl.)</span><span>{{ naira(detail.taxTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between fw-bold\"><span>Total</span><span>{{ naira(detail.grandTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Paid</span><span>{{ naira(detail.amountPaid, detail.currency) }}</span></div>\n @if (detail.codAmountDue > 0) {\n <div class=\"d-flex justify-content-between text-warning\"><span>Due on delivery</span><span>{{ naira(detail.codAmountDue, detail.currency) }}</span></div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div>\n <div class=\"fw-bold small mb-1\">Payments</div>\n @for (payment of detail.payments; track payment.id) {\n <div class=\"small text-secondary\">\n {{ payment.provider }} \u00B7 {{ payment.method || 'card' }} \u00B7 {{ payment.status }}\n \u00B7 {{ naira(payment.amount, payment.currency) }}\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">Shipments</div>\n @for (shipment of detail.shipments; track shipment.id) {\n <div class=\"small text-secondary\">\n {{ shipment.status }}@if (shipment.trackingRef) { \u00B7 {{ shipment.trackingRef }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None yet \u2014 create one on the Shipments page.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">History</div>\n @for (row of detail.history; track row.id) {\n <div class=\"small text-secondary\">\n {{ row.toStatus }} \u00B7 {{ row.createdAt | date: 'MMM d, h:mm a' }}\n @if (row.reason) { \u2014 {{ row.reason }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">No transitions recorded.</div>\n }\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\n", styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}\n"] }]
156
+ }], propDecorators: { detailFlyout: [{
157
+ type: ViewChild,
158
+ args: ['detailFlyout', { read: TemplateRef, static: true }]
159
+ }] } });
160
+
161
+ class OrdersModule {
162
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
163
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, declarations: [OrdersComponent], imports: [SharedModule,
164
+ ElementsModule,
165
+ WebgetsModule, i1.RouterModule] }); }
166
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, imports: [SharedModule,
167
+ ElementsModule,
168
+ WebgetsModule,
169
+ RouterModule.forChild([{ path: '', component: OrdersComponent }])] }); }
170
+ }
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, decorators: [{
172
+ type: NgModule,
173
+ args: [{
174
+ declarations: [OrdersComponent],
175
+ imports: [
176
+ SharedModule,
177
+ ElementsModule,
178
+ WebgetsModule,
179
+ RouterModule.forChild([{ path: '', component: OrdersComponent }]),
180
+ ],
181
+ }]
182
+ }] });
183
+
184
+ export { OrdersModule };
185
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-orders.module-Ddw49QW0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-orders.module-Ddw49QW0.mjs","sources":["../../../projects/admin/src/lib/pages/orders/orders.component.ts","../../../projects/admin/src/lib/pages/orders/orders.component.html","../../../projects/admin/src/lib/pages/orders/orders.module.ts"],"sourcesContent":["import { Component, TemplateRef, ViewChild, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { BaseDirective, notify, titleCase, using } from '@thescaffold/ngx-core';\nimport { FlyoutService } from '@thescaffold/ngx-ui';\nimport { BehaviorSubject, map, takeUntil } from 'rxjs';\n\nfunction naira(amount: number, currency = 'NGN'): string {\n return `${currency} ${Math.round(amount).toLocaleString('en-US')}`;\n}\n\n// Ops action buttons per current status — each entry is a permitted\n// `OrderWorkflow.transition` target. Matches the PRD Appendix B matrix;\n// fulfilment-driven statuses (dispatched, delivered, …) are set by the\n// Shipments page, not here.\nconst ACTIONS: Record<string, { to: string; label: string }[]> = {\n payment_received: [{ to: 'confirmed', label: 'Confirm' }, { to: 'on_hold', label: 'Hold' }],\n on_hold: [{ to: 'confirmed', label: 'Release' }, { to: 'cancelled', label: 'Cancel' }],\n confirmed: [{ to: 'processing', label: 'Start preparing' }, { to: 'cancelled', label: 'Cancel' }],\n processing: [{ to: 'cancelled', label: 'Cancel' }],\n pending_payment: [{ to: 'cancelled', label: 'Cancel' }],\n};\n\n@Component({\n standalone: false,\n selector: 'x-orders',\n templateUrl: './orders.component.html',\n styleUrl: './orders.component.scss',\n})\nexport class OrdersComponent extends BaseDirective {\n private readonly flyoutService = inject(FlyoutService);\n private readonly route = inject(ActivatedRoute);\n\n private readonly orderSource = this.apiService.on('apps/commerce/order');\n private readonly lineSource = this.apiService.on('apps/commerce/order-line');\n private readonly historySource = this.apiService.on('apps/commerce/order-status-history');\n private readonly paymentSource = this.apiService.on('apps/commerce/payment');\n private readonly shipmentSource = this.apiService.on('apps/commerce/shipment');\n\n columns = [\n { key: 'orderNumber', value: 'Order' },\n { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'grandTotalLabel', value: 'Total' },\n { key: 'paidLabel', value: 'Paid' },\n { key: 'placedAt', value: 'Placed', type: 'date' },\n ];\n\n page = 1;\n perPage = 25;\n query = '';\n\n list$ = new BehaviorSubject<any>(null);\n detail: any = null;\n detailActions: { to: string; label: string }[] = [];\n naira = naira;\n\n @ViewChild('detailFlyout', { read: TemplateRef, static: true })\n detailFlyout!: TemplateRef<any>;\n\n override init = () => {\n this.query = this.route.snapshot.queryParamMap.get('q') ?? '';\n this.list();\n };\n\n list(page = this.page, perPage = this.perPage) {\n const params: any = { page, perPage };\n if (this.query) params.query = this.query;\n this.orderSource\n .getMany(params)\n .pipe(\n takeUntil(this.$),\n map((response) => this.toCollection(response)),\n )\n .subscribe(using((data) => this.list$.next(data)));\n }\n\n view(item: any) {\n this.detail = null;\n this.detailActions = ACTIONS[item.status] ?? [];\n this.flyoutService.open(this.detailFlyout);\n\n this.lineSource\n .getMany({ orderId: item.id, page: 1, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using(({ data: lines }: { data: any[] }) => {\n this.detail = {\n id: item.id,\n orderNumber: item.orderNumber,\n status: item.status,\n currency: item.currency,\n businessName: item.businessName,\n recipientName: item.recipientName,\n recipientPhone: item.recipientPhone,\n subtotal: Number(item.subtotal ?? 0),\n deliveryTotal: Number(item.deliveryTotal ?? 0),\n taxTotal: Number(item.taxTotal ?? 0),\n grandTotal: Number(item.grandTotal ?? 0),\n amountPaid: Number(item.amountPaid ?? 0),\n codAmountDue: Number(item.codAmountDue ?? 0),\n lines: lines ?? [],\n history: [],\n payments: [],\n shipments: [],\n };\n\n this.historySource\n .getMany({ orderId: item.id, page: 1, perPage: 100 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(using(({ data }: { data: any[] }) => {\n if (this.detail) this.detail.history = data ?? [];\n }));\n this.paymentSource\n .getMany({ orderId: item.id, page: 1, perPage: 20 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(using(({ data }: { data: any[] }) => {\n if (this.detail) this.detail.payments = data ?? [];\n }));\n this.shipmentSource\n .getMany({ orderId: item.id, page: 1, perPage: 50 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(using(({ data }: { data: any[] }) => {\n if (this.detail) this.detail.shipments = data ?? [];\n }));\n }),\n );\n }\n\n transition(to: string) {\n if (!this.detail) return;\n this.apiService\n .post(`apps/commerce/order/${this.detail.id}/transition`, { toStatus: to })\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n if (res?.status === 'error') {\n notify(res.message || 'That transition is not allowed.', undefined, 'error');\n return;\n }\n notify(`Order moved to ${to.replace(/_/g, ' ')}.`, undefined, 'success');\n this.flyoutService.dismiss();\n this.list();\n }),\n );\n }\n\n private toCollection(response: any) {\n const rows = (response?.data ?? []).map((order: any) => ({\n ...order,\n grandTotalLabel: naira(Number(order.grandTotal ?? 0), order.currency),\n paidLabel: naira(Number(order.amountPaid ?? 0), order.currency),\n }));\n\n return {\n title: titleCase('orders'),\n columns: this.columns,\n rows,\n hasHeaders: true,\n hasTextFilter: true,\n page: response?.meta?.current_page,\n perPage: response?.meta?.per_page,\n total: response?.meta?.total,\n onPage: (page: number) => this.list(page),\n links: {\n secondary: [{ title: 'View', fn: (_link: any, item: any) => this.view(item) }],\n },\n };\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Orders</div>\n <div class=\"x-page-subtitle\">Every order — search, drill in, move it forward.</div>\n</div>\n\n@if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n} @else {\n <x-element-loader></x-element-loader>\n}\n\n<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Order detail' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <div class=\"fw-bold font-monospace\">\n {{ detail.orderNumber }}\n <a\n class=\"small ms-2\"\n [routerLink]=\"['/admin/trace']\"\n [queryParams]=\"{ ref: detail.orderNumber }\"\n >full trace →</a>\n </div>\n <span class=\"badge text-bg-light border mt-1\">{{ detail.status }}</span>\n @if (detail.businessName) {\n <div class=\"text-secondary small mt-1\">Invoice to: {{ detail.businessName }}</div>\n }\n @if (detail.recipientName) {\n <div class=\"text-secondary small\">Recipient: {{ detail.recipientName }} · {{ detail.recipientPhone }}</div>\n }\n </div>\n\n @if (detailActions.length) {\n <div class=\"d-flex flex-wrap gap-2\">\n @for (action of detailActions; track action.to) {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"transition(action.to)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <table class=\"table table-sm\">\n <thead><tr><th>Item</th><th>Qty</th><th class=\"text-end\">Amount</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td>{{ line.nameSnapshot || line.variantId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"text-end\">{{ naira(line.unitPrice * line.quantity, detail.currency) }}</td>\n </tr>\n } @empty {\n <tr><td colspan=\"3\" class=\"text-secondary\">No lines.</td></tr>\n }\n </tbody>\n </table>\n\n <div class=\"small\">\n <div class=\"d-flex justify-content-between\"><span>Subtotal</span><span>{{ naira(detail.subtotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Delivery</span><span>{{ naira(detail.deliveryTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>VAT (incl.)</span><span>{{ naira(detail.taxTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between fw-bold\"><span>Total</span><span>{{ naira(detail.grandTotal, detail.currency) }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Paid</span><span>{{ naira(detail.amountPaid, detail.currency) }}</span></div>\n @if (detail.codAmountDue > 0) {\n <div class=\"d-flex justify-content-between text-warning\"><span>Due on delivery</span><span>{{ naira(detail.codAmountDue, detail.currency) }}</span></div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div>\n <div class=\"fw-bold small mb-1\">Payments</div>\n @for (payment of detail.payments; track payment.id) {\n <div class=\"small text-secondary\">\n {{ payment.provider }} · {{ payment.method || 'card' }} · {{ payment.status }}\n · {{ naira(payment.amount, payment.currency) }}\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">Shipments</div>\n @for (shipment of detail.shipments; track shipment.id) {\n <div class=\"small text-secondary\">\n {{ shipment.status }}@if (shipment.trackingRef) { · {{ shipment.trackingRef }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None yet — create one on the Shipments page.</div>\n }\n </div>\n\n <div>\n <div class=\"fw-bold small mb-1\">History</div>\n @for (row of detail.history; track row.id) {\n <div class=\"small text-secondary\">\n {{ row.toStatus }} · {{ row.createdAt | date: 'MMM d, h:mm a' }}\n @if (row.reason) { — {{ row.reason }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">No transitions recorded.</div>\n }\n </div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n </div>\n </x-webget-flyout>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { OrdersComponent } from './orders.component';\n\n@NgModule({\n declarations: [OrdersComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: OrdersComponent }]),\n ],\n})\nexport class OrdersModule {}\n"],"names":["i2","i3"],"mappings":";;;;;;;;;;AAMA,SAAS,KAAK,CAAC,MAAc,EAAE,QAAQ,GAAG,KAAK,EAAA;AAC7C,IAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,CAAA,EAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;AACpE;AAEA;AACA;AACA;AACA;AACA,MAAM,OAAO,GAAoD;IAC/D,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC3F,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IACtF,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IACjG,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClD,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,CAA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AAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGxD,YAAY,EAAA,UAAA,EAAA,CAAA;kBATxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,eAAe,CAAC;AAC/B,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;AAClE,qBAAA;AACF,iBAAA;;;;;"}
@@ -0,0 +1,106 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import { BaseDirective, using, titleCase, SharedModule } from '@thescaffold/ngx-core';
6
+ import * as i1 from '@thescaffold/ngx-ui';
7
+ import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
8
+ import { BehaviorSubject, takeUntil, map } from 'rxjs';
9
+ import * as i2 from '@angular/common';
10
+
11
+ // Payment reconciliation (docs/TRD.md §7) — backed by grocery's own Payment
12
+ // entity, not ntx-apps-capital.
13
+ class PaymentsComponent extends BaseDirective {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.name = 'payment';
17
+ this.pluralName = 'payments';
18
+ this.dataSource = this.apiService.on('apps/commerce/payment');
19
+ this.columns = [
20
+ { key: 'provider', value: 'Provider', type: 'class', class: 'badge text-bg-light border' },
21
+ { key: 'amount', value: 'Amount' },
22
+ { key: 'currency', value: 'Currency' },
23
+ { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },
24
+ { key: 'paidAt', value: 'Paid at', type: 'date' },
25
+ ];
26
+ this.page = 1;
27
+ this.perPage = 25;
28
+ this.list$ = new BehaviorSubject(null);
29
+ this.init = () => {
30
+ this.list();
31
+ };
32
+ }
33
+ list(page = this.page, perPage = this.perPage) {
34
+ this.dataSource
35
+ .getMany({ page, perPage })
36
+ .pipe(takeUntil(this.$), map((response) => this.toCollection(response)))
37
+ .subscribe(using((data) => this.list$.next(data)));
38
+ }
39
+ toCollection(response) {
40
+ return {
41
+ title: titleCase(this.pluralName),
42
+ columns: this.columns,
43
+ rows: response?.data,
44
+ hasHeaders: true,
45
+ hasTextFilter: true,
46
+ page: response?.meta?.current_page,
47
+ perPage: response?.meta?.per_page,
48
+ total: response?.meta?.total,
49
+ onPage: (page) => this.list(page),
50
+ };
51
+ }
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PaymentsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
53
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: PaymentsComponent, isStandalone: false, selector: "x-payments", usesInheritance: true, ngImport: i0, template: `
54
+ <div class="x-page-head">
55
+ <div class="x-page-title">Payments</div>
56
+ <div class="x-page-subtitle">Every cycle payment, across providers.</div>
57
+ </div>
58
+
59
+ @if (list$ | async; as list) {
60
+ <x-webget-collection [data]="list"></x-webget-collection>
61
+ } @else {
62
+ <x-element-loader></x-element-loader>
63
+ }
64
+ `, isInline: true, styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}\n"], dependencies: [{ kind: "component", type: i1.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i1.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] }); }
65
+ }
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PaymentsComponent, decorators: [{
67
+ type: Component,
68
+ args: [{ standalone: false, selector: 'x-payments', template: `
69
+ <div class="x-page-head">
70
+ <div class="x-page-title">Payments</div>
71
+ <div class="x-page-subtitle">Every cycle payment, across providers.</div>
72
+ </div>
73
+
74
+ @if (list$ | async; as list) {
75
+ <x-webget-collection [data]="list"></x-webget-collection>
76
+ } @else {
77
+ <x-element-loader></x-element-loader>
78
+ }
79
+ `, styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}\n"] }]
80
+ }] });
81
+
82
+ class PaymentsModule {
83
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PaymentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
84
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: PaymentsModule, declarations: [PaymentsComponent], imports: [SharedModule,
85
+ ElementsModule,
86
+ WebgetsModule, i1$1.RouterModule] }); }
87
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PaymentsModule, imports: [SharedModule,
88
+ ElementsModule,
89
+ WebgetsModule,
90
+ RouterModule.forChild([{ path: '', component: PaymentsComponent }])] }); }
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PaymentsModule, decorators: [{
93
+ type: NgModule,
94
+ args: [{
95
+ declarations: [PaymentsComponent],
96
+ imports: [
97
+ SharedModule,
98
+ ElementsModule,
99
+ WebgetsModule,
100
+ RouterModule.forChild([{ path: '', component: PaymentsComponent }]),
101
+ ],
102
+ }]
103
+ }] });
104
+
105
+ export { PaymentsModule };
106
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-payments.module-BhqAtTZs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-payments.module-BhqAtTZs.mjs","sources":["../../../projects/admin/src/lib/pages/payments/payments.component.ts","../../../projects/admin/src/lib/pages/payments/payments.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective, titleCase, using } from '@thescaffold/ngx-core';\nimport { BehaviorSubject, takeUntil, map } from 'rxjs';\n\n// Payment reconciliation (docs/TRD.md §7) — backed by grocery's own Payment\n// entity, not ntx-apps-capital.\n@Component({\n standalone: false,\n selector: 'x-payments',\n template: `\n <div class=\"x-page-head\">\n <div class=\"x-page-title\">Payments</div>\n <div class=\"x-page-subtitle\">Every cycle payment, across providers.</div>\n </div>\n\n @if (list$ | async; as list) {\n <x-webget-collection [data]=\"list\"></x-webget-collection>\n } @else {\n <x-element-loader></x-element-loader>\n }\n `,\n styles: [\n `\n .x-page-head {\n margin-bottom: 20px;\n }\n .x-page-title {\n font-size: 24px;\n font-weight: 800;\n color: var(--color-text);\n }\n .x-page-subtitle {\n font-size: 13.5px;\n color: var(--color-text-muted);\n margin-top: 2px;\n }\n `,\n ],\n})\nexport class PaymentsComponent extends BaseDirective {\n name = 'payment';\n pluralName = 'payments';\n dataSource = this.apiService.on('apps/commerce/payment');\n\n columns = [\n { key: 'provider', value: 'Provider', type: 'class', class: 'badge text-bg-light border' },\n { key: 'amount', value: 'Amount' },\n { key: 'currency', value: 'Currency' },\n { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'paidAt', value: 'Paid at', type: 'date' },\n ];\n\n page = 1;\n perPage = 25;\n\n list$ = new BehaviorSubject<any>(null);\n\n override init = () => {\n this.list();\n };\n\n list(page = this.page, perPage = this.perPage) {\n this.dataSource\n .getMany({ page, perPage })\n .pipe(\n takeUntil(this.$),\n map((response) => this.toCollection(response)),\n )\n .subscribe(using((data) => this.list$.next(data)));\n }\n\n private toCollection(response: any) {\n return {\n title: titleCase(this.pluralName),\n columns: this.columns,\n rows: response?.data,\n hasHeaders: true,\n hasTextFilter: true,\n page: response?.meta?.current_page,\n perPage: response?.meta?.per_page,\n total: response?.meta?.total,\n onPage: (page: number) => this.list(page),\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';\nimport { PaymentsComponent } from './payments.component';\n\n@NgModule({\n declarations: [PaymentsComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: PaymentsComponent }]),\n ],\n})\nexport class PaymentsModule {}\n"],"names":["i1"],"mappings":";;;;;;;;;;AAIA;AACA;AAkCM,MAAO,iBAAkB,SAAQ,aAAa,CAAA;AAjCpD,IAAA,WAAA,GAAA;;QAkCE,IAAA,CAAA,IAAI,GAAG,SAAS;QAChB,IAAA,CAAA,UAAU,GAAG,UAAU;QACvB,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,uBAAuB,CAAC;AAExD,QAAA,IAAA,CAAA,OAAO,GAAG;AACR,YAAA,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,4BAA4B,EAAE;AAC1F,YAAA,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;AAClC,YAAA,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;AACtC,YAAA,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,4BAA4B,EAAE;YACtF,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;SAClD;QAED,IAAA,CAAA,IAAI,GAAG,CAAC;QACR,IAAA,CAAA,OAAO,GAAG,EAAE;AAEZ,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,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AAIJ,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YANvB,YAAY;YACZ,cAAc;YACd,aAAa;AACb,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG1D,cAAc,EAAA,UAAA,EAAA,CAAA;kBAT1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACpE,qBAAA;AACF,iBAAA;;;;;"}
@@ -0,0 +1,70 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/router';
4
+ import { RouterModule } from '@angular/router';
5
+ import { BaseDirective, SharedModule } from '@thescaffold/ngx-core';
6
+
7
+ // P7.1 — ops console section pass (PRD 6.2). Seller and installer payouts
8
+ // are a stub for R1: the marketplace payout ledger lands with the seller
9
+ // network (P9) and installer network (P8), both R2. The section is present
10
+ // so the nav map matches PRD 6.2.
11
+ class PayoutsComponent extends BaseDirective {
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PayoutsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
13
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.16", type: PayoutsComponent, isStandalone: false, selector: "x-payouts", usesInheritance: true, ngImport: i0, template: `
14
+ <div class="x-page-head">
15
+ <div class="x-page-title">Payouts</div>
16
+ <div class="x-page-subtitle">Seller and installer settlement runs.</div>
17
+ </div>
18
+
19
+ <div class="x-stub">
20
+ <p>
21
+ Payouts are not active for R1. Tilmart sells its own inventory at
22
+ launch, so there is no third-party settlement to run yet.
23
+ </p>
24
+ <p class="x-stub-meanwhile">
25
+ The payout ledger, commission accrual and settlement runs land with
26
+ the installer network (P8) and seller network (P9).
27
+ </p>
28
+ </div>
29
+ `, isInline: true, styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-stub{max-width:560px;border:1px solid var(--color-border);border-radius:10px;padding:20px;font-size:14px;line-height:1.6;color:var(--color-text-muted)}.x-stub-meanwhile{margin-bottom:0}\n"] }); }
30
+ }
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PayoutsComponent, decorators: [{
32
+ type: Component,
33
+ args: [{ standalone: false, selector: 'x-payouts', template: `
34
+ <div class="x-page-head">
35
+ <div class="x-page-title">Payouts</div>
36
+ <div class="x-page-subtitle">Seller and installer settlement runs.</div>
37
+ </div>
38
+
39
+ <div class="x-stub">
40
+ <p>
41
+ Payouts are not active for R1. Tilmart sells its own inventory at
42
+ launch, so there is no third-party settlement to run yet.
43
+ </p>
44
+ <p class="x-stub-meanwhile">
45
+ The payout ledger, commission accrual and settlement runs land with
46
+ the installer network (P8) and seller network (P9).
47
+ </p>
48
+ </div>
49
+ `, styles: [".x-page-head{margin-bottom:20px}.x-page-title{font-size:24px;font-weight:800;color:var(--color-text)}.x-page-subtitle{font-size:13.5px;color:var(--color-text-muted);margin-top:2px}.x-stub{max-width:560px;border:1px solid var(--color-border);border-radius:10px;padding:20px;font-size:14px;line-height:1.6;color:var(--color-text-muted)}.x-stub-meanwhile{margin-bottom:0}\n"] }]
50
+ }] });
51
+
52
+ class PayoutsModule {
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PayoutsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
54
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: PayoutsModule, declarations: [PayoutsComponent], imports: [SharedModule, i1.RouterModule] }); }
55
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PayoutsModule, imports: [SharedModule,
56
+ RouterModule.forChild([{ path: '', component: PayoutsComponent }])] }); }
57
+ }
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PayoutsModule, decorators: [{
59
+ type: NgModule,
60
+ args: [{
61
+ declarations: [PayoutsComponent],
62
+ imports: [
63
+ SharedModule,
64
+ RouterModule.forChild([{ path: '', component: PayoutsComponent }]),
65
+ ],
66
+ }]
67
+ }] });
68
+
69
+ export { PayoutsModule };
70
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-payouts.module-CoiscPIZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-payouts.module-CoiscPIZ.mjs","sources":["../../../projects/admin/src/lib/pages/payouts/payouts.component.ts","../../../projects/admin/src/lib/pages/payouts/payouts.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { BaseDirective } from '@thescaffold/ngx-core';\n\n// P7.1 — ops console section pass (PRD 6.2). Seller and installer payouts\n// are a stub for R1: the marketplace payout ledger lands with the seller\n// network (P9) and installer network (P8), both R2. The section is present\n// so the nav map matches PRD 6.2.\n@Component({\n standalone: false,\n selector: 'x-payouts',\n template: `\n <div class=\"x-page-head\">\n <div class=\"x-page-title\">Payouts</div>\n <div class=\"x-page-subtitle\">Seller and installer settlement runs.</div>\n </div>\n\n <div class=\"x-stub\">\n <p>\n Payouts are not active for R1. Tilmart sells its own inventory at\n launch, so there is no third-party settlement to run yet.\n </p>\n <p class=\"x-stub-meanwhile\">\n The payout ledger, commission accrual and settlement runs land with\n the installer network (P8) and seller network (P9).\n </p>\n </div>\n `,\n styles: [\n `\n .x-page-head {\n margin-bottom: 20px;\n }\n .x-page-title {\n font-size: 24px;\n font-weight: 800;\n color: var(--color-text);\n }\n .x-page-subtitle {\n font-size: 13.5px;\n color: var(--color-text-muted);\n margin-top: 2px;\n }\n .x-stub {\n max-width: 560px;\n border: 1px solid var(--color-border);\n border-radius: 10px;\n padding: 20px;\n font-size: 14px;\n line-height: 1.6;\n color: var(--color-text-muted);\n }\n .x-stub-meanwhile {\n margin-bottom: 0;\n }\n `,\n ],\n})\nexport class PayoutsComponent extends BaseDirective {}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { PayoutsComponent } from './payouts.component';\n\n@NgModule({\n declarations: [PayoutsComponent],\n imports: [\n SharedModule,\n RouterModule.forChild([{ path: '', component: PayoutsComponent }]),\n ],\n})\nexport class PayoutsModule {}\n"],"names":[],"mappings":";;;;;;AAGA;AACA;AACA;AACA;AAmDM,MAAO,gBAAiB,SAAQ,aAAa,CAAA;+GAAtC,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,WAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EA/CjB;;;;;;;;;;;;;;;;AAgBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA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