@isaiahiroko/tilmart-ngx-apps-admin 0.2.12 → 0.2.13
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-banners.module-sbSJXda_.mjs +92 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-sbSJXda_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-EooAWVy_.mjs +73 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-EooAWVy_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs +605 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-DrKEqPkW.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-u5VyaNWX.mjs +97 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-u5VyaNWX.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs → isaiahiroko-tilmart-ngx-apps-admin-claims.module-CLtalsnJ.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-CLtalsnJ.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-BCkLIQta.mjs +88 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-BCkLIQta.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs → isaiahiroko-tilmart-ngx-apps-admin-customers.module-BohEH2SB.mjs} +2 -2
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-customers.module-CslGiOdq.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-customers.module-BohEH2SB.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-z6apTF3A.mjs +86 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-z6apTF3A.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs → isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-Dnh9hEz_.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-Dnh9hEz_.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs +1579 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-json-builder.component-BFroIYk9.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs → isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs} +29 -5
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-ChfiBo_X.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-aIW0jRhm.mjs +239 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-aIW0jRhm.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-overview.module-C6gjcJ84.mjs +105 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-overview.module-C6gjcJ84.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs → isaiahiroko-tilmart-ngx-apps-admin-payments.module-Bej9cdwM.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-Bej9cdwM.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs +88 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-Dh7PTGG7.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs +81 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-B8gaByYE.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs → isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-7OLTrySw.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-fjoFzY6t.mjs +137 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-fjoFzY6t.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs → isaiahiroko-tilmart-ngx-apps-admin-returns.module-D0RKEzAr.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-D0RKEzAr.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BWZ9OBPH.mjs +84 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-BWZ9OBPH.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-settings.module-D8HLxbUb.mjs → isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs} +14 -7
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-DZWUhyJg.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-shipments.module-CWXgE2E_.mjs → isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs} +3 -3
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-BG9DCmG-.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-staff.module-YjJJe00X.mjs → isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs} +2 -2
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-staff.module-YjJJe00X.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-staff.module-Br80U5_k.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs +66 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-status-badge-AXfNPKaS.mjs.map +1 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs +178 -0
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BFbm7118.mjs.map +1 -0
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs → isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs} +2 -2
- package/fesm2022/{isaiahiroko-tilmart-ngx-apps-admin-users.module-C31RJJJ_.mjs.map → isaiahiroko-tilmart-ngx-apps-admin-users.module-C8nNzJ5X.mjs.map} +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs +56 -46
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin.mjs.map +1 -1
- package/package.json +1 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-ClIiV2uK.mjs +0 -76
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-banners.module-ClIiV2uK.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-CSp0tWes.mjs +0 -70
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-brands.module-CSp0tWes.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs +0 -562
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-catalog.module-BwjfFXDU.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-uKkUREjb.mjs +0 -94
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-categories.module-uKkUREjb.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-claims.module-Dk9mz7Wj.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-Dcu1nJBW.mjs +0 -85
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-coupons.module-Dcu1nJBW.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-DF7iSJaN.mjs +0 -83
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-DF7iSJaN.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs +0 -190
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs +0 -94
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-D8H6ujoy.mjs +0 -78
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-redirects.module-D8H6ujoy.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-referrals.module-BIAY4L_u.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs +0 -104
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-reports.module-DORiIVLQ.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-returns.module-C9Iu9CX6.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-fYKd3AOq.mjs +0 -81
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-routes.module-fYKd3AOq.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-settings.module-D8HLxbUb.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-shipments.module-CWXgE2E_.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs +0 -140
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs.map +0 -1
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BSAe0CfZ.mjs +0 -102
- package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-stock.module-BSAe0CfZ.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-flash-sales.module-DF7iSJaN.mjs","sources":["../../../projects/admin/src/lib/pages/flash-sales/flash-sales.component.ts","../../../projects/admin/src/lib/pages/_shared/simple-crud.component.html","../../../projects/admin/src/lib/pages/flash-sales/flash-sales.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { CrudFieldSpec, SimpleCrudDirective } from '../_shared/simple-crud.base';\n\n// R1 production-readiness pass — PROMO-04. Previously missing entirely:\n// the homepage composer's `flash_sale_rail` module references a flash\n// sale by id, but there was no page to create the sale window itself.\n// Per-SKU allocation/limits stay a follow-up — this covers the sale\n// window (name, schedule, channels), which is what a module needs to\n// resolve and what ops needs to schedule ahead of time.\n@Component({\n standalone: false,\n selector: 'x-flash-sales',\n templateUrl: '../_shared/simple-crud.component.html',\n styleUrl: '../_shared/simple-crud.component.scss',\n})\nexport class FlashSalesComponent extends SimpleCrudDirective {\n protected pageTitle = 'Flash sales';\n protected pageSubtitle = 'Time-boxed sale windows referenced by the homepage flash-sale rail.';\n protected singularLabel = 'flash sale';\n protected pluralName = 'flash sales';\n protected dataSource = this.apiService.on('apps/commerce/flash-sale');\n\n protected columns = [\n { key: 'name', value: 'Name' },\n { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'startsAt', value: 'Starts', type: 'date' },\n { key: 'endsAt', value: 'Ends', type: 'date' },\n ];\n\n protected fields: CrudFieldSpec[] = [\n { key: 'name', label: 'Name', type: 'text', required: true },\n { key: 'description', label: 'Description', type: 'textarea' },\n {\n key: 'status',\n label: 'Status',\n type: 'select',\n options: [\n { value: 'draft', label: 'Draft' },\n { value: 'scheduled', label: 'Scheduled' },\n { value: 'live', label: 'Live' },\n { value: 'ended', label: 'Ended' },\n { value: 'cancelled', label: 'Cancelled' },\n ],\n },\n { key: 'startsAt', label: 'Starts at', type: 'date' },\n { key: 'endsAt', label: 'Ends at', type: 'date' },\n ];\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">— choose —</option>\n @for (opt of (f.optionsKey ? dynamicOptions[f.optionsKey] : f.options); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n </div>\n </div>\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 { FlashSalesComponent } from './flash-sales.component';\n\n@NgModule({\n declarations: [FlashSalesComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.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UAAA,EAAA,KAAK,YACP,eAAe,EAAA,QAAA,EAAA,q3FAAA,EAAA,MAAA,EAAA,CAAA,49DAAA,CAAA,EAAA;;;MEId,gBAAgB,CAAA;+GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAhB,gBAAgB,EAAA,YAAA,EAAA,CARZ,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAEhC,YAAY;YACZ,cAAc;YACd,aAAa,EAAAA,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;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,gBAAgB,YANzB,YAAY;YACZ,cAAc;YACd,aAAa;AACb,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG5D,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAT5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACtE,qBAAA;AACF,iBAAA;;;;;"}
|
package/fesm2022/isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-installation-requests.module-TryMzSXT.mjs","sources":["../../../projects/admin/src/lib/pages/installation-requests/installation-requests.component.ts","../../../projects/admin/src/lib/pages/installation-requests/installation-requests.component.html","../../../projects/admin/src/lib/pages/installation-requests/installation-requests.module.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Component, TemplateRef, ViewChild, inject } from '@angular/core';\nimport { getEnv, notify, using } from '@thescaffold/ngx-core';\nimport { FlyoutService } from '@thescaffold/ngx-ui';\nimport { firstValueFrom, map, takeUntil } from 'rxjs';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\nconst STATUSES: { value: string; label: string }[] = [\n { value: 'new', label: 'New' },\n { value: 'contacted', label: 'Contacted' },\n { value: 'site_visit_scheduled', label: 'Site visit scheduled' },\n { value: 'quoted', label: 'Quoted' },\n { value: 'won', label: 'Won' },\n { value: 'lost', label: 'Lost' },\n { value: 'closed', label: 'Closed' },\n];\n\ninterface PhotoVm {\n blobId: string;\n src: string;\n}\n\n// \"Request an installer\" leads. The customer form submits to\n// `apps/commerce/installation-request/submit` and a copy lands in the\n// installation mailbox; this page is where ops tracks each lead — contact\n// (tel / WhatsApp), move it along the pipeline, assign + note.\n@Component({\n standalone: false,\n selector: 'x-installation-requests',\n templateUrl: './installation-requests.component.html',\n styleUrl: './installation-requests.component.scss',\n})\nexport class InstallationRequestsComponent extends ListPageDirective {\n private readonly flyoutService = inject(FlyoutService);\n private readonly http = inject(HttpClient);\n\n protected pluralName = 'installation requests';\n protected dataSource = this.apiService.on('apps/commerce/installation-request');\n\n protected columns = [\n { key: 'reference', value: 'Reference' },\n { key: 'name', value: 'Customer' },\n { key: 'phone', value: 'Phone' },\n { key: 'serviceTypeLabel', value: 'Installation' },\n { key: 'state', value: 'State' },\n { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'createdAt', value: 'Received', type: 'date' },\n ];\n\n readonly statuses = STATUSES;\n statusFilter = '';\n\n private typeLabels = new Map<string, string>();\n private propertyLabels = new Map<string, string>();\n\n detail: any = null;\n photos: PhotoVm[] = [];\n saving = false;\n editStatus = 'new';\n editAssignedTo = '';\n editNotes = '';\n\n @ViewChild('detailFlyout', { read: TemplateRef, static: true })\n detailFlyout!: TemplateRef<any>;\n\n override init = () => {\n void this.loadLabels().finally(() => this.list());\n };\n\n private async loadLabels(): Promise<void> {\n try {\n const res: any = await firstValueFrom(\n this.apiService.on('apps/commerce/static-list-item').getMany({\n page: 1,\n perPage: 200,\n listKey: 'installation-type',\n } as any),\n );\n for (const r of res?.data ?? []) this.typeLabels.set(r.code, r.label);\n const props: any = await firstValueFrom(\n this.apiService.on('apps/commerce/static-list-item').getMany({\n page: 1,\n perPage: 200,\n listKey: 'property-type',\n } as any),\n );\n for (const r of props?.data ?? []) this.propertyLabels.set(r.code, r.label);\n } catch {\n // codes render as-is\n }\n }\n\n // The base list has no filter slot; same body plus an exact-match `status`.\n override list(page = this.page, perPage = this.perPage, query = this.query): void {\n this.page = page;\n this.perPage = perPage;\n this.query = query;\n this.dataSource\n .getMany({\n page,\n perPage,\n ...(query ? { query } : {}),\n ...(this.statusFilter ? { status: this.statusFilter } : {}),\n } as any)\n .pipe(\n takeUntil(this.$),\n map((response: any) => this.toCollection(response)),\n )\n .subscribe(using((data) => this.list$.next(data)));\n }\n\n onFilterChange(): void {\n this.list(1, this.perPage);\n }\n\n protected override mapRow(row: any): any {\n return {\n ...row,\n serviceTypeLabel: this.typeLabels.get(row.serviceType) ?? row.serviceType,\n };\n }\n\n protected override extraCollectionFields() {\n return {\n links: {\n secondary: [{ title: 'Open', fn: (_link: any, item: any) => this.view(item) }],\n },\n };\n }\n\n typeLabel(code?: string): string {\n return (code && this.typeLabels.get(code)) || code || '';\n }\n\n propertyLabel(code?: string): string {\n return (code && this.propertyLabels.get(code)) || code || '';\n }\n\n statusLabel(value: string): string {\n return STATUSES.find((s) => s.value === value)?.label ?? value;\n }\n\n get telHref(): string {\n return this.detail?.phone ? `tel:${this.detail.phone}` : '';\n }\n\n // wa.me wants the international number with no `+`/leading zero.\n get whatsappHref(): string {\n const digits = String(this.detail?.phone ?? '').replace(/\\D/g, '');\n if (!digits) return '';\n const number = digits.startsWith('0') ? `234${digits.slice(1)}` : digits;\n const text = encodeURIComponent(\n `Hello ${this.detail?.name ?? ''}, this is Tilmart about your installation request ${this.detail?.reference ?? ''}.`,\n );\n return `https://wa.me/${number}?text=${text}`;\n }\n\n async view(item: any): Promise<void> {\n this.detail = null;\n this.photos = [];\n this.flyoutService.open(this.detailFlyout);\n\n const res: any = await firstValueFrom(this.dataSource.getOne(item.id));\n this.detail = res?.data ?? item;\n this.editStatus = this.detail.status;\n this.editAssignedTo = this.detail.assignedTo ?? '';\n this.editNotes = this.detail.internalNotes ?? '';\n void this.loadPhotos(this.detail);\n }\n\n // `<img src>` can't send the bearer header — fetch through HttpClient and\n // render a data URI (the app CSP allows `data:` but not `blob:`).\n private async loadPhotos(request: any): Promise<void> {\n const ids: string[] = request.photoBlobIds ?? [];\n for (const blobId of ids) {\n try {\n const blob = await firstValueFrom(\n this.http.get(\n `${getEnv('API_BASE_URL')}/apps/commerce/installation-request/${request.id}/photo/${blobId}`,\n { responseType: 'blob' },\n ),\n );\n const src = await new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n if (this.detail?.id === request.id) this.photos = [...this.photos, { blobId, src }];\n } catch {\n if (this.detail?.id === request.id) this.photos = [...this.photos, { blobId, src: '' }];\n }\n }\n }\n\n async save(): Promise<void> {\n if (!this.detail) return;\n this.saving = true;\n try {\n const res: any = await firstValueFrom(\n this.apiService.post(`apps/commerce/installation-request/${this.detail.id}/transition`, {\n status: this.editStatus,\n assignedTo: this.editAssignedTo,\n internalNotes: this.editNotes,\n }),\n );\n if (res?.status === 'error') {\n notify(res.message || 'Could not update the request.', undefined, 'error');\n return;\n }\n notify('Request updated.', undefined, 'success');\n this.detail = { ...this.detail, ...(res?.data ?? {}) };\n this.list(this.page, this.perPage);\n } catch {\n notify('Could not update the request.', undefined, 'error');\n } finally {\n this.saving = false;\n }\n }\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">Installation requests</div>\n <div class=\"x-page-subtitle\">\n “Request an installer” leads from the website and app — contact the customer, then track each one to an outcome.\n </div>\n</div>\n\n<div class=\"d-flex flex-wrap gap-2 align-items-center mb-3\">\n <label class=\"small text-secondary\" for=\"irStatus\">Status</label>\n <select\n id=\"irStatus\"\n class=\"form-select form-select-sm\"\n style=\"width: auto\"\n [(ngModel)]=\"statusFilter\"\n (ngModelChange)=\"onFilterChange()\"\n >\n <option value=\"\">All</option>\n @for (s of statuses; track s.value) {\n <option [value]=\"s.value\">{{ s.label }}</option>\n }\n </select>\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: 'Installation request' }\">\n <div class=\"p-4 d-flex flex-column gap-3\">\n @if (detail) {\n <div class=\"d-flex flex-wrap gap-2 align-items-center\">\n <strong>{{ detail.reference }}</strong>\n <span class=\"badge text-bg-light border\">{{ statusLabel(detail.status) }}</span>\n <span class=\"badge text-bg-light border\">{{ detail.source }}</span>\n <span class=\"small text-secondary ms-auto\">{{ detail.createdAt | date: 'MMM d, y, h:mm a' }}</span>\n </div>\n\n <div>\n <div class=\"fw-bold\">{{ detail.name }}</div>\n <div class=\"small\">{{ detail.phone }}@if (detail.email) { · {{ detail.email }} }</div>\n <div class=\"d-flex flex-wrap gap-2 mt-2\">\n <a class=\"btn btn-sm btn-outline-dark\" [href]=\"telHref\">Call</a>\n @if (detail.whatsappOk) {\n <a class=\"btn btn-sm btn-success\" [href]=\"whatsappHref\" target=\"_blank\" rel=\"noopener\">\n WhatsApp\n </a>\n } @else {\n <span class=\"small text-secondary align-self-center\">Customer prefers calls (not on WhatsApp)</span>\n }\n </div>\n </div>\n\n <div class=\"small\">\n <div><span class=\"text-secondary\">Installation:</span> {{ typeLabel(detail.serviceType) }}</div>\n @if (detail.propertyType) {\n <div><span class=\"text-secondary\">Property:</span> {{ propertyLabel(detail.propertyType) }}</div>\n }\n @if (detail.preferredTiming) {\n <div><span class=\"text-secondary\">Timing:</span> {{ detail.preferredTiming }}</div>\n }\n <div>\n <span class=\"text-secondary\">Location:</span>\n {{ detail.address }}, {{ detail.lga ? detail.lga + ', ' : '' }}{{ detail.state }}\n </div>\n </div>\n\n <div class=\"x-ir-desc small\">{{ detail.description }}</div>\n\n @if (detail.photoBlobIds?.length) {\n <div>\n <div class=\"fw-bold small mb-1\">Site photos ({{ detail.photoBlobIds.length }})</div>\n <div class=\"x-ir-photos\">\n @for (p of photos; track p.blobId) {\n <a class=\"x-ir-photo\" [href]=\"p.src\" target=\"_blank\" rel=\"noopener\">\n @if (p.src) {\n <img [src]=\"p.src\" alt=\"Site photo\" />\n } @else {\n <span>unavailable</span>\n }\n </a>\n }\n </div>\n </div>\n }\n\n <hr class=\"my-1\" />\n\n <div>\n <div class=\"fw-bold small mb-1\">Follow-up</div>\n <div class=\"d-flex flex-column gap-2\">\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"editStatus\">\n @for (s of statuses; track s.value) {\n <option [value]=\"s.value\">{{ s.label }}</option>\n }\n </select>\n <input\n type=\"text\"\n class=\"form-control form-control-sm\"\n placeholder=\"Assigned to\"\n [(ngModel)]=\"editAssignedTo\"\n />\n <textarea\n class=\"form-control form-control-sm\"\n rows=\"3\"\n placeholder=\"Internal notes (not visible to the customer)\"\n [(ngModel)]=\"editNotes\"\n ></textarea>\n </div>\n <button type=\"button\" class=\"btn btn-sm btn-dark mt-2\" [disabled]=\"saving\" (click)=\"save()\">\n Save\n </button>\n @if (detail.contactedAt) {\n <span class=\"small text-secondary ms-2\">\n First contacted {{ detail.contactedAt | date: 'MMM d, h:mm a' }}\n </span>\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 { InstallationRequestsComponent } from './installation-requests.component';\n\n@NgModule({\n declarations: [InstallationRequestsComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: InstallationRequestsComponent }]),\n ],\n})\nexport class InstallationRequestsModule {}\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAOA,MAAM,QAAQ,GAAuC;AACnD,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;AAC9B,IAAA,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;AAC1C,IAAA,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE;AAChE,IAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;AACpC,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;AAC9B,IAAA,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAChC,IAAA,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;CACrC;AAOD;AACA;AACA;AACA;AAOM,MAAO,6BAA8B,SAAQ,iBAAiB,CAAA;AANpE,IAAA,WAAA,GAAA;;AAOmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AACrC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;QAEhC,IAAA,CAAA,UAAU,GAAG,uBAAuB;QACpC,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,oCAAoC,CAAC;AAErE,QAAA,IAAA,CAAA,OAAO,GAAG;AAClB,YAAA,EAAE,GAAG,EAAE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AAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YANnC,YAAY;YACZ,cAAc;YACd,aAAa;AACb,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGtE,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBATtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,6BAA6B,CAAC;AAC7C,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;AACb,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC,CAAC;AAChF,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs","sources":["../../../projects/admin/src/lib/pages/_shared/list-page.base.ts"],"sourcesContent":["import { ApiService, BaseDirective, titleCase, using } from '@thescaffold/ngx-core';\nimport { BehaviorSubject, map, takeUntil } from 'rxjs';\n\n// R1 production-readiness pass — every admin list page built on\n// `x-webget-collection` (customers, payments, referrals, promotions,\n// coupons, stock, returns, claims, shipments, orders, routes,\n// data-requests, users, …) renders a search box and a refresh icon that do\n// nothing: `CollectionComponent` invokes `data.onSearch`/`data.onRefresh`\n// internally (debounced, confirmed in the compiled\n// `@thescaffold/ngx-ui` bundle), but no page ever supplied them — only\n// `onPage` was ever wired. One shared base fixes all of them at once\n// instead of patching each page's `toCollection` individually.\n//\n// A concrete page extends this, sets `dataSource`/`columns`/`pluralName`\n// in field initializers, and gets `list$`/`init`/`list()` for free — same\n// shape as every page's own hand-rolled version, just de-duplicated.\nexport abstract class ListPageDirective extends BaseDirective {\n protected abstract dataSource: ApiService;\n protected abstract columns: { key: string; value: string; type?: string }[];\n protected abstract pluralName: string;\n\n page = 1;\n perPage = 25;\n query?: string;\n\n list$ = new BehaviorSubject<any>(null);\n\n override init = () => {\n this.list();\n };\n\n list(page = this.page, perPage = this.perPage, query = this.query): void {\n this.page = page;\n this.perPage = perPage;\n this.query = query;\n this.dataSource\n .getMany({ page, perPage, ...(query ? { query } : {}) })\n .pipe(\n takeUntil(this.$),\n map((response: any) => this.toCollection(response)),\n )\n .subscribe(using((data) => this.list$.next(data)));\n }\n\n // Override to transform each row before it reaches the table (e.g. a\n // formatted currency label). Identity by default.\n protected mapRow(row: any): any {\n return row;\n }\n\n // Override to add collection-level extras (`links`, `class`, …) beyond\n // the search/refresh/page wiring every page shares.\n protected extraCollectionFields(_response: any): Record<string, any> {\n return {};\n }\n\n protected toCollection(response: any) {\n const rows = (response?.data ?? []).map((row: any) => this.mapRow(row));\n return {\n title: titleCase(this.pluralName),\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 onSearch: (query: string) => this.list(1, this.perPage, query),\n onRefresh: () => this.list(this.page, this.perPage, this.query),\n ...this.extraCollectionFields(response),\n };\n }\n}\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACM,MAAgB,iBAAkB,SAAQ,aAAa,CAAA;AAA7D,IAAA,WAAA,GAAA;;QAKE,IAAA,CAAA,IAAI,GAAG,CAAC;QACR,IAAA,CAAA,OAAO,GAAG,EAAE;AAGZ,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,eAAe,CAAM,IAAI,CAAC;QAE7B,IAAA,CAAA,IAAI,GAAG,MAAK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AE,IAAI,EAAE,YAAY;AAClC,YAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;AACjC,YAAA,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK;YAC5B,MAAM,EAAE,CAAC,IAAY,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACzC,YAAA,QAAQ,EAAE,CAAC,KAAa,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;AAC9D,YAAA,SAAS,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;AAC/D,YAAA,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC;SACxC;IACH;AACD;;;;"}
|
|
@@ -1,190 +0,0 @@
|
|
|
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 { 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 { downloadBlob } from '@isaiahiroko/tilmart-ngx-ui';
|
|
9
|
-
import { takeUntil } from 'rxjs';
|
|
10
|
-
import { L as ListPageDirective } from './isaiahiroko-tilmart-ngx-apps-admin-list-page.base-Cl7JZ-Tp.mjs';
|
|
11
|
-
import * as i3 from '@angular/common';
|
|
12
|
-
|
|
13
|
-
function naira(amount, currency = 'NGN') {
|
|
14
|
-
return `${currency} ${Math.round(amount).toLocaleString('en-US')}`;
|
|
15
|
-
}
|
|
16
|
-
// Ops action buttons per current status — each entry is a permitted
|
|
17
|
-
// `OrderWorkflow.transition` target. Matches the PRD Appendix B matrix;
|
|
18
|
-
// fulfilment-driven statuses (dispatched, delivered, …) are set by the
|
|
19
|
-
// Shipments page, not here.
|
|
20
|
-
const ACTIONS = {
|
|
21
|
-
payment_received: [{ to: 'confirmed', label: 'Confirm' }, { to: 'on_hold', label: 'Hold' }],
|
|
22
|
-
on_hold: [{ to: 'confirmed', label: 'Release' }, { to: 'cancelled', label: 'Cancel' }],
|
|
23
|
-
confirmed: [{ to: 'processing', label: 'Start preparing' }, { to: 'cancelled', label: 'Cancel' }],
|
|
24
|
-
processing: [{ to: 'cancelled', label: 'Cancel' }],
|
|
25
|
-
pending_payment: [{ to: 'cancelled', label: 'Cancel' }],
|
|
26
|
-
};
|
|
27
|
-
class OrdersComponent extends ListPageDirective {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
this.flyoutService = inject(FlyoutService);
|
|
31
|
-
this.route = inject(ActivatedRoute);
|
|
32
|
-
this.pluralName = 'orders';
|
|
33
|
-
this.dataSource = this.apiService.on('apps/commerce/order');
|
|
34
|
-
this.lineSource = this.apiService.on('apps/commerce/order-line');
|
|
35
|
-
this.historySource = this.apiService.on('apps/commerce/order-status-history');
|
|
36
|
-
this.paymentSource = this.apiService.on('apps/commerce/payment');
|
|
37
|
-
this.shipmentSource = this.apiService.on('apps/commerce/shipment');
|
|
38
|
-
this.columns = [
|
|
39
|
-
{ key: 'orderNumber', value: 'Order' },
|
|
40
|
-
{ key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },
|
|
41
|
-
{ key: 'grandTotalLabel', value: 'Total' },
|
|
42
|
-
{ key: 'paidLabel', value: 'Paid' },
|
|
43
|
-
{ key: 'placedAt', value: 'Placed', type: 'date' },
|
|
44
|
-
];
|
|
45
|
-
this.detail = null;
|
|
46
|
-
this.detailActions = [];
|
|
47
|
-
this.naira = naira;
|
|
48
|
-
this.init = () => {
|
|
49
|
-
this.query = this.route.snapshot.queryParamMap.get('q') ?? '';
|
|
50
|
-
this.list();
|
|
51
|
-
};
|
|
52
|
-
// ORD-11 — the order's VAT invoice as a PDF. Fetched as a Blob (auth
|
|
53
|
-
// header, not a cookie) and saved under the invoice's document number.
|
|
54
|
-
this.downloadingInvoice = false;
|
|
55
|
-
}
|
|
56
|
-
view(item) {
|
|
57
|
-
this.detail = null;
|
|
58
|
-
this.detailActions = ACTIONS[item.status] ?? [];
|
|
59
|
-
this.flyoutService.open(this.detailFlyout);
|
|
60
|
-
this.lineSource
|
|
61
|
-
.getMany({ orderId: item.id, page: 1, perPage: 200 })
|
|
62
|
-
.pipe(takeUntil(this.$))
|
|
63
|
-
.subscribe(using(({ data: lines }) => {
|
|
64
|
-
this.detail = {
|
|
65
|
-
id: item.id,
|
|
66
|
-
orderNumber: item.orderNumber,
|
|
67
|
-
status: item.status,
|
|
68
|
-
currency: item.currency,
|
|
69
|
-
businessName: item.businessName,
|
|
70
|
-
recipientName: item.recipientName,
|
|
71
|
-
recipientPhone: item.recipientPhone,
|
|
72
|
-
subtotal: Number(item.subtotal ?? 0),
|
|
73
|
-
deliveryTotal: Number(item.deliveryTotal ?? 0),
|
|
74
|
-
taxTotal: Number(item.taxTotal ?? 0),
|
|
75
|
-
grandTotal: Number(item.grandTotal ?? 0),
|
|
76
|
-
amountPaid: Number(item.amountPaid ?? 0),
|
|
77
|
-
codAmountDue: Number(item.codAmountDue ?? 0),
|
|
78
|
-
lines: lines ?? [],
|
|
79
|
-
history: [],
|
|
80
|
-
payments: [],
|
|
81
|
-
shipments: [],
|
|
82
|
-
};
|
|
83
|
-
this.historySource
|
|
84
|
-
.getMany({ orderId: item.id, page: 1, perPage: 100 })
|
|
85
|
-
.pipe(takeUntil(this.$))
|
|
86
|
-
.subscribe(using(({ data }) => {
|
|
87
|
-
if (this.detail)
|
|
88
|
-
this.detail.history = data ?? [];
|
|
89
|
-
}));
|
|
90
|
-
this.paymentSource
|
|
91
|
-
.getMany({ orderId: item.id, page: 1, perPage: 20 })
|
|
92
|
-
.pipe(takeUntil(this.$))
|
|
93
|
-
.subscribe(using(({ data }) => {
|
|
94
|
-
if (this.detail)
|
|
95
|
-
this.detail.payments = data ?? [];
|
|
96
|
-
}));
|
|
97
|
-
this.shipmentSource
|
|
98
|
-
.getMany({ orderId: item.id, page: 1, perPage: 50 })
|
|
99
|
-
.pipe(takeUntil(this.$))
|
|
100
|
-
.subscribe(using(({ data }) => {
|
|
101
|
-
if (this.detail)
|
|
102
|
-
this.detail.shipments = data ?? [];
|
|
103
|
-
}));
|
|
104
|
-
}));
|
|
105
|
-
}
|
|
106
|
-
downloadInvoice() {
|
|
107
|
-
if (!this.detail || this.downloadingInvoice)
|
|
108
|
-
return;
|
|
109
|
-
const { id, orderNumber } = this.detail;
|
|
110
|
-
this.downloadingInvoice = true;
|
|
111
|
-
this.apiService.requestService
|
|
112
|
-
.raw('get', `apps/commerce/document/order/${id}/invoice`, { format: 'pdf' }, { responseType: 'blob' })
|
|
113
|
-
.pipe(takeUntil(this.$))
|
|
114
|
-
.subscribe({
|
|
115
|
-
next: (blob) => {
|
|
116
|
-
this.downloadingInvoice = false;
|
|
117
|
-
downloadBlob(blob, `INV-${orderNumber}.pdf`);
|
|
118
|
-
},
|
|
119
|
-
error: () => {
|
|
120
|
-
this.downloadingInvoice = false;
|
|
121
|
-
notify('Could not generate the invoice PDF.', undefined, 'error');
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
transition(to) {
|
|
126
|
-
if (!this.detail)
|
|
127
|
-
return;
|
|
128
|
-
this.apiService
|
|
129
|
-
.post(`apps/commerce/order/${this.detail.id}/transition`, { toStatus: to })
|
|
130
|
-
.pipe(takeUntil(this.$))
|
|
131
|
-
.subscribe(using((res) => {
|
|
132
|
-
if (res?.status === 'error') {
|
|
133
|
-
notify(res.message || 'That transition is not allowed.', undefined, 'error');
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
notify(`Order moved to ${to.replace(/_/g, ' ')}.`, undefined, 'success');
|
|
137
|
-
this.flyoutService.dismiss();
|
|
138
|
-
this.list();
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
mapRow(order) {
|
|
142
|
-
return {
|
|
143
|
-
...order,
|
|
144
|
-
grandTotalLabel: naira(Number(order.grandTotal ?? 0), order.currency),
|
|
145
|
-
paidLabel: naira(Number(order.amountPaid ?? 0), order.currency),
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
extraCollectionFields() {
|
|
149
|
-
return {
|
|
150
|
-
links: {
|
|
151
|
-
secondary: [{ title: 'View', fn: (_link, item) => this.view(item) }],
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
156
|
-
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 <div class=\"d-flex flex-wrap gap-2\">\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"downloadingInvoice\"\n (click)=\"downloadInvoice()\"\n >\n {{ downloadingInvoice ? 'Preparing\u2026' : 'Download invoice (PDF)' }}\n </button>\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: 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" }] }); }
|
|
157
|
-
}
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersComponent, decorators: [{
|
|
159
|
-
type: Component,
|
|
160
|
-
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 <div class=\"d-flex flex-wrap gap-2\">\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"downloadingInvoice\"\n (click)=\"downloadInvoice()\"\n >\n {{ downloadingInvoice ? 'Preparing\u2026' : 'Download invoice (PDF)' }}\n </button>\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"] }]
|
|
161
|
-
}], propDecorators: { detailFlyout: [{
|
|
162
|
-
type: ViewChild,
|
|
163
|
-
args: ['detailFlyout', { read: TemplateRef, static: true }]
|
|
164
|
-
}] } });
|
|
165
|
-
|
|
166
|
-
class OrdersModule {
|
|
167
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
168
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, declarations: [OrdersComponent], imports: [SharedModule,
|
|
169
|
-
ElementsModule,
|
|
170
|
-
WebgetsModule, i1.RouterModule] }); }
|
|
171
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, imports: [SharedModule,
|
|
172
|
-
ElementsModule,
|
|
173
|
-
WebgetsModule,
|
|
174
|
-
RouterModule.forChild([{ path: '', component: OrdersComponent }])] }); }
|
|
175
|
-
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: OrdersModule, decorators: [{
|
|
177
|
-
type: NgModule,
|
|
178
|
-
args: [{
|
|
179
|
-
declarations: [OrdersComponent],
|
|
180
|
-
imports: [
|
|
181
|
-
SharedModule,
|
|
182
|
-
ElementsModule,
|
|
183
|
-
WebgetsModule,
|
|
184
|
-
RouterModule.forChild([{ path: '', component: OrdersComponent }]),
|
|
185
|
-
],
|
|
186
|
-
}]
|
|
187
|
-
}] });
|
|
188
|
-
|
|
189
|
-
export { OrdersModule };
|
|
190
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-orders.module-vldWwcAr.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 { notify, using } from '@thescaffold/ngx-core';\nimport { downloadBlob } from '@isaiahiroko/tilmart-ngx-ui';\nimport { FlyoutService } from '@thescaffold/ngx-ui';\nimport { takeUntil } from 'rxjs';\nimport { ListPageDirective } from '../_shared/list-page.base';\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 ListPageDirective {\n private readonly flyoutService = inject(FlyoutService);\n private readonly route = inject(ActivatedRoute);\n\n protected pluralName = 'orders';\n protected dataSource = 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 protected 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 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 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 // ORD-11 — the order's VAT invoice as a PDF. Fetched as a Blob (auth\n // header, not a cookie) and saved under the invoice's document number.\n downloadingInvoice = false;\n downloadInvoice() {\n if (!this.detail || this.downloadingInvoice) return;\n const { id, orderNumber } = this.detail;\n this.downloadingInvoice = true;\n this.apiService.requestService\n .raw<Blob>(\n 'get',\n `apps/commerce/document/order/${id}/invoice`,\n { format: 'pdf' },\n { responseType: 'blob' },\n )\n .pipe(takeUntil(this.$))\n .subscribe({\n next: (blob) => {\n this.downloadingInvoice = false;\n downloadBlob(blob, `INV-${orderNumber}.pdf`);\n },\n error: () => {\n this.downloadingInvoice = false;\n notify('Could not generate the invoice PDF.', undefined, 'error');\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 protected override mapRow(order: any) {\n return {\n ...order,\n grandTotalLabel: naira(Number(order.grandTotal ?? 0), order.currency),\n paidLabel: naira(Number(order.amountPaid ?? 0), order.currency),\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\">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 <div class=\"d-flex flex-wrap gap-2\">\n <button\n type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"downloadingInvoice\"\n (click)=\"downloadInvoice()\"\n >\n {{ downloadingInvoice ? 'Preparing…' : 'Download invoice (PDF)' }}\n </button>\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":[],"mappings":";;;;;;;;;;;;AAQA,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,CAAC;CACxD;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AE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;AAClE,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-payments.module-DstLDYM7.mjs","sources":["../../../projects/admin/src/lib/pages/payments/payments.component.ts","../../../projects/admin/src/lib/pages/payments/payments.component.html","../../../projects/admin/src/lib/pages/payments/payments.module.ts"],"sourcesContent":["import { Component, TemplateRef, ViewChild, inject } from '@angular/core';\nimport { notify } from '@thescaffold/ngx-core';\nimport { FlyoutService } from '@thescaffold/ngx-ui';\nimport { firstValueFrom } from 'rxjs';\nimport { ListPageDirective } from '../_shared/list-page.base';\n\n// R1 production-readiness pass — PAY-13. Was list-only with no drill-in\n// at all. Adds a detail flyout (attempts history, failure codes) and\n// wires the ops \"re-verify with provider\" action that already existed\n// server-side (`OrderWorkflow.verifyPayment`) but had no button.\n//\n// PAY-10 (refunds) is deliberately not touched here — there is no\n// refund workflow on the backend at all (no ledger entry, no provider\n// refund-API call, no reason-code/permission model), so a \"Refund\"\n// button in this pass would either no-op or move money with none of\n// that in place. That's real, separate scope, not a UI gap.\n@Component({\n standalone: false,\n selector: 'x-payments',\n templateUrl: './payments.component.html',\n styleUrl: './payments.component.scss',\n})\nexport class PaymentsComponent extends ListPageDirective {\n private readonly flyoutService = inject(FlyoutService);\n\n protected pluralName = 'payments';\n protected dataSource = this.apiService.on('apps/commerce/payment');\n private readonly attemptSource = this.apiService.on('apps/commerce/payment-attempt');\n\n protected 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 detail: any = null;\n attempts: any[] = [];\n verifying = false;\n\n @ViewChild('detailFlyout', { read: TemplateRef, static: true })\n detailFlyout!: TemplateRef<any>;\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 async view(item: any): Promise<void> {\n this.detail = null;\n this.attempts = [];\n this.flyoutService.open(this.detailFlyout);\n\n const [detailRes, attemptsRes]: any = await Promise.all([\n firstValueFrom(this.dataSource.getOne(item.id)),\n firstValueFrom(this.attemptSource.getMany({ paymentId: item.id, page: 1, perPage: 50 } as any)),\n ]);\n this.detail = detailRes?.data ?? item;\n this.attempts = attemptsRes?.data ?? [];\n }\n\n async reverify(): Promise<void> {\n if (!this.detail) return;\n this.verifying = true;\n try {\n const res: any = await firstValueFrom(\n this.apiService.post(`apps/commerce/payment/${this.detail.id}/verify`),\n );\n if (res?.status === 'error') {\n notify(res.message || 'Verification failed.', undefined, 'error');\n return;\n }\n notify('Re-verified with the provider.', undefined, 'success');\n await this.view(this.detail);\n this.list(this.page, this.perPage);\n } catch {\n notify('Verification failed.', undefined, 'error');\n } finally {\n this.verifying = false;\n }\n }\n}\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<ng-template #detailFlyout>\n <x-webget-flyout [data]=\"{ title: 'Payment detail' }\">\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.provider }}</span>\n <span class=\"badge text-bg-light border\">{{ detail.status }}</span>\n <span class=\"badge text-bg-light border\">{{ detail.method || 'card' }}</span>\n </div>\n <div class=\"small\">\n <div class=\"d-flex justify-content-between\"><span>Amount</span><span>{{ detail.currency }} {{ detail.amount }}</span></div>\n <div class=\"d-flex justify-content-between\"><span>Provider ref</span><span class=\"font-monospace\">{{ detail.providerRef }}</span></div>\n @if (detail.paidAt) {\n <div class=\"d-flex justify-content-between\"><span>Paid at</span><span>{{ detail.paidAt | date: 'MMM d, h:mm a' }}</span></div>\n }\n @if (detail.proofRef) {\n <div class=\"d-flex justify-content-between\"><span>Proof ref</span><span>{{ detail.proofRef }}</span></div>\n }\n </div>\n\n <button type=\"button\" class=\"btn btn-sm btn-outline-dark\" [disabled]=\"verifying\" (click)=\"reverify()\">\n {{ verifying ? 'Verifying…' : 'Re-verify with provider' }}\n </button>\n\n <hr class=\"my-1\" />\n\n <div>\n <div class=\"fw-bold small mb-1\">Attempts</div>\n @for (a of attempts; track a.id) {\n <div class=\"small text-secondary\">\n {{ a.status }} · {{ a.source || 'unknown' }}\n @if (a.failureCode) { — {{ a.failureCode }} }\n · {{ a.createdAt | date: 'MMM d, h:mm a' }}\n </div>\n } @empty {\n <div class=\"small text-secondary\">No attempts 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 { 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","i2"],"mappings":";;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOM,MAAO,iBAAkB,SAAQ,iBAAiB,CAAA;AANxD,IAAA,WAAA,GAAA;;AAOmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAE5C,IAAA,CAAA,UAAU,GAAG,UAAU;QACvB,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,uBAAuB,CAAC;QACjD,IAAA,CAAA,aAAa,GAAG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
import { RouterModule } from '@angular/router';
|
|
5
|
-
import { SharedModule } from '@thescaffold/ngx-core';
|
|
6
|
-
import * as i2 from '@thescaffold/ngx-ui';
|
|
7
|
-
import { ElementsModule, WebgetsModule } from '@thescaffold/ngx-ui';
|
|
8
|
-
import { S as SimpleCrudDirective } from './isaiahiroko-tilmart-ngx-apps-admin-simple-crud.base-C8SPw14H.mjs';
|
|
9
|
-
import * as i1 from '@angular/forms';
|
|
10
|
-
import * as i3 from '@angular/common';
|
|
11
|
-
|
|
12
|
-
// R1 production-readiness pass — PROMO-02. Was list-only; ops had no way
|
|
13
|
-
// to configure a discount rule. `conditions`/`actions` stay raw JSON —
|
|
14
|
-
// a full visual rule builder is real, separate scope beyond this pass.
|
|
15
|
-
class PromotionsComponent extends SimpleCrudDirective {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.pageTitle = 'Promotions';
|
|
19
|
-
this.pageSubtitle = 'Automatic and coupon-gated discount rules evaluated at checkout.';
|
|
20
|
-
this.singularLabel = 'promotion';
|
|
21
|
-
this.pluralName = 'promotions';
|
|
22
|
-
this.dataSource = this.apiService.on('apps/commerce/promotion');
|
|
23
|
-
this.columns = [
|
|
24
|
-
{ key: 'name', value: 'Name' },
|
|
25
|
-
{ key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },
|
|
26
|
-
{ key: 'priority', value: 'Priority' },
|
|
27
|
-
{ key: 'usageCount', value: 'Used' },
|
|
28
|
-
];
|
|
29
|
-
this.fields = [
|
|
30
|
-
{ key: 'name', label: 'Name', type: 'text', required: true },
|
|
31
|
-
{ key: 'description', label: 'Description', type: 'textarea' },
|
|
32
|
-
{
|
|
33
|
-
key: 'status',
|
|
34
|
-
label: 'Status',
|
|
35
|
-
type: 'select',
|
|
36
|
-
options: [
|
|
37
|
-
{ value: 'draft', label: 'Draft' },
|
|
38
|
-
{ value: 'active', label: 'Active' },
|
|
39
|
-
{ value: 'paused', label: 'Paused' },
|
|
40
|
-
{ value: 'expired', label: 'Expired' },
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
{ key: 'priority', label: 'Priority (lower runs first)', type: 'number' },
|
|
44
|
-
{ key: 'stackable', label: 'Stackable with other promotions', type: 'boolean' },
|
|
45
|
-
{ key: 'requiresCoupon', label: 'Requires a coupon code', type: 'boolean' },
|
|
46
|
-
{ key: 'startsAt', label: 'Starts at', type: 'date' },
|
|
47
|
-
{ key: 'endsAt', label: 'Ends at', type: 'date' },
|
|
48
|
-
{
|
|
49
|
-
key: 'conditions',
|
|
50
|
-
label: 'Conditions (JSON)',
|
|
51
|
-
type: 'json',
|
|
52
|
-
placeholder: '{"minSubtotal": 50000, "categoryIds": []}',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
key: 'actions',
|
|
56
|
-
label: 'Actions (JSON array)',
|
|
57
|
-
type: 'json',
|
|
58
|
-
placeholder: '[{"type": "percent_off", "value": 10}]',
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
}
|
|
62
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
63
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: PromotionsComponent, isStandalone: false, selector: "x-promotions", usesInheritance: true, ngImport: i0, template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of (f.optionsKey ? dynamicOptions[f.optionsKey] : f.options); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n </div>\n </div>\n}\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}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { 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: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
|
64
|
-
}
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsComponent, decorators: [{
|
|
66
|
-
type: Component,
|
|
67
|
-
args: [{ standalone: false, selector: 'x-promotions', template: "<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving\u2026' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">\u2014 choose \u2014</option>\n @for (opt of (f.optionsKey ? dynamicOptions[f.optionsKey] : f.options); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n </div>\n </div>\n}\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}.x-scrud-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.x-scrud-btn{border:1px solid var(--color-border);background:transparent;border-radius:var(--radius-md);padding:6px 14px;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--color-text-muted)}.x-scrud-btn:disabled{opacity:.5;cursor:default}.x-scrud-btn-primary{border-color:var(--color-accent);color:var(--color-accent-hover)}.x-scrud-danger{color:var(--color-danger, #c0362c)}.x-scrud-editor{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:16px;display:flex;flex-direction:column;gap:14px}.x-scrud-editor-head{display:flex;align-items:center;justify-content:space-between}.x-scrud-editor-title{font-size:16px;font-weight:800;color:var(--color-text)}.x-scrud-editor-actions{display:flex;gap:8px}.x-scrud-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.x-scrud-f{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--color-text-muted);font-weight:700}.x-scrud-f-wide{grid-column:1/-1}.x-scrud-f input,.x-scrud-f select,.x-scrud-f textarea{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:6px 10px;font-size:13px;background:var(--color-surface);color:var(--color-text);font-weight:400}.x-scrud-f input[type=checkbox]{width:18px;height:18px}.x-scrud-pwd{position:relative;display:flex}.x-scrud-pwd input{flex:1;padding-right:34px!important}.x-scrud-pwd-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);border:none;background:transparent;color:var(--color-text-muted);padding:4px 6px;cursor:pointer}.x-scrud-pwd-toggle:hover{color:var(--color-text)}.x-scrud-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.x-scrud-required{color:var(--color-danger, #c0362c)}\n"] }]
|
|
68
|
-
}] });
|
|
69
|
-
|
|
70
|
-
class PromotionsModule {
|
|
71
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
72
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, declarations: [PromotionsComponent], imports: [SharedModule,
|
|
73
|
-
ElementsModule,
|
|
74
|
-
WebgetsModule, i1$1.RouterModule] }); }
|
|
75
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, imports: [SharedModule,
|
|
76
|
-
ElementsModule,
|
|
77
|
-
WebgetsModule,
|
|
78
|
-
RouterModule.forChild([{ path: '', component: PromotionsComponent }])] }); }
|
|
79
|
-
}
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PromotionsModule, decorators: [{
|
|
81
|
-
type: NgModule,
|
|
82
|
-
args: [{
|
|
83
|
-
declarations: [PromotionsComponent],
|
|
84
|
-
imports: [
|
|
85
|
-
SharedModule,
|
|
86
|
-
ElementsModule,
|
|
87
|
-
WebgetsModule,
|
|
88
|
-
RouterModule.forChild([{ path: '', component: PromotionsComponent }]),
|
|
89
|
-
],
|
|
90
|
-
}]
|
|
91
|
-
}] });
|
|
92
|
-
|
|
93
|
-
export { PromotionsModule };
|
|
94
|
-
//# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isaiahiroko-tilmart-ngx-apps-admin-promotions.module-BO4zRytg.mjs","sources":["../../../projects/admin/src/lib/pages/promotions/promotions.component.ts","../../../projects/admin/src/lib/pages/_shared/simple-crud.component.html","../../../projects/admin/src/lib/pages/promotions/promotions.module.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { CrudFieldSpec, SimpleCrudDirective } from '../_shared/simple-crud.base';\n\n// R1 production-readiness pass — PROMO-02. Was list-only; ops had no way\n// to configure a discount rule. `conditions`/`actions` stay raw JSON —\n// a full visual rule builder is real, separate scope beyond this pass.\n@Component({\n standalone: false,\n selector: 'x-promotions',\n templateUrl: '../_shared/simple-crud.component.html',\n styleUrl: '../_shared/simple-crud.component.scss',\n})\nexport class PromotionsComponent extends SimpleCrudDirective {\n protected pageTitle = 'Promotions';\n protected pageSubtitle = 'Automatic and coupon-gated discount rules evaluated at checkout.';\n protected singularLabel = 'promotion';\n protected pluralName = 'promotions';\n protected dataSource = this.apiService.on('apps/commerce/promotion');\n\n protected columns = [\n { key: 'name', value: 'Name' },\n { key: 'status', value: 'Status', type: 'class', class: 'badge text-bg-light border' },\n { key: 'priority', value: 'Priority' },\n { key: 'usageCount', value: 'Used' },\n ];\n\n protected fields: CrudFieldSpec[] = [\n { key: 'name', label: 'Name', type: 'text', required: true },\n { key: 'description', label: 'Description', type: 'textarea' },\n {\n key: 'status',\n label: 'Status',\n type: 'select',\n options: [\n { value: 'draft', label: 'Draft' },\n { value: 'active', label: 'Active' },\n { value: 'paused', label: 'Paused' },\n { value: 'expired', label: 'Expired' },\n ],\n },\n { key: 'priority', label: 'Priority (lower runs first)', type: 'number' },\n { key: 'stackable', label: 'Stackable with other promotions', type: 'boolean' },\n { key: 'requiresCoupon', label: 'Requires a coupon code', type: 'boolean' },\n { key: 'startsAt', label: 'Starts at', type: 'date' },\n { key: 'endsAt', label: 'Ends at', type: 'date' },\n {\n key: 'conditions',\n label: 'Conditions (JSON)',\n type: 'json',\n placeholder: '{\"minSubtotal\": 50000, \"categoryIds\": []}',\n },\n {\n key: 'actions',\n label: 'Actions (JSON array)',\n type: 'json',\n placeholder: '[{\"type\": \"percent_off\", \"value\": 10}]',\n },\n ];\n}\n","<div class=\"x-page-head\">\n <div class=\"x-page-title\">{{ pageTitle }}</div>\n <div class=\"x-page-subtitle\">{{ pageSubtitle }}</div>\n</div>\n\n@if (!editing) {\n <div class=\"x-scrud-toolbar\">\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" (click)=\"startCreate()\">+ New {{ singularLabel }}</button>\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} @else if (draft) {\n <div class=\"x-scrud-editor\">\n <div class=\"x-scrud-editor-head\">\n <div class=\"x-scrud-editor-title\">{{ draft['id'] ? 'Edit' : 'New' }} {{ singularLabel }}</div>\n <div class=\"x-scrud-editor-actions\">\n @if (draft['id'] && !hideDelete) {\n <button type=\"button\" class=\"x-scrud-btn x-scrud-danger\" (click)=\"remove(draft); cancelEdit()\">Delete</button>\n }\n <button type=\"button\" class=\"x-scrud-btn\" (click)=\"cancelEdit()\">Close</button>\n <button type=\"button\" class=\"x-scrud-btn x-scrud-btn-primary\" [disabled]=\"saving\" (click)=\"save()\">\n {{ saving ? 'Saving…' : 'Save' }}\n </button>\n </div>\n </div>\n\n <div class=\"x-scrud-grid\">\n @for (f of fields; track f.key) {\n <label class=\"x-scrud-f\" [class.x-scrud-f-wide]=\"f.type === 'textarea' || f.type === 'json'\">\n {{ f.label }}\n @if (f.required) {\n <span class=\"x-scrud-required\">*</span>\n }\n @switch (f.type) {\n @case ('boolean') {\n <input type=\"checkbox\" [(ngModel)]=\"draft[f.key]\" />\n }\n @case ('select') {\n <select [(ngModel)]=\"draft[f.key]\">\n <option value=\"\">— choose —</option>\n @for (opt of (f.optionsKey ? dynamicOptions[f.optionsKey] : f.options); track opt.value) {\n <option [value]=\"opt.value\">{{ opt.label }}</option>\n }\n </select>\n }\n @case ('textarea') {\n <textarea rows=\"3\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\"></textarea>\n }\n @case ('json') {\n <textarea rows=\"4\" class=\"x-scrud-json\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || '{}'\"></textarea>\n }\n @case ('number') {\n <input type=\"number\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n @case ('date') {\n <input type=\"datetime-local\" [(ngModel)]=\"draft[f.key]\" />\n }\n @default {\n <input type=\"text\" [(ngModel)]=\"draft[f.key]\" [placeholder]=\"f.placeholder || ''\" />\n }\n }\n </label>\n }\n </div>\n </div>\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 { PromotionsComponent } from './promotions.component';\n\n@NgModule({\n declarations: [PromotionsComponent],\n imports: [\n SharedModule,\n ElementsModule,\n WebgetsModule,\n RouterModule.forChild([{ path: '', component: PromotionsComponent }]),\n ],\n})\nexport class PromotionsModule {}\n"],"names":["i1"],"mappings":";;;;;;;;;;;AAGA;AACA;AACA;AAOM,MAAO,mBAAoB,SAAQ,mBAAmB,CAAA;AAN5D,IAAA,WAAA,GAAA;;QAOY,IAAA,CAAA,SAAS,GAAG,YAAY;QACxB,IAAA,CAAA,YAAY,GAAG,kEAAkE;QACjF,IAAA,CAAA,aAAa,GAAG,WAAW;QAC3B,IAAA,CAAA,UAAU,GAAG,YAAY;QACzB,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,yBAAyB,CAAC;AAE1D,QAAA,IAAA,CAAA,OAAO,GAAG;AAClB,YAAA,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;AAC9B,YAAA,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,4BAA4B,EAAE;AACtF,YAAA,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;AACtC,YAAA,EAAE,GAAG,EAAE,Y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