@isaiahiroko/tilmart-ngx-apps-admin 0.2.9 → 0.2.12
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.
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-homepage.module-ClHkgqXm.mjs → isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs} +38 -12
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-BHgvPIY1.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-pickup-locations.module-CKCz9CBw.mjs +634 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-pickup-locations.module-CKCz9CBw.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-settings.module-CFVgAQ2f.mjs → isaiahiroko-tilmart-ngx-apps-admin-settings.module-D8HLxbUb.mjs} +25 -2
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-D8HLxbUb.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-CWXgE2E_.mjs +200 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-CWXgE2E_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs +18 -6
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs.map +1 -1
- package/package.json +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-homepage.module-ClHkgqXm.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-CFVgAQ2f.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs +0 -131
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs.map +0 -1
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, TemplateRef, ViewChild, Component, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1$1 from '@angular/router';
|
|
4
|
-
import { RouterModule } from '@angular/router';
|
|
5
|
-
import { using, notify, SharedModule } from '@thescaffold/ngx-core';
|
|
6
|
-
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
|
-
import { FlyoutService, ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
|
-
import { takeUntil } from 'rxjs';
|
|
9
|
-
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs';
|
|
10
|
-
import * as i1 from '@angular/forms';
|
|
11
|
-
import * as i3 from '@angular/common';
|
|
12
|
-
|
|
13
|
-
const EXCEPTION_REASONS = [
|
|
14
|
-
'recipient_unavailable',
|
|
15
|
-
'address_not_found',
|
|
16
|
-
'recipient_refused',
|
|
17
|
-
'damaged_in_transit',
|
|
18
|
-
'access_blocked',
|
|
19
|
-
'weather',
|
|
20
|
-
'vehicle_issue',
|
|
21
|
-
'security',
|
|
22
|
-
'other',
|
|
23
|
-
];
|
|
24
|
-
// ORD-08 / ORD-12 — the fulfilment queue. List every shipment; drill in
|
|
25
|
-
// to dispatch, mark delivered, or record a delivery exception (each
|
|
26
|
-
// calls `FulfilmentWorkflow` via the shipment controller).
|
|
27
|
-
class ShipmentsComponent extends ListPageDirective {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
this.flyoutService = inject(FlyoutService);
|
|
31
|
-
this.pluralName = 'shipments';
|
|
32
|
-
this.dataSource = this.apiService.on('apps/commerce/shipment');
|
|
33
|
-
this.lineSource = this.apiService.on('apps/commerce/shipment-line');
|
|
34
|
-
this.exceptionSource = this.apiService.on('apps/commerce/delivery-exception');
|
|
35
|
-
this.reasons = EXCEPTION_REASONS;
|
|
36
|
-
this.columns = [
|
|
37
|
-
{ key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },
|
|
38
|
-
{ key: 'orderId', value: 'Order' },
|
|
39
|
-
{ key: 'carrier', value: 'Carrier' },
|
|
40
|
-
{ key: 'trackingRef', value: 'Tracking' },
|
|
41
|
-
{ key: 'createdAt', value: 'Created', type: 'date' },
|
|
42
|
-
];
|
|
43
|
-
this.detail = null;
|
|
44
|
-
this.exceptionReason = 'recipient_unavailable';
|
|
45
|
-
this.exceptionNote = '';
|
|
46
|
-
}
|
|
47
|
-
view(item) {
|
|
48
|
-
this.detail = null;
|
|
49
|
-
this.exceptionReason = 'recipient_unavailable';
|
|
50
|
-
this.exceptionNote = '';
|
|
51
|
-
this.flyoutService.open(this.detailFlyout);
|
|
52
|
-
this.lineSource
|
|
53
|
-
.getMany({ shipmentId: item.id, page: 1, perPage: 100 })
|
|
54
|
-
.pipe(takeUntil(this.$))
|
|
55
|
-
.subscribe(using(({ data: lines }) => {
|
|
56
|
-
this.detail = { ...item, lines: lines ?? [], exceptions: [] };
|
|
57
|
-
this.exceptionSource
|
|
58
|
-
.getMany({ shipmentId: item.id, page: 1, perPage: 50 })
|
|
59
|
-
.pipe(takeUntil(this.$))
|
|
60
|
-
.subscribe(using(({ data }) => {
|
|
61
|
-
if (this.detail)
|
|
62
|
-
this.detail.exceptions = data ?? [];
|
|
63
|
-
}));
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
act(path, body, okMsg) {
|
|
67
|
-
this.apiService
|
|
68
|
-
.post(`apps/commerce/shipment/${this.detail.id}/${path}`, body)
|
|
69
|
-
.pipe(takeUntil(this.$))
|
|
70
|
-
.subscribe(using((res) => {
|
|
71
|
-
if (res?.status === 'error') {
|
|
72
|
-
notify(res.message || 'That action failed.', undefined, 'error');
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
notify(okMsg, undefined, 'success');
|
|
76
|
-
this.flyoutService.dismiss();
|
|
77
|
-
this.list();
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
dispatch() {
|
|
81
|
-
this.act('dispatch', {}, 'Shipment dispatched.');
|
|
82
|
-
}
|
|
83
|
-
deliver() {
|
|
84
|
-
this.act('deliver', {}, 'Shipment marked delivered.');
|
|
85
|
-
}
|
|
86
|
-
recordException() {
|
|
87
|
-
this.act('exception', { reasonCode: this.exceptionReason, notes: this.exceptionNote || undefined }, 'Delivery exception recorded.');
|
|
88
|
-
}
|
|
89
|
-
extraCollectionFields() {
|
|
90
|
-
return {
|
|
91
|
-
links: {
|
|
92
|
-
secondary: [{ title: 'View', fn: (_link, item) => this.view(item) }],
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
97
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ShipmentsComponent, isStandalone: false, selector: "x-shipments", 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\">Shipments</div>\n <div class=\"x-page-subtitle\">Dispatch, deliver, and record delivery exceptions (ORD-08).</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: 'Shipment' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <span class=\"badge text-bg-light border\">{{ detail.status }}</span>\n @if (detail.trackingRef) {\n <div class=\"small text-secondary mt-1\">{{ detail.carrier }} \u00B7 {{ detail.trackingRef }}</div>\n }\n @if (detail.dispatchedAt) {\n <div class=\"small text-secondary\">Dispatched {{ detail.dispatchedAt | date: 'MMM d, h:mm a' }}</div>\n }\n @if (detail.deliveredAt) {\n <div class=\"small text-secondary\">Delivered {{ detail.deliveredAt | date: 'MMM d, h:mm a' }}</div>\n }\n </div>\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.status === 'preparing' || detail.status === 'ready_for_dispatch') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"dispatch()\">Dispatch</button>\n }\n @if (detail.status === 'dispatched' || detail.status === 'out_for_delivery' || detail.status === 'failed_delivery') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-success\" (click)=\"deliver()\">Mark delivered</button>\n }\n </div>\n\n <table class=\"table table-sm\">\n <thead><tr><th>Order line</th><th>Qty</th><th>Serials</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td class=\"font-monospace small\">{{ line.orderLineId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"small\">{{ line.serialNumbers?.join(', ') || '\u2014' }}</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>\n <div class=\"fw-bold small mb-1\">Delivery exceptions</div>\n @for (ex of detail.exceptions; track ex.id) {\n <div class=\"small text-secondary\">\n Attempt {{ ex.attemptNumber }} \u00B7 {{ ex.reasonCode }}\n @if (ex.notes) { \u2014 {{ ex.notes }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div class=\"d-flex flex-column gap-2\">\n <div class=\"fw-bold small\">Record an exception</div>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"exceptionReason\">\n @for (reason of reasons; track reason) {\n <option [value]=\"reason\">{{ reason }}</option>\n }\n </select>\n <input class=\"form-control form-control-sm\" placeholder=\"Note (optional)\" [(ngModel)]=\"exceptionNote\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-warning align-self-start\" (click)=\"recordException()\">\n Record exception\n </button>\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.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i2.CollectionComponent, selector: "x-webget-collection", inputs: ["data"], outputs: ["search", "filter", "refresh", "select", "page", "show"] }, { kind: "component", type: i2.FlyoutComponent, selector: "x-webget-flyout", inputs: ["data"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] }); }
|
|
98
|
-
}
|
|
99
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsComponent, decorators: [{
|
|
100
|
-
type: Component,
|
|
101
|
-
args: [{ standalone: false, selector: 'x-shipments', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">Shipments</div>\n <div class=\"x-page-subtitle\">Dispatch, deliver, and record delivery exceptions (ORD-08).</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: 'Shipment' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <span class=\"badge text-bg-light border\">{{ detail.status }}</span>\n @if (detail.trackingRef) {\n <div class=\"small text-secondary mt-1\">{{ detail.carrier }} \u00B7 {{ detail.trackingRef }}</div>\n }\n @if (detail.dispatchedAt) {\n <div class=\"small text-secondary\">Dispatched {{ detail.dispatchedAt | date: 'MMM d, h:mm a' }}</div>\n }\n @if (detail.deliveredAt) {\n <div class=\"small text-secondary\">Delivered {{ detail.deliveredAt | date: 'MMM d, h:mm a' }}</div>\n }\n </div>\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.status === 'preparing' || detail.status === 'ready_for_dispatch') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"dispatch()\">Dispatch</button>\n }\n @if (detail.status === 'dispatched' || detail.status === 'out_for_delivery' || detail.status === 'failed_delivery') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-success\" (click)=\"deliver()\">Mark delivered</button>\n }\n </div>\n\n <table class=\"table table-sm\">\n <thead><tr><th>Order line</th><th>Qty</th><th>Serials</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td class=\"font-monospace small\">{{ line.orderLineId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"small\">{{ line.serialNumbers?.join(', ') || '\u2014' }}</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>\n <div class=\"fw-bold small mb-1\">Delivery exceptions</div>\n @for (ex of detail.exceptions; track ex.id) {\n <div class=\"small text-secondary\">\n Attempt {{ ex.attemptNumber }} \u00B7 {{ ex.reasonCode }}\n @if (ex.notes) { \u2014 {{ ex.notes }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div class=\"d-flex flex-column gap-2\">\n <div class=\"fw-bold small\">Record an exception</div>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"exceptionReason\">\n @for (reason of reasons; track reason) {\n <option [value]=\"reason\">{{ reason }}</option>\n }\n </select>\n <input class=\"form-control form-control-sm\" placeholder=\"Note (optional)\" [(ngModel)]=\"exceptionNote\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-warning align-self-start\" (click)=\"recordException()\">\n Record exception\n </button>\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"] }]
|
|
102
|
-
}], propDecorators: { detailFlyout: [{
|
|
103
|
-
type: ViewChild,
|
|
104
|
-
args: ['detailFlyout', { read: TemplateRef, static: true }]
|
|
105
|
-
}] } });
|
|
106
|
-
|
|
107
|
-
class ShipmentsModule {
|
|
108
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
109
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, declarations: [ShipmentsComponent], imports: [SharedModule,
|
|
110
|
-
ElementsModule,
|
|
111
|
-
WebgetsModule, i1$1.RouterModule] }); }
|
|
112
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, imports: [SharedModule,
|
|
113
|
-
ElementsModule,
|
|
114
|
-
WebgetsModule,
|
|
115
|
-
RouterModule.forChild([{ path: '', component: ShipmentsComponent }])] }); }
|
|
116
|
-
}
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ShipmentsModule, decorators: [{
|
|
118
|
-
type: NgModule,
|
|
119
|
-
args: [{
|
|
120
|
-
declarations: [ShipmentsComponent],
|
|
121
|
-
imports: [
|
|
122
|
-
SharedModule,
|
|
123
|
-
ElementsModule,
|
|
124
|
-
WebgetsModule,
|
|
125
|
-
RouterModule.forChild([{ path: '', component: ShipmentsComponent }]),
|
|
126
|
-
],
|
|
127
|
-
}]
|
|
128
|
-
}] });
|
|
129
|
-
|
|
130
|
-
export { ShipmentsModule };
|
|
131
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-shipments.module-Cs5CLamm.mjs","sources":["../../../projects/admin/src/lib/pages/shipments/shipments.component.ts","../../../projects/admin/src/lib/pages/shipments/shipments.component.html","../../../projects/admin/src/lib/pages/shipments/shipments.module.ts"],"sourcesContent":["import { Component, TemplateRef, ViewChild, inject } from '@angular/core';\nimport { notify, using } from '@thescaffold/ngx-core';\nimport { FlyoutService } from '@thescaffold/ngx-ui';\nimport { takeUntil } from 'rxjs';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\nconst EXCEPTION_REASONS = [\n 'recipient_unavailable',\n 'address_not_found',\n 'recipient_refused',\n 'damaged_in_transit',\n 'access_blocked',\n 'weather',\n 'vehicle_issue',\n 'security',\n 'other',\n];\n\n// ORD-08 / ORD-12 — the fulfilment queue. List every shipment; drill in\n// to dispatch, mark delivered, or record a delivery exception (each\n// calls `FulfilmentWorkflow` via the shipment controller).\n@Component({\n standalone: false,\n selector: 'x-shipments',\n templateUrl: './shipments.component.html',\n styleUrl: './shipments.component.scss',\n})\nexport class ShipmentsComponent extends ListPageDirective {\n private readonly flyoutService = inject(FlyoutService);\n\n protected pluralName = 'shipments';\n protected dataSource = this.apiService.on('apps/commerce/shipment');\n private readonly lineSource = this.apiService.on('apps/commerce/shipment-line');\n private readonly exceptionSource = this.apiService.on('apps/commerce/delivery-exception');\n\n readonly reasons = EXCEPTION_REASONS;\n\n protected columns = [\n { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'orderId', value: 'Order' },\n { key: 'carrier', value: 'Carrier' },\n { key: 'trackingRef', value: 'Tracking' },\n { key: 'createdAt', value: 'Created', type: 'date' },\n ];\n\n detail: any = null;\n exceptionReason = 'recipient_unavailable';\n exceptionNote = '';\n\n @ViewChild('detailFlyout', { read: TemplateRef, static: true })\n detailFlyout!: TemplateRef<any>;\n\n view(item: any) {\n this.detail = null;\n this.exceptionReason = 'recipient_unavailable';\n this.exceptionNote = '';\n this.flyoutService.open(this.detailFlyout);\n\n this.lineSource\n .getMany({ shipmentId: item.id, page: 1, perPage: 100 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using(({ data: lines }: { data: any[] }) => {\n this.detail = { ...item, lines: lines ?? [], exceptions: [] };\n this.exceptionSource\n .getMany({ shipmentId: item.id, page: 1, perPage: 50 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(using(({ data }: { data: any[] }) => {\n if (this.detail) this.detail.exceptions = data ?? [];\n }));\n }),\n );\n }\n\n private act(path: string, body: Record<string, unknown>, okMsg: string) {\n this.apiService\n .post(`apps/commerce/shipment/${this.detail.id}/${path}`, body)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n if (res?.status === 'error') {\n notify(res.message || 'That action failed.', undefined, 'error');\n return;\n }\n notify(okMsg, undefined, 'success');\n this.flyoutService.dismiss();\n this.list();\n }),\n );\n }\n\n dispatch() {\n this.act('dispatch', {}, 'Shipment dispatched.');\n }\n\n deliver() {\n this.act('deliver', {}, 'Shipment marked delivered.');\n }\n\n recordException() {\n this.act(\n 'exception',\n { reasonCode: this.exceptionReason, notes: this.exceptionNote || undefined },\n 'Delivery exception recorded.',\n );\n }\n\n protected override extraCollectionFields() {\n return {\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\">Shipments</div>\n <div class=\"x-page-subtitle\">Dispatch, deliver, and record delivery exceptions (ORD-08).</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: 'Shipment' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div>\n <span class=\"badge text-bg-light border\">{{ detail.status }}</span>\n @if (detail.trackingRef) {\n <div class=\"small text-secondary mt-1\">{{ detail.carrier }} · {{ detail.trackingRef }}</div>\n }\n @if (detail.dispatchedAt) {\n <div class=\"small text-secondary\">Dispatched {{ detail.dispatchedAt | date: 'MMM d, h:mm a' }}</div>\n }\n @if (detail.deliveredAt) {\n <div class=\"small text-secondary\">Delivered {{ detail.deliveredAt | date: 'MMM d, h:mm a' }}</div>\n }\n </div>\n\n <div class=\"d-flex flex-wrap gap-2\">\n @if (detail.status === 'preparing' || detail.status === 'ready_for_dispatch') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" (click)=\"dispatch()\">Dispatch</button>\n }\n @if (detail.status === 'dispatched' || detail.status === 'out_for_delivery' || detail.status === 'failed_delivery') {\n <button type=\"button\" class=\"btn btn-sm btn-outline-success\" (click)=\"deliver()\">Mark delivered</button>\n }\n </div>\n\n <table class=\"table table-sm\">\n <thead><tr><th>Order line</th><th>Qty</th><th>Serials</th></tr></thead>\n <tbody>\n @for (line of detail.lines; track line.id) {\n <tr>\n <td class=\"font-monospace small\">{{ line.orderLineId }}</td>\n <td>{{ line.quantity }}</td>\n <td class=\"small\">{{ line.serialNumbers?.join(', ') || '—' }}</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>\n <div class=\"fw-bold small mb-1\">Delivery exceptions</div>\n @for (ex of detail.exceptions; track ex.id) {\n <div class=\"small text-secondary\">\n Attempt {{ ex.attemptNumber }} · {{ ex.reasonCode }}\n @if (ex.notes) { — {{ ex.notes }} }\n </div>\n } @empty {\n <div class=\"small text-secondary\">None.</div>\n }\n </div>\n\n <hr class=\"my-1\" />\n <div class=\"d-flex flex-column gap-2\">\n <div class=\"fw-bold small\">Record an exception</div>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"exceptionReason\">\n @for (reason of reasons; track reason) {\n <option [value]=\"reason\">{{ reason }}</option>\n }\n </select>\n <input class=\"form-control form-control-sm\" placeholder=\"Note (optional)\" [(ngModel)]=\"exceptionNote\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-warning align-self-start\" (click)=\"recordException()\">\n Record exception\n </button>\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 { ShipmentsComponent } from './shipments.component';\n\n@NgModule({\n declarations: [ShipmentsComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: ShipmentsComponent }]),\n ],\n})\nexport class ShipmentsModule {}\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AAMA,MAAM,iBAAiB,GAAG;IACxB,uBAAuB;IACvB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,gBAAgB;IAChB,SAAS;IACT,eAAe;IACf,UAAU;IACV,OAAO;CACR;AAED;AACA;AACA;AAOM,MAAO,kBAAmB,SAAQ,iBAAiB,CAAA;AANzD,IAAA,WAAA,GAAA;;AAOmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;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