update admin

This commit is contained in:
s.esmaeili
2026-09-21 17:37:26 +03:30
parent ef1d4638cc
commit a743f6f93c
9 changed files with 269 additions and 2 deletions
@@ -18,6 +18,7 @@ const PUBLIC_CUSTOMER_SELECT = {
businessLicenseUrl: true,
shopImageUrl: true,
isActive: true,
isArchived: true,
createdAt: true,
updatedAt: true,
} satisfies Prisma.CustomerSelect;
@@ -35,8 +36,16 @@ export class CustomersService {
return customer;
}
// Ported from legacy henza_server's WebApp\AuthController::userAuth() /
// ApiMobileController::userAuth(), both of which query
// Customer::active()->where('is_archive', 0) — an inactive or archived
// customer cannot authenticate in the customer-facing app. This endpoint is
// that same lookup surface for the user-app login flow (client-side match
// on `mobile`), so it must apply the same two filters, or a
// deactivated/archived customer would still be able to log in.
list() {
return this.prisma.customer.findMany({
where: { isActive: true, isArchived: false },
select: PUBLIC_CUSTOMER_SELECT,
orderBy: { createdAt: 'desc' },
});