build: rebuild release bundles with retail dashboard change
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 5.5
parent
640a42da05
commit
890f5a9725
+14
-8
@@ -103086,8 +103086,12 @@ var require_admin_dashboard_service = __commonJS({
|
||||
static SOLD = {
|
||||
status: { in: [client_1.OrderStatus.DELIVERED_TO_AGENT, client_1.OrderStatus.DELIVERED_TO_CUSTOMER] }
|
||||
};
|
||||
/** The single merged dashboard endpoint (`GET admin/dashboard/overview`). */
|
||||
async overview() {
|
||||
/**
|
||||
* The single merged dashboard endpoint (`GET admin/dashboard/overview`).
|
||||
* Retail («تک فروشی») figures are only built for the super admin; for anyone
|
||||
* else they never leave the server.
|
||||
*/
|
||||
async overview(viewerIsSuperAdmin = false) {
|
||||
const since30 = this.daysAgo(30);
|
||||
const since7 = this.daysAgo(7);
|
||||
const [omde, tak, ordersLast30, statusGroups, channelGroups, topProductRows, latestGoldQuote, debtAgg] = await Promise.all([
|
||||
@@ -103143,7 +103147,7 @@ var require_admin_dashboard_service = __commonJS({
|
||||
else
|
||||
bucket.retail += 1;
|
||||
}
|
||||
const ordersTrend = [...trendByDay.entries()].map(([date, v]) => ({ date, ...v }));
|
||||
const ordersTrend = [...trendByDay.entries()].map(([date, v]) => viewerIsSuperAdmin ? { date, ...v } : { date, total: v.wholesale, wholesale: v.wholesale });
|
||||
const statusLabels = {
|
||||
SUSPENDED: "\u0645\u0639\u0644\u0642 (\u0633\u0642\u0641 \u0627\u0639\u062A\u0628\u0627\u0631)",
|
||||
PLACED: "\u062B\u0628\u062A \u0634\u062F\u0647",
|
||||
@@ -103160,12 +103164,12 @@ var require_admin_dashboard_service = __commonJS({
|
||||
count: g._count
|
||||
}));
|
||||
const channelLabels = { RETAIL: "\u062A\u06A9 \u0641\u0631\u0648\u0634\u06CC", WHOLESALE: "\u0639\u0645\u062F\u0647 \u0641\u0631\u0648\u0634\u06CC" };
|
||||
const channelBreakdown = channelGroups.map((g) => ({
|
||||
const channelBreakdown = viewerIsSuperAdmin ? channelGroups.map((g) => ({
|
||||
channel: g.channel,
|
||||
label: channelLabels[g.channel] ?? g.channel,
|
||||
count: g._count,
|
||||
grams: g._sum.totalGoldWeightGrams ?? new client_1.Prisma.Decimal(0)
|
||||
}));
|
||||
})) : [];
|
||||
const productTotals = /* @__PURE__ */ new Map();
|
||||
for (const it of topProductRows) {
|
||||
const p = it.productVariant.product;
|
||||
@@ -103415,13 +103419,14 @@ var require_admin_dashboard_controller = __commonJS({
|
||||
var common_12 = require_common();
|
||||
var admin_dashboard_service_1 = require_admin_dashboard_service();
|
||||
var guards_1 = require_guards2();
|
||||
var super_admin_1 = require_super_admin();
|
||||
var AdminDashboardController = class AdminDashboardController {
|
||||
dashboard;
|
||||
constructor(dashboard) {
|
||||
this.dashboard = dashboard;
|
||||
}
|
||||
overview() {
|
||||
return this.dashboard.overview();
|
||||
overview(admin) {
|
||||
return this.dashboard.overview((0, super_admin_1.isSuperAdmin)(admin.mobile));
|
||||
}
|
||||
/** @deprecated superseded by GET overview; kept as an alias. */
|
||||
omde() {
|
||||
@@ -103444,8 +103449,9 @@ var require_admin_dashboard_controller = __commonJS({
|
||||
__decorate4([
|
||||
(0, common_12.Get)("overview"),
|
||||
(0, guards_1.RequirePermission)("dashboard.view"),
|
||||
__param3(0, (0, guards_1.CurrentAdmin)()),
|
||||
__metadata3("design:type", Function),
|
||||
__metadata3("design:paramtypes", []),
|
||||
__metadata3("design:paramtypes", [Object]),
|
||||
__metadata3("design:returntype", void 0)
|
||||
], AdminDashboardController.prototype, "overview", null);
|
||||
__decorate4([
|
||||
|
||||
Reference in New Issue
Block a user