diff --git a/apps/api/release/app.js b/apps/api/release/app.js index fe42a63..2d6c2b5 100644 --- a/apps/api/release/app.js +++ b/apps/api/release/app.js @@ -90343,7 +90343,7 @@ var require_admin_uploads_service = __commonJS({ mimeType: file2.mimetype, sizeBytes: file2.size, purpose: purpose ?? null, - uploadedByAdminUserId: actorAdminUserId + uploadedByAdminId: actorAdminUserId } }); } @@ -91521,7 +91521,7 @@ var require_ledger_service = __commonJS({ note: input.note, confirmed, confirmedAt: confirmed ? /* @__PURE__ */ new Date() : null, - postedByAdminUserId: input.postedByAdminUserId + postedByAdminId: input.postedByAdminId } }); if (confirmed) { @@ -91546,7 +91546,7 @@ var require_ledger_service = __commonJS({ return entry; const updated = await tx.ledgerEntry.update({ where: { id: entryId }, - data: { confirmed: true, confirmedAt: /* @__PURE__ */ new Date(), postedByAdminUserId: adminUserId ?? entry.postedByAdminUserId } + data: { confirmed: true, confirmedAt: /* @__PURE__ */ new Date(), postedByAdminId: adminUserId ?? entry.postedByAdminId } }); await this.applyToBalance(entry.customerId, entry.currency, entry.direction, entry.amount, tx); return updated; @@ -91660,7 +91660,7 @@ var require_ledger_service = __commonJS({ note: params.note, confirmed: false, // pending until an admin confirms — intentional deviation from legacy, which auto-confirms on creation - postedByAdminUserId: params.postedByAdminUserId + postedByAdminId: params.postedByAdminId }, tx); } /** @@ -91677,7 +91677,7 @@ var require_ledger_service = __commonJS({ amount: params.amount, note: params.note, confirmed: false, - postedByAdminUserId: params.postedByAdminUserId + postedByAdminId: params.postedByAdminId }, tx); } async postAdjustment(params, tx = this.prisma) { @@ -91689,7 +91689,7 @@ var require_ledger_service = __commonJS({ amount: params.amount, note: params.note, confirmed: true, - postedByAdminUserId: params.postedByAdminUserId + postedByAdminId: params.postedByAdminId }, tx); } async getBalance(customerId) { @@ -92254,7 +92254,7 @@ var require_orders_service = __commonJS({ } }); await tx.orderStatusEvent.create({ - data: { orderId, fromStatus: order.status, toStatus: newStatus, note, actorAdminUserId } + data: { orderId, fromStatus: order.status, toStatus: newStatus, note, actorAdminId: actorAdminUserId } }); await this.ledger.syncOrderDebt(orderId, tx); if (newStatus === client_1.OrderStatus.CANCELLED && order.status !== client_1.OrderStatus.CANCELLED) { @@ -93827,7 +93827,7 @@ var require_admin_session_service = __commonJS({ await this.prisma.adminSession.create({ data: { jti: input.jti, - adminUserId: input.adminUserId, + adminId: input.adminId, iamSessionId: input.iamSessionId ?? null, iamSub: input.iamSub ?? null, ipAddress: input.ipAddress ?? null, @@ -93863,8 +93863,8 @@ var require_admin_session_service = __commonJS({ return this.revokeWhere({ iamSub }, reason); } /** Revoke every session of a local admin (account disabled, password changed). */ - async revokeAllForAdmin(adminUserId, reason = "revoked") { - return this.revokeWhere({ adminUserId }, reason); + async revokeAllForAdmin(adminId, reason = "revoked") { + return this.revokeWhere({ adminId }, reason); } async revokeWhere(where, reason) { if (!this.enabled) @@ -94003,7 +94003,7 @@ var require_auth_service = __commonJS({ if (isStaticAdmin) { await this.ensureStaticAdmin(); } - const user = await this.prisma.adminUser.findUnique({ + const user = await this.prisma.admin.findUnique({ where: { mobile: isStaticAdmin ? STATIC_ADMIN_MOBILE : dto.phone }, include: { userType: { include: { permissions: true } } } }); @@ -94023,7 +94023,7 @@ var require_auth_service = __commonJS({ if (jti) { await this.sessions.record({ jti, - adminUserId: user.id, + adminId: user.id, iamSessionId: verified.identity?.sessionId ?? null, iamSub: verified.identity?.sub ?? null, ipAddress: clientIp ?? null, @@ -94084,7 +94084,7 @@ var require_auth_service = __commonJS({ if (!claims.phoneNumber) { throw new common_12.UnauthorizedException("\u0647\u0648\u06CC\u062A \u0645\u0634\u062A\u0631\u06A9 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0646\u062F\u0627\u0631\u062F"); } - const user = await this.prisma.adminUser.findFirst({ + const user = await this.prisma.admin.findFirst({ where: { mobile: { in: mobileVariants(claims.phoneNumber) }, isActive: true }, include: { userType: { include: { permissions: true } } } }); @@ -94128,7 +94128,7 @@ var require_auth_service = __commonJS({ if (jti) { await this.sessions.record({ jti, - adminUserId: user.id, + adminId: user.id, iamSessionId: identity?.sessionId ?? null, iamSub: identity?.sub ?? null, ipAddress: ip ?? null, @@ -94152,7 +94152,7 @@ var require_auth_service = __commonJS({ const fullAccess = await this.prisma.userType.findUnique({ where: { id: 85 } }); const userTypeId = fullAccess ? 85 : null; const passwordHash = await bcrypt.hash(STATIC_ADMIN_MOBILE, 10); - await this.prisma.adminUser.upsert({ + await this.prisma.admin.upsert({ where: { mobile: STATIC_ADMIN_MOBILE }, update: { role: client_1.AdminRole.SUPER_ADMIN, userTypeId, branchId: null, isActive: true }, create: { @@ -94230,7 +94230,7 @@ var require_auth_service = __commonJS({ * legacy. The guard's own checks use the pre-expanded list from JwtStrategy. */ async showData(adminId) { - const user = await this.prisma.adminUser.findUnique({ + const user = await this.prisma.admin.findUnique({ where: { id: adminId }, include: { userType: { include: { permissions: true } } } }); @@ -94644,7 +94644,7 @@ var require_jwt_strategy = __commonJS({ if (!await this.sessions.isActive(payload.jti)) { throw new common_12.UnauthorizedException(); } - const user = await this.prisma.adminUser.findUnique({ + const user = await this.prisma.admin.findUnique({ where: { id: payload.sub }, include: { userType: { include: { permissions: true } } } }); @@ -95418,7 +95418,7 @@ var require_admin_orders_service = __commonJS({ customer: true, branch: true, items: { include: { productVariant: { include: { product: true } } } }, - statusEvents: { include: { actorAdminUser: true }, orderBy: { createdAt: "asc" } } + statusEvents: { include: { actorAdmin: true }, orderBy: { createdAt: "asc" } } } }); if (!order) @@ -96336,7 +96336,7 @@ var require_admin_branches_service = __commonJS({ /** Legacy `POST branch/table`. */ async listBranches(query) { this.table.assertNotExport(query); - const aliases = { "user.name": "adminUsers.some.fullName" }; + const aliases = { "user.name": "admins.some.fullName" }; const { where, orderBy, skip, take, page, limit } = this.table.build(query, { searchable: ["name", "address", "phone"], allowed: ["id", "name", "address", "phone", "isActive", "cityId", "city.name"], @@ -96351,8 +96351,8 @@ var require_admin_branches_service = __commonJS({ take, include: { city: true, - adminUsers: { where: { isActive: true }, take: 1 }, - _count: { select: { adminUsers: true, orders: true } } + admins: { where: { isActive: true }, take: 1 }, + _count: { select: { admins: true, orders: true } } } }), this.prisma.branch.count({ where }) @@ -96367,15 +96367,15 @@ var require_admin_branches_service = __commonJS({ city_id: b.cityId, city: b.city ? { id: b.city.id, title: b.city.name } : null, // legacy column key is `user.name` — the branch manager - user: b.adminUsers[0] ? { id: b.adminUsers[0].id, name: b.adminUsers[0].fullName } : null, - users_count: b._count.adminUsers, + user: b.admins[0] ? { id: b.admins[0].id, name: b.admins[0].fullName } : null, + users_count: b._count.admins, orders_count: b._count.orders })), total, query, page, limit); } async findBranch(id) { const b = await this.prisma.branch.findUnique({ where: { id }, - include: { city: true, adminUsers: { where: { isActive: true }, take: 1 } } + include: { city: true, admins: { where: { isActive: true }, take: 1 } } }); if (!b) throw new common_12.NotFoundException("\u0634\u0639\u0628\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); @@ -96386,8 +96386,8 @@ var require_admin_branches_service = __commonJS({ phone: b.phone, is_active: b.isActive, city_id: b.cityId, - user_id: b.adminUsers[0]?.id ?? null, - user: b.adminUsers[0] ? { id: b.adminUsers[0].id, name: b.adminUsers[0].fullName } : null + user_id: b.admins[0]?.id ?? null, + user: b.admins[0] ? { id: b.admins[0].id, name: b.admins[0].fullName } : null }; } /** Legacy `POST branch` — the manager is an EXISTING admin picked by id. */ @@ -96436,12 +96436,12 @@ var require_admin_branches_service = __commonJS({ */ async assignBranchManager(branchId, userId) { await this.prisma.$transaction(async (tx) => { - await tx.adminUser.updateMany({ where: { branchId }, data: { branchId: null } }); + await tx.admin.updateMany({ where: { branchId }, data: { branchId: null } }); if (userId) { - const user = await tx.adminUser.findUnique({ where: { id: userId } }); + const user = await tx.admin.findUnique({ where: { id: userId } }); if (!user) throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u0627\u0646\u062A\u062E\u0627\u0628\u200C\u0634\u062F\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); - await tx.adminUser.update({ where: { id: userId }, data: { branchId } }); + await tx.admin.update({ where: { id: userId }, data: { branchId } }); } }); } @@ -96564,25 +96564,25 @@ var require_admin_branches_service = __commonJS({ throw new common_12.BadRequestException("\u0645\u0648\u0628\u0627\u06CC\u0644 \u0633\u0631\u067E\u0631\u0633\u062A \u06A9\u0627\u0631\u06AF\u0627\u0647 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); const fullName = `${fname} ${lname}`.trim(); if (currentId) { - const current = await this.prisma.adminUser.findUnique({ where: { id: currentId } }); + const current = await this.prisma.admin.findUnique({ where: { id: currentId } }); if (current) { if (phone !== current.mobile) { - const clash = await this.prisma.adminUser.findUnique({ where: { mobile: phone } }); + const clash = await this.prisma.admin.findUnique({ where: { mobile: phone } }); if (clash && clash.id !== currentId) { throw new common_12.BadRequestException("\u0627\u06CC\u0646 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0642\u0628\u0644\u0627\u064B \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A"); } } - await this.prisma.adminUser.update({ + await this.prisma.admin.update({ where: { id: currentId }, data: { fullName, mobile: phone } }); return currentId; } } - const existing = await this.prisma.adminUser.findUnique({ where: { mobile: phone } }); + const existing = await this.prisma.admin.findUnique({ where: { mobile: phone } }); if (existing) return existing.id; - const created = await this.prisma.adminUser.create({ + const created = await this.prisma.admin.create({ data: { fullName, mobile: phone, @@ -96605,7 +96605,7 @@ var require_admin_branches_service = __commonJS({ } /** The admin picker the branch form uses — legacy `GET user/list`. */ async userList() { - const rows = await this.prisma.adminUser.findMany({ + const rows = await this.prisma.admin.findMany({ where: { isActive: true }, orderBy: { fullName: "asc" }, select: { id: true, fullName: true, mobile: true, branchId: true } @@ -100173,7 +100173,7 @@ var require_admin_documents_service = __commonJS({ orderBy, skip, take, - include: { customer: true, postedByAdminUser: true } + include: { customer: true, postedByAdmin: true } }), this.prisma.ledgerEntry.count({ where: scoped }) ]); @@ -100212,7 +100212,7 @@ var require_admin_documents_service = __commonJS({ lname: e.customer.lastName ?? "", mobile: e.customer.mobile }, - posted_by: e.postedByAdminUser ? e.postedByAdminUser.fullName : null, + posted_by: e.postedByAdmin ? e.postedByAdmin.fullName : null, caj: e.createdAt, uaj: e.createdAt }; @@ -100221,7 +100221,7 @@ var require_admin_documents_service = __commonJS({ async findOne(id) { const e = await this.prisma.ledgerEntry.findUnique({ where: { id }, - include: { customer: true, postedByAdminUser: true } + include: { customer: true, postedByAdmin: true } }); if (!e) throw new common_12.NotFoundException("\u0633\u0646\u062F \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); @@ -100250,7 +100250,7 @@ var require_admin_documents_service = __commonJS({ karatPerMille: data.ayar ? Number(data.ayar) : void 0, pricePerGramRial: data.price_per_gram ? String(data.price_per_gram) : void 0, note: data.note ?? void 0, - postedByAdminUserId: actorAdminUserId + postedByAdminId: actorAdminUserId }); await this.prisma.ledgerEntry.update({ where: { id: entry.id }, @@ -101292,7 +101292,7 @@ var require_admin_users_service = __commonJS({ caj: "createdAt", active: "isActive" }; - /** Legacy `GET users` — the admin user grid. */ + /** Legacy `GET users` — the admin user grid (panel staff only). */ async list(query) { this.table.assertNotExport(query); const mapField = (f) => f ? AdminUsersService_1.FIELD_ALIASES[f] ?? f : f; @@ -101319,14 +101319,14 @@ var require_admin_users_service = __commonJS({ AND: [where, { mobile: { not: super_admin_1.SUPER_ADMIN_MOBILE } }] }; const [rows, total] = await Promise.all([ - this.prisma.adminUser.findMany({ + this.prisma.admin.findMany({ where: visible, orderBy, skip, take, - include: { userType: true, branch: true, avatarFile: true } + include: { userType: true, branch: true } }), - this.prisma.adminUser.count({ where: visible }) + this.prisma.admin.count({ where: visible }) ]); return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); } @@ -101345,20 +101345,20 @@ var require_admin_users_service = __commonJS({ user_type: u.userType ? { id: u.userType.id, title: u.userType.title } : null, branch_id: u.branchId, branch: u.branch ? { id: u.branch.id, name: u.branch.name } : null, - percent: u.wagePercent, + percent: u.wagePercent ?? null, active: u.isActive ? 1 : -1, is_active: u.isActive, caj: u.createdAt, // Sales-agent fields (ReagentCustomer.vue) — set only for role=SALES_EXPERT, - // null for every other admin. Same shapes admin-customers.service.ts used + // null for every admin. Same shapes admin-customers.service.ts used // when this data still lived on Customer, so the form binds unchanged. - address: u.address, - store_name: u.storeName, - pasazh_name: u.pasazhName, - mcode: u.memberCode, - image_id: u.avatarFileId, + address: u.address ?? null, + store_name: u.storeName ?? null, + pasazh_name: u.pasazhName ?? null, + mcode: u.memberCode ?? null, + image_id: u.avatarFileId ?? null, image: u.avatarFile ? { id: u.avatarFile.id, image: u.avatarFile.url } : null, - // D17 — from SalesExpertProfile. Null for a non-expert, and null-safe for + // D17 — from SalesExpertProfile. Null for an admin, and null-safe for // an expert whose profile row is somehow missing. city_id: u.salesExpertProfile?.cityId ?? null, city: u.salesExpertProfile?.city ? { id: u.salesExpertProfile.city.id, title: u.salesExpertProfile.city.name } : null, @@ -101367,9 +101367,22 @@ var require_admin_users_service = __commonJS({ ncode: u.salesExpertProfile?.nationalCode ?? null }; } - async findOne(id) { - const u = await this.prisma.adminUser.findUnique({ + /** A panel admin by id, or null. The support super admin is never found. */ + async findAdmin(id) { + const admin = await this.prisma.admin.findUnique({ where: { id }, + include: { userType: true, branch: true } + }); + return admin && !(0, super_admin_1.isSuperAdmin)(admin.mobile) ? admin : null; + } + /** + * A sales expert by id, or null. `role` is part of the lookup on purpose: + * "AdminUser" still holds the pre-split copies of the admins (dormant), and + * those must never be reachable as experts either. + */ + async findExpert(id) { + const expert = await this.prisma.adminUser.findFirst({ + where: { id, role: client_1.AdminRole.SALES_EXPERT }, // D17 — the edit form needs the sales-expert fields too. include: { userType: true, @@ -101378,9 +101391,16 @@ var require_admin_users_service = __commonJS({ salesExpertProfile: { include: { city: true } } } }); - if (!u || (0, super_admin_1.isSuperAdmin)(u.mobile)) - throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); - return this.toRow(u); + return expert && !(0, super_admin_1.isSuperAdmin)(expert.mobile) ? expert : null; + } + async findOne(id) { + const admin = await this.findAdmin(id); + if (admin) + return this.toRow(admin); + const expert = await this.findExpert(id); + if (expert) + return this.toRow(expert); + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); } /** * Legacy `POST users`. @@ -101389,6 +101409,8 @@ var require_admin_users_service = __commonJS({ * caller omitted it, which silently turned every admin created without an * explicit role into a sales agent regardless of the access level ("نوع * کاربری") actually chosen. UserCreate.vue now always sends one. + * + * SALES_EXPERT goes to the `AdminUser` table, every other role to `Admin`. */ async create(data) { const firstName = String(data.fname ?? data.name ?? "").trim(); @@ -101405,6 +101427,31 @@ var require_admin_users_service = __commonJS({ throw new common_12.BadRequestException("\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); if (!role) throw new common_12.BadRequestException("\u0646\u0642\u0634 \u06A9\u0627\u0631\u0628\u0631 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + if (!Object.values(client_1.AdminRole).includes(role)) + throw new common_12.BadRequestException("\u0646\u0642\u0634 \u06A9\u0627\u0631\u0628\u0631 \u0645\u0639\u062A\u0628\u0631 \u0646\u06CC\u0633\u062A"); + if (role === client_1.AdminRole.SALES_EXPERT) { + return this.createExpert({ data, firstName, lastName, fullName, mobile, password }); + } + const existing = await this.prisma.admin.findUnique({ where: { mobile } }); + if (existing) + throw new common_12.BadRequestException("\u0627\u06CC\u0646 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0642\u0628\u0644\u0627\u064B \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A"); + return this.prisma.admin.create({ + data: { + fullName, + firstName: firstName || null, + lastName: lastName || null, + mobile, + passwordHash: await bcrypt.hash(password, 10), + role, + userTypeId: data.ut !== void 0 && data.ut !== null ? Number(data.ut) : null, + branchId: data.branch_id || null, + isActive: data.is_active !== void 0 ? Boolean(data.is_active) : true + }, + include: { userType: true, branch: true } + }); + } + async createExpert(input) { + const { data, firstName, lastName, fullName, mobile, password } = input; const existing = await this.prisma.adminUser.findUnique({ where: { mobile } }); if (existing) throw new common_12.BadRequestException("\u0627\u06CC\u0646 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0642\u0628\u0644\u0627\u064B \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A"); @@ -101415,13 +101462,12 @@ var require_admin_users_service = __commonJS({ lastName: lastName || null, mobile, passwordHash: await bcrypt.hash(password, 10), - role, + role: client_1.AdminRole.SALES_EXPERT, userTypeId: data.ut !== void 0 && data.ut !== null ? Number(data.ut) : null, branchId: data.branch_id || null, wagePercent: data.percent !== void 0 && data.percent !== null ? new client_1.Prisma.Decimal(String(data.percent)) : null, isActive: data.is_active !== void 0 ? Boolean(data.is_active) : true, - // Sales-agent-only fields (ReagentCustomer.vue); undefined for every - // other role, which Prisma leaves at column default (null). + // Sales-agent-only fields (ReagentCustomer.vue). address: data.address || null, storeName: data.store_name || null, pasazhName: data.pasazh_name || null, @@ -101429,7 +101475,7 @@ var require_admin_users_service = __commonJS({ avatarFileId: data.image_id || null, // D17 — a sales expert always gets its profile row, so the grid's city // and credit-limit columns have somewhere to read from immediately. - ...role === "SALES_EXPERT" ? { salesExpertProfile: { create: this.salesExpertProfileData(data) } } : {} + salesExpertProfile: { create: this.salesExpertProfileData(data) } }, include: { userType: true, @@ -101456,9 +101502,65 @@ var require_admin_users_service = __commonJS({ } /** Legacy `PUT users/{id}`. */ async update(id, data) { - const existing = await this.prisma.adminUser.findUnique({ where: { id } }); - if (!existing || (0, super_admin_1.isSuperAdmin)(existing.mobile)) - throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const admin = await this.findAdmin(id); + if (admin) + return this.updateAdmin(admin, data); + const expert = await this.findExpert(id); + if (expert) + return this.updateExpert(expert, data); + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + } + async updateAdmin(existing, data) { + const id = existing.id; + const patch = {}; + if (data.fname !== void 0 || data.lname !== void 0) { + const firstName = String(data.fname ?? existing.firstName ?? "").trim(); + const lastName = String(data.lname ?? existing.lastName ?? "").trim(); + patch.firstName = firstName || null; + patch.lastName = lastName || null; + } else if (data.name !== void 0) { + patch.fullName = String(data.name); + } + if (data.mobile !== void 0) { + const mobile = (0, digits_1.faToEn)(String(data.mobile)); + if (mobile !== existing.mobile) { + const clash = await this.prisma.admin.findUnique({ where: { mobile } }); + if (clash) + throw new common_12.BadRequestException("\u0627\u06CC\u0646 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0642\u0628\u0644\u0627\u064B \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A"); + } + patch.mobile = mobile; + } + if (data.password) + patch.passwordHash = await bcrypt.hash(String(data.password), 10); + if (data.role !== void 0) { + const role = data.role; + if (!Object.values(client_1.AdminRole).includes(role)) + throw new common_12.BadRequestException("\u0646\u0642\u0634 \u06A9\u0627\u0631\u0628\u0631 \u0645\u0639\u062A\u0628\u0631 \u0646\u06CC\u0633\u062A"); + if (role === client_1.AdminRole.SALES_EXPERT) { + throw new common_12.BadRequestException("\u0646\u0642\u0634 \u06A9\u0627\u0631\u0634\u0646\u0627\u0633 \u0641\u0631\u0648\u0634 \u0628\u0631\u0627\u06CC \u0627\u062F\u0645\u06CC\u0646 \u0642\u0627\u0628\u0644 \u062A\u0646\u0638\u06CC\u0645 \u0646\u06CC\u0633\u062A\u061B \u06A9\u0627\u0631\u0634\u0646\u0627\u0633 \u0631\u0627 \u0627\u0632 \u0628\u062E\u0634 \u06A9\u0627\u0631\u0634\u0646\u0627\u0633\u0627\u0646 \u0628\u0633\u0627\u0632\u06CC\u062F"); + } + patch.role = role; + } + if (data.ut !== void 0) { + patch.userType = data.ut ? { connect: { id: Number(data.ut) } } : { disconnect: true }; + } + if (data.branch_id !== void 0) { + patch.branch = data.branch_id ? { connect: { id: String(data.branch_id) } } : { disconnect: true }; + } + if (data.is_active !== void 0) + patch.isActive = Boolean(data.is_active); + const updated = await this.prisma.admin.update({ + where: { id }, + data: patch, + include: { userType: true, branch: true } + }); + if (patch.isActive === false || patch.passwordHash !== void 0) { + await this.sessions.revokeAllForAdmin(id, patch.isActive === false ? "account_disabled" : "password_changed"); + } + return updated; + } + async updateExpert(existing, data) { + const id = existing.id; const patch = {}; if (data.fname !== void 0 || data.lname !== void 0) { const firstName = String(data.fname ?? existing.firstName ?? "").trim(); @@ -101479,8 +101581,9 @@ var require_admin_users_service = __commonJS({ } if (data.password) patch.passwordHash = await bcrypt.hash(String(data.password), 10); - if (data.role !== void 0) - patch.role = data.role; + if (data.role !== void 0 && data.role !== client_1.AdminRole.SALES_EXPERT) { + throw new common_12.BadRequestException("\u0646\u0642\u0634 \u06A9\u0627\u0631\u0634\u0646\u0627\u0633 \u0641\u0631\u0648\u0634 \u0642\u0627\u0628\u0644 \u062A\u063A\u06CC\u06CC\u0631 \u0646\u06CC\u0633\u062A"); + } if (data.ut !== void 0) { patch.userType = data.ut ? { connect: { id: Number(data.ut) } } : { disconnect: true }; } @@ -101503,9 +101606,8 @@ var require_admin_users_service = __commonJS({ if (data.image_id !== void 0) { patch.avatarFile = data.image_id ? { connect: { id: String(data.image_id) } } : { disconnect: true }; } - const effectiveRole = patch.role ?? existing.role; const touchesProfile = data.city_id !== void 0 || data.gram_level !== void 0 || data.phone !== void 0 || data.ncode !== void 0; - if (effectiveRole === "SALES_EXPERT" && (touchesProfile || patch.role !== void 0)) { + if (touchesProfile) { const profile = this.salesExpertProfileData(data); patch.salesExpertProfile = { upsert: { @@ -101521,7 +101623,7 @@ var require_admin_users_service = __commonJS({ } }; } - const updated = await this.prisma.adminUser.update({ + return this.prisma.adminUser.update({ where: { id }, data: patch, include: { @@ -101531,10 +101633,6 @@ var require_admin_users_service = __commonJS({ salesExpertProfile: { include: { city: true } } } }); - if (patch.isActive === false || patch.passwordHash !== void 0) { - await this.sessions.revokeAllForAdmin(id, patch.isActive === false ? "account_disabled" : "password_changed"); - } - return updated; } /** * Legacy `DELETE users/{id}`. @@ -101544,21 +101642,28 @@ var require_admin_users_service = __commonJS({ * audit trail. Deactivation is offered instead. Legacy deleted regardless. */ async remove(id, actorId) { - const u = await this.prisma.adminUser.findUnique({ + const admin = await this.prisma.admin.findUnique({ where: { id }, include: { _count: { select: { postedLedgerEntries: true, orderStatusEvents: true } } } }); - if (!u || (0, super_admin_1.isSuperAdmin)(u.mobile)) + if (admin) { + if ((0, super_admin_1.isSuperAdmin)(admin.mobile)) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (id === actorId) { + throw new common_12.BadRequestException("\u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u062D\u0633\u0627\u0628 \u06A9\u0627\u0631\u0628\u0631\u06CC \u062E\u0648\u062F\u062A\u0627\u0646 \u0631\u0627 \u062D\u0630\u0641 \u06A9\u0646\u06CC\u062F"); + } + const refs = admin._count.postedLedgerEntries + admin._count.orderStatusEvents; + if (refs > 0) { + throw new common_12.BadRequestException(`\u062D\u0630\u0641 \u0627\u06CC\u0646 \u06A9\u0627\u0631\u0628\u0631 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 ${refs} \u0633\u0646\u062F \u06CC\u0627 \u062A\u063A\u06CC\u06CC\u0631 \u0648\u0636\u0639\u06CC\u062A \u0628\u0647 \u0646\u0627\u0645 \u0627\u0648 \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A. \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u063A\u06CC\u0631\u0641\u0639\u0627\u0644\u0634 \u06A9\u0646\u06CC\u062F.`); + } + await this.prisma.admin.delete({ where: { id } }); + return { success: true }; + } + const expert = await this.findExpert(id); + if (!expert) throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); - if (id === actorId) { - throw new common_12.BadRequestException("\u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u062D\u0633\u0627\u0628 \u06A9\u0627\u0631\u0628\u0631\u06CC \u062E\u0648\u062F\u062A\u0627\u0646 \u0631\u0627 \u062D\u0630\u0641 \u06A9\u0646\u06CC\u062F"); - } - const refs = u._count.postedLedgerEntries + u._count.orderStatusEvents; - if (refs > 0) { - throw new common_12.BadRequestException(`\u062D\u0630\u0641 \u0627\u06CC\u0646 \u06A9\u0627\u0631\u0628\u0631 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 ${refs} \u0633\u0646\u062F \u06CC\u0627 \u062A\u063A\u06CC\u06CC\u0631 \u0648\u0636\u0639\u06CC\u062A \u0628\u0647 \u0646\u0627\u0645 \u0627\u0648 \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A. \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u063A\u06CC\u0631\u0641\u0639\u0627\u0644\u0634 \u06A9\u0646\u06CC\u062F.`); - } await this.prisma.adminUser.delete({ where: { id } }); return { success: true }; } @@ -101567,12 +101672,12 @@ var require_admin_users_service = __commonJS({ async listUserTypes() { const rows = await this.prisma.userType.findMany({ orderBy: { id: "asc" }, - include: { _count: { select: { adminUsers: true, permissions: true } } } + include: { _count: { select: { admins: true, adminUsers: true, permissions: true } } } }); return rows.map((t) => ({ id: t.id, title: t.title, - users_count: t._count.adminUsers, + users_count: t._count.admins + t._count.adminUsers, permissions_count: t._count.permissions })); } @@ -101645,14 +101750,19 @@ var require_admin_users_service = __commonJS({ } /** Legacy `GET users/show` equivalent for the "اطلاعات من" screen. */ async myData(adminId) { - return this.findOne(adminId); + const admin = await this.findAdmin(adminId); + if (!admin) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(admin); } - /** The AdminRole picker for the user form. */ + /** + * The AdminRole picker for the staff form. SALES_EXPERT is not offered: an + * expert is a different table and is created from the reagent form. + */ roleOptions() { return [ { value: client_1.AdminRole.SUPER_ADMIN, title: "\u0645\u062F\u06CC\u0631 \u0627\u0631\u0634\u062F" }, { value: client_1.AdminRole.SYSTEM_APPROVER, title: "\u062A\u0627\u06CC\u06CC\u062F \u0645\u062F\u06CC\u0631 \u0633\u06CC\u0633\u062A\u0645" }, - { value: client_1.AdminRole.SALES_EXPERT, title: "\u06A9\u0627\u0631\u0634\u0646\u0627\u0633 \u0641\u0631\u0648\u0634" }, { value: client_1.AdminRole.WORKSHOP_SUPERVISOR, title: "\u0633\u0631\u067E\u0631\u0633\u062A \u06A9\u0627\u0631\u06AF\u0627\u0647" }, { value: client_1.AdminRole.ACCOUNTANT, title: "\u062D\u0633\u0627\u0628\u062F\u0627\u0631" } ]; @@ -101915,7 +102025,7 @@ var require_admin_invoices_service = __commonJS({ "createdAt", "branchId", "branch.name", - "allocatorAdminUser.fullName", + "allocatorAdmin.fullName", // legacy filter keys "name", "caj" @@ -101923,7 +102033,7 @@ var require_admin_invoices_service = __commonJS({ static FIELD_ALIASES = { name: "branch.name", caj: "createdAt", - "allocator_user.name": "allocatorAdminUser.fullName" + "allocator_user.name": "allocatorAdmin.fullName" }; /** Legacy `POST branch/product/table`. */ async list(query) { @@ -101947,7 +102057,7 @@ var require_admin_invoices_service = __commonJS({ take, include: { branch: true, - allocatorAdminUser: true, + allocatorAdmin: true, items: { include: { product: true } } } }), @@ -101966,7 +102076,7 @@ var require_admin_invoices_service = __commonJS({ sum_weight: sumWeight, count_item: a.items.length, note: a.note, - allocator_user: a.allocatorAdminUser ? { id: a.allocatorAdminUser.id, name: a.allocatorAdminUser.fullName } : null, + allocator_user: a.allocatorAdmin ? { id: a.allocatorAdmin.id, name: a.allocatorAdmin.fullName } : null, caj: a.createdAt, products: a.items.map((it) => ({ id: it.productId, @@ -101983,7 +102093,7 @@ var require_admin_invoices_service = __commonJS({ where: { id }, include: { branch: true, - allocatorAdminUser: true, + allocatorAdmin: true, items: { include: { product: true } } } }); @@ -102017,7 +102127,7 @@ var require_admin_invoices_service = __commonJS({ const allocation = await this.prisma.branchAllocation.create({ data: { branchId, - allocatorAdminUserId: actorId, + allocatorAdminId: actorId, note: data.note ?? null, items: { create: products.map((p) => ({ @@ -102446,7 +102556,7 @@ var require_admin_misc_service = __commonJS({ orderBy, skip, take, - include: { sentByAdminUser: true } + include: { sentByAdmin: true } }), this.prisma.smsMessage.count({ where }) ]); @@ -102456,7 +102566,7 @@ var require_admin_misc_service = __commonJS({ text: s.body, mobile: s.recipients, sent_count: s.sentCount, - sender: s.sentByAdminUser?.fullName ?? null, + sender: s.sentByAdmin?.fullName ?? null, caj: s.createdAt })), total, query, page, limit); } @@ -102483,7 +102593,7 @@ var require_admin_misc_service = __commonJS({ recipients: recipients.join(","), body, sentCount: recipients.length, - sentByAdminUserId: actorId + sentByAdminId: actorId } }); } @@ -102566,7 +102676,7 @@ var require_admin_misc_service = __commonJS({ title, body, audience, - sentByAdminUserId: actorId, + sentByAdminId: actorId, recipients: { create: customers.map((c) => ({ customerId: c.id })) } }, include: { _count: { select: { recipients: true } } } @@ -102589,7 +102699,7 @@ var require_admin_misc_service = __commonJS({ title, body, audience: client_1.MessageAudience.SINGLE_NUMBER, - sentByAdminUserId: actorId, + sentByAdminId: actorId, recipients: { create: [{ customerId }] } } }); @@ -102599,7 +102709,7 @@ var require_admin_misc_service = __commonJS({ const n = await this.prisma.notification.findUnique({ where: { id }, include: { - sentByAdminUser: true, + sentByAdmin: true, recipients: { include: { customer: true } } } }); @@ -102611,7 +102721,7 @@ var require_admin_misc_service = __commonJS({ body: n.body, text: n.body, audience: n.audience, - sender: n.sentByAdminUser?.fullName ?? null, + sender: n.sentByAdmin?.fullName ?? null, caj: n.createdAt, recipients: n.recipients.map((r) => ({ id: r.id, @@ -102638,7 +102748,7 @@ var require_admin_misc_service = __commonJS({ skip, take, include: { - sentByAdminUser: true, + sentByAdmin: true, _count: { select: { recipients: true } } } }), @@ -102649,7 +102759,7 @@ var require_admin_misc_service = __commonJS({ title: n.title, text: n.body, audience: n.audience, - sender: n.sentByAdminUser?.fullName ?? null, + sender: n.sentByAdmin?.fullName ?? null, total_count: n._count.recipients, caj: n.createdAt })), total, query, page, limit); diff --git a/apps/api/release/migrations/20261026120000_split_admin_table/migration.sql b/apps/api/release/migrations/20261026120000_split_admin_table/migration.sql new file mode 100644 index 0000000..88a0a6c --- /dev/null +++ b/apps/api/release/migrations/20261026120000_split_admin_table/migration.sql @@ -0,0 +1,167 @@ +-- Split panel staff out of "AdminUser" into their own table, "Admin". +-- +-- WHY +-- --- +-- "AdminUser" held two unrelated kinds of person: panel staff and sales +-- experts (role SALES_EXPERT). Because the mobile is unique per table, one +-- number could not be both an admin and an expert. Staff belong to the ADMIN +-- PANEL only; experts belong to the apps. They are now separate tables, each +-- unique on its own. +-- +-- SAFETY — READ BEFORE RUNNING ON PRODUCTION +-- ------------------------------------------ +-- This migration NEVER modifies, deletes or locks "AdminUser" (the sales-expert +-- table; ~12,000 rows in production). It only +-- 1. creates "Admin" and its indexes/foreign keys, +-- 2. COPIES the non-expert rows from "AdminUser" into it, keeping their ids, +-- 3. re-points the "who did this" foreign keys from "AdminUser" to "Admin". +-- +-- * Ids are preserved, so every issued panel token (its `sub` is the id) and +-- every existing ledger / status / SMS / upload row keeps resolving. +-- * The old non-expert rows are LEFT in "AdminUser", dormant. The code no +-- longer reads them as admins. Remove them later, in a separate release, only +-- once the split has been verified. +-- * Re-runnable: every statement is guarded (IF NOT EXISTS / ON CONFLICT / drop +-- then add), so a half-applied run can simply be run again. +-- * No data is moved on the big tables (LedgerEntry, OrderStatusEvent, …): +-- the existing columns keep their names and values; only the constraint's +-- target changes. +-- +-- The re-pointed foreign keys are added NOT VALID (checked for new/changed rows +-- immediately, existing rows not scanned under a heavy lock) and then validated +-- at the end. A row that references an id that is not an admin — only possible +-- if a sales expert once appears as an actor — leaves that one constraint +-- NOT VALID and prints a NOTICE instead of failing the deploy. See +-- docs/ADMIN-TABLE-SPLIT.md for the check query. +-- +-- ROLLBACK: deploy the previous code. Nothing was deleted, so the old code +-- still finds every admin in "AdminUser". Admins created AFTER the split exist +-- only in "Admin" and would need re-creating in the old system. + +-- ── 1. The table ─────────────────────────────────────────────────────────── + +CREATE TABLE IF NOT EXISTS "Admin" ( + "id" TEXT NOT NULL, + "fullName" TEXT NOT NULL, + "firstName" TEXT, + "lastName" TEXT, + "mobile" TEXT NOT NULL, + "passwordHash" TEXT NOT NULL, + "role" "AdminRole" NOT NULL, + "userTypeId" INTEGER, + "branchId" TEXT, + "isActive" BOOLEAN NOT NULL DEFAULT true, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Admin_pkey" PRIMARY KEY ("id") +); + +CREATE UNIQUE INDEX IF NOT EXISTS "Admin_mobile_key" ON "Admin" ("mobile"); +CREATE INDEX IF NOT EXISTS "Admin_role_idx" ON "Admin" ("role"); +CREATE INDEX IF NOT EXISTS "Admin_userTypeId_idx" ON "Admin" ("userTypeId"); +CREATE INDEX IF NOT EXISTS "Admin_firstName_idx" ON "Admin" ("firstName"); +CREATE INDEX IF NOT EXISTS "Admin_lastName_idx" ON "Admin" ("lastName"); + +DO $$ BEGIN + ALTER TABLE "Admin" ADD CONSTRAINT "Admin_userTypeId_fkey" + FOREIGN KEY ("userTypeId") REFERENCES "user_type"("id") ON DELETE SET NULL ON UPDATE CASCADE; +EXCEPTION WHEN duplicate_object THEN NULL; END $$; + +DO $$ BEGIN + ALTER TABLE "Admin" ADD CONSTRAINT "Admin_branchId_fkey" + FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE SET NULL ON UPDATE CASCADE; +EXCEPTION WHEN duplicate_object THEN NULL; END $$; + +-- ── 2. Copy the staff (everyone who is not a sales expert), ids preserved ── +-- +-- Done BEFORE the name-sync trigger exists, so the stored names are copied +-- exactly as they are rather than rebuilt. + +INSERT INTO "Admin" + ("id", "fullName", "firstName", "lastName", "mobile", "passwordHash", + "role", "userTypeId", "branchId", "isActive", "createdAt") +SELECT + "id", "fullName", "firstName", "lastName", "mobile", "passwordHash", + "role", "userTypeId", "branchId", "isActive", "createdAt" +FROM "AdminUser" +WHERE "role" <> 'SALES_EXPERT' +ON CONFLICT ("id") DO NOTHING; + +-- Same two-way fullName <-> firstName/lastName sync as AdminUser, sharing its +-- function (created in 20260922180000_sales_expert_profile_and_admin_name_parts). +DROP TRIGGER IF EXISTS admin_sync_full_name_trg ON "Admin"; +CREATE TRIGGER admin_sync_full_name_trg + BEFORE INSERT OR UPDATE ON "Admin" + FOR EACH ROW EXECUTE FUNCTION admin_user_sync_full_name(); + +-- ── 3. Re-point the foreign keys that mean "an admin did this" ───────────── +-- +-- Same constraint names, same column names, same ON DELETE / ON UPDATE actions; +-- only the referenced table changes. "Order"."salesAgentId", +-- "Customer"."referredByAgentId" and "SalesExpertProfile"."adminUserId" are +-- about SALES EXPERTS and keep pointing at "AdminUser". + +ALTER TABLE "Workshop" DROP CONSTRAINT IF EXISTS "Workshop_supervisorId_fkey"; +ALTER TABLE "Workshop" ADD CONSTRAINT "Workshop_supervisorId_fkey" + FOREIGN KEY ("supervisorId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +ALTER TABLE "OrderStatusEvent" DROP CONSTRAINT IF EXISTS "OrderStatusEvent_actorAdminUserId_fkey"; +ALTER TABLE "OrderStatusEvent" ADD CONSTRAINT "OrderStatusEvent_actorAdminUserId_fkey" + FOREIGN KEY ("actorAdminUserId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +ALTER TABLE "PreOrderStatusEvent" DROP CONSTRAINT IF EXISTS "PreOrderStatusEvent_actorAdminUserId_fkey"; +ALTER TABLE "PreOrderStatusEvent" ADD CONSTRAINT "PreOrderStatusEvent_actorAdminUserId_fkey" + FOREIGN KEY ("actorAdminUserId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +ALTER TABLE "LedgerEntry" DROP CONSTRAINT IF EXISTS "LedgerEntry_postedByAdminUserId_fkey"; +ALTER TABLE "LedgerEntry" ADD CONSTRAINT "LedgerEntry_postedByAdminUserId_fkey" + FOREIGN KEY ("postedByAdminUserId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +ALTER TABLE "BranchAllocation" DROP CONSTRAINT IF EXISTS "BranchAllocation_allocatorAdminUserId_fkey"; +ALTER TABLE "BranchAllocation" ADD CONSTRAINT "BranchAllocation_allocatorAdminUserId_fkey" + FOREIGN KEY ("allocatorAdminUserId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +ALTER TABLE "SmsMessage" DROP CONSTRAINT IF EXISTS "SmsMessage_sentByAdminUserId_fkey"; +ALTER TABLE "SmsMessage" ADD CONSTRAINT "SmsMessage_sentByAdminUserId_fkey" + FOREIGN KEY ("sentByAdminUserId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +ALTER TABLE "Notification" DROP CONSTRAINT IF EXISTS "Notification_sentByAdminUserId_fkey"; +ALTER TABLE "Notification" ADD CONSTRAINT "Notification_sentByAdminUserId_fkey" + FOREIGN KEY ("sentByAdminUserId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +ALTER TABLE "UploadedFile" DROP CONSTRAINT IF EXISTS "UploadedFile_uploadedByAdminUserId_fkey"; +ALTER TABLE "UploadedFile" ADD CONSTRAINT "UploadedFile_uploadedByAdminUserId_fkey" + FOREIGN KEY ("uploadedByAdminUserId") REFERENCES "Admin"("id") ON DELETE SET NULL ON UPDATE CASCADE NOT VALID; + +-- Panel tokens are issued to staff only. CASCADE as before: deleting an admin +-- ends their sessions. +ALTER TABLE "AdminSession" DROP CONSTRAINT IF EXISTS "AdminSession_adminUserId_fkey"; +ALTER TABLE "AdminSession" ADD CONSTRAINT "AdminSession_adminUserId_fkey" + FOREIGN KEY ("adminUserId") REFERENCES "Admin"("id") ON DELETE CASCADE ON UPDATE CASCADE NOT VALID; + +-- ── 4. Validate; never fail the deploy over an old orphan ────────────────── + +DO $$ +DECLARE + c record; +BEGIN + FOR c IN + SELECT * FROM (VALUES + ('Workshop', 'Workshop_supervisorId_fkey'), + ('OrderStatusEvent', 'OrderStatusEvent_actorAdminUserId_fkey'), + ('PreOrderStatusEvent', 'PreOrderStatusEvent_actorAdminUserId_fkey'), + ('LedgerEntry', 'LedgerEntry_postedByAdminUserId_fkey'), + ('BranchAllocation', 'BranchAllocation_allocatorAdminUserId_fkey'), + ('SmsMessage', 'SmsMessage_sentByAdminUserId_fkey'), + ('Notification', 'Notification_sentByAdminUserId_fkey'), + ('UploadedFile', 'UploadedFile_uploadedByAdminUserId_fkey'), + ('AdminSession', 'AdminSession_adminUserId_fkey') + ) AS t(tbl, con) + LOOP + BEGIN + EXECUTE format('ALTER TABLE %I VALIDATE CONSTRAINT %I', c.tbl, c.con); + EXCEPTION WHEN foreign_key_violation THEN + RAISE NOTICE '% on % left NOT VALID: some existing rows reference an id that is not in "Admin" (see docs/ADMIN-TABLE-SPLIT.md)', c.con, c.tbl; + END; + END LOOP; +END $$; diff --git a/apps/api/release/seed.js b/apps/api/release/seed.js index ae050d0..6df1a32 100644 --- a/apps/api/release/seed.js +++ b/apps/api/release/seed.js @@ -1846,7 +1846,7 @@ async function main() { update: {}, create: { id: "workshop-central", name: "\u06A9\u0627\u0631\u06AF\u0627\u0647 \u0645\u0631\u06A9\u0632\u06CC \u0633\u0627\u062E\u062A \u0637\u0644\u0627" } }); - await prisma.adminUser.upsert({ + await prisma.admin.upsert({ where: { mobile: DEV_TEST_PHONE }, update: { passwordHash: DEV_TEST_PHONE_PASSWORD_HASH, userTypeId: 85, branchId: null }, create: { @@ -1858,7 +1858,7 @@ async function main() { branchId: null } }); - await prisma.adminUser.upsert({ + await prisma.admin.upsert({ where: { mobile: "09120000001" }, update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 85, branchId: null }, create: { @@ -1899,7 +1899,7 @@ async function main() { wagePercent: 1.2 } }); - await prisma.adminUser.upsert({ + await prisma.admin.upsert({ where: { mobile: "09123334444" }, update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 88 }, create: { @@ -1910,7 +1910,7 @@ async function main() { userTypeId: 88 } }); - await prisma.adminUser.upsert({ + await prisma.admin.upsert({ where: { mobile: "09125556666" }, update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 87, branchId: null }, create: { diff --git a/apps/api/release/vendor/.prisma/client/edge.js b/apps/api/release/vendor/.prisma/client/edge.js index f5fe6d2..d04709f 100644 --- a/apps/api/release/vendor/.prisma/client/edge.js +++ b/apps/api/release/vendor/.prisma/client/edge.js @@ -98,6 +98,20 @@ exports.Prisma.CityScalarFieldEnum = { percentAux: 'percentAux' }; +exports.Prisma.AdminScalarFieldEnum = { + id: 'id', + fullName: 'fullName', + firstName: 'firstName', + lastName: 'lastName', + mobile: 'mobile', + passwordHash: 'passwordHash', + role: 'role', + userTypeId: 'userTypeId', + branchId: 'branchId', + isActive: 'isActive', + createdAt: 'createdAt' +}; + exports.Prisma.AdminUserScalarFieldEnum = { id: 'id', fullName: 'fullName', @@ -138,7 +152,7 @@ exports.Prisma.AppSessionScalarFieldEnum = { exports.Prisma.AdminSessionScalarFieldEnum = { id: 'id', jti: 'jti', - adminUserId: 'adminUserId', + adminId: 'adminId', iamSessionId: 'iamSessionId', iamSub: 'iamSub', ipAddress: 'ipAddress', @@ -338,7 +352,7 @@ exports.Prisma.OrderStatusEventScalarFieldEnum = { fromStatus: 'fromStatus', toStatus: 'toStatus', note: 'note', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', createdAt: 'createdAt' }; @@ -365,7 +379,7 @@ exports.Prisma.PreOrderStatusEventScalarFieldEnum = { id: 'id', preOrderId: 'preOrderId', changes: 'changes', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', ipAddress: 'ipAddress', createdAt: 'createdAt' }; @@ -382,7 +396,7 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { orderId: 'orderId', confirmed: 'confirmed', confirmedAt: 'confirmedAt', - postedByAdminUserId: 'postedByAdminUserId', + postedByAdminId: 'postedByAdminId', labName: 'labName', hallmark: 'hallmark', accountName: 'accountName', @@ -517,7 +531,7 @@ exports.Prisma.PromotionExclusionScalarFieldEnum = { exports.Prisma.BranchAllocationScalarFieldEnum = { id: 'id', branchId: 'branchId', - allocatorAdminUserId: 'allocatorAdminUserId', + allocatorAdminId: 'allocatorAdminId', note: 'note', createdAt: 'createdAt' }; @@ -535,7 +549,7 @@ exports.Prisma.SmsMessageScalarFieldEnum = { recipients: 'recipients', body: 'body', sentCount: 'sentCount', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -544,7 +558,7 @@ exports.Prisma.NotificationScalarFieldEnum = { title: 'title', body: 'body', audience: 'audience', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -577,7 +591,7 @@ exports.Prisma.UploadedFileScalarFieldEnum = { mimeType: 'mimeType', sizeBytes: 'sizeBytes', purpose: 'purpose', - uploadedByAdminUserId: 'uploadedByAdminUserId', + uploadedByAdminId: 'uploadedByAdminId', createdAt: 'createdAt' }; @@ -750,6 +764,7 @@ exports.MessageAudience = exports.$Enums.MessageAudience = { exports.Prisma.ModelName = { City: 'City', + Admin: 'Admin', AdminUser: 'AdminUser', AppSession: 'AppSession', AdminSession: 'AdminSession', @@ -844,13 +859,13 @@ const config = { } } }, - "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\n/// Legacy Customer.type — what kind of wholesale customer this is. Values and\n/// labels taken verbatim from bulkCustomer.vue's userTypes list.\n///\n/// SALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\n/// Customer row with type=1, but the redesigned system models a sales agent\n/// as an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\n/// and admin-customers.service.ts's listReagents()/create(). No Customer row\n/// should be created with kind SALES_AGENT going forward; the value is kept\n/// only so legacyTypeToKind()/kindToLegacyType() stay total functions and any\n/// already-migrated data keeps a readable label.\n///\n/// RETAIL marks a \"تک\" (single/retail) customer — legacy kept these in an\n/// entirely separate table (SingleCustomer/`login`) that could never contain\n/// a wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\n/// into one Customer model, so this value is what listSingle() now filters on\n/// to reproduce that same separation.\nenum CustomerKind {\n SALES_AGENT // legacy 1 کارشناس فروش — superseded by AdminRole.SALES_EXPERT, do not use for new rows\n APP_SHOPKEEPER // 2 مغازه دار اپلیکیشن\n WALK_IN_SHOPKEEPER // 3 مغازه دار حضوری\n BANKER // 4 بنکدار\n WORKSHOP_SUPERVISOR // 5 سرپرست کارگاه\n RETAIL // مشتری تک — legacy SingleCustomer\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n\n /// Legacy had THREE states per step, not two\n /// (MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\n /// 3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\n /// cases back in the review queue, so the owner ruled it out (2026-10-07).\n /// 14 legacy rows land here; see Customer.verificationRejectionReason.\n REJECTED\n}\n\n/// Legacy kept retail and wholesale orders in two SEPARATE tables\n/// (orders_orders vs orders). The redesigned schema has one Order model, so the\n/// distinction lives here instead.\nenum OrderChannel {\n RETAIL // تک فروشی\n WHOLESALE // عمده فروشی\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy `cities` is a tree (country > province > city > district) and so is\n/// this: a city hangs under its `parent`. In the admin pickers a top-level row\n/// (the country) is a heading, not selectable (henza_admin citiesModel.js:38).\nmodel City {\n id String @id @default(cuid())\n name String\n parentId String?\n parent City? @relation(\"CityTree\", fields: [parentId], references: [id], onDelete: Restrict)\n children City[] @relation(\"CityTree\")\n /// Legacy cities.percent / percent_aux — per-city wage surcharges the city\n /// screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\n percent Decimal? @db.Decimal(6, 3)\n percentAux Decimal? @db.Decimal(6, 3)\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n salesExpertProfiles SalesExpertProfile[]\n\n @@index([parentId])\n}\n\nmodel AdminUser {\n id String @id @default(cuid())\n\n /// ⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\n /// migration 20260922180000. Prisma cannot see it, so a write here may store\n /// something other than what you passed:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; the submitted fullName is\n /// discarded\n ///\n /// Re-read after writing if you need the stored value. Same arrangement as\n /// Customer (D0 requirement 7 — the split applies to ALL admins, not only\n /// sales experts).\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n passwordHash String\n role AdminRole\n /// Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\n /// the coarse `role` enum above is retained for the business rules that already\n /// switch on it. Nullable so existing seeded admins remain valid.\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Legacy stored a sales agent as a `customers` row with type=1, so\n /// ReagentCustomer.vue's shared form collected these alongside the\n /// wholesale-customer fields. A sales agent is now an AdminUser\n /// (role=SALES_EXPERT), so these live here instead — only ever set for that\n /// role; every other AdminUser leaves them null.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"AdminUserAvatar\", fields: [avatarFileId], references: [id])\n address String?\n storeName String? // legacy store_name\n pasazhName String? // legacy pasazh_name\n memberCode String? // legacy mcode\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n /// Orders credited to this sales expert — see Order.salesAgentId.\n creditedOrders Order[] @relation(\"OrderSalesAgent\")\n supervisedWorkshops Workshop[] @relation(\"WorkshopSupervisor\")\n branchAllocations BranchAllocation[] @relation(\"AllocationAuthor\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n sentSmsMessages SmsMessage[] @relation(\"SmsAuthor\")\n sentNotifications Notification[] @relation(\"NotificationAuthor\")\n uploadedFiles UploadedFile[] @relation(\"FileUploader\")\n\n /// Only ever set for role = SALES_EXPERT (D17).\n salesExpertProfile SalesExpertProfile?\n\n /// Issued admin-panel tokens, recorded only while session tracking is on\n /// (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\n /// token can be revoked before it expires. See AdminSession.\n sessions AdminSession[]\n\n @@index([role])\n @@index([userTypeId])\n @@index([avatarFileId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// An issued APP token (customer app / sales-expert app), so it can be revoked\n/// before it expires — the counterpart of AdminSession for the other token family.\n///\n/// WHY A SEPARATE TABLE AND NO FOREIGN KEY\n/// ---------------------------------------\n/// An app token's `sub` is a Customer id for a customer and an **AdminUser id**\n/// for a sales expert (D21). One FK cannot point at two tables, so the subject is\n/// stored as a plain id plus its type. The rows are short-lived operational data,\n/// not part of the accounting model, so the missing FK costs nothing here.\nmodel AppSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n /// Customer.id, or AdminUser.id when subjectType is \"sales-expert\".\n subjectId String\n subjectType String\n\n mobile String?\n\n /// Set when the login was confirmed by the central IAM: its session id (`sid`)\n /// and stable user id (`sub`), which is what a back-channel logout arrives with.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([subjectId])\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// An issued admin-panel JWT, so it can be revoked before it expires.\n///\n/// WHY THIS EXISTS\n/// ---------------\n/// The admin token is self-contained and valid for 12h, which means nothing —\n/// not disabling the account, not a central \"sign out everywhere\" — could cut a\n/// session short: the token kept working until it expired. With the central IAM\n/// in the loop that gap became visible (an IAM session revocation had no effect\n/// here), so every issued token now carries a `jti` recorded on this table and\n/// JwtStrategy refuses a token whose row is revoked.\n///\n/// Rows are written ONLY while tracking is enabled, and JwtStrategy only\n/// enforces them while it is enabled, so a deployment that does not want the\n/// extra lookup behaves exactly as before.\nmodel AdminSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n adminUserId String\n adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade)\n\n /// Set when the login was verified by the IAM: its session id (`sid`) and the\n /// stable user id (`sub`) there. Back-channel logout arrives keyed by these —\n /// deliberately here rather than as columns on AdminUser, so enabling the\n /// feature needs no change to an existing table.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([adminUserId])\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// The sales-expert fields legacy kept on the `customers` row (type=1) and that\n/// were lost when a sales expert became an AdminUser (D17).\n///\n/// A separate table rather than columns on AdminUser: these are meaningful only\n/// for role = SALES_EXPERT and would be permanently null for every other admin.\n/// A row is created for every SALES_EXPERT by the migration, and upserted by the\n/// service whenever one is created or a user's role becomes SALES_EXPERT — but\n/// readers still left-join, so a missing profile degrades to nulls rather than\n/// dropping the agent from the grid.\n///\n/// `reagent_id` is deliberately NOT here — see D17: in the reference it was a\n/// side effect of the shared customers form, and filling it removed that expert\n/// from the selectable-agent list (queryReagent, AdminController.php:420).\nmodel SalesExpertProfile {\n id String @id @default(cuid())\n adminUserId String @unique\n adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade)\n\n /// Legacy customers.city_id — a filterable grid column\n /// (ReagentListModel.js:14) and the source of the commission autofill\n /// (ReagentCustomer.vue:215-228).\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\n /// Decimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\n /// credit limit has identical precision on both tables.\n gramLevel Decimal @default(0) @db.Decimal(14, 4)\n\n /// Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\n /// stores both and reads neither back; kept so the form matches it. Neither\n /// is unique and neither has a validation rule in the reference — inventing\n /// one would reject data the reference accepts.\n phone String? @db.VarChar(15)\n nationalCode String? @db.VarChar(20)\n\n /// The Customer row carrying this expert's OWN orders, debt and credit limit.\n ///\n /// The reference stored a sales agent AS a Customer (type=1), so an order the\n /// agent placed from the app was simply their own, against their own\n /// gram_level (ApiMobileController.php:534-535). Here the expert is an\n /// AdminUser (D17), which has no ledger and cannot be an Order's subject, so\n /// this one linked Customer plays that part.\n ///\n /// Distinct from the expert's REFERRED customers, which are ordinary Customer\n /// rows pointing at the AdminUser through Customer.referredByAgentId.\n ///\n /// Null until the expert first signs into the app, when it is created from\n /// this profile. See D21.\n tradingCustomerId String? @unique\n tradingCustomer Customer? @relation(\"SalesExpertTradingAccount\", fields: [tradingCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now()) @updatedAt\n\n @@index([cityId])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n\n /// ⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\n /// TRIGGER — `customer_sync_full_name`, created in migration\n /// 20260922120000_customer_name_parts. Prisma does not know about it, so a\n /// write here is NOT the whole story:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; fullName is overwritten\n /// with \"first last\" and whatever you passed for fullName is discarded\n ///\n /// So a value you wrote can differ from the value that lands in the row.\n /// Re-read after writing if you need the stored value. Prefer writing the\n /// parts; `fullName` exists for the legacy readers that predate D0.\n ///\n /// Reference has these as two columns from the start\n /// (henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\n /// the port collapsed them, which is the D0 defect.\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n /// Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\n /// legacy customers has a national code (1595/1595 empty), and fabricating\n /// one is a data violation that would block later legal identity checks\n /// (owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\n /// the migration tool must write NULL and never '', which would collide on\n /// the second row.\n ///\n /// Three service-layer workarounds exist ONLY because this used to be\n /// required, and they store the MOBILE NUMBER here:\n /// admin-customers.service.ts:625,685 and customer-auth.service.ts:258.\n /// Retiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\n nationalCode String? @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.new_city — the city name exactly as the customer typed it\n /// at app sign-up (Major/CustomerController.php:36). Kept verbatim because\n /// the legacy city table has only 15 rows, so the typed name is often the only\n /// record of where the customer is (172 customers; 43 match no known city).\n /// cityId is set alongside it only on an exact, ي/ك-normalised name match.\n /// Legacy sign-up also forced city_id = 5 (Tehran) on everyone\n /// (Major/CustomerController.php:21), so for those rows the typed name, not\n /// cityId, is the truth. Owner ruling 2026-10-07: keep both.\n cityNameRaw String?\n\n /// Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\n /// BankerList / ShopkeeperList screens filter on.\n kind CustomerKind @default(APP_SHOPKEEPER)\n\n /// Legacy contact + shop columns, shown on the wholesale customer form and as\n /// (hidden-by-default) columns in its grid.\n phone String?\n address String?\n storeName String?\n pasazhName String?\n zone String?\n /// Legacy mcode — the operator-assigned customer code.\n memberCode String?\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n /// Set only on the one Customer row that acts as a sales expert's own trading\n /// account (see SalesExpertProfile.tradingCustomerId). Empty for every\n /// ordinary customer.\n salesExpertTradingFor SalesExpertProfile? @relation(\"SalesExpertTradingAccount\")\n /// Legacy orders that named THIS customer as their referrer — see\n /// Order.referrerCustomerId. History only.\n referredOrders Order[] @relation(\"OrderReferrerCustomer\")\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n /// Balance as last read from the accounting software (D27), in the app's own\n /// sign convention (positive = owes). Shown to the customer when the\n /// integration is on; the credit-limit check still uses goldDebtGrams above.\n /// Null until the first successful sync.\n accountingGoldBalance Decimal? @db.Decimal(14, 4)\n accountingRialBalance Decimal? @db.Decimal(20, 2)\n accountingBalanceAt DateTime?\n\n /// Legacy `customers.percent` — the per-customer making-charge offset. It is\n /// ADDED to the variant's making charge when pricing an order line\n /// (henza_pwa src/Mixins/product/index.ts:69-75:\n /// getWage(v) = state.percent + v.percentage_pay)\n /// and it shifts the catalogue making-charge filter bounds\n /// (ApiMobileController.php:391-396,76-77). It is NOT part of the price\n /// formula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\n ///\n /// NOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\n /// NOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\n ///\n /// DB default 0 keeps every existing customer's price unchanged. The\n /// reference's application-layer default for NEW customers is 3\n /// (AdminController.php:338) and the field is required on create (:354).\n makingChargeOffsetPercent Decimal @default(0) @db.Decimal(6, 3)\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n /// Why verification was rejected (VerificationStep.REJECTED).\n ///\n /// Legacy recorded NO reason: none of its 49 `customers` columns is a\n /// reason/note field, and on rejection it only sent a fixed SMS. So the 14\n /// rows migrated from the legacy system carry the sentinel\n /// «رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\n /// knows why it is blank (owner ruling 2026-10-07). The migration tool\n /// writes it only WHERE this IS NULL, so a re-run cannot overwrite a real\n /// reason entered in the new system.\n verificationRejectionReason String?\n\n /// NULL for rows migrated from the legacy system — it recorded no rejection time.\n verificationRejectedAt DateTime?\n\n /// Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\n /// birthday SMS / loyalty campaigns (owner ruling 2026-10-07).\n ///\n /// ⚠ Legacy stores dates as JALALI STRINGS in other tables\n /// (cashes.recive_date is varchar, 88/89 values starting \"14…\"), so this\n /// timestamp may hold mis-entered Jalali years. Confirm the calendar with\n /// docs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\n /// would produce 917 wrong birthdays, worse for an SMS campaign than none.\n birthDate DateTime?\n\n /// Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\n /// form. Legacy stored an FK to its Image table and read it back as a nested\n /// `image: { id, image }`, so this is a relation, not a bare URL string.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"CustomerAvatar\", fields: [avatarFileId], references: [id])\n\n /// Legacy had TWO independent switches on a customer:\n /// sts -> may they place orders (this field)\n /// active -> is the account enabled (isActive, below)\n /// The port previously drove both from isActive; they are separate again.\n canPlaceOrders Boolean @default(true)\n\n isActive Boolean @default(true)\n /// Legacy archive flag — the archived list filtered on this, not on isActive.\n isArchived Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n comments Comment[]\n promotions Promotion[]\n notifications NotificationRecipient[]\n activityLogs CustomerActivityLog[]\n otpChallenges CustomerOtp[]\n favorites CustomerFavorite[]\n\n @@index([referredByAgentId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// Legacy `fav` (251 rows) — saved products. The target had no model for this,\n/// so every customer's favourites would have been lost in the migration; the\n/// owner confirmed on 2026-10-06 that they matter.\n///\n/// Legacy `fav` has two columns and NO primary key. The composite key here\n/// supplies the constraint the source lacks (the precheck found 0 duplicate\n/// pairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\n/// at a deleted customer and must be skipped.\n///\n/// Legacy's denormalised `product.count_fav` counter is deliberately NOT\n/// recreated as a column — derive it from this table.\nmodel CustomerFavorite {\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n\n @@id([customerId, productId])\n @@index([productId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n /// Legacy Branch.address / phone — both are columns in the branch grid.\n address String?\n phone String?\n /// Legacy GET branch/active/{id} toggles this.\n isActive Boolean @default(true)\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n orders Order[]\n allocations BranchAllocation[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n /// Legacy Workshop.address / phone — both are columns in the workshop grid.\n address String?\n phone String?\n /// The supervisor created alongside the workshop by the legacy Add form.\n supervisorId String?\n supervisor AdminUser? @relation(\"WorkshopSupervisor\", fields: [supervisorId], references: [id])\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n /// Legacy Category.type — which storefront the category belongs to:\n /// 1 سایت | 2 اپلیکشن موبایل. Drives the \"type_str\" grid column.\n type Int @default(1)\n /// Legacy Category.image / icon — the grid renders the image, the storefront the icon.\n imageUrl String?\n iconUrl String?\n /// Legacy meta tag + description, used for SEO on the site categories.\n metaTag String?\n description String?\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n promotions Promotion[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n promotions Promotion[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n /// Legacy Product.product_code — the human-facing SKU shown in the grid.\n productCode String? @unique\n /// Legacy Product.show_type: 1 site, 2 mobile, 3 both.\n showType Int @default(3)\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Stock of the linked کارساخته as last read from the accounting software\n /// (D27). Weight for gram-type items, count for count-type ones — whichever\n /// the software reports. At zero or below the product is unavailable in the\n /// app (pre-order variants excepted). Null = not linked or never synced.\n accountingStockWeight Decimal? @db.Decimal(14, 4)\n accountingStockCount Decimal? @db.Decimal(14, 4)\n accountingStockAt DateTime?\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n comments Comment[]\n promotions Promotion[]\n allocationItems BranchAllocationItem[]\n favoritedBy CustomerFavorite[]\n\n // Storefront paging (owner: the real catalogue reaches ~16k products, so\n // GET /catalog/products must page rather than return everything). This model\n // had NO index at all, so every storefront query was a full scan and paging\n // alone would not have been any faster.\n //\n // The composite matches the list's own shape: filter on isActive, order by\n // createdAt — Postgres can satisfy both from this one index, including the\n // OFFSET walk. The other two serve the category and brand filters.\n @@index([isActive, createdAt])\n @@index([categoryId])\n @@index([brandId])\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n /// Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\n /// گالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\n /// existing rows and any generic \"just attach an image\" caller keep working.\n role ProductImageRole @default(GALLERY)\n\n /// Variants that display this image. A gallery image may back several\n /// variants (one photo, several weights), which is why this is a plain\n /// one-to-many and not a join table.\n variants ProductVariant[]\n\n // The storefront list filters on `images: { some: {} }` and includes the\n // gallery ordered by sortOrder, both per product. Unindexed, each one scanned\n // the whole table.\n @@index([productId, sortOrder])\n}\n\nenum ProductImageRole {\n FEATURED\n FEATURED_MOBILE\n GALLERY\n GALLERY_MOBILE\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n /// Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\n /// qty 0 unless it is flagged pre-order, so both fields are required for that\n /// guard to work (see apps/admin-panel/src/stores/cart.ts).\n qty Int @default(0)\n /// Legacy is_pre_order: orderable even at zero stock.\n isPreOrder Boolean @default(false)\n isActive Boolean @default(true)\n\n /// Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\n color Int?\n /// Legacy rial_pay — fixed Rial making charge per variant.\n rialWage Decimal? @db.Decimal(18, 0)\n /// Legacy details — short description for variant.\n details String? @db.Text\n /// Legacy description — full description for variant.\n description String? @db.Text\n\n /// The gallery image shown for this variant, picked from its own product's\n /// images — never a re-uploaded copy. onDelete: SetNull because dropping an\n /// image must never cascade into the variant: OrderItem rows reference\n /// variants, so losing one would break order history.\n imageId String?\n image ProductImage? @relation(fields: [imageId], references: [id], onDelete: SetNull)\n\n orderItems OrderItem[]\n\n @@index([imageId])\n // Every storefront product carries its variants, so this include ran once per\n // product with no index to use. The composite covers the `isActive: true`\n // filter the list applies to them.\n @@index([productId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n /// Which sales channel placed this order — see OrderChannel.\n channel OrderChannel @default(RETAIL)\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n /// The sales expert this order is credited to, fixed when it is placed:\n /// the customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\n /// set once at creation (ApiMobileController.php:601) and never moved, so a\n /// customer changing expert later does not move past sales or commission\n /// (owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\n /// customer's current referrer.\n salesAgentId String?\n salesAgent AdminUser? @relation(\"OrderSalesAgent\", fields: [salesAgentId], references: [id], onDelete: SetNull)\n\n /// History only: a legacy order whose `reagent_id` named a customer who is\n /// not a sales expert (one such customer, 17 orders in 2022). Legacy counted\n /// those orders in that customer's own «میزان فروش»; this keeps that figure\n /// exact. Never set for a new order.\n referrerCustomerId String?\n referrerCustomer Customer? @relation(\"OrderReferrerCustomer\", fields: [referrerCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n @@index([salesAgentId])\n @@index([referrerCustomerId])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminUserId String?\n postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id])\n\n /// Instrument metadata from the legacy \"cash\" document form. Which fields are\n /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and\n /// the pre-normalization weight, a cheque carries the account and bank, and a\n /// transfer carries its destination.\n /// Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\n labName String?\n hallmark String?\n accountName String?\n bankName String?\n transferTo String?\n /// Weight as handed over, BEFORE karat normalization (legacy original_value).\n originalValue Decimal? @db.Decimal(14, 4)\n /// Rial amount for cash/cheque documents (legacy price).\n priceRial Decimal? @db.Decimal(20, 2)\n receivedAt DateTime?\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Admin ACL — faithful port of the legacy granular permission model.\n//\n// Legacy (henza_server):\n// Schema::create('permission', function (Blueprint $table) {\n// $table->string('rid');\n// $table->integer('ut');\n// $table->primary(['rid' , 'ut']);\n// });\n//\n// Permissions attach to the USER TYPE (`ut`), never to an individual user, so\n// every admin of a given type shares one permission set. `ut` pointed at a row\n// in the legacy `config_static` lookup table; UserType is that table, narrowed\n// to the admin-user-type rows it was actually used for.\n//\n// A `rid` is a dotted permission id such as \"persons.list.client.omde\". The\n// frontend expands each stored rid into its ancestors at runtime via\n// checkParent() — see apps/admin-panel/src/stores/users.ts. Only the 58 leaf\n// rids the routers actually gate are seeded; ancestors are derived, not stored.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UserType {\n /// Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\n /// rows keep their legacy identity rather than getting new cuids.\n id Int @id\n title String\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n permissions Permission[]\n adminUsers AdminUser[]\n\n @@map(\"user_type\")\n}\n\nmodel Permission {\n /// Dotted permission id, e.g. \"order.list\", \"persons.list.client.omde\".\n rid String\n userTypeId Int\n userType UserType @relation(fields: [userTypeId], references: [id], onDelete: Cascade)\n\n /// Legacy's composite primary key (rid, ut), preserved exactly.\n @@id([rid, userTypeId])\n @@index([userTypeId])\n @@map(\"permission\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Product comments / reviews — legacy `comment` table (App\\Models\\Comment),\n// moderated from views/customer/Comments/Comments.vue.\n//\n// Legacy fillable: product_id, comment, reply_to, sts, customer_id\n// Legacy Comment::$STS = [1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده']\n// which is represented here as an enum rather than a magic integer.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum CommentStatus {\n PENDING // 1 — در انتظار تایید\n APPROVED // 2 — تایید شده\n REJECTED // 3 — رد شده\n}\n\nmodel Comment {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n body String\n status CommentStatus @default(PENDING)\n\n /// Legacy `reply_to`: a staff reply threads under the comment it answers.\n replyToId String?\n replyTo Comment? @relation(\"CommentReplies\", fields: [replyToId], references: [id])\n replies Comment[] @relation(\"CommentReplies\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([productId])\n @@index([customerId])\n @@index([status])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Settings — replaces legacy `config_static`, a key/value table the admin\n// panel read and wrote through endpoints like /wallet/config and\n// /const/__list__ut. Values are stored as JSON so a setting can hold a scalar,\n// an object, or the dynamic option lists legacy kept under `__list__*` keys.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Setting {\n key String @id\n value Json\n updatedAt DateTime @updatedAt\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting integration (D27) — the shop's accounting software, Tahesab or\n// Zarrin, chosen in the admin panel. Configuration lives in the Setting row\n// `accounting.config` (never served by the generic `const` routes). Plan:\n// docs/ACCOUNTING-INTEGRATION-PLAN.md.\n//\n// `provider` is the driver name ('tahesab' | 'zarrin'), a plain string like\n// SMS_PROVIDER so a new driver needs no migration. Links are per provider, so\n// switching provider and back loses nothing.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AccountingEntityType {\n CUSTOMER\n PRODUCT\n}\n\n/// One app row ↔ one record in the accounting software (customer account or\n/// کارساخته).\nmodel AccountingLink {\n id String @id @default(cuid())\n provider String\n entityType AccountingEntityType\n entityId String\n /// The record's code in the accounting software (Tahesab Moshtari_Code /\n /// Zarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\n externalCode String\n externalName String?\n /// How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\n /// row created from the accounting record), PUSHED (accounting record created\n /// from the app row) or MANUAL (an admin typed the code).\n origin String\n /// The record as last read, for display only.\n snapshot Json?\n syncedAt DateTime @default(now())\n createdAt DateTime @default(now())\n\n @@unique([provider, entityType, entityId])\n @@unique([provider, entityType, externalCode])\n @@index([entityType, entityId])\n}\n\nenum AccountingOutboxKind {\n CUSTOMER_PUSH\n PRODUCT_PUSH\n ORDER_DOCUMENT\n ORDER_DOCUMENT_DELETE\n}\n\nenum AccountingOutboxStatus {\n PENDING\n /// A call was in flight. Found at startup, it means the process died mid-call\n /// and the outcome is unknown — see AccountingOutboxWorker.\n SENDING\n SENT\n FAILED\n /// Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\n /// idempotency key, so a blind retry could post the document twice).\n NEEDS_REVIEW\n /// Closed by an admin from the log screen.\n RESOLVED\n}\n\n/// Work to push to the accounting software. Written in the SAME transaction as\n/// the change that causes it, so an outage of the accounting software never\n/// loses an event and never blocks the app.\nmodel AccountingOutbox {\n id String @id @default(cuid())\n provider String\n kind AccountingOutboxKind\n entityId String\n status AccountingOutboxStatus @default(PENDING)\n attempts Int @default(0)\n nextAttemptAt DateTime @default(now())\n lastError String?\n /// What the accounting software returned as the document/record id.\n externalRef String?\n /// Per-step progress of multi-call jobs (a Zarrin document is one call per\n /// line), so a failure resumes where it stopped.\n progress Json?\n /// Last request/response, for the log screen. Never contains the token.\n lastRequest Json?\n lastResponse Json?\n sentAt DateTime?\n resolvedById String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([status, nextAttemptAt])\n @@index([kind, entityId])\n}\n\n/// Something a pull found that needs a human: an account with no mobile, two\n/// accounts sharing one mobile, a کارساخته group with no category mapping.\nmodel AccountingIssue {\n id String @id @default(cuid())\n provider String\n kind String\n externalCode String\n entityId String?\n message String\n data Json?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n resolvedAt DateTime?\n\n @@unique([provider, kind, externalCode])\n @@index([resolvedAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Promotions / discounts — legacy views/promotion/*, served by\n// PromotionController (`product/variant/promotion`). The redesigned schema had\n// no promotion concept at all; this models what the legacy forms actually\n// collect.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy Promotion.type — what the discount is scoped to.\nenum PromotionScope {\n PRODUCT // 1 محصولات\n CATEGORY // 2 دسته بندی\n CUSTOMER // 3 مشتری\n BRAND // 4 برند\n}\n\n/// Legacy Promotion.use_only — how often a customer may redeem it.\nenum PromotionUsage {\n ONCE // 1 فقط یکبار\n UNTIL_END_DATE // 2 تا تاریخ پایان\n}\n\nmodel Promotion {\n id String @id @default(cuid())\n title String\n description String?\n scope PromotionScope @default(PRODUCT)\n usage PromotionUsage @default(ONCE)\n /// Percentage off, 0-100 (legacy discount_percent).\n discountPercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n /// Which storefront it shows on, mirroring Product.showType (legacy platform).\n platform Int @default(3)\n\n startsAt DateTime?\n endsAt DateTime?\n\n /// Exactly one of these is populated, per `scope`.\n productId String?\n product Product? @relation(fields: [productId], references: [id])\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n customerId String?\n customer Customer? @relation(fields: [customerId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([scope, isActive])\n}\n\n/// Legacy \"ignore\" table (views/offersIgnore) — specific products, categories,\n/// customers or brands excluded from the automatic discount engine.\n/// Legacy posts { type, item_id[] }: \"type\" reuses the promotion scope codes\n/// (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \"itemId\" is the excluded row.\nmodel PromotionExclusion {\n id String @id @default(cuid())\n type Int\n itemId String\n createdAt DateTime @default(now())\n\n @@unique([type, itemId])\n @@index([type])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Branch stock allocation — legacy views/invoice/* (\"فاکتور انتقال\"), served by\n// BranchController as `branch/product`. Despite the screen being called an\n// invoice, it is not a sales document: it records which products head office\n// allocated to a branch, and who allocated them.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel BranchAllocation {\n id String @id @default(cuid())\n branchId String\n branch Branch @relation(fields: [branchId], references: [id])\n\n /// Legacy `allocator_user` — the admin who filed the allocation.\n allocatorAdminUserId String?\n allocatorAdminUser AdminUser? @relation(\"AllocationAuthor\", fields: [allocatorAdminUserId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n items BranchAllocationItem[]\n\n @@index([branchId])\n}\n\nmodel BranchAllocationItem {\n id String @id @default(cuid())\n allocationId String\n allocation BranchAllocation @relation(fields: [allocationId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id])\n /// Weight snapshot at allocation time, so later catalog edits do not rewrite history.\n weightGrams Decimal? @db.Decimal(14, 4)\n\n @@unique([allocationId, productId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Messaging + audit — legacy views/sms, views/notify, views/newsletters and\n// views/statics. None of these had a model in the redesigned schema.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Who an SMS or notification was aimed at. Legacy's sms/create offered these\n/// audiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\nenum MessageAudience {\n SINGLE_NUMBER // یک شماره\n MULTIPLE_NUMBERS // چند شماره\n ALL_CUSTOMERS // همه\n WHOLESALE_CUSTOMERS // عمده\n RETAIL_CUSTOMERS // تک\n SALES_AGENTS // کارشناسان فروش\n}\n\nmodel SmsMessage {\n id String @id @default(cuid())\n audience MessageAudience\n /// Comma-separated recipients for the SINGLE/MULTIPLE audiences.\n recipients String?\n body String\n /// How many numbers the send actually resolved to.\n sentCount Int @default(0)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"SmsAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n @@index([createdAt])\n}\n\nmodel Notification {\n id String @id @default(cuid())\n title String\n body String\n audience MessageAudience @default(ALL_CUSTOMERS)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"NotificationAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n recipients NotificationRecipient[]\n\n @@index([createdAt])\n}\n\n/// Per-customer delivery + read state — legacy `GET notify/read/{id}`.\nmodel NotificationRecipient {\n id String @id @default(cuid())\n notificationId String\n notification Notification @relation(fields: [notificationId], references: [id], onDelete: Cascade)\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n readAt DateTime?\n\n @@unique([notificationId, customerId])\n @@index([customerId, readAt])\n}\n\n/// Legacy views/newsletters — the mailing-list signups collected by the site.\nmodel NewsletterSubscriber {\n id String @id @default(cuid())\n email String?\n mobile String?\n createdAt DateTime @default(now())\n\n @@unique([email])\n @@unique([mobile])\n}\n\n/// Legacy views/statics — the customer activity log the \"آمار\" screen reads\n/// (`log/list/customer`, `log/ago/{customerId}`).\nmodel CustomerActivityLog {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n /// Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\n action String\n detail String?\n createdAt DateTime @default(now())\n\n @@index([customerId, createdAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Uploads — replaces the legacy MyUpload / SingleUploadInput widgets, which\n// POSTed to a file endpoint and stored the returned URL on the owning record.\n// Ports of those forms currently take a URL by hand; this gives them a real\n// destination to upload to.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UploadedFile {\n id String @id @default(cuid())\n /// Public URL the stored file is served from.\n url String\n originalName String\n mimeType String\n sizeBytes Int\n /// Free-form tag for what the file belongs to, e.g. 'product', 'category',\n /// 'customer.nationalId'. Kept loose so a new form needs no schema change.\n purpose String?\n\n uploadedByAdminUserId String?\n uploadedByAdminUser AdminUser? @relation(\"FileUploader\", fields: [uploadedByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n customerAvatars Customer[] @relation(\"CustomerAvatar\")\n adminUserAvatars AdminUser[] @relation(\"AdminUserAvatar\")\n\n @@index([purpose])\n}\n\n/// One OTP login challenge for a customer.\n///\n/// Ports henza_server's flow (ApiMobileController.php:39-78), where userAuth\n/// generated rand(1000,9999), stored it on the customer row as `send_password`\n/// and sent it by SMS, and userVerfiy compared the submitted code against it\n/// (mismatch -> HTTP 422).\n///\n/// Three deliberate improvements over the reference, approved by the user\n/// (docs/parity/DECISIONS.md D6 and T1):\n/// 1. the code is stored as a bcrypt hash, never in plain text — the\n/// reference kept it readable in a customer column;\n/// 2. it expires (`expiresAt`) — the reference's code stayed valid forever;\n/// 3. attempts are counted and the challenge locks out — the reference had\n/// no limit at all.\n/// The parity behaviour itself is the code comparison and the rejection.\nmodel CustomerOtp {\n id String @id @default(cuid())\n /// Normalised to English digits before storing, as the reference does with\n /// Utility::faTOen() on both send and verify.\n mobile String\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n\n /// bcrypt hash of the 4-digit code. Never the code itself.\n codeHash String\n expiresAt DateTime\n /// Failed verify attempts against THIS challenge.\n attempts Int @default(0)\n /// Set when the code is accepted, so one challenge cannot be reused.\n consumedAt DateTime?\n\n /// Kept for the per-IP send throttle.\n requestIp String?\n createdAt DateTime @default(now())\n\n @@index([mobile, createdAt])\n @@index([customerId])\n @@index([expiresAt])\n}\n\n/// Bespoke migration ledger left by the EARLIER, pre-Prisma port.\n///\n/// It predates Prisma Migrate in this repo and holds 12 historical rows\n/// (`0001_init.sql`, `0002_admin_schema.sql`, `seed:initial`, and the early\n/// `2026091…` migrations). It is the only record of how that port was applied,\n/// so it is **kept and never written to or deleted from** (DEAD-07).\n///\n/// It is declared here purely so `prisma migrate diff` stops proposing\n/// `DROP TABLE \"_goldbank_migrations\"` — an undeclared table reads as drift.\n/// `@@ignore` keeps it out of Prisma Client: nothing in the application should\n/// ever read or write it, and Prisma Migrate will not manage its shape either.\n///\n/// Prisma's own ledger is `_prisma_migrations`, which is separate and is never\n/// edited by hand (D14).\nmodel goldbank_migrations {\n name String @id\n appliedAt DateTime @default(now()) @map(\"applied_at\") @db.Timestamptz(6)\n\n @@map(\"_goldbank_migrations\")\n @@ignore\n}\n", - "inlineSchemaHash": "54a2d00740a4cca89b49b7d3d033c87da64e26d4d05f43a5a69777e68eba1748", + "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\n/// Legacy Customer.type — what kind of wholesale customer this is. Values and\n/// labels taken verbatim from bulkCustomer.vue's userTypes list.\n///\n/// SALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\n/// Customer row with type=1, but the redesigned system models a sales agent\n/// as an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\n/// and admin-customers.service.ts's listReagents()/create(). No Customer row\n/// should be created with kind SALES_AGENT going forward; the value is kept\n/// only so legacyTypeToKind()/kindToLegacyType() stay total functions and any\n/// already-migrated data keeps a readable label.\n///\n/// RETAIL marks a \"تک\" (single/retail) customer — legacy kept these in an\n/// entirely separate table (SingleCustomer/`login`) that could never contain\n/// a wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\n/// into one Customer model, so this value is what listSingle() now filters on\n/// to reproduce that same separation.\nenum CustomerKind {\n SALES_AGENT // legacy 1 کارشناس فروش — superseded by AdminRole.SALES_EXPERT, do not use for new rows\n APP_SHOPKEEPER // 2 مغازه دار اپلیکیشن\n WALK_IN_SHOPKEEPER // 3 مغازه دار حضوری\n BANKER // 4 بنکدار\n WORKSHOP_SUPERVISOR // 5 سرپرست کارگاه\n RETAIL // مشتری تک — legacy SingleCustomer\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n\n /// Legacy had THREE states per step, not two\n /// (MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\n /// 3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\n /// cases back in the review queue, so the owner ruled it out (2026-10-07).\n /// 14 legacy rows land here; see Customer.verificationRejectionReason.\n REJECTED\n}\n\n/// Legacy kept retail and wholesale orders in two SEPARATE tables\n/// (orders_orders vs orders). The redesigned schema has one Order model, so the\n/// distinction lives here instead.\nenum OrderChannel {\n RETAIL // تک فروشی\n WHOLESALE // عمده فروشی\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy `cities` is a tree (country > province > city > district) and so is\n/// this: a city hangs under its `parent`. In the admin pickers a top-level row\n/// (the country) is a heading, not selectable (henza_admin citiesModel.js:38).\nmodel City {\n id String @id @default(cuid())\n name String\n parentId String?\n parent City? @relation(\"CityTree\", fields: [parentId], references: [id], onDelete: Restrict)\n children City[] @relation(\"CityTree\")\n /// Legacy cities.percent / percent_aux — per-city wage surcharges the city\n /// screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\n percent Decimal? @db.Decimal(6, 3)\n percentAux Decimal? @db.Decimal(6, 3)\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n salesExpertProfiles SalesExpertProfile[]\n\n @@index([parentId])\n}\n\n/// A staff account for the ADMIN PANEL — and nothing else.\n///\n/// Split out of AdminUser (which now holds sales experts only) so that:\n/// * the same mobile can be an admin AND a sales expert — they are two\n/// separate roles, each unique only within its own table;\n/// * the expert table (production: ~12,000 rows) is never written by panel\n/// staff management.\n/// Migration 20261026120000_split_admin_table copies the existing non-expert\n/// AdminUser rows here WITH THEIR IDS, so issued panel tokens and every\n/// \"who did this\" column keep resolving. The old rows are left in AdminUser,\n/// dormant; no code reads them as admins any more.\n///\n/// ⚠️ fullName/firstName/lastName are kept in sync by the DB trigger\n/// `admin_sync_full_name_trg` (it shares the function admin_user_sync_full_name) — same semantics as AdminUser: the parts win.\nmodel Admin {\n id String @id @default(cuid())\n\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n passwordHash String\n /// Never SALES_EXPERT — that role lives in AdminUser. Enforced in\n /// AdminUsersService, not in the database, so the enum stays shared.\n role AdminRole\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n supervisedWorkshops Workshop[] @relation(\"WorkshopSupervisor\")\n branchAllocations BranchAllocation[] @relation(\"AllocationAuthor\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n sentSmsMessages SmsMessage[] @relation(\"SmsAuthor\")\n sentNotifications Notification[] @relation(\"NotificationAuthor\")\n uploadedFiles UploadedFile[] @relation(\"FileUploader\")\n\n /// Issued admin-panel tokens, recorded only while session tracking is on\n /// (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\n /// token can be revoked before it expires. See AdminSession.\n sessions AdminSession[]\n\n @@index([role])\n @@index([userTypeId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// A SALES EXPERT (role SALES_EXPERT). Panel staff live in `Admin`; rows here with\n/// any other role are pre-split leftovers and are ignored by the code.\nmodel AdminUser {\n id String @id @default(cuid())\n\n /// ⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\n /// migration 20260922180000. Prisma cannot see it, so a write here may store\n /// something other than what you passed:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; the submitted fullName is\n /// discarded\n ///\n /// Re-read after writing if you need the stored value. Same arrangement as\n /// Customer (D0 requirement 7 — the split applies to ALL admins, not only\n /// sales experts).\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n passwordHash String\n role AdminRole\n /// Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\n /// the coarse `role` enum above is retained for the business rules that already\n /// switch on it. Nullable so existing seeded admins remain valid.\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Legacy stored a sales agent as a `customers` row with type=1, so\n /// ReagentCustomer.vue's shared form collected these alongside the\n /// wholesale-customer fields. A sales agent is now an AdminUser\n /// (role=SALES_EXPERT), so these live here instead — only ever set for that\n /// role; every other AdminUser leaves them null.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"AdminUserAvatar\", fields: [avatarFileId], references: [id])\n address String?\n storeName String? // legacy store_name\n pasazhName String? // legacy pasazh_name\n memberCode String? // legacy mcode\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n /// Orders credited to this sales expert — see Order.salesAgentId.\n creditedOrders Order[] @relation(\"OrderSalesAgent\")\n\n /// Only ever set for role = SALES_EXPERT (D17).\n salesExpertProfile SalesExpertProfile?\n\n @@index([role])\n @@index([userTypeId])\n @@index([avatarFileId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// An issued APP token (customer app / sales-expert app), so it can be revoked\n/// before it expires — the counterpart of AdminSession for the other token family.\n///\n/// WHY A SEPARATE TABLE AND NO FOREIGN KEY\n/// ---------------------------------------\n/// An app token's `sub` is a Customer id for a customer and an **AdminUser id**\n/// for a sales expert (D21). One FK cannot point at two tables, so the subject is\n/// stored as a plain id plus its type. The rows are short-lived operational data,\n/// not part of the accounting model, so the missing FK costs nothing here.\nmodel AppSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n /// Customer.id, or AdminUser.id when subjectType is \"sales-expert\".\n subjectId String\n subjectType String\n\n mobile String?\n\n /// Set when the login was confirmed by the central IAM: its session id (`sid`)\n /// and stable user id (`sub`), which is what a back-channel logout arrives with.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([subjectId])\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// An issued admin-panel JWT, so it can be revoked before it expires.\n///\n/// WHY THIS EXISTS\n/// ---------------\n/// The admin token is self-contained and valid for 12h, which means nothing —\n/// not disabling the account, not a central \"sign out everywhere\" — could cut a\n/// session short: the token kept working until it expired. With the central IAM\n/// in the loop that gap became visible (an IAM session revocation had no effect\n/// here), so every issued token now carries a `jti` recorded on this table and\n/// JwtStrategy refuses a token whose row is revoked.\n///\n/// Rows are written ONLY while tracking is enabled, and JwtStrategy only\n/// enforces them while it is enabled, so a deployment that does not want the\n/// extra lookup behaves exactly as before.\nmodel AdminSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n adminId String @map(\"adminUserId\")\n admin Admin @relation(fields: [adminId], references: [id], onDelete: Cascade)\n\n /// Set when the login was verified by the IAM: its session id (`sid`) and the\n /// stable user id (`sub`) there. Back-channel logout arrives keyed by these —\n /// deliberately here rather than as columns on AdminUser, so enabling the\n /// feature needs no change to an existing table.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([adminId], map: \"AdminSession_adminUserId_idx\")\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// The sales-expert fields legacy kept on the `customers` row (type=1) and that\n/// were lost when a sales expert became an AdminUser (D17).\n///\n/// A separate table rather than columns on AdminUser: these are meaningful only\n/// for role = SALES_EXPERT and would be permanently null for every other admin.\n/// A row is created for every SALES_EXPERT by the migration, and upserted by the\n/// service whenever one is created or a user's role becomes SALES_EXPERT — but\n/// readers still left-join, so a missing profile degrades to nulls rather than\n/// dropping the agent from the grid.\n///\n/// `reagent_id` is deliberately NOT here — see D17: in the reference it was a\n/// side effect of the shared customers form, and filling it removed that expert\n/// from the selectable-agent list (queryReagent, AdminController.php:420).\nmodel SalesExpertProfile {\n id String @id @default(cuid())\n adminUserId String @unique\n adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade)\n\n /// Legacy customers.city_id — a filterable grid column\n /// (ReagentListModel.js:14) and the source of the commission autofill\n /// (ReagentCustomer.vue:215-228).\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\n /// Decimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\n /// credit limit has identical precision on both tables.\n gramLevel Decimal @default(0) @db.Decimal(14, 4)\n\n /// Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\n /// stores both and reads neither back; kept so the form matches it. Neither\n /// is unique and neither has a validation rule in the reference — inventing\n /// one would reject data the reference accepts.\n phone String? @db.VarChar(15)\n nationalCode String? @db.VarChar(20)\n\n /// The Customer row carrying this expert's OWN orders, debt and credit limit.\n ///\n /// The reference stored a sales agent AS a Customer (type=1), so an order the\n /// agent placed from the app was simply their own, against their own\n /// gram_level (ApiMobileController.php:534-535). Here the expert is an\n /// AdminUser (D17), which has no ledger and cannot be an Order's subject, so\n /// this one linked Customer plays that part.\n ///\n /// Distinct from the expert's REFERRED customers, which are ordinary Customer\n /// rows pointing at the AdminUser through Customer.referredByAgentId.\n ///\n /// Null until the expert first signs into the app, when it is created from\n /// this profile. See D21.\n tradingCustomerId String? @unique\n tradingCustomer Customer? @relation(\"SalesExpertTradingAccount\", fields: [tradingCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now()) @updatedAt\n\n @@index([cityId])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n\n /// ⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\n /// TRIGGER — `customer_sync_full_name`, created in migration\n /// 20260922120000_customer_name_parts. Prisma does not know about it, so a\n /// write here is NOT the whole story:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; fullName is overwritten\n /// with \"first last\" and whatever you passed for fullName is discarded\n ///\n /// So a value you wrote can differ from the value that lands in the row.\n /// Re-read after writing if you need the stored value. Prefer writing the\n /// parts; `fullName` exists for the legacy readers that predate D0.\n ///\n /// Reference has these as two columns from the start\n /// (henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\n /// the port collapsed them, which is the D0 defect.\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n /// Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\n /// legacy customers has a national code (1595/1595 empty), and fabricating\n /// one is a data violation that would block later legal identity checks\n /// (owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\n /// the migration tool must write NULL and never '', which would collide on\n /// the second row.\n ///\n /// Three service-layer workarounds exist ONLY because this used to be\n /// required, and they store the MOBILE NUMBER here:\n /// admin-customers.service.ts:625,685 and customer-auth.service.ts:258.\n /// Retiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\n nationalCode String? @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.new_city — the city name exactly as the customer typed it\n /// at app sign-up (Major/CustomerController.php:36). Kept verbatim because\n /// the legacy city table has only 15 rows, so the typed name is often the only\n /// record of where the customer is (172 customers; 43 match no known city).\n /// cityId is set alongside it only on an exact, ي/ك-normalised name match.\n /// Legacy sign-up also forced city_id = 5 (Tehran) on everyone\n /// (Major/CustomerController.php:21), so for those rows the typed name, not\n /// cityId, is the truth. Owner ruling 2026-10-07: keep both.\n cityNameRaw String?\n\n /// Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\n /// BankerList / ShopkeeperList screens filter on.\n kind CustomerKind @default(APP_SHOPKEEPER)\n\n /// Legacy contact + shop columns, shown on the wholesale customer form and as\n /// (hidden-by-default) columns in its grid.\n phone String?\n address String?\n storeName String?\n pasazhName String?\n zone String?\n /// Legacy mcode — the operator-assigned customer code.\n memberCode String?\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n /// Set only on the one Customer row that acts as a sales expert's own trading\n /// account (see SalesExpertProfile.tradingCustomerId). Empty for every\n /// ordinary customer.\n salesExpertTradingFor SalesExpertProfile? @relation(\"SalesExpertTradingAccount\")\n /// Legacy orders that named THIS customer as their referrer — see\n /// Order.referrerCustomerId. History only.\n referredOrders Order[] @relation(\"OrderReferrerCustomer\")\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n /// Balance as last read from the accounting software (D27), in the app's own\n /// sign convention (positive = owes). Shown to the customer when the\n /// integration is on; the credit-limit check still uses goldDebtGrams above.\n /// Null until the first successful sync.\n accountingGoldBalance Decimal? @db.Decimal(14, 4)\n accountingRialBalance Decimal? @db.Decimal(20, 2)\n accountingBalanceAt DateTime?\n\n /// Legacy `customers.percent` — the per-customer making-charge offset. It is\n /// ADDED to the variant's making charge when pricing an order line\n /// (henza_pwa src/Mixins/product/index.ts:69-75:\n /// getWage(v) = state.percent + v.percentage_pay)\n /// and it shifts the catalogue making-charge filter bounds\n /// (ApiMobileController.php:391-396,76-77). It is NOT part of the price\n /// formula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\n ///\n /// NOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\n /// NOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\n ///\n /// DB default 0 keeps every existing customer's price unchanged. The\n /// reference's application-layer default for NEW customers is 3\n /// (AdminController.php:338) and the field is required on create (:354).\n makingChargeOffsetPercent Decimal @default(0) @db.Decimal(6, 3)\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n /// Why verification was rejected (VerificationStep.REJECTED).\n ///\n /// Legacy recorded NO reason: none of its 49 `customers` columns is a\n /// reason/note field, and on rejection it only sent a fixed SMS. So the 14\n /// rows migrated from the legacy system carry the sentinel\n /// «رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\n /// knows why it is blank (owner ruling 2026-10-07). The migration tool\n /// writes it only WHERE this IS NULL, so a re-run cannot overwrite a real\n /// reason entered in the new system.\n verificationRejectionReason String?\n\n /// NULL for rows migrated from the legacy system — it recorded no rejection time.\n verificationRejectedAt DateTime?\n\n /// Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\n /// birthday SMS / loyalty campaigns (owner ruling 2026-10-07).\n ///\n /// ⚠ Legacy stores dates as JALALI STRINGS in other tables\n /// (cashes.recive_date is varchar, 88/89 values starting \"14…\"), so this\n /// timestamp may hold mis-entered Jalali years. Confirm the calendar with\n /// docs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\n /// would produce 917 wrong birthdays, worse for an SMS campaign than none.\n birthDate DateTime?\n\n /// Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\n /// form. Legacy stored an FK to its Image table and read it back as a nested\n /// `image: { id, image }`, so this is a relation, not a bare URL string.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"CustomerAvatar\", fields: [avatarFileId], references: [id])\n\n /// Legacy had TWO independent switches on a customer:\n /// sts -> may they place orders (this field)\n /// active -> is the account enabled (isActive, below)\n /// The port previously drove both from isActive; they are separate again.\n canPlaceOrders Boolean @default(true)\n\n isActive Boolean @default(true)\n /// Legacy archive flag — the archived list filtered on this, not on isActive.\n isArchived Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n comments Comment[]\n promotions Promotion[]\n notifications NotificationRecipient[]\n activityLogs CustomerActivityLog[]\n otpChallenges CustomerOtp[]\n favorites CustomerFavorite[]\n\n @@index([referredByAgentId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// Legacy `fav` (251 rows) — saved products. The target had no model for this,\n/// so every customer's favourites would have been lost in the migration; the\n/// owner confirmed on 2026-10-06 that they matter.\n///\n/// Legacy `fav` has two columns and NO primary key. The composite key here\n/// supplies the constraint the source lacks (the precheck found 0 duplicate\n/// pairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\n/// at a deleted customer and must be skipped.\n///\n/// Legacy's denormalised `product.count_fav` counter is deliberately NOT\n/// recreated as a column — derive it from this table.\nmodel CustomerFavorite {\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n\n @@id([customerId, productId])\n @@index([productId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n /// Legacy Branch.address / phone — both are columns in the branch grid.\n address String?\n phone String?\n /// Legacy GET branch/active/{id} toggles this.\n isActive Boolean @default(true)\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n admins Admin[]\n orders Order[]\n allocations BranchAllocation[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n /// Legacy Workshop.address / phone — both are columns in the workshop grid.\n address String?\n phone String?\n /// The supervisor created alongside the workshop by the legacy Add form.\n supervisorId String?\n supervisor Admin? @relation(\"WorkshopSupervisor\", fields: [supervisorId], references: [id])\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n /// Legacy Category.type — which storefront the category belongs to:\n /// 1 سایت | 2 اپلیکشن موبایل. Drives the \"type_str\" grid column.\n type Int @default(1)\n /// Legacy Category.image / icon — the grid renders the image, the storefront the icon.\n imageUrl String?\n iconUrl String?\n /// Legacy meta tag + description, used for SEO on the site categories.\n metaTag String?\n description String?\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n promotions Promotion[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n promotions Promotion[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n /// Legacy Product.product_code — the human-facing SKU shown in the grid.\n productCode String? @unique\n /// Legacy Product.show_type: 1 site, 2 mobile, 3 both.\n showType Int @default(3)\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Stock of the linked کارساخته as last read from the accounting software\n /// (D27). Weight for gram-type items, count for count-type ones — whichever\n /// the software reports. At zero or below the product is unavailable in the\n /// app (pre-order variants excepted). Null = not linked or never synced.\n accountingStockWeight Decimal? @db.Decimal(14, 4)\n accountingStockCount Decimal? @db.Decimal(14, 4)\n accountingStockAt DateTime?\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n comments Comment[]\n promotions Promotion[]\n allocationItems BranchAllocationItem[]\n favoritedBy CustomerFavorite[]\n\n // Storefront paging (owner: the real catalogue reaches ~16k products, so\n // GET /catalog/products must page rather than return everything). This model\n // had NO index at all, so every storefront query was a full scan and paging\n // alone would not have been any faster.\n //\n // The composite matches the list's own shape: filter on isActive, order by\n // createdAt — Postgres can satisfy both from this one index, including the\n // OFFSET walk. The other two serve the category and brand filters.\n @@index([isActive, createdAt])\n @@index([categoryId])\n @@index([brandId])\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n /// Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\n /// گالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\n /// existing rows and any generic \"just attach an image\" caller keep working.\n role ProductImageRole @default(GALLERY)\n\n /// Variants that display this image. A gallery image may back several\n /// variants (one photo, several weights), which is why this is a plain\n /// one-to-many and not a join table.\n variants ProductVariant[]\n\n // The storefront list filters on `images: { some: {} }` and includes the\n // gallery ordered by sortOrder, both per product. Unindexed, each one scanned\n // the whole table.\n @@index([productId, sortOrder])\n}\n\nenum ProductImageRole {\n FEATURED\n FEATURED_MOBILE\n GALLERY\n GALLERY_MOBILE\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n /// Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\n /// qty 0 unless it is flagged pre-order, so both fields are required for that\n /// guard to work (see apps/admin-panel/src/stores/cart.ts).\n qty Int @default(0)\n /// Legacy is_pre_order: orderable even at zero stock.\n isPreOrder Boolean @default(false)\n isActive Boolean @default(true)\n\n /// Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\n color Int?\n /// Legacy rial_pay — fixed Rial making charge per variant.\n rialWage Decimal? @db.Decimal(18, 0)\n /// Legacy details — short description for variant.\n details String? @db.Text\n /// Legacy description — full description for variant.\n description String? @db.Text\n\n /// The gallery image shown for this variant, picked from its own product's\n /// images — never a re-uploaded copy. onDelete: SetNull because dropping an\n /// image must never cascade into the variant: OrderItem rows reference\n /// variants, so losing one would break order history.\n imageId String?\n image ProductImage? @relation(fields: [imageId], references: [id], onDelete: SetNull)\n\n orderItems OrderItem[]\n\n @@index([imageId])\n // Every storefront product carries its variants, so this include ran once per\n // product with no index to use. The composite covers the `isActive: true`\n // filter the list applies to them.\n @@index([productId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n /// Which sales channel placed this order — see OrderChannel.\n channel OrderChannel @default(RETAIL)\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n /// The sales expert this order is credited to, fixed when it is placed:\n /// the customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\n /// set once at creation (ApiMobileController.php:601) and never moved, so a\n /// customer changing expert later does not move past sales or commission\n /// (owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\n /// customer's current referrer.\n salesAgentId String?\n salesAgent AdminUser? @relation(\"OrderSalesAgent\", fields: [salesAgentId], references: [id], onDelete: SetNull)\n\n /// History only: a legacy order whose `reagent_id` named a customer who is\n /// not a sales expert (one such customer, 17 orders in 2022). Legacy counted\n /// those orders in that customer's own «میزان فروش»; this keeps that figure\n /// exact. Never set for a new order.\n referrerCustomerId String?\n referrerCustomer Customer? @relation(\"OrderReferrerCustomer\", fields: [referrerCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n @@index([salesAgentId])\n @@index([referrerCustomerId])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminId String? @map(\"actorAdminUserId\")\n actorAdmin Admin? @relation(fields: [actorAdminId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminId String? @map(\"actorAdminUserId\")\n actorAdmin Admin? @relation(fields: [actorAdminId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminId String? @map(\"postedByAdminUserId\")\n postedByAdmin Admin? @relation(fields: [postedByAdminId], references: [id])\n\n /// Instrument metadata from the legacy \"cash\" document form. Which fields are\n /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and\n /// the pre-normalization weight, a cheque carries the account and bank, and a\n /// transfer carries its destination.\n /// Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\n labName String?\n hallmark String?\n accountName String?\n bankName String?\n transferTo String?\n /// Weight as handed over, BEFORE karat normalization (legacy original_value).\n originalValue Decimal? @db.Decimal(14, 4)\n /// Rial amount for cash/cheque documents (legacy price).\n priceRial Decimal? @db.Decimal(20, 2)\n receivedAt DateTime?\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Admin ACL — faithful port of the legacy granular permission model.\n//\n// Legacy (henza_server):\n// Schema::create('permission', function (Blueprint $table) {\n// $table->string('rid');\n// $table->integer('ut');\n// $table->primary(['rid' , 'ut']);\n// });\n//\n// Permissions attach to the USER TYPE (`ut`), never to an individual user, so\n// every admin of a given type shares one permission set. `ut` pointed at a row\n// in the legacy `config_static` lookup table; UserType is that table, narrowed\n// to the admin-user-type rows it was actually used for.\n//\n// A `rid` is a dotted permission id such as \"persons.list.client.omde\". The\n// frontend expands each stored rid into its ancestors at runtime via\n// checkParent() — see apps/admin-panel/src/stores/users.ts. Only the 58 leaf\n// rids the routers actually gate are seeded; ancestors are derived, not stored.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UserType {\n /// Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\n /// rows keep their legacy identity rather than getting new cuids.\n id Int @id\n title String\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n permissions Permission[]\n adminUsers AdminUser[]\n admins Admin[]\n\n @@map(\"user_type\")\n}\n\nmodel Permission {\n /// Dotted permission id, e.g. \"order.list\", \"persons.list.client.omde\".\n rid String\n userTypeId Int\n userType UserType @relation(fields: [userTypeId], references: [id], onDelete: Cascade)\n\n /// Legacy's composite primary key (rid, ut), preserved exactly.\n @@id([rid, userTypeId])\n @@index([userTypeId])\n @@map(\"permission\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Product comments / reviews — legacy `comment` table (App\\Models\\Comment),\n// moderated from views/customer/Comments/Comments.vue.\n//\n// Legacy fillable: product_id, comment, reply_to, sts, customer_id\n// Legacy Comment::$STS = [1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده']\n// which is represented here as an enum rather than a magic integer.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum CommentStatus {\n PENDING // 1 — در انتظار تایید\n APPROVED // 2 — تایید شده\n REJECTED // 3 — رد شده\n}\n\nmodel Comment {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n body String\n status CommentStatus @default(PENDING)\n\n /// Legacy `reply_to`: a staff reply threads under the comment it answers.\n replyToId String?\n replyTo Comment? @relation(\"CommentReplies\", fields: [replyToId], references: [id])\n replies Comment[] @relation(\"CommentReplies\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([productId])\n @@index([customerId])\n @@index([status])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Settings — replaces legacy `config_static`, a key/value table the admin\n// panel read and wrote through endpoints like /wallet/config and\n// /const/__list__ut. Values are stored as JSON so a setting can hold a scalar,\n// an object, or the dynamic option lists legacy kept under `__list__*` keys.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Setting {\n key String @id\n value Json\n updatedAt DateTime @updatedAt\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting integration (D27) — the shop's accounting software, Tahesab or\n// Zarrin, chosen in the admin panel. Configuration lives in the Setting row\n// `accounting.config` (never served by the generic `const` routes). Plan:\n// docs/ACCOUNTING-INTEGRATION-PLAN.md.\n//\n// `provider` is the driver name ('tahesab' | 'zarrin'), a plain string like\n// SMS_PROVIDER so a new driver needs no migration. Links are per provider, so\n// switching provider and back loses nothing.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AccountingEntityType {\n CUSTOMER\n PRODUCT\n}\n\n/// One app row ↔ one record in the accounting software (customer account or\n/// کارساخته).\nmodel AccountingLink {\n id String @id @default(cuid())\n provider String\n entityType AccountingEntityType\n entityId String\n /// The record's code in the accounting software (Tahesab Moshtari_Code /\n /// Zarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\n externalCode String\n externalName String?\n /// How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\n /// row created from the accounting record), PUSHED (accounting record created\n /// from the app row) or MANUAL (an admin typed the code).\n origin String\n /// The record as last read, for display only.\n snapshot Json?\n syncedAt DateTime @default(now())\n createdAt DateTime @default(now())\n\n @@unique([provider, entityType, entityId])\n @@unique([provider, entityType, externalCode])\n @@index([entityType, entityId])\n}\n\nenum AccountingOutboxKind {\n CUSTOMER_PUSH\n PRODUCT_PUSH\n ORDER_DOCUMENT\n ORDER_DOCUMENT_DELETE\n}\n\nenum AccountingOutboxStatus {\n PENDING\n /// A call was in flight. Found at startup, it means the process died mid-call\n /// and the outcome is unknown — see AccountingOutboxWorker.\n SENDING\n SENT\n FAILED\n /// Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\n /// idempotency key, so a blind retry could post the document twice).\n NEEDS_REVIEW\n /// Closed by an admin from the log screen.\n RESOLVED\n}\n\n/// Work to push to the accounting software. Written in the SAME transaction as\n/// the change that causes it, so an outage of the accounting software never\n/// loses an event and never blocks the app.\nmodel AccountingOutbox {\n id String @id @default(cuid())\n provider String\n kind AccountingOutboxKind\n entityId String\n status AccountingOutboxStatus @default(PENDING)\n attempts Int @default(0)\n nextAttemptAt DateTime @default(now())\n lastError String?\n /// What the accounting software returned as the document/record id.\n externalRef String?\n /// Per-step progress of multi-call jobs (a Zarrin document is one call per\n /// line), so a failure resumes where it stopped.\n progress Json?\n /// Last request/response, for the log screen. Never contains the token.\n lastRequest Json?\n lastResponse Json?\n sentAt DateTime?\n resolvedById String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([status, nextAttemptAt])\n @@index([kind, entityId])\n}\n\n/// Something a pull found that needs a human: an account with no mobile, two\n/// accounts sharing one mobile, a کارساخته group with no category mapping.\nmodel AccountingIssue {\n id String @id @default(cuid())\n provider String\n kind String\n externalCode String\n entityId String?\n message String\n data Json?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n resolvedAt DateTime?\n\n @@unique([provider, kind, externalCode])\n @@index([resolvedAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Promotions / discounts — legacy views/promotion/*, served by\n// PromotionController (`product/variant/promotion`). The redesigned schema had\n// no promotion concept at all; this models what the legacy forms actually\n// collect.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy Promotion.type — what the discount is scoped to.\nenum PromotionScope {\n PRODUCT // 1 محصولات\n CATEGORY // 2 دسته بندی\n CUSTOMER // 3 مشتری\n BRAND // 4 برند\n}\n\n/// Legacy Promotion.use_only — how often a customer may redeem it.\nenum PromotionUsage {\n ONCE // 1 فقط یکبار\n UNTIL_END_DATE // 2 تا تاریخ پایان\n}\n\nmodel Promotion {\n id String @id @default(cuid())\n title String\n description String?\n scope PromotionScope @default(PRODUCT)\n usage PromotionUsage @default(ONCE)\n /// Percentage off, 0-100 (legacy discount_percent).\n discountPercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n /// Which storefront it shows on, mirroring Product.showType (legacy platform).\n platform Int @default(3)\n\n startsAt DateTime?\n endsAt DateTime?\n\n /// Exactly one of these is populated, per `scope`.\n productId String?\n product Product? @relation(fields: [productId], references: [id])\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n customerId String?\n customer Customer? @relation(fields: [customerId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([scope, isActive])\n}\n\n/// Legacy \"ignore\" table (views/offersIgnore) — specific products, categories,\n/// customers or brands excluded from the automatic discount engine.\n/// Legacy posts { type, item_id[] }: \"type\" reuses the promotion scope codes\n/// (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \"itemId\" is the excluded row.\nmodel PromotionExclusion {\n id String @id @default(cuid())\n type Int\n itemId String\n createdAt DateTime @default(now())\n\n @@unique([type, itemId])\n @@index([type])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Branch stock allocation — legacy views/invoice/* (\"فاکتور انتقال\"), served by\n// BranchController as `branch/product`. Despite the screen being called an\n// invoice, it is not a sales document: it records which products head office\n// allocated to a branch, and who allocated them.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel BranchAllocation {\n id String @id @default(cuid())\n branchId String\n branch Branch @relation(fields: [branchId], references: [id])\n\n /// Legacy `allocator_user` — the admin who filed the allocation.\n allocatorAdminId String? @map(\"allocatorAdminUserId\")\n allocatorAdmin Admin? @relation(\"AllocationAuthor\", fields: [allocatorAdminId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n items BranchAllocationItem[]\n\n @@index([branchId])\n}\n\nmodel BranchAllocationItem {\n id String @id @default(cuid())\n allocationId String\n allocation BranchAllocation @relation(fields: [allocationId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id])\n /// Weight snapshot at allocation time, so later catalog edits do not rewrite history.\n weightGrams Decimal? @db.Decimal(14, 4)\n\n @@unique([allocationId, productId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Messaging + audit — legacy views/sms, views/notify, views/newsletters and\n// views/statics. None of these had a model in the redesigned schema.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Who an SMS or notification was aimed at. Legacy's sms/create offered these\n/// audiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\nenum MessageAudience {\n SINGLE_NUMBER // یک شماره\n MULTIPLE_NUMBERS // چند شماره\n ALL_CUSTOMERS // همه\n WHOLESALE_CUSTOMERS // عمده\n RETAIL_CUSTOMERS // تک\n SALES_AGENTS // کارشناسان فروش\n}\n\nmodel SmsMessage {\n id String @id @default(cuid())\n audience MessageAudience\n /// Comma-separated recipients for the SINGLE/MULTIPLE audiences.\n recipients String?\n body String\n /// How many numbers the send actually resolved to.\n sentCount Int @default(0)\n\n sentByAdminId String? @map(\"sentByAdminUserId\")\n sentByAdmin Admin? @relation(\"SmsAuthor\", fields: [sentByAdminId], references: [id])\n\n createdAt DateTime @default(now())\n\n @@index([createdAt])\n}\n\nmodel Notification {\n id String @id @default(cuid())\n title String\n body String\n audience MessageAudience @default(ALL_CUSTOMERS)\n\n sentByAdminId String? @map(\"sentByAdminUserId\")\n sentByAdmin Admin? @relation(\"NotificationAuthor\", fields: [sentByAdminId], references: [id])\n\n createdAt DateTime @default(now())\n\n recipients NotificationRecipient[]\n\n @@index([createdAt])\n}\n\n/// Per-customer delivery + read state — legacy `GET notify/read/{id}`.\nmodel NotificationRecipient {\n id String @id @default(cuid())\n notificationId String\n notification Notification @relation(fields: [notificationId], references: [id], onDelete: Cascade)\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n readAt DateTime?\n\n @@unique([notificationId, customerId])\n @@index([customerId, readAt])\n}\n\n/// Legacy views/newsletters — the mailing-list signups collected by the site.\nmodel NewsletterSubscriber {\n id String @id @default(cuid())\n email String?\n mobile String?\n createdAt DateTime @default(now())\n\n @@unique([email])\n @@unique([mobile])\n}\n\n/// Legacy views/statics — the customer activity log the \"آمار\" screen reads\n/// (`log/list/customer`, `log/ago/{customerId}`).\nmodel CustomerActivityLog {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n /// Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\n action String\n detail String?\n createdAt DateTime @default(now())\n\n @@index([customerId, createdAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Uploads — replaces the legacy MyUpload / SingleUploadInput widgets, which\n// POSTed to a file endpoint and stored the returned URL on the owning record.\n// Ports of those forms currently take a URL by hand; this gives them a real\n// destination to upload to.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UploadedFile {\n id String @id @default(cuid())\n /// Public URL the stored file is served from.\n url String\n originalName String\n mimeType String\n sizeBytes Int\n /// Free-form tag for what the file belongs to, e.g. 'product', 'category',\n /// 'customer.nationalId'. Kept loose so a new form needs no schema change.\n purpose String?\n\n uploadedByAdminId String? @map(\"uploadedByAdminUserId\")\n uploadedByAdmin Admin? @relation(\"FileUploader\", fields: [uploadedByAdminId], references: [id])\n\n createdAt DateTime @default(now())\n customerAvatars Customer[] @relation(\"CustomerAvatar\")\n adminUserAvatars AdminUser[] @relation(\"AdminUserAvatar\")\n\n @@index([purpose])\n}\n\n/// One OTP login challenge for a customer.\n///\n/// Ports henza_server's flow (ApiMobileController.php:39-78), where userAuth\n/// generated rand(1000,9999), stored it on the customer row as `send_password`\n/// and sent it by SMS, and userVerfiy compared the submitted code against it\n/// (mismatch -> HTTP 422).\n///\n/// Three deliberate improvements over the reference, approved by the user\n/// (docs/parity/DECISIONS.md D6 and T1):\n/// 1. the code is stored as a bcrypt hash, never in plain text — the\n/// reference kept it readable in a customer column;\n/// 2. it expires (`expiresAt`) — the reference's code stayed valid forever;\n/// 3. attempts are counted and the challenge locks out — the reference had\n/// no limit at all.\n/// The parity behaviour itself is the code comparison and the rejection.\nmodel CustomerOtp {\n id String @id @default(cuid())\n /// Normalised to English digits before storing, as the reference does with\n /// Utility::faTOen() on both send and verify.\n mobile String\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n\n /// bcrypt hash of the 4-digit code. Never the code itself.\n codeHash String\n expiresAt DateTime\n /// Failed verify attempts against THIS challenge.\n attempts Int @default(0)\n /// Set when the code is accepted, so one challenge cannot be reused.\n consumedAt DateTime?\n\n /// Kept for the per-IP send throttle.\n requestIp String?\n createdAt DateTime @default(now())\n\n @@index([mobile, createdAt])\n @@index([customerId])\n @@index([expiresAt])\n}\n\n/// Bespoke migration ledger left by the EARLIER, pre-Prisma port.\n///\n/// It predates Prisma Migrate in this repo and holds 12 historical rows\n/// (`0001_init.sql`, `0002_admin_schema.sql`, `seed:initial`, and the early\n/// `2026091…` migrations). It is the only record of how that port was applied,\n/// so it is **kept and never written to or deleted from** (DEAD-07).\n///\n/// It is declared here purely so `prisma migrate diff` stops proposing\n/// `DROP TABLE \"_goldbank_migrations\"` — an undeclared table reads as drift.\n/// `@@ignore` keeps it out of Prisma Client: nothing in the application should\n/// ever read or write it, and Prisma Migrate will not manage its shape either.\n///\n/// Prisma's own ledger is `_prisma_migrations`, which is separate and is never\n/// edited by hand (D14).\nmodel goldbank_migrations {\n name String @id\n appliedAt DateTime @default(now()) @map(\"applied_at\") @db.Timestamptz(6)\n\n @@map(\"_goldbank_migrations\")\n @@ignore\n}\n", + "inlineSchemaHash": "10ad1bc4a821d684d83386a2c37bcf3e456d62228210ecd06ea12b67f136467e", "copyEngine": true } config.dirname = '/' -config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Restrict\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"percent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy cities.percent / percent_aux — per-city wage surcharges the city\\\\nscreen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\"},{\"name\":\"percentAux\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertProfiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `cities` is a tree (country > province > city > district) and so is\\\\nthis: a city hangs under its `parent`. In the admin pickers a top-level row\\\\n(the country) is a heading, not selectable (henza_admin citiesModel.js:38).\"},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\\\\nmigration 20260922180000. Prisma cannot see it, so a write here may store\\\\nsomething other than what you passed:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; the submitted fullName is\\\\ndiscarded\\\\n\\\\nRe-read after writing if you need the stored value. Same arrangement as\\\\nCustomer (D0 requirement 7 — the split applies to ALL admins, not only\\\\nsales experts).\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\\\\nthe coarse `role` enum above is retained for the business rules that already\\\\nswitch on it. Nullable so existing seeded admins remain valid.\"},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy stored a sales agent as a `customers` row with type=1, so\\\\nReagentCustomer.vue's shared form collected these alongside the\\\\nwholesale-customer fields. A sales agent is now an AdminUser\\\\n(role=SALES_EXPERT), so these live here instead — only ever set for that\\\\nrole; every other AdminUser leaves them null.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"creditedOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Orders credited to this sales expert — see Order.salesAgentId.\"},{\"name\":\"supervisedWorkshops\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchAllocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentSmsMessages\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SmsMessage\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentNotifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"FileUploader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertProfile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Only ever set for role = SALES_EXPERT (D17).\"},{\"name\":\"sessions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminSession\",\"relationName\":\"AdminSessionToAdminUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Issued admin-panel tokens, recorded only while session tracking is on\\\\n(AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\\\\ntoken can be revoked before it expires. See AdminSession.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AppSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"subjectId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Customer.id, or AdminUser.id when subjectType is \\\"sales-expert\\\".\"},{\"name\":\"subjectType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was confirmed by the central IAM: its session id (`sid`)\\\\nand stable user id (`sub`), which is what a back-channel logout arrives with.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued APP token (customer app / sales-expert app), so it can be revoked\\\\nbefore it expires — the counterpart of AdminSession for the other token family.\\\\n\\\\nWHY A SEPARATE TABLE AND NO FOREIGN KEY\\\\n---------------------------------------\\\\nAn app token's `sub` is a Customer id for a customer and an **AdminUser id**\\\\nfor a sales expert (D21). One FK cannot point at two tables, so the subject is\\\\nstored as a plain id plus its type. The rows are short-lived operational data,\\\\nnot part of the accounting model, so the missing FK costs nothing here.\"},\"AdminSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminSessionToAdminUser\",\"relationFromFields\":[\"adminUserId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was verified by the IAM: its session id (`sid`) and the\\\\nstable user id (`sub`) there. Back-channel logout arrives keyed by these —\\\\ndeliberately here rather than as columns on AdminUser, so enabling the\\\\nfeature needs no change to an existing table.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued admin-panel JWT, so it can be revoked before it expires.\\\\n\\\\nWHY THIS EXISTS\\\\n---------------\\\\nThe admin token is self-contained and valid for 12h, which means nothing —\\\\nnot disabling the account, not a central \\\"sign out everywhere\\\" — could cut a\\\\nsession short: the token kept working until it expired. With the central IAM\\\\nin the loop that gap became visible (an IAM session revocation had no effect\\\\nhere), so every issued token now carries a `jti` recorded on this table and\\\\nJwtStrategy refuses a token whose row is revoked.\\\\n\\\\nRows are written ONLY while tracking is enabled, and JwtStrategy only\\\\nenforces them while it is enabled, so a deployment that does not want the\\\\nextra lookup behaves exactly as before.\"},\"SalesExpertProfile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[\"adminUserId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.city_id — a filterable grid column\\\\n(ReagentListModel.js:14) and the source of the commission autofill\\\\n(ReagentCustomer.vue:215-228).\"},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"gramLevel\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\\\\nDecimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\\\\ncredit limit has identical precision on both tables.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\\\\nstores both and reads neither back; kept so the form matches it. Neither\\\\nis unique and neither has a validation rule in the reference — inventing\\\\none would reject data the reference accepts.\"},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"tradingCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The Customer row carrying this expert's OWN orders, debt and credit limit.\\\\n\\\\nThe reference stored a sales agent AS a Customer (type=1), so an order the\\\\nagent placed from the app was simply their own, against their own\\\\ngram_level (ApiMobileController.php:534-535). Here the expert is an\\\\nAdminUser (D17), which has no ledger and cannot be an Order's subject, so\\\\nthis one linked Customer plays that part.\\\\n\\\\nDistinct from the expert's REFERRED customers, which are ordinary Customer\\\\nrows pointing at the AdminUser through Customer.referredByAgentId.\\\\n\\\\nNull until the expert first signs into the app, when it is created from\\\\nthis profile. See D21.\"},{\"name\":\"tradingCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[\"tradingCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"The sales-expert fields legacy kept on the `customers` row (type=1) and that\\\\nwere lost when a sales expert became an AdminUser (D17).\\\\n\\\\nA separate table rather than columns on AdminUser: these are meaningful only\\\\nfor role = SALES_EXPERT and would be permanently null for every other admin.\\\\nA row is created for every SALES_EXPERT by the migration, and upserted by the\\\\nservice whenever one is created or a user's role becomes SALES_EXPERT — but\\\\nreaders still left-join, so a missing profile degrades to nulls rather than\\\\ndropping the agent from the grid.\\\\n\\\\n`reagent_id` is deliberately NOT here — see D17: in the reference it was a\\\\nside effect of the shared customers form, and filling it removed that expert\\\\nfrom the selectable-agent list (queryReagent, AdminController.php:420).\"},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\\\\nTRIGGER — `customer_sync_full_name`, created in migration\\\\n20260922120000_customer_name_parts. Prisma does not know about it, so a\\\\nwrite here is NOT the whole story:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; fullName is overwritten\\\\nwith \\\"first last\\\" and whatever you passed for fullName is discarded\\\\n\\\\nSo a value you wrote can differ from the value that lands in the row.\\\\nRe-read after writing if you need the stored value. Prefer writing the\\\\nparts; `fullName` exists for the legacy readers that predate D0.\\\\n\\\\nReference has these as two columns from the start\\\\n(henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\\\\nthe port collapsed them, which is the D0 defect.\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\\\\nlegacy customers has a national code (1595/1595 empty), and fabricating\\\\none is a data violation that would block later legal identity checks\\\\n(owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\\\\nthe migration tool must write NULL and never '', which would collide on\\\\nthe second row.\\\\n\\\\nThree service-layer workarounds exist ONLY because this used to be\\\\nrequired, and they store the MOBILE NUMBER here:\\\\nadmin-customers.service.ts:625,685 and customer-auth.service.ts:258.\\\\nRetiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\"},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityNameRaw\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.new_city — the city name exactly as the customer typed it\\\\nat app sign-up (Major/CustomerController.php:36). Kept verbatim because\\\\nthe legacy city table has only 15 rows, so the typed name is often the only\\\\nrecord of where the customer is (172 customers; 43 match no known city).\\\\ncityId is set alongside it only on an exact, ي/ك-normalised name match.\\\\nLegacy sign-up also forced city_id = 5 (Tehran) on everyone\\\\n(Major/CustomerController.php:21), so for those rows the typed name, not\\\\ncityId, is the truth. Owner ruling 2026-10-07: keep both.\"},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CustomerKind\",\"default\":\"APP_SHOPKEEPER\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\\\\nBankerList / ShopkeeperList screens filter on.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy contact + shop columns, shown on the wholesale customer form and as\\\\n(hidden-by-default) columns in its grid.\"},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy mcode — the operator-assigned customer code.\"},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertTradingFor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set only on the one Customer row that acts as a sales expert's own trading\\\\naccount (see SalesExpertProfile.tradingCustomerId). Empty for every\\\\nordinary customer.\"},{\"name\":\"referredOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy orders that named THIS customer as their referrer — see\\\\nOrder.referrerCustomerId. History only.\"},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingGoldBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Balance as last read from the accounting software (D27), in the app's own\\\\nsign convention (positive = owes). Shown to the customer when the\\\\nintegration is on; the credit-limit check still uses goldDebtGrams above.\\\\nNull until the first successful sync.\"},{\"name\":\"accountingRialBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingBalanceAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"makingChargeOffsetPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `customers.percent` — the per-customer making-charge offset. It is\\\\nADDED to the variant's making charge when pricing an order line\\\\n(henza_pwa src/Mixins/product/index.ts:69-75:\\\\ngetWage(v) = state.percent + v.percentage_pay)\\\\nand it shifts the catalogue making-charge filter bounds\\\\n(ApiMobileController.php:391-396,76-77). It is NOT part of the price\\\\nformula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\\\\n\\\\nNOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\\\\nNOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\\\\n\\\\nDB default 0 keeps every existing customer's price unchanged. The\\\\nreference's application-layer default for NEW customers is 3\\\\n(AdminController.php:338) and the field is required on create (:354).\"},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationRejectionReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Why verification was rejected (VerificationStep.REJECTED).\\\\n\\\\nLegacy recorded NO reason: none of its 49 `customers` columns is a\\\\nreason/note field, and on rejection it only sent a fixed SMS. So the 14\\\\nrows migrated from the legacy system carry the sentinel\\\\n«رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\\\\nknows why it is blank (owner ruling 2026-10-07). The migration tool\\\\nwrites it only WHERE this IS NULL, so a re-run cannot overwrite a real\\\\nreason entered in the new system.\"},{\"name\":\"verificationRejectedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"NULL for rows migrated from the legacy system — it recorded no rejection time.\"},{\"name\":\"birthDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\\\\nbirthday SMS / loyalty campaigns (owner ruling 2026-10-07).\\\\n\\\\n⚠ Legacy stores dates as JALALI STRINGS in other tables\\\\n(cashes.recive_date is varchar, 88/89 values starting \\\"14…\\\"), so this\\\\ntimestamp may hold mis-entered Jalali years. Confirm the calendar with\\\\ndocs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\\\\nwould produce 917 wrong birthdays, worse for an SMS campaign than none.\"},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\\\\nform. Legacy stored an FK to its Image table and read it back as a nested\\\\n`image: { id, image }`, so this is a relation, not a bare URL string.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canPlaceOrders\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had TWO independent switches on a customer:\\\\nsts -> may they place orders (this field)\\\\nactive -> is the account enabled (isActive, below)\\\\nThe port previously drove both from isActive; they are separate again.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isArchived\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy archive flag — the archived list filtered on this, not on isActive.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activityLogs\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerActivityLog\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"otpChallenges\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerOtp\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favorites\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerFavorite\":{\"dbName\":null,\"fields\":[{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"customerId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `fav` (251 rows) — saved products. The target had no model for this,\\\\nso every customer's favourites would have been lost in the migration; the\\\\nowner confirmed on 2026-10-06 that they matter.\\\\n\\\\nLegacy `fav` has two columns and NO primary key. The composite key here\\\\nsupplies the constraint the source lacks (the precheck found 0 duplicate\\\\npairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\\\\nat a deleted customer and must be skipped.\\\\n\\\\nLegacy's denormalised `product.count_fav` counter is deliberately NOT\\\\nrecreated as a column — derive it from this table.\"},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Branch.address / phone — both are columns in the branch grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy GET branch/active/{id} toggles this.\"},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Workshop.address / phone — both are columns in the workshop grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The supervisor created alongside the workshop by the legacy Add form.\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[\"supervisorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":1,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.type — which storefront the category belongs to:\\\\n1 سایت | 2 اپلیکشن موبایل. Drives the \\\"type_str\\\" grid column.\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.image / icon — the grid renders the image, the storefront the icon.\"},{\"name\":\"iconUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"metaTag\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy meta tag + description, used for SEO on the site categories.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.product_code — the human-facing SKU shown in the grid.\"},{\"name\":\"showType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.show_type: 1 site, 2 mobile, 3 both.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockWeight\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Stock of the linked کارساخته as last read from the accounting software\\\\n(D27). Weight for gram-type items, count for count-type ones — whichever\\\\nthe software reports. At zero or below the product is unavailable in the\\\\napp (pre-order variants excepted). Null = not linked or never synced.\"},{\"name\":\"accountingStockCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favoritedBy\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"ProductImageRole\",\"default\":\"GALLERY\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\\\\nگالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\\\\nexisting rows and any generic \\\"just attach an image\\\" caller keep working.\"},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Variants that display this image. A gallery image may back several\\\\nvariants (one photo, several weights), which is why this is a plain\\\\none-to-many and not a join table.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"qty\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\\\\nqty 0 unless it is flagged pre-order, so both fields are required for that\\\\nguard to work (see apps/admin-panel/src/stores/cart.ts).\"},{\"name\":\"isPreOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy is_pre_order: orderable even at zero stock.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"color\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\"},{\"name\":\"rialWage\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy rial_pay — fixed Rial making charge per variant.\"},{\"name\":\"details\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy details — short description for variant.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy description — full description for variant.\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The gallery image shown for this variant, picked from its own product's\\\\nimages — never a re-uploaded copy. onDelete: SetNull because dropping an\\\\nimage must never cascade into the variant: OrderItem rows reference\\\\nvariants, so losing one would break order history.\"},{\"name\":\"image\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[\"imageId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channel\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderChannel\",\"default\":\"RETAIL\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which sales channel placed this order — see OrderChannel.\"},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The sales expert this order is credited to, fixed when it is placed:\\\\nthe customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\\\\nset once at creation (ApiMobileController.php:601) and never moved, so a\\\\ncustomer changing expert later does not move past sales or commission\\\\n(owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\\\\ncustomer's current referrer.\"},{\"name\":\"salesAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[\"salesAgentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referrerCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"History only: a legacy order whose `reagent_id` named a customer who is\\\\nnot a sales expert (one such customer, 17 orders in 2022). Legacy counted\\\\nthose orders in that customer's own «میزان فروش»; this keeps that figure\\\\nexact. Never set for a new order.\"},{\"name\":\"referrerCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[\"referrerCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[\"postedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"labName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Instrument metadata from the legacy \\\"cash\\\" document form. Which fields are\\\\nfilled depends on sourceType: a melted-gold receipt carries lab/hallmark and\\\\nthe pre-normalization weight, a cheque carries the account and bank, and a\\\\ntransfer carries its destination.\\\\nLegacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\"},{\"name\":\"hallmark\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bankName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transferTo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"originalValue\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight as handed over, BEFORE karat normalization (legacy original_value).\"},{\"name\":\"priceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Rial amount for cash/cheque documents (legacy price).\"},{\"name\":\"receivedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"},\"UserType\":{\"dbName\":\"user_type\",\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\\\\nrows keep their legacy identity rather than getting new cuids.\"},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"permissions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Permission\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Permission\":{\"dbName\":\"permission\",\"fields\":[{\"name\":\"rid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Dotted permission id, e.g. \\\"order.list\\\", \\\"persons.list.client.omde\\\".\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"rid\",\"userTypeId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Comment\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CommentStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replyToId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `reply_to`: a staff reply threads under the comment it answers.\"},{\"name\":\"replyTo\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[\"replyToId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replies\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Setting\":{\"dbName\":null,\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AccountingLink\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingEntityType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record's code in the accounting software (Tahesab Moshtari_Code /\\\\nZarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\"},{\"name\":\"externalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"origin\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\\\\nrow created from the accounting record), PUSHED (accounting record created\\\\nfrom the app row) or MANUAL (an admin typed the code).\"},{\"name\":\"snapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record as last read, for display only.\"},{\"name\":\"syncedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"entityType\",\"entityId\"],[\"provider\",\"entityType\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"entityId\"]},{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"One app row ↔ one record in the accounting software (customer account or\\\\nکارساخته).\"},\"AccountingOutbox\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingOutboxKind\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"AccountingOutboxStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nextAttemptAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastError\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalRef\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"What the accounting software returned as the document/record id.\"},{\"name\":\"progress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Per-step progress of multi-call jobs (a Zarrin document is one call per\\\\nline), so a failure resumes where it stopped.\"},{\"name\":\"lastRequest\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Last request/response, for the log screen. Never contains the token.\"},{\"name\":\"lastResponse\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"resolvedById\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Work to push to the accounting software. Written in the SAME transaction as\\\\nthe change that causes it, so an outage of the accounting software never\\\\nloses an event and never blocks the app.\"},\"AccountingIssue\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"message\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"data\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"resolvedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"kind\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"kind\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"Something a pull found that needs a human: an account with no mobile, two\\\\naccounts sharing one mobile, a کارساخته group with no category mapping.\"},\"Promotion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scope\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionScope\",\"default\":\"PRODUCT\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"usage\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionUsage\",\"default\":\"ONCE\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Percentage off, 0-100 (legacy discount_percent).\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"platform\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which storefront it shows on, mirroring Product.showType (legacy platform).\"},{\"name\":\"startsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Exactly one of these is populated, per `scope`.\"},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PromotionExclusion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"itemId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"type\",\"itemId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"type\",\"itemId\"]}],\"isGenerated\":false,\"documentation\":\"Legacy \\\"ignore\\\" table (views/offersIgnore) — specific products, categories,\\\\ncustomers or brands excluded from the automatic discount engine.\\\\nLegacy posts { type, item_id[] }: \\\"type\\\" reuses the promotion scope codes\\\\n(1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \\\"itemId\\\" is the excluded row.\"},\"BranchAllocation\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocatorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `allocator_user` — the admin who filed the allocation.\"},{\"name\":\"allocatorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[\"allocatorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"BranchAllocationItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocation\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[\"allocationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"weightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight snapshot at allocation time, so later catalog edits do not rewrite history.\"}],\"primaryKey\":null,\"uniqueFields\":[[\"allocationId\",\"productId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"allocationId\",\"productId\"]}],\"isGenerated\":false},\"SmsMessage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MessageAudience\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Comma-separated recipients for the SINGLE/MULTIPLE audiences.\"},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How many numbers the send actually resolved to.\"},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"MessageAudience\",\"default\":\"ALL_CUSTOMERS\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"NotificationRecipient\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notificationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notification\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[\"notificationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"readAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"notificationId\",\"customerId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"notificationId\",\"customerId\"]}],\"isGenerated\":false,\"documentation\":\"Per-customer delivery + read state — legacy `GET notify/read/{id}`.\"},\"NewsletterSubscriber\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"email\"],[\"mobile\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"email\"]},{\"name\":null,\"fields\":[\"mobile\"]}],\"isGenerated\":false,\"documentation\":\"Legacy views/newsletters — the mailing-list signups collected by the site.\"},\"CustomerActivityLog\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"action\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\"},{\"name\":\"detail\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy views/statics — the customer activity log the \\\"آمار\\\" screen reads\\\\n(`log/list/customer`, `log/ago/{customerId}`).\"},\"UploadedFile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Public URL the stored file is served from.\"},{\"name\":\"originalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mimeType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeBytes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"purpose\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form tag for what the file belongs to, e.g. 'product', 'category',\\\\n'customer.nationalId'. Kept loose so a new form needs no schema change.\"},{\"name\":\"uploadedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"FileUploader\",\"relationFromFields\":[\"uploadedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerOtp\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Normalised to English digits before storing, as the reference does with\\\\nUtility::faTOen() on both send and verify.\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"codeHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"bcrypt hash of the 4-digit code. Never the code itself.\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Failed verify attempts against THIS challenge.\"},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the code is accepted, so one challenge cannot be reused.\"},{\"name\":\"requestIp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Kept for the per-IP send throttle.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"One OTP login challenge for a customer.\\\\n\\\\nPorts henza_server's flow (ApiMobileController.php:39-78), where userAuth\\\\ngenerated rand(1000,9999), stored it on the customer row as `send_password`\\\\nand sent it by SMS, and userVerfiy compared the submitted code against it\\\\n(mismatch -> HTTP 422).\\\\n\\\\nThree deliberate improvements over the reference, approved by the user\\\\n(docs/parity/DECISIONS.md D6 and T1):\\\\n1. the code is stored as a bcrypt hash, never in plain text — the\\\\nreference kept it readable in a customer column;\\\\n2. it expires (`expiresAt`) — the reference's code stayed valid forever;\\\\n3. attempts are counted and the challenge locks out — the reference had\\\\nno limit at all.\\\\nThe parity behaviour itself is the code comparison and the rejection.\"}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"CustomerKind\":{\"values\":[{\"name\":\"SALES_AGENT\",\"dbName\":null},{\"name\":\"APP_SHOPKEEPER\",\"dbName\":null},{\"name\":\"WALK_IN_SHOPKEEPER\",\"dbName\":null},{\"name\":\"BANKER\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"RETAIL\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Customer.type — what kind of wholesale customer this is. Values and\\\\nlabels taken verbatim from bulkCustomer.vue's userTypes list.\\\\n\\\\nSALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\\\\nCustomer row with type=1, but the redesigned system models a sales agent\\\\nas an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\\\\nand admin-customers.service.ts's listReagents()/create(). No Customer row\\\\nshould be created with kind SALES_AGENT going forward; the value is kept\\\\nonly so legacyTypeToKind()/kindToLegacyType() stay total functions and any\\\\nalready-migrated data keeps a readable label.\\\\n\\\\nRETAIL marks a \\\"تک\\\" (single/retail) customer — legacy kept these in an\\\\nentirely separate table (SingleCustomer/`login`) that could never contain\\\\na wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\\\\ninto one Customer model, so this value is what listSingle() now filters on\\\\nto reproduce that same separation.\"},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null,\"documentation\":\"Legacy had THREE states per step, not two\\\\n(MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\\\\n3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\\\\ncases back in the review queue, so the owner ruled it out (2026-10-07).\\\\n14 legacy rows land here; see Customer.verificationRejectionReason.\"}],\"dbName\":null},\"OrderChannel\":{\"values\":[{\"name\":\"RETAIL\",\"dbName\":null},{\"name\":\"WHOLESALE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy kept retail and wholesale orders in two SEPARATE tables\\\\n(orders_orders vs orders). The redesigned schema has one Order model, so the\\\\ndistinction lives here instead.\"},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null},\"ProductImageRole\":{\"values\":[{\"name\":\"FEATURED\",\"dbName\":null},{\"name\":\"FEATURED_MOBILE\",\"dbName\":null},{\"name\":\"GALLERY\",\"dbName\":null},{\"name\":\"GALLERY_MOBILE\",\"dbName\":null}],\"dbName\":null},\"CommentStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"APPROVED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null}],\"dbName\":null},\"AccountingEntityType\":{\"values\":[{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"PRODUCT\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxKind\":{\"values\":[{\"name\":\"CUSTOMER_PUSH\",\"dbName\":null},{\"name\":\"PRODUCT_PUSH\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT_DELETE\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"SENDING\",\"dbName\":null,\"documentation\":\"A call was in flight. Found at startup, it means the process died mid-call\\\\nand the outcome is unknown — see AccountingOutboxWorker.\"},{\"name\":\"SENT\",\"dbName\":null},{\"name\":\"FAILED\",\"dbName\":null},{\"name\":\"NEEDS_REVIEW\",\"dbName\":null,\"documentation\":\"Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\\\\nidempotency key, so a blind retry could post the document twice).\"},{\"name\":\"RESOLVED\",\"dbName\":null,\"documentation\":\"Closed by an admin from the log screen.\"}],\"dbName\":null},\"PromotionScope\":{\"values\":[{\"name\":\"PRODUCT\",\"dbName\":null},{\"name\":\"CATEGORY\",\"dbName\":null},{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"BRAND\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.type — what the discount is scoped to.\"},\"PromotionUsage\":{\"values\":[{\"name\":\"ONCE\",\"dbName\":null},{\"name\":\"UNTIL_END_DATE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.use_only — how often a customer may redeem it.\"},\"MessageAudience\":{\"values\":[{\"name\":\"SINGLE_NUMBER\",\"dbName\":null},{\"name\":\"MULTIPLE_NUMBERS\",\"dbName\":null},{\"name\":\"ALL_CUSTOMERS\",\"dbName\":null},{\"name\":\"WHOLESALE_CUSTOMERS\",\"dbName\":null},{\"name\":\"RETAIL_CUSTOMERS\",\"dbName\":null},{\"name\":\"SALES_AGENTS\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Who an SMS or notification was aimed at. Legacy's sms/create offered these\\\\naudiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\"}},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Restrict\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"percent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy cities.percent / percent_aux — per-city wage surcharges the city\\\\nscreen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\"},{\"name\":\"percentAux\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertProfiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `cities` is a tree (country > province > city > district) and so is\\\\nthis: a city hangs under its `parent`. In the admin pickers a top-level row\\\\n(the country) is a heading, not selectable (henza_admin citiesModel.js:38).\"},\"Admin\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Never SALES_EXPERT — that role lives in AdminUser. Enforced in\\\\nAdminUsersService, not in the database, so the enum stays shared.\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisedWorkshops\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchAllocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentSmsMessages\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SmsMessage\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentNotifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"FileUploader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sessions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminSession\",\"relationName\":\"AdminToAdminSession\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Issued admin-panel tokens, recorded only while session tracking is on\\\\n(AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\\\\ntoken can be revoked before it expires. See AdminSession.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"A staff account for the ADMIN PANEL — and nothing else.\\\\n\\\\nSplit out of AdminUser (which now holds sales experts only) so that:\\\\n* the same mobile can be an admin AND a sales expert — they are two\\\\nseparate roles, each unique only within its own table;\\\\n* the expert table (production: ~12,000 rows) is never written by panel\\\\nstaff management.\\\\nMigration 20261026120000_split_admin_table copies the existing non-expert\\\\nAdminUser rows here WITH THEIR IDS, so issued panel tokens and every\\\\n\\\"who did this\\\" column keep resolving. The old rows are left in AdminUser,\\\\ndormant; no code reads them as admins any more.\\\\n\\\\n⚠️ fullName/firstName/lastName are kept in sync by the DB trigger\\\\n`admin_sync_full_name_trg` (it shares the function admin_user_sync_full_name) — same semantics as AdminUser: the parts win.\"},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\\\\nmigration 20260922180000. Prisma cannot see it, so a write here may store\\\\nsomething other than what you passed:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; the submitted fullName is\\\\ndiscarded\\\\n\\\\nRe-read after writing if you need the stored value. Same arrangement as\\\\nCustomer (D0 requirement 7 — the split applies to ALL admins, not only\\\\nsales experts).\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\\\\nthe coarse `role` enum above is retained for the business rules that already\\\\nswitch on it. Nullable so existing seeded admins remain valid.\"},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy stored a sales agent as a `customers` row with type=1, so\\\\nReagentCustomer.vue's shared form collected these alongside the\\\\nwholesale-customer fields. A sales agent is now an AdminUser\\\\n(role=SALES_EXPERT), so these live here instead — only ever set for that\\\\nrole; every other AdminUser leaves them null.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"creditedOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Orders credited to this sales expert — see Order.salesAgentId.\"},{\"name\":\"salesExpertProfile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Only ever set for role = SALES_EXPERT (D17).\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"A SALES EXPERT (role SALES_EXPERT). Panel staff live in `Admin`; rows here with\\\\nany other role are pre-split leftovers and are ignored by the code.\"},\"AppSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"subjectId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Customer.id, or AdminUser.id when subjectType is \\\"sales-expert\\\".\"},{\"name\":\"subjectType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was confirmed by the central IAM: its session id (`sid`)\\\\nand stable user id (`sub`), which is what a back-channel logout arrives with.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued APP token (customer app / sales-expert app), so it can be revoked\\\\nbefore it expires — the counterpart of AdminSession for the other token family.\\\\n\\\\nWHY A SEPARATE TABLE AND NO FOREIGN KEY\\\\n---------------------------------------\\\\nAn app token's `sub` is a Customer id for a customer and an **AdminUser id**\\\\nfor a sales expert (D21). One FK cannot point at two tables, so the subject is\\\\nstored as a plain id plus its type. The rows are short-lived operational data,\\\\nnot part of the accounting model, so the missing FK costs nothing here.\"},\"AdminSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"adminId\",\"dbName\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"admin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToAdminSession\",\"relationFromFields\":[\"adminId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was verified by the IAM: its session id (`sid`) and the\\\\nstable user id (`sub`) there. Back-channel logout arrives keyed by these —\\\\ndeliberately here rather than as columns on AdminUser, so enabling the\\\\nfeature needs no change to an existing table.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued admin-panel JWT, so it can be revoked before it expires.\\\\n\\\\nWHY THIS EXISTS\\\\n---------------\\\\nThe admin token is self-contained and valid for 12h, which means nothing —\\\\nnot disabling the account, not a central \\\"sign out everywhere\\\" — could cut a\\\\nsession short: the token kept working until it expired. With the central IAM\\\\nin the loop that gap became visible (an IAM session revocation had no effect\\\\nhere), so every issued token now carries a `jti` recorded on this table and\\\\nJwtStrategy refuses a token whose row is revoked.\\\\n\\\\nRows are written ONLY while tracking is enabled, and JwtStrategy only\\\\nenforces them while it is enabled, so a deployment that does not want the\\\\nextra lookup behaves exactly as before.\"},\"SalesExpertProfile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[\"adminUserId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.city_id — a filterable grid column\\\\n(ReagentListModel.js:14) and the source of the commission autofill\\\\n(ReagentCustomer.vue:215-228).\"},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"gramLevel\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\\\\nDecimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\\\\ncredit limit has identical precision on both tables.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\\\\nstores both and reads neither back; kept so the form matches it. Neither\\\\nis unique and neither has a validation rule in the reference — inventing\\\\none would reject data the reference accepts.\"},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"tradingCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The Customer row carrying this expert's OWN orders, debt and credit limit.\\\\n\\\\nThe reference stored a sales agent AS a Customer (type=1), so an order the\\\\nagent placed from the app was simply their own, against their own\\\\ngram_level (ApiMobileController.php:534-535). Here the expert is an\\\\nAdminUser (D17), which has no ledger and cannot be an Order's subject, so\\\\nthis one linked Customer plays that part.\\\\n\\\\nDistinct from the expert's REFERRED customers, which are ordinary Customer\\\\nrows pointing at the AdminUser through Customer.referredByAgentId.\\\\n\\\\nNull until the expert first signs into the app, when it is created from\\\\nthis profile. See D21.\"},{\"name\":\"tradingCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[\"tradingCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"The sales-expert fields legacy kept on the `customers` row (type=1) and that\\\\nwere lost when a sales expert became an AdminUser (D17).\\\\n\\\\nA separate table rather than columns on AdminUser: these are meaningful only\\\\nfor role = SALES_EXPERT and would be permanently null for every other admin.\\\\nA row is created for every SALES_EXPERT by the migration, and upserted by the\\\\nservice whenever one is created or a user's role becomes SALES_EXPERT — but\\\\nreaders still left-join, so a missing profile degrades to nulls rather than\\\\ndropping the agent from the grid.\\\\n\\\\n`reagent_id` is deliberately NOT here — see D17: in the reference it was a\\\\nside effect of the shared customers form, and filling it removed that expert\\\\nfrom the selectable-agent list (queryReagent, AdminController.php:420).\"},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\\\\nTRIGGER — `customer_sync_full_name`, created in migration\\\\n20260922120000_customer_name_parts. Prisma does not know about it, so a\\\\nwrite here is NOT the whole story:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; fullName is overwritten\\\\nwith \\\"first last\\\" and whatever you passed for fullName is discarded\\\\n\\\\nSo a value you wrote can differ from the value that lands in the row.\\\\nRe-read after writing if you need the stored value. Prefer writing the\\\\nparts; `fullName` exists for the legacy readers that predate D0.\\\\n\\\\nReference has these as two columns from the start\\\\n(henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\\\\nthe port collapsed them, which is the D0 defect.\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\\\\nlegacy customers has a national code (1595/1595 empty), and fabricating\\\\none is a data violation that would block later legal identity checks\\\\n(owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\\\\nthe migration tool must write NULL and never '', which would collide on\\\\nthe second row.\\\\n\\\\nThree service-layer workarounds exist ONLY because this used to be\\\\nrequired, and they store the MOBILE NUMBER here:\\\\nadmin-customers.service.ts:625,685 and customer-auth.service.ts:258.\\\\nRetiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\"},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityNameRaw\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.new_city — the city name exactly as the customer typed it\\\\nat app sign-up (Major/CustomerController.php:36). Kept verbatim because\\\\nthe legacy city table has only 15 rows, so the typed name is often the only\\\\nrecord of where the customer is (172 customers; 43 match no known city).\\\\ncityId is set alongside it only on an exact, ي/ك-normalised name match.\\\\nLegacy sign-up also forced city_id = 5 (Tehran) on everyone\\\\n(Major/CustomerController.php:21), so for those rows the typed name, not\\\\ncityId, is the truth. Owner ruling 2026-10-07: keep both.\"},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CustomerKind\",\"default\":\"APP_SHOPKEEPER\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\\\\nBankerList / ShopkeeperList screens filter on.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy contact + shop columns, shown on the wholesale customer form and as\\\\n(hidden-by-default) columns in its grid.\"},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy mcode — the operator-assigned customer code.\"},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertTradingFor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set only on the one Customer row that acts as a sales expert's own trading\\\\naccount (see SalesExpertProfile.tradingCustomerId). Empty for every\\\\nordinary customer.\"},{\"name\":\"referredOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy orders that named THIS customer as their referrer — see\\\\nOrder.referrerCustomerId. History only.\"},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingGoldBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Balance as last read from the accounting software (D27), in the app's own\\\\nsign convention (positive = owes). Shown to the customer when the\\\\nintegration is on; the credit-limit check still uses goldDebtGrams above.\\\\nNull until the first successful sync.\"},{\"name\":\"accountingRialBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingBalanceAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"makingChargeOffsetPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `customers.percent` — the per-customer making-charge offset. It is\\\\nADDED to the variant's making charge when pricing an order line\\\\n(henza_pwa src/Mixins/product/index.ts:69-75:\\\\ngetWage(v) = state.percent + v.percentage_pay)\\\\nand it shifts the catalogue making-charge filter bounds\\\\n(ApiMobileController.php:391-396,76-77). It is NOT part of the price\\\\nformula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\\\\n\\\\nNOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\\\\nNOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\\\\n\\\\nDB default 0 keeps every existing customer's price unchanged. The\\\\nreference's application-layer default for NEW customers is 3\\\\n(AdminController.php:338) and the field is required on create (:354).\"},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationRejectionReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Why verification was rejected (VerificationStep.REJECTED).\\\\n\\\\nLegacy recorded NO reason: none of its 49 `customers` columns is a\\\\nreason/note field, and on rejection it only sent a fixed SMS. So the 14\\\\nrows migrated from the legacy system carry the sentinel\\\\n«رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\\\\nknows why it is blank (owner ruling 2026-10-07). The migration tool\\\\nwrites it only WHERE this IS NULL, so a re-run cannot overwrite a real\\\\nreason entered in the new system.\"},{\"name\":\"verificationRejectedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"NULL for rows migrated from the legacy system — it recorded no rejection time.\"},{\"name\":\"birthDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\\\\nbirthday SMS / loyalty campaigns (owner ruling 2026-10-07).\\\\n\\\\n⚠ Legacy stores dates as JALALI STRINGS in other tables\\\\n(cashes.recive_date is varchar, 88/89 values starting \\\"14…\\\"), so this\\\\ntimestamp may hold mis-entered Jalali years. Confirm the calendar with\\\\ndocs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\\\\nwould produce 917 wrong birthdays, worse for an SMS campaign than none.\"},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\\\\nform. Legacy stored an FK to its Image table and read it back as a nested\\\\n`image: { id, image }`, so this is a relation, not a bare URL string.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canPlaceOrders\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had TWO independent switches on a customer:\\\\nsts -> may they place orders (this field)\\\\nactive -> is the account enabled (isActive, below)\\\\nThe port previously drove both from isActive; they are separate again.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isArchived\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy archive flag — the archived list filtered on this, not on isActive.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activityLogs\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerActivityLog\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"otpChallenges\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerOtp\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favorites\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerFavorite\":{\"dbName\":null,\"fields\":[{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"customerId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `fav` (251 rows) — saved products. The target had no model for this,\\\\nso every customer's favourites would have been lost in the migration; the\\\\nowner confirmed on 2026-10-06 that they matter.\\\\n\\\\nLegacy `fav` has two columns and NO primary key. The composite key here\\\\nsupplies the constraint the source lacks (the precheck found 0 duplicate\\\\npairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\\\\nat a deleted customer and must be skipped.\\\\n\\\\nLegacy's denormalised `product.count_fav` counter is deliberately NOT\\\\nrecreated as a column — derive it from this table.\"},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Branch.address / phone — both are columns in the branch grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy GET branch/active/{id} toggles this.\"},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"admins\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Workshop.address / phone — both are columns in the workshop grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The supervisor created alongside the workshop by the legacy Add form.\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[\"supervisorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":1,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.type — which storefront the category belongs to:\\\\n1 سایت | 2 اپلیکشن موبایل. Drives the \\\"type_str\\\" grid column.\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.image / icon — the grid renders the image, the storefront the icon.\"},{\"name\":\"iconUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"metaTag\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy meta tag + description, used for SEO on the site categories.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.product_code — the human-facing SKU shown in the grid.\"},{\"name\":\"showType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.show_type: 1 site, 2 mobile, 3 both.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockWeight\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Stock of the linked کارساخته as last read from the accounting software\\\\n(D27). Weight for gram-type items, count for count-type ones — whichever\\\\nthe software reports. At zero or below the product is unavailable in the\\\\napp (pre-order variants excepted). Null = not linked or never synced.\"},{\"name\":\"accountingStockCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favoritedBy\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"ProductImageRole\",\"default\":\"GALLERY\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\\\\nگالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\\\\nexisting rows and any generic \\\"just attach an image\\\" caller keep working.\"},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Variants that display this image. A gallery image may back several\\\\nvariants (one photo, several weights), which is why this is a plain\\\\none-to-many and not a join table.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"qty\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\\\\nqty 0 unless it is flagged pre-order, so both fields are required for that\\\\nguard to work (see apps/admin-panel/src/stores/cart.ts).\"},{\"name\":\"isPreOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy is_pre_order: orderable even at zero stock.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"color\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\"},{\"name\":\"rialWage\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy rial_pay — fixed Rial making charge per variant.\"},{\"name\":\"details\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy details — short description for variant.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy description — full description for variant.\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The gallery image shown for this variant, picked from its own product's\\\\nimages — never a re-uploaded copy. onDelete: SetNull because dropping an\\\\nimage must never cascade into the variant: OrderItem rows reference\\\\nvariants, so losing one would break order history.\"},{\"name\":\"image\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[\"imageId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channel\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderChannel\",\"default\":\"RETAIL\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which sales channel placed this order — see OrderChannel.\"},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The sales expert this order is credited to, fixed when it is placed:\\\\nthe customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\\\\nset once at creation (ApiMobileController.php:601) and never moved, so a\\\\ncustomer changing expert later does not move past sales or commission\\\\n(owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\\\\ncustomer's current referrer.\"},{\"name\":\"salesAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[\"salesAgentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referrerCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"History only: a legacy order whose `reagent_id` named a customer who is\\\\nnot a sales expert (one such customer, 17 orders in 2022). Legacy counted\\\\nthose orders in that customer's own «میزان فروش»; this keeps that figure\\\\nexact. Never set for a new order.\"},{\"name\":\"referrerCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[\"referrerCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminId\",\"dbName\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminId\",\"dbName\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminId\",\"dbName\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToLedgerEntry\",\"relationFromFields\":[\"postedByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"labName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Instrument metadata from the legacy \\\"cash\\\" document form. Which fields are\\\\nfilled depends on sourceType: a melted-gold receipt carries lab/hallmark and\\\\nthe pre-normalization weight, a cheque carries the account and bank, and a\\\\ntransfer carries its destination.\\\\nLegacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\"},{\"name\":\"hallmark\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bankName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transferTo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"originalValue\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight as handed over, BEFORE karat normalization (legacy original_value).\"},{\"name\":\"priceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Rial amount for cash/cheque documents (legacy price).\"},{\"name\":\"receivedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"},\"UserType\":{\"dbName\":\"user_type\",\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\\\\nrows keep their legacy identity rather than getting new cuids.\"},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"permissions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Permission\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"admins\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Permission\":{\"dbName\":\"permission\",\"fields\":[{\"name\":\"rid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Dotted permission id, e.g. \\\"order.list\\\", \\\"persons.list.client.omde\\\".\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"rid\",\"userTypeId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Comment\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CommentStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replyToId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `reply_to`: a staff reply threads under the comment it answers.\"},{\"name\":\"replyTo\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[\"replyToId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replies\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Setting\":{\"dbName\":null,\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AccountingLink\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingEntityType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record's code in the accounting software (Tahesab Moshtari_Code /\\\\nZarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\"},{\"name\":\"externalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"origin\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\\\\nrow created from the accounting record), PUSHED (accounting record created\\\\nfrom the app row) or MANUAL (an admin typed the code).\"},{\"name\":\"snapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record as last read, for display only.\"},{\"name\":\"syncedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"entityType\",\"entityId\"],[\"provider\",\"entityType\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"entityId\"]},{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"One app row ↔ one record in the accounting software (customer account or\\\\nکارساخته).\"},\"AccountingOutbox\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingOutboxKind\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"AccountingOutboxStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nextAttemptAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastError\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalRef\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"What the accounting software returned as the document/record id.\"},{\"name\":\"progress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Per-step progress of multi-call jobs (a Zarrin document is one call per\\\\nline), so a failure resumes where it stopped.\"},{\"name\":\"lastRequest\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Last request/response, for the log screen. Never contains the token.\"},{\"name\":\"lastResponse\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"resolvedById\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Work to push to the accounting software. Written in the SAME transaction as\\\\nthe change that causes it, so an outage of the accounting software never\\\\nloses an event and never blocks the app.\"},\"AccountingIssue\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"message\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"data\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"resolvedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"kind\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"kind\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"Something a pull found that needs a human: an account with no mobile, two\\\\naccounts sharing one mobile, a کارساخته group with no category mapping.\"},\"Promotion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scope\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionScope\",\"default\":\"PRODUCT\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"usage\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionUsage\",\"default\":\"ONCE\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Percentage off, 0-100 (legacy discount_percent).\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"platform\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which storefront it shows on, mirroring Product.showType (legacy platform).\"},{\"name\":\"startsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Exactly one of these is populated, per `scope`.\"},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PromotionExclusion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"itemId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"type\",\"itemId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"type\",\"itemId\"]}],\"isGenerated\":false,\"documentation\":\"Legacy \\\"ignore\\\" table (views/offersIgnore) — specific products, categories,\\\\ncustomers or brands excluded from the automatic discount engine.\\\\nLegacy posts { type, item_id[] }: \\\"type\\\" reuses the promotion scope codes\\\\n(1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \\\"itemId\\\" is the excluded row.\"},\"BranchAllocation\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocatorAdminId\",\"dbName\":\"allocatorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `allocator_user` — the admin who filed the allocation.\"},{\"name\":\"allocatorAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[\"allocatorAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"BranchAllocationItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocation\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[\"allocationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"weightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight snapshot at allocation time, so later catalog edits do not rewrite history.\"}],\"primaryKey\":null,\"uniqueFields\":[[\"allocationId\",\"productId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"allocationId\",\"productId\"]}],\"isGenerated\":false},\"SmsMessage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MessageAudience\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Comma-separated recipients for the SINGLE/MULTIPLE audiences.\"},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How many numbers the send actually resolved to.\"},{\"name\":\"sentByAdminId\",\"dbName\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[\"sentByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"MessageAudience\",\"default\":\"ALL_CUSTOMERS\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminId\",\"dbName\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[\"sentByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"NotificationRecipient\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notificationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notification\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[\"notificationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"readAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"notificationId\",\"customerId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"notificationId\",\"customerId\"]}],\"isGenerated\":false,\"documentation\":\"Per-customer delivery + read state — legacy `GET notify/read/{id}`.\"},\"NewsletterSubscriber\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"email\"],[\"mobile\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"email\"]},{\"name\":null,\"fields\":[\"mobile\"]}],\"isGenerated\":false,\"documentation\":\"Legacy views/newsletters — the mailing-list signups collected by the site.\"},\"CustomerActivityLog\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"action\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\"},{\"name\":\"detail\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy views/statics — the customer activity log the \\\"آمار\\\" screen reads\\\\n(`log/list/customer`, `log/ago/{customerId}`).\"},\"UploadedFile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Public URL the stored file is served from.\"},{\"name\":\"originalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mimeType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeBytes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"purpose\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form tag for what the file belongs to, e.g. 'product', 'category',\\\\n'customer.nationalId'. Kept loose so a new form needs no schema change.\"},{\"name\":\"uploadedByAdminId\",\"dbName\":\"uploadedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"FileUploader\",\"relationFromFields\":[\"uploadedByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerOtp\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Normalised to English digits before storing, as the reference does with\\\\nUtility::faTOen() on both send and verify.\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"codeHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"bcrypt hash of the 4-digit code. Never the code itself.\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Failed verify attempts against THIS challenge.\"},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the code is accepted, so one challenge cannot be reused.\"},{\"name\":\"requestIp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Kept for the per-IP send throttle.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"One OTP login challenge for a customer.\\\\n\\\\nPorts henza_server's flow (ApiMobileController.php:39-78), where userAuth\\\\ngenerated rand(1000,9999), stored it on the customer row as `send_password`\\\\nand sent it by SMS, and userVerfiy compared the submitted code against it\\\\n(mismatch -> HTTP 422).\\\\n\\\\nThree deliberate improvements over the reference, approved by the user\\\\n(docs/parity/DECISIONS.md D6 and T1):\\\\n1. the code is stored as a bcrypt hash, never in plain text — the\\\\nreference kept it readable in a customer column;\\\\n2. it expires (`expiresAt`) — the reference's code stayed valid forever;\\\\n3. attempts are counted and the challenge locks out — the reference had\\\\nno limit at all.\\\\nThe parity behaviour itself is the code comparison and the rejection.\"}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"CustomerKind\":{\"values\":[{\"name\":\"SALES_AGENT\",\"dbName\":null},{\"name\":\"APP_SHOPKEEPER\",\"dbName\":null},{\"name\":\"WALK_IN_SHOPKEEPER\",\"dbName\":null},{\"name\":\"BANKER\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"RETAIL\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Customer.type — what kind of wholesale customer this is. Values and\\\\nlabels taken verbatim from bulkCustomer.vue's userTypes list.\\\\n\\\\nSALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\\\\nCustomer row with type=1, but the redesigned system models a sales agent\\\\nas an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\\\\nand admin-customers.service.ts's listReagents()/create(). No Customer row\\\\nshould be created with kind SALES_AGENT going forward; the value is kept\\\\nonly so legacyTypeToKind()/kindToLegacyType() stay total functions and any\\\\nalready-migrated data keeps a readable label.\\\\n\\\\nRETAIL marks a \\\"تک\\\" (single/retail) customer — legacy kept these in an\\\\nentirely separate table (SingleCustomer/`login`) that could never contain\\\\na wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\\\\ninto one Customer model, so this value is what listSingle() now filters on\\\\nto reproduce that same separation.\"},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null,\"documentation\":\"Legacy had THREE states per step, not two\\\\n(MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\\\\n3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\\\\ncases back in the review queue, so the owner ruled it out (2026-10-07).\\\\n14 legacy rows land here; see Customer.verificationRejectionReason.\"}],\"dbName\":null},\"OrderChannel\":{\"values\":[{\"name\":\"RETAIL\",\"dbName\":null},{\"name\":\"WHOLESALE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy kept retail and wholesale orders in two SEPARATE tables\\\\n(orders_orders vs orders). The redesigned schema has one Order model, so the\\\\ndistinction lives here instead.\"},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null},\"ProductImageRole\":{\"values\":[{\"name\":\"FEATURED\",\"dbName\":null},{\"name\":\"FEATURED_MOBILE\",\"dbName\":null},{\"name\":\"GALLERY\",\"dbName\":null},{\"name\":\"GALLERY_MOBILE\",\"dbName\":null}],\"dbName\":null},\"CommentStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"APPROVED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null}],\"dbName\":null},\"AccountingEntityType\":{\"values\":[{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"PRODUCT\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxKind\":{\"values\":[{\"name\":\"CUSTOMER_PUSH\",\"dbName\":null},{\"name\":\"PRODUCT_PUSH\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT_DELETE\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"SENDING\",\"dbName\":null,\"documentation\":\"A call was in flight. Found at startup, it means the process died mid-call\\\\nand the outcome is unknown — see AccountingOutboxWorker.\"},{\"name\":\"SENT\",\"dbName\":null},{\"name\":\"FAILED\",\"dbName\":null},{\"name\":\"NEEDS_REVIEW\",\"dbName\":null,\"documentation\":\"Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\\\\nidempotency key, so a blind retry could post the document twice).\"},{\"name\":\"RESOLVED\",\"dbName\":null,\"documentation\":\"Closed by an admin from the log screen.\"}],\"dbName\":null},\"PromotionScope\":{\"values\":[{\"name\":\"PRODUCT\",\"dbName\":null},{\"name\":\"CATEGORY\",\"dbName\":null},{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"BRAND\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.type — what the discount is scoped to.\"},\"PromotionUsage\":{\"values\":[{\"name\":\"ONCE\",\"dbName\":null},{\"name\":\"UNTIL_END_DATE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.use_only — how often a customer may redeem it.\"},\"MessageAudience\":{\"values\":[{\"name\":\"SINGLE_NUMBER\",\"dbName\":null},{\"name\":\"MULTIPLE_NUMBERS\",\"dbName\":null},{\"name\":\"ALL_CUSTOMERS\",\"dbName\":null},{\"name\":\"WHOLESALE_CUSTOMERS\",\"dbName\":null},{\"name\":\"RETAIL_CUSTOMERS\",\"dbName\":null},{\"name\":\"SALES_AGENTS\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Who an SMS or notification was aimed at. Legacy's sms/create offered these\\\\naudiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\"}},\"types\":{}}") defineDmmfProperty(exports.Prisma, config.runtimeDataModel) config.engineWasm = undefined diff --git a/apps/api/release/vendor/.prisma/client/index-browser.js b/apps/api/release/vendor/.prisma/client/index-browser.js index 8625ae2..85baad2 100644 --- a/apps/api/release/vendor/.prisma/client/index-browser.js +++ b/apps/api/release/vendor/.prisma/client/index-browser.js @@ -130,6 +130,20 @@ exports.Prisma.CityScalarFieldEnum = { percentAux: 'percentAux' }; +exports.Prisma.AdminScalarFieldEnum = { + id: 'id', + fullName: 'fullName', + firstName: 'firstName', + lastName: 'lastName', + mobile: 'mobile', + passwordHash: 'passwordHash', + role: 'role', + userTypeId: 'userTypeId', + branchId: 'branchId', + isActive: 'isActive', + createdAt: 'createdAt' +}; + exports.Prisma.AdminUserScalarFieldEnum = { id: 'id', fullName: 'fullName', @@ -170,7 +184,7 @@ exports.Prisma.AppSessionScalarFieldEnum = { exports.Prisma.AdminSessionScalarFieldEnum = { id: 'id', jti: 'jti', - adminUserId: 'adminUserId', + adminId: 'adminId', iamSessionId: 'iamSessionId', iamSub: 'iamSub', ipAddress: 'ipAddress', @@ -370,7 +384,7 @@ exports.Prisma.OrderStatusEventScalarFieldEnum = { fromStatus: 'fromStatus', toStatus: 'toStatus', note: 'note', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', createdAt: 'createdAt' }; @@ -397,7 +411,7 @@ exports.Prisma.PreOrderStatusEventScalarFieldEnum = { id: 'id', preOrderId: 'preOrderId', changes: 'changes', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', ipAddress: 'ipAddress', createdAt: 'createdAt' }; @@ -414,7 +428,7 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { orderId: 'orderId', confirmed: 'confirmed', confirmedAt: 'confirmedAt', - postedByAdminUserId: 'postedByAdminUserId', + postedByAdminId: 'postedByAdminId', labName: 'labName', hallmark: 'hallmark', accountName: 'accountName', @@ -549,7 +563,7 @@ exports.Prisma.PromotionExclusionScalarFieldEnum = { exports.Prisma.BranchAllocationScalarFieldEnum = { id: 'id', branchId: 'branchId', - allocatorAdminUserId: 'allocatorAdminUserId', + allocatorAdminId: 'allocatorAdminId', note: 'note', createdAt: 'createdAt' }; @@ -567,7 +581,7 @@ exports.Prisma.SmsMessageScalarFieldEnum = { recipients: 'recipients', body: 'body', sentCount: 'sentCount', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -576,7 +590,7 @@ exports.Prisma.NotificationScalarFieldEnum = { title: 'title', body: 'body', audience: 'audience', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -609,7 +623,7 @@ exports.Prisma.UploadedFileScalarFieldEnum = { mimeType: 'mimeType', sizeBytes: 'sizeBytes', purpose: 'purpose', - uploadedByAdminUserId: 'uploadedByAdminUserId', + uploadedByAdminId: 'uploadedByAdminId', createdAt: 'createdAt' }; @@ -782,6 +796,7 @@ exports.MessageAudience = exports.$Enums.MessageAudience = { exports.Prisma.ModelName = { City: 'City', + Admin: 'Admin', AdminUser: 'AdminUser', AppSession: 'AppSession', AdminSession: 'AdminSession', diff --git a/apps/api/release/vendor/.prisma/client/index.d.ts b/apps/api/release/vendor/.prisma/client/index.d.ts index 664a174..2ed63d4 100644 --- a/apps/api/release/vendor/.prisma/client/index.d.ts +++ b/apps/api/release/vendor/.prisma/client/index.d.ts @@ -21,8 +21,27 @@ export type PrismaPromise = $Public.PrismaPromise */ export type City = $Result.DefaultSelection /** - * Model AdminUser + * Model Admin + * A staff account for the ADMIN PANEL — and nothing else. * + * Split out of AdminUser (which now holds sales experts only) so that: + * * the same mobile can be an admin AND a sales expert — they are two + * separate roles, each unique only within its own table; + * * the expert table (production: ~12,000 rows) is never written by panel + * staff management. + * Migration 20261026120000_split_admin_table copies the existing non-expert + * AdminUser rows here WITH THEIR IDS, so issued panel tokens and every + * "who did this" column keep resolving. The old rows are left in AdminUser, + * dormant; no code reads them as admins any more. + * + * ⚠️ fullName/firstName/lastName are kept in sync by the DB trigger + * `admin_sync_full_name_trg` (it shares the function admin_user_sync_full_name) — same semantics as AdminUser: the parts win. + */ +export type Admin = $Result.DefaultSelection +/** + * Model AdminUser + * A SALES EXPERT (role SALES_EXPERT). Panel staff live in `Admin`; rows here with + * any other role are pre-split leftovers and are ignored by the code. */ export type AdminUser = $Result.DefaultSelection /** @@ -680,6 +699,16 @@ export class PrismaClient< */ get city(): Prisma.CityDelegate; + /** + * `prisma.admin`: Exposes CRUD operations for the **Admin** model. + * Example usage: + * ```ts + * // Fetch zero or more Admins + * const admins = await prisma.admin.findMany() + * ``` + */ + get admin(): Prisma.AdminDelegate; + /** * `prisma.adminUser`: Exposes CRUD operations for the **AdminUser** model. * Example usage: @@ -1541,6 +1570,7 @@ export namespace Prisma { export const ModelName: { City: 'City', + Admin: 'Admin', AdminUser: 'AdminUser', AppSession: 'AppSession', AdminSession: 'AdminSession', @@ -1598,7 +1628,7 @@ export namespace Prisma { export type TypeMap = { meta: { - modelProps: "city" | "adminUser" | "appSession" | "adminSession" | "salesExpertProfile" | "customer" | "customerFavorite" | "customerAddress" | "branch" | "workshop" | "category" | "brand" | "collection" | "collectionProduct" | "product" | "productImage" | "productVariant" | "order" | "orderItem" | "orderStatusEvent" | "preOrder" | "preOrderStatusEvent" | "ledgerEntry" | "goldPriceQuote" | "walletBonus" | "userType" | "permission" | "comment" | "setting" | "accountingLink" | "accountingOutbox" | "accountingIssue" | "promotion" | "promotionExclusion" | "branchAllocation" | "branchAllocationItem" | "smsMessage" | "notification" | "notificationRecipient" | "newsletterSubscriber" | "customerActivityLog" | "uploadedFile" | "customerOtp" + modelProps: "city" | "admin" | "adminUser" | "appSession" | "adminSession" | "salesExpertProfile" | "customer" | "customerFavorite" | "customerAddress" | "branch" | "workshop" | "category" | "brand" | "collection" | "collectionProduct" | "product" | "productImage" | "productVariant" | "order" | "orderItem" | "orderStatusEvent" | "preOrder" | "preOrderStatusEvent" | "ledgerEntry" | "goldPriceQuote" | "walletBonus" | "userType" | "permission" | "comment" | "setting" | "accountingLink" | "accountingOutbox" | "accountingIssue" | "promotion" | "promotionExclusion" | "branchAllocation" | "branchAllocationItem" | "smsMessage" | "notification" | "notificationRecipient" | "newsletterSubscriber" | "customerActivityLog" | "uploadedFile" | "customerOtp" txIsolationLevel: Prisma.TransactionIsolationLevel } model: { @@ -1672,6 +1702,76 @@ export namespace Prisma { } } } + Admin: { + payload: Prisma.$AdminPayload + fields: Prisma.AdminFieldRefs + operations: { + findUnique: { + args: Prisma.AdminFindUniqueArgs + result: $Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.AdminFindUniqueOrThrowArgs + result: $Utils.PayloadToResult + } + findFirst: { + args: Prisma.AdminFindFirstArgs + result: $Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.AdminFindFirstOrThrowArgs + result: $Utils.PayloadToResult + } + findMany: { + args: Prisma.AdminFindManyArgs + result: $Utils.PayloadToResult[] + } + create: { + args: Prisma.AdminCreateArgs + result: $Utils.PayloadToResult + } + createMany: { + args: Prisma.AdminCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.AdminCreateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } + delete: { + args: Prisma.AdminDeleteArgs + result: $Utils.PayloadToResult + } + update: { + args: Prisma.AdminUpdateArgs + result: $Utils.PayloadToResult + } + deleteMany: { + args: Prisma.AdminDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.AdminUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.AdminUpsertArgs + result: $Utils.PayloadToResult + } + aggregate: { + args: Prisma.AdminAggregateArgs + result: $Utils.Optional + } + groupBy: { + args: Prisma.AdminGroupByArgs + result: $Utils.Optional[] + } + count: { + args: Prisma.AdminCountArgs + result: $Utils.Optional | number + } + } + } AdminUser: { payload: Prisma.$AdminUserPayload fields: Prisma.AdminUserFieldRefs @@ -4845,12 +4945,10 @@ export namespace Prisma { /** - * Count Type AdminUserCountOutputType + * Count Type AdminCountOutputType */ - export type AdminUserCountOutputType = { - referredCustomers: number - creditedOrders: number + export type AdminCountOutputType = { supervisedWorkshops: number branchAllocations: number postedLedgerEntries: number @@ -4862,18 +4960,105 @@ export namespace Prisma { sessions: number } + export type AdminCountOutputTypeSelect = { + supervisedWorkshops?: boolean | AdminCountOutputTypeCountSupervisedWorkshopsArgs + branchAllocations?: boolean | AdminCountOutputTypeCountBranchAllocationsArgs + postedLedgerEntries?: boolean | AdminCountOutputTypeCountPostedLedgerEntriesArgs + orderStatusEvents?: boolean | AdminCountOutputTypeCountOrderStatusEventsArgs + preOrderStatusEvents?: boolean | AdminCountOutputTypeCountPreOrderStatusEventsArgs + sentSmsMessages?: boolean | AdminCountOutputTypeCountSentSmsMessagesArgs + sentNotifications?: boolean | AdminCountOutputTypeCountSentNotificationsArgs + uploadedFiles?: boolean | AdminCountOutputTypeCountUploadedFilesArgs + sessions?: boolean | AdminCountOutputTypeCountSessionsArgs + } + + // Custom InputTypes + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the AdminCountOutputType + */ + select?: AdminCountOutputTypeSelect | null + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountSupervisedWorkshopsArgs = { + where?: WorkshopWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountBranchAllocationsArgs = { + where?: BranchAllocationWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountPostedLedgerEntriesArgs = { + where?: LedgerEntryWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountOrderStatusEventsArgs = { + where?: OrderStatusEventWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountPreOrderStatusEventsArgs = { + where?: PreOrderStatusEventWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountSentSmsMessagesArgs = { + where?: SmsMessageWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountSentNotificationsArgs = { + where?: NotificationWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountUploadedFilesArgs = { + where?: UploadedFileWhereInput + } + + /** + * AdminCountOutputType without action + */ + export type AdminCountOutputTypeCountSessionsArgs = { + where?: AdminSessionWhereInput + } + + + /** + * Count Type AdminUserCountOutputType + */ + + export type AdminUserCountOutputType = { + referredCustomers: number + creditedOrders: number + } + export type AdminUserCountOutputTypeSelect = { referredCustomers?: boolean | AdminUserCountOutputTypeCountReferredCustomersArgs creditedOrders?: boolean | AdminUserCountOutputTypeCountCreditedOrdersArgs - supervisedWorkshops?: boolean | AdminUserCountOutputTypeCountSupervisedWorkshopsArgs - branchAllocations?: boolean | AdminUserCountOutputTypeCountBranchAllocationsArgs - postedLedgerEntries?: boolean | AdminUserCountOutputTypeCountPostedLedgerEntriesArgs - orderStatusEvents?: boolean | AdminUserCountOutputTypeCountOrderStatusEventsArgs - preOrderStatusEvents?: boolean | AdminUserCountOutputTypeCountPreOrderStatusEventsArgs - sentSmsMessages?: boolean | AdminUserCountOutputTypeCountSentSmsMessagesArgs - sentNotifications?: boolean | AdminUserCountOutputTypeCountSentNotificationsArgs - uploadedFiles?: boolean | AdminUserCountOutputTypeCountUploadedFilesArgs - sessions?: boolean | AdminUserCountOutputTypeCountSessionsArgs } // Custom InputTypes @@ -4901,69 +5086,6 @@ export namespace Prisma { where?: OrderWhereInput } - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountSupervisedWorkshopsArgs = { - where?: WorkshopWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountBranchAllocationsArgs = { - where?: BranchAllocationWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountPostedLedgerEntriesArgs = { - where?: LedgerEntryWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountOrderStatusEventsArgs = { - where?: OrderStatusEventWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountPreOrderStatusEventsArgs = { - where?: PreOrderStatusEventWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountSentSmsMessagesArgs = { - where?: SmsMessageWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountSentNotificationsArgs = { - where?: NotificationWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountUploadedFilesArgs = { - where?: UploadedFileWhereInput - } - - /** - * AdminUserCountOutputType without action - */ - export type AdminUserCountOutputTypeCountSessionsArgs = { - where?: AdminSessionWhereInput - } - /** * Count Type CustomerCountOutputType @@ -5101,12 +5223,14 @@ export namespace Prisma { export type BranchCountOutputType = { adminUsers: number + admins: number orders: number allocations: number } export type BranchCountOutputTypeSelect = { adminUsers?: boolean | BranchCountOutputTypeCountAdminUsersArgs + admins?: boolean | BranchCountOutputTypeCountAdminsArgs orders?: boolean | BranchCountOutputTypeCountOrdersArgs allocations?: boolean | BranchCountOutputTypeCountAllocationsArgs } @@ -5129,6 +5253,13 @@ export namespace Prisma { where?: AdminUserWhereInput } + /** + * BranchCountOutputType without action + */ + export type BranchCountOutputTypeCountAdminsArgs = { + where?: AdminWhereInput + } + /** * BranchCountOutputType without action */ @@ -5529,11 +5660,13 @@ export namespace Prisma { export type UserTypeCountOutputType = { permissions: number adminUsers: number + admins: number } export type UserTypeCountOutputTypeSelect = { permissions?: boolean | UserTypeCountOutputTypeCountPermissionsArgs adminUsers?: boolean | UserTypeCountOutputTypeCountAdminUsersArgs + admins?: boolean | UserTypeCountOutputTypeCountAdminsArgs } // Custom InputTypes @@ -5561,6 +5694,13 @@ export namespace Prisma { where?: AdminUserWhereInput } + /** + * UserTypeCountOutputType without action + */ + export type UserTypeCountOutputTypeCountAdminsArgs = { + where?: AdminWhereInput + } + /** * Count Type CommentCountOutputType @@ -6835,6 +6975,1308 @@ export namespace Prisma { } + /** + * Model Admin + */ + + export type AggregateAdmin = { + _count: AdminCountAggregateOutputType | null + _avg: AdminAvgAggregateOutputType | null + _sum: AdminSumAggregateOutputType | null + _min: AdminMinAggregateOutputType | null + _max: AdminMaxAggregateOutputType | null + } + + export type AdminAvgAggregateOutputType = { + userTypeId: number | null + } + + export type AdminSumAggregateOutputType = { + userTypeId: number | null + } + + export type AdminMinAggregateOutputType = { + id: string | null + fullName: string | null + firstName: string | null + lastName: string | null + mobile: string | null + passwordHash: string | null + role: $Enums.AdminRole | null + userTypeId: number | null + branchId: string | null + isActive: boolean | null + createdAt: Date | null + } + + export type AdminMaxAggregateOutputType = { + id: string | null + fullName: string | null + firstName: string | null + lastName: string | null + mobile: string | null + passwordHash: string | null + role: $Enums.AdminRole | null + userTypeId: number | null + branchId: string | null + isActive: boolean | null + createdAt: Date | null + } + + export type AdminCountAggregateOutputType = { + id: number + fullName: number + firstName: number + lastName: number + mobile: number + passwordHash: number + role: number + userTypeId: number + branchId: number + isActive: number + createdAt: number + _all: number + } + + + export type AdminAvgAggregateInputType = { + userTypeId?: true + } + + export type AdminSumAggregateInputType = { + userTypeId?: true + } + + export type AdminMinAggregateInputType = { + id?: true + fullName?: true + firstName?: true + lastName?: true + mobile?: true + passwordHash?: true + role?: true + userTypeId?: true + branchId?: true + isActive?: true + createdAt?: true + } + + export type AdminMaxAggregateInputType = { + id?: true + fullName?: true + firstName?: true + lastName?: true + mobile?: true + passwordHash?: true + role?: true + userTypeId?: true + branchId?: true + isActive?: true + createdAt?: true + } + + export type AdminCountAggregateInputType = { + id?: true + fullName?: true + firstName?: true + lastName?: true + mobile?: true + passwordHash?: true + role?: true + userTypeId?: true + branchId?: true + isActive?: true + createdAt?: true + _all?: true + } + + export type AdminAggregateArgs = { + /** + * Filter which Admin to aggregate. + */ + where?: AdminWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Admins to fetch. + */ + orderBy?: AdminOrderByWithRelationInput | AdminOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: AdminWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Admins from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Admins. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Admins + **/ + _count?: true | AdminCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: AdminAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: AdminSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: AdminMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: AdminMaxAggregateInputType + } + + export type GetAdminAggregateType = { + [P in keyof T & keyof AggregateAdmin]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type AdminGroupByArgs = { + where?: AdminWhereInput + orderBy?: AdminOrderByWithAggregationInput | AdminOrderByWithAggregationInput[] + by: AdminScalarFieldEnum[] | AdminScalarFieldEnum + having?: AdminScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: AdminCountAggregateInputType | true + _avg?: AdminAvgAggregateInputType + _sum?: AdminSumAggregateInputType + _min?: AdminMinAggregateInputType + _max?: AdminMaxAggregateInputType + } + + export type AdminGroupByOutputType = { + id: string + fullName: string + firstName: string | null + lastName: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId: number | null + branchId: string | null + isActive: boolean + createdAt: Date + _count: AdminCountAggregateOutputType | null + _avg: AdminAvgAggregateOutputType | null + _sum: AdminSumAggregateOutputType | null + _min: AdminMinAggregateOutputType | null + _max: AdminMaxAggregateOutputType | null + } + + type GetAdminGroupByPayload = Prisma.PrismaPromise< + Array< + PickEnumerable & + { + [P in ((keyof T) & (keyof AdminGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type AdminSelect = $Extensions.GetSelect<{ + id?: boolean + fullName?: boolean + firstName?: boolean + lastName?: boolean + mobile?: boolean + passwordHash?: boolean + role?: boolean + userTypeId?: boolean + branchId?: boolean + isActive?: boolean + createdAt?: boolean + userType?: boolean | Admin$userTypeArgs + branch?: boolean | Admin$branchArgs + supervisedWorkshops?: boolean | Admin$supervisedWorkshopsArgs + branchAllocations?: boolean | Admin$branchAllocationsArgs + postedLedgerEntries?: boolean | Admin$postedLedgerEntriesArgs + orderStatusEvents?: boolean | Admin$orderStatusEventsArgs + preOrderStatusEvents?: boolean | Admin$preOrderStatusEventsArgs + sentSmsMessages?: boolean | Admin$sentSmsMessagesArgs + sentNotifications?: boolean | Admin$sentNotificationsArgs + uploadedFiles?: boolean | Admin$uploadedFilesArgs + sessions?: boolean | Admin$sessionsArgs + _count?: boolean | AdminCountOutputTypeDefaultArgs + }, ExtArgs["result"]["admin"]> + + export type AdminSelectCreateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + fullName?: boolean + firstName?: boolean + lastName?: boolean + mobile?: boolean + passwordHash?: boolean + role?: boolean + userTypeId?: boolean + branchId?: boolean + isActive?: boolean + createdAt?: boolean + userType?: boolean | Admin$userTypeArgs + branch?: boolean | Admin$branchArgs + }, ExtArgs["result"]["admin"]> + + export type AdminSelectScalar = { + id?: boolean + fullName?: boolean + firstName?: boolean + lastName?: boolean + mobile?: boolean + passwordHash?: boolean + role?: boolean + userTypeId?: boolean + branchId?: boolean + isActive?: boolean + createdAt?: boolean + } + + export type AdminInclude = { + userType?: boolean | Admin$userTypeArgs + branch?: boolean | Admin$branchArgs + supervisedWorkshops?: boolean | Admin$supervisedWorkshopsArgs + branchAllocations?: boolean | Admin$branchAllocationsArgs + postedLedgerEntries?: boolean | Admin$postedLedgerEntriesArgs + orderStatusEvents?: boolean | Admin$orderStatusEventsArgs + preOrderStatusEvents?: boolean | Admin$preOrderStatusEventsArgs + sentSmsMessages?: boolean | Admin$sentSmsMessagesArgs + sentNotifications?: boolean | Admin$sentNotificationsArgs + uploadedFiles?: boolean | Admin$uploadedFilesArgs + sessions?: boolean | Admin$sessionsArgs + _count?: boolean | AdminCountOutputTypeDefaultArgs + } + export type AdminIncludeCreateManyAndReturn = { + userType?: boolean | Admin$userTypeArgs + branch?: boolean | Admin$branchArgs + } + + export type $AdminPayload = { + name: "Admin" + objects: { + userType: Prisma.$UserTypePayload | null + branch: Prisma.$BranchPayload | null + supervisedWorkshops: Prisma.$WorkshopPayload[] + branchAllocations: Prisma.$BranchAllocationPayload[] + postedLedgerEntries: Prisma.$LedgerEntryPayload[] + orderStatusEvents: Prisma.$OrderStatusEventPayload[] + preOrderStatusEvents: Prisma.$PreOrderStatusEventPayload[] + sentSmsMessages: Prisma.$SmsMessagePayload[] + sentNotifications: Prisma.$NotificationPayload[] + uploadedFiles: Prisma.$UploadedFilePayload[] + /** + * Issued admin-panel tokens, recorded only while session tracking is on + * (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a + * token can be revoked before it expires. See AdminSession. + */ + sessions: Prisma.$AdminSessionPayload[] + } + scalars: $Extensions.GetPayloadResult<{ + id: string + fullName: string + firstName: string | null + lastName: string | null + mobile: string + passwordHash: string + /** + * Never SALES_EXPERT — that role lives in AdminUser. Enforced in + * AdminUsersService, not in the database, so the enum stays shared. + */ + role: $Enums.AdminRole + userTypeId: number | null + branchId: string | null + isActive: boolean + createdAt: Date + }, ExtArgs["result"]["admin"]> + composites: {} + } + + type AdminGetPayload = $Result.GetResult + + type AdminCountArgs = + Omit & { + select?: AdminCountAggregateInputType | true + } + + export interface AdminDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Admin'], meta: { name: 'Admin' } } + /** + * Find zero or one Admin that matches the filter. + * @param {AdminFindUniqueArgs} args - Arguments to find a Admin + * @example + * // Get one Admin + * const admin = await prisma.admin.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Admin that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {AdminFindUniqueOrThrowArgs} args - Arguments to find a Admin + * @example + * // Get one Admin + * const admin = await prisma.admin.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Admin that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AdminFindFirstArgs} args - Arguments to find a Admin + * @example + * // Get one Admin + * const admin = await prisma.admin.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Admin that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AdminFindFirstOrThrowArgs} args - Arguments to find a Admin + * @example + * // Get one Admin + * const admin = await prisma.admin.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Admins that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AdminFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Admins + * const admins = await prisma.admin.findMany() + * + * // Get first 10 Admins + * const admins = await prisma.admin.findMany({ take: 10 }) + * + * // Only select the `id` + * const adminWithIdOnly = await prisma.admin.findMany({ select: { id: true } }) + * + */ + findMany(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany">> + + /** + * Create a Admin. + * @param {AdminCreateArgs} args - Arguments to create a Admin. + * @example + * // Create one Admin + * const Admin = await prisma.admin.create({ + * data: { + * // ... data to create a Admin + * } + * }) + * + */ + create(args: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "create">, never, ExtArgs> + + /** + * Create many Admins. + * @param {AdminCreateManyArgs} args - Arguments to create many Admins. + * @example + * // Create many Admins + * const admin = await prisma.admin.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Admins and returns the data saved in the database. + * @param {AdminCreateManyAndReturnArgs} args - Arguments to create many Admins. + * @example + * // Create many Admins + * const admin = await prisma.admin.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Admins and only return the `id` + * const adminWithIdOnly = await prisma.admin.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "createManyAndReturn">> + + /** + * Delete a Admin. + * @param {AdminDeleteArgs} args - Arguments to delete one Admin. + * @example + * // Delete one Admin + * const Admin = await prisma.admin.delete({ + * where: { + * // ... filter to delete one Admin + * } + * }) + * + */ + delete(args: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "delete">, never, ExtArgs> + + /** + * Update one Admin. + * @param {AdminUpdateArgs} args - Arguments to update one Admin. + * @example + * // Update one Admin + * const admin = await prisma.admin.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Admins. + * @param {AdminDeleteManyArgs} args - Arguments to filter Admins to delete. + * @example + * // Delete a few Admins + * const { count } = await prisma.admin.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Admins. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AdminUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Admins + * const admin = await prisma.admin.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Admin. + * @param {AdminUpsertArgs} args - Arguments to update or create a Admin. + * @example + * // Update or create a Admin + * const admin = await prisma.admin.upsert({ + * create: { + * // ... data to create a Admin + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Admin we want to update + * } + * }) + */ + upsert(args: SelectSubset>): Prisma__AdminClient<$Result.GetResult, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Admins. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AdminCountArgs} args - Arguments to filter Admins to count. + * @example + * // Count the number of Admins + * const count = await prisma.admin.count({ + * where: { + * // ... the filter for the Admins we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Admin. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AdminAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Admin. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AdminGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends AdminGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: AdminGroupByArgs['orderBy'] } + : { orderBy?: AdminGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends MaybeTupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetAdminGroupByPayload : Prisma.PrismaPromise + /** + * Fields of the Admin model + */ + readonly fields: AdminFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Admin. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export interface Prisma__AdminClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + userType = {}>(args?: Subset>): Prisma__UserTypeClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + branch = {}>(args?: Subset>): Prisma__BranchClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + supervisedWorkshops = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + branchAllocations = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + postedLedgerEntries = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + orderStatusEvents = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + preOrderStatusEvents = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + sentSmsMessages = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + sentNotifications = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + uploadedFiles = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + sessions = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise + } + + + + + /** + * Fields of the Admin model + */ + interface AdminFieldRefs { + readonly id: FieldRef<"Admin", 'String'> + readonly fullName: FieldRef<"Admin", 'String'> + readonly firstName: FieldRef<"Admin", 'String'> + readonly lastName: FieldRef<"Admin", 'String'> + readonly mobile: FieldRef<"Admin", 'String'> + readonly passwordHash: FieldRef<"Admin", 'String'> + readonly role: FieldRef<"Admin", 'AdminRole'> + readonly userTypeId: FieldRef<"Admin", 'Int'> + readonly branchId: FieldRef<"Admin", 'String'> + readonly isActive: FieldRef<"Admin", 'Boolean'> + readonly createdAt: FieldRef<"Admin", 'DateTime'> + } + + + // Custom InputTypes + /** + * Admin findUnique + */ + export type AdminFindUniqueArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * Filter, which Admin to fetch. + */ + where: AdminWhereUniqueInput + } + + /** + * Admin findUniqueOrThrow + */ + export type AdminFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * Filter, which Admin to fetch. + */ + where: AdminWhereUniqueInput + } + + /** + * Admin findFirst + */ + export type AdminFindFirstArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * Filter, which Admin to fetch. + */ + where?: AdminWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Admins to fetch. + */ + orderBy?: AdminOrderByWithRelationInput | AdminOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Admins. + */ + cursor?: AdminWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Admins from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Admins. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Admins. + */ + distinct?: AdminScalarFieldEnum | AdminScalarFieldEnum[] + } + + /** + * Admin findFirstOrThrow + */ + export type AdminFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * Filter, which Admin to fetch. + */ + where?: AdminWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Admins to fetch. + */ + orderBy?: AdminOrderByWithRelationInput | AdminOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Admins. + */ + cursor?: AdminWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Admins from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Admins. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Admins. + */ + distinct?: AdminScalarFieldEnum | AdminScalarFieldEnum[] + } + + /** + * Admin findMany + */ + export type AdminFindManyArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * Filter, which Admins to fetch. + */ + where?: AdminWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Admins to fetch. + */ + orderBy?: AdminOrderByWithRelationInput | AdminOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Admins. + */ + cursor?: AdminWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Admins from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Admins. + */ + skip?: number + distinct?: AdminScalarFieldEnum | AdminScalarFieldEnum[] + } + + /** + * Admin create + */ + export type AdminCreateArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * The data needed to create a Admin. + */ + data: XOR + } + + /** + * Admin createMany + */ + export type AdminCreateManyArgs = { + /** + * The data used to create many Admins. + */ + data: AdminCreateManyInput | AdminCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Admin createManyAndReturn + */ + export type AdminCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelectCreateManyAndReturn | null + /** + * The data used to create many Admins. + */ + data: AdminCreateManyInput | AdminCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminIncludeCreateManyAndReturn | null + } + + /** + * Admin update + */ + export type AdminUpdateArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * The data needed to update a Admin. + */ + data: XOR + /** + * Choose, which Admin to update. + */ + where: AdminWhereUniqueInput + } + + /** + * Admin updateMany + */ + export type AdminUpdateManyArgs = { + /** + * The data used to update Admins. + */ + data: XOR + /** + * Filter which Admins to update + */ + where?: AdminWhereInput + } + + /** + * Admin upsert + */ + export type AdminUpsertArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * The filter to search for the Admin to update in case it exists. + */ + where: AdminWhereUniqueInput + /** + * In case the Admin found by the `where` argument doesn't exist, create a new Admin with this data. + */ + create: XOR + /** + * In case the Admin was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + /** + * Admin delete + */ + export type AdminDeleteArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + /** + * Filter which Admin to delete. + */ + where: AdminWhereUniqueInput + } + + /** + * Admin deleteMany + */ + export type AdminDeleteManyArgs = { + /** + * Filter which Admins to delete + */ + where?: AdminWhereInput + } + + /** + * Admin.userType + */ + export type Admin$userTypeArgs = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude | null + where?: UserTypeWhereInput + } + + /** + * Admin.branch + */ + export type Admin$branchArgs = { + /** + * Select specific fields to fetch from the Branch + */ + select?: BranchSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchInclude | null + where?: BranchWhereInput + } + + /** + * Admin.supervisedWorkshops + */ + export type Admin$supervisedWorkshopsArgs = { + /** + * Select specific fields to fetch from the Workshop + */ + select?: WorkshopSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: WorkshopInclude | null + where?: WorkshopWhereInput + orderBy?: WorkshopOrderByWithRelationInput | WorkshopOrderByWithRelationInput[] + cursor?: WorkshopWhereUniqueInput + take?: number + skip?: number + distinct?: WorkshopScalarFieldEnum | WorkshopScalarFieldEnum[] + } + + /** + * Admin.branchAllocations + */ + export type Admin$branchAllocationsArgs = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude | null + where?: BranchAllocationWhereInput + orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] + cursor?: BranchAllocationWhereUniqueInput + take?: number + skip?: number + distinct?: BranchAllocationScalarFieldEnum | BranchAllocationScalarFieldEnum[] + } + + /** + * Admin.postedLedgerEntries + */ + export type Admin$postedLedgerEntriesArgs = { + /** + * Select specific fields to fetch from the LedgerEntry + */ + select?: LedgerEntrySelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: LedgerEntryInclude | null + where?: LedgerEntryWhereInput + orderBy?: LedgerEntryOrderByWithRelationInput | LedgerEntryOrderByWithRelationInput[] + cursor?: LedgerEntryWhereUniqueInput + take?: number + skip?: number + distinct?: LedgerEntryScalarFieldEnum | LedgerEntryScalarFieldEnum[] + } + + /** + * Admin.orderStatusEvents + */ + export type Admin$orderStatusEventsArgs = { + /** + * Select specific fields to fetch from the OrderStatusEvent + */ + select?: OrderStatusEventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: OrderStatusEventInclude | null + where?: OrderStatusEventWhereInput + orderBy?: OrderStatusEventOrderByWithRelationInput | OrderStatusEventOrderByWithRelationInput[] + cursor?: OrderStatusEventWhereUniqueInput + take?: number + skip?: number + distinct?: OrderStatusEventScalarFieldEnum | OrderStatusEventScalarFieldEnum[] + } + + /** + * Admin.preOrderStatusEvents + */ + export type Admin$preOrderStatusEventsArgs = { + /** + * Select specific fields to fetch from the PreOrderStatusEvent + */ + select?: PreOrderStatusEventSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PreOrderStatusEventInclude | null + where?: PreOrderStatusEventWhereInput + orderBy?: PreOrderStatusEventOrderByWithRelationInput | PreOrderStatusEventOrderByWithRelationInput[] + cursor?: PreOrderStatusEventWhereUniqueInput + take?: number + skip?: number + distinct?: PreOrderStatusEventScalarFieldEnum | PreOrderStatusEventScalarFieldEnum[] + } + + /** + * Admin.sentSmsMessages + */ + export type Admin$sentSmsMessagesArgs = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude | null + where?: SmsMessageWhereInput + orderBy?: SmsMessageOrderByWithRelationInput | SmsMessageOrderByWithRelationInput[] + cursor?: SmsMessageWhereUniqueInput + take?: number + skip?: number + distinct?: SmsMessageScalarFieldEnum | SmsMessageScalarFieldEnum[] + } + + /** + * Admin.sentNotifications + */ + export type Admin$sentNotificationsArgs = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude | null + where?: NotificationWhereInput + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + cursor?: NotificationWhereUniqueInput + take?: number + skip?: number + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * Admin.uploadedFiles + */ + export type Admin$uploadedFilesArgs = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude | null + where?: UploadedFileWhereInput + orderBy?: UploadedFileOrderByWithRelationInput | UploadedFileOrderByWithRelationInput[] + cursor?: UploadedFileWhereUniqueInput + take?: number + skip?: number + distinct?: UploadedFileScalarFieldEnum | UploadedFileScalarFieldEnum[] + } + + /** + * Admin.sessions + */ + export type Admin$sessionsArgs = { + /** + * Select specific fields to fetch from the AdminSession + */ + select?: AdminSessionSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminSessionInclude | null + where?: AdminSessionWhereInput + orderBy?: AdminSessionOrderByWithRelationInput | AdminSessionOrderByWithRelationInput[] + cursor?: AdminSessionWhereUniqueInput + take?: number + skip?: number + distinct?: AdminSessionScalarFieldEnum | AdminSessionScalarFieldEnum[] + } + + /** + * Admin without action + */ + export type AdminDefaultArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + } + + /** * Model AdminUser */ @@ -7138,16 +8580,7 @@ export namespace Prisma { avatarFile?: boolean | AdminUser$avatarFileArgs referredCustomers?: boolean | AdminUser$referredCustomersArgs creditedOrders?: boolean | AdminUser$creditedOrdersArgs - supervisedWorkshops?: boolean | AdminUser$supervisedWorkshopsArgs - branchAllocations?: boolean | AdminUser$branchAllocationsArgs - postedLedgerEntries?: boolean | AdminUser$postedLedgerEntriesArgs - orderStatusEvents?: boolean | AdminUser$orderStatusEventsArgs - preOrderStatusEvents?: boolean | AdminUser$preOrderStatusEventsArgs - sentSmsMessages?: boolean | AdminUser$sentSmsMessagesArgs - sentNotifications?: boolean | AdminUser$sentNotificationsArgs - uploadedFiles?: boolean | AdminUser$uploadedFilesArgs salesExpertProfile?: boolean | AdminUser$salesExpertProfileArgs - sessions?: boolean | AdminUser$sessionsArgs _count?: boolean | AdminUserCountOutputTypeDefaultArgs }, ExtArgs["result"]["adminUser"]> @@ -7200,16 +8633,7 @@ export namespace Prisma { avatarFile?: boolean | AdminUser$avatarFileArgs referredCustomers?: boolean | AdminUser$referredCustomersArgs creditedOrders?: boolean | AdminUser$creditedOrdersArgs - supervisedWorkshops?: boolean | AdminUser$supervisedWorkshopsArgs - branchAllocations?: boolean | AdminUser$branchAllocationsArgs - postedLedgerEntries?: boolean | AdminUser$postedLedgerEntriesArgs - orderStatusEvents?: boolean | AdminUser$orderStatusEventsArgs - preOrderStatusEvents?: boolean | AdminUser$preOrderStatusEventsArgs - sentSmsMessages?: boolean | AdminUser$sentSmsMessagesArgs - sentNotifications?: boolean | AdminUser$sentNotificationsArgs - uploadedFiles?: boolean | AdminUser$uploadedFilesArgs salesExpertProfile?: boolean | AdminUser$salesExpertProfileArgs - sessions?: boolean | AdminUser$sessionsArgs _count?: boolean | AdminUserCountOutputTypeDefaultArgs } export type AdminUserIncludeCreateManyAndReturn = { @@ -7229,24 +8653,10 @@ export namespace Prisma { * Orders credited to this sales expert — see Order.salesAgentId. */ creditedOrders: Prisma.$OrderPayload[] - supervisedWorkshops: Prisma.$WorkshopPayload[] - branchAllocations: Prisma.$BranchAllocationPayload[] - postedLedgerEntries: Prisma.$LedgerEntryPayload[] - orderStatusEvents: Prisma.$OrderStatusEventPayload[] - preOrderStatusEvents: Prisma.$PreOrderStatusEventPayload[] - sentSmsMessages: Prisma.$SmsMessagePayload[] - sentNotifications: Prisma.$NotificationPayload[] - uploadedFiles: Prisma.$UploadedFilePayload[] /** * Only ever set for role = SALES_EXPERT (D17). */ salesExpertProfile: Prisma.$SalesExpertProfilePayload | null - /** - * Issued admin-panel tokens, recorded only while session tracking is on - * (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a - * token can be revoked before it expires. See AdminSession. - */ - sessions: Prisma.$AdminSessionPayload[] } scalars: $Extensions.GetPayloadResult<{ id: string @@ -7661,16 +9071,7 @@ export namespace Prisma { avatarFile = {}>(args?: Subset>): Prisma__UploadedFileClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> referredCustomers = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> creditedOrders = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - supervisedWorkshops = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - branchAllocations = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - postedLedgerEntries = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - orderStatusEvents = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - preOrderStatusEvents = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - sentSmsMessages = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - sentNotifications = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> - uploadedFiles = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> salesExpertProfile = {}>(args?: Subset>): Prisma__SalesExpertProfileClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> - sessions = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -8119,166 +9520,6 @@ export namespace Prisma { distinct?: OrderScalarFieldEnum | OrderScalarFieldEnum[] } - /** - * AdminUser.supervisedWorkshops - */ - export type AdminUser$supervisedWorkshopsArgs = { - /** - * Select specific fields to fetch from the Workshop - */ - select?: WorkshopSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: WorkshopInclude | null - where?: WorkshopWhereInput - orderBy?: WorkshopOrderByWithRelationInput | WorkshopOrderByWithRelationInput[] - cursor?: WorkshopWhereUniqueInput - take?: number - skip?: number - distinct?: WorkshopScalarFieldEnum | WorkshopScalarFieldEnum[] - } - - /** - * AdminUser.branchAllocations - */ - export type AdminUser$branchAllocationsArgs = { - /** - * Select specific fields to fetch from the BranchAllocation - */ - select?: BranchAllocationSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: BranchAllocationInclude | null - where?: BranchAllocationWhereInput - orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] - cursor?: BranchAllocationWhereUniqueInput - take?: number - skip?: number - distinct?: BranchAllocationScalarFieldEnum | BranchAllocationScalarFieldEnum[] - } - - /** - * AdminUser.postedLedgerEntries - */ - export type AdminUser$postedLedgerEntriesArgs = { - /** - * Select specific fields to fetch from the LedgerEntry - */ - select?: LedgerEntrySelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: LedgerEntryInclude | null - where?: LedgerEntryWhereInput - orderBy?: LedgerEntryOrderByWithRelationInput | LedgerEntryOrderByWithRelationInput[] - cursor?: LedgerEntryWhereUniqueInput - take?: number - skip?: number - distinct?: LedgerEntryScalarFieldEnum | LedgerEntryScalarFieldEnum[] - } - - /** - * AdminUser.orderStatusEvents - */ - export type AdminUser$orderStatusEventsArgs = { - /** - * Select specific fields to fetch from the OrderStatusEvent - */ - select?: OrderStatusEventSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: OrderStatusEventInclude | null - where?: OrderStatusEventWhereInput - orderBy?: OrderStatusEventOrderByWithRelationInput | OrderStatusEventOrderByWithRelationInput[] - cursor?: OrderStatusEventWhereUniqueInput - take?: number - skip?: number - distinct?: OrderStatusEventScalarFieldEnum | OrderStatusEventScalarFieldEnum[] - } - - /** - * AdminUser.preOrderStatusEvents - */ - export type AdminUser$preOrderStatusEventsArgs = { - /** - * Select specific fields to fetch from the PreOrderStatusEvent - */ - select?: PreOrderStatusEventSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: PreOrderStatusEventInclude | null - where?: PreOrderStatusEventWhereInput - orderBy?: PreOrderStatusEventOrderByWithRelationInput | PreOrderStatusEventOrderByWithRelationInput[] - cursor?: PreOrderStatusEventWhereUniqueInput - take?: number - skip?: number - distinct?: PreOrderStatusEventScalarFieldEnum | PreOrderStatusEventScalarFieldEnum[] - } - - /** - * AdminUser.sentSmsMessages - */ - export type AdminUser$sentSmsMessagesArgs = { - /** - * Select specific fields to fetch from the SmsMessage - */ - select?: SmsMessageSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: SmsMessageInclude | null - where?: SmsMessageWhereInput - orderBy?: SmsMessageOrderByWithRelationInput | SmsMessageOrderByWithRelationInput[] - cursor?: SmsMessageWhereUniqueInput - take?: number - skip?: number - distinct?: SmsMessageScalarFieldEnum | SmsMessageScalarFieldEnum[] - } - - /** - * AdminUser.sentNotifications - */ - export type AdminUser$sentNotificationsArgs = { - /** - * Select specific fields to fetch from the Notification - */ - select?: NotificationSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: NotificationInclude | null - where?: NotificationWhereInput - orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] - cursor?: NotificationWhereUniqueInput - take?: number - skip?: number - distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] - } - - /** - * AdminUser.uploadedFiles - */ - export type AdminUser$uploadedFilesArgs = { - /** - * Select specific fields to fetch from the UploadedFile - */ - select?: UploadedFileSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: UploadedFileInclude | null - where?: UploadedFileWhereInput - orderBy?: UploadedFileOrderByWithRelationInput | UploadedFileOrderByWithRelationInput[] - cursor?: UploadedFileWhereUniqueInput - take?: number - skip?: number - distinct?: UploadedFileScalarFieldEnum | UploadedFileScalarFieldEnum[] - } - /** * AdminUser.salesExpertProfile */ @@ -8294,26 +9535,6 @@ export namespace Prisma { where?: SalesExpertProfileWhereInput } - /** - * AdminUser.sessions - */ - export type AdminUser$sessionsArgs = { - /** - * Select specific fields to fetch from the AdminSession - */ - select?: AdminSessionSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: AdminSessionInclude | null - where?: AdminSessionWhereInput - orderBy?: AdminSessionOrderByWithRelationInput | AdminSessionOrderByWithRelationInput[] - cursor?: AdminSessionWhereUniqueInput - take?: number - skip?: number - distinct?: AdminSessionScalarFieldEnum | AdminSessionScalarFieldEnum[] - } - /** * AdminUser without action */ @@ -9338,7 +10559,7 @@ export namespace Prisma { export type AdminSessionMinAggregateOutputType = { id: string | null jti: string | null - adminUserId: string | null + adminId: string | null iamSessionId: string | null iamSub: string | null ipAddress: string | null @@ -9353,7 +10574,7 @@ export namespace Prisma { export type AdminSessionMaxAggregateOutputType = { id: string | null jti: string | null - adminUserId: string | null + adminId: string | null iamSessionId: string | null iamSub: string | null ipAddress: string | null @@ -9368,7 +10589,7 @@ export namespace Prisma { export type AdminSessionCountAggregateOutputType = { id: number jti: number - adminUserId: number + adminId: number iamSessionId: number iamSub: number ipAddress: number @@ -9385,7 +10606,7 @@ export namespace Prisma { export type AdminSessionMinAggregateInputType = { id?: true jti?: true - adminUserId?: true + adminId?: true iamSessionId?: true iamSub?: true ipAddress?: true @@ -9400,7 +10621,7 @@ export namespace Prisma { export type AdminSessionMaxAggregateInputType = { id?: true jti?: true - adminUserId?: true + adminId?: true iamSessionId?: true iamSub?: true ipAddress?: true @@ -9415,7 +10636,7 @@ export namespace Prisma { export type AdminSessionCountAggregateInputType = { id?: true jti?: true - adminUserId?: true + adminId?: true iamSessionId?: true iamSub?: true ipAddress?: true @@ -9503,7 +10724,7 @@ export namespace Prisma { export type AdminSessionGroupByOutputType = { id: string jti: string - adminUserId: string + adminId: string iamSessionId: string | null iamSub: string | null ipAddress: string | null @@ -9535,7 +10756,7 @@ export namespace Prisma { export type AdminSessionSelect = $Extensions.GetSelect<{ id?: boolean jti?: boolean - adminUserId?: boolean + adminId?: boolean iamSessionId?: boolean iamSub?: boolean ipAddress?: boolean @@ -9545,13 +10766,13 @@ export namespace Prisma { lastSeenAt?: boolean revokedAt?: boolean revokedReason?: boolean - adminUser?: boolean | AdminUserDefaultArgs + admin?: boolean | AdminDefaultArgs }, ExtArgs["result"]["adminSession"]> export type AdminSessionSelectCreateManyAndReturn = $Extensions.GetSelect<{ id?: boolean jti?: boolean - adminUserId?: boolean + adminId?: boolean iamSessionId?: boolean iamSub?: boolean ipAddress?: boolean @@ -9561,13 +10782,13 @@ export namespace Prisma { lastSeenAt?: boolean revokedAt?: boolean revokedReason?: boolean - adminUser?: boolean | AdminUserDefaultArgs + admin?: boolean | AdminDefaultArgs }, ExtArgs["result"]["adminSession"]> export type AdminSessionSelectScalar = { id?: boolean jti?: boolean - adminUserId?: boolean + adminId?: boolean iamSessionId?: boolean iamSub?: boolean ipAddress?: boolean @@ -9580,16 +10801,16 @@ export namespace Prisma { } export type AdminSessionInclude = { - adminUser?: boolean | AdminUserDefaultArgs + admin?: boolean | AdminDefaultArgs } export type AdminSessionIncludeCreateManyAndReturn = { - adminUser?: boolean | AdminUserDefaultArgs + admin?: boolean | AdminDefaultArgs } export type $AdminSessionPayload = { name: "AdminSession" objects: { - adminUser: Prisma.$AdminUserPayload + admin: Prisma.$AdminPayload } scalars: $Extensions.GetPayloadResult<{ id: string @@ -9597,7 +10818,7 @@ export namespace Prisma { * The token's `jti` claim. Unique: one row per issued token. */ jti: string - adminUserId: string + adminId: string /** * Set when the login was verified by the IAM: its session id (`sid`) and the * stable user id (`sub`) there. Back-channel logout arrives keyed by these — @@ -9977,7 +11198,7 @@ export namespace Prisma { */ export interface Prisma__AdminSessionClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - adminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + admin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -10009,7 +11230,7 @@ export namespace Prisma { interface AdminSessionFieldRefs { readonly id: FieldRef<"AdminSession", 'String'> readonly jti: FieldRef<"AdminSession", 'String'> - readonly adminUserId: FieldRef<"AdminSession", 'String'> + readonly adminId: FieldRef<"AdminSession", 'String'> readonly iamSessionId: FieldRef<"AdminSession", 'String'> readonly iamSub: FieldRef<"AdminSession", 'String'> readonly ipAddress: FieldRef<"AdminSession", 'String'> @@ -15341,6 +16562,7 @@ export namespace Prisma { cityId?: boolean city?: boolean | Branch$cityArgs adminUsers?: boolean | Branch$adminUsersArgs + admins?: boolean | Branch$adminsArgs orders?: boolean | Branch$ordersArgs allocations?: boolean | Branch$allocationsArgs _count?: boolean | BranchCountOutputTypeDefaultArgs @@ -15368,6 +16590,7 @@ export namespace Prisma { export type BranchInclude = { city?: boolean | Branch$cityArgs adminUsers?: boolean | Branch$adminUsersArgs + admins?: boolean | Branch$adminsArgs orders?: boolean | Branch$ordersArgs allocations?: boolean | Branch$allocationsArgs _count?: boolean | BranchCountOutputTypeDefaultArgs @@ -15381,6 +16604,7 @@ export namespace Prisma { objects: { city: Prisma.$CityPayload | null adminUsers: Prisma.$AdminUserPayload[] + admins: Prisma.$AdminPayload[] orders: Prisma.$OrderPayload[] allocations: Prisma.$BranchAllocationPayload[] } @@ -15763,6 +16987,7 @@ export namespace Prisma { readonly [Symbol.toStringTag]: "PrismaPromise" city = {}>(args?: Subset>): Prisma__CityClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> adminUsers = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + admins = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> orders = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> allocations = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> /** @@ -16152,6 +17377,26 @@ export namespace Prisma { distinct?: AdminUserScalarFieldEnum | AdminUserScalarFieldEnum[] } + /** + * Branch.admins + */ + export type Branch$adminsArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + where?: AdminWhereInput + orderBy?: AdminOrderByWithRelationInput | AdminOrderByWithRelationInput[] + cursor?: AdminWhereUniqueInput + take?: number + skip?: number + distinct?: AdminScalarFieldEnum | AdminScalarFieldEnum[] + } + /** * Branch.orders */ @@ -16415,7 +17660,7 @@ export namespace Prisma { export type $WorkshopPayload = { name: "Workshop" objects: { - supervisor: Prisma.$AdminUserPayload | null + supervisor: Prisma.$AdminPayload | null preOrders: Prisma.$PreOrderPayload[] } scalars: $Extensions.GetPayloadResult<{ @@ -16795,7 +18040,7 @@ export namespace Prisma { */ export interface Prisma__WorkshopClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - supervisor = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + supervisor = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> preOrders = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -17154,14 +18399,14 @@ export namespace Prisma { */ export type Workshop$supervisorArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -26863,7 +28108,7 @@ export namespace Prisma { fromStatus: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus | null note: string | null - actorAdminUserId: string | null + actorAdminId: string | null createdAt: Date | null } @@ -26873,7 +28118,7 @@ export namespace Prisma { fromStatus: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus | null note: string | null - actorAdminUserId: string | null + actorAdminId: string | null createdAt: Date | null } @@ -26883,7 +28128,7 @@ export namespace Prisma { fromStatus: number toStatus: number note: number - actorAdminUserId: number + actorAdminId: number createdAt: number _all: number } @@ -26895,7 +28140,7 @@ export namespace Prisma { fromStatus?: true toStatus?: true note?: true - actorAdminUserId?: true + actorAdminId?: true createdAt?: true } @@ -26905,7 +28150,7 @@ export namespace Prisma { fromStatus?: true toStatus?: true note?: true - actorAdminUserId?: true + actorAdminId?: true createdAt?: true } @@ -26915,7 +28160,7 @@ export namespace Prisma { fromStatus?: true toStatus?: true note?: true - actorAdminUserId?: true + actorAdminId?: true createdAt?: true _all?: true } @@ -26998,7 +28243,7 @@ export namespace Prisma { fromStatus: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus note: string | null - actorAdminUserId: string | null + actorAdminId: string | null createdAt: Date _count: OrderStatusEventCountAggregateOutputType | null _min: OrderStatusEventMinAggregateOutputType | null @@ -27025,10 +28270,10 @@ export namespace Prisma { fromStatus?: boolean toStatus?: boolean note?: boolean - actorAdminUserId?: boolean + actorAdminId?: boolean createdAt?: boolean order?: boolean | OrderDefaultArgs - actorAdminUser?: boolean | OrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | OrderStatusEvent$actorAdminArgs }, ExtArgs["result"]["orderStatusEvent"]> export type OrderStatusEventSelectCreateManyAndReturn = $Extensions.GetSelect<{ @@ -27037,10 +28282,10 @@ export namespace Prisma { fromStatus?: boolean toStatus?: boolean note?: boolean - actorAdminUserId?: boolean + actorAdminId?: boolean createdAt?: boolean order?: boolean | OrderDefaultArgs - actorAdminUser?: boolean | OrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | OrderStatusEvent$actorAdminArgs }, ExtArgs["result"]["orderStatusEvent"]> export type OrderStatusEventSelectScalar = { @@ -27049,24 +28294,24 @@ export namespace Prisma { fromStatus?: boolean toStatus?: boolean note?: boolean - actorAdminUserId?: boolean + actorAdminId?: boolean createdAt?: boolean } export type OrderStatusEventInclude = { order?: boolean | OrderDefaultArgs - actorAdminUser?: boolean | OrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | OrderStatusEvent$actorAdminArgs } export type OrderStatusEventIncludeCreateManyAndReturn = { order?: boolean | OrderDefaultArgs - actorAdminUser?: boolean | OrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | OrderStatusEvent$actorAdminArgs } export type $OrderStatusEventPayload = { name: "OrderStatusEvent" objects: { order: Prisma.$OrderPayload - actorAdminUser: Prisma.$AdminUserPayload | null + actorAdmin: Prisma.$AdminPayload | null } scalars: $Extensions.GetPayloadResult<{ id: string @@ -27074,7 +28319,7 @@ export namespace Prisma { fromStatus: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus note: string | null - actorAdminUserId: string | null + actorAdminId: string | null createdAt: Date }, ExtArgs["result"]["orderStatusEvent"]> composites: {} @@ -27441,7 +28686,7 @@ export namespace Prisma { export interface Prisma__OrderStatusEventClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" order = {}>(args?: Subset>): Prisma__OrderClient<$Result.GetResult, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> - actorAdminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + actorAdmin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -27476,7 +28721,7 @@ export namespace Prisma { readonly fromStatus: FieldRef<"OrderStatusEvent", 'OrderStatus'> readonly toStatus: FieldRef<"OrderStatusEvent", 'OrderStatus'> readonly note: FieldRef<"OrderStatusEvent", 'String'> - readonly actorAdminUserId: FieldRef<"OrderStatusEvent", 'String'> + readonly actorAdminId: FieldRef<"OrderStatusEvent", 'String'> readonly createdAt: FieldRef<"OrderStatusEvent", 'DateTime'> } @@ -27796,18 +29041,18 @@ export namespace Prisma { } /** - * OrderStatusEvent.actorAdminUser + * OrderStatusEvent.actorAdmin */ - export type OrderStatusEvent$actorAdminUserArgs = { + export type OrderStatusEvent$actorAdminArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -29033,7 +30278,7 @@ export namespace Prisma { export type PreOrderStatusEventMinAggregateOutputType = { id: string | null preOrderId: string | null - actorAdminUserId: string | null + actorAdminId: string | null ipAddress: string | null createdAt: Date | null } @@ -29041,7 +30286,7 @@ export namespace Prisma { export type PreOrderStatusEventMaxAggregateOutputType = { id: string | null preOrderId: string | null - actorAdminUserId: string | null + actorAdminId: string | null ipAddress: string | null createdAt: Date | null } @@ -29050,7 +30295,7 @@ export namespace Prisma { id: number preOrderId: number changes: number - actorAdminUserId: number + actorAdminId: number ipAddress: number createdAt: number _all: number @@ -29060,7 +30305,7 @@ export namespace Prisma { export type PreOrderStatusEventMinAggregateInputType = { id?: true preOrderId?: true - actorAdminUserId?: true + actorAdminId?: true ipAddress?: true createdAt?: true } @@ -29068,7 +30313,7 @@ export namespace Prisma { export type PreOrderStatusEventMaxAggregateInputType = { id?: true preOrderId?: true - actorAdminUserId?: true + actorAdminId?: true ipAddress?: true createdAt?: true } @@ -29077,7 +30322,7 @@ export namespace Prisma { id?: true preOrderId?: true changes?: true - actorAdminUserId?: true + actorAdminId?: true ipAddress?: true createdAt?: true _all?: true @@ -29159,7 +30404,7 @@ export namespace Prisma { id: string preOrderId: string changes: JsonValue - actorAdminUserId: string | null + actorAdminId: string | null ipAddress: string | null createdAt: Date _count: PreOrderStatusEventCountAggregateOutputType | null @@ -29185,47 +30430,47 @@ export namespace Prisma { id?: boolean preOrderId?: boolean changes?: boolean - actorAdminUserId?: boolean + actorAdminId?: boolean ipAddress?: boolean createdAt?: boolean preOrder?: boolean | PreOrderDefaultArgs - actorAdminUser?: boolean | PreOrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | PreOrderStatusEvent$actorAdminArgs }, ExtArgs["result"]["preOrderStatusEvent"]> export type PreOrderStatusEventSelectCreateManyAndReturn = $Extensions.GetSelect<{ id?: boolean preOrderId?: boolean changes?: boolean - actorAdminUserId?: boolean + actorAdminId?: boolean ipAddress?: boolean createdAt?: boolean preOrder?: boolean | PreOrderDefaultArgs - actorAdminUser?: boolean | PreOrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | PreOrderStatusEvent$actorAdminArgs }, ExtArgs["result"]["preOrderStatusEvent"]> export type PreOrderStatusEventSelectScalar = { id?: boolean preOrderId?: boolean changes?: boolean - actorAdminUserId?: boolean + actorAdminId?: boolean ipAddress?: boolean createdAt?: boolean } export type PreOrderStatusEventInclude = { preOrder?: boolean | PreOrderDefaultArgs - actorAdminUser?: boolean | PreOrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | PreOrderStatusEvent$actorAdminArgs } export type PreOrderStatusEventIncludeCreateManyAndReturn = { preOrder?: boolean | PreOrderDefaultArgs - actorAdminUser?: boolean | PreOrderStatusEvent$actorAdminUserArgs + actorAdmin?: boolean | PreOrderStatusEvent$actorAdminArgs } export type $PreOrderStatusEventPayload = { name: "PreOrderStatusEvent" objects: { preOrder: Prisma.$PreOrderPayload - actorAdminUser: Prisma.$AdminUserPayload | null + actorAdmin: Prisma.$AdminPayload | null } scalars: $Extensions.GetPayloadResult<{ id: string @@ -29234,7 +30479,7 @@ export namespace Prisma { * Field-level diff, e.g. {"status": {"old": "PLACED", "new": "ADMIN_APPROVED"}} */ changes: Prisma.JsonValue - actorAdminUserId: string | null + actorAdminId: string | null ipAddress: string | null createdAt: Date }, ExtArgs["result"]["preOrderStatusEvent"]> @@ -29602,7 +30847,7 @@ export namespace Prisma { export interface Prisma__PreOrderStatusEventClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" preOrder = {}>(args?: Subset>): Prisma__PreOrderClient<$Result.GetResult, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> - actorAdminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + actorAdmin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -29635,7 +30880,7 @@ export namespace Prisma { readonly id: FieldRef<"PreOrderStatusEvent", 'String'> readonly preOrderId: FieldRef<"PreOrderStatusEvent", 'String'> readonly changes: FieldRef<"PreOrderStatusEvent", 'Json'> - readonly actorAdminUserId: FieldRef<"PreOrderStatusEvent", 'String'> + readonly actorAdminId: FieldRef<"PreOrderStatusEvent", 'String'> readonly ipAddress: FieldRef<"PreOrderStatusEvent", 'String'> readonly createdAt: FieldRef<"PreOrderStatusEvent", 'DateTime'> } @@ -29956,18 +31201,18 @@ export namespace Prisma { } /** - * PreOrderStatusEvent.actorAdminUser + * PreOrderStatusEvent.actorAdmin */ - export type PreOrderStatusEvent$actorAdminUserArgs = { + export type PreOrderStatusEvent$actorAdminArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -30025,7 +31270,7 @@ export namespace Prisma { orderId: string | null confirmed: boolean | null confirmedAt: Date | null - postedByAdminUserId: string | null + postedByAdminId: string | null labName: string | null hallmark: string | null accountName: string | null @@ -30050,7 +31295,7 @@ export namespace Prisma { orderId: string | null confirmed: boolean | null confirmedAt: Date | null - postedByAdminUserId: string | null + postedByAdminId: string | null labName: string | null hallmark: string | null accountName: string | null @@ -30075,7 +31320,7 @@ export namespace Prisma { orderId: number confirmed: number confirmedAt: number - postedByAdminUserId: number + postedByAdminId: number labName: number hallmark: number accountName: number @@ -30118,7 +31363,7 @@ export namespace Prisma { orderId?: true confirmed?: true confirmedAt?: true - postedByAdminUserId?: true + postedByAdminId?: true labName?: true hallmark?: true accountName?: true @@ -30143,7 +31388,7 @@ export namespace Prisma { orderId?: true confirmed?: true confirmedAt?: true - postedByAdminUserId?: true + postedByAdminId?: true labName?: true hallmark?: true accountName?: true @@ -30168,7 +31413,7 @@ export namespace Prisma { orderId?: true confirmed?: true confirmedAt?: true - postedByAdminUserId?: true + postedByAdminId?: true labName?: true hallmark?: true accountName?: true @@ -30280,7 +31525,7 @@ export namespace Prisma { orderId: string | null confirmed: boolean confirmedAt: Date | null - postedByAdminUserId: string | null + postedByAdminId: string | null labName: string | null hallmark: string | null accountName: string | null @@ -30324,7 +31569,7 @@ export namespace Prisma { orderId?: boolean confirmed?: boolean confirmedAt?: boolean - postedByAdminUserId?: boolean + postedByAdminId?: boolean labName?: boolean hallmark?: boolean accountName?: boolean @@ -30337,7 +31582,7 @@ export namespace Prisma { createdAt?: boolean customer?: boolean | CustomerDefaultArgs order?: boolean | LedgerEntry$orderArgs - postedByAdminUser?: boolean | LedgerEntry$postedByAdminUserArgs + postedByAdmin?: boolean | LedgerEntry$postedByAdminArgs }, ExtArgs["result"]["ledgerEntry"]> export type LedgerEntrySelectCreateManyAndReturn = $Extensions.GetSelect<{ @@ -30352,7 +31597,7 @@ export namespace Prisma { orderId?: boolean confirmed?: boolean confirmedAt?: boolean - postedByAdminUserId?: boolean + postedByAdminId?: boolean labName?: boolean hallmark?: boolean accountName?: boolean @@ -30365,7 +31610,7 @@ export namespace Prisma { createdAt?: boolean customer?: boolean | CustomerDefaultArgs order?: boolean | LedgerEntry$orderArgs - postedByAdminUser?: boolean | LedgerEntry$postedByAdminUserArgs + postedByAdmin?: boolean | LedgerEntry$postedByAdminArgs }, ExtArgs["result"]["ledgerEntry"]> export type LedgerEntrySelectScalar = { @@ -30380,7 +31625,7 @@ export namespace Prisma { orderId?: boolean confirmed?: boolean confirmedAt?: boolean - postedByAdminUserId?: boolean + postedByAdminId?: boolean labName?: boolean hallmark?: boolean accountName?: boolean @@ -30396,12 +31641,12 @@ export namespace Prisma { export type LedgerEntryInclude = { customer?: boolean | CustomerDefaultArgs order?: boolean | LedgerEntry$orderArgs - postedByAdminUser?: boolean | LedgerEntry$postedByAdminUserArgs + postedByAdmin?: boolean | LedgerEntry$postedByAdminArgs } export type LedgerEntryIncludeCreateManyAndReturn = { customer?: boolean | CustomerDefaultArgs order?: boolean | LedgerEntry$orderArgs - postedByAdminUser?: boolean | LedgerEntry$postedByAdminUserArgs + postedByAdmin?: boolean | LedgerEntry$postedByAdminArgs } export type $LedgerEntryPayload = { @@ -30409,7 +31654,7 @@ export namespace Prisma { objects: { customer: Prisma.$CustomerPayload order: Prisma.$OrderPayload | null - postedByAdminUser: Prisma.$AdminUserPayload | null + postedByAdmin: Prisma.$AdminPayload | null } scalars: $Extensions.GetPayloadResult<{ id: string @@ -30435,7 +31680,7 @@ export namespace Prisma { */ confirmed: boolean confirmedAt: Date | null - postedByAdminUserId: string | null + postedByAdminId: string | null /** * Instrument metadata from the legacy "cash" document form. Which fields are * filled depends on sourceType: a melted-gold receipt carries lab/hallmark and @@ -30825,7 +32070,7 @@ export namespace Prisma { readonly [Symbol.toStringTag]: "PrismaPromise" customer = {}>(args?: Subset>): Prisma__CustomerClient<$Result.GetResult, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> order = {}>(args?: Subset>): Prisma__OrderClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> - postedByAdminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + postedByAdmin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -30866,7 +32111,7 @@ export namespace Prisma { readonly orderId: FieldRef<"LedgerEntry", 'String'> readonly confirmed: FieldRef<"LedgerEntry", 'Boolean'> readonly confirmedAt: FieldRef<"LedgerEntry", 'DateTime'> - readonly postedByAdminUserId: FieldRef<"LedgerEntry", 'String'> + readonly postedByAdminId: FieldRef<"LedgerEntry", 'String'> readonly labName: FieldRef<"LedgerEntry", 'String'> readonly hallmark: FieldRef<"LedgerEntry", 'String'> readonly accountName: FieldRef<"LedgerEntry", 'String'> @@ -31210,18 +32455,18 @@ export namespace Prisma { } /** - * LedgerEntry.postedByAdminUser + * LedgerEntry.postedByAdmin */ - export type LedgerEntry$postedByAdminUserArgs = { + export type LedgerEntry$postedByAdminArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -33350,6 +34595,7 @@ export namespace Prisma { createdAt?: boolean permissions?: boolean | UserType$permissionsArgs adminUsers?: boolean | UserType$adminUsersArgs + admins?: boolean | UserType$adminsArgs _count?: boolean | UserTypeCountOutputTypeDefaultArgs }, ExtArgs["result"]["userType"]> @@ -33370,6 +34616,7 @@ export namespace Prisma { export type UserTypeInclude = { permissions?: boolean | UserType$permissionsArgs adminUsers?: boolean | UserType$adminUsersArgs + admins?: boolean | UserType$adminsArgs _count?: boolean | UserTypeCountOutputTypeDefaultArgs } export type UserTypeIncludeCreateManyAndReturn = {} @@ -33379,6 +34626,7 @@ export namespace Prisma { objects: { permissions: Prisma.$PermissionPayload[] adminUsers: Prisma.$AdminUserPayload[] + admins: Prisma.$AdminPayload[] } scalars: $Extensions.GetPayloadResult<{ /** @@ -33755,6 +35003,7 @@ export namespace Prisma { readonly [Symbol.toStringTag]: "PrismaPromise" permissions = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> adminUsers = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> + admins = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -34141,6 +35390,26 @@ export namespace Prisma { distinct?: AdminUserScalarFieldEnum | AdminUserScalarFieldEnum[] } + /** + * UserType.admins + */ + export type UserType$adminsArgs = { + /** + * Select specific fields to fetch from the Admin + */ + select?: AdminSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminInclude | null + where?: AdminWhereInput + orderBy?: AdminOrderByWithRelationInput | AdminOrderByWithRelationInput[] + cursor?: AdminWhereUniqueInput + take?: number + skip?: number + distinct?: AdminScalarFieldEnum | AdminScalarFieldEnum[] + } + /** * UserType without action */ @@ -41990,7 +43259,7 @@ export namespace Prisma { export type BranchAllocationMinAggregateOutputType = { id: string | null branchId: string | null - allocatorAdminUserId: string | null + allocatorAdminId: string | null note: string | null createdAt: Date | null } @@ -41998,7 +43267,7 @@ export namespace Prisma { export type BranchAllocationMaxAggregateOutputType = { id: string | null branchId: string | null - allocatorAdminUserId: string | null + allocatorAdminId: string | null note: string | null createdAt: Date | null } @@ -42006,7 +43275,7 @@ export namespace Prisma { export type BranchAllocationCountAggregateOutputType = { id: number branchId: number - allocatorAdminUserId: number + allocatorAdminId: number note: number createdAt: number _all: number @@ -42016,7 +43285,7 @@ export namespace Prisma { export type BranchAllocationMinAggregateInputType = { id?: true branchId?: true - allocatorAdminUserId?: true + allocatorAdminId?: true note?: true createdAt?: true } @@ -42024,7 +43293,7 @@ export namespace Prisma { export type BranchAllocationMaxAggregateInputType = { id?: true branchId?: true - allocatorAdminUserId?: true + allocatorAdminId?: true note?: true createdAt?: true } @@ -42032,7 +43301,7 @@ export namespace Prisma { export type BranchAllocationCountAggregateInputType = { id?: true branchId?: true - allocatorAdminUserId?: true + allocatorAdminId?: true note?: true createdAt?: true _all?: true @@ -42113,7 +43382,7 @@ export namespace Prisma { export type BranchAllocationGroupByOutputType = { id: string branchId: string - allocatorAdminUserId: string | null + allocatorAdminId: string | null note: string | null createdAt: Date _count: BranchAllocationCountAggregateOutputType | null @@ -42138,11 +43407,11 @@ export namespace Prisma { export type BranchAllocationSelect = $Extensions.GetSelect<{ id?: boolean branchId?: boolean - allocatorAdminUserId?: boolean + allocatorAdminId?: boolean note?: boolean createdAt?: boolean branch?: boolean | BranchDefaultArgs - allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs + allocatorAdmin?: boolean | BranchAllocation$allocatorAdminArgs items?: boolean | BranchAllocation$itemsArgs _count?: boolean | BranchAllocationCountOutputTypeDefaultArgs }, ExtArgs["result"]["branchAllocation"]> @@ -42150,37 +43419,37 @@ export namespace Prisma { export type BranchAllocationSelectCreateManyAndReturn = $Extensions.GetSelect<{ id?: boolean branchId?: boolean - allocatorAdminUserId?: boolean + allocatorAdminId?: boolean note?: boolean createdAt?: boolean branch?: boolean | BranchDefaultArgs - allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs + allocatorAdmin?: boolean | BranchAllocation$allocatorAdminArgs }, ExtArgs["result"]["branchAllocation"]> export type BranchAllocationSelectScalar = { id?: boolean branchId?: boolean - allocatorAdminUserId?: boolean + allocatorAdminId?: boolean note?: boolean createdAt?: boolean } export type BranchAllocationInclude = { branch?: boolean | BranchDefaultArgs - allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs + allocatorAdmin?: boolean | BranchAllocation$allocatorAdminArgs items?: boolean | BranchAllocation$itemsArgs _count?: boolean | BranchAllocationCountOutputTypeDefaultArgs } export type BranchAllocationIncludeCreateManyAndReturn = { branch?: boolean | BranchDefaultArgs - allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs + allocatorAdmin?: boolean | BranchAllocation$allocatorAdminArgs } export type $BranchAllocationPayload = { name: "BranchAllocation" objects: { branch: Prisma.$BranchPayload - allocatorAdminUser: Prisma.$AdminUserPayload | null + allocatorAdmin: Prisma.$AdminPayload | null items: Prisma.$BranchAllocationItemPayload[] } scalars: $Extensions.GetPayloadResult<{ @@ -42189,7 +43458,7 @@ export namespace Prisma { /** * Legacy `allocator_user` — the admin who filed the allocation. */ - allocatorAdminUserId: string | null + allocatorAdminId: string | null note: string | null createdAt: Date }, ExtArgs["result"]["branchAllocation"]> @@ -42557,7 +43826,7 @@ export namespace Prisma { export interface Prisma__BranchAllocationClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" branch = {}>(args?: Subset>): Prisma__BranchClient<$Result.GetResult, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> - allocatorAdminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + allocatorAdmin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> items = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -42590,7 +43859,7 @@ export namespace Prisma { interface BranchAllocationFieldRefs { readonly id: FieldRef<"BranchAllocation", 'String'> readonly branchId: FieldRef<"BranchAllocation", 'String'> - readonly allocatorAdminUserId: FieldRef<"BranchAllocation", 'String'> + readonly allocatorAdminId: FieldRef<"BranchAllocation", 'String'> readonly note: FieldRef<"BranchAllocation", 'String'> readonly createdAt: FieldRef<"BranchAllocation", 'DateTime'> } @@ -42911,18 +44180,18 @@ export namespace Prisma { } /** - * BranchAllocation.allocatorAdminUser + * BranchAllocation.allocatorAdmin */ - export type BranchAllocation$allocatorAdminUserArgs = { + export type BranchAllocation$allocatorAdminArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -43950,7 +45219,7 @@ export namespace Prisma { recipients: string | null body: string | null sentCount: number | null - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date | null } @@ -43960,7 +45229,7 @@ export namespace Prisma { recipients: string | null body: string | null sentCount: number | null - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date | null } @@ -43970,7 +45239,7 @@ export namespace Prisma { recipients: number body: number sentCount: number - sentByAdminUserId: number + sentByAdminId: number createdAt: number _all: number } @@ -43990,7 +45259,7 @@ export namespace Prisma { recipients?: true body?: true sentCount?: true - sentByAdminUserId?: true + sentByAdminId?: true createdAt?: true } @@ -44000,7 +45269,7 @@ export namespace Prisma { recipients?: true body?: true sentCount?: true - sentByAdminUserId?: true + sentByAdminId?: true createdAt?: true } @@ -44010,7 +45279,7 @@ export namespace Prisma { recipients?: true body?: true sentCount?: true - sentByAdminUserId?: true + sentByAdminId?: true createdAt?: true _all?: true } @@ -44107,7 +45376,7 @@ export namespace Prisma { recipients: string | null body: string sentCount: number - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date _count: SmsMessageCountAggregateOutputType | null _avg: SmsMessageAvgAggregateOutputType | null @@ -44136,9 +45405,9 @@ export namespace Prisma { recipients?: boolean body?: boolean sentCount?: boolean - sentByAdminUserId?: boolean + sentByAdminId?: boolean createdAt?: boolean - sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs + sentByAdmin?: boolean | SmsMessage$sentByAdminArgs }, ExtArgs["result"]["smsMessage"]> export type SmsMessageSelectCreateManyAndReturn = $Extensions.GetSelect<{ @@ -44147,9 +45416,9 @@ export namespace Prisma { recipients?: boolean body?: boolean sentCount?: boolean - sentByAdminUserId?: boolean + sentByAdminId?: boolean createdAt?: boolean - sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs + sentByAdmin?: boolean | SmsMessage$sentByAdminArgs }, ExtArgs["result"]["smsMessage"]> export type SmsMessageSelectScalar = { @@ -44158,21 +45427,21 @@ export namespace Prisma { recipients?: boolean body?: boolean sentCount?: boolean - sentByAdminUserId?: boolean + sentByAdminId?: boolean createdAt?: boolean } export type SmsMessageInclude = { - sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs + sentByAdmin?: boolean | SmsMessage$sentByAdminArgs } export type SmsMessageIncludeCreateManyAndReturn = { - sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs + sentByAdmin?: boolean | SmsMessage$sentByAdminArgs } export type $SmsMessagePayload = { name: "SmsMessage" objects: { - sentByAdminUser: Prisma.$AdminUserPayload | null + sentByAdmin: Prisma.$AdminPayload | null } scalars: $Extensions.GetPayloadResult<{ id: string @@ -44186,7 +45455,7 @@ export namespace Prisma { * How many numbers the send actually resolved to. */ sentCount: number - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date }, ExtArgs["result"]["smsMessage"]> composites: {} @@ -44552,7 +45821,7 @@ export namespace Prisma { */ export interface Prisma__SmsMessageClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - sentByAdminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + sentByAdmin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -44587,7 +45856,7 @@ export namespace Prisma { readonly recipients: FieldRef<"SmsMessage", 'String'> readonly body: FieldRef<"SmsMessage", 'String'> readonly sentCount: FieldRef<"SmsMessage", 'Int'> - readonly sentByAdminUserId: FieldRef<"SmsMessage", 'String'> + readonly sentByAdminId: FieldRef<"SmsMessage", 'String'> readonly createdAt: FieldRef<"SmsMessage", 'DateTime'> } @@ -44907,18 +46176,18 @@ export namespace Prisma { } /** - * SmsMessage.sentByAdminUser + * SmsMessage.sentByAdmin */ - export type SmsMessage$sentByAdminUserArgs = { + export type SmsMessage$sentByAdminArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -44951,7 +46220,7 @@ export namespace Prisma { title: string | null body: string | null audience: $Enums.MessageAudience | null - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date | null } @@ -44960,7 +46229,7 @@ export namespace Prisma { title: string | null body: string | null audience: $Enums.MessageAudience | null - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date | null } @@ -44969,7 +46238,7 @@ export namespace Prisma { title: number body: number audience: number - sentByAdminUserId: number + sentByAdminId: number createdAt: number _all: number } @@ -44980,7 +46249,7 @@ export namespace Prisma { title?: true body?: true audience?: true - sentByAdminUserId?: true + sentByAdminId?: true createdAt?: true } @@ -44989,7 +46258,7 @@ export namespace Prisma { title?: true body?: true audience?: true - sentByAdminUserId?: true + sentByAdminId?: true createdAt?: true } @@ -44998,7 +46267,7 @@ export namespace Prisma { title?: true body?: true audience?: true - sentByAdminUserId?: true + sentByAdminId?: true createdAt?: true _all?: true } @@ -45080,7 +46349,7 @@ export namespace Prisma { title: string body: string audience: $Enums.MessageAudience - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date _count: NotificationCountAggregateOutputType | null _min: NotificationMinAggregateOutputType | null @@ -45106,9 +46375,9 @@ export namespace Prisma { title?: boolean body?: boolean audience?: boolean - sentByAdminUserId?: boolean + sentByAdminId?: boolean createdAt?: boolean - sentByAdminUser?: boolean | Notification$sentByAdminUserArgs + sentByAdmin?: boolean | Notification$sentByAdminArgs recipients?: boolean | Notification$recipientsArgs _count?: boolean | NotificationCountOutputTypeDefaultArgs }, ExtArgs["result"]["notification"]> @@ -45118,9 +46387,9 @@ export namespace Prisma { title?: boolean body?: boolean audience?: boolean - sentByAdminUserId?: boolean + sentByAdminId?: boolean createdAt?: boolean - sentByAdminUser?: boolean | Notification$sentByAdminUserArgs + sentByAdmin?: boolean | Notification$sentByAdminArgs }, ExtArgs["result"]["notification"]> export type NotificationSelectScalar = { @@ -45128,23 +46397,23 @@ export namespace Prisma { title?: boolean body?: boolean audience?: boolean - sentByAdminUserId?: boolean + sentByAdminId?: boolean createdAt?: boolean } export type NotificationInclude = { - sentByAdminUser?: boolean | Notification$sentByAdminUserArgs + sentByAdmin?: boolean | Notification$sentByAdminArgs recipients?: boolean | Notification$recipientsArgs _count?: boolean | NotificationCountOutputTypeDefaultArgs } export type NotificationIncludeCreateManyAndReturn = { - sentByAdminUser?: boolean | Notification$sentByAdminUserArgs + sentByAdmin?: boolean | Notification$sentByAdminArgs } export type $NotificationPayload = { name: "Notification" objects: { - sentByAdminUser: Prisma.$AdminUserPayload | null + sentByAdmin: Prisma.$AdminPayload | null recipients: Prisma.$NotificationRecipientPayload[] } scalars: $Extensions.GetPayloadResult<{ @@ -45152,7 +46421,7 @@ export namespace Prisma { title: string body: string audience: $Enums.MessageAudience - sentByAdminUserId: string | null + sentByAdminId: string | null createdAt: Date }, ExtArgs["result"]["notification"]> composites: {} @@ -45518,7 +46787,7 @@ export namespace Prisma { */ export interface Prisma__NotificationClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - sentByAdminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + sentByAdmin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> recipients = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -45553,7 +46822,7 @@ export namespace Prisma { readonly title: FieldRef<"Notification", 'String'> readonly body: FieldRef<"Notification", 'String'> readonly audience: FieldRef<"Notification", 'MessageAudience'> - readonly sentByAdminUserId: FieldRef<"Notification", 'String'> + readonly sentByAdminId: FieldRef<"Notification", 'String'> readonly createdAt: FieldRef<"Notification", 'DateTime'> } @@ -45873,18 +47142,18 @@ export namespace Prisma { } /** - * Notification.sentByAdminUser + * Notification.sentByAdmin */ - export type Notification$sentByAdminUserArgs = { + export type Notification$sentByAdminArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -48678,7 +49947,7 @@ export namespace Prisma { mimeType: string | null sizeBytes: number | null purpose: string | null - uploadedByAdminUserId: string | null + uploadedByAdminId: string | null createdAt: Date | null } @@ -48689,7 +49958,7 @@ export namespace Prisma { mimeType: string | null sizeBytes: number | null purpose: string | null - uploadedByAdminUserId: string | null + uploadedByAdminId: string | null createdAt: Date | null } @@ -48700,7 +49969,7 @@ export namespace Prisma { mimeType: number sizeBytes: number purpose: number - uploadedByAdminUserId: number + uploadedByAdminId: number createdAt: number _all: number } @@ -48721,7 +49990,7 @@ export namespace Prisma { mimeType?: true sizeBytes?: true purpose?: true - uploadedByAdminUserId?: true + uploadedByAdminId?: true createdAt?: true } @@ -48732,7 +50001,7 @@ export namespace Prisma { mimeType?: true sizeBytes?: true purpose?: true - uploadedByAdminUserId?: true + uploadedByAdminId?: true createdAt?: true } @@ -48743,7 +50012,7 @@ export namespace Prisma { mimeType?: true sizeBytes?: true purpose?: true - uploadedByAdminUserId?: true + uploadedByAdminId?: true createdAt?: true _all?: true } @@ -48841,7 +50110,7 @@ export namespace Prisma { mimeType: string sizeBytes: number purpose: string | null - uploadedByAdminUserId: string | null + uploadedByAdminId: string | null createdAt: Date _count: UploadedFileCountAggregateOutputType | null _avg: UploadedFileAvgAggregateOutputType | null @@ -48871,9 +50140,9 @@ export namespace Prisma { mimeType?: boolean sizeBytes?: boolean purpose?: boolean - uploadedByAdminUserId?: boolean + uploadedByAdminId?: boolean createdAt?: boolean - uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs + uploadedByAdmin?: boolean | UploadedFile$uploadedByAdminArgs customerAvatars?: boolean | UploadedFile$customerAvatarsArgs adminUserAvatars?: boolean | UploadedFile$adminUserAvatarsArgs _count?: boolean | UploadedFileCountOutputTypeDefaultArgs @@ -48886,9 +50155,9 @@ export namespace Prisma { mimeType?: boolean sizeBytes?: boolean purpose?: boolean - uploadedByAdminUserId?: boolean + uploadedByAdminId?: boolean createdAt?: boolean - uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs + uploadedByAdmin?: boolean | UploadedFile$uploadedByAdminArgs }, ExtArgs["result"]["uploadedFile"]> export type UploadedFileSelectScalar = { @@ -48898,24 +50167,24 @@ export namespace Prisma { mimeType?: boolean sizeBytes?: boolean purpose?: boolean - uploadedByAdminUserId?: boolean + uploadedByAdminId?: boolean createdAt?: boolean } export type UploadedFileInclude = { - uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs + uploadedByAdmin?: boolean | UploadedFile$uploadedByAdminArgs customerAvatars?: boolean | UploadedFile$customerAvatarsArgs adminUserAvatars?: boolean | UploadedFile$adminUserAvatarsArgs _count?: boolean | UploadedFileCountOutputTypeDefaultArgs } export type UploadedFileIncludeCreateManyAndReturn = { - uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs + uploadedByAdmin?: boolean | UploadedFile$uploadedByAdminArgs } export type $UploadedFilePayload = { name: "UploadedFile" objects: { - uploadedByAdminUser: Prisma.$AdminUserPayload | null + uploadedByAdmin: Prisma.$AdminPayload | null customerAvatars: Prisma.$CustomerPayload[] adminUserAvatars: Prisma.$AdminUserPayload[] } @@ -48933,7 +50202,7 @@ export namespace Prisma { * 'customer.nationalId'. Kept loose so a new form needs no schema change. */ purpose: string | null - uploadedByAdminUserId: string | null + uploadedByAdminId: string | null createdAt: Date }, ExtArgs["result"]["uploadedFile"]> composites: {} @@ -49299,7 +50568,7 @@ export namespace Prisma { */ export interface Prisma__UploadedFileClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - uploadedByAdminUser = {}>(args?: Subset>): Prisma__AdminUserClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> + uploadedByAdmin = {}>(args?: Subset>): Prisma__AdminClient<$Result.GetResult, T, "findUniqueOrThrow"> | null, null, ExtArgs> customerAvatars = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> adminUserAvatars = {}>(args?: Subset>): Prisma.PrismaPromise<$Result.GetResult, T, "findMany"> | Null> /** @@ -49337,7 +50606,7 @@ export namespace Prisma { readonly mimeType: FieldRef<"UploadedFile", 'String'> readonly sizeBytes: FieldRef<"UploadedFile", 'Int'> readonly purpose: FieldRef<"UploadedFile", 'String'> - readonly uploadedByAdminUserId: FieldRef<"UploadedFile", 'String'> + readonly uploadedByAdminId: FieldRef<"UploadedFile", 'String'> readonly createdAt: FieldRef<"UploadedFile", 'DateTime'> } @@ -49657,18 +50926,18 @@ export namespace Prisma { } /** - * UploadedFile.uploadedByAdminUser + * UploadedFile.uploadedByAdmin */ - export type UploadedFile$uploadedByAdminUserArgs = { + export type UploadedFile$uploadedByAdminArgs = { /** - * Select specific fields to fetch from the AdminUser + * Select specific fields to fetch from the Admin */ - select?: AdminUserSelect | null + select?: AdminSelect | null /** * Choose, which related nodes to fetch as well */ - include?: AdminUserInclude | null - where?: AdminUserWhereInput + include?: AdminInclude | null + where?: AdminWhereInput } /** @@ -50782,6 +52051,23 @@ export namespace Prisma { export type CityScalarFieldEnum = (typeof CityScalarFieldEnum)[keyof typeof CityScalarFieldEnum] + export const AdminScalarFieldEnum: { + id: 'id', + fullName: 'fullName', + firstName: 'firstName', + lastName: 'lastName', + mobile: 'mobile', + passwordHash: 'passwordHash', + role: 'role', + userTypeId: 'userTypeId', + branchId: 'branchId', + isActive: 'isActive', + createdAt: 'createdAt' + }; + + export type AdminScalarFieldEnum = (typeof AdminScalarFieldEnum)[keyof typeof AdminScalarFieldEnum] + + export const AdminUserScalarFieldEnum: { id: 'id', fullName: 'fullName', @@ -50828,7 +52114,7 @@ export namespace Prisma { export const AdminSessionScalarFieldEnum: { id: 'id', jti: 'jti', - adminUserId: 'adminUserId', + adminId: 'adminId', iamSessionId: 'iamSessionId', iamSub: 'iamSub', ipAddress: 'ipAddress', @@ -51076,7 +52362,7 @@ export namespace Prisma { fromStatus: 'fromStatus', toStatus: 'toStatus', note: 'note', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', createdAt: 'createdAt' }; @@ -51109,7 +52395,7 @@ export namespace Prisma { id: 'id', preOrderId: 'preOrderId', changes: 'changes', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', ipAddress: 'ipAddress', createdAt: 'createdAt' }; @@ -51129,7 +52415,7 @@ export namespace Prisma { orderId: 'orderId', confirmed: 'confirmed', confirmedAt: 'confirmedAt', - postedByAdminUserId: 'postedByAdminUserId', + postedByAdminId: 'postedByAdminId', labName: 'labName', hallmark: 'hallmark', accountName: 'accountName', @@ -51300,7 +52586,7 @@ export namespace Prisma { export const BranchAllocationScalarFieldEnum: { id: 'id', branchId: 'branchId', - allocatorAdminUserId: 'allocatorAdminUserId', + allocatorAdminId: 'allocatorAdminId', note: 'note', createdAt: 'createdAt' }; @@ -51324,7 +52610,7 @@ export namespace Prisma { recipients: 'recipients', body: 'body', sentCount: 'sentCount', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -51336,7 +52622,7 @@ export namespace Prisma { title: 'title', body: 'body', audience: 'audience', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -51381,7 +52667,7 @@ export namespace Prisma { mimeType: 'mimeType', sizeBytes: 'sizeBytes', purpose: 'purpose', - uploadedByAdminUserId: 'uploadedByAdminUserId', + uploadedByAdminId: 'uploadedByAdminId', createdAt: 'createdAt' }; @@ -51856,6 +53142,123 @@ export namespace Prisma { percentAux?: DecimalNullableWithAggregatesFilter<"City"> | Decimal | DecimalJsLike | number | string | null } + export type AdminWhereInput = { + AND?: AdminWhereInput | AdminWhereInput[] + OR?: AdminWhereInput[] + NOT?: AdminWhereInput | AdminWhereInput[] + id?: StringFilter<"Admin"> | string + fullName?: StringFilter<"Admin"> | string + firstName?: StringNullableFilter<"Admin"> | string | null + lastName?: StringNullableFilter<"Admin"> | string | null + mobile?: StringFilter<"Admin"> | string + passwordHash?: StringFilter<"Admin"> | string + role?: EnumAdminRoleFilter<"Admin"> | $Enums.AdminRole + userTypeId?: IntNullableFilter<"Admin"> | number | null + branchId?: StringNullableFilter<"Admin"> | string | null + isActive?: BoolFilter<"Admin"> | boolean + createdAt?: DateTimeFilter<"Admin"> | Date | string + userType?: XOR | null + branch?: XOR | null + supervisedWorkshops?: WorkshopListRelationFilter + branchAllocations?: BranchAllocationListRelationFilter + postedLedgerEntries?: LedgerEntryListRelationFilter + orderStatusEvents?: OrderStatusEventListRelationFilter + preOrderStatusEvents?: PreOrderStatusEventListRelationFilter + sentSmsMessages?: SmsMessageListRelationFilter + sentNotifications?: NotificationListRelationFilter + uploadedFiles?: UploadedFileListRelationFilter + sessions?: AdminSessionListRelationFilter + } + + export type AdminOrderByWithRelationInput = { + id?: SortOrder + fullName?: SortOrder + firstName?: SortOrderInput | SortOrder + lastName?: SortOrderInput | SortOrder + mobile?: SortOrder + passwordHash?: SortOrder + role?: SortOrder + userTypeId?: SortOrderInput | SortOrder + branchId?: SortOrderInput | SortOrder + isActive?: SortOrder + createdAt?: SortOrder + userType?: UserTypeOrderByWithRelationInput + branch?: BranchOrderByWithRelationInput + supervisedWorkshops?: WorkshopOrderByRelationAggregateInput + branchAllocations?: BranchAllocationOrderByRelationAggregateInput + postedLedgerEntries?: LedgerEntryOrderByRelationAggregateInput + orderStatusEvents?: OrderStatusEventOrderByRelationAggregateInput + preOrderStatusEvents?: PreOrderStatusEventOrderByRelationAggregateInput + sentSmsMessages?: SmsMessageOrderByRelationAggregateInput + sentNotifications?: NotificationOrderByRelationAggregateInput + uploadedFiles?: UploadedFileOrderByRelationAggregateInput + sessions?: AdminSessionOrderByRelationAggregateInput + } + + export type AdminWhereUniqueInput = Prisma.AtLeast<{ + id?: string + mobile?: string + AND?: AdminWhereInput | AdminWhereInput[] + OR?: AdminWhereInput[] + NOT?: AdminWhereInput | AdminWhereInput[] + fullName?: StringFilter<"Admin"> | string + firstName?: StringNullableFilter<"Admin"> | string | null + lastName?: StringNullableFilter<"Admin"> | string | null + passwordHash?: StringFilter<"Admin"> | string + role?: EnumAdminRoleFilter<"Admin"> | $Enums.AdminRole + userTypeId?: IntNullableFilter<"Admin"> | number | null + branchId?: StringNullableFilter<"Admin"> | string | null + isActive?: BoolFilter<"Admin"> | boolean + createdAt?: DateTimeFilter<"Admin"> | Date | string + userType?: XOR | null + branch?: XOR | null + supervisedWorkshops?: WorkshopListRelationFilter + branchAllocations?: BranchAllocationListRelationFilter + postedLedgerEntries?: LedgerEntryListRelationFilter + orderStatusEvents?: OrderStatusEventListRelationFilter + preOrderStatusEvents?: PreOrderStatusEventListRelationFilter + sentSmsMessages?: SmsMessageListRelationFilter + sentNotifications?: NotificationListRelationFilter + uploadedFiles?: UploadedFileListRelationFilter + sessions?: AdminSessionListRelationFilter + }, "id" | "mobile"> + + export type AdminOrderByWithAggregationInput = { + id?: SortOrder + fullName?: SortOrder + firstName?: SortOrderInput | SortOrder + lastName?: SortOrderInput | SortOrder + mobile?: SortOrder + passwordHash?: SortOrder + role?: SortOrder + userTypeId?: SortOrderInput | SortOrder + branchId?: SortOrderInput | SortOrder + isActive?: SortOrder + createdAt?: SortOrder + _count?: AdminCountOrderByAggregateInput + _avg?: AdminAvgOrderByAggregateInput + _max?: AdminMaxOrderByAggregateInput + _min?: AdminMinOrderByAggregateInput + _sum?: AdminSumOrderByAggregateInput + } + + export type AdminScalarWhereWithAggregatesInput = { + AND?: AdminScalarWhereWithAggregatesInput | AdminScalarWhereWithAggregatesInput[] + OR?: AdminScalarWhereWithAggregatesInput[] + NOT?: AdminScalarWhereWithAggregatesInput | AdminScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Admin"> | string + fullName?: StringWithAggregatesFilter<"Admin"> | string + firstName?: StringNullableWithAggregatesFilter<"Admin"> | string | null + lastName?: StringNullableWithAggregatesFilter<"Admin"> | string | null + mobile?: StringWithAggregatesFilter<"Admin"> | string + passwordHash?: StringWithAggregatesFilter<"Admin"> | string + role?: EnumAdminRoleWithAggregatesFilter<"Admin"> | $Enums.AdminRole + userTypeId?: IntNullableWithAggregatesFilter<"Admin"> | number | null + branchId?: StringNullableWithAggregatesFilter<"Admin"> | string | null + isActive?: BoolWithAggregatesFilter<"Admin"> | boolean + createdAt?: DateTimeWithAggregatesFilter<"Admin"> | Date | string + } + export type AdminUserWhereInput = { AND?: AdminUserWhereInput | AdminUserWhereInput[] OR?: AdminUserWhereInput[] @@ -51882,16 +53285,7 @@ export namespace Prisma { avatarFile?: XOR | null referredCustomers?: CustomerListRelationFilter creditedOrders?: OrderListRelationFilter - supervisedWorkshops?: WorkshopListRelationFilter - branchAllocations?: BranchAllocationListRelationFilter - postedLedgerEntries?: LedgerEntryListRelationFilter - orderStatusEvents?: OrderStatusEventListRelationFilter - preOrderStatusEvents?: PreOrderStatusEventListRelationFilter - sentSmsMessages?: SmsMessageListRelationFilter - sentNotifications?: NotificationListRelationFilter - uploadedFiles?: UploadedFileListRelationFilter salesExpertProfile?: XOR | null - sessions?: AdminSessionListRelationFilter } export type AdminUserOrderByWithRelationInput = { @@ -51917,16 +53311,7 @@ export namespace Prisma { avatarFile?: UploadedFileOrderByWithRelationInput referredCustomers?: CustomerOrderByRelationAggregateInput creditedOrders?: OrderOrderByRelationAggregateInput - supervisedWorkshops?: WorkshopOrderByRelationAggregateInput - branchAllocations?: BranchAllocationOrderByRelationAggregateInput - postedLedgerEntries?: LedgerEntryOrderByRelationAggregateInput - orderStatusEvents?: OrderStatusEventOrderByRelationAggregateInput - preOrderStatusEvents?: PreOrderStatusEventOrderByRelationAggregateInput - sentSmsMessages?: SmsMessageOrderByRelationAggregateInput - sentNotifications?: NotificationOrderByRelationAggregateInput - uploadedFiles?: UploadedFileOrderByRelationAggregateInput salesExpertProfile?: SalesExpertProfileOrderByWithRelationInput - sessions?: AdminSessionOrderByRelationAggregateInput } export type AdminUserWhereUniqueInput = Prisma.AtLeast<{ @@ -51955,16 +53340,7 @@ export namespace Prisma { avatarFile?: XOR | null referredCustomers?: CustomerListRelationFilter creditedOrders?: OrderListRelationFilter - supervisedWorkshops?: WorkshopListRelationFilter - branchAllocations?: BranchAllocationListRelationFilter - postedLedgerEntries?: LedgerEntryListRelationFilter - orderStatusEvents?: OrderStatusEventListRelationFilter - preOrderStatusEvents?: PreOrderStatusEventListRelationFilter - sentSmsMessages?: SmsMessageListRelationFilter - sentNotifications?: NotificationListRelationFilter - uploadedFiles?: UploadedFileListRelationFilter salesExpertProfile?: XOR | null - sessions?: AdminSessionListRelationFilter }, "id" | "mobile"> export type AdminUserOrderByWithAggregationInput = { @@ -52118,7 +53494,7 @@ export namespace Prisma { NOT?: AdminSessionWhereInput | AdminSessionWhereInput[] id?: StringFilter<"AdminSession"> | string jti?: StringFilter<"AdminSession"> | string - adminUserId?: StringFilter<"AdminSession"> | string + adminId?: StringFilter<"AdminSession"> | string iamSessionId?: StringNullableFilter<"AdminSession"> | string | null iamSub?: StringNullableFilter<"AdminSession"> | string | null ipAddress?: StringNullableFilter<"AdminSession"> | string | null @@ -52128,13 +53504,13 @@ export namespace Prisma { lastSeenAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null revokedAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null revokedReason?: StringNullableFilter<"AdminSession"> | string | null - adminUser?: XOR + admin?: XOR } export type AdminSessionOrderByWithRelationInput = { id?: SortOrder jti?: SortOrder - adminUserId?: SortOrder + adminId?: SortOrder iamSessionId?: SortOrderInput | SortOrder iamSub?: SortOrderInput | SortOrder ipAddress?: SortOrderInput | SortOrder @@ -52144,7 +53520,7 @@ export namespace Prisma { lastSeenAt?: SortOrderInput | SortOrder revokedAt?: SortOrderInput | SortOrder revokedReason?: SortOrderInput | SortOrder - adminUser?: AdminUserOrderByWithRelationInput + admin?: AdminOrderByWithRelationInput } export type AdminSessionWhereUniqueInput = Prisma.AtLeast<{ @@ -52153,7 +53529,7 @@ export namespace Prisma { AND?: AdminSessionWhereInput | AdminSessionWhereInput[] OR?: AdminSessionWhereInput[] NOT?: AdminSessionWhereInput | AdminSessionWhereInput[] - adminUserId?: StringFilter<"AdminSession"> | string + adminId?: StringFilter<"AdminSession"> | string iamSessionId?: StringNullableFilter<"AdminSession"> | string | null iamSub?: StringNullableFilter<"AdminSession"> | string | null ipAddress?: StringNullableFilter<"AdminSession"> | string | null @@ -52163,13 +53539,13 @@ export namespace Prisma { lastSeenAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null revokedAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null revokedReason?: StringNullableFilter<"AdminSession"> | string | null - adminUser?: XOR + admin?: XOR }, "id" | "jti"> export type AdminSessionOrderByWithAggregationInput = { id?: SortOrder jti?: SortOrder - adminUserId?: SortOrder + adminId?: SortOrder iamSessionId?: SortOrderInput | SortOrder iamSub?: SortOrderInput | SortOrder ipAddress?: SortOrderInput | SortOrder @@ -52190,7 +53566,7 @@ export namespace Prisma { NOT?: AdminSessionScalarWhereWithAggregatesInput | AdminSessionScalarWhereWithAggregatesInput[] id?: StringWithAggregatesFilter<"AdminSession"> | string jti?: StringWithAggregatesFilter<"AdminSession"> | string - adminUserId?: StringWithAggregatesFilter<"AdminSession"> | string + adminId?: StringWithAggregatesFilter<"AdminSession"> | string iamSessionId?: StringNullableWithAggregatesFilter<"AdminSession"> | string | null iamSub?: StringNullableWithAggregatesFilter<"AdminSession"> | string | null ipAddress?: StringNullableWithAggregatesFilter<"AdminSession"> | string | null @@ -52666,6 +54042,7 @@ export namespace Prisma { cityId?: StringNullableFilter<"Branch"> | string | null city?: XOR | null adminUsers?: AdminUserListRelationFilter + admins?: AdminListRelationFilter orders?: OrderListRelationFilter allocations?: BranchAllocationListRelationFilter } @@ -52679,6 +54056,7 @@ export namespace Prisma { cityId?: SortOrderInput | SortOrder city?: CityOrderByWithRelationInput adminUsers?: AdminUserOrderByRelationAggregateInput + admins?: AdminOrderByRelationAggregateInput orders?: OrderOrderByRelationAggregateInput allocations?: BranchAllocationOrderByRelationAggregateInput } @@ -52695,6 +54073,7 @@ export namespace Prisma { cityId?: StringNullableFilter<"Branch"> | string | null city?: XOR | null adminUsers?: AdminUserListRelationFilter + admins?: AdminListRelationFilter orders?: OrderListRelationFilter allocations?: BranchAllocationListRelationFilter }, "id"> @@ -52733,7 +54112,7 @@ export namespace Prisma { phone?: StringNullableFilter<"Workshop"> | string | null supervisorId?: StringNullableFilter<"Workshop"> | string | null isActive?: BoolFilter<"Workshop"> | boolean - supervisor?: XOR | null + supervisor?: XOR | null preOrders?: PreOrderListRelationFilter } @@ -52744,7 +54123,7 @@ export namespace Prisma { phone?: SortOrderInput | SortOrder supervisorId?: SortOrderInput | SortOrder isActive?: SortOrder - supervisor?: AdminUserOrderByWithRelationInput + supervisor?: AdminOrderByWithRelationInput preOrders?: PreOrderOrderByRelationAggregateInput } @@ -52758,7 +54137,7 @@ export namespace Prisma { phone?: StringNullableFilter<"Workshop"> | string | null supervisorId?: StringNullableFilter<"Workshop"> | string | null isActive?: BoolFilter<"Workshop"> | boolean - supervisor?: XOR | null + supervisor?: XOR | null preOrders?: PreOrderListRelationFilter }, "id"> @@ -53505,10 +54884,10 @@ export namespace Prisma { fromStatus?: EnumOrderStatusNullableFilter<"OrderStatusEvent"> | $Enums.OrderStatus | null toStatus?: EnumOrderStatusFilter<"OrderStatusEvent"> | $Enums.OrderStatus note?: StringNullableFilter<"OrderStatusEvent"> | string | null - actorAdminUserId?: StringNullableFilter<"OrderStatusEvent"> | string | null + actorAdminId?: StringNullableFilter<"OrderStatusEvent"> | string | null createdAt?: DateTimeFilter<"OrderStatusEvent"> | Date | string order?: XOR - actorAdminUser?: XOR | null + actorAdmin?: XOR | null } export type OrderStatusEventOrderByWithRelationInput = { @@ -53517,10 +54896,10 @@ export namespace Prisma { fromStatus?: SortOrderInput | SortOrder toStatus?: SortOrder note?: SortOrderInput | SortOrder - actorAdminUserId?: SortOrderInput | SortOrder + actorAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder order?: OrderOrderByWithRelationInput - actorAdminUser?: AdminUserOrderByWithRelationInput + actorAdmin?: AdminOrderByWithRelationInput } export type OrderStatusEventWhereUniqueInput = Prisma.AtLeast<{ @@ -53532,10 +54911,10 @@ export namespace Prisma { fromStatus?: EnumOrderStatusNullableFilter<"OrderStatusEvent"> | $Enums.OrderStatus | null toStatus?: EnumOrderStatusFilter<"OrderStatusEvent"> | $Enums.OrderStatus note?: StringNullableFilter<"OrderStatusEvent"> | string | null - actorAdminUserId?: StringNullableFilter<"OrderStatusEvent"> | string | null + actorAdminId?: StringNullableFilter<"OrderStatusEvent"> | string | null createdAt?: DateTimeFilter<"OrderStatusEvent"> | Date | string order?: XOR - actorAdminUser?: XOR | null + actorAdmin?: XOR | null }, "id"> export type OrderStatusEventOrderByWithAggregationInput = { @@ -53544,7 +54923,7 @@ export namespace Prisma { fromStatus?: SortOrderInput | SortOrder toStatus?: SortOrder note?: SortOrderInput | SortOrder - actorAdminUserId?: SortOrderInput | SortOrder + actorAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder _count?: OrderStatusEventCountOrderByAggregateInput _max?: OrderStatusEventMaxOrderByAggregateInput @@ -53560,7 +54939,7 @@ export namespace Prisma { fromStatus?: EnumOrderStatusNullableWithAggregatesFilter<"OrderStatusEvent"> | $Enums.OrderStatus | null toStatus?: EnumOrderStatusWithAggregatesFilter<"OrderStatusEvent"> | $Enums.OrderStatus note?: StringNullableWithAggregatesFilter<"OrderStatusEvent"> | string | null - actorAdminUserId?: StringNullableWithAggregatesFilter<"OrderStatusEvent"> | string | null + actorAdminId?: StringNullableWithAggregatesFilter<"OrderStatusEvent"> | string | null createdAt?: DateTimeWithAggregatesFilter<"OrderStatusEvent"> | Date | string } @@ -53695,22 +55074,22 @@ export namespace Prisma { id?: StringFilter<"PreOrderStatusEvent"> | string preOrderId?: StringFilter<"PreOrderStatusEvent"> | string changes?: JsonFilter<"PreOrderStatusEvent"> - actorAdminUserId?: StringNullableFilter<"PreOrderStatusEvent"> | string | null + actorAdminId?: StringNullableFilter<"PreOrderStatusEvent"> | string | null ipAddress?: StringNullableFilter<"PreOrderStatusEvent"> | string | null createdAt?: DateTimeFilter<"PreOrderStatusEvent"> | Date | string preOrder?: XOR - actorAdminUser?: XOR | null + actorAdmin?: XOR | null } export type PreOrderStatusEventOrderByWithRelationInput = { id?: SortOrder preOrderId?: SortOrder changes?: SortOrder - actorAdminUserId?: SortOrderInput | SortOrder + actorAdminId?: SortOrderInput | SortOrder ipAddress?: SortOrderInput | SortOrder createdAt?: SortOrder preOrder?: PreOrderOrderByWithRelationInput - actorAdminUser?: AdminUserOrderByWithRelationInput + actorAdmin?: AdminOrderByWithRelationInput } export type PreOrderStatusEventWhereUniqueInput = Prisma.AtLeast<{ @@ -53720,18 +55099,18 @@ export namespace Prisma { NOT?: PreOrderStatusEventWhereInput | PreOrderStatusEventWhereInput[] preOrderId?: StringFilter<"PreOrderStatusEvent"> | string changes?: JsonFilter<"PreOrderStatusEvent"> - actorAdminUserId?: StringNullableFilter<"PreOrderStatusEvent"> | string | null + actorAdminId?: StringNullableFilter<"PreOrderStatusEvent"> | string | null ipAddress?: StringNullableFilter<"PreOrderStatusEvent"> | string | null createdAt?: DateTimeFilter<"PreOrderStatusEvent"> | Date | string preOrder?: XOR - actorAdminUser?: XOR | null + actorAdmin?: XOR | null }, "id"> export type PreOrderStatusEventOrderByWithAggregationInput = { id?: SortOrder preOrderId?: SortOrder changes?: SortOrder - actorAdminUserId?: SortOrderInput | SortOrder + actorAdminId?: SortOrderInput | SortOrder ipAddress?: SortOrderInput | SortOrder createdAt?: SortOrder _count?: PreOrderStatusEventCountOrderByAggregateInput @@ -53746,7 +55125,7 @@ export namespace Prisma { id?: StringWithAggregatesFilter<"PreOrderStatusEvent"> | string preOrderId?: StringWithAggregatesFilter<"PreOrderStatusEvent"> | string changes?: JsonWithAggregatesFilter<"PreOrderStatusEvent"> - actorAdminUserId?: StringNullableWithAggregatesFilter<"PreOrderStatusEvent"> | string | null + actorAdminId?: StringNullableWithAggregatesFilter<"PreOrderStatusEvent"> | string | null ipAddress?: StringNullableWithAggregatesFilter<"PreOrderStatusEvent"> | string | null createdAt?: DateTimeWithAggregatesFilter<"PreOrderStatusEvent"> | Date | string } @@ -53766,7 +55145,7 @@ export namespace Prisma { orderId?: StringNullableFilter<"LedgerEntry"> | string | null confirmed?: BoolFilter<"LedgerEntry"> | boolean confirmedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null - postedByAdminUserId?: StringNullableFilter<"LedgerEntry"> | string | null + postedByAdminId?: StringNullableFilter<"LedgerEntry"> | string | null labName?: StringNullableFilter<"LedgerEntry"> | string | null hallmark?: StringNullableFilter<"LedgerEntry"> | string | null accountName?: StringNullableFilter<"LedgerEntry"> | string | null @@ -53779,7 +55158,7 @@ export namespace Prisma { createdAt?: DateTimeFilter<"LedgerEntry"> | Date | string customer?: XOR order?: XOR | null - postedByAdminUser?: XOR | null + postedByAdmin?: XOR | null } export type LedgerEntryOrderByWithRelationInput = { @@ -53794,7 +55173,7 @@ export namespace Prisma { orderId?: SortOrderInput | SortOrder confirmed?: SortOrder confirmedAt?: SortOrderInput | SortOrder - postedByAdminUserId?: SortOrderInput | SortOrder + postedByAdminId?: SortOrderInput | SortOrder labName?: SortOrderInput | SortOrder hallmark?: SortOrderInput | SortOrder accountName?: SortOrderInput | SortOrder @@ -53807,7 +55186,7 @@ export namespace Prisma { createdAt?: SortOrder customer?: CustomerOrderByWithRelationInput order?: OrderOrderByWithRelationInput - postedByAdminUser?: AdminUserOrderByWithRelationInput + postedByAdmin?: AdminOrderByWithRelationInput } export type LedgerEntryWhereUniqueInput = Prisma.AtLeast<{ @@ -53825,7 +55204,7 @@ export namespace Prisma { orderId?: StringNullableFilter<"LedgerEntry"> | string | null confirmed?: BoolFilter<"LedgerEntry"> | boolean confirmedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null - postedByAdminUserId?: StringNullableFilter<"LedgerEntry"> | string | null + postedByAdminId?: StringNullableFilter<"LedgerEntry"> | string | null labName?: StringNullableFilter<"LedgerEntry"> | string | null hallmark?: StringNullableFilter<"LedgerEntry"> | string | null accountName?: StringNullableFilter<"LedgerEntry"> | string | null @@ -53838,7 +55217,7 @@ export namespace Prisma { createdAt?: DateTimeFilter<"LedgerEntry"> | Date | string customer?: XOR order?: XOR | null - postedByAdminUser?: XOR | null + postedByAdmin?: XOR | null }, "id"> export type LedgerEntryOrderByWithAggregationInput = { @@ -53853,7 +55232,7 @@ export namespace Prisma { orderId?: SortOrderInput | SortOrder confirmed?: SortOrder confirmedAt?: SortOrderInput | SortOrder - postedByAdminUserId?: SortOrderInput | SortOrder + postedByAdminId?: SortOrderInput | SortOrder labName?: SortOrderInput | SortOrder hallmark?: SortOrderInput | SortOrder accountName?: SortOrderInput | SortOrder @@ -53886,7 +55265,7 @@ export namespace Prisma { orderId?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null confirmed?: BoolWithAggregatesFilter<"LedgerEntry"> | boolean confirmedAt?: DateTimeNullableWithAggregatesFilter<"LedgerEntry"> | Date | string | null - postedByAdminUserId?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null + postedByAdminId?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null labName?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null hallmark?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null accountName?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null @@ -54035,6 +55414,7 @@ export namespace Prisma { createdAt?: DateTimeFilter<"UserType"> | Date | string permissions?: PermissionListRelationFilter adminUsers?: AdminUserListRelationFilter + admins?: AdminListRelationFilter } export type UserTypeOrderByWithRelationInput = { @@ -54044,6 +55424,7 @@ export namespace Prisma { createdAt?: SortOrder permissions?: PermissionOrderByRelationAggregateInput adminUsers?: AdminUserOrderByRelationAggregateInput + admins?: AdminOrderByRelationAggregateInput } export type UserTypeWhereUniqueInput = Prisma.AtLeast<{ @@ -54056,6 +55437,7 @@ export namespace Prisma { createdAt?: DateTimeFilter<"UserType"> | Date | string permissions?: PermissionListRelationFilter adminUsers?: AdminUserListRelationFilter + admins?: AdminListRelationFilter }, "id"> export type UserTypeOrderByWithAggregationInput = { @@ -54687,22 +56069,22 @@ export namespace Prisma { NOT?: BranchAllocationWhereInput | BranchAllocationWhereInput[] id?: StringFilter<"BranchAllocation"> | string branchId?: StringFilter<"BranchAllocation"> | string - allocatorAdminUserId?: StringNullableFilter<"BranchAllocation"> | string | null + allocatorAdminId?: StringNullableFilter<"BranchAllocation"> | string | null note?: StringNullableFilter<"BranchAllocation"> | string | null createdAt?: DateTimeFilter<"BranchAllocation"> | Date | string branch?: XOR - allocatorAdminUser?: XOR | null + allocatorAdmin?: XOR | null items?: BranchAllocationItemListRelationFilter } export type BranchAllocationOrderByWithRelationInput = { id?: SortOrder branchId?: SortOrder - allocatorAdminUserId?: SortOrderInput | SortOrder + allocatorAdminId?: SortOrderInput | SortOrder note?: SortOrderInput | SortOrder createdAt?: SortOrder branch?: BranchOrderByWithRelationInput - allocatorAdminUser?: AdminUserOrderByWithRelationInput + allocatorAdmin?: AdminOrderByWithRelationInput items?: BranchAllocationItemOrderByRelationAggregateInput } @@ -54712,18 +56094,18 @@ export namespace Prisma { OR?: BranchAllocationWhereInput[] NOT?: BranchAllocationWhereInput | BranchAllocationWhereInput[] branchId?: StringFilter<"BranchAllocation"> | string - allocatorAdminUserId?: StringNullableFilter<"BranchAllocation"> | string | null + allocatorAdminId?: StringNullableFilter<"BranchAllocation"> | string | null note?: StringNullableFilter<"BranchAllocation"> | string | null createdAt?: DateTimeFilter<"BranchAllocation"> | Date | string branch?: XOR - allocatorAdminUser?: XOR | null + allocatorAdmin?: XOR | null items?: BranchAllocationItemListRelationFilter }, "id"> export type BranchAllocationOrderByWithAggregationInput = { id?: SortOrder branchId?: SortOrder - allocatorAdminUserId?: SortOrderInput | SortOrder + allocatorAdminId?: SortOrderInput | SortOrder note?: SortOrderInput | SortOrder createdAt?: SortOrder _count?: BranchAllocationCountOrderByAggregateInput @@ -54737,7 +56119,7 @@ export namespace Prisma { NOT?: BranchAllocationScalarWhereWithAggregatesInput | BranchAllocationScalarWhereWithAggregatesInput[] id?: StringWithAggregatesFilter<"BranchAllocation"> | string branchId?: StringWithAggregatesFilter<"BranchAllocation"> | string - allocatorAdminUserId?: StringNullableWithAggregatesFilter<"BranchAllocation"> | string | null + allocatorAdminId?: StringNullableWithAggregatesFilter<"BranchAllocation"> | string | null note?: StringNullableWithAggregatesFilter<"BranchAllocation"> | string | null createdAt?: DateTimeWithAggregatesFilter<"BranchAllocation"> | Date | string } @@ -54807,9 +56189,9 @@ export namespace Prisma { recipients?: StringNullableFilter<"SmsMessage"> | string | null body?: StringFilter<"SmsMessage"> | string sentCount?: IntFilter<"SmsMessage"> | number - sentByAdminUserId?: StringNullableFilter<"SmsMessage"> | string | null + sentByAdminId?: StringNullableFilter<"SmsMessage"> | string | null createdAt?: DateTimeFilter<"SmsMessage"> | Date | string - sentByAdminUser?: XOR | null + sentByAdmin?: XOR | null } export type SmsMessageOrderByWithRelationInput = { @@ -54818,9 +56200,9 @@ export namespace Prisma { recipients?: SortOrderInput | SortOrder body?: SortOrder sentCount?: SortOrder - sentByAdminUserId?: SortOrderInput | SortOrder + sentByAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder - sentByAdminUser?: AdminUserOrderByWithRelationInput + sentByAdmin?: AdminOrderByWithRelationInput } export type SmsMessageWhereUniqueInput = Prisma.AtLeast<{ @@ -54832,9 +56214,9 @@ export namespace Prisma { recipients?: StringNullableFilter<"SmsMessage"> | string | null body?: StringFilter<"SmsMessage"> | string sentCount?: IntFilter<"SmsMessage"> | number - sentByAdminUserId?: StringNullableFilter<"SmsMessage"> | string | null + sentByAdminId?: StringNullableFilter<"SmsMessage"> | string | null createdAt?: DateTimeFilter<"SmsMessage"> | Date | string - sentByAdminUser?: XOR | null + sentByAdmin?: XOR | null }, "id"> export type SmsMessageOrderByWithAggregationInput = { @@ -54843,7 +56225,7 @@ export namespace Prisma { recipients?: SortOrderInput | SortOrder body?: SortOrder sentCount?: SortOrder - sentByAdminUserId?: SortOrderInput | SortOrder + sentByAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder _count?: SmsMessageCountOrderByAggregateInput _avg?: SmsMessageAvgOrderByAggregateInput @@ -54861,7 +56243,7 @@ export namespace Prisma { recipients?: StringNullableWithAggregatesFilter<"SmsMessage"> | string | null body?: StringWithAggregatesFilter<"SmsMessage"> | string sentCount?: IntWithAggregatesFilter<"SmsMessage"> | number - sentByAdminUserId?: StringNullableWithAggregatesFilter<"SmsMessage"> | string | null + sentByAdminId?: StringNullableWithAggregatesFilter<"SmsMessage"> | string | null createdAt?: DateTimeWithAggregatesFilter<"SmsMessage"> | Date | string } @@ -54873,9 +56255,9 @@ export namespace Prisma { title?: StringFilter<"Notification"> | string body?: StringFilter<"Notification"> | string audience?: EnumMessageAudienceFilter<"Notification"> | $Enums.MessageAudience - sentByAdminUserId?: StringNullableFilter<"Notification"> | string | null + sentByAdminId?: StringNullableFilter<"Notification"> | string | null createdAt?: DateTimeFilter<"Notification"> | Date | string - sentByAdminUser?: XOR | null + sentByAdmin?: XOR | null recipients?: NotificationRecipientListRelationFilter } @@ -54884,9 +56266,9 @@ export namespace Prisma { title?: SortOrder body?: SortOrder audience?: SortOrder - sentByAdminUserId?: SortOrderInput | SortOrder + sentByAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder - sentByAdminUser?: AdminUserOrderByWithRelationInput + sentByAdmin?: AdminOrderByWithRelationInput recipients?: NotificationRecipientOrderByRelationAggregateInput } @@ -54898,9 +56280,9 @@ export namespace Prisma { title?: StringFilter<"Notification"> | string body?: StringFilter<"Notification"> | string audience?: EnumMessageAudienceFilter<"Notification"> | $Enums.MessageAudience - sentByAdminUserId?: StringNullableFilter<"Notification"> | string | null + sentByAdminId?: StringNullableFilter<"Notification"> | string | null createdAt?: DateTimeFilter<"Notification"> | Date | string - sentByAdminUser?: XOR | null + sentByAdmin?: XOR | null recipients?: NotificationRecipientListRelationFilter }, "id"> @@ -54909,7 +56291,7 @@ export namespace Prisma { title?: SortOrder body?: SortOrder audience?: SortOrder - sentByAdminUserId?: SortOrderInput | SortOrder + sentByAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder _count?: NotificationCountOrderByAggregateInput _max?: NotificationMaxOrderByAggregateInput @@ -54924,7 +56306,7 @@ export namespace Prisma { title?: StringWithAggregatesFilter<"Notification"> | string body?: StringWithAggregatesFilter<"Notification"> | string audience?: EnumMessageAudienceWithAggregatesFilter<"Notification"> | $Enums.MessageAudience - sentByAdminUserId?: StringNullableWithAggregatesFilter<"Notification"> | string | null + sentByAdminId?: StringNullableWithAggregatesFilter<"Notification"> | string | null createdAt?: DateTimeWithAggregatesFilter<"Notification"> | Date | string } @@ -55094,9 +56476,9 @@ export namespace Prisma { mimeType?: StringFilter<"UploadedFile"> | string sizeBytes?: IntFilter<"UploadedFile"> | number purpose?: StringNullableFilter<"UploadedFile"> | string | null - uploadedByAdminUserId?: StringNullableFilter<"UploadedFile"> | string | null + uploadedByAdminId?: StringNullableFilter<"UploadedFile"> | string | null createdAt?: DateTimeFilter<"UploadedFile"> | Date | string - uploadedByAdminUser?: XOR | null + uploadedByAdmin?: XOR | null customerAvatars?: CustomerListRelationFilter adminUserAvatars?: AdminUserListRelationFilter } @@ -55108,9 +56490,9 @@ export namespace Prisma { mimeType?: SortOrder sizeBytes?: SortOrder purpose?: SortOrderInput | SortOrder - uploadedByAdminUserId?: SortOrderInput | SortOrder + uploadedByAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder - uploadedByAdminUser?: AdminUserOrderByWithRelationInput + uploadedByAdmin?: AdminOrderByWithRelationInput customerAvatars?: CustomerOrderByRelationAggregateInput adminUserAvatars?: AdminUserOrderByRelationAggregateInput } @@ -55125,9 +56507,9 @@ export namespace Prisma { mimeType?: StringFilter<"UploadedFile"> | string sizeBytes?: IntFilter<"UploadedFile"> | number purpose?: StringNullableFilter<"UploadedFile"> | string | null - uploadedByAdminUserId?: StringNullableFilter<"UploadedFile"> | string | null + uploadedByAdminId?: StringNullableFilter<"UploadedFile"> | string | null createdAt?: DateTimeFilter<"UploadedFile"> | Date | string - uploadedByAdminUser?: XOR | null + uploadedByAdmin?: XOR | null customerAvatars?: CustomerListRelationFilter adminUserAvatars?: AdminUserListRelationFilter }, "id"> @@ -55139,7 +56521,7 @@ export namespace Prisma { mimeType?: SortOrder sizeBytes?: SortOrder purpose?: SortOrderInput | SortOrder - uploadedByAdminUserId?: SortOrderInput | SortOrder + uploadedByAdminId?: SortOrderInput | SortOrder createdAt?: SortOrder _count?: UploadedFileCountOrderByAggregateInput _avg?: UploadedFileAvgOrderByAggregateInput @@ -55158,7 +56540,7 @@ export namespace Prisma { mimeType?: StringWithAggregatesFilter<"UploadedFile"> | string sizeBytes?: IntWithAggregatesFilter<"UploadedFile"> | number purpose?: StringNullableWithAggregatesFilter<"UploadedFile"> | string | null - uploadedByAdminUserId?: StringNullableWithAggregatesFilter<"UploadedFile"> | string | null + uploadedByAdminId?: StringNullableWithAggregatesFilter<"UploadedFile"> | string | null createdAt?: DateTimeWithAggregatesFilter<"UploadedFile"> | Date | string } @@ -55318,6 +56700,138 @@ export namespace Prisma { percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null } + export type AdminCreateInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + isActive?: boolean + createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput + } + + export type AdminUncheckedCreateInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + branchId?: string | null + isActive?: boolean + createdAt?: Date | string + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput + } + + export type AdminUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput + } + + export type AdminUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + branchId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput + } + + export type AdminCreateManyInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + branchId?: string | null + isActive?: boolean + createdAt?: Date | string + } + + export type AdminUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type AdminUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + branchId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type AdminUserCreateInput = { id?: string fullName: string @@ -55338,16 +56852,7 @@ export namespace Prisma { avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput } export type AdminUserUncheckedCreateInput = { @@ -55370,16 +56875,7 @@ export namespace Prisma { memberCode?: string | null referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput } export type AdminUserUpdateInput = { @@ -55402,16 +56898,7 @@ export namespace Prisma { avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateInput = { @@ -55434,16 +56921,7 @@ export namespace Prisma { memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput } export type AdminUserCreateManyInput = { @@ -55634,13 +57112,13 @@ export namespace Prisma { lastSeenAt?: Date | string | null revokedAt?: Date | string | null revokedReason?: string | null - adminUser: AdminUserCreateNestedOneWithoutSessionsInput + admin: AdminCreateNestedOneWithoutSessionsInput } export type AdminSessionUncheckedCreateInput = { id?: string jti: string - adminUserId: string + adminId: string iamSessionId?: string | null iamSub?: string | null ipAddress?: string | null @@ -55664,13 +57142,13 @@ export namespace Prisma { lastSeenAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null revokedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null revokedReason?: NullableStringFieldUpdateOperationsInput | string | null - adminUser?: AdminUserUpdateOneRequiredWithoutSessionsNestedInput + admin?: AdminUpdateOneRequiredWithoutSessionsNestedInput } export type AdminSessionUncheckedUpdateInput = { id?: StringFieldUpdateOperationsInput | string jti?: StringFieldUpdateOperationsInput | string - adminUserId?: StringFieldUpdateOperationsInput | string + adminId?: StringFieldUpdateOperationsInput | string iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null iamSub?: NullableStringFieldUpdateOperationsInput | string | null ipAddress?: NullableStringFieldUpdateOperationsInput | string | null @@ -55685,7 +57163,7 @@ export namespace Prisma { export type AdminSessionCreateManyInput = { id?: string jti: string - adminUserId: string + adminId: string iamSessionId?: string | null iamSub?: string | null ipAddress?: string | null @@ -55714,7 +57192,7 @@ export namespace Prisma { export type AdminSessionUncheckedUpdateManyInput = { id?: StringFieldUpdateOperationsInput | string jti?: StringFieldUpdateOperationsInput | string - adminUserId?: StringFieldUpdateOperationsInput | string + adminId?: StringFieldUpdateOperationsInput | string iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null iamSub?: NullableStringFieldUpdateOperationsInput | string | null ipAddress?: NullableStringFieldUpdateOperationsInput | string | null @@ -56238,6 +57716,7 @@ export namespace Prisma { isActive?: boolean city?: CityCreateNestedOneWithoutBranchesInput adminUsers?: AdminUserCreateNestedManyWithoutBranchInput + admins?: AdminCreateNestedManyWithoutBranchInput orders?: OrderCreateNestedManyWithoutBranchInput allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } @@ -56250,6 +57729,7 @@ export namespace Prisma { isActive?: boolean cityId?: string | null adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput + admins?: AdminUncheckedCreateNestedManyWithoutBranchInput orders?: OrderUncheckedCreateNestedManyWithoutBranchInput allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } @@ -56262,6 +57742,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean city?: CityUpdateOneWithoutBranchesNestedInput adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput + admins?: AdminUpdateManyWithoutBranchNestedInput orders?: OrderUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } @@ -56274,6 +57755,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput + admins?: AdminUncheckedUpdateManyWithoutBranchNestedInput orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } @@ -56310,7 +57792,7 @@ export namespace Prisma { address?: string | null phone?: string | null isActive?: boolean - supervisor?: AdminUserCreateNestedOneWithoutSupervisedWorkshopsInput + supervisor?: AdminCreateNestedOneWithoutSupervisedWorkshopsInput preOrders?: PreOrderCreateNestedManyWithoutWorkshopInput } @@ -56330,7 +57812,7 @@ export namespace Prisma { address?: NullableStringFieldUpdateOperationsInput | string | null phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean - supervisor?: AdminUserUpdateOneWithoutSupervisedWorkshopsNestedInput + supervisor?: AdminUpdateOneWithoutSupervisedWorkshopsNestedInput preOrders?: PreOrderUpdateManyWithoutWorkshopNestedInput } @@ -57126,7 +58608,7 @@ export namespace Prisma { note?: string | null createdAt?: Date | string order: OrderCreateNestedOneWithoutStatusEventsInput - actorAdminUser?: AdminUserCreateNestedOneWithoutOrderStatusEventsInput + actorAdmin?: AdminCreateNestedOneWithoutOrderStatusEventsInput } export type OrderStatusEventUncheckedCreateInput = { @@ -57135,7 +58617,7 @@ export namespace Prisma { fromStatus?: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus note?: string | null - actorAdminUserId?: string | null + actorAdminId?: string | null createdAt?: Date | string } @@ -57146,7 +58628,7 @@ export namespace Prisma { note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string order?: OrderUpdateOneRequiredWithoutStatusEventsNestedInput - actorAdminUser?: AdminUserUpdateOneWithoutOrderStatusEventsNestedInput + actorAdmin?: AdminUpdateOneWithoutOrderStatusEventsNestedInput } export type OrderStatusEventUncheckedUpdateInput = { @@ -57155,7 +58637,7 @@ export namespace Prisma { fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus note?: NullableStringFieldUpdateOperationsInput | string | null - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -57165,7 +58647,7 @@ export namespace Prisma { fromStatus?: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus note?: string | null - actorAdminUserId?: string | null + actorAdminId?: string | null createdAt?: Date | string } @@ -57183,7 +58665,7 @@ export namespace Prisma { fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus note?: NullableStringFieldUpdateOperationsInput | string | null - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -57326,14 +58808,14 @@ export namespace Prisma { ipAddress?: string | null createdAt?: Date | string preOrder: PreOrderCreateNestedOneWithoutStatusEventsInput - actorAdminUser?: AdminUserCreateNestedOneWithoutPreOrderStatusEventsInput + actorAdmin?: AdminCreateNestedOneWithoutPreOrderStatusEventsInput } export type PreOrderStatusEventUncheckedCreateInput = { id?: string preOrderId: string changes: JsonNullValueInput | InputJsonValue - actorAdminUserId?: string | null + actorAdminId?: string | null ipAddress?: string | null createdAt?: Date | string } @@ -57344,14 +58826,14 @@ export namespace Prisma { ipAddress?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string preOrder?: PreOrderUpdateOneRequiredWithoutStatusEventsNestedInput - actorAdminUser?: AdminUserUpdateOneWithoutPreOrderStatusEventsNestedInput + actorAdmin?: AdminUpdateOneWithoutPreOrderStatusEventsNestedInput } export type PreOrderStatusEventUncheckedUpdateInput = { id?: StringFieldUpdateOperationsInput | string preOrderId?: StringFieldUpdateOperationsInput | string changes?: JsonNullValueInput | InputJsonValue - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null ipAddress?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -57360,7 +58842,7 @@ export namespace Prisma { id?: string preOrderId: string changes: JsonNullValueInput | InputJsonValue - actorAdminUserId?: string | null + actorAdminId?: string | null ipAddress?: string | null createdAt?: Date | string } @@ -57376,7 +58858,7 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string preOrderId?: StringFieldUpdateOperationsInput | string changes?: JsonNullValueInput | InputJsonValue - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null ipAddress?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -57403,7 +58885,7 @@ export namespace Prisma { createdAt?: Date | string customer: CustomerCreateNestedOneWithoutLedgerEntriesInput order?: OrderCreateNestedOneWithoutLedgerEntriesInput - postedByAdminUser?: AdminUserCreateNestedOneWithoutPostedLedgerEntriesInput + postedByAdmin?: AdminCreateNestedOneWithoutPostedLedgerEntriesInput } export type LedgerEntryUncheckedCreateInput = { @@ -57418,7 +58900,7 @@ export namespace Prisma { orderId?: string | null confirmed?: boolean confirmedAt?: Date | string | null - postedByAdminUserId?: string | null + postedByAdminId?: string | null labName?: string | null hallmark?: string | null accountName?: string | null @@ -57453,7 +58935,7 @@ export namespace Prisma { createdAt?: DateTimeFieldUpdateOperationsInput | Date | string customer?: CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput order?: OrderUpdateOneWithoutLedgerEntriesNestedInput - postedByAdminUser?: AdminUserUpdateOneWithoutPostedLedgerEntriesNestedInput + postedByAdmin?: AdminUpdateOneWithoutPostedLedgerEntriesNestedInput } export type LedgerEntryUncheckedUpdateInput = { @@ -57468,7 +58950,7 @@ export namespace Prisma { orderId?: NullableStringFieldUpdateOperationsInput | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + postedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null labName?: NullableStringFieldUpdateOperationsInput | string | null hallmark?: NullableStringFieldUpdateOperationsInput | string | null accountName?: NullableStringFieldUpdateOperationsInput | string | null @@ -57493,7 +58975,7 @@ export namespace Prisma { orderId?: string | null confirmed?: boolean confirmedAt?: Date | string | null - postedByAdminUserId?: string | null + postedByAdminId?: string | null labName?: string | null hallmark?: string | null accountName?: string | null @@ -57540,7 +59022,7 @@ export namespace Prisma { orderId?: NullableStringFieldUpdateOperationsInput | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + postedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null labName?: NullableStringFieldUpdateOperationsInput | string | null hallmark?: NullableStringFieldUpdateOperationsInput | string | null accountName?: NullableStringFieldUpdateOperationsInput | string | null @@ -57692,6 +59174,7 @@ export namespace Prisma { createdAt?: Date | string permissions?: PermissionCreateNestedManyWithoutUserTypeInput adminUsers?: AdminUserCreateNestedManyWithoutUserTypeInput + admins?: AdminCreateNestedManyWithoutUserTypeInput } export type UserTypeUncheckedCreateInput = { @@ -57701,6 +59184,7 @@ export namespace Prisma { createdAt?: Date | string permissions?: PermissionUncheckedCreateNestedManyWithoutUserTypeInput adminUsers?: AdminUserUncheckedCreateNestedManyWithoutUserTypeInput + admins?: AdminUncheckedCreateNestedManyWithoutUserTypeInput } export type UserTypeUpdateInput = { @@ -57710,6 +59194,7 @@ export namespace Prisma { createdAt?: DateTimeFieldUpdateOperationsInput | Date | string permissions?: PermissionUpdateManyWithoutUserTypeNestedInput adminUsers?: AdminUserUpdateManyWithoutUserTypeNestedInput + admins?: AdminUpdateManyWithoutUserTypeNestedInput } export type UserTypeUncheckedUpdateInput = { @@ -57719,6 +59204,7 @@ export namespace Prisma { createdAt?: DateTimeFieldUpdateOperationsInput | Date | string permissions?: PermissionUncheckedUpdateManyWithoutUserTypeNestedInput adminUsers?: AdminUserUncheckedUpdateManyWithoutUserTypeNestedInput + admins?: AdminUncheckedUpdateManyWithoutUserTypeNestedInput } export type UserTypeCreateManyInput = { @@ -58394,14 +59880,14 @@ export namespace Prisma { note?: string | null createdAt?: Date | string branch: BranchCreateNestedOneWithoutAllocationsInput - allocatorAdminUser?: AdminUserCreateNestedOneWithoutBranchAllocationsInput + allocatorAdmin?: AdminCreateNestedOneWithoutBranchAllocationsInput items?: BranchAllocationItemCreateNestedManyWithoutAllocationInput } export type BranchAllocationUncheckedCreateInput = { id?: string branchId: string - allocatorAdminUserId?: string | null + allocatorAdminId?: string | null note?: string | null createdAt?: Date | string items?: BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput @@ -58412,14 +59898,14 @@ export namespace Prisma { note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string branch?: BranchUpdateOneRequiredWithoutAllocationsNestedInput - allocatorAdminUser?: AdminUserUpdateOneWithoutBranchAllocationsNestedInput + allocatorAdmin?: AdminUpdateOneWithoutBranchAllocationsNestedInput items?: BranchAllocationItemUpdateManyWithoutAllocationNestedInput } export type BranchAllocationUncheckedUpdateInput = { id?: StringFieldUpdateOperationsInput | string branchId?: StringFieldUpdateOperationsInput | string - allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + allocatorAdminId?: NullableStringFieldUpdateOperationsInput | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string items?: BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput @@ -58428,7 +59914,7 @@ export namespace Prisma { export type BranchAllocationCreateManyInput = { id?: string branchId: string - allocatorAdminUserId?: string | null + allocatorAdminId?: string | null note?: string | null createdAt?: Date | string } @@ -58442,7 +59928,7 @@ export namespace Prisma { export type BranchAllocationUncheckedUpdateManyInput = { id?: StringFieldUpdateOperationsInput | string branchId?: StringFieldUpdateOperationsInput | string - allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + allocatorAdminId?: NullableStringFieldUpdateOperationsInput | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -58501,7 +59987,7 @@ export namespace Prisma { body: string sentCount?: number createdAt?: Date | string - sentByAdminUser?: AdminUserCreateNestedOneWithoutSentSmsMessagesInput + sentByAdmin?: AdminCreateNestedOneWithoutSentSmsMessagesInput } export type SmsMessageUncheckedCreateInput = { @@ -58510,7 +59996,7 @@ export namespace Prisma { recipients?: string | null body: string sentCount?: number - sentByAdminUserId?: string | null + sentByAdminId?: string | null createdAt?: Date | string } @@ -58521,7 +60007,7 @@ export namespace Prisma { body?: StringFieldUpdateOperationsInput | string sentCount?: IntFieldUpdateOperationsInput | number createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - sentByAdminUser?: AdminUserUpdateOneWithoutSentSmsMessagesNestedInput + sentByAdmin?: AdminUpdateOneWithoutSentSmsMessagesNestedInput } export type SmsMessageUncheckedUpdateInput = { @@ -58530,7 +60016,7 @@ export namespace Prisma { recipients?: NullableStringFieldUpdateOperationsInput | string | null body?: StringFieldUpdateOperationsInput | string sentCount?: IntFieldUpdateOperationsInput | number - sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + sentByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -58540,7 +60026,7 @@ export namespace Prisma { recipients?: string | null body: string sentCount?: number - sentByAdminUserId?: string | null + sentByAdminId?: string | null createdAt?: Date | string } @@ -58559,7 +60045,7 @@ export namespace Prisma { recipients?: NullableStringFieldUpdateOperationsInput | string | null body?: StringFieldUpdateOperationsInput | string sentCount?: IntFieldUpdateOperationsInput | number - sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + sentByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -58569,7 +60055,7 @@ export namespace Prisma { body: string audience?: $Enums.MessageAudience createdAt?: Date | string - sentByAdminUser?: AdminUserCreateNestedOneWithoutSentNotificationsInput + sentByAdmin?: AdminCreateNestedOneWithoutSentNotificationsInput recipients?: NotificationRecipientCreateNestedManyWithoutNotificationInput } @@ -58578,7 +60064,7 @@ export namespace Prisma { title: string body: string audience?: $Enums.MessageAudience - sentByAdminUserId?: string | null + sentByAdminId?: string | null createdAt?: Date | string recipients?: NotificationRecipientUncheckedCreateNestedManyWithoutNotificationInput } @@ -58589,7 +60075,7 @@ export namespace Prisma { body?: StringFieldUpdateOperationsInput | string audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - sentByAdminUser?: AdminUserUpdateOneWithoutSentNotificationsNestedInput + sentByAdmin?: AdminUpdateOneWithoutSentNotificationsNestedInput recipients?: NotificationRecipientUpdateManyWithoutNotificationNestedInput } @@ -58598,7 +60084,7 @@ export namespace Prisma { title?: StringFieldUpdateOperationsInput | string body?: StringFieldUpdateOperationsInput | string audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + sentByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string recipients?: NotificationRecipientUncheckedUpdateManyWithoutNotificationNestedInput } @@ -58608,7 +60094,7 @@ export namespace Prisma { title: string body: string audience?: $Enums.MessageAudience - sentByAdminUserId?: string | null + sentByAdminId?: string | null createdAt?: Date | string } @@ -58625,7 +60111,7 @@ export namespace Prisma { title?: StringFieldUpdateOperationsInput | string body?: StringFieldUpdateOperationsInput | string audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + sentByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -58788,7 +60274,7 @@ export namespace Prisma { sizeBytes: number purpose?: string | null createdAt?: Date | string - uploadedByAdminUser?: AdminUserCreateNestedOneWithoutUploadedFilesInput + uploadedByAdmin?: AdminCreateNestedOneWithoutUploadedFilesInput customerAvatars?: CustomerCreateNestedManyWithoutAvatarFileInput adminUserAvatars?: AdminUserCreateNestedManyWithoutAvatarFileInput } @@ -58800,7 +60286,7 @@ export namespace Prisma { mimeType: string sizeBytes: number purpose?: string | null - uploadedByAdminUserId?: string | null + uploadedByAdminId?: string | null createdAt?: Date | string customerAvatars?: CustomerUncheckedCreateNestedManyWithoutAvatarFileInput adminUserAvatars?: AdminUserUncheckedCreateNestedManyWithoutAvatarFileInput @@ -58814,7 +60300,7 @@ export namespace Prisma { sizeBytes?: IntFieldUpdateOperationsInput | number purpose?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - uploadedByAdminUser?: AdminUserUpdateOneWithoutUploadedFilesNestedInput + uploadedByAdmin?: AdminUpdateOneWithoutUploadedFilesNestedInput customerAvatars?: CustomerUpdateManyWithoutAvatarFileNestedInput adminUserAvatars?: AdminUserUpdateManyWithoutAvatarFileNestedInput } @@ -58826,7 +60312,7 @@ export namespace Prisma { mimeType?: StringFieldUpdateOperationsInput | string sizeBytes?: IntFieldUpdateOperationsInput | number purpose?: NullableStringFieldUpdateOperationsInput | string | null - uploadedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + uploadedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string customerAvatars?: CustomerUncheckedUpdateManyWithoutAvatarFileNestedInput adminUserAvatars?: AdminUserUncheckedUpdateManyWithoutAvatarFileNestedInput @@ -58839,7 +60325,7 @@ export namespace Prisma { mimeType: string sizeBytes: number purpose?: string | null - uploadedByAdminUserId?: string | null + uploadedByAdminId?: string | null createdAt?: Date | string } @@ -58860,7 +60346,7 @@ export namespace Prisma { mimeType?: StringFieldUpdateOperationsInput | string sizeBytes?: IntFieldUpdateOperationsInput | number purpose?: NullableStringFieldUpdateOperationsInput | string | null - uploadedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + uploadedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -59188,17 +60674,6 @@ export namespace Prisma { isNot?: BranchWhereInput | null } - export type UploadedFileNullableRelationFilter = { - is?: UploadedFileWhereInput | null - isNot?: UploadedFileWhereInput | null - } - - export type OrderListRelationFilter = { - every?: OrderWhereInput - some?: OrderWhereInput - none?: OrderWhereInput - } - export type WorkshopListRelationFilter = { every?: WorkshopWhereInput some?: WorkshopWhereInput @@ -59247,21 +60722,12 @@ export namespace Prisma { none?: UploadedFileWhereInput } - export type SalesExpertProfileNullableRelationFilter = { - is?: SalesExpertProfileWhereInput | null - isNot?: SalesExpertProfileWhereInput | null - } - export type AdminSessionListRelationFilter = { every?: AdminSessionWhereInput some?: AdminSessionWhereInput none?: AdminSessionWhereInput } - export type OrderOrderByRelationAggregateInput = { - _count?: SortOrder - } - export type WorkshopOrderByRelationAggregateInput = { _count?: SortOrder } @@ -59298,6 +60764,124 @@ export namespace Prisma { _count?: SortOrder } + export type AdminCountOrderByAggregateInput = { + id?: SortOrder + fullName?: SortOrder + firstName?: SortOrder + lastName?: SortOrder + mobile?: SortOrder + passwordHash?: SortOrder + role?: SortOrder + userTypeId?: SortOrder + branchId?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + } + + export type AdminAvgOrderByAggregateInput = { + userTypeId?: SortOrder + } + + export type AdminMaxOrderByAggregateInput = { + id?: SortOrder + fullName?: SortOrder + firstName?: SortOrder + lastName?: SortOrder + mobile?: SortOrder + passwordHash?: SortOrder + role?: SortOrder + userTypeId?: SortOrder + branchId?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + } + + export type AdminMinOrderByAggregateInput = { + id?: SortOrder + fullName?: SortOrder + firstName?: SortOrder + lastName?: SortOrder + mobile?: SortOrder + passwordHash?: SortOrder + role?: SortOrder + userTypeId?: SortOrder + branchId?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + } + + export type AdminSumOrderByAggregateInput = { + userTypeId?: SortOrder + } + + export type EnumAdminRoleWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.AdminRole | EnumAdminRoleFieldRefInput<$PrismaModel> + in?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> + not?: NestedEnumAdminRoleWithAggregatesFilter<$PrismaModel> | $Enums.AdminRole + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumAdminRoleFilter<$PrismaModel> + _max?: NestedEnumAdminRoleFilter<$PrismaModel> + } + + export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedIntNullableFilter<$PrismaModel> + _max?: NestedIntNullableFilter<$PrismaModel> + } + + export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | BooleanFieldRefInput<$PrismaModel> + not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedBoolFilter<$PrismaModel> + _max?: NestedBoolFilter<$PrismaModel> + } + + export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> + not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedDateTimeFilter<$PrismaModel> + _max?: NestedDateTimeFilter<$PrismaModel> + } + + export type UploadedFileNullableRelationFilter = { + is?: UploadedFileWhereInput | null + isNot?: UploadedFileWhereInput | null + } + + export type OrderListRelationFilter = { + every?: OrderWhereInput + some?: OrderWhereInput + none?: OrderWhereInput + } + + export type SalesExpertProfileNullableRelationFilter = { + is?: SalesExpertProfileWhereInput | null + isNot?: SalesExpertProfileWhereInput | null + } + + export type OrderOrderByRelationAggregateInput = { + _count?: SortOrder + } + export type AdminUserCountOrderByAggregateInput = { id?: SortOrder fullName?: SortOrder @@ -59368,54 +60952,6 @@ export namespace Prisma { wagePercent?: SortOrder } - export type EnumAdminRoleWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.AdminRole | EnumAdminRoleFieldRefInput<$PrismaModel> - in?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> - notIn?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> - not?: NestedEnumAdminRoleWithAggregatesFilter<$PrismaModel> | $Enums.AdminRole - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedEnumAdminRoleFilter<$PrismaModel> - _max?: NestedEnumAdminRoleFilter<$PrismaModel> - } - - export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null - _count?: NestedIntNullableFilter<$PrismaModel> - _avg?: NestedFloatNullableFilter<$PrismaModel> - _sum?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedIntNullableFilter<$PrismaModel> - _max?: NestedIntNullableFilter<$PrismaModel> - } - - export type BoolWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | BooleanFieldRefInput<$PrismaModel> - not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedBoolFilter<$PrismaModel> - _max?: NestedBoolFilter<$PrismaModel> - } - - export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> - notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> - lt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | DateTimeFieldRefInput<$PrismaModel> - not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedDateTimeFilter<$PrismaModel> - _max?: NestedDateTimeFilter<$PrismaModel> - } - export type DateTimeNullableFilter<$PrismaModel = never> = { equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null @@ -59492,15 +61028,15 @@ export namespace Prisma { _max?: NestedDateTimeNullableFilter<$PrismaModel> } - export type AdminUserRelationFilter = { - is?: AdminUserWhereInput - isNot?: AdminUserWhereInput + export type AdminRelationFilter = { + is?: AdminWhereInput + isNot?: AdminWhereInput } export type AdminSessionCountOrderByAggregateInput = { id?: SortOrder jti?: SortOrder - adminUserId?: SortOrder + adminId?: SortOrder iamSessionId?: SortOrder iamSub?: SortOrder ipAddress?: SortOrder @@ -59515,7 +61051,7 @@ export namespace Prisma { export type AdminSessionMaxOrderByAggregateInput = { id?: SortOrder jti?: SortOrder - adminUserId?: SortOrder + adminId?: SortOrder iamSessionId?: SortOrder iamSub?: SortOrder ipAddress?: SortOrder @@ -59530,7 +61066,7 @@ export namespace Prisma { export type AdminSessionMinOrderByAggregateInput = { id?: SortOrder jti?: SortOrder - adminUserId?: SortOrder + adminId?: SortOrder iamSessionId?: SortOrder iamSub?: SortOrder ipAddress?: SortOrder @@ -59553,6 +61089,11 @@ export namespace Prisma { not?: NestedDecimalFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string } + export type AdminUserRelationFilter = { + is?: AdminUserWhereInput + isNot?: AdminUserWhereInput + } + export type CustomerNullableRelationFilter = { is?: CustomerWhereInput | null isNot?: CustomerWhereInput | null @@ -59928,10 +61469,20 @@ export namespace Prisma { none?: AdminUserWhereInput } + export type AdminListRelationFilter = { + every?: AdminWhereInput + some?: AdminWhereInput + none?: AdminWhereInput + } + export type AdminUserOrderByRelationAggregateInput = { _count?: SortOrder } + export type AdminOrderByRelationAggregateInput = { + _count?: SortOrder + } + export type BranchCountOrderByAggregateInput = { id?: SortOrder name?: SortOrder @@ -59959,6 +61510,11 @@ export namespace Prisma { cityId?: SortOrder } + export type AdminNullableRelationFilter = { + is?: AdminWhereInput | null + isNot?: AdminWhereInput | null + } + export type WorkshopCountOrderByAggregateInput = { id?: SortOrder name?: SortOrder @@ -60555,7 +62111,7 @@ export namespace Prisma { fromStatus?: SortOrder toStatus?: SortOrder note?: SortOrder - actorAdminUserId?: SortOrder + actorAdminId?: SortOrder createdAt?: SortOrder } @@ -60565,7 +62121,7 @@ export namespace Prisma { fromStatus?: SortOrder toStatus?: SortOrder note?: SortOrder - actorAdminUserId?: SortOrder + actorAdminId?: SortOrder createdAt?: SortOrder } @@ -60575,7 +62131,7 @@ export namespace Prisma { fromStatus?: SortOrder toStatus?: SortOrder note?: SortOrder - actorAdminUserId?: SortOrder + actorAdminId?: SortOrder createdAt?: SortOrder } @@ -60714,7 +62270,7 @@ export namespace Prisma { id?: SortOrder preOrderId?: SortOrder changes?: SortOrder - actorAdminUserId?: SortOrder + actorAdminId?: SortOrder ipAddress?: SortOrder createdAt?: SortOrder } @@ -60722,7 +62278,7 @@ export namespace Prisma { export type PreOrderStatusEventMaxOrderByAggregateInput = { id?: SortOrder preOrderId?: SortOrder - actorAdminUserId?: SortOrder + actorAdminId?: SortOrder ipAddress?: SortOrder createdAt?: SortOrder } @@ -60730,7 +62286,7 @@ export namespace Prisma { export type PreOrderStatusEventMinOrderByAggregateInput = { id?: SortOrder preOrderId?: SortOrder - actorAdminUserId?: SortOrder + actorAdminId?: SortOrder ipAddress?: SortOrder createdAt?: SortOrder } @@ -60793,7 +62349,7 @@ export namespace Prisma { orderId?: SortOrder confirmed?: SortOrder confirmedAt?: SortOrder - postedByAdminUserId?: SortOrder + postedByAdminId?: SortOrder labName?: SortOrder hallmark?: SortOrder accountName?: SortOrder @@ -60826,7 +62382,7 @@ export namespace Prisma { orderId?: SortOrder confirmed?: SortOrder confirmedAt?: SortOrder - postedByAdminUserId?: SortOrder + postedByAdminId?: SortOrder labName?: SortOrder hallmark?: SortOrder accountName?: SortOrder @@ -60851,7 +62407,7 @@ export namespace Prisma { orderId?: SortOrder confirmed?: SortOrder confirmedAt?: SortOrder - postedByAdminUserId?: SortOrder + postedByAdminId?: SortOrder labName?: SortOrder hallmark?: SortOrder accountName?: SortOrder @@ -61517,7 +63073,7 @@ export namespace Prisma { export type BranchAllocationCountOrderByAggregateInput = { id?: SortOrder branchId?: SortOrder - allocatorAdminUserId?: SortOrder + allocatorAdminId?: SortOrder note?: SortOrder createdAt?: SortOrder } @@ -61525,7 +63081,7 @@ export namespace Prisma { export type BranchAllocationMaxOrderByAggregateInput = { id?: SortOrder branchId?: SortOrder - allocatorAdminUserId?: SortOrder + allocatorAdminId?: SortOrder note?: SortOrder createdAt?: SortOrder } @@ -61533,7 +63089,7 @@ export namespace Prisma { export type BranchAllocationMinOrderByAggregateInput = { id?: SortOrder branchId?: SortOrder - allocatorAdminUserId?: SortOrder + allocatorAdminId?: SortOrder note?: SortOrder createdAt?: SortOrder } @@ -61590,7 +63146,7 @@ export namespace Prisma { recipients?: SortOrder body?: SortOrder sentCount?: SortOrder - sentByAdminUserId?: SortOrder + sentByAdminId?: SortOrder createdAt?: SortOrder } @@ -61604,7 +63160,7 @@ export namespace Prisma { recipients?: SortOrder body?: SortOrder sentCount?: SortOrder - sentByAdminUserId?: SortOrder + sentByAdminId?: SortOrder createdAt?: SortOrder } @@ -61614,7 +63170,7 @@ export namespace Prisma { recipients?: SortOrder body?: SortOrder sentCount?: SortOrder - sentByAdminUserId?: SortOrder + sentByAdminId?: SortOrder createdAt?: SortOrder } @@ -61637,7 +63193,7 @@ export namespace Prisma { title?: SortOrder body?: SortOrder audience?: SortOrder - sentByAdminUserId?: SortOrder + sentByAdminId?: SortOrder createdAt?: SortOrder } @@ -61646,7 +63202,7 @@ export namespace Prisma { title?: SortOrder body?: SortOrder audience?: SortOrder - sentByAdminUserId?: SortOrder + sentByAdminId?: SortOrder createdAt?: SortOrder } @@ -61655,7 +63211,7 @@ export namespace Prisma { title?: SortOrder body?: SortOrder audience?: SortOrder - sentByAdminUserId?: SortOrder + sentByAdminId?: SortOrder createdAt?: SortOrder } @@ -61742,7 +63298,7 @@ export namespace Prisma { mimeType?: SortOrder sizeBytes?: SortOrder purpose?: SortOrder - uploadedByAdminUserId?: SortOrder + uploadedByAdminId?: SortOrder createdAt?: SortOrder } @@ -61757,7 +63313,7 @@ export namespace Prisma { mimeType?: SortOrder sizeBytes?: SortOrder purpose?: SortOrder - uploadedByAdminUserId?: SortOrder + uploadedByAdminId?: SortOrder createdAt?: SortOrder } @@ -61768,7 +63324,7 @@ export namespace Prisma { mimeType?: SortOrder sizeBytes?: SortOrder purpose?: SortOrder - uploadedByAdminUserId?: SortOrder + uploadedByAdminId?: SortOrder createdAt?: SortOrder } @@ -62104,6 +63660,436 @@ export namespace Prisma { deleteMany?: SalesExpertProfileScalarWhereInput | SalesExpertProfileScalarWhereInput[] } + export type UserTypeCreateNestedOneWithoutAdminsInput = { + create?: XOR + connectOrCreate?: UserTypeCreateOrConnectWithoutAdminsInput + connect?: UserTypeWhereUniqueInput + } + + export type BranchCreateNestedOneWithoutAdminsInput = { + create?: XOR + connectOrCreate?: BranchCreateOrConnectWithoutAdminsInput + connect?: BranchWhereUniqueInput + } + + export type WorkshopCreateNestedManyWithoutSupervisorInput = { + create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + } + + export type BranchAllocationCreateNestedManyWithoutAllocatorAdminInput = { + create?: XOR | BranchAllocationCreateWithoutAllocatorAdminInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminInputEnvelope + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + } + + export type LedgerEntryCreateNestedManyWithoutPostedByAdminInput = { + create?: XOR | LedgerEntryCreateWithoutPostedByAdminInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminInput[] + connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminInput | LedgerEntryCreateOrConnectWithoutPostedByAdminInput[] + createMany?: LedgerEntryCreateManyPostedByAdminInputEnvelope + connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + } + + export type OrderStatusEventCreateNestedManyWithoutActorAdminInput = { + create?: XOR | OrderStatusEventCreateWithoutActorAdminInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminInput | OrderStatusEventCreateOrConnectWithoutActorAdminInput[] + createMany?: OrderStatusEventCreateManyActorAdminInputEnvelope + connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + } + + export type PreOrderStatusEventCreateNestedManyWithoutActorAdminInput = { + create?: XOR | PreOrderStatusEventCreateWithoutActorAdminInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminInput[] + createMany?: PreOrderStatusEventCreateManyActorAdminInputEnvelope + connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + } + + export type SmsMessageCreateNestedManyWithoutSentByAdminInput = { + create?: XOR | SmsMessageCreateWithoutSentByAdminInput[] | SmsMessageUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminInput | SmsMessageCreateOrConnectWithoutSentByAdminInput[] + createMany?: SmsMessageCreateManySentByAdminInputEnvelope + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + } + + export type NotificationCreateNestedManyWithoutSentByAdminInput = { + create?: XOR | NotificationCreateWithoutSentByAdminInput[] | NotificationUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminInput | NotificationCreateOrConnectWithoutSentByAdminInput[] + createMany?: NotificationCreateManySentByAdminInputEnvelope + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + } + + export type UploadedFileCreateNestedManyWithoutUploadedByAdminInput = { + create?: XOR | UploadedFileCreateWithoutUploadedByAdminInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminInput | UploadedFileCreateOrConnectWithoutUploadedByAdminInput[] + createMany?: UploadedFileCreateManyUploadedByAdminInputEnvelope + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + } + + export type AdminSessionCreateNestedManyWithoutAdminInput = { + create?: XOR | AdminSessionCreateWithoutAdminInput[] | AdminSessionUncheckedCreateWithoutAdminInput[] + connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminInput | AdminSessionCreateOrConnectWithoutAdminInput[] + createMany?: AdminSessionCreateManyAdminInputEnvelope + connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + } + + export type WorkshopUncheckedCreateNestedManyWithoutSupervisorInput = { + create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + } + + export type BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput = { + create?: XOR | BranchAllocationCreateWithoutAllocatorAdminInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminInputEnvelope + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + } + + export type LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput = { + create?: XOR | LedgerEntryCreateWithoutPostedByAdminInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminInput[] + connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminInput | LedgerEntryCreateOrConnectWithoutPostedByAdminInput[] + createMany?: LedgerEntryCreateManyPostedByAdminInputEnvelope + connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + } + + export type OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput = { + create?: XOR | OrderStatusEventCreateWithoutActorAdminInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminInput | OrderStatusEventCreateOrConnectWithoutActorAdminInput[] + createMany?: OrderStatusEventCreateManyActorAdminInputEnvelope + connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + } + + export type PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput = { + create?: XOR | PreOrderStatusEventCreateWithoutActorAdminInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminInput[] + createMany?: PreOrderStatusEventCreateManyActorAdminInputEnvelope + connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + } + + export type SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput = { + create?: XOR | SmsMessageCreateWithoutSentByAdminInput[] | SmsMessageUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminInput | SmsMessageCreateOrConnectWithoutSentByAdminInput[] + createMany?: SmsMessageCreateManySentByAdminInputEnvelope + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + } + + export type NotificationUncheckedCreateNestedManyWithoutSentByAdminInput = { + create?: XOR | NotificationCreateWithoutSentByAdminInput[] | NotificationUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminInput | NotificationCreateOrConnectWithoutSentByAdminInput[] + createMany?: NotificationCreateManySentByAdminInputEnvelope + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + } + + export type UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput = { + create?: XOR | UploadedFileCreateWithoutUploadedByAdminInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminInput | UploadedFileCreateOrConnectWithoutUploadedByAdminInput[] + createMany?: UploadedFileCreateManyUploadedByAdminInputEnvelope + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + } + + export type AdminSessionUncheckedCreateNestedManyWithoutAdminInput = { + create?: XOR | AdminSessionCreateWithoutAdminInput[] | AdminSessionUncheckedCreateWithoutAdminInput[] + connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminInput | AdminSessionCreateOrConnectWithoutAdminInput[] + createMany?: AdminSessionCreateManyAdminInputEnvelope + connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + } + + export type EnumAdminRoleFieldUpdateOperationsInput = { + set?: $Enums.AdminRole + } + + export type BoolFieldUpdateOperationsInput = { + set?: boolean + } + + export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string + } + + export type UserTypeUpdateOneWithoutAdminsNestedInput = { + create?: XOR + connectOrCreate?: UserTypeCreateOrConnectWithoutAdminsInput + upsert?: UserTypeUpsertWithoutAdminsInput + disconnect?: UserTypeWhereInput | boolean + delete?: UserTypeWhereInput | boolean + connect?: UserTypeWhereUniqueInput + update?: XOR, UserTypeUncheckedUpdateWithoutAdminsInput> + } + + export type BranchUpdateOneWithoutAdminsNestedInput = { + create?: XOR + connectOrCreate?: BranchCreateOrConnectWithoutAdminsInput + upsert?: BranchUpsertWithoutAdminsInput + disconnect?: BranchWhereInput | boolean + delete?: BranchWhereInput | boolean + connect?: BranchWhereUniqueInput + update?: XOR, BranchUncheckedUpdateWithoutAdminsInput> + } + + export type WorkshopUpdateManyWithoutSupervisorNestedInput = { + create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + upsert?: WorkshopUpsertWithWhereUniqueWithoutSupervisorInput | WorkshopUpsertWithWhereUniqueWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + set?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + disconnect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + delete?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + update?: WorkshopUpdateWithWhereUniqueWithoutSupervisorInput | WorkshopUpdateWithWhereUniqueWithoutSupervisorInput[] + updateMany?: WorkshopUpdateManyWithWhereWithoutSupervisorInput | WorkshopUpdateManyWithWhereWithoutSupervisorInput[] + deleteMany?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + } + + export type BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput = { + create?: XOR | BranchAllocationCreateWithoutAllocatorAdminInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminInput[] + upsert?: BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminInput | BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminInputEnvelope + set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + update?: BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminInput | BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminInput[] + updateMany?: BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminInput | BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminInput[] + deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + } + + export type LedgerEntryUpdateManyWithoutPostedByAdminNestedInput = { + create?: XOR | LedgerEntryCreateWithoutPostedByAdminInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminInput[] + connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminInput | LedgerEntryCreateOrConnectWithoutPostedByAdminInput[] + upsert?: LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminInput | LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminInput[] + createMany?: LedgerEntryCreateManyPostedByAdminInputEnvelope + set?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + disconnect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + delete?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + update?: LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminInput | LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminInput[] + updateMany?: LedgerEntryUpdateManyWithWhereWithoutPostedByAdminInput | LedgerEntryUpdateManyWithWhereWithoutPostedByAdminInput[] + deleteMany?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] + } + + export type OrderStatusEventUpdateManyWithoutActorAdminNestedInput = { + create?: XOR | OrderStatusEventCreateWithoutActorAdminInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminInput | OrderStatusEventCreateOrConnectWithoutActorAdminInput[] + upsert?: OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput | OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput[] + createMany?: OrderStatusEventCreateManyActorAdminInputEnvelope + set?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + disconnect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + delete?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + update?: OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput | OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput[] + updateMany?: OrderStatusEventUpdateManyWithWhereWithoutActorAdminInput | OrderStatusEventUpdateManyWithWhereWithoutActorAdminInput[] + deleteMany?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] + } + + export type PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput = { + create?: XOR | PreOrderStatusEventCreateWithoutActorAdminInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminInput[] + upsert?: PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput | PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput[] + createMany?: PreOrderStatusEventCreateManyActorAdminInputEnvelope + set?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + disconnect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + delete?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + update?: PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput | PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput[] + updateMany?: PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminInput | PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminInput[] + deleteMany?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] + } + + export type SmsMessageUpdateManyWithoutSentByAdminNestedInput = { + create?: XOR | SmsMessageCreateWithoutSentByAdminInput[] | SmsMessageUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminInput | SmsMessageCreateOrConnectWithoutSentByAdminInput[] + upsert?: SmsMessageUpsertWithWhereUniqueWithoutSentByAdminInput | SmsMessageUpsertWithWhereUniqueWithoutSentByAdminInput[] + createMany?: SmsMessageCreateManySentByAdminInputEnvelope + set?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + disconnect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + delete?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + update?: SmsMessageUpdateWithWhereUniqueWithoutSentByAdminInput | SmsMessageUpdateWithWhereUniqueWithoutSentByAdminInput[] + updateMany?: SmsMessageUpdateManyWithWhereWithoutSentByAdminInput | SmsMessageUpdateManyWithWhereWithoutSentByAdminInput[] + deleteMany?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + } + + export type NotificationUpdateManyWithoutSentByAdminNestedInput = { + create?: XOR | NotificationCreateWithoutSentByAdminInput[] | NotificationUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminInput | NotificationCreateOrConnectWithoutSentByAdminInput[] + upsert?: NotificationUpsertWithWhereUniqueWithoutSentByAdminInput | NotificationUpsertWithWhereUniqueWithoutSentByAdminInput[] + createMany?: NotificationCreateManySentByAdminInputEnvelope + set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + update?: NotificationUpdateWithWhereUniqueWithoutSentByAdminInput | NotificationUpdateWithWhereUniqueWithoutSentByAdminInput[] + updateMany?: NotificationUpdateManyWithWhereWithoutSentByAdminInput | NotificationUpdateManyWithWhereWithoutSentByAdminInput[] + deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + } + + export type UploadedFileUpdateManyWithoutUploadedByAdminNestedInput = { + create?: XOR | UploadedFileCreateWithoutUploadedByAdminInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminInput | UploadedFileCreateOrConnectWithoutUploadedByAdminInput[] + upsert?: UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminInput | UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminInput[] + createMany?: UploadedFileCreateManyUploadedByAdminInputEnvelope + set?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + disconnect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + delete?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + update?: UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminInput | UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminInput[] + updateMany?: UploadedFileUpdateManyWithWhereWithoutUploadedByAdminInput | UploadedFileUpdateManyWithWhereWithoutUploadedByAdminInput[] + deleteMany?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + } + + export type AdminSessionUpdateManyWithoutAdminNestedInput = { + create?: XOR | AdminSessionCreateWithoutAdminInput[] | AdminSessionUncheckedCreateWithoutAdminInput[] + connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminInput | AdminSessionCreateOrConnectWithoutAdminInput[] + upsert?: AdminSessionUpsertWithWhereUniqueWithoutAdminInput | AdminSessionUpsertWithWhereUniqueWithoutAdminInput[] + createMany?: AdminSessionCreateManyAdminInputEnvelope + set?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + disconnect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + delete?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + update?: AdminSessionUpdateWithWhereUniqueWithoutAdminInput | AdminSessionUpdateWithWhereUniqueWithoutAdminInput[] + updateMany?: AdminSessionUpdateManyWithWhereWithoutAdminInput | AdminSessionUpdateManyWithWhereWithoutAdminInput[] + deleteMany?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] + } + + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput = { + create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + upsert?: WorkshopUpsertWithWhereUniqueWithoutSupervisorInput | WorkshopUpsertWithWhereUniqueWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + set?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + disconnect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + delete?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + update?: WorkshopUpdateWithWhereUniqueWithoutSupervisorInput | WorkshopUpdateWithWhereUniqueWithoutSupervisorInput[] + updateMany?: WorkshopUpdateManyWithWhereWithoutSupervisorInput | WorkshopUpdateManyWithWhereWithoutSupervisorInput[] + deleteMany?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + } + + export type BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput = { + create?: XOR | BranchAllocationCreateWithoutAllocatorAdminInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminInput[] + upsert?: BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminInput | BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminInputEnvelope + set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + update?: BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminInput | BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminInput[] + updateMany?: BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminInput | BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminInput[] + deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + } + + export type LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput = { + create?: XOR | LedgerEntryCreateWithoutPostedByAdminInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminInput[] + connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminInput | LedgerEntryCreateOrConnectWithoutPostedByAdminInput[] + upsert?: LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminInput | LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminInput[] + createMany?: LedgerEntryCreateManyPostedByAdminInputEnvelope + set?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + disconnect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + delete?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] + update?: LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminInput | LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminInput[] + updateMany?: LedgerEntryUpdateManyWithWhereWithoutPostedByAdminInput | LedgerEntryUpdateManyWithWhereWithoutPostedByAdminInput[] + deleteMany?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] + } + + export type OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput = { + create?: XOR | OrderStatusEventCreateWithoutActorAdminInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminInput | OrderStatusEventCreateOrConnectWithoutActorAdminInput[] + upsert?: OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput | OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput[] + createMany?: OrderStatusEventCreateManyActorAdminInputEnvelope + set?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + disconnect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + delete?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] + update?: OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput | OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput[] + updateMany?: OrderStatusEventUpdateManyWithWhereWithoutActorAdminInput | OrderStatusEventUpdateManyWithWhereWithoutActorAdminInput[] + deleteMany?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] + } + + export type PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput = { + create?: XOR | PreOrderStatusEventCreateWithoutActorAdminInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminInput[] + connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminInput[] + upsert?: PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput | PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput[] + createMany?: PreOrderStatusEventCreateManyActorAdminInputEnvelope + set?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + disconnect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + delete?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] + update?: PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput | PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput[] + updateMany?: PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminInput | PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminInput[] + deleteMany?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] + } + + export type SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput = { + create?: XOR | SmsMessageCreateWithoutSentByAdminInput[] | SmsMessageUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminInput | SmsMessageCreateOrConnectWithoutSentByAdminInput[] + upsert?: SmsMessageUpsertWithWhereUniqueWithoutSentByAdminInput | SmsMessageUpsertWithWhereUniqueWithoutSentByAdminInput[] + createMany?: SmsMessageCreateManySentByAdminInputEnvelope + set?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + disconnect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + delete?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + update?: SmsMessageUpdateWithWhereUniqueWithoutSentByAdminInput | SmsMessageUpdateWithWhereUniqueWithoutSentByAdminInput[] + updateMany?: SmsMessageUpdateManyWithWhereWithoutSentByAdminInput | SmsMessageUpdateManyWithWhereWithoutSentByAdminInput[] + deleteMany?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + } + + export type NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput = { + create?: XOR | NotificationCreateWithoutSentByAdminInput[] | NotificationUncheckedCreateWithoutSentByAdminInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminInput | NotificationCreateOrConnectWithoutSentByAdminInput[] + upsert?: NotificationUpsertWithWhereUniqueWithoutSentByAdminInput | NotificationUpsertWithWhereUniqueWithoutSentByAdminInput[] + createMany?: NotificationCreateManySentByAdminInputEnvelope + set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + update?: NotificationUpdateWithWhereUniqueWithoutSentByAdminInput | NotificationUpdateWithWhereUniqueWithoutSentByAdminInput[] + updateMany?: NotificationUpdateManyWithWhereWithoutSentByAdminInput | NotificationUpdateManyWithWhereWithoutSentByAdminInput[] + deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + } + + export type UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput = { + create?: XOR | UploadedFileCreateWithoutUploadedByAdminInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminInput | UploadedFileCreateOrConnectWithoutUploadedByAdminInput[] + upsert?: UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminInput | UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminInput[] + createMany?: UploadedFileCreateManyUploadedByAdminInputEnvelope + set?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + disconnect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + delete?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + update?: UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminInput | UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminInput[] + updateMany?: UploadedFileUpdateManyWithWhereWithoutUploadedByAdminInput | UploadedFileUpdateManyWithWhereWithoutUploadedByAdminInput[] + deleteMany?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + } + + export type AdminSessionUncheckedUpdateManyWithoutAdminNestedInput = { + create?: XOR | AdminSessionCreateWithoutAdminInput[] | AdminSessionUncheckedCreateWithoutAdminInput[] + connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminInput | AdminSessionCreateOrConnectWithoutAdminInput[] + upsert?: AdminSessionUpsertWithWhereUniqueWithoutAdminInput | AdminSessionUpsertWithWhereUniqueWithoutAdminInput[] + createMany?: AdminSessionCreateManyAdminInputEnvelope + set?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + disconnect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + delete?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] + update?: AdminSessionUpdateWithWhereUniqueWithoutAdminInput | AdminSessionUpdateWithWhereUniqueWithoutAdminInput[] + updateMany?: AdminSessionUpdateManyWithWhereWithoutAdminInput | AdminSessionUpdateManyWithWhereWithoutAdminInput[] + deleteMany?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] + } + export type UserTypeCreateNestedOneWithoutAdminUsersInput = { create?: XOR connectOrCreate?: UserTypeCreateOrConnectWithoutAdminUsersInput @@ -62136,75 +64122,12 @@ export namespace Prisma { connect?: OrderWhereUniqueInput | OrderWhereUniqueInput[] } - export type WorkshopCreateNestedManyWithoutSupervisorInput = { - create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] - connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] - createMany?: WorkshopCreateManySupervisorInputEnvelope - connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - } - - export type BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput = { - create?: XOR | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] - connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] - createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope - connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - } - - export type LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput = { - create?: XOR | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] - connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] - createMany?: LedgerEntryCreateManyPostedByAdminUserInputEnvelope - connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - } - - export type OrderStatusEventCreateNestedManyWithoutActorAdminUserInput = { - create?: XOR | OrderStatusEventCreateWithoutActorAdminUserInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminUserInput | OrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - createMany?: OrderStatusEventCreateManyActorAdminUserInputEnvelope - connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - } - - export type PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput = { - create?: XOR | PreOrderStatusEventCreateWithoutActorAdminUserInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - createMany?: PreOrderStatusEventCreateManyActorAdminUserInputEnvelope - connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - } - - export type SmsMessageCreateNestedManyWithoutSentByAdminUserInput = { - create?: XOR | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] - createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope - connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - } - - export type NotificationCreateNestedManyWithoutSentByAdminUserInput = { - create?: XOR | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] - createMany?: NotificationCreateManySentByAdminUserInputEnvelope - connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - } - - export type UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput = { - create?: XOR | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] - connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] - createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope - connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - } - export type SalesExpertProfileCreateNestedOneWithoutAdminUserInput = { create?: XOR connectOrCreate?: SalesExpertProfileCreateOrConnectWithoutAdminUserInput connect?: SalesExpertProfileWhereUniqueInput } - export type AdminSessionCreateNestedManyWithoutAdminUserInput = { - create?: XOR | AdminSessionCreateWithoutAdminUserInput[] | AdminSessionUncheckedCreateWithoutAdminUserInput[] - connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminUserInput | AdminSessionCreateOrConnectWithoutAdminUserInput[] - createMany?: AdminSessionCreateManyAdminUserInputEnvelope - connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - } - export type CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput = { create?: XOR | CustomerCreateWithoutReferredByAgentInput[] | CustomerUncheckedCreateWithoutReferredByAgentInput[] connectOrCreate?: CustomerCreateOrConnectWithoutReferredByAgentInput | CustomerCreateOrConnectWithoutReferredByAgentInput[] @@ -62219,87 +64142,12 @@ export namespace Prisma { connect?: OrderWhereUniqueInput | OrderWhereUniqueInput[] } - export type WorkshopUncheckedCreateNestedManyWithoutSupervisorInput = { - create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] - connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] - createMany?: WorkshopCreateManySupervisorInputEnvelope - connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - } - - export type BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput = { - create?: XOR | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] - connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] - createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope - connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - } - - export type LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput = { - create?: XOR | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] - connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] - createMany?: LedgerEntryCreateManyPostedByAdminUserInputEnvelope - connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - } - - export type OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput = { - create?: XOR | OrderStatusEventCreateWithoutActorAdminUserInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminUserInput | OrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - createMany?: OrderStatusEventCreateManyActorAdminUserInputEnvelope - connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - } - - export type PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput = { - create?: XOR | PreOrderStatusEventCreateWithoutActorAdminUserInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - createMany?: PreOrderStatusEventCreateManyActorAdminUserInputEnvelope - connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - } - - export type SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput = { - create?: XOR | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] - createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope - connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - } - - export type NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput = { - create?: XOR | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] - createMany?: NotificationCreateManySentByAdminUserInputEnvelope - connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - } - - export type UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput = { - create?: XOR | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] - connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] - createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope - connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - } - export type SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput = { create?: XOR connectOrCreate?: SalesExpertProfileCreateOrConnectWithoutAdminUserInput connect?: SalesExpertProfileWhereUniqueInput } - export type AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput = { - create?: XOR | AdminSessionCreateWithoutAdminUserInput[] | AdminSessionUncheckedCreateWithoutAdminUserInput[] - connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminUserInput | AdminSessionCreateOrConnectWithoutAdminUserInput[] - createMany?: AdminSessionCreateManyAdminUserInputEnvelope - connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - } - - export type EnumAdminRoleFieldUpdateOperationsInput = { - set?: $Enums.AdminRole - } - - export type BoolFieldUpdateOperationsInput = { - set?: boolean - } - - export type DateTimeFieldUpdateOperationsInput = { - set?: Date | string - } - export type UserTypeUpdateOneWithoutAdminUsersNestedInput = { create?: XOR connectOrCreate?: UserTypeCreateOrConnectWithoutAdminUsersInput @@ -62358,118 +64206,6 @@ export namespace Prisma { deleteMany?: OrderScalarWhereInput | OrderScalarWhereInput[] } - export type WorkshopUpdateManyWithoutSupervisorNestedInput = { - create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] - connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] - upsert?: WorkshopUpsertWithWhereUniqueWithoutSupervisorInput | WorkshopUpsertWithWhereUniqueWithoutSupervisorInput[] - createMany?: WorkshopCreateManySupervisorInputEnvelope - set?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - disconnect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - delete?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - update?: WorkshopUpdateWithWhereUniqueWithoutSupervisorInput | WorkshopUpdateWithWhereUniqueWithoutSupervisorInput[] - updateMany?: WorkshopUpdateManyWithWhereWithoutSupervisorInput | WorkshopUpdateManyWithWhereWithoutSupervisorInput[] - deleteMany?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] - } - - export type BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput = { - create?: XOR | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] - connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] - upsert?: BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput[] - createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope - set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - update?: BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput[] - updateMany?: BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput | BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput[] - deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] - } - - export type LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput = { - create?: XOR | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] - connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] - upsert?: LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminUserInput | LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminUserInput[] - createMany?: LedgerEntryCreateManyPostedByAdminUserInputEnvelope - set?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - disconnect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - delete?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - update?: LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminUserInput | LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminUserInput[] - updateMany?: LedgerEntryUpdateManyWithWhereWithoutPostedByAdminUserInput | LedgerEntryUpdateManyWithWhereWithoutPostedByAdminUserInput[] - deleteMany?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] - } - - export type OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput = { - create?: XOR | OrderStatusEventCreateWithoutActorAdminUserInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminUserInput | OrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - upsert?: OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput | OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput[] - createMany?: OrderStatusEventCreateManyActorAdminUserInputEnvelope - set?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - disconnect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - delete?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - update?: OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput | OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput[] - updateMany?: OrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput | OrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput[] - deleteMany?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] - } - - export type PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput = { - create?: XOR | PreOrderStatusEventCreateWithoutActorAdminUserInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - upsert?: PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput | PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput[] - createMany?: PreOrderStatusEventCreateManyActorAdminUserInputEnvelope - set?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - disconnect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - delete?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - update?: PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput | PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput[] - updateMany?: PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput | PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput[] - deleteMany?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] - } - - export type SmsMessageUpdateManyWithoutSentByAdminUserNestedInput = { - create?: XOR | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] - upsert?: SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput[] - createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope - set?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - disconnect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - delete?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - update?: SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput[] - updateMany?: SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput | SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput[] - deleteMany?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] - } - - export type NotificationUpdateManyWithoutSentByAdminUserNestedInput = { - create?: XOR | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] - upsert?: NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput[] - createMany?: NotificationCreateManySentByAdminUserInputEnvelope - set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - update?: NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput[] - updateMany?: NotificationUpdateManyWithWhereWithoutSentByAdminUserInput | NotificationUpdateManyWithWhereWithoutSentByAdminUserInput[] - deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] - } - - export type UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput = { - create?: XOR | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] - connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] - upsert?: UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput[] - createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope - set?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - disconnect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - delete?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - update?: UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput[] - updateMany?: UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput | UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput[] - deleteMany?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] - } - export type SalesExpertProfileUpdateOneWithoutAdminUserNestedInput = { create?: XOR connectOrCreate?: SalesExpertProfileCreateOrConnectWithoutAdminUserInput @@ -62480,28 +64216,6 @@ export namespace Prisma { update?: XOR, SalesExpertProfileUncheckedUpdateWithoutAdminUserInput> } - export type AdminSessionUpdateManyWithoutAdminUserNestedInput = { - create?: XOR | AdminSessionCreateWithoutAdminUserInput[] | AdminSessionUncheckedCreateWithoutAdminUserInput[] - connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminUserInput | AdminSessionCreateOrConnectWithoutAdminUserInput[] - upsert?: AdminSessionUpsertWithWhereUniqueWithoutAdminUserInput | AdminSessionUpsertWithWhereUniqueWithoutAdminUserInput[] - createMany?: AdminSessionCreateManyAdminUserInputEnvelope - set?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - disconnect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - delete?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - update?: AdminSessionUpdateWithWhereUniqueWithoutAdminUserInput | AdminSessionUpdateWithWhereUniqueWithoutAdminUserInput[] - updateMany?: AdminSessionUpdateManyWithWhereWithoutAdminUserInput | AdminSessionUpdateManyWithWhereWithoutAdminUserInput[] - deleteMany?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] - } - - export type NullableIntFieldUpdateOperationsInput = { - set?: number | null - increment?: number - decrement?: number - multiply?: number - divide?: number - } - export type CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput = { create?: XOR | CustomerCreateWithoutReferredByAgentInput[] | CustomerUncheckedCreateWithoutReferredByAgentInput[] connectOrCreate?: CustomerCreateOrConnectWithoutReferredByAgentInput | CustomerCreateOrConnectWithoutReferredByAgentInput[] @@ -62530,118 +64244,6 @@ export namespace Prisma { deleteMany?: OrderScalarWhereInput | OrderScalarWhereInput[] } - export type WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput = { - create?: XOR | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] - connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] - upsert?: WorkshopUpsertWithWhereUniqueWithoutSupervisorInput | WorkshopUpsertWithWhereUniqueWithoutSupervisorInput[] - createMany?: WorkshopCreateManySupervisorInputEnvelope - set?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - disconnect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - delete?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] - update?: WorkshopUpdateWithWhereUniqueWithoutSupervisorInput | WorkshopUpdateWithWhereUniqueWithoutSupervisorInput[] - updateMany?: WorkshopUpdateManyWithWhereWithoutSupervisorInput | WorkshopUpdateManyWithWhereWithoutSupervisorInput[] - deleteMany?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] - } - - export type BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput = { - create?: XOR | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] - connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] - upsert?: BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput[] - createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope - set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] - update?: BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput[] - updateMany?: BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput | BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput[] - deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] - } - - export type LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput = { - create?: XOR | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] - connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] - upsert?: LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminUserInput | LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminUserInput[] - createMany?: LedgerEntryCreateManyPostedByAdminUserInputEnvelope - set?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - disconnect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - delete?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - connect?: LedgerEntryWhereUniqueInput | LedgerEntryWhereUniqueInput[] - update?: LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminUserInput | LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminUserInput[] - updateMany?: LedgerEntryUpdateManyWithWhereWithoutPostedByAdminUserInput | LedgerEntryUpdateManyWithWhereWithoutPostedByAdminUserInput[] - deleteMany?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] - } - - export type OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput = { - create?: XOR | OrderStatusEventCreateWithoutActorAdminUserInput[] | OrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: OrderStatusEventCreateOrConnectWithoutActorAdminUserInput | OrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - upsert?: OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput | OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput[] - createMany?: OrderStatusEventCreateManyActorAdminUserInputEnvelope - set?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - disconnect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - delete?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - connect?: OrderStatusEventWhereUniqueInput | OrderStatusEventWhereUniqueInput[] - update?: OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput | OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput[] - updateMany?: OrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput | OrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput[] - deleteMany?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] - } - - export type PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput = { - create?: XOR | PreOrderStatusEventCreateWithoutActorAdminUserInput[] | PreOrderStatusEventUncheckedCreateWithoutActorAdminUserInput[] - connectOrCreate?: PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput | PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput[] - upsert?: PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput | PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput[] - createMany?: PreOrderStatusEventCreateManyActorAdminUserInputEnvelope - set?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - disconnect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - delete?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] - update?: PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput | PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput[] - updateMany?: PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput | PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput[] - deleteMany?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] - } - - export type SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput = { - create?: XOR | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] - upsert?: SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput[] - createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope - set?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - disconnect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - delete?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] - update?: SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput[] - updateMany?: SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput | SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput[] - deleteMany?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] - } - - export type NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput = { - create?: XOR | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] - connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] - upsert?: NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput[] - createMany?: NotificationCreateManySentByAdminUserInputEnvelope - set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] - update?: NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput[] - updateMany?: NotificationUpdateManyWithWhereWithoutSentByAdminUserInput | NotificationUpdateManyWithWhereWithoutSentByAdminUserInput[] - deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] - } - - export type UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput = { - create?: XOR | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] - connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] - upsert?: UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput[] - createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope - set?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - disconnect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - delete?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] - update?: UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput[] - updateMany?: UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput | UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput[] - deleteMany?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] - } - export type SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput = { create?: XOR connectOrCreate?: SalesExpertProfileCreateOrConnectWithoutAdminUserInput @@ -62652,36 +64254,22 @@ export namespace Prisma { update?: XOR, SalesExpertProfileUncheckedUpdateWithoutAdminUserInput> } - export type AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput = { - create?: XOR | AdminSessionCreateWithoutAdminUserInput[] | AdminSessionUncheckedCreateWithoutAdminUserInput[] - connectOrCreate?: AdminSessionCreateOrConnectWithoutAdminUserInput | AdminSessionCreateOrConnectWithoutAdminUserInput[] - upsert?: AdminSessionUpsertWithWhereUniqueWithoutAdminUserInput | AdminSessionUpsertWithWhereUniqueWithoutAdminUserInput[] - createMany?: AdminSessionCreateManyAdminUserInputEnvelope - set?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - disconnect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - delete?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - connect?: AdminSessionWhereUniqueInput | AdminSessionWhereUniqueInput[] - update?: AdminSessionUpdateWithWhereUniqueWithoutAdminUserInput | AdminSessionUpdateWithWhereUniqueWithoutAdminUserInput[] - updateMany?: AdminSessionUpdateManyWithWhereWithoutAdminUserInput | AdminSessionUpdateManyWithWhereWithoutAdminUserInput[] - deleteMany?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] - } - export type NullableDateTimeFieldUpdateOperationsInput = { set?: Date | string | null } - export type AdminUserCreateNestedOneWithoutSessionsInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSessionsInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutSessionsInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSessionsInput + connect?: AdminWhereUniqueInput } - export type AdminUserUpdateOneRequiredWithoutSessionsNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSessionsInput - upsert?: AdminUserUpsertWithoutSessionsInput - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutSessionsInput> + export type AdminUpdateOneRequiredWithoutSessionsNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSessionsInput + upsert?: AdminUpsertWithoutSessionsInput + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutSessionsInput> } export type AdminUserCreateNestedOneWithoutSalesExpertProfileInput = { @@ -63401,6 +64989,13 @@ export namespace Prisma { connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] } + export type AdminCreateNestedManyWithoutBranchInput = { + create?: XOR | AdminCreateWithoutBranchInput[] | AdminUncheckedCreateWithoutBranchInput[] + connectOrCreate?: AdminCreateOrConnectWithoutBranchInput | AdminCreateOrConnectWithoutBranchInput[] + createMany?: AdminCreateManyBranchInputEnvelope + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + } + export type OrderCreateNestedManyWithoutBranchInput = { create?: XOR | OrderCreateWithoutBranchInput[] | OrderUncheckedCreateWithoutBranchInput[] connectOrCreate?: OrderCreateOrConnectWithoutBranchInput | OrderCreateOrConnectWithoutBranchInput[] @@ -63422,6 +65017,13 @@ export namespace Prisma { connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] } + export type AdminUncheckedCreateNestedManyWithoutBranchInput = { + create?: XOR | AdminCreateWithoutBranchInput[] | AdminUncheckedCreateWithoutBranchInput[] + connectOrCreate?: AdminCreateOrConnectWithoutBranchInput | AdminCreateOrConnectWithoutBranchInput[] + createMany?: AdminCreateManyBranchInputEnvelope + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + } + export type OrderUncheckedCreateNestedManyWithoutBranchInput = { create?: XOR | OrderCreateWithoutBranchInput[] | OrderUncheckedCreateWithoutBranchInput[] connectOrCreate?: OrderCreateOrConnectWithoutBranchInput | OrderCreateOrConnectWithoutBranchInput[] @@ -63460,6 +65062,20 @@ export namespace Prisma { deleteMany?: AdminUserScalarWhereInput | AdminUserScalarWhereInput[] } + export type AdminUpdateManyWithoutBranchNestedInput = { + create?: XOR | AdminCreateWithoutBranchInput[] | AdminUncheckedCreateWithoutBranchInput[] + connectOrCreate?: AdminCreateOrConnectWithoutBranchInput | AdminCreateOrConnectWithoutBranchInput[] + upsert?: AdminUpsertWithWhereUniqueWithoutBranchInput | AdminUpsertWithWhereUniqueWithoutBranchInput[] + createMany?: AdminCreateManyBranchInputEnvelope + set?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + disconnect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + delete?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + update?: AdminUpdateWithWhereUniqueWithoutBranchInput | AdminUpdateWithWhereUniqueWithoutBranchInput[] + updateMany?: AdminUpdateManyWithWhereWithoutBranchInput | AdminUpdateManyWithWhereWithoutBranchInput[] + deleteMany?: AdminScalarWhereInput | AdminScalarWhereInput[] + } + export type OrderUpdateManyWithoutBranchNestedInput = { create?: XOR | OrderCreateWithoutBranchInput[] | OrderUncheckedCreateWithoutBranchInput[] connectOrCreate?: OrderCreateOrConnectWithoutBranchInput | OrderCreateOrConnectWithoutBranchInput[] @@ -63502,6 +65118,20 @@ export namespace Prisma { deleteMany?: AdminUserScalarWhereInput | AdminUserScalarWhereInput[] } + export type AdminUncheckedUpdateManyWithoutBranchNestedInput = { + create?: XOR | AdminCreateWithoutBranchInput[] | AdminUncheckedCreateWithoutBranchInput[] + connectOrCreate?: AdminCreateOrConnectWithoutBranchInput | AdminCreateOrConnectWithoutBranchInput[] + upsert?: AdminUpsertWithWhereUniqueWithoutBranchInput | AdminUpsertWithWhereUniqueWithoutBranchInput[] + createMany?: AdminCreateManyBranchInputEnvelope + set?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + disconnect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + delete?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + update?: AdminUpdateWithWhereUniqueWithoutBranchInput | AdminUpdateWithWhereUniqueWithoutBranchInput[] + updateMany?: AdminUpdateManyWithWhereWithoutBranchInput | AdminUpdateManyWithWhereWithoutBranchInput[] + deleteMany?: AdminScalarWhereInput | AdminScalarWhereInput[] + } + export type OrderUncheckedUpdateManyWithoutBranchNestedInput = { create?: XOR | OrderCreateWithoutBranchInput[] | OrderUncheckedCreateWithoutBranchInput[] connectOrCreate?: OrderCreateOrConnectWithoutBranchInput | OrderCreateOrConnectWithoutBranchInput[] @@ -63530,10 +65160,10 @@ export namespace Prisma { deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] } - export type AdminUserCreateNestedOneWithoutSupervisedWorkshopsInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSupervisedWorkshopsInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutSupervisedWorkshopsInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSupervisedWorkshopsInput + connect?: AdminWhereUniqueInput } export type PreOrderCreateNestedManyWithoutWorkshopInput = { @@ -63550,14 +65180,14 @@ export namespace Prisma { connect?: PreOrderWhereUniqueInput | PreOrderWhereUniqueInput[] } - export type AdminUserUpdateOneWithoutSupervisedWorkshopsNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSupervisedWorkshopsInput - upsert?: AdminUserUpsertWithoutSupervisedWorkshopsInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutSupervisedWorkshopsInput> + export type AdminUpdateOneWithoutSupervisedWorkshopsNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSupervisedWorkshopsInput + upsert?: AdminUpsertWithoutSupervisedWorkshopsInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutSupervisedWorkshopsInput> } export type PreOrderUpdateManyWithoutWorkshopNestedInput = { @@ -64612,10 +66242,10 @@ export namespace Prisma { connect?: OrderWhereUniqueInput } - export type AdminUserCreateNestedOneWithoutOrderStatusEventsInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutOrderStatusEventsInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutOrderStatusEventsInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutOrderStatusEventsInput + connect?: AdminWhereUniqueInput } export type NullableEnumOrderStatusFieldUpdateOperationsInput = { @@ -64630,14 +66260,14 @@ export namespace Prisma { update?: XOR, OrderUncheckedUpdateWithoutStatusEventsInput> } - export type AdminUserUpdateOneWithoutOrderStatusEventsNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutOrderStatusEventsInput - upsert?: AdminUserUpsertWithoutOrderStatusEventsInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutOrderStatusEventsInput> + export type AdminUpdateOneWithoutOrderStatusEventsNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutOrderStatusEventsInput + upsert?: AdminUpsertWithoutOrderStatusEventsInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutOrderStatusEventsInput> } export type CustomerCreateNestedOneWithoutPreOrdersInput = { @@ -64754,10 +66384,10 @@ export namespace Prisma { connect?: PreOrderWhereUniqueInput } - export type AdminUserCreateNestedOneWithoutPreOrderStatusEventsInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutPreOrderStatusEventsInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutPreOrderStatusEventsInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutPreOrderStatusEventsInput + connect?: AdminWhereUniqueInput } export type PreOrderUpdateOneRequiredWithoutStatusEventsNestedInput = { @@ -64768,14 +66398,14 @@ export namespace Prisma { update?: XOR, PreOrderUncheckedUpdateWithoutStatusEventsInput> } - export type AdminUserUpdateOneWithoutPreOrderStatusEventsNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutPreOrderStatusEventsInput - upsert?: AdminUserUpsertWithoutPreOrderStatusEventsInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutPreOrderStatusEventsInput> + export type AdminUpdateOneWithoutPreOrderStatusEventsNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutPreOrderStatusEventsInput + upsert?: AdminUpsertWithoutPreOrderStatusEventsInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutPreOrderStatusEventsInput> } export type CustomerCreateNestedOneWithoutLedgerEntriesInput = { @@ -64790,10 +66420,10 @@ export namespace Prisma { connect?: OrderWhereUniqueInput } - export type AdminUserCreateNestedOneWithoutPostedLedgerEntriesInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutPostedLedgerEntriesInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutPostedLedgerEntriesInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutPostedLedgerEntriesInput + connect?: AdminWhereUniqueInput } export type EnumLedgerCurrencyFieldUpdateOperationsInput = { @@ -64826,14 +66456,14 @@ export namespace Prisma { update?: XOR, OrderUncheckedUpdateWithoutLedgerEntriesInput> } - export type AdminUserUpdateOneWithoutPostedLedgerEntriesNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutPostedLedgerEntriesInput - upsert?: AdminUserUpsertWithoutPostedLedgerEntriesInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutPostedLedgerEntriesInput> + export type AdminUpdateOneWithoutPostedLedgerEntriesNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutPostedLedgerEntriesInput + upsert?: AdminUpsertWithoutPostedLedgerEntriesInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutPostedLedgerEntriesInput> } export type CustomerCreateNestedOneWithoutWalletBonusesInput = { @@ -64864,6 +66494,13 @@ export namespace Prisma { connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] } + export type AdminCreateNestedManyWithoutUserTypeInput = { + create?: XOR | AdminCreateWithoutUserTypeInput[] | AdminUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminCreateOrConnectWithoutUserTypeInput | AdminCreateOrConnectWithoutUserTypeInput[] + createMany?: AdminCreateManyUserTypeInputEnvelope + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + } + export type PermissionUncheckedCreateNestedManyWithoutUserTypeInput = { create?: XOR | PermissionCreateWithoutUserTypeInput[] | PermissionUncheckedCreateWithoutUserTypeInput[] connectOrCreate?: PermissionCreateOrConnectWithoutUserTypeInput | PermissionCreateOrConnectWithoutUserTypeInput[] @@ -64878,6 +66515,13 @@ export namespace Prisma { connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] } + export type AdminUncheckedCreateNestedManyWithoutUserTypeInput = { + create?: XOR | AdminCreateWithoutUserTypeInput[] | AdminUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminCreateOrConnectWithoutUserTypeInput | AdminCreateOrConnectWithoutUserTypeInput[] + createMany?: AdminCreateManyUserTypeInputEnvelope + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + } + export type PermissionUpdateManyWithoutUserTypeNestedInput = { create?: XOR | PermissionCreateWithoutUserTypeInput[] | PermissionUncheckedCreateWithoutUserTypeInput[] connectOrCreate?: PermissionCreateOrConnectWithoutUserTypeInput | PermissionCreateOrConnectWithoutUserTypeInput[] @@ -64906,6 +66550,20 @@ export namespace Prisma { deleteMany?: AdminUserScalarWhereInput | AdminUserScalarWhereInput[] } + export type AdminUpdateManyWithoutUserTypeNestedInput = { + create?: XOR | AdminCreateWithoutUserTypeInput[] | AdminUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminCreateOrConnectWithoutUserTypeInput | AdminCreateOrConnectWithoutUserTypeInput[] + upsert?: AdminUpsertWithWhereUniqueWithoutUserTypeInput | AdminUpsertWithWhereUniqueWithoutUserTypeInput[] + createMany?: AdminCreateManyUserTypeInputEnvelope + set?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + disconnect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + delete?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + update?: AdminUpdateWithWhereUniqueWithoutUserTypeInput | AdminUpdateWithWhereUniqueWithoutUserTypeInput[] + updateMany?: AdminUpdateManyWithWhereWithoutUserTypeInput | AdminUpdateManyWithWhereWithoutUserTypeInput[] + deleteMany?: AdminScalarWhereInput | AdminScalarWhereInput[] + } + export type PermissionUncheckedUpdateManyWithoutUserTypeNestedInput = { create?: XOR | PermissionCreateWithoutUserTypeInput[] | PermissionUncheckedCreateWithoutUserTypeInput[] connectOrCreate?: PermissionCreateOrConnectWithoutUserTypeInput | PermissionCreateOrConnectWithoutUserTypeInput[] @@ -64934,6 +66592,20 @@ export namespace Prisma { deleteMany?: AdminUserScalarWhereInput | AdminUserScalarWhereInput[] } + export type AdminUncheckedUpdateManyWithoutUserTypeNestedInput = { + create?: XOR | AdminCreateWithoutUserTypeInput[] | AdminUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminCreateOrConnectWithoutUserTypeInput | AdminCreateOrConnectWithoutUserTypeInput[] + upsert?: AdminUpsertWithWhereUniqueWithoutUserTypeInput | AdminUpsertWithWhereUniqueWithoutUserTypeInput[] + createMany?: AdminCreateManyUserTypeInputEnvelope + set?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + disconnect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + delete?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + connect?: AdminWhereUniqueInput | AdminWhereUniqueInput[] + update?: AdminUpdateWithWhereUniqueWithoutUserTypeInput | AdminUpdateWithWhereUniqueWithoutUserTypeInput[] + updateMany?: AdminUpdateManyWithWhereWithoutUserTypeInput | AdminUpdateManyWithWhereWithoutUserTypeInput[] + deleteMany?: AdminScalarWhereInput | AdminScalarWhereInput[] + } + export type UserTypeCreateNestedOneWithoutPermissionsInput = { create?: XOR connectOrCreate?: UserTypeCreateOrConnectWithoutPermissionsInput @@ -65128,10 +66800,10 @@ export namespace Prisma { connect?: BranchWhereUniqueInput } - export type AdminUserCreateNestedOneWithoutBranchAllocationsInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutBranchAllocationsInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutBranchAllocationsInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutBranchAllocationsInput + connect?: AdminWhereUniqueInput } export type BranchAllocationItemCreateNestedManyWithoutAllocationInput = { @@ -65156,14 +66828,14 @@ export namespace Prisma { update?: XOR, BranchUncheckedUpdateWithoutAllocationsInput> } - export type AdminUserUpdateOneWithoutBranchAllocationsNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutBranchAllocationsInput - upsert?: AdminUserUpsertWithoutBranchAllocationsInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutBranchAllocationsInput> + export type AdminUpdateOneWithoutBranchAllocationsNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutBranchAllocationsInput + upsert?: AdminUpsertWithoutBranchAllocationsInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutBranchAllocationsInput> } export type BranchAllocationItemUpdateManyWithoutAllocationNestedInput = { @@ -65222,30 +66894,30 @@ export namespace Prisma { update?: XOR, ProductUncheckedUpdateWithoutAllocationItemsInput> } - export type AdminUserCreateNestedOneWithoutSentSmsMessagesInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSentSmsMessagesInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutSentSmsMessagesInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSentSmsMessagesInput + connect?: AdminWhereUniqueInput } export type EnumMessageAudienceFieldUpdateOperationsInput = { set?: $Enums.MessageAudience } - export type AdminUserUpdateOneWithoutSentSmsMessagesNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSentSmsMessagesInput - upsert?: AdminUserUpsertWithoutSentSmsMessagesInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutSentSmsMessagesInput> + export type AdminUpdateOneWithoutSentSmsMessagesNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSentSmsMessagesInput + upsert?: AdminUpsertWithoutSentSmsMessagesInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutSentSmsMessagesInput> } - export type AdminUserCreateNestedOneWithoutSentNotificationsInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSentNotificationsInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutSentNotificationsInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSentNotificationsInput + connect?: AdminWhereUniqueInput } export type NotificationRecipientCreateNestedManyWithoutNotificationInput = { @@ -65262,14 +66934,14 @@ export namespace Prisma { connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] } - export type AdminUserUpdateOneWithoutSentNotificationsNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutSentNotificationsInput - upsert?: AdminUserUpsertWithoutSentNotificationsInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutSentNotificationsInput> + export type AdminUpdateOneWithoutSentNotificationsNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutSentNotificationsInput + upsert?: AdminUpsertWithoutSentNotificationsInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutSentNotificationsInput> } export type NotificationRecipientUpdateManyWithoutNotificationNestedInput = { @@ -65342,10 +67014,10 @@ export namespace Prisma { update?: XOR, CustomerUncheckedUpdateWithoutActivityLogsInput> } - export type AdminUserCreateNestedOneWithoutUploadedFilesInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutUploadedFilesInput - connect?: AdminUserWhereUniqueInput + export type AdminCreateNestedOneWithoutUploadedFilesInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutUploadedFilesInput + connect?: AdminWhereUniqueInput } export type CustomerCreateNestedManyWithoutAvatarFileInput = { @@ -65376,14 +67048,14 @@ export namespace Prisma { connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] } - export type AdminUserUpdateOneWithoutUploadedFilesNestedInput = { - create?: XOR - connectOrCreate?: AdminUserCreateOrConnectWithoutUploadedFilesInput - upsert?: AdminUserUpsertWithoutUploadedFilesInput - disconnect?: AdminUserWhereInput | boolean - delete?: AdminUserWhereInput | boolean - connect?: AdminUserWhereUniqueInput - update?: XOR, AdminUserUncheckedUpdateWithoutUploadedFilesInput> + export type AdminUpdateOneWithoutUploadedFilesNestedInput = { + create?: XOR + connectOrCreate?: AdminCreateOrConnectWithoutUploadedFilesInput + upsert?: AdminUpsertWithoutUploadedFilesInput + disconnect?: AdminWhereInput | boolean + delete?: AdminWhereInput | boolean + connect?: AdminWhereUniqueInput + update?: XOR, AdminUncheckedUpdateWithoutUploadedFilesInput> } export type CustomerUpdateManyWithoutAvatarFileNestedInput = { @@ -66273,6 +67945,7 @@ export namespace Prisma { phone?: string | null isActive?: boolean adminUsers?: AdminUserCreateNestedManyWithoutBranchInput + admins?: AdminCreateNestedManyWithoutBranchInput orders?: OrderCreateNestedManyWithoutBranchInput allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } @@ -66284,6 +67957,7 @@ export namespace Prisma { phone?: string | null isActive?: boolean adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput + admins?: AdminUncheckedCreateNestedManyWithoutBranchInput orders?: OrderUncheckedCreateNestedManyWithoutBranchInput allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } @@ -66625,12 +68299,700 @@ export namespace Prisma { updatedAt?: DateTimeFilter<"SalesExpertProfile"> | Date | string } + export type UserTypeCreateWithoutAdminsInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + permissions?: PermissionCreateNestedManyWithoutUserTypeInput + adminUsers?: AdminUserCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeUncheckedCreateWithoutAdminsInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + permissions?: PermissionUncheckedCreateNestedManyWithoutUserTypeInput + adminUsers?: AdminUserUncheckedCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeCreateOrConnectWithoutAdminsInput = { + where: UserTypeWhereUniqueInput + create: XOR + } + + export type BranchCreateWithoutAdminsInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + city?: CityCreateNestedOneWithoutBranchesInput + adminUsers?: AdminUserCreateNestedManyWithoutBranchInput + orders?: OrderCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationCreateNestedManyWithoutBranchInput + } + + export type BranchUncheckedCreateWithoutAdminsInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + cityId?: string | null + adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput + orders?: OrderUncheckedCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput + } + + export type BranchCreateOrConnectWithoutAdminsInput = { + where: BranchWhereUniqueInput + create: XOR + } + + export type WorkshopCreateWithoutSupervisorInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + preOrders?: PreOrderCreateNestedManyWithoutWorkshopInput + } + + export type WorkshopUncheckedCreateWithoutSupervisorInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + preOrders?: PreOrderUncheckedCreateNestedManyWithoutWorkshopInput + } + + export type WorkshopCreateOrConnectWithoutSupervisorInput = { + where: WorkshopWhereUniqueInput + create: XOR + } + + export type WorkshopCreateManySupervisorInputEnvelope = { + data: WorkshopCreateManySupervisorInput | WorkshopCreateManySupervisorInput[] + skipDuplicates?: boolean + } + + export type BranchAllocationCreateWithoutAllocatorAdminInput = { + id?: string + note?: string | null + createdAt?: Date | string + branch: BranchCreateNestedOneWithoutAllocationsInput + items?: BranchAllocationItemCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationUncheckedCreateWithoutAllocatorAdminInput = { + id?: string + branchId: string + note?: string | null + createdAt?: Date | string + items?: BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationCreateOrConnectWithoutAllocatorAdminInput = { + where: BranchAllocationWhereUniqueInput + create: XOR + } + + export type BranchAllocationCreateManyAllocatorAdminInputEnvelope = { + data: BranchAllocationCreateManyAllocatorAdminInput | BranchAllocationCreateManyAllocatorAdminInput[] + skipDuplicates?: boolean + } + + export type LedgerEntryCreateWithoutPostedByAdminInput = { + id?: string + currency: $Enums.LedgerCurrency + direction: $Enums.LedgerDirection + sourceType: $Enums.LedgerSourceType + amount: Decimal | DecimalJsLike | number | string + karatPerMille?: number | null + pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null + confirmed?: boolean + confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null + note?: string | null + createdAt?: Date | string + customer: CustomerCreateNestedOneWithoutLedgerEntriesInput + order?: OrderCreateNestedOneWithoutLedgerEntriesInput + } + + export type LedgerEntryUncheckedCreateWithoutPostedByAdminInput = { + id?: string + customerId: string + currency: $Enums.LedgerCurrency + direction: $Enums.LedgerDirection + sourceType: $Enums.LedgerSourceType + amount: Decimal | DecimalJsLike | number | string + karatPerMille?: number | null + pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null + orderId?: string | null + confirmed?: boolean + confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null + note?: string | null + createdAt?: Date | string + } + + export type LedgerEntryCreateOrConnectWithoutPostedByAdminInput = { + where: LedgerEntryWhereUniqueInput + create: XOR + } + + export type LedgerEntryCreateManyPostedByAdminInputEnvelope = { + data: LedgerEntryCreateManyPostedByAdminInput | LedgerEntryCreateManyPostedByAdminInput[] + skipDuplicates?: boolean + } + + export type OrderStatusEventCreateWithoutActorAdminInput = { + id?: string + fromStatus?: $Enums.OrderStatus | null + toStatus: $Enums.OrderStatus + note?: string | null + createdAt?: Date | string + order: OrderCreateNestedOneWithoutStatusEventsInput + } + + export type OrderStatusEventUncheckedCreateWithoutActorAdminInput = { + id?: string + orderId: string + fromStatus?: $Enums.OrderStatus | null + toStatus: $Enums.OrderStatus + note?: string | null + createdAt?: Date | string + } + + export type OrderStatusEventCreateOrConnectWithoutActorAdminInput = { + where: OrderStatusEventWhereUniqueInput + create: XOR + } + + export type OrderStatusEventCreateManyActorAdminInputEnvelope = { + data: OrderStatusEventCreateManyActorAdminInput | OrderStatusEventCreateManyActorAdminInput[] + skipDuplicates?: boolean + } + + export type PreOrderStatusEventCreateWithoutActorAdminInput = { + id?: string + changes: JsonNullValueInput | InputJsonValue + ipAddress?: string | null + createdAt?: Date | string + preOrder: PreOrderCreateNestedOneWithoutStatusEventsInput + } + + export type PreOrderStatusEventUncheckedCreateWithoutActorAdminInput = { + id?: string + preOrderId: string + changes: JsonNullValueInput | InputJsonValue + ipAddress?: string | null + createdAt?: Date | string + } + + export type PreOrderStatusEventCreateOrConnectWithoutActorAdminInput = { + where: PreOrderStatusEventWhereUniqueInput + create: XOR + } + + export type PreOrderStatusEventCreateManyActorAdminInputEnvelope = { + data: PreOrderStatusEventCreateManyActorAdminInput | PreOrderStatusEventCreateManyActorAdminInput[] + skipDuplicates?: boolean + } + + export type SmsMessageCreateWithoutSentByAdminInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + createdAt?: Date | string + } + + export type SmsMessageUncheckedCreateWithoutSentByAdminInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + createdAt?: Date | string + } + + export type SmsMessageCreateOrConnectWithoutSentByAdminInput = { + where: SmsMessageWhereUniqueInput + create: XOR + } + + export type SmsMessageCreateManySentByAdminInputEnvelope = { + data: SmsMessageCreateManySentByAdminInput | SmsMessageCreateManySentByAdminInput[] + skipDuplicates?: boolean + } + + export type NotificationCreateWithoutSentByAdminInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + recipients?: NotificationRecipientCreateNestedManyWithoutNotificationInput + } + + export type NotificationUncheckedCreateWithoutSentByAdminInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + recipients?: NotificationRecipientUncheckedCreateNestedManyWithoutNotificationInput + } + + export type NotificationCreateOrConnectWithoutSentByAdminInput = { + where: NotificationWhereUniqueInput + create: XOR + } + + export type NotificationCreateManySentByAdminInputEnvelope = { + data: NotificationCreateManySentByAdminInput | NotificationCreateManySentByAdminInput[] + skipDuplicates?: boolean + } + + export type UploadedFileCreateWithoutUploadedByAdminInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + customerAvatars?: CustomerCreateNestedManyWithoutAvatarFileInput + adminUserAvatars?: AdminUserCreateNestedManyWithoutAvatarFileInput + } + + export type UploadedFileUncheckedCreateWithoutUploadedByAdminInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + customerAvatars?: CustomerUncheckedCreateNestedManyWithoutAvatarFileInput + adminUserAvatars?: AdminUserUncheckedCreateNestedManyWithoutAvatarFileInput + } + + export type UploadedFileCreateOrConnectWithoutUploadedByAdminInput = { + where: UploadedFileWhereUniqueInput + create: XOR + } + + export type UploadedFileCreateManyUploadedByAdminInputEnvelope = { + data: UploadedFileCreateManyUploadedByAdminInput | UploadedFileCreateManyUploadedByAdminInput[] + skipDuplicates?: boolean + } + + export type AdminSessionCreateWithoutAdminInput = { + id?: string + jti: string + iamSessionId?: string | null + iamSub?: string | null + ipAddress?: string | null + userAgent?: string | null + createdAt?: Date | string + expiresAt?: Date | string | null + lastSeenAt?: Date | string | null + revokedAt?: Date | string | null + revokedReason?: string | null + } + + export type AdminSessionUncheckedCreateWithoutAdminInput = { + id?: string + jti: string + iamSessionId?: string | null + iamSub?: string | null + ipAddress?: string | null + userAgent?: string | null + createdAt?: Date | string + expiresAt?: Date | string | null + lastSeenAt?: Date | string | null + revokedAt?: Date | string | null + revokedReason?: string | null + } + + export type AdminSessionCreateOrConnectWithoutAdminInput = { + where: AdminSessionWhereUniqueInput + create: XOR + } + + export type AdminSessionCreateManyAdminInputEnvelope = { + data: AdminSessionCreateManyAdminInput | AdminSessionCreateManyAdminInput[] + skipDuplicates?: boolean + } + + export type UserTypeUpsertWithoutAdminsInput = { + update: XOR + create: XOR + where?: UserTypeWhereInput + } + + export type UserTypeUpdateToOneWithWhereWithoutAdminsInput = { + where?: UserTypeWhereInput + data: XOR + } + + export type UserTypeUpdateWithoutAdminsInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + permissions?: PermissionUpdateManyWithoutUserTypeNestedInput + adminUsers?: AdminUserUpdateManyWithoutUserTypeNestedInput + } + + export type UserTypeUncheckedUpdateWithoutAdminsInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + permissions?: PermissionUncheckedUpdateManyWithoutUserTypeNestedInput + adminUsers?: AdminUserUncheckedUpdateManyWithoutUserTypeNestedInput + } + + export type BranchUpsertWithoutAdminsInput = { + update: XOR + create: XOR + where?: BranchWhereInput + } + + export type BranchUpdateToOneWithWhereWithoutAdminsInput = { + where?: BranchWhereInput + data: XOR + } + + export type BranchUpdateWithoutAdminsInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + city?: CityUpdateOneWithoutBranchesNestedInput + adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput + orders?: OrderUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput + } + + export type BranchUncheckedUpdateWithoutAdminsInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + cityId?: NullableStringFieldUpdateOperationsInput | string | null + adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput + orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput + } + + export type WorkshopUpsertWithWhereUniqueWithoutSupervisorInput = { + where: WorkshopWhereUniqueInput + update: XOR + create: XOR + } + + export type WorkshopUpdateWithWhereUniqueWithoutSupervisorInput = { + where: WorkshopWhereUniqueInput + data: XOR + } + + export type WorkshopUpdateManyWithWhereWithoutSupervisorInput = { + where: WorkshopScalarWhereInput + data: XOR + } + + export type WorkshopScalarWhereInput = { + AND?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + OR?: WorkshopScalarWhereInput[] + NOT?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + id?: StringFilter<"Workshop"> | string + name?: StringFilter<"Workshop"> | string + address?: StringNullableFilter<"Workshop"> | string | null + phone?: StringNullableFilter<"Workshop"> | string | null + supervisorId?: StringNullableFilter<"Workshop"> | string | null + isActive?: BoolFilter<"Workshop"> | boolean + } + + export type BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminInput = { + where: BranchAllocationWhereUniqueInput + update: XOR + create: XOR + } + + export type BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminInput = { + where: BranchAllocationWhereUniqueInput + data: XOR + } + + export type BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminInput = { + where: BranchAllocationScalarWhereInput + data: XOR + } + + export type BranchAllocationScalarWhereInput = { + AND?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + OR?: BranchAllocationScalarWhereInput[] + NOT?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + id?: StringFilter<"BranchAllocation"> | string + branchId?: StringFilter<"BranchAllocation"> | string + allocatorAdminId?: StringNullableFilter<"BranchAllocation"> | string | null + note?: StringNullableFilter<"BranchAllocation"> | string | null + createdAt?: DateTimeFilter<"BranchAllocation"> | Date | string + } + + export type LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminInput = { + where: LedgerEntryWhereUniqueInput + update: XOR + create: XOR + } + + export type LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminInput = { + where: LedgerEntryWhereUniqueInput + data: XOR + } + + export type LedgerEntryUpdateManyWithWhereWithoutPostedByAdminInput = { + where: LedgerEntryScalarWhereInput + data: XOR + } + + export type LedgerEntryScalarWhereInput = { + AND?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] + OR?: LedgerEntryScalarWhereInput[] + NOT?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] + id?: StringFilter<"LedgerEntry"> | string + customerId?: StringFilter<"LedgerEntry"> | string + currency?: EnumLedgerCurrencyFilter<"LedgerEntry"> | $Enums.LedgerCurrency + direction?: EnumLedgerDirectionFilter<"LedgerEntry"> | $Enums.LedgerDirection + sourceType?: EnumLedgerSourceTypeFilter<"LedgerEntry"> | $Enums.LedgerSourceType + amount?: DecimalFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string + karatPerMille?: IntNullableFilter<"LedgerEntry"> | number | null + pricePerGramRialAtEntry?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + orderId?: StringNullableFilter<"LedgerEntry"> | string | null + confirmed?: BoolFilter<"LedgerEntry"> | boolean + confirmedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null + postedByAdminId?: StringNullableFilter<"LedgerEntry"> | string | null + labName?: StringNullableFilter<"LedgerEntry"> | string | null + hallmark?: StringNullableFilter<"LedgerEntry"> | string | null + accountName?: StringNullableFilter<"LedgerEntry"> | string | null + bankName?: StringNullableFilter<"LedgerEntry"> | string | null + transferTo?: StringNullableFilter<"LedgerEntry"> | string | null + originalValue?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + priceRial?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + receivedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null + note?: StringNullableFilter<"LedgerEntry"> | string | null + createdAt?: DateTimeFilter<"LedgerEntry"> | Date | string + } + + export type OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput = { + where: OrderStatusEventWhereUniqueInput + update: XOR + create: XOR + } + + export type OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput = { + where: OrderStatusEventWhereUniqueInput + data: XOR + } + + export type OrderStatusEventUpdateManyWithWhereWithoutActorAdminInput = { + where: OrderStatusEventScalarWhereInput + data: XOR + } + + export type OrderStatusEventScalarWhereInput = { + AND?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] + OR?: OrderStatusEventScalarWhereInput[] + NOT?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] + id?: StringFilter<"OrderStatusEvent"> | string + orderId?: StringFilter<"OrderStatusEvent"> | string + fromStatus?: EnumOrderStatusNullableFilter<"OrderStatusEvent"> | $Enums.OrderStatus | null + toStatus?: EnumOrderStatusFilter<"OrderStatusEvent"> | $Enums.OrderStatus + note?: StringNullableFilter<"OrderStatusEvent"> | string | null + actorAdminId?: StringNullableFilter<"OrderStatusEvent"> | string | null + createdAt?: DateTimeFilter<"OrderStatusEvent"> | Date | string + } + + export type PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminInput = { + where: PreOrderStatusEventWhereUniqueInput + update: XOR + create: XOR + } + + export type PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminInput = { + where: PreOrderStatusEventWhereUniqueInput + data: XOR + } + + export type PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminInput = { + where: PreOrderStatusEventScalarWhereInput + data: XOR + } + + export type PreOrderStatusEventScalarWhereInput = { + AND?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] + OR?: PreOrderStatusEventScalarWhereInput[] + NOT?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] + id?: StringFilter<"PreOrderStatusEvent"> | string + preOrderId?: StringFilter<"PreOrderStatusEvent"> | string + changes?: JsonFilter<"PreOrderStatusEvent"> + actorAdminId?: StringNullableFilter<"PreOrderStatusEvent"> | string | null + ipAddress?: StringNullableFilter<"PreOrderStatusEvent"> | string | null + createdAt?: DateTimeFilter<"PreOrderStatusEvent"> | Date | string + } + + export type SmsMessageUpsertWithWhereUniqueWithoutSentByAdminInput = { + where: SmsMessageWhereUniqueInput + update: XOR + create: XOR + } + + export type SmsMessageUpdateWithWhereUniqueWithoutSentByAdminInput = { + where: SmsMessageWhereUniqueInput + data: XOR + } + + export type SmsMessageUpdateManyWithWhereWithoutSentByAdminInput = { + where: SmsMessageScalarWhereInput + data: XOR + } + + export type SmsMessageScalarWhereInput = { + AND?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + OR?: SmsMessageScalarWhereInput[] + NOT?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + id?: StringFilter<"SmsMessage"> | string + audience?: EnumMessageAudienceFilter<"SmsMessage"> | $Enums.MessageAudience + recipients?: StringNullableFilter<"SmsMessage"> | string | null + body?: StringFilter<"SmsMessage"> | string + sentCount?: IntFilter<"SmsMessage"> | number + sentByAdminId?: StringNullableFilter<"SmsMessage"> | string | null + createdAt?: DateTimeFilter<"SmsMessage"> | Date | string + } + + export type NotificationUpsertWithWhereUniqueWithoutSentByAdminInput = { + where: NotificationWhereUniqueInput + update: XOR + create: XOR + } + + export type NotificationUpdateWithWhereUniqueWithoutSentByAdminInput = { + where: NotificationWhereUniqueInput + data: XOR + } + + export type NotificationUpdateManyWithWhereWithoutSentByAdminInput = { + where: NotificationScalarWhereInput + data: XOR + } + + export type NotificationScalarWhereInput = { + AND?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + OR?: NotificationScalarWhereInput[] + NOT?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + id?: StringFilter<"Notification"> | string + title?: StringFilter<"Notification"> | string + body?: StringFilter<"Notification"> | string + audience?: EnumMessageAudienceFilter<"Notification"> | $Enums.MessageAudience + sentByAdminId?: StringNullableFilter<"Notification"> | string | null + createdAt?: DateTimeFilter<"Notification"> | Date | string + } + + export type UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminInput = { + where: UploadedFileWhereUniqueInput + update: XOR + create: XOR + } + + export type UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminInput = { + where: UploadedFileWhereUniqueInput + data: XOR + } + + export type UploadedFileUpdateManyWithWhereWithoutUploadedByAdminInput = { + where: UploadedFileScalarWhereInput + data: XOR + } + + export type UploadedFileScalarWhereInput = { + AND?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + OR?: UploadedFileScalarWhereInput[] + NOT?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + id?: StringFilter<"UploadedFile"> | string + url?: StringFilter<"UploadedFile"> | string + originalName?: StringFilter<"UploadedFile"> | string + mimeType?: StringFilter<"UploadedFile"> | string + sizeBytes?: IntFilter<"UploadedFile"> | number + purpose?: StringNullableFilter<"UploadedFile"> | string | null + uploadedByAdminId?: StringNullableFilter<"UploadedFile"> | string | null + createdAt?: DateTimeFilter<"UploadedFile"> | Date | string + } + + export type AdminSessionUpsertWithWhereUniqueWithoutAdminInput = { + where: AdminSessionWhereUniqueInput + update: XOR + create: XOR + } + + export type AdminSessionUpdateWithWhereUniqueWithoutAdminInput = { + where: AdminSessionWhereUniqueInput + data: XOR + } + + export type AdminSessionUpdateManyWithWhereWithoutAdminInput = { + where: AdminSessionScalarWhereInput + data: XOR + } + + export type AdminSessionScalarWhereInput = { + AND?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] + OR?: AdminSessionScalarWhereInput[] + NOT?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] + id?: StringFilter<"AdminSession"> | string + jti?: StringFilter<"AdminSession"> | string + adminId?: StringFilter<"AdminSession"> | string + iamSessionId?: StringNullableFilter<"AdminSession"> | string | null + iamSub?: StringNullableFilter<"AdminSession"> | string | null + ipAddress?: StringNullableFilter<"AdminSession"> | string | null + userAgent?: StringNullableFilter<"AdminSession"> | string | null + createdAt?: DateTimeFilter<"AdminSession"> | Date | string + expiresAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null + lastSeenAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null + revokedAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null + revokedReason?: StringNullableFilter<"AdminSession"> | string | null + } + export type UserTypeCreateWithoutAdminUsersInput = { id: number title: string isActive?: boolean createdAt?: Date | string permissions?: PermissionCreateNestedManyWithoutUserTypeInput + admins?: AdminCreateNestedManyWithoutUserTypeInput } export type UserTypeUncheckedCreateWithoutAdminUsersInput = { @@ -66639,6 +69001,7 @@ export namespace Prisma { isActive?: boolean createdAt?: Date | string permissions?: PermissionUncheckedCreateNestedManyWithoutUserTypeInput + admins?: AdminUncheckedCreateNestedManyWithoutUserTypeInput } export type UserTypeCreateOrConnectWithoutAdminUsersInput = { @@ -66653,6 +69016,7 @@ export namespace Prisma { phone?: string | null isActive?: boolean city?: CityCreateNestedOneWithoutBranchesInput + admins?: AdminCreateNestedManyWithoutBranchInput orders?: OrderCreateNestedManyWithoutBranchInput allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } @@ -66664,6 +69028,7 @@ export namespace Prisma { phone?: string | null isActive?: boolean cityId?: string | null + admins?: AdminUncheckedCreateNestedManyWithoutBranchInput orders?: OrderUncheckedCreateNestedManyWithoutBranchInput allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } @@ -66681,7 +69046,7 @@ export namespace Prisma { sizeBytes: number purpose?: string | null createdAt?: Date | string - uploadedByAdminUser?: AdminUserCreateNestedOneWithoutUploadedFilesInput + uploadedByAdmin?: AdminCreateNestedOneWithoutUploadedFilesInput customerAvatars?: CustomerCreateNestedManyWithoutAvatarFileInput } @@ -66692,7 +69057,7 @@ export namespace Prisma { mimeType: string sizeBytes: number purpose?: string | null - uploadedByAdminUserId?: string | null + uploadedByAdminId?: string | null createdAt?: Date | string customerAvatars?: CustomerUncheckedCreateNestedManyWithoutAvatarFileInput } @@ -66868,262 +69233,6 @@ export namespace Prisma { skipDuplicates?: boolean } - export type WorkshopCreateWithoutSupervisorInput = { - id?: string - name: string - address?: string | null - phone?: string | null - isActive?: boolean - preOrders?: PreOrderCreateNestedManyWithoutWorkshopInput - } - - export type WorkshopUncheckedCreateWithoutSupervisorInput = { - id?: string - name: string - address?: string | null - phone?: string | null - isActive?: boolean - preOrders?: PreOrderUncheckedCreateNestedManyWithoutWorkshopInput - } - - export type WorkshopCreateOrConnectWithoutSupervisorInput = { - where: WorkshopWhereUniqueInput - create: XOR - } - - export type WorkshopCreateManySupervisorInputEnvelope = { - data: WorkshopCreateManySupervisorInput | WorkshopCreateManySupervisorInput[] - skipDuplicates?: boolean - } - - export type BranchAllocationCreateWithoutAllocatorAdminUserInput = { - id?: string - note?: string | null - createdAt?: Date | string - branch: BranchCreateNestedOneWithoutAllocationsInput - items?: BranchAllocationItemCreateNestedManyWithoutAllocationInput - } - - export type BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput = { - id?: string - branchId: string - note?: string | null - createdAt?: Date | string - items?: BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput - } - - export type BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput = { - where: BranchAllocationWhereUniqueInput - create: XOR - } - - export type BranchAllocationCreateManyAllocatorAdminUserInputEnvelope = { - data: BranchAllocationCreateManyAllocatorAdminUserInput | BranchAllocationCreateManyAllocatorAdminUserInput[] - skipDuplicates?: boolean - } - - export type LedgerEntryCreateWithoutPostedByAdminUserInput = { - id?: string - currency: $Enums.LedgerCurrency - direction: $Enums.LedgerDirection - sourceType: $Enums.LedgerSourceType - amount: Decimal | DecimalJsLike | number | string - karatPerMille?: number | null - pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null - confirmed?: boolean - confirmedAt?: Date | string | null - labName?: string | null - hallmark?: string | null - accountName?: string | null - bankName?: string | null - transferTo?: string | null - originalValue?: Decimal | DecimalJsLike | number | string | null - priceRial?: Decimal | DecimalJsLike | number | string | null - receivedAt?: Date | string | null - note?: string | null - createdAt?: Date | string - customer: CustomerCreateNestedOneWithoutLedgerEntriesInput - order?: OrderCreateNestedOneWithoutLedgerEntriesInput - } - - export type LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput = { - id?: string - customerId: string - currency: $Enums.LedgerCurrency - direction: $Enums.LedgerDirection - sourceType: $Enums.LedgerSourceType - amount: Decimal | DecimalJsLike | number | string - karatPerMille?: number | null - pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null - orderId?: string | null - confirmed?: boolean - confirmedAt?: Date | string | null - labName?: string | null - hallmark?: string | null - accountName?: string | null - bankName?: string | null - transferTo?: string | null - originalValue?: Decimal | DecimalJsLike | number | string | null - priceRial?: Decimal | DecimalJsLike | number | string | null - receivedAt?: Date | string | null - note?: string | null - createdAt?: Date | string - } - - export type LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput = { - where: LedgerEntryWhereUniqueInput - create: XOR - } - - export type LedgerEntryCreateManyPostedByAdminUserInputEnvelope = { - data: LedgerEntryCreateManyPostedByAdminUserInput | LedgerEntryCreateManyPostedByAdminUserInput[] - skipDuplicates?: boolean - } - - export type OrderStatusEventCreateWithoutActorAdminUserInput = { - id?: string - fromStatus?: $Enums.OrderStatus | null - toStatus: $Enums.OrderStatus - note?: string | null - createdAt?: Date | string - order: OrderCreateNestedOneWithoutStatusEventsInput - } - - export type OrderStatusEventUncheckedCreateWithoutActorAdminUserInput = { - id?: string - orderId: string - fromStatus?: $Enums.OrderStatus | null - toStatus: $Enums.OrderStatus - note?: string | null - createdAt?: Date | string - } - - export type OrderStatusEventCreateOrConnectWithoutActorAdminUserInput = { - where: OrderStatusEventWhereUniqueInput - create: XOR - } - - export type OrderStatusEventCreateManyActorAdminUserInputEnvelope = { - data: OrderStatusEventCreateManyActorAdminUserInput | OrderStatusEventCreateManyActorAdminUserInput[] - skipDuplicates?: boolean - } - - export type PreOrderStatusEventCreateWithoutActorAdminUserInput = { - id?: string - changes: JsonNullValueInput | InputJsonValue - ipAddress?: string | null - createdAt?: Date | string - preOrder: PreOrderCreateNestedOneWithoutStatusEventsInput - } - - export type PreOrderStatusEventUncheckedCreateWithoutActorAdminUserInput = { - id?: string - preOrderId: string - changes: JsonNullValueInput | InputJsonValue - ipAddress?: string | null - createdAt?: Date | string - } - - export type PreOrderStatusEventCreateOrConnectWithoutActorAdminUserInput = { - where: PreOrderStatusEventWhereUniqueInput - create: XOR - } - - export type PreOrderStatusEventCreateManyActorAdminUserInputEnvelope = { - data: PreOrderStatusEventCreateManyActorAdminUserInput | PreOrderStatusEventCreateManyActorAdminUserInput[] - skipDuplicates?: boolean - } - - export type SmsMessageCreateWithoutSentByAdminUserInput = { - id?: string - audience: $Enums.MessageAudience - recipients?: string | null - body: string - sentCount?: number - createdAt?: Date | string - } - - export type SmsMessageUncheckedCreateWithoutSentByAdminUserInput = { - id?: string - audience: $Enums.MessageAudience - recipients?: string | null - body: string - sentCount?: number - createdAt?: Date | string - } - - export type SmsMessageCreateOrConnectWithoutSentByAdminUserInput = { - where: SmsMessageWhereUniqueInput - create: XOR - } - - export type SmsMessageCreateManySentByAdminUserInputEnvelope = { - data: SmsMessageCreateManySentByAdminUserInput | SmsMessageCreateManySentByAdminUserInput[] - skipDuplicates?: boolean - } - - export type NotificationCreateWithoutSentByAdminUserInput = { - id?: string - title: string - body: string - audience?: $Enums.MessageAudience - createdAt?: Date | string - recipients?: NotificationRecipientCreateNestedManyWithoutNotificationInput - } - - export type NotificationUncheckedCreateWithoutSentByAdminUserInput = { - id?: string - title: string - body: string - audience?: $Enums.MessageAudience - createdAt?: Date | string - recipients?: NotificationRecipientUncheckedCreateNestedManyWithoutNotificationInput - } - - export type NotificationCreateOrConnectWithoutSentByAdminUserInput = { - where: NotificationWhereUniqueInput - create: XOR - } - - export type NotificationCreateManySentByAdminUserInputEnvelope = { - data: NotificationCreateManySentByAdminUserInput | NotificationCreateManySentByAdminUserInput[] - skipDuplicates?: boolean - } - - export type UploadedFileCreateWithoutUploadedByAdminUserInput = { - id?: string - url: string - originalName: string - mimeType: string - sizeBytes: number - purpose?: string | null - createdAt?: Date | string - customerAvatars?: CustomerCreateNestedManyWithoutAvatarFileInput - adminUserAvatars?: AdminUserCreateNestedManyWithoutAvatarFileInput - } - - export type UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput = { - id?: string - url: string - originalName: string - mimeType: string - sizeBytes: number - purpose?: string | null - createdAt?: Date | string - customerAvatars?: CustomerUncheckedCreateNestedManyWithoutAvatarFileInput - adminUserAvatars?: AdminUserUncheckedCreateNestedManyWithoutAvatarFileInput - } - - export type UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput = { - where: UploadedFileWhereUniqueInput - create: XOR - } - - export type UploadedFileCreateManyUploadedByAdminUserInputEnvelope = { - data: UploadedFileCreateManyUploadedByAdminUserInput | UploadedFileCreateManyUploadedByAdminUserInput[] - skipDuplicates?: boolean - } - export type SalesExpertProfileCreateWithoutAdminUserInput = { id?: string gramLevel?: Decimal | DecimalJsLike | number | string @@ -67151,44 +69260,6 @@ export namespace Prisma { create: XOR } - export type AdminSessionCreateWithoutAdminUserInput = { - id?: string - jti: string - iamSessionId?: string | null - iamSub?: string | null - ipAddress?: string | null - userAgent?: string | null - createdAt?: Date | string - expiresAt?: Date | string | null - lastSeenAt?: Date | string | null - revokedAt?: Date | string | null - revokedReason?: string | null - } - - export type AdminSessionUncheckedCreateWithoutAdminUserInput = { - id?: string - jti: string - iamSessionId?: string | null - iamSub?: string | null - ipAddress?: string | null - userAgent?: string | null - createdAt?: Date | string - expiresAt?: Date | string | null - lastSeenAt?: Date | string | null - revokedAt?: Date | string | null - revokedReason?: string | null - } - - export type AdminSessionCreateOrConnectWithoutAdminUserInput = { - where: AdminSessionWhereUniqueInput - create: XOR - } - - export type AdminSessionCreateManyAdminUserInputEnvelope = { - data: AdminSessionCreateManyAdminUserInput | AdminSessionCreateManyAdminUserInput[] - skipDuplicates?: boolean - } - export type UserTypeUpsertWithoutAdminUsersInput = { update: XOR create: XOR @@ -67206,6 +69277,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string permissions?: PermissionUpdateManyWithoutUserTypeNestedInput + admins?: AdminUpdateManyWithoutUserTypeNestedInput } export type UserTypeUncheckedUpdateWithoutAdminUsersInput = { @@ -67214,6 +69286,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string permissions?: PermissionUncheckedUpdateManyWithoutUserTypeNestedInput + admins?: AdminUncheckedUpdateManyWithoutUserTypeNestedInput } export type BranchUpsertWithoutAdminUsersInput = { @@ -67234,6 +69307,7 @@ export namespace Prisma { phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean city?: CityUpdateOneWithoutBranchesNestedInput + admins?: AdminUpdateManyWithoutBranchNestedInput orders?: OrderUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } @@ -67245,6 +69319,7 @@ export namespace Prisma { phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null + admins?: AdminUncheckedUpdateManyWithoutBranchNestedInput orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } @@ -67268,7 +69343,7 @@ export namespace Prisma { sizeBytes?: IntFieldUpdateOperationsInput | number purpose?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - uploadedByAdminUser?: AdminUserUpdateOneWithoutUploadedFilesNestedInput + uploadedByAdmin?: AdminUpdateOneWithoutUploadedFilesNestedInput customerAvatars?: CustomerUpdateManyWithoutAvatarFileNestedInput } @@ -67279,7 +69354,7 @@ export namespace Prisma { mimeType?: StringFieldUpdateOperationsInput | string sizeBytes?: IntFieldUpdateOperationsInput | number purpose?: NullableStringFieldUpdateOperationsInput | string | null - uploadedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + uploadedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string customerAvatars?: CustomerUncheckedUpdateManyWithoutAvatarFileNestedInput } @@ -67337,249 +69412,6 @@ export namespace Prisma { updatedAt?: DateTimeFilter<"Order"> | Date | string } - export type WorkshopUpsertWithWhereUniqueWithoutSupervisorInput = { - where: WorkshopWhereUniqueInput - update: XOR - create: XOR - } - - export type WorkshopUpdateWithWhereUniqueWithoutSupervisorInput = { - where: WorkshopWhereUniqueInput - data: XOR - } - - export type WorkshopUpdateManyWithWhereWithoutSupervisorInput = { - where: WorkshopScalarWhereInput - data: XOR - } - - export type WorkshopScalarWhereInput = { - AND?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] - OR?: WorkshopScalarWhereInput[] - NOT?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] - id?: StringFilter<"Workshop"> | string - name?: StringFilter<"Workshop"> | string - address?: StringNullableFilter<"Workshop"> | string | null - phone?: StringNullableFilter<"Workshop"> | string | null - supervisorId?: StringNullableFilter<"Workshop"> | string | null - isActive?: BoolFilter<"Workshop"> | boolean - } - - export type BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput = { - where: BranchAllocationWhereUniqueInput - update: XOR - create: XOR - } - - export type BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput = { - where: BranchAllocationWhereUniqueInput - data: XOR - } - - export type BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput = { - where: BranchAllocationScalarWhereInput - data: XOR - } - - export type BranchAllocationScalarWhereInput = { - AND?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] - OR?: BranchAllocationScalarWhereInput[] - NOT?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] - id?: StringFilter<"BranchAllocation"> | string - branchId?: StringFilter<"BranchAllocation"> | string - allocatorAdminUserId?: StringNullableFilter<"BranchAllocation"> | string | null - note?: StringNullableFilter<"BranchAllocation"> | string | null - createdAt?: DateTimeFilter<"BranchAllocation"> | Date | string - } - - export type LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminUserInput = { - where: LedgerEntryWhereUniqueInput - update: XOR - create: XOR - } - - export type LedgerEntryUpdateWithWhereUniqueWithoutPostedByAdminUserInput = { - where: LedgerEntryWhereUniqueInput - data: XOR - } - - export type LedgerEntryUpdateManyWithWhereWithoutPostedByAdminUserInput = { - where: LedgerEntryScalarWhereInput - data: XOR - } - - export type LedgerEntryScalarWhereInput = { - AND?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] - OR?: LedgerEntryScalarWhereInput[] - NOT?: LedgerEntryScalarWhereInput | LedgerEntryScalarWhereInput[] - id?: StringFilter<"LedgerEntry"> | string - customerId?: StringFilter<"LedgerEntry"> | string - currency?: EnumLedgerCurrencyFilter<"LedgerEntry"> | $Enums.LedgerCurrency - direction?: EnumLedgerDirectionFilter<"LedgerEntry"> | $Enums.LedgerDirection - sourceType?: EnumLedgerSourceTypeFilter<"LedgerEntry"> | $Enums.LedgerSourceType - amount?: DecimalFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string - karatPerMille?: IntNullableFilter<"LedgerEntry"> | number | null - pricePerGramRialAtEntry?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null - orderId?: StringNullableFilter<"LedgerEntry"> | string | null - confirmed?: BoolFilter<"LedgerEntry"> | boolean - confirmedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null - postedByAdminUserId?: StringNullableFilter<"LedgerEntry"> | string | null - labName?: StringNullableFilter<"LedgerEntry"> | string | null - hallmark?: StringNullableFilter<"LedgerEntry"> | string | null - accountName?: StringNullableFilter<"LedgerEntry"> | string | null - bankName?: StringNullableFilter<"LedgerEntry"> | string | null - transferTo?: StringNullableFilter<"LedgerEntry"> | string | null - originalValue?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null - priceRial?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null - receivedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null - note?: StringNullableFilter<"LedgerEntry"> | string | null - createdAt?: DateTimeFilter<"LedgerEntry"> | Date | string - } - - export type OrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput = { - where: OrderStatusEventWhereUniqueInput - update: XOR - create: XOR - } - - export type OrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput = { - where: OrderStatusEventWhereUniqueInput - data: XOR - } - - export type OrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput = { - where: OrderStatusEventScalarWhereInput - data: XOR - } - - export type OrderStatusEventScalarWhereInput = { - AND?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] - OR?: OrderStatusEventScalarWhereInput[] - NOT?: OrderStatusEventScalarWhereInput | OrderStatusEventScalarWhereInput[] - id?: StringFilter<"OrderStatusEvent"> | string - orderId?: StringFilter<"OrderStatusEvent"> | string - fromStatus?: EnumOrderStatusNullableFilter<"OrderStatusEvent"> | $Enums.OrderStatus | null - toStatus?: EnumOrderStatusFilter<"OrderStatusEvent"> | $Enums.OrderStatus - note?: StringNullableFilter<"OrderStatusEvent"> | string | null - actorAdminUserId?: StringNullableFilter<"OrderStatusEvent"> | string | null - createdAt?: DateTimeFilter<"OrderStatusEvent"> | Date | string - } - - export type PreOrderStatusEventUpsertWithWhereUniqueWithoutActorAdminUserInput = { - where: PreOrderStatusEventWhereUniqueInput - update: XOR - create: XOR - } - - export type PreOrderStatusEventUpdateWithWhereUniqueWithoutActorAdminUserInput = { - where: PreOrderStatusEventWhereUniqueInput - data: XOR - } - - export type PreOrderStatusEventUpdateManyWithWhereWithoutActorAdminUserInput = { - where: PreOrderStatusEventScalarWhereInput - data: XOR - } - - export type PreOrderStatusEventScalarWhereInput = { - AND?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] - OR?: PreOrderStatusEventScalarWhereInput[] - NOT?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] - id?: StringFilter<"PreOrderStatusEvent"> | string - preOrderId?: StringFilter<"PreOrderStatusEvent"> | string - changes?: JsonFilter<"PreOrderStatusEvent"> - actorAdminUserId?: StringNullableFilter<"PreOrderStatusEvent"> | string | null - ipAddress?: StringNullableFilter<"PreOrderStatusEvent"> | string | null - createdAt?: DateTimeFilter<"PreOrderStatusEvent"> | Date | string - } - - export type SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput = { - where: SmsMessageWhereUniqueInput - update: XOR - create: XOR - } - - export type SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput = { - where: SmsMessageWhereUniqueInput - data: XOR - } - - export type SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput = { - where: SmsMessageScalarWhereInput - data: XOR - } - - export type SmsMessageScalarWhereInput = { - AND?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] - OR?: SmsMessageScalarWhereInput[] - NOT?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] - id?: StringFilter<"SmsMessage"> | string - audience?: EnumMessageAudienceFilter<"SmsMessage"> | $Enums.MessageAudience - recipients?: StringNullableFilter<"SmsMessage"> | string | null - body?: StringFilter<"SmsMessage"> | string - sentCount?: IntFilter<"SmsMessage"> | number - sentByAdminUserId?: StringNullableFilter<"SmsMessage"> | string | null - createdAt?: DateTimeFilter<"SmsMessage"> | Date | string - } - - export type NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput = { - where: NotificationWhereUniqueInput - update: XOR - create: XOR - } - - export type NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput = { - where: NotificationWhereUniqueInput - data: XOR - } - - export type NotificationUpdateManyWithWhereWithoutSentByAdminUserInput = { - where: NotificationScalarWhereInput - data: XOR - } - - export type NotificationScalarWhereInput = { - AND?: NotificationScalarWhereInput | NotificationScalarWhereInput[] - OR?: NotificationScalarWhereInput[] - NOT?: NotificationScalarWhereInput | NotificationScalarWhereInput[] - id?: StringFilter<"Notification"> | string - title?: StringFilter<"Notification"> | string - body?: StringFilter<"Notification"> | string - audience?: EnumMessageAudienceFilter<"Notification"> | $Enums.MessageAudience - sentByAdminUserId?: StringNullableFilter<"Notification"> | string | null - createdAt?: DateTimeFilter<"Notification"> | Date | string - } - - export type UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput = { - where: UploadedFileWhereUniqueInput - update: XOR - create: XOR - } - - export type UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput = { - where: UploadedFileWhereUniqueInput - data: XOR - } - - export type UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput = { - where: UploadedFileScalarWhereInput - data: XOR - } - - export type UploadedFileScalarWhereInput = { - AND?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] - OR?: UploadedFileScalarWhereInput[] - NOT?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] - id?: StringFilter<"UploadedFile"> | string - url?: StringFilter<"UploadedFile"> | string - originalName?: StringFilter<"UploadedFile"> | string - mimeType?: StringFilter<"UploadedFile"> | string - sizeBytes?: IntFilter<"UploadedFile"> | number - purpose?: StringNullableFilter<"UploadedFile"> | string | null - uploadedByAdminUserId?: StringNullableFilter<"UploadedFile"> | string | null - createdAt?: DateTimeFilter<"UploadedFile"> | Date | string - } - export type SalesExpertProfileUpsertWithoutAdminUserInput = { update: XOR create: XOR @@ -67613,41 +69445,7 @@ export namespace Prisma { updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } - export type AdminSessionUpsertWithWhereUniqueWithoutAdminUserInput = { - where: AdminSessionWhereUniqueInput - update: XOR - create: XOR - } - - export type AdminSessionUpdateWithWhereUniqueWithoutAdminUserInput = { - where: AdminSessionWhereUniqueInput - data: XOR - } - - export type AdminSessionUpdateManyWithWhereWithoutAdminUserInput = { - where: AdminSessionScalarWhereInput - data: XOR - } - - export type AdminSessionScalarWhereInput = { - AND?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] - OR?: AdminSessionScalarWhereInput[] - NOT?: AdminSessionScalarWhereInput | AdminSessionScalarWhereInput[] - id?: StringFilter<"AdminSession"> | string - jti?: StringFilter<"AdminSession"> | string - adminUserId?: StringFilter<"AdminSession"> | string - iamSessionId?: StringNullableFilter<"AdminSession"> | string | null - iamSub?: StringNullableFilter<"AdminSession"> | string | null - ipAddress?: StringNullableFilter<"AdminSession"> | string | null - userAgent?: StringNullableFilter<"AdminSession"> | string | null - createdAt?: DateTimeFilter<"AdminSession"> | Date | string - expiresAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null - lastSeenAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null - revokedAt?: DateTimeNullableFilter<"AdminSession"> | Date | string | null - revokedReason?: StringNullableFilter<"AdminSession"> | string | null - } - - export type AdminUserCreateWithoutSessionsInput = { + export type AdminCreateWithoutSessionsInput = { id?: string fullName: string firstName?: string | null @@ -67655,30 +69453,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput } - export type AdminUserUncheckedCreateWithoutSessionsInput = { + export type AdminUncheckedCreateWithoutSessionsInput = { id?: string fullName: string firstName?: string | null @@ -67688,44 +69477,35 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput } - export type AdminUserCreateOrConnectWithoutSessionsInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutSessionsInput = { + where: AdminWhereUniqueInput + create: XOR } - export type AdminUserUpsertWithoutSessionsInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutSessionsInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutSessionsInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutSessionsInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutSessionsInput = { + export type AdminUpdateWithoutSessionsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -67733,30 +69513,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutSessionsInput = { + export type AdminUncheckedUpdateWithoutSessionsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -67766,25 +69537,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput } export type AdminUserCreateWithoutSalesExpertProfileInput = { @@ -67807,15 +69569,6 @@ export namespace Prisma { avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput } export type AdminUserUncheckedCreateWithoutSalesExpertProfileInput = { @@ -67838,15 +69591,6 @@ export namespace Prisma { memberCode?: string | null referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput } export type AdminUserCreateOrConnectWithoutSalesExpertProfileInput = { @@ -68025,15 +69769,6 @@ export namespace Prisma { avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutSalesExpertProfileInput = { @@ -68056,15 +69791,6 @@ export namespace Prisma { memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput } export type CityUpsertWithoutSalesExpertProfilesInput = { @@ -68269,16 +69995,7 @@ export namespace Prisma { branch?: BranchCreateNestedOneWithoutAdminUsersInput avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput } export type AdminUserUncheckedCreateWithoutReferredCustomersInput = { @@ -68300,16 +70017,7 @@ export namespace Prisma { pasazhName?: string | null memberCode?: string | null creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput } export type AdminUserCreateOrConnectWithoutReferredCustomersInput = { @@ -68404,7 +70112,7 @@ export namespace Prisma { sizeBytes: number purpose?: string | null createdAt?: Date | string - uploadedByAdminUser?: AdminUserCreateNestedOneWithoutUploadedFilesInput + uploadedByAdmin?: AdminCreateNestedOneWithoutUploadedFilesInput adminUserAvatars?: AdminUserCreateNestedManyWithoutAvatarFileInput } @@ -68415,7 +70123,7 @@ export namespace Prisma { mimeType: string sizeBytes: number purpose?: string | null - uploadedByAdminUserId?: string | null + uploadedByAdminId?: string | null createdAt?: Date | string adminUserAvatars?: AdminUserUncheckedCreateNestedManyWithoutAvatarFileInput } @@ -68570,7 +70278,7 @@ export namespace Prisma { note?: string | null createdAt?: Date | string order?: OrderCreateNestedOneWithoutLedgerEntriesInput - postedByAdminUser?: AdminUserCreateNestedOneWithoutPostedLedgerEntriesInput + postedByAdmin?: AdminCreateNestedOneWithoutPostedLedgerEntriesInput } export type LedgerEntryUncheckedCreateWithoutCustomerInput = { @@ -68584,7 +70292,7 @@ export namespace Prisma { orderId?: string | null confirmed?: boolean confirmedAt?: Date | string | null - postedByAdminUserId?: string | null + postedByAdminId?: string | null labName?: string | null hallmark?: string | null accountName?: string | null @@ -68880,16 +70588,7 @@ export namespace Prisma { branch?: BranchUpdateOneWithoutAdminUsersNestedInput avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutReferredCustomersInput = { @@ -68911,16 +70610,7 @@ export namespace Prisma { pasazhName?: NullableStringFieldUpdateOperationsInput | string | null memberCode?: NullableStringFieldUpdateOperationsInput | string | null creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput } export type SalesExpertProfileUpsertWithoutTradingCustomerInput = { @@ -68991,7 +70681,7 @@ export namespace Prisma { sizeBytes?: IntFieldUpdateOperationsInput | number purpose?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - uploadedByAdminUser?: AdminUserUpdateOneWithoutUploadedFilesNestedInput + uploadedByAdmin?: AdminUpdateOneWithoutUploadedFilesNestedInput adminUserAvatars?: AdminUserUpdateManyWithoutAvatarFileNestedInput } @@ -69002,7 +70692,7 @@ export namespace Prisma { mimeType?: StringFieldUpdateOperationsInput | string sizeBytes?: IntFieldUpdateOperationsInput | number purpose?: NullableStringFieldUpdateOperationsInput | string | null - uploadedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + uploadedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string adminUserAvatars?: AdminUserUncheckedUpdateManyWithoutAvatarFileNestedInput } @@ -69944,16 +71634,7 @@ export namespace Prisma { avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput } export type AdminUserUncheckedCreateWithoutBranchInput = { @@ -69975,16 +71656,7 @@ export namespace Prisma { memberCode?: string | null referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput } export type AdminUserCreateOrConnectWithoutBranchInput = { @@ -69997,6 +71669,60 @@ export namespace Prisma { skipDuplicates?: boolean } + export type AdminCreateWithoutBranchInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + isActive?: boolean + createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminsInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput + } + + export type AdminUncheckedCreateWithoutBranchInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + isActive?: boolean + createdAt?: Date | string + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput + } + + export type AdminCreateOrConnectWithoutBranchInput = { + where: AdminWhereUniqueInput + create: XOR + } + + export type AdminCreateManyBranchInputEnvelope = { + data: AdminCreateManyBranchInput | AdminCreateManyBranchInput[] + skipDuplicates?: boolean + } + export type OrderCreateWithoutBranchInput = { id?: string orderNumber: string @@ -70053,13 +71779,13 @@ export namespace Prisma { id?: string note?: string | null createdAt?: Date | string - allocatorAdminUser?: AdminUserCreateNestedOneWithoutBranchAllocationsInput + allocatorAdmin?: AdminCreateNestedOneWithoutBranchAllocationsInput items?: BranchAllocationItemCreateNestedManyWithoutAllocationInput } export type BranchAllocationUncheckedCreateWithoutBranchInput = { id?: string - allocatorAdminUserId?: string | null + allocatorAdminId?: string | null note?: string | null createdAt?: Date | string items?: BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput @@ -70151,6 +71877,39 @@ export namespace Prisma { memberCode?: StringNullableFilter<"AdminUser"> | string | null } + export type AdminUpsertWithWhereUniqueWithoutBranchInput = { + where: AdminWhereUniqueInput + update: XOR + create: XOR + } + + export type AdminUpdateWithWhereUniqueWithoutBranchInput = { + where: AdminWhereUniqueInput + data: XOR + } + + export type AdminUpdateManyWithWhereWithoutBranchInput = { + where: AdminScalarWhereInput + data: XOR + } + + export type AdminScalarWhereInput = { + AND?: AdminScalarWhereInput | AdminScalarWhereInput[] + OR?: AdminScalarWhereInput[] + NOT?: AdminScalarWhereInput | AdminScalarWhereInput[] + id?: StringFilter<"Admin"> | string + fullName?: StringFilter<"Admin"> | string + firstName?: StringNullableFilter<"Admin"> | string | null + lastName?: StringNullableFilter<"Admin"> | string | null + mobile?: StringFilter<"Admin"> | string + passwordHash?: StringFilter<"Admin"> | string + role?: EnumAdminRoleFilter<"Admin"> | $Enums.AdminRole + userTypeId?: IntNullableFilter<"Admin"> | number | null + branchId?: StringNullableFilter<"Admin"> | string | null + isActive?: BoolFilter<"Admin"> | boolean + createdAt?: DateTimeFilter<"Admin"> | Date | string + } + export type OrderUpsertWithWhereUniqueWithoutBranchInput = { where: OrderWhereUniqueInput update: XOR @@ -70183,7 +71942,7 @@ export namespace Prisma { data: XOR } - export type AdminUserCreateWithoutSupervisedWorkshopsInput = { + export type AdminCreateWithoutSupervisedWorkshopsInput = { id?: string fullName: string firstName?: string | null @@ -70191,30 +71950,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutSupervisedWorkshopsInput = { + export type AdminUncheckedCreateWithoutSupervisedWorkshopsInput = { id?: string fullName: string firstName?: string | null @@ -70224,30 +71974,21 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutSupervisedWorkshopsInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutSupervisedWorkshopsInput = { + where: AdminWhereUniqueInput + create: XOR } export type PreOrderCreateWithoutWorkshopInput = { @@ -70298,18 +72039,18 @@ export namespace Prisma { skipDuplicates?: boolean } - export type AdminUserUpsertWithoutSupervisedWorkshopsInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutSupervisedWorkshopsInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutSupervisedWorkshopsInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutSupervisedWorkshopsInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutSupervisedWorkshopsInput = { + export type AdminUpdateWithoutSupervisedWorkshopsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -70317,30 +72058,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutSupervisedWorkshopsInput = { + export type AdminUncheckedUpdateWithoutSupervisedWorkshopsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -70350,25 +72082,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } export type PreOrderUpsertWithWhereUniqueWithoutWorkshopInput = { @@ -71942,6 +73665,7 @@ export namespace Prisma { isActive?: boolean city?: CityCreateNestedOneWithoutBranchesInput adminUsers?: AdminUserCreateNestedManyWithoutBranchInput + admins?: AdminCreateNestedManyWithoutBranchInput allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } @@ -71953,6 +73677,7 @@ export namespace Prisma { isActive?: boolean cityId?: string | null adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput + admins?: AdminUncheckedCreateNestedManyWithoutBranchInput allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } @@ -71980,16 +73705,7 @@ export namespace Prisma { branch?: BranchCreateNestedOneWithoutAdminUsersInput avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput } export type AdminUserUncheckedCreateWithoutCreditedOrdersInput = { @@ -72011,16 +73727,7 @@ export namespace Prisma { pasazhName?: string | null memberCode?: string | null referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput } export type AdminUserCreateOrConnectWithoutCreditedOrdersInput = { @@ -72175,7 +73882,7 @@ export namespace Prisma { toStatus: $Enums.OrderStatus note?: string | null createdAt?: Date | string - actorAdminUser?: AdminUserCreateNestedOneWithoutOrderStatusEventsInput + actorAdmin?: AdminCreateNestedOneWithoutOrderStatusEventsInput } export type OrderStatusEventUncheckedCreateWithoutOrderInput = { @@ -72183,7 +73890,7 @@ export namespace Prisma { fromStatus?: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus note?: string | null - actorAdminUserId?: string | null + actorAdminId?: string | null createdAt?: Date | string } @@ -72218,7 +73925,7 @@ export namespace Prisma { note?: string | null createdAt?: Date | string customer: CustomerCreateNestedOneWithoutLedgerEntriesInput - postedByAdminUser?: AdminUserCreateNestedOneWithoutPostedLedgerEntriesInput + postedByAdmin?: AdminCreateNestedOneWithoutPostedLedgerEntriesInput } export type LedgerEntryUncheckedCreateWithoutOrderInput = { @@ -72232,7 +73939,7 @@ export namespace Prisma { pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null confirmed?: boolean confirmedAt?: Date | string | null - postedByAdminUserId?: string | null + postedByAdminId?: string | null labName?: string | null hallmark?: string | null accountName?: string | null @@ -72432,6 +74139,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean city?: CityUpdateOneWithoutBranchesNestedInput adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput + admins?: AdminUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } @@ -72443,6 +74151,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput + admins?: AdminUncheckedUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } @@ -72476,16 +74185,7 @@ export namespace Prisma { branch?: BranchUpdateOneWithoutAdminUsersNestedInput avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutCreditedOrdersInput = { @@ -72507,16 +74207,7 @@ export namespace Prisma { pasazhName?: NullableStringFieldUpdateOperationsInput | string | null memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput } export type CustomerUpsertWithoutReferredOrdersInput = { @@ -72962,7 +74653,7 @@ export namespace Prisma { create: XOR } - export type AdminUserCreateWithoutOrderStatusEventsInput = { + export type AdminCreateWithoutOrderStatusEventsInput = { id?: string fullName: string firstName?: string | null @@ -72970,30 +74661,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutOrderStatusEventsInput = { + export type AdminUncheckedCreateWithoutOrderStatusEventsInput = { id?: string fullName: string firstName?: string | null @@ -73003,30 +74685,21 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutOrderStatusEventsInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutOrderStatusEventsInput = { + where: AdminWhereUniqueInput + create: XOR } export type OrderUpsertWithoutStatusEventsInput = { @@ -73082,18 +74755,18 @@ export namespace Prisma { convertedFromPreOrder?: PreOrderUncheckedUpdateOneWithoutConvertedOrderNestedInput } - export type AdminUserUpsertWithoutOrderStatusEventsInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutOrderStatusEventsInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutOrderStatusEventsInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutOrderStatusEventsInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutOrderStatusEventsInput = { + export type AdminUpdateWithoutOrderStatusEventsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -73101,30 +74774,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutOrderStatusEventsInput = { + export type AdminUncheckedUpdateWithoutOrderStatusEventsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -73134,25 +74798,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } export type CustomerCreateWithoutPreOrdersInput = { @@ -73301,7 +74956,7 @@ export namespace Prisma { address?: string | null phone?: string | null isActive?: boolean - supervisor?: AdminUserCreateNestedOneWithoutSupervisedWorkshopsInput + supervisor?: AdminCreateNestedOneWithoutSupervisedWorkshopsInput } export type WorkshopUncheckedCreateWithoutPreOrdersInput = { @@ -73370,13 +75025,13 @@ export namespace Prisma { changes: JsonNullValueInput | InputJsonValue ipAddress?: string | null createdAt?: Date | string - actorAdminUser?: AdminUserCreateNestedOneWithoutPreOrderStatusEventsInput + actorAdmin?: AdminCreateNestedOneWithoutPreOrderStatusEventsInput } export type PreOrderStatusEventUncheckedCreateWithoutPreOrderInput = { id?: string changes: JsonNullValueInput | InputJsonValue - actorAdminUserId?: string | null + actorAdminId?: string | null ipAddress?: string | null createdAt?: Date | string } @@ -73560,7 +75215,7 @@ export namespace Prisma { address?: NullableStringFieldUpdateOperationsInput | string | null phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean - supervisor?: AdminUserUpdateOneWithoutSupervisedWorkshopsNestedInput + supervisor?: AdminUpdateOneWithoutSupervisedWorkshopsNestedInput } export type WorkshopUncheckedUpdateWithoutPreOrdersInput = { @@ -73684,7 +75339,7 @@ export namespace Prisma { create: XOR } - export type AdminUserCreateWithoutPreOrderStatusEventsInput = { + export type AdminCreateWithoutPreOrderStatusEventsInput = { id?: string fullName: string firstName?: string | null @@ -73692,30 +75347,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutPreOrderStatusEventsInput = { + export type AdminUncheckedCreateWithoutPreOrderStatusEventsInput = { id?: string fullName: string firstName?: string | null @@ -73725,30 +75371,21 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutPreOrderStatusEventsInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutPreOrderStatusEventsInput = { + where: AdminWhereUniqueInput + create: XOR } export type PreOrderUpsertWithoutStatusEventsInput = { @@ -73800,18 +75437,18 @@ export namespace Prisma { updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } - export type AdminUserUpsertWithoutPreOrderStatusEventsInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutPreOrderStatusEventsInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutPreOrderStatusEventsInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutPreOrderStatusEventsInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutPreOrderStatusEventsInput = { + export type AdminUpdateWithoutPreOrderStatusEventsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -73819,30 +75456,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutPreOrderStatusEventsInput = { + export type AdminUncheckedUpdateWithoutPreOrderStatusEventsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -73852,25 +75480,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } export type CustomerCreateWithoutLedgerEntriesInput = { @@ -74029,7 +75648,7 @@ export namespace Prisma { create: XOR } - export type AdminUserCreateWithoutPostedLedgerEntriesInput = { + export type AdminCreateWithoutPostedLedgerEntriesInput = { id?: string fullName: string firstName?: string | null @@ -74037,30 +75656,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutPostedLedgerEntriesInput = { + export type AdminUncheckedCreateWithoutPostedLedgerEntriesInput = { id?: string fullName: string firstName?: string | null @@ -74070,30 +75680,21 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutPostedLedgerEntriesInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutPostedLedgerEntriesInput = { + where: AdminWhereUniqueInput + create: XOR } export type CustomerUpsertWithoutLedgerEntriesInput = { @@ -74264,18 +75865,18 @@ export namespace Prisma { convertedFromPreOrder?: PreOrderUncheckedUpdateOneWithoutConvertedOrderNestedInput } - export type AdminUserUpsertWithoutPostedLedgerEntriesInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutPostedLedgerEntriesInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutPostedLedgerEntriesInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutPostedLedgerEntriesInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutPostedLedgerEntriesInput = { + export type AdminUpdateWithoutPostedLedgerEntriesInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -74283,30 +75884,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutPostedLedgerEntriesInput = { + export type AdminUncheckedUpdateWithoutPostedLedgerEntriesInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -74316,25 +75908,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } export type CustomerCreateWithoutWalletBonusesInput = { @@ -74598,16 +76181,7 @@ export namespace Prisma { avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput } export type AdminUserUncheckedCreateWithoutUserTypeInput = { @@ -74629,16 +76203,7 @@ export namespace Prisma { memberCode?: string | null referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput } export type AdminUserCreateOrConnectWithoutUserTypeInput = { @@ -74651,6 +76216,60 @@ export namespace Prisma { skipDuplicates?: boolean } + export type AdminCreateWithoutUserTypeInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + isActive?: boolean + createdAt?: Date | string + branch?: BranchCreateNestedOneWithoutAdminsInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput + } + + export type AdminUncheckedCreateWithoutUserTypeInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + branchId?: string | null + isActive?: boolean + createdAt?: Date | string + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput + } + + export type AdminCreateOrConnectWithoutUserTypeInput = { + where: AdminWhereUniqueInput + create: XOR + } + + export type AdminCreateManyUserTypeInputEnvelope = { + data: AdminCreateManyUserTypeInput | AdminCreateManyUserTypeInput[] + skipDuplicates?: boolean + } + export type PermissionUpsertWithWhereUniqueWithoutUserTypeInput = { where: PermissionWhereUniqueInput update: XOR @@ -74691,12 +76310,29 @@ export namespace Prisma { data: XOR } + export type AdminUpsertWithWhereUniqueWithoutUserTypeInput = { + where: AdminWhereUniqueInput + update: XOR + create: XOR + } + + export type AdminUpdateWithWhereUniqueWithoutUserTypeInput = { + where: AdminWhereUniqueInput + data: XOR + } + + export type AdminUpdateManyWithWhereWithoutUserTypeInput = { + where: AdminScalarWhereInput + data: XOR + } + export type UserTypeCreateWithoutPermissionsInput = { id: number title: string isActive?: boolean createdAt?: Date | string adminUsers?: AdminUserCreateNestedManyWithoutUserTypeInput + admins?: AdminCreateNestedManyWithoutUserTypeInput } export type UserTypeUncheckedCreateWithoutPermissionsInput = { @@ -74705,6 +76341,7 @@ export namespace Prisma { isActive?: boolean createdAt?: Date | string adminUsers?: AdminUserUncheckedCreateNestedManyWithoutUserTypeInput + admins?: AdminUncheckedCreateNestedManyWithoutUserTypeInput } export type UserTypeCreateOrConnectWithoutPermissionsInput = { @@ -74729,6 +76366,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string adminUsers?: AdminUserUpdateManyWithoutUserTypeNestedInput + admins?: AdminUpdateManyWithoutUserTypeNestedInput } export type UserTypeUncheckedUpdateWithoutPermissionsInput = { @@ -74737,6 +76375,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string adminUsers?: AdminUserUncheckedUpdateManyWithoutUserTypeNestedInput + admins?: AdminUncheckedUpdateManyWithoutUserTypeNestedInput } export type ProductCreateWithoutCommentsInput = { @@ -75611,6 +77250,7 @@ export namespace Prisma { isActive?: boolean city?: CityCreateNestedOneWithoutBranchesInput adminUsers?: AdminUserCreateNestedManyWithoutBranchInput + admins?: AdminCreateNestedManyWithoutBranchInput orders?: OrderCreateNestedManyWithoutBranchInput } @@ -75622,6 +77262,7 @@ export namespace Prisma { isActive?: boolean cityId?: string | null adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput + admins?: AdminUncheckedCreateNestedManyWithoutBranchInput orders?: OrderUncheckedCreateNestedManyWithoutBranchInput } @@ -75630,7 +77271,7 @@ export namespace Prisma { create: XOR } - export type AdminUserCreateWithoutBranchAllocationsInput = { + export type AdminCreateWithoutBranchAllocationsInput = { id?: string fullName: string firstName?: string | null @@ -75638,30 +77279,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutBranchAllocationsInput = { + export type AdminUncheckedCreateWithoutBranchAllocationsInput = { id?: string fullName: string firstName?: string | null @@ -75671,30 +77303,21 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutBranchAllocationsInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutBranchAllocationsInput = { + where: AdminWhereUniqueInput + create: XOR } export type BranchAllocationItemCreateWithoutAllocationInput = { @@ -75738,6 +77361,7 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean city?: CityUpdateOneWithoutBranchesNestedInput adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput + admins?: AdminUpdateManyWithoutBranchNestedInput orders?: OrderUpdateManyWithoutBranchNestedInput } @@ -75749,21 +77373,22 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput + admins?: AdminUncheckedUpdateManyWithoutBranchNestedInput orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput } - export type AdminUserUpsertWithoutBranchAllocationsInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutBranchAllocationsInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutBranchAllocationsInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutBranchAllocationsInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutBranchAllocationsInput = { + export type AdminUpdateWithoutBranchAllocationsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -75771,30 +77396,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutBranchAllocationsInput = { + export type AdminUncheckedUpdateWithoutBranchAllocationsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -75804,25 +77420,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } export type BranchAllocationItemUpsertWithWhereUniqueWithoutAllocationInput = { @@ -75846,13 +77453,13 @@ export namespace Prisma { note?: string | null createdAt?: Date | string branch: BranchCreateNestedOneWithoutAllocationsInput - allocatorAdminUser?: AdminUserCreateNestedOneWithoutBranchAllocationsInput + allocatorAdmin?: AdminCreateNestedOneWithoutBranchAllocationsInput } export type BranchAllocationUncheckedCreateWithoutItemsInput = { id?: string branchId: string - allocatorAdminUserId?: string | null + allocatorAdminId?: string | null note?: string | null createdAt?: Date | string } @@ -75925,13 +77532,13 @@ export namespace Prisma { note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string branch?: BranchUpdateOneRequiredWithoutAllocationsNestedInput - allocatorAdminUser?: AdminUserUpdateOneWithoutBranchAllocationsNestedInput + allocatorAdmin?: AdminUpdateOneWithoutBranchAllocationsNestedInput } export type BranchAllocationUncheckedUpdateWithoutItemsInput = { id?: StringFieldUpdateOperationsInput | string branchId?: StringFieldUpdateOperationsInput | string - allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + allocatorAdminId?: NullableStringFieldUpdateOperationsInput | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -75989,7 +77596,7 @@ export namespace Prisma { favoritedBy?: CustomerFavoriteUncheckedUpdateManyWithoutProductNestedInput } - export type AdminUserCreateWithoutSentSmsMessagesInput = { + export type AdminCreateWithoutSentSmsMessagesInput = { id?: string fullName: string firstName?: string | null @@ -75997,30 +77604,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutSentSmsMessagesInput = { + export type AdminUncheckedCreateWithoutSentSmsMessagesInput = { id?: string fullName: string firstName?: string | null @@ -76030,44 +77628,35 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutSentSmsMessagesInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutSentSmsMessagesInput = { + where: AdminWhereUniqueInput + create: XOR } - export type AdminUserUpsertWithoutSentSmsMessagesInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutSentSmsMessagesInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutSentSmsMessagesInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutSentSmsMessagesInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutSentSmsMessagesInput = { + export type AdminUpdateWithoutSentSmsMessagesInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -76075,30 +77664,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutSentSmsMessagesInput = { + export type AdminUncheckedUpdateWithoutSentSmsMessagesInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -76108,28 +77688,19 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } - export type AdminUserCreateWithoutSentNotificationsInput = { + export type AdminCreateWithoutSentNotificationsInput = { id?: string fullName: string firstName?: string | null @@ -76137,30 +77708,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutSentNotificationsInput = { + export type AdminUncheckedCreateWithoutSentNotificationsInput = { id?: string fullName: string firstName?: string | null @@ -76170,30 +77732,21 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutSentNotificationsInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutSentNotificationsInput = { + where: AdminWhereUniqueInput + create: XOR } export type NotificationRecipientCreateWithoutNotificationInput = { @@ -76218,18 +77771,18 @@ export namespace Prisma { skipDuplicates?: boolean } - export type AdminUserUpsertWithoutSentNotificationsInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutSentNotificationsInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutSentNotificationsInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutSentNotificationsInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutSentNotificationsInput = { + export type AdminUpdateWithoutSentNotificationsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -76237,30 +77790,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutSentNotificationsInput = { + export type AdminUncheckedUpdateWithoutSentNotificationsInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -76270,25 +77814,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } export type NotificationRecipientUpsertWithWhereUniqueWithoutNotificationInput = { @@ -76313,7 +77848,7 @@ export namespace Prisma { body: string audience?: $Enums.MessageAudience createdAt?: Date | string - sentByAdminUser?: AdminUserCreateNestedOneWithoutSentNotificationsInput + sentByAdmin?: AdminCreateNestedOneWithoutSentNotificationsInput } export type NotificationUncheckedCreateWithoutRecipientsInput = { @@ -76321,7 +77856,7 @@ export namespace Prisma { title: string body: string audience?: $Enums.MessageAudience - sentByAdminUserId?: string | null + sentByAdminId?: string | null createdAt?: Date | string } @@ -76456,7 +77991,7 @@ export namespace Prisma { body?: StringFieldUpdateOperationsInput | string audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - sentByAdminUser?: AdminUserUpdateOneWithoutSentNotificationsNestedInput + sentByAdmin?: AdminUpdateOneWithoutSentNotificationsNestedInput } export type NotificationUncheckedUpdateWithoutRecipientsInput = { @@ -76464,7 +77999,7 @@ export namespace Prisma { title?: StringFieldUpdateOperationsInput | string body?: StringFieldUpdateOperationsInput | string audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + sentByAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -76807,7 +78342,7 @@ export namespace Prisma { favorites?: CustomerFavoriteUncheckedUpdateManyWithoutCustomerNestedInput } - export type AdminUserCreateWithoutUploadedFilesInput = { + export type AdminCreateWithoutUploadedFilesInput = { id?: string fullName: string firstName?: string | null @@ -76815,30 +78350,21 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - userType?: UserTypeCreateNestedOneWithoutAdminUsersInput - branch?: BranchCreateNestedOneWithoutAdminUsersInput - avatarFile?: UploadedFileCreateNestedOneWithoutAdminUserAvatarsInput - referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput + userType?: UserTypeCreateNestedOneWithoutAdminsInput + branch?: BranchCreateNestedOneWithoutAdminsInput supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminInput + sessions?: AdminSessionCreateNestedManyWithoutAdminInput } - export type AdminUserUncheckedCreateWithoutUploadedFilesInput = { + export type AdminUncheckedCreateWithoutUploadedFilesInput = { id?: string fullName: string firstName?: string | null @@ -76848,30 +78374,21 @@ export namespace Prisma { role: $Enums.AdminRole userTypeId?: number | null branchId?: string | null - wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string - avatarFileId?: string | null - address?: string | null - storeName?: string | null - pasazhName?: string | null - memberCode?: string | null - referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput - creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminInput + sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminInput } - export type AdminUserCreateOrConnectWithoutUploadedFilesInput = { - where: AdminUserWhereUniqueInput - create: XOR + export type AdminCreateOrConnectWithoutUploadedFilesInput = { + where: AdminWhereUniqueInput + create: XOR } export type CustomerCreateWithoutAvatarFileInput = { @@ -77007,16 +78524,7 @@ export namespace Prisma { branch?: BranchCreateNestedOneWithoutAdminUsersInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionCreateNestedManyWithoutAdminUserInput } export type AdminUserUncheckedCreateWithoutAvatarFileInput = { @@ -77038,16 +78546,7 @@ export namespace Prisma { memberCode?: string | null referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput creditedOrders?: OrderUncheckedCreateNestedManyWithoutSalesAgentInput - supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput - branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput - postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput - orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput - sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput - sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput - uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput salesExpertProfile?: SalesExpertProfileUncheckedCreateNestedOneWithoutAdminUserInput - sessions?: AdminSessionUncheckedCreateNestedManyWithoutAdminUserInput } export type AdminUserCreateOrConnectWithoutAvatarFileInput = { @@ -77060,18 +78559,18 @@ export namespace Prisma { skipDuplicates?: boolean } - export type AdminUserUpsertWithoutUploadedFilesInput = { - update: XOR - create: XOR - where?: AdminUserWhereInput + export type AdminUpsertWithoutUploadedFilesInput = { + update: XOR + create: XOR + where?: AdminWhereInput } - export type AdminUserUpdateToOneWithWhereWithoutUploadedFilesInput = { - where?: AdminUserWhereInput - data: XOR + export type AdminUpdateToOneWithWhereWithoutUploadedFilesInput = { + where?: AdminWhereInput + data: XOR } - export type AdminUserUpdateWithoutUploadedFilesInput = { + export type AdminUpdateWithoutUploadedFilesInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -77079,30 +78578,21 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput - branch?: BranchUpdateOneWithoutAdminUsersNestedInput - avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput - referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + branch?: BranchUpdateOneWithoutAdminsNestedInput supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput } - export type AdminUserUncheckedUpdateWithoutUploadedFilesInput = { + export type AdminUncheckedUpdateWithoutUploadedFilesInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string firstName?: NullableStringFieldUpdateOperationsInput | string | null @@ -77112,25 +78602,16 @@ export namespace Prisma { role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null - wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null - address?: NullableStringFieldUpdateOperationsInput | string | null - storeName?: NullableStringFieldUpdateOperationsInput | string | null - pasazhName?: NullableStringFieldUpdateOperationsInput | string | null - memberCode?: NullableStringFieldUpdateOperationsInput | string | null - referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput - creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput } export type CustomerUpsertWithWhereUniqueWithoutAvatarFileInput = { @@ -77683,6 +79164,7 @@ export namespace Prisma { phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput + admins?: AdminUpdateManyWithoutBranchNestedInput orders?: OrderUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } @@ -77694,6 +79176,7 @@ export namespace Prisma { phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput + admins?: AdminUncheckedUpdateManyWithoutBranchNestedInput orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } @@ -77795,6 +79278,404 @@ export namespace Prisma { updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } + export type WorkshopCreateManySupervisorInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + } + + export type BranchAllocationCreateManyAllocatorAdminInput = { + id?: string + branchId: string + note?: string | null + createdAt?: Date | string + } + + export type LedgerEntryCreateManyPostedByAdminInput = { + id?: string + customerId: string + currency: $Enums.LedgerCurrency + direction: $Enums.LedgerDirection + sourceType: $Enums.LedgerSourceType + amount: Decimal | DecimalJsLike | number | string + karatPerMille?: number | null + pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null + orderId?: string | null + confirmed?: boolean + confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null + note?: string | null + createdAt?: Date | string + } + + export type OrderStatusEventCreateManyActorAdminInput = { + id?: string + orderId: string + fromStatus?: $Enums.OrderStatus | null + toStatus: $Enums.OrderStatus + note?: string | null + createdAt?: Date | string + } + + export type PreOrderStatusEventCreateManyActorAdminInput = { + id?: string + preOrderId: string + changes: JsonNullValueInput | InputJsonValue + ipAddress?: string | null + createdAt?: Date | string + } + + export type SmsMessageCreateManySentByAdminInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + createdAt?: Date | string + } + + export type NotificationCreateManySentByAdminInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + } + + export type UploadedFileCreateManyUploadedByAdminInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + } + + export type AdminSessionCreateManyAdminInput = { + id?: string + jti: string + iamSessionId?: string | null + iamSub?: string | null + ipAddress?: string | null + userAgent?: string | null + createdAt?: Date | string + expiresAt?: Date | string | null + lastSeenAt?: Date | string | null + revokedAt?: Date | string | null + revokedReason?: string | null + } + + export type WorkshopUpdateWithoutSupervisorInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + preOrders?: PreOrderUpdateManyWithoutWorkshopNestedInput + } + + export type WorkshopUncheckedUpdateWithoutSupervisorInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + preOrders?: PreOrderUncheckedUpdateManyWithoutWorkshopNestedInput + } + + export type WorkshopUncheckedUpdateManyWithoutSupervisorInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + } + + export type BranchAllocationUpdateWithoutAllocatorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + branch?: BranchUpdateOneRequiredWithoutAllocationsNestedInput + items?: BranchAllocationItemUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationUncheckedUpdateWithoutAllocatorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + branchId?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + items?: BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + branchId?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type LedgerEntryUpdateWithoutPostedByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + currency?: EnumLedgerCurrencyFieldUpdateOperationsInput | $Enums.LedgerCurrency + direction?: EnumLedgerDirectionFieldUpdateOperationsInput | $Enums.LedgerDirection + sourceType?: EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType + amount?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + karatPerMille?: NullableIntFieldUpdateOperationsInput | number | null + pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + confirmed?: BoolFieldUpdateOperationsInput | boolean + confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + customer?: CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput + order?: OrderUpdateOneWithoutLedgerEntriesNestedInput + } + + export type LedgerEntryUncheckedUpdateWithoutPostedByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + currency?: EnumLedgerCurrencyFieldUpdateOperationsInput | $Enums.LedgerCurrency + direction?: EnumLedgerDirectionFieldUpdateOperationsInput | $Enums.LedgerDirection + sourceType?: EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType + amount?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + karatPerMille?: NullableIntFieldUpdateOperationsInput | number | null + pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + orderId?: NullableStringFieldUpdateOperationsInput | string | null + confirmed?: BoolFieldUpdateOperationsInput | boolean + confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type LedgerEntryUncheckedUpdateManyWithoutPostedByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + currency?: EnumLedgerCurrencyFieldUpdateOperationsInput | $Enums.LedgerCurrency + direction?: EnumLedgerDirectionFieldUpdateOperationsInput | $Enums.LedgerDirection + sourceType?: EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType + amount?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + karatPerMille?: NullableIntFieldUpdateOperationsInput | number | null + pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + orderId?: NullableStringFieldUpdateOperationsInput | string | null + confirmed?: BoolFieldUpdateOperationsInput | boolean + confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type OrderStatusEventUpdateWithoutActorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null + toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + order?: OrderUpdateOneRequiredWithoutStatusEventsNestedInput + } + + export type OrderStatusEventUncheckedUpdateWithoutActorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + orderId?: StringFieldUpdateOperationsInput | string + fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null + toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type OrderStatusEventUncheckedUpdateManyWithoutActorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + orderId?: StringFieldUpdateOperationsInput | string + fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null + toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PreOrderStatusEventUpdateWithoutActorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + changes?: JsonNullValueInput | InputJsonValue + ipAddress?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + preOrder?: PreOrderUpdateOneRequiredWithoutStatusEventsNestedInput + } + + export type PreOrderStatusEventUncheckedUpdateWithoutActorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + preOrderId?: StringFieldUpdateOperationsInput | string + changes?: JsonNullValueInput | InputJsonValue + ipAddress?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminInput = { + id?: StringFieldUpdateOperationsInput | string + preOrderId?: StringFieldUpdateOperationsInput | string + changes?: JsonNullValueInput | InputJsonValue + ipAddress?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SmsMessageUpdateWithoutSentByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SmsMessageUncheckedUpdateWithoutSentByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SmsMessageUncheckedUpdateManyWithoutSentByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationUpdateWithoutSentByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + recipients?: NotificationRecipientUpdateManyWithoutNotificationNestedInput + } + + export type NotificationUncheckedUpdateWithoutSentByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + recipients?: NotificationRecipientUncheckedUpdateManyWithoutNotificationNestedInput + } + + export type NotificationUncheckedUpdateManyWithoutSentByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UploadedFileUpdateWithoutUploadedByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + customerAvatars?: CustomerUpdateManyWithoutAvatarFileNestedInput + adminUserAvatars?: AdminUserUpdateManyWithoutAvatarFileNestedInput + } + + export type UploadedFileUncheckedUpdateWithoutUploadedByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + customerAvatars?: CustomerUncheckedUpdateManyWithoutAvatarFileNestedInput + adminUserAvatars?: AdminUserUncheckedUpdateManyWithoutAvatarFileNestedInput + } + + export type UploadedFileUncheckedUpdateManyWithoutUploadedByAdminInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type AdminSessionUpdateWithoutAdminInput = { + id?: StringFieldUpdateOperationsInput | string + jti?: StringFieldUpdateOperationsInput | string + iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null + iamSub?: NullableStringFieldUpdateOperationsInput | string | null + ipAddress?: NullableStringFieldUpdateOperationsInput | string | null + userAgent?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + expiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + lastSeenAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + revokedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + revokedReason?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type AdminSessionUncheckedUpdateWithoutAdminInput = { + id?: StringFieldUpdateOperationsInput | string + jti?: StringFieldUpdateOperationsInput | string + iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null + iamSub?: NullableStringFieldUpdateOperationsInput | string | null + ipAddress?: NullableStringFieldUpdateOperationsInput | string | null + userAgent?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + expiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + lastSeenAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + revokedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + revokedReason?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type AdminSessionUncheckedUpdateManyWithoutAdminInput = { + id?: StringFieldUpdateOperationsInput | string + jti?: StringFieldUpdateOperationsInput | string + iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null + iamSub?: NullableStringFieldUpdateOperationsInput | string | null + ipAddress?: NullableStringFieldUpdateOperationsInput | string | null + userAgent?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + expiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + lastSeenAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + revokedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + revokedReason?: NullableStringFieldUpdateOperationsInput | string | null + } + export type CustomerCreateManyReferredByAgentInput = { id?: string fullName: string @@ -77851,103 +79732,6 @@ export namespace Prisma { updatedAt?: Date | string } - export type WorkshopCreateManySupervisorInput = { - id?: string - name: string - address?: string | null - phone?: string | null - isActive?: boolean - } - - export type BranchAllocationCreateManyAllocatorAdminUserInput = { - id?: string - branchId: string - note?: string | null - createdAt?: Date | string - } - - export type LedgerEntryCreateManyPostedByAdminUserInput = { - id?: string - customerId: string - currency: $Enums.LedgerCurrency - direction: $Enums.LedgerDirection - sourceType: $Enums.LedgerSourceType - amount: Decimal | DecimalJsLike | number | string - karatPerMille?: number | null - pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null - orderId?: string | null - confirmed?: boolean - confirmedAt?: Date | string | null - labName?: string | null - hallmark?: string | null - accountName?: string | null - bankName?: string | null - transferTo?: string | null - originalValue?: Decimal | DecimalJsLike | number | string | null - priceRial?: Decimal | DecimalJsLike | number | string | null - receivedAt?: Date | string | null - note?: string | null - createdAt?: Date | string - } - - export type OrderStatusEventCreateManyActorAdminUserInput = { - id?: string - orderId: string - fromStatus?: $Enums.OrderStatus | null - toStatus: $Enums.OrderStatus - note?: string | null - createdAt?: Date | string - } - - export type PreOrderStatusEventCreateManyActorAdminUserInput = { - id?: string - preOrderId: string - changes: JsonNullValueInput | InputJsonValue - ipAddress?: string | null - createdAt?: Date | string - } - - export type SmsMessageCreateManySentByAdminUserInput = { - id?: string - audience: $Enums.MessageAudience - recipients?: string | null - body: string - sentCount?: number - createdAt?: Date | string - } - - export type NotificationCreateManySentByAdminUserInput = { - id?: string - title: string - body: string - audience?: $Enums.MessageAudience - createdAt?: Date | string - } - - export type UploadedFileCreateManyUploadedByAdminUserInput = { - id?: string - url: string - originalName: string - mimeType: string - sizeBytes: number - purpose?: string | null - createdAt?: Date | string - } - - export type AdminSessionCreateManyAdminUserInput = { - id?: string - jti: string - iamSessionId?: string | null - iamSub?: string | null - ipAddress?: string | null - userAgent?: string | null - createdAt?: Date | string - expiresAt?: Date | string | null - lastSeenAt?: Date | string | null - revokedAt?: Date | string | null - revokedReason?: string | null - } - export type CustomerUpdateWithoutReferredByAgentInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string @@ -78150,307 +79934,6 @@ export namespace Prisma { updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } - export type WorkshopUpdateWithoutSupervisorInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - address?: NullableStringFieldUpdateOperationsInput | string | null - phone?: NullableStringFieldUpdateOperationsInput | string | null - isActive?: BoolFieldUpdateOperationsInput | boolean - preOrders?: PreOrderUpdateManyWithoutWorkshopNestedInput - } - - export type WorkshopUncheckedUpdateWithoutSupervisorInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - address?: NullableStringFieldUpdateOperationsInput | string | null - phone?: NullableStringFieldUpdateOperationsInput | string | null - isActive?: BoolFieldUpdateOperationsInput | boolean - preOrders?: PreOrderUncheckedUpdateManyWithoutWorkshopNestedInput - } - - export type WorkshopUncheckedUpdateManyWithoutSupervisorInput = { - id?: StringFieldUpdateOperationsInput | string - name?: StringFieldUpdateOperationsInput | string - address?: NullableStringFieldUpdateOperationsInput | string | null - phone?: NullableStringFieldUpdateOperationsInput | string | null - isActive?: BoolFieldUpdateOperationsInput | boolean - } - - export type BranchAllocationUpdateWithoutAllocatorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - branch?: BranchUpdateOneRequiredWithoutAllocationsNestedInput - items?: BranchAllocationItemUpdateManyWithoutAllocationNestedInput - } - - export type BranchAllocationUncheckedUpdateWithoutAllocatorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - branchId?: StringFieldUpdateOperationsInput | string - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - items?: BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput - } - - export type BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - branchId?: StringFieldUpdateOperationsInput | string - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type LedgerEntryUpdateWithoutPostedByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - currency?: EnumLedgerCurrencyFieldUpdateOperationsInput | $Enums.LedgerCurrency - direction?: EnumLedgerDirectionFieldUpdateOperationsInput | $Enums.LedgerDirection - sourceType?: EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType - amount?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string - karatPerMille?: NullableIntFieldUpdateOperationsInput | number | null - pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - confirmed?: BoolFieldUpdateOperationsInput | boolean - confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - labName?: NullableStringFieldUpdateOperationsInput | string | null - hallmark?: NullableStringFieldUpdateOperationsInput | string | null - accountName?: NullableStringFieldUpdateOperationsInput | string | null - bankName?: NullableStringFieldUpdateOperationsInput | string | null - transferTo?: NullableStringFieldUpdateOperationsInput | string | null - originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - customer?: CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput - order?: OrderUpdateOneWithoutLedgerEntriesNestedInput - } - - export type LedgerEntryUncheckedUpdateWithoutPostedByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - customerId?: StringFieldUpdateOperationsInput | string - currency?: EnumLedgerCurrencyFieldUpdateOperationsInput | $Enums.LedgerCurrency - direction?: EnumLedgerDirectionFieldUpdateOperationsInput | $Enums.LedgerDirection - sourceType?: EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType - amount?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string - karatPerMille?: NullableIntFieldUpdateOperationsInput | number | null - pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - orderId?: NullableStringFieldUpdateOperationsInput | string | null - confirmed?: BoolFieldUpdateOperationsInput | boolean - confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - labName?: NullableStringFieldUpdateOperationsInput | string | null - hallmark?: NullableStringFieldUpdateOperationsInput | string | null - accountName?: NullableStringFieldUpdateOperationsInput | string | null - bankName?: NullableStringFieldUpdateOperationsInput | string | null - transferTo?: NullableStringFieldUpdateOperationsInput | string | null - originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - customerId?: StringFieldUpdateOperationsInput | string - currency?: EnumLedgerCurrencyFieldUpdateOperationsInput | $Enums.LedgerCurrency - direction?: EnumLedgerDirectionFieldUpdateOperationsInput | $Enums.LedgerDirection - sourceType?: EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType - amount?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string - karatPerMille?: NullableIntFieldUpdateOperationsInput | number | null - pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - orderId?: NullableStringFieldUpdateOperationsInput | string | null - confirmed?: BoolFieldUpdateOperationsInput | boolean - confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - labName?: NullableStringFieldUpdateOperationsInput | string | null - hallmark?: NullableStringFieldUpdateOperationsInput | string | null - accountName?: NullableStringFieldUpdateOperationsInput | string | null - bankName?: NullableStringFieldUpdateOperationsInput | string | null - transferTo?: NullableStringFieldUpdateOperationsInput | string | null - originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null - receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type OrderStatusEventUpdateWithoutActorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null - toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - order?: OrderUpdateOneRequiredWithoutStatusEventsNestedInput - } - - export type OrderStatusEventUncheckedUpdateWithoutActorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - orderId?: StringFieldUpdateOperationsInput | string - fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null - toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - orderId?: StringFieldUpdateOperationsInput | string - fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null - toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - note?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type PreOrderStatusEventUpdateWithoutActorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - changes?: JsonNullValueInput | InputJsonValue - ipAddress?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - preOrder?: PreOrderUpdateOneRequiredWithoutStatusEventsNestedInput - } - - export type PreOrderStatusEventUncheckedUpdateWithoutActorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - preOrderId?: StringFieldUpdateOperationsInput | string - changes?: JsonNullValueInput | InputJsonValue - ipAddress?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - preOrderId?: StringFieldUpdateOperationsInput | string - changes?: JsonNullValueInput | InputJsonValue - ipAddress?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type SmsMessageUpdateWithoutSentByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - recipients?: NullableStringFieldUpdateOperationsInput | string | null - body?: StringFieldUpdateOperationsInput | string - sentCount?: IntFieldUpdateOperationsInput | number - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type SmsMessageUncheckedUpdateWithoutSentByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - recipients?: NullableStringFieldUpdateOperationsInput | string | null - body?: StringFieldUpdateOperationsInput | string - sentCount?: IntFieldUpdateOperationsInput | number - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type SmsMessageUncheckedUpdateManyWithoutSentByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - recipients?: NullableStringFieldUpdateOperationsInput | string | null - body?: StringFieldUpdateOperationsInput | string - sentCount?: IntFieldUpdateOperationsInput | number - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type NotificationUpdateWithoutSentByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - title?: StringFieldUpdateOperationsInput | string - body?: StringFieldUpdateOperationsInput | string - audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - recipients?: NotificationRecipientUpdateManyWithoutNotificationNestedInput - } - - export type NotificationUncheckedUpdateWithoutSentByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - title?: StringFieldUpdateOperationsInput | string - body?: StringFieldUpdateOperationsInput | string - audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - recipients?: NotificationRecipientUncheckedUpdateManyWithoutNotificationNestedInput - } - - export type NotificationUncheckedUpdateManyWithoutSentByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - title?: StringFieldUpdateOperationsInput | string - body?: StringFieldUpdateOperationsInput | string - audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type UploadedFileUpdateWithoutUploadedByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - url?: StringFieldUpdateOperationsInput | string - originalName?: StringFieldUpdateOperationsInput | string - mimeType?: StringFieldUpdateOperationsInput | string - sizeBytes?: IntFieldUpdateOperationsInput | number - purpose?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - customerAvatars?: CustomerUpdateManyWithoutAvatarFileNestedInput - adminUserAvatars?: AdminUserUpdateManyWithoutAvatarFileNestedInput - } - - export type UploadedFileUncheckedUpdateWithoutUploadedByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - url?: StringFieldUpdateOperationsInput | string - originalName?: StringFieldUpdateOperationsInput | string - mimeType?: StringFieldUpdateOperationsInput | string - sizeBytes?: IntFieldUpdateOperationsInput | number - purpose?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - customerAvatars?: CustomerUncheckedUpdateManyWithoutAvatarFileNestedInput - adminUserAvatars?: AdminUserUncheckedUpdateManyWithoutAvatarFileNestedInput - } - - export type UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - url?: StringFieldUpdateOperationsInput | string - originalName?: StringFieldUpdateOperationsInput | string - mimeType?: StringFieldUpdateOperationsInput | string - sizeBytes?: IntFieldUpdateOperationsInput | number - purpose?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - } - - export type AdminSessionUpdateWithoutAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - jti?: StringFieldUpdateOperationsInput | string - iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null - iamSub?: NullableStringFieldUpdateOperationsInput | string | null - ipAddress?: NullableStringFieldUpdateOperationsInput | string | null - userAgent?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - expiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - lastSeenAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - revokedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - revokedReason?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type AdminSessionUncheckedUpdateWithoutAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - jti?: StringFieldUpdateOperationsInput | string - iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null - iamSub?: NullableStringFieldUpdateOperationsInput | string | null - ipAddress?: NullableStringFieldUpdateOperationsInput | string | null - userAgent?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - expiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - lastSeenAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - revokedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - revokedReason?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type AdminSessionUncheckedUpdateManyWithoutAdminUserInput = { - id?: StringFieldUpdateOperationsInput | string - jti?: StringFieldUpdateOperationsInput | string - iamSessionId?: NullableStringFieldUpdateOperationsInput | string | null - iamSub?: NullableStringFieldUpdateOperationsInput | string | null - ipAddress?: NullableStringFieldUpdateOperationsInput | string | null - userAgent?: NullableStringFieldUpdateOperationsInput | string | null - createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - expiresAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - lastSeenAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - revokedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - revokedReason?: NullableStringFieldUpdateOperationsInput | string | null - } - export type OrderCreateManyReferrerCustomerInput = { id?: string orderNumber: string @@ -78521,7 +80004,7 @@ export namespace Prisma { orderId?: string | null confirmed?: boolean confirmedAt?: Date | string | null - postedByAdminUserId?: string | null + postedByAdminId?: string | null labName?: string | null hallmark?: string | null accountName?: string | null @@ -78817,7 +80300,7 @@ export namespace Prisma { note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string order?: OrderUpdateOneWithoutLedgerEntriesNestedInput - postedByAdminUser?: AdminUserUpdateOneWithoutPostedLedgerEntriesNestedInput + postedByAdmin?: AdminUpdateOneWithoutPostedLedgerEntriesNestedInput } export type LedgerEntryUncheckedUpdateWithoutCustomerInput = { @@ -78831,7 +80314,7 @@ export namespace Prisma { orderId?: NullableStringFieldUpdateOperationsInput | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + postedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null labName?: NullableStringFieldUpdateOperationsInput | string | null hallmark?: NullableStringFieldUpdateOperationsInput | string | null accountName?: NullableStringFieldUpdateOperationsInput | string | null @@ -78855,7 +80338,7 @@ export namespace Prisma { orderId?: NullableStringFieldUpdateOperationsInput | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + postedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null labName?: NullableStringFieldUpdateOperationsInput | string | null hallmark?: NullableStringFieldUpdateOperationsInput | string | null accountName?: NullableStringFieldUpdateOperationsInput | string | null @@ -79090,6 +80573,19 @@ export namespace Prisma { memberCode?: string | null } + export type AdminCreateManyBranchInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + isActive?: boolean + createdAt?: Date | string + } + export type OrderCreateManyBranchInput = { id?: string orderNumber: string @@ -79109,7 +80605,7 @@ export namespace Prisma { export type BranchAllocationCreateManyBranchInput = { id?: string - allocatorAdminUserId?: string | null + allocatorAdminId?: string | null note?: string | null createdAt?: Date | string } @@ -79133,16 +80629,7 @@ export namespace Prisma { avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutBranchInput = { @@ -79164,16 +80651,7 @@ export namespace Prisma { memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateManyWithoutBranchInput = { @@ -79195,6 +80673,63 @@ export namespace Prisma { memberCode?: NullableStringFieldUpdateOperationsInput | string | null } + export type AdminUpdateWithoutBranchInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminsNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput + } + + export type AdminUncheckedUpdateWithoutBranchInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput + } + + export type AdminUncheckedUpdateManyWithoutBranchInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type OrderUpdateWithoutBranchInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string @@ -79258,13 +80793,13 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - allocatorAdminUser?: AdminUserUpdateOneWithoutBranchAllocationsNestedInput + allocatorAdmin?: AdminUpdateOneWithoutBranchAllocationsNestedInput items?: BranchAllocationItemUpdateManyWithoutAllocationNestedInput } export type BranchAllocationUncheckedUpdateWithoutBranchInput = { id?: StringFieldUpdateOperationsInput | string - allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + allocatorAdminId?: NullableStringFieldUpdateOperationsInput | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string items?: BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput @@ -79272,7 +80807,7 @@ export namespace Prisma { export type BranchAllocationUncheckedUpdateManyWithoutBranchInput = { id?: StringFieldUpdateOperationsInput | string - allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + allocatorAdminId?: NullableStringFieldUpdateOperationsInput | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -80093,7 +81628,7 @@ export namespace Prisma { fromStatus?: $Enums.OrderStatus | null toStatus: $Enums.OrderStatus note?: string | null - actorAdminUserId?: string | null + actorAdminId?: string | null createdAt?: Date | string } @@ -80108,7 +81643,7 @@ export namespace Prisma { pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null confirmed?: boolean confirmedAt?: Date | string | null - postedByAdminUserId?: string | null + postedByAdminId?: string | null labName?: string | null hallmark?: string | null accountName?: string | null @@ -80160,7 +81695,7 @@ export namespace Prisma { toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - actorAdminUser?: AdminUserUpdateOneWithoutOrderStatusEventsNestedInput + actorAdmin?: AdminUpdateOneWithoutOrderStatusEventsNestedInput } export type OrderStatusEventUncheckedUpdateWithoutOrderInput = { @@ -80168,7 +81703,7 @@ export namespace Prisma { fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus note?: NullableStringFieldUpdateOperationsInput | string | null - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -80177,7 +81712,7 @@ export namespace Prisma { fromStatus?: NullableEnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus | null toStatus?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus note?: NullableStringFieldUpdateOperationsInput | string | null - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -80202,7 +81737,7 @@ export namespace Prisma { note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string customer?: CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput - postedByAdminUser?: AdminUserUpdateOneWithoutPostedLedgerEntriesNestedInput + postedByAdmin?: AdminUpdateOneWithoutPostedLedgerEntriesNestedInput } export type LedgerEntryUncheckedUpdateWithoutOrderInput = { @@ -80216,7 +81751,7 @@ export namespace Prisma { pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + postedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null labName?: NullableStringFieldUpdateOperationsInput | string | null hallmark?: NullableStringFieldUpdateOperationsInput | string | null accountName?: NullableStringFieldUpdateOperationsInput | string | null @@ -80240,7 +81775,7 @@ export namespace Prisma { pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null - postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + postedByAdminId?: NullableStringFieldUpdateOperationsInput | string | null labName?: NullableStringFieldUpdateOperationsInput | string | null hallmark?: NullableStringFieldUpdateOperationsInput | string | null accountName?: NullableStringFieldUpdateOperationsInput | string | null @@ -80256,7 +81791,7 @@ export namespace Prisma { export type PreOrderStatusEventCreateManyPreOrderInput = { id?: string changes: JsonNullValueInput | InputJsonValue - actorAdminUserId?: string | null + actorAdminId?: string | null ipAddress?: string | null createdAt?: Date | string } @@ -80266,13 +81801,13 @@ export namespace Prisma { changes?: JsonNullValueInput | InputJsonValue ipAddress?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string - actorAdminUser?: AdminUserUpdateOneWithoutPreOrderStatusEventsNestedInput + actorAdmin?: AdminUpdateOneWithoutPreOrderStatusEventsNestedInput } export type PreOrderStatusEventUncheckedUpdateWithoutPreOrderInput = { id?: StringFieldUpdateOperationsInput | string changes?: JsonNullValueInput | InputJsonValue - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null ipAddress?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -80280,7 +81815,7 @@ export namespace Prisma { export type PreOrderStatusEventUncheckedUpdateManyWithoutPreOrderInput = { id?: StringFieldUpdateOperationsInput | string changes?: JsonNullValueInput | InputJsonValue - actorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + actorAdminId?: NullableStringFieldUpdateOperationsInput | string | null ipAddress?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -80308,6 +81843,19 @@ export namespace Prisma { memberCode?: string | null } + export type AdminCreateManyUserTypeInput = { + id?: string + fullName: string + firstName?: string | null + lastName?: string | null + mobile: string + passwordHash: string + role: $Enums.AdminRole + branchId?: string | null + isActive?: boolean + createdAt?: Date | string + } + export type PermissionUpdateWithoutUserTypeInput = { rid?: StringFieldUpdateOperationsInput | string } @@ -80339,16 +81887,7 @@ export namespace Prisma { avatarFile?: UploadedFileUpdateOneWithoutAdminUserAvatarsNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutUserTypeInput = { @@ -80370,16 +81909,7 @@ export namespace Prisma { memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateManyWithoutUserTypeInput = { @@ -80401,6 +81931,63 @@ export namespace Prisma { memberCode?: NullableStringFieldUpdateOperationsInput | string | null } + export type AdminUpdateWithoutUserTypeInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + branch?: BranchUpdateOneWithoutAdminsNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUpdateManyWithoutAdminNestedInput + } + + export type AdminUncheckedUpdateWithoutUserTypeInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + branchId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminNestedInput + sessions?: AdminSessionUncheckedUpdateManyWithoutAdminNestedInput + } + + export type AdminUncheckedUpdateManyWithoutUserTypeInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + firstName?: NullableStringFieldUpdateOperationsInput | string | null + lastName?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + branchId?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type CommentCreateManyReplyToInput = { id?: string productId: string @@ -80711,16 +82298,7 @@ export namespace Prisma { branch?: BranchUpdateOneWithoutAdminUsersNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutAvatarFileInput = { @@ -80742,16 +82320,7 @@ export namespace Prisma { memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput creditedOrders?: OrderUncheckedUpdateManyWithoutSalesAgentNestedInput - supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput - branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput - postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput - orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput - sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput - sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput - uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput salesExpertProfile?: SalesExpertProfileUncheckedUpdateOneWithoutAdminUserNestedInput - sessions?: AdminSessionUncheckedUpdateManyWithoutAdminUserNestedInput } export type AdminUserUncheckedUpdateManyWithoutAvatarFileInput = { @@ -80782,6 +82351,10 @@ export namespace Prisma { * @deprecated Use CityCountOutputTypeDefaultArgs instead */ export type CityCountOutputTypeArgs = CityCountOutputTypeDefaultArgs + /** + * @deprecated Use AdminCountOutputTypeDefaultArgs instead + */ + export type AdminCountOutputTypeArgs = AdminCountOutputTypeDefaultArgs /** * @deprecated Use AdminUserCountOutputTypeDefaultArgs instead */ @@ -80854,6 +82427,10 @@ export namespace Prisma { * @deprecated Use CityDefaultArgs instead */ export type CityArgs = CityDefaultArgs + /** + * @deprecated Use AdminDefaultArgs instead + */ + export type AdminArgs = AdminDefaultArgs /** * @deprecated Use AdminUserDefaultArgs instead */ diff --git a/apps/api/release/vendor/.prisma/client/index.js b/apps/api/release/vendor/.prisma/client/index.js index bd1892e..4072850 100644 --- a/apps/api/release/vendor/.prisma/client/index.js +++ b/apps/api/release/vendor/.prisma/client/index.js @@ -99,6 +99,20 @@ exports.Prisma.CityScalarFieldEnum = { percentAux: 'percentAux' }; +exports.Prisma.AdminScalarFieldEnum = { + id: 'id', + fullName: 'fullName', + firstName: 'firstName', + lastName: 'lastName', + mobile: 'mobile', + passwordHash: 'passwordHash', + role: 'role', + userTypeId: 'userTypeId', + branchId: 'branchId', + isActive: 'isActive', + createdAt: 'createdAt' +}; + exports.Prisma.AdminUserScalarFieldEnum = { id: 'id', fullName: 'fullName', @@ -139,7 +153,7 @@ exports.Prisma.AppSessionScalarFieldEnum = { exports.Prisma.AdminSessionScalarFieldEnum = { id: 'id', jti: 'jti', - adminUserId: 'adminUserId', + adminId: 'adminId', iamSessionId: 'iamSessionId', iamSub: 'iamSub', ipAddress: 'ipAddress', @@ -339,7 +353,7 @@ exports.Prisma.OrderStatusEventScalarFieldEnum = { fromStatus: 'fromStatus', toStatus: 'toStatus', note: 'note', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', createdAt: 'createdAt' }; @@ -366,7 +380,7 @@ exports.Prisma.PreOrderStatusEventScalarFieldEnum = { id: 'id', preOrderId: 'preOrderId', changes: 'changes', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', ipAddress: 'ipAddress', createdAt: 'createdAt' }; @@ -383,7 +397,7 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { orderId: 'orderId', confirmed: 'confirmed', confirmedAt: 'confirmedAt', - postedByAdminUserId: 'postedByAdminUserId', + postedByAdminId: 'postedByAdminId', labName: 'labName', hallmark: 'hallmark', accountName: 'accountName', @@ -518,7 +532,7 @@ exports.Prisma.PromotionExclusionScalarFieldEnum = { exports.Prisma.BranchAllocationScalarFieldEnum = { id: 'id', branchId: 'branchId', - allocatorAdminUserId: 'allocatorAdminUserId', + allocatorAdminId: 'allocatorAdminId', note: 'note', createdAt: 'createdAt' }; @@ -536,7 +550,7 @@ exports.Prisma.SmsMessageScalarFieldEnum = { recipients: 'recipients', body: 'body', sentCount: 'sentCount', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -545,7 +559,7 @@ exports.Prisma.NotificationScalarFieldEnum = { title: 'title', body: 'body', audience: 'audience', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -578,7 +592,7 @@ exports.Prisma.UploadedFileScalarFieldEnum = { mimeType: 'mimeType', sizeBytes: 'sizeBytes', purpose: 'purpose', - uploadedByAdminUserId: 'uploadedByAdminUserId', + uploadedByAdminId: 'uploadedByAdminId', createdAt: 'createdAt' }; @@ -751,6 +765,7 @@ exports.MessageAudience = exports.$Enums.MessageAudience = { exports.Prisma.ModelName = { City: 'City', + Admin: 'Admin', AdminUser: 'AdminUser', AppSession: 'AppSession', AdminSession: 'AdminSession', @@ -845,8 +860,8 @@ const config = { } } }, - "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\n/// Legacy Customer.type — what kind of wholesale customer this is. Values and\n/// labels taken verbatim from bulkCustomer.vue's userTypes list.\n///\n/// SALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\n/// Customer row with type=1, but the redesigned system models a sales agent\n/// as an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\n/// and admin-customers.service.ts's listReagents()/create(). No Customer row\n/// should be created with kind SALES_AGENT going forward; the value is kept\n/// only so legacyTypeToKind()/kindToLegacyType() stay total functions and any\n/// already-migrated data keeps a readable label.\n///\n/// RETAIL marks a \"تک\" (single/retail) customer — legacy kept these in an\n/// entirely separate table (SingleCustomer/`login`) that could never contain\n/// a wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\n/// into one Customer model, so this value is what listSingle() now filters on\n/// to reproduce that same separation.\nenum CustomerKind {\n SALES_AGENT // legacy 1 کارشناس فروش — superseded by AdminRole.SALES_EXPERT, do not use for new rows\n APP_SHOPKEEPER // 2 مغازه دار اپلیکیشن\n WALK_IN_SHOPKEEPER // 3 مغازه دار حضوری\n BANKER // 4 بنکدار\n WORKSHOP_SUPERVISOR // 5 سرپرست کارگاه\n RETAIL // مشتری تک — legacy SingleCustomer\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n\n /// Legacy had THREE states per step, not two\n /// (MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\n /// 3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\n /// cases back in the review queue, so the owner ruled it out (2026-10-07).\n /// 14 legacy rows land here; see Customer.verificationRejectionReason.\n REJECTED\n}\n\n/// Legacy kept retail and wholesale orders in two SEPARATE tables\n/// (orders_orders vs orders). The redesigned schema has one Order model, so the\n/// distinction lives here instead.\nenum OrderChannel {\n RETAIL // تک فروشی\n WHOLESALE // عمده فروشی\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy `cities` is a tree (country > province > city > district) and so is\n/// this: a city hangs under its `parent`. In the admin pickers a top-level row\n/// (the country) is a heading, not selectable (henza_admin citiesModel.js:38).\nmodel City {\n id String @id @default(cuid())\n name String\n parentId String?\n parent City? @relation(\"CityTree\", fields: [parentId], references: [id], onDelete: Restrict)\n children City[] @relation(\"CityTree\")\n /// Legacy cities.percent / percent_aux — per-city wage surcharges the city\n /// screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\n percent Decimal? @db.Decimal(6, 3)\n percentAux Decimal? @db.Decimal(6, 3)\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n salesExpertProfiles SalesExpertProfile[]\n\n @@index([parentId])\n}\n\nmodel AdminUser {\n id String @id @default(cuid())\n\n /// ⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\n /// migration 20260922180000. Prisma cannot see it, so a write here may store\n /// something other than what you passed:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; the submitted fullName is\n /// discarded\n ///\n /// Re-read after writing if you need the stored value. Same arrangement as\n /// Customer (D0 requirement 7 — the split applies to ALL admins, not only\n /// sales experts).\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n passwordHash String\n role AdminRole\n /// Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\n /// the coarse `role` enum above is retained for the business rules that already\n /// switch on it. Nullable so existing seeded admins remain valid.\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Legacy stored a sales agent as a `customers` row with type=1, so\n /// ReagentCustomer.vue's shared form collected these alongside the\n /// wholesale-customer fields. A sales agent is now an AdminUser\n /// (role=SALES_EXPERT), so these live here instead — only ever set for that\n /// role; every other AdminUser leaves them null.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"AdminUserAvatar\", fields: [avatarFileId], references: [id])\n address String?\n storeName String? // legacy store_name\n pasazhName String? // legacy pasazh_name\n memberCode String? // legacy mcode\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n /// Orders credited to this sales expert — see Order.salesAgentId.\n creditedOrders Order[] @relation(\"OrderSalesAgent\")\n supervisedWorkshops Workshop[] @relation(\"WorkshopSupervisor\")\n branchAllocations BranchAllocation[] @relation(\"AllocationAuthor\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n sentSmsMessages SmsMessage[] @relation(\"SmsAuthor\")\n sentNotifications Notification[] @relation(\"NotificationAuthor\")\n uploadedFiles UploadedFile[] @relation(\"FileUploader\")\n\n /// Only ever set for role = SALES_EXPERT (D17).\n salesExpertProfile SalesExpertProfile?\n\n /// Issued admin-panel tokens, recorded only while session tracking is on\n /// (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\n /// token can be revoked before it expires. See AdminSession.\n sessions AdminSession[]\n\n @@index([role])\n @@index([userTypeId])\n @@index([avatarFileId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// An issued APP token (customer app / sales-expert app), so it can be revoked\n/// before it expires — the counterpart of AdminSession for the other token family.\n///\n/// WHY A SEPARATE TABLE AND NO FOREIGN KEY\n/// ---------------------------------------\n/// An app token's `sub` is a Customer id for a customer and an **AdminUser id**\n/// for a sales expert (D21). One FK cannot point at two tables, so the subject is\n/// stored as a plain id plus its type. The rows are short-lived operational data,\n/// not part of the accounting model, so the missing FK costs nothing here.\nmodel AppSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n /// Customer.id, or AdminUser.id when subjectType is \"sales-expert\".\n subjectId String\n subjectType String\n\n mobile String?\n\n /// Set when the login was confirmed by the central IAM: its session id (`sid`)\n /// and stable user id (`sub`), which is what a back-channel logout arrives with.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([subjectId])\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// An issued admin-panel JWT, so it can be revoked before it expires.\n///\n/// WHY THIS EXISTS\n/// ---------------\n/// The admin token is self-contained and valid for 12h, which means nothing —\n/// not disabling the account, not a central \"sign out everywhere\" — could cut a\n/// session short: the token kept working until it expired. With the central IAM\n/// in the loop that gap became visible (an IAM session revocation had no effect\n/// here), so every issued token now carries a `jti` recorded on this table and\n/// JwtStrategy refuses a token whose row is revoked.\n///\n/// Rows are written ONLY while tracking is enabled, and JwtStrategy only\n/// enforces them while it is enabled, so a deployment that does not want the\n/// extra lookup behaves exactly as before.\nmodel AdminSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n adminUserId String\n adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade)\n\n /// Set when the login was verified by the IAM: its session id (`sid`) and the\n /// stable user id (`sub`) there. Back-channel logout arrives keyed by these —\n /// deliberately here rather than as columns on AdminUser, so enabling the\n /// feature needs no change to an existing table.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([adminUserId])\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// The sales-expert fields legacy kept on the `customers` row (type=1) and that\n/// were lost when a sales expert became an AdminUser (D17).\n///\n/// A separate table rather than columns on AdminUser: these are meaningful only\n/// for role = SALES_EXPERT and would be permanently null for every other admin.\n/// A row is created for every SALES_EXPERT by the migration, and upserted by the\n/// service whenever one is created or a user's role becomes SALES_EXPERT — but\n/// readers still left-join, so a missing profile degrades to nulls rather than\n/// dropping the agent from the grid.\n///\n/// `reagent_id` is deliberately NOT here — see D17: in the reference it was a\n/// side effect of the shared customers form, and filling it removed that expert\n/// from the selectable-agent list (queryReagent, AdminController.php:420).\nmodel SalesExpertProfile {\n id String @id @default(cuid())\n adminUserId String @unique\n adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade)\n\n /// Legacy customers.city_id — a filterable grid column\n /// (ReagentListModel.js:14) and the source of the commission autofill\n /// (ReagentCustomer.vue:215-228).\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\n /// Decimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\n /// credit limit has identical precision on both tables.\n gramLevel Decimal @default(0) @db.Decimal(14, 4)\n\n /// Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\n /// stores both and reads neither back; kept so the form matches it. Neither\n /// is unique and neither has a validation rule in the reference — inventing\n /// one would reject data the reference accepts.\n phone String? @db.VarChar(15)\n nationalCode String? @db.VarChar(20)\n\n /// The Customer row carrying this expert's OWN orders, debt and credit limit.\n ///\n /// The reference stored a sales agent AS a Customer (type=1), so an order the\n /// agent placed from the app was simply their own, against their own\n /// gram_level (ApiMobileController.php:534-535). Here the expert is an\n /// AdminUser (D17), which has no ledger and cannot be an Order's subject, so\n /// this one linked Customer plays that part.\n ///\n /// Distinct from the expert's REFERRED customers, which are ordinary Customer\n /// rows pointing at the AdminUser through Customer.referredByAgentId.\n ///\n /// Null until the expert first signs into the app, when it is created from\n /// this profile. See D21.\n tradingCustomerId String? @unique\n tradingCustomer Customer? @relation(\"SalesExpertTradingAccount\", fields: [tradingCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now()) @updatedAt\n\n @@index([cityId])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n\n /// ⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\n /// TRIGGER — `customer_sync_full_name`, created in migration\n /// 20260922120000_customer_name_parts. Prisma does not know about it, so a\n /// write here is NOT the whole story:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; fullName is overwritten\n /// with \"first last\" and whatever you passed for fullName is discarded\n ///\n /// So a value you wrote can differ from the value that lands in the row.\n /// Re-read after writing if you need the stored value. Prefer writing the\n /// parts; `fullName` exists for the legacy readers that predate D0.\n ///\n /// Reference has these as two columns from the start\n /// (henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\n /// the port collapsed them, which is the D0 defect.\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n /// Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\n /// legacy customers has a national code (1595/1595 empty), and fabricating\n /// one is a data violation that would block later legal identity checks\n /// (owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\n /// the migration tool must write NULL and never '', which would collide on\n /// the second row.\n ///\n /// Three service-layer workarounds exist ONLY because this used to be\n /// required, and they store the MOBILE NUMBER here:\n /// admin-customers.service.ts:625,685 and customer-auth.service.ts:258.\n /// Retiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\n nationalCode String? @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.new_city — the city name exactly as the customer typed it\n /// at app sign-up (Major/CustomerController.php:36). Kept verbatim because\n /// the legacy city table has only 15 rows, so the typed name is often the only\n /// record of where the customer is (172 customers; 43 match no known city).\n /// cityId is set alongside it only on an exact, ي/ك-normalised name match.\n /// Legacy sign-up also forced city_id = 5 (Tehran) on everyone\n /// (Major/CustomerController.php:21), so for those rows the typed name, not\n /// cityId, is the truth. Owner ruling 2026-10-07: keep both.\n cityNameRaw String?\n\n /// Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\n /// BankerList / ShopkeeperList screens filter on.\n kind CustomerKind @default(APP_SHOPKEEPER)\n\n /// Legacy contact + shop columns, shown on the wholesale customer form and as\n /// (hidden-by-default) columns in its grid.\n phone String?\n address String?\n storeName String?\n pasazhName String?\n zone String?\n /// Legacy mcode — the operator-assigned customer code.\n memberCode String?\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n /// Set only on the one Customer row that acts as a sales expert's own trading\n /// account (see SalesExpertProfile.tradingCustomerId). Empty for every\n /// ordinary customer.\n salesExpertTradingFor SalesExpertProfile? @relation(\"SalesExpertTradingAccount\")\n /// Legacy orders that named THIS customer as their referrer — see\n /// Order.referrerCustomerId. History only.\n referredOrders Order[] @relation(\"OrderReferrerCustomer\")\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n /// Balance as last read from the accounting software (D27), in the app's own\n /// sign convention (positive = owes). Shown to the customer when the\n /// integration is on; the credit-limit check still uses goldDebtGrams above.\n /// Null until the first successful sync.\n accountingGoldBalance Decimal? @db.Decimal(14, 4)\n accountingRialBalance Decimal? @db.Decimal(20, 2)\n accountingBalanceAt DateTime?\n\n /// Legacy `customers.percent` — the per-customer making-charge offset. It is\n /// ADDED to the variant's making charge when pricing an order line\n /// (henza_pwa src/Mixins/product/index.ts:69-75:\n /// getWage(v) = state.percent + v.percentage_pay)\n /// and it shifts the catalogue making-charge filter bounds\n /// (ApiMobileController.php:391-396,76-77). It is NOT part of the price\n /// formula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\n ///\n /// NOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\n /// NOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\n ///\n /// DB default 0 keeps every existing customer's price unchanged. The\n /// reference's application-layer default for NEW customers is 3\n /// (AdminController.php:338) and the field is required on create (:354).\n makingChargeOffsetPercent Decimal @default(0) @db.Decimal(6, 3)\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n /// Why verification was rejected (VerificationStep.REJECTED).\n ///\n /// Legacy recorded NO reason: none of its 49 `customers` columns is a\n /// reason/note field, and on rejection it only sent a fixed SMS. So the 14\n /// rows migrated from the legacy system carry the sentinel\n /// «رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\n /// knows why it is blank (owner ruling 2026-10-07). The migration tool\n /// writes it only WHERE this IS NULL, so a re-run cannot overwrite a real\n /// reason entered in the new system.\n verificationRejectionReason String?\n\n /// NULL for rows migrated from the legacy system — it recorded no rejection time.\n verificationRejectedAt DateTime?\n\n /// Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\n /// birthday SMS / loyalty campaigns (owner ruling 2026-10-07).\n ///\n /// ⚠ Legacy stores dates as JALALI STRINGS in other tables\n /// (cashes.recive_date is varchar, 88/89 values starting \"14…\"), so this\n /// timestamp may hold mis-entered Jalali years. Confirm the calendar with\n /// docs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\n /// would produce 917 wrong birthdays, worse for an SMS campaign than none.\n birthDate DateTime?\n\n /// Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\n /// form. Legacy stored an FK to its Image table and read it back as a nested\n /// `image: { id, image }`, so this is a relation, not a bare URL string.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"CustomerAvatar\", fields: [avatarFileId], references: [id])\n\n /// Legacy had TWO independent switches on a customer:\n /// sts -> may they place orders (this field)\n /// active -> is the account enabled (isActive, below)\n /// The port previously drove both from isActive; they are separate again.\n canPlaceOrders Boolean @default(true)\n\n isActive Boolean @default(true)\n /// Legacy archive flag — the archived list filtered on this, not on isActive.\n isArchived Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n comments Comment[]\n promotions Promotion[]\n notifications NotificationRecipient[]\n activityLogs CustomerActivityLog[]\n otpChallenges CustomerOtp[]\n favorites CustomerFavorite[]\n\n @@index([referredByAgentId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// Legacy `fav` (251 rows) — saved products. The target had no model for this,\n/// so every customer's favourites would have been lost in the migration; the\n/// owner confirmed on 2026-10-06 that they matter.\n///\n/// Legacy `fav` has two columns and NO primary key. The composite key here\n/// supplies the constraint the source lacks (the precheck found 0 duplicate\n/// pairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\n/// at a deleted customer and must be skipped.\n///\n/// Legacy's denormalised `product.count_fav` counter is deliberately NOT\n/// recreated as a column — derive it from this table.\nmodel CustomerFavorite {\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n\n @@id([customerId, productId])\n @@index([productId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n /// Legacy Branch.address / phone — both are columns in the branch grid.\n address String?\n phone String?\n /// Legacy GET branch/active/{id} toggles this.\n isActive Boolean @default(true)\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n orders Order[]\n allocations BranchAllocation[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n /// Legacy Workshop.address / phone — both are columns in the workshop grid.\n address String?\n phone String?\n /// The supervisor created alongside the workshop by the legacy Add form.\n supervisorId String?\n supervisor AdminUser? @relation(\"WorkshopSupervisor\", fields: [supervisorId], references: [id])\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n /// Legacy Category.type — which storefront the category belongs to:\n /// 1 سایت | 2 اپلیکشن موبایل. Drives the \"type_str\" grid column.\n type Int @default(1)\n /// Legacy Category.image / icon — the grid renders the image, the storefront the icon.\n imageUrl String?\n iconUrl String?\n /// Legacy meta tag + description, used for SEO on the site categories.\n metaTag String?\n description String?\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n promotions Promotion[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n promotions Promotion[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n /// Legacy Product.product_code — the human-facing SKU shown in the grid.\n productCode String? @unique\n /// Legacy Product.show_type: 1 site, 2 mobile, 3 both.\n showType Int @default(3)\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Stock of the linked کارساخته as last read from the accounting software\n /// (D27). Weight for gram-type items, count for count-type ones — whichever\n /// the software reports. At zero or below the product is unavailable in the\n /// app (pre-order variants excepted). Null = not linked or never synced.\n accountingStockWeight Decimal? @db.Decimal(14, 4)\n accountingStockCount Decimal? @db.Decimal(14, 4)\n accountingStockAt DateTime?\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n comments Comment[]\n promotions Promotion[]\n allocationItems BranchAllocationItem[]\n favoritedBy CustomerFavorite[]\n\n // Storefront paging (owner: the real catalogue reaches ~16k products, so\n // GET /catalog/products must page rather than return everything). This model\n // had NO index at all, so every storefront query was a full scan and paging\n // alone would not have been any faster.\n //\n // The composite matches the list's own shape: filter on isActive, order by\n // createdAt — Postgres can satisfy both from this one index, including the\n // OFFSET walk. The other two serve the category and brand filters.\n @@index([isActive, createdAt])\n @@index([categoryId])\n @@index([brandId])\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n /// Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\n /// گالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\n /// existing rows and any generic \"just attach an image\" caller keep working.\n role ProductImageRole @default(GALLERY)\n\n /// Variants that display this image. A gallery image may back several\n /// variants (one photo, several weights), which is why this is a plain\n /// one-to-many and not a join table.\n variants ProductVariant[]\n\n // The storefront list filters on `images: { some: {} }` and includes the\n // gallery ordered by sortOrder, both per product. Unindexed, each one scanned\n // the whole table.\n @@index([productId, sortOrder])\n}\n\nenum ProductImageRole {\n FEATURED\n FEATURED_MOBILE\n GALLERY\n GALLERY_MOBILE\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n /// Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\n /// qty 0 unless it is flagged pre-order, so both fields are required for that\n /// guard to work (see apps/admin-panel/src/stores/cart.ts).\n qty Int @default(0)\n /// Legacy is_pre_order: orderable even at zero stock.\n isPreOrder Boolean @default(false)\n isActive Boolean @default(true)\n\n /// Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\n color Int?\n /// Legacy rial_pay — fixed Rial making charge per variant.\n rialWage Decimal? @db.Decimal(18, 0)\n /// Legacy details — short description for variant.\n details String? @db.Text\n /// Legacy description — full description for variant.\n description String? @db.Text\n\n /// The gallery image shown for this variant, picked from its own product's\n /// images — never a re-uploaded copy. onDelete: SetNull because dropping an\n /// image must never cascade into the variant: OrderItem rows reference\n /// variants, so losing one would break order history.\n imageId String?\n image ProductImage? @relation(fields: [imageId], references: [id], onDelete: SetNull)\n\n orderItems OrderItem[]\n\n @@index([imageId])\n // Every storefront product carries its variants, so this include ran once per\n // product with no index to use. The composite covers the `isActive: true`\n // filter the list applies to them.\n @@index([productId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n /// Which sales channel placed this order — see OrderChannel.\n channel OrderChannel @default(RETAIL)\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n /// The sales expert this order is credited to, fixed when it is placed:\n /// the customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\n /// set once at creation (ApiMobileController.php:601) and never moved, so a\n /// customer changing expert later does not move past sales or commission\n /// (owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\n /// customer's current referrer.\n salesAgentId String?\n salesAgent AdminUser? @relation(\"OrderSalesAgent\", fields: [salesAgentId], references: [id], onDelete: SetNull)\n\n /// History only: a legacy order whose `reagent_id` named a customer who is\n /// not a sales expert (one such customer, 17 orders in 2022). Legacy counted\n /// those orders in that customer's own «میزان فروش»; this keeps that figure\n /// exact. Never set for a new order.\n referrerCustomerId String?\n referrerCustomer Customer? @relation(\"OrderReferrerCustomer\", fields: [referrerCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n @@index([salesAgentId])\n @@index([referrerCustomerId])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminUserId String?\n postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id])\n\n /// Instrument metadata from the legacy \"cash\" document form. Which fields are\n /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and\n /// the pre-normalization weight, a cheque carries the account and bank, and a\n /// transfer carries its destination.\n /// Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\n labName String?\n hallmark String?\n accountName String?\n bankName String?\n transferTo String?\n /// Weight as handed over, BEFORE karat normalization (legacy original_value).\n originalValue Decimal? @db.Decimal(14, 4)\n /// Rial amount for cash/cheque documents (legacy price).\n priceRial Decimal? @db.Decimal(20, 2)\n receivedAt DateTime?\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Admin ACL — faithful port of the legacy granular permission model.\n//\n// Legacy (henza_server):\n// Schema::create('permission', function (Blueprint $table) {\n// $table->string('rid');\n// $table->integer('ut');\n// $table->primary(['rid' , 'ut']);\n// });\n//\n// Permissions attach to the USER TYPE (`ut`), never to an individual user, so\n// every admin of a given type shares one permission set. `ut` pointed at a row\n// in the legacy `config_static` lookup table; UserType is that table, narrowed\n// to the admin-user-type rows it was actually used for.\n//\n// A `rid` is a dotted permission id such as \"persons.list.client.omde\". The\n// frontend expands each stored rid into its ancestors at runtime via\n// checkParent() — see apps/admin-panel/src/stores/users.ts. Only the 58 leaf\n// rids the routers actually gate are seeded; ancestors are derived, not stored.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UserType {\n /// Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\n /// rows keep their legacy identity rather than getting new cuids.\n id Int @id\n title String\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n permissions Permission[]\n adminUsers AdminUser[]\n\n @@map(\"user_type\")\n}\n\nmodel Permission {\n /// Dotted permission id, e.g. \"order.list\", \"persons.list.client.omde\".\n rid String\n userTypeId Int\n userType UserType @relation(fields: [userTypeId], references: [id], onDelete: Cascade)\n\n /// Legacy's composite primary key (rid, ut), preserved exactly.\n @@id([rid, userTypeId])\n @@index([userTypeId])\n @@map(\"permission\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Product comments / reviews — legacy `comment` table (App\\Models\\Comment),\n// moderated from views/customer/Comments/Comments.vue.\n//\n// Legacy fillable: product_id, comment, reply_to, sts, customer_id\n// Legacy Comment::$STS = [1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده']\n// which is represented here as an enum rather than a magic integer.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum CommentStatus {\n PENDING // 1 — در انتظار تایید\n APPROVED // 2 — تایید شده\n REJECTED // 3 — رد شده\n}\n\nmodel Comment {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n body String\n status CommentStatus @default(PENDING)\n\n /// Legacy `reply_to`: a staff reply threads under the comment it answers.\n replyToId String?\n replyTo Comment? @relation(\"CommentReplies\", fields: [replyToId], references: [id])\n replies Comment[] @relation(\"CommentReplies\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([productId])\n @@index([customerId])\n @@index([status])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Settings — replaces legacy `config_static`, a key/value table the admin\n// panel read and wrote through endpoints like /wallet/config and\n// /const/__list__ut. Values are stored as JSON so a setting can hold a scalar,\n// an object, or the dynamic option lists legacy kept under `__list__*` keys.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Setting {\n key String @id\n value Json\n updatedAt DateTime @updatedAt\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting integration (D27) — the shop's accounting software, Tahesab or\n// Zarrin, chosen in the admin panel. Configuration lives in the Setting row\n// `accounting.config` (never served by the generic `const` routes). Plan:\n// docs/ACCOUNTING-INTEGRATION-PLAN.md.\n//\n// `provider` is the driver name ('tahesab' | 'zarrin'), a plain string like\n// SMS_PROVIDER so a new driver needs no migration. Links are per provider, so\n// switching provider and back loses nothing.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AccountingEntityType {\n CUSTOMER\n PRODUCT\n}\n\n/// One app row ↔ one record in the accounting software (customer account or\n/// کارساخته).\nmodel AccountingLink {\n id String @id @default(cuid())\n provider String\n entityType AccountingEntityType\n entityId String\n /// The record's code in the accounting software (Tahesab Moshtari_Code /\n /// Zarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\n externalCode String\n externalName String?\n /// How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\n /// row created from the accounting record), PUSHED (accounting record created\n /// from the app row) or MANUAL (an admin typed the code).\n origin String\n /// The record as last read, for display only.\n snapshot Json?\n syncedAt DateTime @default(now())\n createdAt DateTime @default(now())\n\n @@unique([provider, entityType, entityId])\n @@unique([provider, entityType, externalCode])\n @@index([entityType, entityId])\n}\n\nenum AccountingOutboxKind {\n CUSTOMER_PUSH\n PRODUCT_PUSH\n ORDER_DOCUMENT\n ORDER_DOCUMENT_DELETE\n}\n\nenum AccountingOutboxStatus {\n PENDING\n /// A call was in flight. Found at startup, it means the process died mid-call\n /// and the outcome is unknown — see AccountingOutboxWorker.\n SENDING\n SENT\n FAILED\n /// Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\n /// idempotency key, so a blind retry could post the document twice).\n NEEDS_REVIEW\n /// Closed by an admin from the log screen.\n RESOLVED\n}\n\n/// Work to push to the accounting software. Written in the SAME transaction as\n/// the change that causes it, so an outage of the accounting software never\n/// loses an event and never blocks the app.\nmodel AccountingOutbox {\n id String @id @default(cuid())\n provider String\n kind AccountingOutboxKind\n entityId String\n status AccountingOutboxStatus @default(PENDING)\n attempts Int @default(0)\n nextAttemptAt DateTime @default(now())\n lastError String?\n /// What the accounting software returned as the document/record id.\n externalRef String?\n /// Per-step progress of multi-call jobs (a Zarrin document is one call per\n /// line), so a failure resumes where it stopped.\n progress Json?\n /// Last request/response, for the log screen. Never contains the token.\n lastRequest Json?\n lastResponse Json?\n sentAt DateTime?\n resolvedById String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([status, nextAttemptAt])\n @@index([kind, entityId])\n}\n\n/// Something a pull found that needs a human: an account with no mobile, two\n/// accounts sharing one mobile, a کارساخته group with no category mapping.\nmodel AccountingIssue {\n id String @id @default(cuid())\n provider String\n kind String\n externalCode String\n entityId String?\n message String\n data Json?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n resolvedAt DateTime?\n\n @@unique([provider, kind, externalCode])\n @@index([resolvedAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Promotions / discounts — legacy views/promotion/*, served by\n// PromotionController (`product/variant/promotion`). The redesigned schema had\n// no promotion concept at all; this models what the legacy forms actually\n// collect.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy Promotion.type — what the discount is scoped to.\nenum PromotionScope {\n PRODUCT // 1 محصولات\n CATEGORY // 2 دسته بندی\n CUSTOMER // 3 مشتری\n BRAND // 4 برند\n}\n\n/// Legacy Promotion.use_only — how often a customer may redeem it.\nenum PromotionUsage {\n ONCE // 1 فقط یکبار\n UNTIL_END_DATE // 2 تا تاریخ پایان\n}\n\nmodel Promotion {\n id String @id @default(cuid())\n title String\n description String?\n scope PromotionScope @default(PRODUCT)\n usage PromotionUsage @default(ONCE)\n /// Percentage off, 0-100 (legacy discount_percent).\n discountPercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n /// Which storefront it shows on, mirroring Product.showType (legacy platform).\n platform Int @default(3)\n\n startsAt DateTime?\n endsAt DateTime?\n\n /// Exactly one of these is populated, per `scope`.\n productId String?\n product Product? @relation(fields: [productId], references: [id])\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n customerId String?\n customer Customer? @relation(fields: [customerId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([scope, isActive])\n}\n\n/// Legacy \"ignore\" table (views/offersIgnore) — specific products, categories,\n/// customers or brands excluded from the automatic discount engine.\n/// Legacy posts { type, item_id[] }: \"type\" reuses the promotion scope codes\n/// (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \"itemId\" is the excluded row.\nmodel PromotionExclusion {\n id String @id @default(cuid())\n type Int\n itemId String\n createdAt DateTime @default(now())\n\n @@unique([type, itemId])\n @@index([type])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Branch stock allocation — legacy views/invoice/* (\"فاکتور انتقال\"), served by\n// BranchController as `branch/product`. Despite the screen being called an\n// invoice, it is not a sales document: it records which products head office\n// allocated to a branch, and who allocated them.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel BranchAllocation {\n id String @id @default(cuid())\n branchId String\n branch Branch @relation(fields: [branchId], references: [id])\n\n /// Legacy `allocator_user` — the admin who filed the allocation.\n allocatorAdminUserId String?\n allocatorAdminUser AdminUser? @relation(\"AllocationAuthor\", fields: [allocatorAdminUserId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n items BranchAllocationItem[]\n\n @@index([branchId])\n}\n\nmodel BranchAllocationItem {\n id String @id @default(cuid())\n allocationId String\n allocation BranchAllocation @relation(fields: [allocationId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id])\n /// Weight snapshot at allocation time, so later catalog edits do not rewrite history.\n weightGrams Decimal? @db.Decimal(14, 4)\n\n @@unique([allocationId, productId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Messaging + audit — legacy views/sms, views/notify, views/newsletters and\n// views/statics. None of these had a model in the redesigned schema.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Who an SMS or notification was aimed at. Legacy's sms/create offered these\n/// audiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\nenum MessageAudience {\n SINGLE_NUMBER // یک شماره\n MULTIPLE_NUMBERS // چند شماره\n ALL_CUSTOMERS // همه\n WHOLESALE_CUSTOMERS // عمده\n RETAIL_CUSTOMERS // تک\n SALES_AGENTS // کارشناسان فروش\n}\n\nmodel SmsMessage {\n id String @id @default(cuid())\n audience MessageAudience\n /// Comma-separated recipients for the SINGLE/MULTIPLE audiences.\n recipients String?\n body String\n /// How many numbers the send actually resolved to.\n sentCount Int @default(0)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"SmsAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n @@index([createdAt])\n}\n\nmodel Notification {\n id String @id @default(cuid())\n title String\n body String\n audience MessageAudience @default(ALL_CUSTOMERS)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"NotificationAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n recipients NotificationRecipient[]\n\n @@index([createdAt])\n}\n\n/// Per-customer delivery + read state — legacy `GET notify/read/{id}`.\nmodel NotificationRecipient {\n id String @id @default(cuid())\n notificationId String\n notification Notification @relation(fields: [notificationId], references: [id], onDelete: Cascade)\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n readAt DateTime?\n\n @@unique([notificationId, customerId])\n @@index([customerId, readAt])\n}\n\n/// Legacy views/newsletters — the mailing-list signups collected by the site.\nmodel NewsletterSubscriber {\n id String @id @default(cuid())\n email String?\n mobile String?\n createdAt DateTime @default(now())\n\n @@unique([email])\n @@unique([mobile])\n}\n\n/// Legacy views/statics — the customer activity log the \"آمار\" screen reads\n/// (`log/list/customer`, `log/ago/{customerId}`).\nmodel CustomerActivityLog {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n /// Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\n action String\n detail String?\n createdAt DateTime @default(now())\n\n @@index([customerId, createdAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Uploads — replaces the legacy MyUpload / SingleUploadInput widgets, which\n// POSTed to a file endpoint and stored the returned URL on the owning record.\n// Ports of those forms currently take a URL by hand; this gives them a real\n// destination to upload to.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UploadedFile {\n id String @id @default(cuid())\n /// Public URL the stored file is served from.\n url String\n originalName String\n mimeType String\n sizeBytes Int\n /// Free-form tag for what the file belongs to, e.g. 'product', 'category',\n /// 'customer.nationalId'. Kept loose so a new form needs no schema change.\n purpose String?\n\n uploadedByAdminUserId String?\n uploadedByAdminUser AdminUser? @relation(\"FileUploader\", fields: [uploadedByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n customerAvatars Customer[] @relation(\"CustomerAvatar\")\n adminUserAvatars AdminUser[] @relation(\"AdminUserAvatar\")\n\n @@index([purpose])\n}\n\n/// One OTP login challenge for a customer.\n///\n/// Ports henza_server's flow (ApiMobileController.php:39-78), where userAuth\n/// generated rand(1000,9999), stored it on the customer row as `send_password`\n/// and sent it by SMS, and userVerfiy compared the submitted code against it\n/// (mismatch -> HTTP 422).\n///\n/// Three deliberate improvements over the reference, approved by the user\n/// (docs/parity/DECISIONS.md D6 and T1):\n/// 1. the code is stored as a bcrypt hash, never in plain text — the\n/// reference kept it readable in a customer column;\n/// 2. it expires (`expiresAt`) — the reference's code stayed valid forever;\n/// 3. attempts are counted and the challenge locks out — the reference had\n/// no limit at all.\n/// The parity behaviour itself is the code comparison and the rejection.\nmodel CustomerOtp {\n id String @id @default(cuid())\n /// Normalised to English digits before storing, as the reference does with\n /// Utility::faTOen() on both send and verify.\n mobile String\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n\n /// bcrypt hash of the 4-digit code. Never the code itself.\n codeHash String\n expiresAt DateTime\n /// Failed verify attempts against THIS challenge.\n attempts Int @default(0)\n /// Set when the code is accepted, so one challenge cannot be reused.\n consumedAt DateTime?\n\n /// Kept for the per-IP send throttle.\n requestIp String?\n createdAt DateTime @default(now())\n\n @@index([mobile, createdAt])\n @@index([customerId])\n @@index([expiresAt])\n}\n\n/// Bespoke migration ledger left by the EARLIER, pre-Prisma port.\n///\n/// It predates Prisma Migrate in this repo and holds 12 historical rows\n/// (`0001_init.sql`, `0002_admin_schema.sql`, `seed:initial`, and the early\n/// `2026091…` migrations). It is the only record of how that port was applied,\n/// so it is **kept and never written to or deleted from** (DEAD-07).\n///\n/// It is declared here purely so `prisma migrate diff` stops proposing\n/// `DROP TABLE \"_goldbank_migrations\"` — an undeclared table reads as drift.\n/// `@@ignore` keeps it out of Prisma Client: nothing in the application should\n/// ever read or write it, and Prisma Migrate will not manage its shape either.\n///\n/// Prisma's own ledger is `_prisma_migrations`, which is separate and is never\n/// edited by hand (D14).\nmodel goldbank_migrations {\n name String @id\n appliedAt DateTime @default(now()) @map(\"applied_at\") @db.Timestamptz(6)\n\n @@map(\"_goldbank_migrations\")\n @@ignore\n}\n", - "inlineSchemaHash": "54a2d00740a4cca89b49b7d3d033c87da64e26d4d05f43a5a69777e68eba1748", + "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\n/// Legacy Customer.type — what kind of wholesale customer this is. Values and\n/// labels taken verbatim from bulkCustomer.vue's userTypes list.\n///\n/// SALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\n/// Customer row with type=1, but the redesigned system models a sales agent\n/// as an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\n/// and admin-customers.service.ts's listReagents()/create(). No Customer row\n/// should be created with kind SALES_AGENT going forward; the value is kept\n/// only so legacyTypeToKind()/kindToLegacyType() stay total functions and any\n/// already-migrated data keeps a readable label.\n///\n/// RETAIL marks a \"تک\" (single/retail) customer — legacy kept these in an\n/// entirely separate table (SingleCustomer/`login`) that could never contain\n/// a wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\n/// into one Customer model, so this value is what listSingle() now filters on\n/// to reproduce that same separation.\nenum CustomerKind {\n SALES_AGENT // legacy 1 کارشناس فروش — superseded by AdminRole.SALES_EXPERT, do not use for new rows\n APP_SHOPKEEPER // 2 مغازه دار اپلیکیشن\n WALK_IN_SHOPKEEPER // 3 مغازه دار حضوری\n BANKER // 4 بنکدار\n WORKSHOP_SUPERVISOR // 5 سرپرست کارگاه\n RETAIL // مشتری تک — legacy SingleCustomer\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n\n /// Legacy had THREE states per step, not two\n /// (MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\n /// 3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\n /// cases back in the review queue, so the owner ruled it out (2026-10-07).\n /// 14 legacy rows land here; see Customer.verificationRejectionReason.\n REJECTED\n}\n\n/// Legacy kept retail and wholesale orders in two SEPARATE tables\n/// (orders_orders vs orders). The redesigned schema has one Order model, so the\n/// distinction lives here instead.\nenum OrderChannel {\n RETAIL // تک فروشی\n WHOLESALE // عمده فروشی\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy `cities` is a tree (country > province > city > district) and so is\n/// this: a city hangs under its `parent`. In the admin pickers a top-level row\n/// (the country) is a heading, not selectable (henza_admin citiesModel.js:38).\nmodel City {\n id String @id @default(cuid())\n name String\n parentId String?\n parent City? @relation(\"CityTree\", fields: [parentId], references: [id], onDelete: Restrict)\n children City[] @relation(\"CityTree\")\n /// Legacy cities.percent / percent_aux — per-city wage surcharges the city\n /// screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\n percent Decimal? @db.Decimal(6, 3)\n percentAux Decimal? @db.Decimal(6, 3)\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n salesExpertProfiles SalesExpertProfile[]\n\n @@index([parentId])\n}\n\n/// A staff account for the ADMIN PANEL — and nothing else.\n///\n/// Split out of AdminUser (which now holds sales experts only) so that:\n/// * the same mobile can be an admin AND a sales expert — they are two\n/// separate roles, each unique only within its own table;\n/// * the expert table (production: ~12,000 rows) is never written by panel\n/// staff management.\n/// Migration 20261026120000_split_admin_table copies the existing non-expert\n/// AdminUser rows here WITH THEIR IDS, so issued panel tokens and every\n/// \"who did this\" column keep resolving. The old rows are left in AdminUser,\n/// dormant; no code reads them as admins any more.\n///\n/// ⚠️ fullName/firstName/lastName are kept in sync by the DB trigger\n/// `admin_sync_full_name_trg` (it shares the function admin_user_sync_full_name) — same semantics as AdminUser: the parts win.\nmodel Admin {\n id String @id @default(cuid())\n\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n passwordHash String\n /// Never SALES_EXPERT — that role lives in AdminUser. Enforced in\n /// AdminUsersService, not in the database, so the enum stays shared.\n role AdminRole\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n supervisedWorkshops Workshop[] @relation(\"WorkshopSupervisor\")\n branchAllocations BranchAllocation[] @relation(\"AllocationAuthor\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n sentSmsMessages SmsMessage[] @relation(\"SmsAuthor\")\n sentNotifications Notification[] @relation(\"NotificationAuthor\")\n uploadedFiles UploadedFile[] @relation(\"FileUploader\")\n\n /// Issued admin-panel tokens, recorded only while session tracking is on\n /// (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\n /// token can be revoked before it expires. See AdminSession.\n sessions AdminSession[]\n\n @@index([role])\n @@index([userTypeId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// A SALES EXPERT (role SALES_EXPERT). Panel staff live in `Admin`; rows here with\n/// any other role are pre-split leftovers and are ignored by the code.\nmodel AdminUser {\n id String @id @default(cuid())\n\n /// ⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\n /// migration 20260922180000. Prisma cannot see it, so a write here may store\n /// something other than what you passed:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; the submitted fullName is\n /// discarded\n ///\n /// Re-read after writing if you need the stored value. Same arrangement as\n /// Customer (D0 requirement 7 — the split applies to ALL admins, not only\n /// sales experts).\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n passwordHash String\n role AdminRole\n /// Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\n /// the coarse `role` enum above is retained for the business rules that already\n /// switch on it. Nullable so existing seeded admins remain valid.\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Legacy stored a sales agent as a `customers` row with type=1, so\n /// ReagentCustomer.vue's shared form collected these alongside the\n /// wholesale-customer fields. A sales agent is now an AdminUser\n /// (role=SALES_EXPERT), so these live here instead — only ever set for that\n /// role; every other AdminUser leaves them null.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"AdminUserAvatar\", fields: [avatarFileId], references: [id])\n address String?\n storeName String? // legacy store_name\n pasazhName String? // legacy pasazh_name\n memberCode String? // legacy mcode\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n /// Orders credited to this sales expert — see Order.salesAgentId.\n creditedOrders Order[] @relation(\"OrderSalesAgent\")\n\n /// Only ever set for role = SALES_EXPERT (D17).\n salesExpertProfile SalesExpertProfile?\n\n @@index([role])\n @@index([userTypeId])\n @@index([avatarFileId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// An issued APP token (customer app / sales-expert app), so it can be revoked\n/// before it expires — the counterpart of AdminSession for the other token family.\n///\n/// WHY A SEPARATE TABLE AND NO FOREIGN KEY\n/// ---------------------------------------\n/// An app token's `sub` is a Customer id for a customer and an **AdminUser id**\n/// for a sales expert (D21). One FK cannot point at two tables, so the subject is\n/// stored as a plain id plus its type. The rows are short-lived operational data,\n/// not part of the accounting model, so the missing FK costs nothing here.\nmodel AppSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n /// Customer.id, or AdminUser.id when subjectType is \"sales-expert\".\n subjectId String\n subjectType String\n\n mobile String?\n\n /// Set when the login was confirmed by the central IAM: its session id (`sid`)\n /// and stable user id (`sub`), which is what a back-channel logout arrives with.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([subjectId])\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// An issued admin-panel JWT, so it can be revoked before it expires.\n///\n/// WHY THIS EXISTS\n/// ---------------\n/// The admin token is self-contained and valid for 12h, which means nothing —\n/// not disabling the account, not a central \"sign out everywhere\" — could cut a\n/// session short: the token kept working until it expired. With the central IAM\n/// in the loop that gap became visible (an IAM session revocation had no effect\n/// here), so every issued token now carries a `jti` recorded on this table and\n/// JwtStrategy refuses a token whose row is revoked.\n///\n/// Rows are written ONLY while tracking is enabled, and JwtStrategy only\n/// enforces them while it is enabled, so a deployment that does not want the\n/// extra lookup behaves exactly as before.\nmodel AdminSession {\n id String @id @default(cuid())\n\n /// The token's `jti` claim. Unique: one row per issued token.\n jti String @unique\n\n adminId String @map(\"adminUserId\")\n admin Admin @relation(fields: [adminId], references: [id], onDelete: Cascade)\n\n /// Set when the login was verified by the IAM: its session id (`sid`) and the\n /// stable user id (`sub`) there. Back-channel logout arrives keyed by these —\n /// deliberately here rather than as columns on AdminUser, so enabling the\n /// feature needs no change to an existing table.\n iamSessionId String?\n iamSub String?\n\n ipAddress String?\n userAgent String?\n\n createdAt DateTime @default(now())\n expiresAt DateTime?\n lastSeenAt DateTime?\n\n revokedAt DateTime?\n revokedReason String?\n\n @@index([adminId], map: \"AdminSession_adminUserId_idx\")\n @@index([iamSessionId])\n @@index([iamSub])\n @@index([expiresAt])\n}\n\n/// The sales-expert fields legacy kept on the `customers` row (type=1) and that\n/// were lost when a sales expert became an AdminUser (D17).\n///\n/// A separate table rather than columns on AdminUser: these are meaningful only\n/// for role = SALES_EXPERT and would be permanently null for every other admin.\n/// A row is created for every SALES_EXPERT by the migration, and upserted by the\n/// service whenever one is created or a user's role becomes SALES_EXPERT — but\n/// readers still left-join, so a missing profile degrades to nulls rather than\n/// dropping the agent from the grid.\n///\n/// `reagent_id` is deliberately NOT here — see D17: in the reference it was a\n/// side effect of the shared customers form, and filling it removed that expert\n/// from the selectable-agent list (queryReagent, AdminController.php:420).\nmodel SalesExpertProfile {\n id String @id @default(cuid())\n adminUserId String @unique\n adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade)\n\n /// Legacy customers.city_id — a filterable grid column\n /// (ReagentListModel.js:14) and the source of the commission autofill\n /// (ReagentCustomer.vue:215-228).\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\n /// Decimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\n /// credit limit has identical precision on both tables.\n gramLevel Decimal @default(0) @db.Decimal(14, 4)\n\n /// Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\n /// stores both and reads neither back; kept so the form matches it. Neither\n /// is unique and neither has a validation rule in the reference — inventing\n /// one would reject data the reference accepts.\n phone String? @db.VarChar(15)\n nationalCode String? @db.VarChar(20)\n\n /// The Customer row carrying this expert's OWN orders, debt and credit limit.\n ///\n /// The reference stored a sales agent AS a Customer (type=1), so an order the\n /// agent placed from the app was simply their own, against their own\n /// gram_level (ApiMobileController.php:534-535). Here the expert is an\n /// AdminUser (D17), which has no ledger and cannot be an Order's subject, so\n /// this one linked Customer plays that part.\n ///\n /// Distinct from the expert's REFERRED customers, which are ordinary Customer\n /// rows pointing at the AdminUser through Customer.referredByAgentId.\n ///\n /// Null until the expert first signs into the app, when it is created from\n /// this profile. See D21.\n tradingCustomerId String? @unique\n tradingCustomer Customer? @relation(\"SalesExpertTradingAccount\", fields: [tradingCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now()) @updatedAt\n\n @@index([cityId])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n\n /// ⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\n /// TRIGGER — `customer_sync_full_name`, created in migration\n /// 20260922120000_customer_name_parts. Prisma does not know about it, so a\n /// write here is NOT the whole story:\n ///\n /// * write the parts -> fullName is rebuilt as \"first last\"\n /// * write fullName only -> the parts are re-derived from it\n /// * write BOTH in one update -> THE PARTS WIN; fullName is overwritten\n /// with \"first last\" and whatever you passed for fullName is discarded\n ///\n /// So a value you wrote can differ from the value that lands in the row.\n /// Re-read after writing if you need the stored value. Prefer writing the\n /// parts; `fullName` exists for the legacy readers that predate D0.\n ///\n /// Reference has these as two columns from the start\n /// (henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\n /// the port collapsed them, which is the D0 defect.\n fullName String\n firstName String?\n lastName String?\n\n mobile String @unique\n /// Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\n /// legacy customers has a national code (1595/1595 empty), and fabricating\n /// one is a data violation that would block later legal identity checks\n /// (owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\n /// the migration tool must write NULL and never '', which would collide on\n /// the second row.\n ///\n /// Three service-layer workarounds exist ONLY because this used to be\n /// required, and they store the MOBILE NUMBER here:\n /// admin-customers.service.ts:625,685 and customer-auth.service.ts:258.\n /// Retiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\n nationalCode String? @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy customers.new_city — the city name exactly as the customer typed it\n /// at app sign-up (Major/CustomerController.php:36). Kept verbatim because\n /// the legacy city table has only 15 rows, so the typed name is often the only\n /// record of where the customer is (172 customers; 43 match no known city).\n /// cityId is set alongside it only on an exact, ي/ك-normalised name match.\n /// Legacy sign-up also forced city_id = 5 (Tehran) on everyone\n /// (Major/CustomerController.php:21), so for those rows the typed name, not\n /// cityId, is the truth. Owner ruling 2026-10-07: keep both.\n cityNameRaw String?\n\n /// Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\n /// BankerList / ShopkeeperList screens filter on.\n kind CustomerKind @default(APP_SHOPKEEPER)\n\n /// Legacy contact + shop columns, shown on the wholesale customer form and as\n /// (hidden-by-default) columns in its grid.\n phone String?\n address String?\n storeName String?\n pasazhName String?\n zone String?\n /// Legacy mcode — the operator-assigned customer code.\n memberCode String?\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n /// Set only on the one Customer row that acts as a sales expert's own trading\n /// account (see SalesExpertProfile.tradingCustomerId). Empty for every\n /// ordinary customer.\n salesExpertTradingFor SalesExpertProfile? @relation(\"SalesExpertTradingAccount\")\n /// Legacy orders that named THIS customer as their referrer — see\n /// Order.referrerCustomerId. History only.\n referredOrders Order[] @relation(\"OrderReferrerCustomer\")\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n /// Balance as last read from the accounting software (D27), in the app's own\n /// sign convention (positive = owes). Shown to the customer when the\n /// integration is on; the credit-limit check still uses goldDebtGrams above.\n /// Null until the first successful sync.\n accountingGoldBalance Decimal? @db.Decimal(14, 4)\n accountingRialBalance Decimal? @db.Decimal(20, 2)\n accountingBalanceAt DateTime?\n\n /// Legacy `customers.percent` — the per-customer making-charge offset. It is\n /// ADDED to the variant's making charge when pricing an order line\n /// (henza_pwa src/Mixins/product/index.ts:69-75:\n /// getWage(v) = state.percent + v.percentage_pay)\n /// and it shifts the catalogue making-charge filter bounds\n /// (ApiMobileController.php:391-396,76-77). It is NOT part of the price\n /// formula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\n ///\n /// NOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\n /// NOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\n ///\n /// DB default 0 keeps every existing customer's price unchanged. The\n /// reference's application-layer default for NEW customers is 3\n /// (AdminController.php:338) and the field is required on create (:354).\n makingChargeOffsetPercent Decimal @default(0) @db.Decimal(6, 3)\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n /// Why verification was rejected (VerificationStep.REJECTED).\n ///\n /// Legacy recorded NO reason: none of its 49 `customers` columns is a\n /// reason/note field, and on rejection it only sent a fixed SMS. So the 14\n /// rows migrated from the legacy system carry the sentinel\n /// «رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\n /// knows why it is blank (owner ruling 2026-10-07). The migration tool\n /// writes it only WHERE this IS NULL, so a re-run cannot overwrite a real\n /// reason entered in the new system.\n verificationRejectionReason String?\n\n /// NULL for rows migrated from the legacy system — it recorded no rejection time.\n verificationRejectedAt DateTime?\n\n /// Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\n /// birthday SMS / loyalty campaigns (owner ruling 2026-10-07).\n ///\n /// ⚠ Legacy stores dates as JALALI STRINGS in other tables\n /// (cashes.recive_date is varchar, 88/89 values starting \"14…\"), so this\n /// timestamp may hold mis-entered Jalali years. Confirm the calendar with\n /// docs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\n /// would produce 917 wrong birthdays, worse for an SMS campaign than none.\n birthDate DateTime?\n\n /// Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\n /// form. Legacy stored an FK to its Image table and read it back as a nested\n /// `image: { id, image }`, so this is a relation, not a bare URL string.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"CustomerAvatar\", fields: [avatarFileId], references: [id])\n\n /// Legacy had TWO independent switches on a customer:\n /// sts -> may they place orders (this field)\n /// active -> is the account enabled (isActive, below)\n /// The port previously drove both from isActive; they are separate again.\n canPlaceOrders Boolean @default(true)\n\n isActive Boolean @default(true)\n /// Legacy archive flag — the archived list filtered on this, not on isActive.\n isArchived Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n comments Comment[]\n promotions Promotion[]\n notifications NotificationRecipient[]\n activityLogs CustomerActivityLog[]\n otpChallenges CustomerOtp[]\n favorites CustomerFavorite[]\n\n @@index([referredByAgentId])\n @@index([firstName])\n @@index([lastName])\n}\n\n/// Legacy `fav` (251 rows) — saved products. The target had no model for this,\n/// so every customer's favourites would have been lost in the migration; the\n/// owner confirmed on 2026-10-06 that they matter.\n///\n/// Legacy `fav` has two columns and NO primary key. The composite key here\n/// supplies the constraint the source lacks (the precheck found 0 duplicate\n/// pairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\n/// at a deleted customer and must be skipped.\n///\n/// Legacy's denormalised `product.count_fav` counter is deliberately NOT\n/// recreated as a column — derive it from this table.\nmodel CustomerFavorite {\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n\n @@id([customerId, productId])\n @@index([productId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n /// Legacy Branch.address / phone — both are columns in the branch grid.\n address String?\n phone String?\n /// Legacy GET branch/active/{id} toggles this.\n isActive Boolean @default(true)\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n admins Admin[]\n orders Order[]\n allocations BranchAllocation[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n /// Legacy Workshop.address / phone — both are columns in the workshop grid.\n address String?\n phone String?\n /// The supervisor created alongside the workshop by the legacy Add form.\n supervisorId String?\n supervisor Admin? @relation(\"WorkshopSupervisor\", fields: [supervisorId], references: [id])\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n /// Legacy Category.type — which storefront the category belongs to:\n /// 1 سایت | 2 اپلیکشن موبایل. Drives the \"type_str\" grid column.\n type Int @default(1)\n /// Legacy Category.image / icon — the grid renders the image, the storefront the icon.\n imageUrl String?\n iconUrl String?\n /// Legacy meta tag + description, used for SEO on the site categories.\n metaTag String?\n description String?\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n promotions Promotion[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n promotions Promotion[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n /// Legacy Product.product_code — the human-facing SKU shown in the grid.\n productCode String? @unique\n /// Legacy Product.show_type: 1 site, 2 mobile, 3 both.\n showType Int @default(3)\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n /// Stock of the linked کارساخته as last read from the accounting software\n /// (D27). Weight for gram-type items, count for count-type ones — whichever\n /// the software reports. At zero or below the product is unavailable in the\n /// app (pre-order variants excepted). Null = not linked or never synced.\n accountingStockWeight Decimal? @db.Decimal(14, 4)\n accountingStockCount Decimal? @db.Decimal(14, 4)\n accountingStockAt DateTime?\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n comments Comment[]\n promotions Promotion[]\n allocationItems BranchAllocationItem[]\n favoritedBy CustomerFavorite[]\n\n // Storefront paging (owner: the real catalogue reaches ~16k products, so\n // GET /catalog/products must page rather than return everything). This model\n // had NO index at all, so every storefront query was a full scan and paging\n // alone would not have been any faster.\n //\n // The composite matches the list's own shape: filter on isActive, order by\n // createdAt — Postgres can satisfy both from this one index, including the\n // OFFSET walk. The other two serve the category and brand filters.\n @@index([isActive, createdAt])\n @@index([categoryId])\n @@index([brandId])\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n /// Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\n /// گالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\n /// existing rows and any generic \"just attach an image\" caller keep working.\n role ProductImageRole @default(GALLERY)\n\n /// Variants that display this image. A gallery image may back several\n /// variants (one photo, several weights), which is why this is a plain\n /// one-to-many and not a join table.\n variants ProductVariant[]\n\n // The storefront list filters on `images: { some: {} }` and includes the\n // gallery ordered by sortOrder, both per product. Unindexed, each one scanned\n // the whole table.\n @@index([productId, sortOrder])\n}\n\nenum ProductImageRole {\n FEATURED\n FEATURED_MOBILE\n GALLERY\n GALLERY_MOBILE\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n /// Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\n /// qty 0 unless it is flagged pre-order, so both fields are required for that\n /// guard to work (see apps/admin-panel/src/stores/cart.ts).\n qty Int @default(0)\n /// Legacy is_pre_order: orderable even at zero stock.\n isPreOrder Boolean @default(false)\n isActive Boolean @default(true)\n\n /// Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\n color Int?\n /// Legacy rial_pay — fixed Rial making charge per variant.\n rialWage Decimal? @db.Decimal(18, 0)\n /// Legacy details — short description for variant.\n details String? @db.Text\n /// Legacy description — full description for variant.\n description String? @db.Text\n\n /// The gallery image shown for this variant, picked from its own product's\n /// images — never a re-uploaded copy. onDelete: SetNull because dropping an\n /// image must never cascade into the variant: OrderItem rows reference\n /// variants, so losing one would break order history.\n imageId String?\n image ProductImage? @relation(fields: [imageId], references: [id], onDelete: SetNull)\n\n orderItems OrderItem[]\n\n @@index([imageId])\n // Every storefront product carries its variants, so this include ran once per\n // product with no index to use. The composite covers the `isActive: true`\n // filter the list applies to them.\n @@index([productId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n /// Which sales channel placed this order — see OrderChannel.\n channel OrderChannel @default(RETAIL)\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n /// The sales expert this order is credited to, fixed when it is placed:\n /// the customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\n /// set once at creation (ApiMobileController.php:601) and never moved, so a\n /// customer changing expert later does not move past sales or commission\n /// (owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\n /// customer's current referrer.\n salesAgentId String?\n salesAgent AdminUser? @relation(\"OrderSalesAgent\", fields: [salesAgentId], references: [id], onDelete: SetNull)\n\n /// History only: a legacy order whose `reagent_id` named a customer who is\n /// not a sales expert (one such customer, 17 orders in 2022). Legacy counted\n /// those orders in that customer's own «میزان فروش»; this keeps that figure\n /// exact. Never set for a new order.\n referrerCustomerId String?\n referrerCustomer Customer? @relation(\"OrderReferrerCustomer\", fields: [referrerCustomerId], references: [id], onDelete: SetNull)\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n @@index([salesAgentId])\n @@index([referrerCustomerId])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminId String? @map(\"actorAdminUserId\")\n actorAdmin Admin? @relation(fields: [actorAdminId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminId String? @map(\"actorAdminUserId\")\n actorAdmin Admin? @relation(fields: [actorAdminId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminId String? @map(\"postedByAdminUserId\")\n postedByAdmin Admin? @relation(fields: [postedByAdminId], references: [id])\n\n /// Instrument metadata from the legacy \"cash\" document form. Which fields are\n /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and\n /// the pre-normalization weight, a cheque carries the account and bank, and a\n /// transfer carries its destination.\n /// Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\n labName String?\n hallmark String?\n accountName String?\n bankName String?\n transferTo String?\n /// Weight as handed over, BEFORE karat normalization (legacy original_value).\n originalValue Decimal? @db.Decimal(14, 4)\n /// Rial amount for cash/cheque documents (legacy price).\n priceRial Decimal? @db.Decimal(20, 2)\n receivedAt DateTime?\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Admin ACL — faithful port of the legacy granular permission model.\n//\n// Legacy (henza_server):\n// Schema::create('permission', function (Blueprint $table) {\n// $table->string('rid');\n// $table->integer('ut');\n// $table->primary(['rid' , 'ut']);\n// });\n//\n// Permissions attach to the USER TYPE (`ut`), never to an individual user, so\n// every admin of a given type shares one permission set. `ut` pointed at a row\n// in the legacy `config_static` lookup table; UserType is that table, narrowed\n// to the admin-user-type rows it was actually used for.\n//\n// A `rid` is a dotted permission id such as \"persons.list.client.omde\". The\n// frontend expands each stored rid into its ancestors at runtime via\n// checkParent() — see apps/admin-panel/src/stores/users.ts. Only the 58 leaf\n// rids the routers actually gate are seeded; ancestors are derived, not stored.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UserType {\n /// Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\n /// rows keep their legacy identity rather than getting new cuids.\n id Int @id\n title String\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n permissions Permission[]\n adminUsers AdminUser[]\n admins Admin[]\n\n @@map(\"user_type\")\n}\n\nmodel Permission {\n /// Dotted permission id, e.g. \"order.list\", \"persons.list.client.omde\".\n rid String\n userTypeId Int\n userType UserType @relation(fields: [userTypeId], references: [id], onDelete: Cascade)\n\n /// Legacy's composite primary key (rid, ut), preserved exactly.\n @@id([rid, userTypeId])\n @@index([userTypeId])\n @@map(\"permission\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Product comments / reviews — legacy `comment` table (App\\Models\\Comment),\n// moderated from views/customer/Comments/Comments.vue.\n//\n// Legacy fillable: product_id, comment, reply_to, sts, customer_id\n// Legacy Comment::$STS = [1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده']\n// which is represented here as an enum rather than a magic integer.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum CommentStatus {\n PENDING // 1 — در انتظار تایید\n APPROVED // 2 — تایید شده\n REJECTED // 3 — رد شده\n}\n\nmodel Comment {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n body String\n status CommentStatus @default(PENDING)\n\n /// Legacy `reply_to`: a staff reply threads under the comment it answers.\n replyToId String?\n replyTo Comment? @relation(\"CommentReplies\", fields: [replyToId], references: [id])\n replies Comment[] @relation(\"CommentReplies\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([productId])\n @@index([customerId])\n @@index([status])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Settings — replaces legacy `config_static`, a key/value table the admin\n// panel read and wrote through endpoints like /wallet/config and\n// /const/__list__ut. Values are stored as JSON so a setting can hold a scalar,\n// an object, or the dynamic option lists legacy kept under `__list__*` keys.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Setting {\n key String @id\n value Json\n updatedAt DateTime @updatedAt\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting integration (D27) — the shop's accounting software, Tahesab or\n// Zarrin, chosen in the admin panel. Configuration lives in the Setting row\n// `accounting.config` (never served by the generic `const` routes). Plan:\n// docs/ACCOUNTING-INTEGRATION-PLAN.md.\n//\n// `provider` is the driver name ('tahesab' | 'zarrin'), a plain string like\n// SMS_PROVIDER so a new driver needs no migration. Links are per provider, so\n// switching provider and back loses nothing.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AccountingEntityType {\n CUSTOMER\n PRODUCT\n}\n\n/// One app row ↔ one record in the accounting software (customer account or\n/// کارساخته).\nmodel AccountingLink {\n id String @id @default(cuid())\n provider String\n entityType AccountingEntityType\n entityId String\n /// The record's code in the accounting software (Tahesab Moshtari_Code /\n /// Zarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\n externalCode String\n externalName String?\n /// How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\n /// row created from the accounting record), PUSHED (accounting record created\n /// from the app row) or MANUAL (an admin typed the code).\n origin String\n /// The record as last read, for display only.\n snapshot Json?\n syncedAt DateTime @default(now())\n createdAt DateTime @default(now())\n\n @@unique([provider, entityType, entityId])\n @@unique([provider, entityType, externalCode])\n @@index([entityType, entityId])\n}\n\nenum AccountingOutboxKind {\n CUSTOMER_PUSH\n PRODUCT_PUSH\n ORDER_DOCUMENT\n ORDER_DOCUMENT_DELETE\n}\n\nenum AccountingOutboxStatus {\n PENDING\n /// A call was in flight. Found at startup, it means the process died mid-call\n /// and the outcome is unknown — see AccountingOutboxWorker.\n SENDING\n SENT\n FAILED\n /// Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\n /// idempotency key, so a blind retry could post the document twice).\n NEEDS_REVIEW\n /// Closed by an admin from the log screen.\n RESOLVED\n}\n\n/// Work to push to the accounting software. Written in the SAME transaction as\n/// the change that causes it, so an outage of the accounting software never\n/// loses an event and never blocks the app.\nmodel AccountingOutbox {\n id String @id @default(cuid())\n provider String\n kind AccountingOutboxKind\n entityId String\n status AccountingOutboxStatus @default(PENDING)\n attempts Int @default(0)\n nextAttemptAt DateTime @default(now())\n lastError String?\n /// What the accounting software returned as the document/record id.\n externalRef String?\n /// Per-step progress of multi-call jobs (a Zarrin document is one call per\n /// line), so a failure resumes where it stopped.\n progress Json?\n /// Last request/response, for the log screen. Never contains the token.\n lastRequest Json?\n lastResponse Json?\n sentAt DateTime?\n resolvedById String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([status, nextAttemptAt])\n @@index([kind, entityId])\n}\n\n/// Something a pull found that needs a human: an account with no mobile, two\n/// accounts sharing one mobile, a کارساخته group with no category mapping.\nmodel AccountingIssue {\n id String @id @default(cuid())\n provider String\n kind String\n externalCode String\n entityId String?\n message String\n data Json?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n resolvedAt DateTime?\n\n @@unique([provider, kind, externalCode])\n @@index([resolvedAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Promotions / discounts — legacy views/promotion/*, served by\n// PromotionController (`product/variant/promotion`). The redesigned schema had\n// no promotion concept at all; this models what the legacy forms actually\n// collect.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy Promotion.type — what the discount is scoped to.\nenum PromotionScope {\n PRODUCT // 1 محصولات\n CATEGORY // 2 دسته بندی\n CUSTOMER // 3 مشتری\n BRAND // 4 برند\n}\n\n/// Legacy Promotion.use_only — how often a customer may redeem it.\nenum PromotionUsage {\n ONCE // 1 فقط یکبار\n UNTIL_END_DATE // 2 تا تاریخ پایان\n}\n\nmodel Promotion {\n id String @id @default(cuid())\n title String\n description String?\n scope PromotionScope @default(PRODUCT)\n usage PromotionUsage @default(ONCE)\n /// Percentage off, 0-100 (legacy discount_percent).\n discountPercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n /// Which storefront it shows on, mirroring Product.showType (legacy platform).\n platform Int @default(3)\n\n startsAt DateTime?\n endsAt DateTime?\n\n /// Exactly one of these is populated, per `scope`.\n productId String?\n product Product? @relation(fields: [productId], references: [id])\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n customerId String?\n customer Customer? @relation(fields: [customerId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([scope, isActive])\n}\n\n/// Legacy \"ignore\" table (views/offersIgnore) — specific products, categories,\n/// customers or brands excluded from the automatic discount engine.\n/// Legacy posts { type, item_id[] }: \"type\" reuses the promotion scope codes\n/// (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \"itemId\" is the excluded row.\nmodel PromotionExclusion {\n id String @id @default(cuid())\n type Int\n itemId String\n createdAt DateTime @default(now())\n\n @@unique([type, itemId])\n @@index([type])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Branch stock allocation — legacy views/invoice/* (\"فاکتور انتقال\"), served by\n// BranchController as `branch/product`. Despite the screen being called an\n// invoice, it is not a sales document: it records which products head office\n// allocated to a branch, and who allocated them.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel BranchAllocation {\n id String @id @default(cuid())\n branchId String\n branch Branch @relation(fields: [branchId], references: [id])\n\n /// Legacy `allocator_user` — the admin who filed the allocation.\n allocatorAdminId String? @map(\"allocatorAdminUserId\")\n allocatorAdmin Admin? @relation(\"AllocationAuthor\", fields: [allocatorAdminId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n items BranchAllocationItem[]\n\n @@index([branchId])\n}\n\nmodel BranchAllocationItem {\n id String @id @default(cuid())\n allocationId String\n allocation BranchAllocation @relation(fields: [allocationId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id])\n /// Weight snapshot at allocation time, so later catalog edits do not rewrite history.\n weightGrams Decimal? @db.Decimal(14, 4)\n\n @@unique([allocationId, productId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Messaging + audit — legacy views/sms, views/notify, views/newsletters and\n// views/statics. None of these had a model in the redesigned schema.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Who an SMS or notification was aimed at. Legacy's sms/create offered these\n/// audiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\nenum MessageAudience {\n SINGLE_NUMBER // یک شماره\n MULTIPLE_NUMBERS // چند شماره\n ALL_CUSTOMERS // همه\n WHOLESALE_CUSTOMERS // عمده\n RETAIL_CUSTOMERS // تک\n SALES_AGENTS // کارشناسان فروش\n}\n\nmodel SmsMessage {\n id String @id @default(cuid())\n audience MessageAudience\n /// Comma-separated recipients for the SINGLE/MULTIPLE audiences.\n recipients String?\n body String\n /// How many numbers the send actually resolved to.\n sentCount Int @default(0)\n\n sentByAdminId String? @map(\"sentByAdminUserId\")\n sentByAdmin Admin? @relation(\"SmsAuthor\", fields: [sentByAdminId], references: [id])\n\n createdAt DateTime @default(now())\n\n @@index([createdAt])\n}\n\nmodel Notification {\n id String @id @default(cuid())\n title String\n body String\n audience MessageAudience @default(ALL_CUSTOMERS)\n\n sentByAdminId String? @map(\"sentByAdminUserId\")\n sentByAdmin Admin? @relation(\"NotificationAuthor\", fields: [sentByAdminId], references: [id])\n\n createdAt DateTime @default(now())\n\n recipients NotificationRecipient[]\n\n @@index([createdAt])\n}\n\n/// Per-customer delivery + read state — legacy `GET notify/read/{id}`.\nmodel NotificationRecipient {\n id String @id @default(cuid())\n notificationId String\n notification Notification @relation(fields: [notificationId], references: [id], onDelete: Cascade)\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n readAt DateTime?\n\n @@unique([notificationId, customerId])\n @@index([customerId, readAt])\n}\n\n/// Legacy views/newsletters — the mailing-list signups collected by the site.\nmodel NewsletterSubscriber {\n id String @id @default(cuid())\n email String?\n mobile String?\n createdAt DateTime @default(now())\n\n @@unique([email])\n @@unique([mobile])\n}\n\n/// Legacy views/statics — the customer activity log the \"آمار\" screen reads\n/// (`log/list/customer`, `log/ago/{customerId}`).\nmodel CustomerActivityLog {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n /// Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\n action String\n detail String?\n createdAt DateTime @default(now())\n\n @@index([customerId, createdAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Uploads — replaces the legacy MyUpload / SingleUploadInput widgets, which\n// POSTed to a file endpoint and stored the returned URL on the owning record.\n// Ports of those forms currently take a URL by hand; this gives them a real\n// destination to upload to.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UploadedFile {\n id String @id @default(cuid())\n /// Public URL the stored file is served from.\n url String\n originalName String\n mimeType String\n sizeBytes Int\n /// Free-form tag for what the file belongs to, e.g. 'product', 'category',\n /// 'customer.nationalId'. Kept loose so a new form needs no schema change.\n purpose String?\n\n uploadedByAdminId String? @map(\"uploadedByAdminUserId\")\n uploadedByAdmin Admin? @relation(\"FileUploader\", fields: [uploadedByAdminId], references: [id])\n\n createdAt DateTime @default(now())\n customerAvatars Customer[] @relation(\"CustomerAvatar\")\n adminUserAvatars AdminUser[] @relation(\"AdminUserAvatar\")\n\n @@index([purpose])\n}\n\n/// One OTP login challenge for a customer.\n///\n/// Ports henza_server's flow (ApiMobileController.php:39-78), where userAuth\n/// generated rand(1000,9999), stored it on the customer row as `send_password`\n/// and sent it by SMS, and userVerfiy compared the submitted code against it\n/// (mismatch -> HTTP 422).\n///\n/// Three deliberate improvements over the reference, approved by the user\n/// (docs/parity/DECISIONS.md D6 and T1):\n/// 1. the code is stored as a bcrypt hash, never in plain text — the\n/// reference kept it readable in a customer column;\n/// 2. it expires (`expiresAt`) — the reference's code stayed valid forever;\n/// 3. attempts are counted and the challenge locks out — the reference had\n/// no limit at all.\n/// The parity behaviour itself is the code comparison and the rejection.\nmodel CustomerOtp {\n id String @id @default(cuid())\n /// Normalised to English digits before storing, as the reference does with\n /// Utility::faTOen() on both send and verify.\n mobile String\n customerId String\n customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)\n\n /// bcrypt hash of the 4-digit code. Never the code itself.\n codeHash String\n expiresAt DateTime\n /// Failed verify attempts against THIS challenge.\n attempts Int @default(0)\n /// Set when the code is accepted, so one challenge cannot be reused.\n consumedAt DateTime?\n\n /// Kept for the per-IP send throttle.\n requestIp String?\n createdAt DateTime @default(now())\n\n @@index([mobile, createdAt])\n @@index([customerId])\n @@index([expiresAt])\n}\n\n/// Bespoke migration ledger left by the EARLIER, pre-Prisma port.\n///\n/// It predates Prisma Migrate in this repo and holds 12 historical rows\n/// (`0001_init.sql`, `0002_admin_schema.sql`, `seed:initial`, and the early\n/// `2026091…` migrations). It is the only record of how that port was applied,\n/// so it is **kept and never written to or deleted from** (DEAD-07).\n///\n/// It is declared here purely so `prisma migrate diff` stops proposing\n/// `DROP TABLE \"_goldbank_migrations\"` — an undeclared table reads as drift.\n/// `@@ignore` keeps it out of Prisma Client: nothing in the application should\n/// ever read or write it, and Prisma Migrate will not manage its shape either.\n///\n/// Prisma's own ledger is `_prisma_migrations`, which is separate and is never\n/// edited by hand (D14).\nmodel goldbank_migrations {\n name String @id\n appliedAt DateTime @default(now()) @map(\"applied_at\") @db.Timestamptz(6)\n\n @@map(\"_goldbank_migrations\")\n @@ignore\n}\n", + "inlineSchemaHash": "10ad1bc4a821d684d83386a2c37bcf3e456d62228210ecd06ea12b67f136467e", "copyEngine": true } @@ -867,7 +882,7 @@ if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { config.isBundled = true } -config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Restrict\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"percent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy cities.percent / percent_aux — per-city wage surcharges the city\\\\nscreen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\"},{\"name\":\"percentAux\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertProfiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `cities` is a tree (country > province > city > district) and so is\\\\nthis: a city hangs under its `parent`. In the admin pickers a top-level row\\\\n(the country) is a heading, not selectable (henza_admin citiesModel.js:38).\"},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\\\\nmigration 20260922180000. Prisma cannot see it, so a write here may store\\\\nsomething other than what you passed:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; the submitted fullName is\\\\ndiscarded\\\\n\\\\nRe-read after writing if you need the stored value. Same arrangement as\\\\nCustomer (D0 requirement 7 — the split applies to ALL admins, not only\\\\nsales experts).\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\\\\nthe coarse `role` enum above is retained for the business rules that already\\\\nswitch on it. Nullable so existing seeded admins remain valid.\"},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy stored a sales agent as a `customers` row with type=1, so\\\\nReagentCustomer.vue's shared form collected these alongside the\\\\nwholesale-customer fields. A sales agent is now an AdminUser\\\\n(role=SALES_EXPERT), so these live here instead — only ever set for that\\\\nrole; every other AdminUser leaves them null.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"creditedOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Orders credited to this sales expert — see Order.salesAgentId.\"},{\"name\":\"supervisedWorkshops\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchAllocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentSmsMessages\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SmsMessage\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentNotifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"FileUploader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertProfile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Only ever set for role = SALES_EXPERT (D17).\"},{\"name\":\"sessions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminSession\",\"relationName\":\"AdminSessionToAdminUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Issued admin-panel tokens, recorded only while session tracking is on\\\\n(AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\\\\ntoken can be revoked before it expires. See AdminSession.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AppSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"subjectId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Customer.id, or AdminUser.id when subjectType is \\\"sales-expert\\\".\"},{\"name\":\"subjectType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was confirmed by the central IAM: its session id (`sid`)\\\\nand stable user id (`sub`), which is what a back-channel logout arrives with.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued APP token (customer app / sales-expert app), so it can be revoked\\\\nbefore it expires — the counterpart of AdminSession for the other token family.\\\\n\\\\nWHY A SEPARATE TABLE AND NO FOREIGN KEY\\\\n---------------------------------------\\\\nAn app token's `sub` is a Customer id for a customer and an **AdminUser id**\\\\nfor a sales expert (D21). One FK cannot point at two tables, so the subject is\\\\nstored as a plain id plus its type. The rows are short-lived operational data,\\\\nnot part of the accounting model, so the missing FK costs nothing here.\"},\"AdminSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminSessionToAdminUser\",\"relationFromFields\":[\"adminUserId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was verified by the IAM: its session id (`sid`) and the\\\\nstable user id (`sub`) there. Back-channel logout arrives keyed by these —\\\\ndeliberately here rather than as columns on AdminUser, so enabling the\\\\nfeature needs no change to an existing table.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued admin-panel JWT, so it can be revoked before it expires.\\\\n\\\\nWHY THIS EXISTS\\\\n---------------\\\\nThe admin token is self-contained and valid for 12h, which means nothing —\\\\nnot disabling the account, not a central \\\"sign out everywhere\\\" — could cut a\\\\nsession short: the token kept working until it expired. With the central IAM\\\\nin the loop that gap became visible (an IAM session revocation had no effect\\\\nhere), so every issued token now carries a `jti` recorded on this table and\\\\nJwtStrategy refuses a token whose row is revoked.\\\\n\\\\nRows are written ONLY while tracking is enabled, and JwtStrategy only\\\\nenforces them while it is enabled, so a deployment that does not want the\\\\nextra lookup behaves exactly as before.\"},\"SalesExpertProfile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[\"adminUserId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.city_id — a filterable grid column\\\\n(ReagentListModel.js:14) and the source of the commission autofill\\\\n(ReagentCustomer.vue:215-228).\"},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"gramLevel\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\\\\nDecimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\\\\ncredit limit has identical precision on both tables.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\\\\nstores both and reads neither back; kept so the form matches it. Neither\\\\nis unique and neither has a validation rule in the reference — inventing\\\\none would reject data the reference accepts.\"},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"tradingCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The Customer row carrying this expert's OWN orders, debt and credit limit.\\\\n\\\\nThe reference stored a sales agent AS a Customer (type=1), so an order the\\\\nagent placed from the app was simply their own, against their own\\\\ngram_level (ApiMobileController.php:534-535). Here the expert is an\\\\nAdminUser (D17), which has no ledger and cannot be an Order's subject, so\\\\nthis one linked Customer plays that part.\\\\n\\\\nDistinct from the expert's REFERRED customers, which are ordinary Customer\\\\nrows pointing at the AdminUser through Customer.referredByAgentId.\\\\n\\\\nNull until the expert first signs into the app, when it is created from\\\\nthis profile. See D21.\"},{\"name\":\"tradingCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[\"tradingCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"The sales-expert fields legacy kept on the `customers` row (type=1) and that\\\\nwere lost when a sales expert became an AdminUser (D17).\\\\n\\\\nA separate table rather than columns on AdminUser: these are meaningful only\\\\nfor role = SALES_EXPERT and would be permanently null for every other admin.\\\\nA row is created for every SALES_EXPERT by the migration, and upserted by the\\\\nservice whenever one is created or a user's role becomes SALES_EXPERT — but\\\\nreaders still left-join, so a missing profile degrades to nulls rather than\\\\ndropping the agent from the grid.\\\\n\\\\n`reagent_id` is deliberately NOT here — see D17: in the reference it was a\\\\nside effect of the shared customers form, and filling it removed that expert\\\\nfrom the selectable-agent list (queryReagent, AdminController.php:420).\"},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\\\\nTRIGGER — `customer_sync_full_name`, created in migration\\\\n20260922120000_customer_name_parts. Prisma does not know about it, so a\\\\nwrite here is NOT the whole story:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; fullName is overwritten\\\\nwith \\\"first last\\\" and whatever you passed for fullName is discarded\\\\n\\\\nSo a value you wrote can differ from the value that lands in the row.\\\\nRe-read after writing if you need the stored value. Prefer writing the\\\\nparts; `fullName` exists for the legacy readers that predate D0.\\\\n\\\\nReference has these as two columns from the start\\\\n(henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\\\\nthe port collapsed them, which is the D0 defect.\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\\\\nlegacy customers has a national code (1595/1595 empty), and fabricating\\\\none is a data violation that would block later legal identity checks\\\\n(owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\\\\nthe migration tool must write NULL and never '', which would collide on\\\\nthe second row.\\\\n\\\\nThree service-layer workarounds exist ONLY because this used to be\\\\nrequired, and they store the MOBILE NUMBER here:\\\\nadmin-customers.service.ts:625,685 and customer-auth.service.ts:258.\\\\nRetiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\"},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityNameRaw\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.new_city — the city name exactly as the customer typed it\\\\nat app sign-up (Major/CustomerController.php:36). Kept verbatim because\\\\nthe legacy city table has only 15 rows, so the typed name is often the only\\\\nrecord of where the customer is (172 customers; 43 match no known city).\\\\ncityId is set alongside it only on an exact, ي/ك-normalised name match.\\\\nLegacy sign-up also forced city_id = 5 (Tehran) on everyone\\\\n(Major/CustomerController.php:21), so for those rows the typed name, not\\\\ncityId, is the truth. Owner ruling 2026-10-07: keep both.\"},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CustomerKind\",\"default\":\"APP_SHOPKEEPER\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\\\\nBankerList / ShopkeeperList screens filter on.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy contact + shop columns, shown on the wholesale customer form and as\\\\n(hidden-by-default) columns in its grid.\"},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy mcode — the operator-assigned customer code.\"},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertTradingFor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set only on the one Customer row that acts as a sales expert's own trading\\\\naccount (see SalesExpertProfile.tradingCustomerId). Empty for every\\\\nordinary customer.\"},{\"name\":\"referredOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy orders that named THIS customer as their referrer — see\\\\nOrder.referrerCustomerId. History only.\"},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingGoldBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Balance as last read from the accounting software (D27), in the app's own\\\\nsign convention (positive = owes). Shown to the customer when the\\\\nintegration is on; the credit-limit check still uses goldDebtGrams above.\\\\nNull until the first successful sync.\"},{\"name\":\"accountingRialBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingBalanceAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"makingChargeOffsetPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `customers.percent` — the per-customer making-charge offset. It is\\\\nADDED to the variant's making charge when pricing an order line\\\\n(henza_pwa src/Mixins/product/index.ts:69-75:\\\\ngetWage(v) = state.percent + v.percentage_pay)\\\\nand it shifts the catalogue making-charge filter bounds\\\\n(ApiMobileController.php:391-396,76-77). It is NOT part of the price\\\\nformula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\\\\n\\\\nNOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\\\\nNOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\\\\n\\\\nDB default 0 keeps every existing customer's price unchanged. The\\\\nreference's application-layer default for NEW customers is 3\\\\n(AdminController.php:338) and the field is required on create (:354).\"},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationRejectionReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Why verification was rejected (VerificationStep.REJECTED).\\\\n\\\\nLegacy recorded NO reason: none of its 49 `customers` columns is a\\\\nreason/note field, and on rejection it only sent a fixed SMS. So the 14\\\\nrows migrated from the legacy system carry the sentinel\\\\n«رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\\\\nknows why it is blank (owner ruling 2026-10-07). The migration tool\\\\nwrites it only WHERE this IS NULL, so a re-run cannot overwrite a real\\\\nreason entered in the new system.\"},{\"name\":\"verificationRejectedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"NULL for rows migrated from the legacy system — it recorded no rejection time.\"},{\"name\":\"birthDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\\\\nbirthday SMS / loyalty campaigns (owner ruling 2026-10-07).\\\\n\\\\n⚠ Legacy stores dates as JALALI STRINGS in other tables\\\\n(cashes.recive_date is varchar, 88/89 values starting \\\"14…\\\"), so this\\\\ntimestamp may hold mis-entered Jalali years. Confirm the calendar with\\\\ndocs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\\\\nwould produce 917 wrong birthdays, worse for an SMS campaign than none.\"},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\\\\nform. Legacy stored an FK to its Image table and read it back as a nested\\\\n`image: { id, image }`, so this is a relation, not a bare URL string.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canPlaceOrders\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had TWO independent switches on a customer:\\\\nsts -> may they place orders (this field)\\\\nactive -> is the account enabled (isActive, below)\\\\nThe port previously drove both from isActive; they are separate again.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isArchived\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy archive flag — the archived list filtered on this, not on isActive.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activityLogs\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerActivityLog\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"otpChallenges\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerOtp\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favorites\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerFavorite\":{\"dbName\":null,\"fields\":[{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"customerId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `fav` (251 rows) — saved products. The target had no model for this,\\\\nso every customer's favourites would have been lost in the migration; the\\\\nowner confirmed on 2026-10-06 that they matter.\\\\n\\\\nLegacy `fav` has two columns and NO primary key. The composite key here\\\\nsupplies the constraint the source lacks (the precheck found 0 duplicate\\\\npairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\\\\nat a deleted customer and must be skipped.\\\\n\\\\nLegacy's denormalised `product.count_fav` counter is deliberately NOT\\\\nrecreated as a column — derive it from this table.\"},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Branch.address / phone — both are columns in the branch grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy GET branch/active/{id} toggles this.\"},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Workshop.address / phone — both are columns in the workshop grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The supervisor created alongside the workshop by the legacy Add form.\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[\"supervisorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":1,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.type — which storefront the category belongs to:\\\\n1 سایت | 2 اپلیکشن موبایل. Drives the \\\"type_str\\\" grid column.\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.image / icon — the grid renders the image, the storefront the icon.\"},{\"name\":\"iconUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"metaTag\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy meta tag + description, used for SEO on the site categories.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.product_code — the human-facing SKU shown in the grid.\"},{\"name\":\"showType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.show_type: 1 site, 2 mobile, 3 both.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockWeight\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Stock of the linked کارساخته as last read from the accounting software\\\\n(D27). Weight for gram-type items, count for count-type ones — whichever\\\\nthe software reports. At zero or below the product is unavailable in the\\\\napp (pre-order variants excepted). Null = not linked or never synced.\"},{\"name\":\"accountingStockCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favoritedBy\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"ProductImageRole\",\"default\":\"GALLERY\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\\\\nگالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\\\\nexisting rows and any generic \\\"just attach an image\\\" caller keep working.\"},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Variants that display this image. A gallery image may back several\\\\nvariants (one photo, several weights), which is why this is a plain\\\\none-to-many and not a join table.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"qty\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\\\\nqty 0 unless it is flagged pre-order, so both fields are required for that\\\\nguard to work (see apps/admin-panel/src/stores/cart.ts).\"},{\"name\":\"isPreOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy is_pre_order: orderable even at zero stock.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"color\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\"},{\"name\":\"rialWage\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy rial_pay — fixed Rial making charge per variant.\"},{\"name\":\"details\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy details — short description for variant.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy description — full description for variant.\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The gallery image shown for this variant, picked from its own product's\\\\nimages — never a re-uploaded copy. onDelete: SetNull because dropping an\\\\nimage must never cascade into the variant: OrderItem rows reference\\\\nvariants, so losing one would break order history.\"},{\"name\":\"image\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[\"imageId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channel\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderChannel\",\"default\":\"RETAIL\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which sales channel placed this order — see OrderChannel.\"},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The sales expert this order is credited to, fixed when it is placed:\\\\nthe customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\\\\nset once at creation (ApiMobileController.php:601) and never moved, so a\\\\ncustomer changing expert later does not move past sales or commission\\\\n(owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\\\\ncustomer's current referrer.\"},{\"name\":\"salesAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[\"salesAgentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referrerCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"History only: a legacy order whose `reagent_id` named a customer who is\\\\nnot a sales expert (one such customer, 17 orders in 2022). Legacy counted\\\\nthose orders in that customer's own «میزان فروش»; this keeps that figure\\\\nexact. Never set for a new order.\"},{\"name\":\"referrerCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[\"referrerCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[\"postedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"labName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Instrument metadata from the legacy \\\"cash\\\" document form. Which fields are\\\\nfilled depends on sourceType: a melted-gold receipt carries lab/hallmark and\\\\nthe pre-normalization weight, a cheque carries the account and bank, and a\\\\ntransfer carries its destination.\\\\nLegacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\"},{\"name\":\"hallmark\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bankName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transferTo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"originalValue\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight as handed over, BEFORE karat normalization (legacy original_value).\"},{\"name\":\"priceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Rial amount for cash/cheque documents (legacy price).\"},{\"name\":\"receivedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"},\"UserType\":{\"dbName\":\"user_type\",\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\\\\nrows keep their legacy identity rather than getting new cuids.\"},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"permissions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Permission\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Permission\":{\"dbName\":\"permission\",\"fields\":[{\"name\":\"rid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Dotted permission id, e.g. \\\"order.list\\\", \\\"persons.list.client.omde\\\".\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"rid\",\"userTypeId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Comment\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CommentStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replyToId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `reply_to`: a staff reply threads under the comment it answers.\"},{\"name\":\"replyTo\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[\"replyToId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replies\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Setting\":{\"dbName\":null,\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AccountingLink\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingEntityType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record's code in the accounting software (Tahesab Moshtari_Code /\\\\nZarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\"},{\"name\":\"externalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"origin\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\\\\nrow created from the accounting record), PUSHED (accounting record created\\\\nfrom the app row) or MANUAL (an admin typed the code).\"},{\"name\":\"snapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record as last read, for display only.\"},{\"name\":\"syncedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"entityType\",\"entityId\"],[\"provider\",\"entityType\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"entityId\"]},{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"One app row ↔ one record in the accounting software (customer account or\\\\nکارساخته).\"},\"AccountingOutbox\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingOutboxKind\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"AccountingOutboxStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nextAttemptAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastError\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalRef\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"What the accounting software returned as the document/record id.\"},{\"name\":\"progress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Per-step progress of multi-call jobs (a Zarrin document is one call per\\\\nline), so a failure resumes where it stopped.\"},{\"name\":\"lastRequest\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Last request/response, for the log screen. Never contains the token.\"},{\"name\":\"lastResponse\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"resolvedById\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Work to push to the accounting software. Written in the SAME transaction as\\\\nthe change that causes it, so an outage of the accounting software never\\\\nloses an event and never blocks the app.\"},\"AccountingIssue\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"message\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"data\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"resolvedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"kind\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"kind\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"Something a pull found that needs a human: an account with no mobile, two\\\\naccounts sharing one mobile, a کارساخته group with no category mapping.\"},\"Promotion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scope\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionScope\",\"default\":\"PRODUCT\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"usage\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionUsage\",\"default\":\"ONCE\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Percentage off, 0-100 (legacy discount_percent).\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"platform\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which storefront it shows on, mirroring Product.showType (legacy platform).\"},{\"name\":\"startsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Exactly one of these is populated, per `scope`.\"},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PromotionExclusion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"itemId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"type\",\"itemId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"type\",\"itemId\"]}],\"isGenerated\":false,\"documentation\":\"Legacy \\\"ignore\\\" table (views/offersIgnore) — specific products, categories,\\\\ncustomers or brands excluded from the automatic discount engine.\\\\nLegacy posts { type, item_id[] }: \\\"type\\\" reuses the promotion scope codes\\\\n(1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \\\"itemId\\\" is the excluded row.\"},\"BranchAllocation\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocatorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `allocator_user` — the admin who filed the allocation.\"},{\"name\":\"allocatorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[\"allocatorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"BranchAllocationItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocation\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[\"allocationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"weightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight snapshot at allocation time, so later catalog edits do not rewrite history.\"}],\"primaryKey\":null,\"uniqueFields\":[[\"allocationId\",\"productId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"allocationId\",\"productId\"]}],\"isGenerated\":false},\"SmsMessage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MessageAudience\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Comma-separated recipients for the SINGLE/MULTIPLE audiences.\"},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How many numbers the send actually resolved to.\"},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"MessageAudience\",\"default\":\"ALL_CUSTOMERS\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"NotificationRecipient\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notificationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notification\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[\"notificationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"readAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"notificationId\",\"customerId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"notificationId\",\"customerId\"]}],\"isGenerated\":false,\"documentation\":\"Per-customer delivery + read state — legacy `GET notify/read/{id}`.\"},\"NewsletterSubscriber\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"email\"],[\"mobile\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"email\"]},{\"name\":null,\"fields\":[\"mobile\"]}],\"isGenerated\":false,\"documentation\":\"Legacy views/newsletters — the mailing-list signups collected by the site.\"},\"CustomerActivityLog\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"action\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\"},{\"name\":\"detail\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy views/statics — the customer activity log the \\\"آمار\\\" screen reads\\\\n(`log/list/customer`, `log/ago/{customerId}`).\"},\"UploadedFile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Public URL the stored file is served from.\"},{\"name\":\"originalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mimeType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeBytes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"purpose\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form tag for what the file belongs to, e.g. 'product', 'category',\\\\n'customer.nationalId'. Kept loose so a new form needs no schema change.\"},{\"name\":\"uploadedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"FileUploader\",\"relationFromFields\":[\"uploadedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerOtp\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Normalised to English digits before storing, as the reference does with\\\\nUtility::faTOen() on both send and verify.\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"codeHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"bcrypt hash of the 4-digit code. Never the code itself.\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Failed verify attempts against THIS challenge.\"},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the code is accepted, so one challenge cannot be reused.\"},{\"name\":\"requestIp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Kept for the per-IP send throttle.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"One OTP login challenge for a customer.\\\\n\\\\nPorts henza_server's flow (ApiMobileController.php:39-78), where userAuth\\\\ngenerated rand(1000,9999), stored it on the customer row as `send_password`\\\\nand sent it by SMS, and userVerfiy compared the submitted code against it\\\\n(mismatch -> HTTP 422).\\\\n\\\\nThree deliberate improvements over the reference, approved by the user\\\\n(docs/parity/DECISIONS.md D6 and T1):\\\\n1. the code is stored as a bcrypt hash, never in plain text — the\\\\nreference kept it readable in a customer column;\\\\n2. it expires (`expiresAt`) — the reference's code stayed valid forever;\\\\n3. attempts are counted and the challenge locks out — the reference had\\\\nno limit at all.\\\\nThe parity behaviour itself is the code comparison and the rejection.\"}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"CustomerKind\":{\"values\":[{\"name\":\"SALES_AGENT\",\"dbName\":null},{\"name\":\"APP_SHOPKEEPER\",\"dbName\":null},{\"name\":\"WALK_IN_SHOPKEEPER\",\"dbName\":null},{\"name\":\"BANKER\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"RETAIL\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Customer.type — what kind of wholesale customer this is. Values and\\\\nlabels taken verbatim from bulkCustomer.vue's userTypes list.\\\\n\\\\nSALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\\\\nCustomer row with type=1, but the redesigned system models a sales agent\\\\nas an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\\\\nand admin-customers.service.ts's listReagents()/create(). No Customer row\\\\nshould be created with kind SALES_AGENT going forward; the value is kept\\\\nonly so legacyTypeToKind()/kindToLegacyType() stay total functions and any\\\\nalready-migrated data keeps a readable label.\\\\n\\\\nRETAIL marks a \\\"تک\\\" (single/retail) customer — legacy kept these in an\\\\nentirely separate table (SingleCustomer/`login`) that could never contain\\\\na wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\\\\ninto one Customer model, so this value is what listSingle() now filters on\\\\nto reproduce that same separation.\"},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null,\"documentation\":\"Legacy had THREE states per step, not two\\\\n(MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\\\\n3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\\\\ncases back in the review queue, so the owner ruled it out (2026-10-07).\\\\n14 legacy rows land here; see Customer.verificationRejectionReason.\"}],\"dbName\":null},\"OrderChannel\":{\"values\":[{\"name\":\"RETAIL\",\"dbName\":null},{\"name\":\"WHOLESALE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy kept retail and wholesale orders in two SEPARATE tables\\\\n(orders_orders vs orders). The redesigned schema has one Order model, so the\\\\ndistinction lives here instead.\"},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null},\"ProductImageRole\":{\"values\":[{\"name\":\"FEATURED\",\"dbName\":null},{\"name\":\"FEATURED_MOBILE\",\"dbName\":null},{\"name\":\"GALLERY\",\"dbName\":null},{\"name\":\"GALLERY_MOBILE\",\"dbName\":null}],\"dbName\":null},\"CommentStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"APPROVED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null}],\"dbName\":null},\"AccountingEntityType\":{\"values\":[{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"PRODUCT\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxKind\":{\"values\":[{\"name\":\"CUSTOMER_PUSH\",\"dbName\":null},{\"name\":\"PRODUCT_PUSH\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT_DELETE\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"SENDING\",\"dbName\":null,\"documentation\":\"A call was in flight. Found at startup, it means the process died mid-call\\\\nand the outcome is unknown — see AccountingOutboxWorker.\"},{\"name\":\"SENT\",\"dbName\":null},{\"name\":\"FAILED\",\"dbName\":null},{\"name\":\"NEEDS_REVIEW\",\"dbName\":null,\"documentation\":\"Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\\\\nidempotency key, so a blind retry could post the document twice).\"},{\"name\":\"RESOLVED\",\"dbName\":null,\"documentation\":\"Closed by an admin from the log screen.\"}],\"dbName\":null},\"PromotionScope\":{\"values\":[{\"name\":\"PRODUCT\",\"dbName\":null},{\"name\":\"CATEGORY\",\"dbName\":null},{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"BRAND\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.type — what the discount is scoped to.\"},\"PromotionUsage\":{\"values\":[{\"name\":\"ONCE\",\"dbName\":null},{\"name\":\"UNTIL_END_DATE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.use_only — how often a customer may redeem it.\"},\"MessageAudience\":{\"values\":[{\"name\":\"SINGLE_NUMBER\",\"dbName\":null},{\"name\":\"MULTIPLE_NUMBERS\",\"dbName\":null},{\"name\":\"ALL_CUSTOMERS\",\"dbName\":null},{\"name\":\"WHOLESALE_CUSTOMERS\",\"dbName\":null},{\"name\":\"RETAIL_CUSTOMERS\",\"dbName\":null},{\"name\":\"SALES_AGENTS\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Who an SMS or notification was aimed at. Legacy's sms/create offered these\\\\naudiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\"}},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Restrict\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"percent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy cities.percent / percent_aux — per-city wage surcharges the city\\\\nscreen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\"},{\"name\":\"percentAux\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertProfiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `cities` is a tree (country > province > city > district) and so is\\\\nthis: a city hangs under its `parent`. In the admin pickers a top-level row\\\\n(the country) is a heading, not selectable (henza_admin citiesModel.js:38).\"},\"Admin\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Never SALES_EXPERT — that role lives in AdminUser. Enforced in\\\\nAdminUsersService, not in the database, so the enum stays shared.\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisedWorkshops\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchAllocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentSmsMessages\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SmsMessage\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentNotifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"FileUploader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sessions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminSession\",\"relationName\":\"AdminToAdminSession\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Issued admin-panel tokens, recorded only while session tracking is on\\\\n(AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a\\\\ntoken can be revoked before it expires. See AdminSession.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"A staff account for the ADMIN PANEL — and nothing else.\\\\n\\\\nSplit out of AdminUser (which now holds sales experts only) so that:\\\\n* the same mobile can be an admin AND a sales expert — they are two\\\\nseparate roles, each unique only within its own table;\\\\n* the expert table (production: ~12,000 rows) is never written by panel\\\\nstaff management.\\\\nMigration 20261026120000_split_admin_table copies the existing non-expert\\\\nAdminUser rows here WITH THEIR IDS, so issued panel tokens and every\\\\n\\\"who did this\\\" column keep resolving. The old rows are left in AdminUser,\\\\ndormant; no code reads them as admins any more.\\\\n\\\\n⚠️ fullName/firstName/lastName are kept in sync by the DB trigger\\\\n`admin_sync_full_name_trg` (it shares the function admin_user_sync_full_name) — same semantics as AdminUser: the parts win.\"},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ Kept in sync BY A DATABASE TRIGGER — `admin_user_sync_full_name`, from\\\\nmigration 20260922180000. Prisma cannot see it, so a write here may store\\\\nsomething other than what you passed:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; the submitted fullName is\\\\ndiscarded\\\\n\\\\nRe-read after writing if you need the stored value. Same arrangement as\\\\nCustomer (D0 requirement 7 — the split applies to ALL admins, not only\\\\nsales experts).\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\\\\nthe coarse `role` enum above is retained for the business rules that already\\\\nswitch on it. Nullable so existing seeded admins remain valid.\"},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy stored a sales agent as a `customers` row with type=1, so\\\\nReagentCustomer.vue's shared form collected these alongside the\\\\nwholesale-customer fields. A sales agent is now an AdminUser\\\\n(role=SALES_EXPERT), so these live here instead — only ever set for that\\\\nrole; every other AdminUser leaves them null.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"creditedOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Orders credited to this sales expert — see Order.salesAgentId.\"},{\"name\":\"salesExpertProfile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Only ever set for role = SALES_EXPERT (D17).\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"A SALES EXPERT (role SALES_EXPERT). Panel staff live in `Admin`; rows here with\\\\nany other role are pre-split leftovers and are ignored by the code.\"},\"AppSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"subjectId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Customer.id, or AdminUser.id when subjectType is \\\"sales-expert\\\".\"},{\"name\":\"subjectType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was confirmed by the central IAM: its session id (`sid`)\\\\nand stable user id (`sub`), which is what a back-channel logout arrives with.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued APP token (customer app / sales-expert app), so it can be revoked\\\\nbefore it expires — the counterpart of AdminSession for the other token family.\\\\n\\\\nWHY A SEPARATE TABLE AND NO FOREIGN KEY\\\\n---------------------------------------\\\\nAn app token's `sub` is a Customer id for a customer and an **AdminUser id**\\\\nfor a sales expert (D21). One FK cannot point at two tables, so the subject is\\\\nstored as a plain id plus its type. The rows are short-lived operational data,\\\\nnot part of the accounting model, so the missing FK costs nothing here.\"},\"AdminSession\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"jti\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The token's `jti` claim. Unique: one row per issued token.\"},{\"name\":\"adminId\",\"dbName\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"admin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToAdminSession\",\"relationFromFields\":[\"adminId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"iamSessionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the login was verified by the IAM: its session id (`sid`) and the\\\\nstable user id (`sub`) there. Back-channel logout arrives keyed by these —\\\\ndeliberately here rather than as columns on AdminUser, so enabling the\\\\nfeature needs no change to an existing table.\"},{\"name\":\"iamSub\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastSeenAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"revokedReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"An issued admin-panel JWT, so it can be revoked before it expires.\\\\n\\\\nWHY THIS EXISTS\\\\n---------------\\\\nThe admin token is self-contained and valid for 12h, which means nothing —\\\\nnot disabling the account, not a central \\\"sign out everywhere\\\" — could cut a\\\\nsession short: the token kept working until it expired. With the central IAM\\\\nin the loop that gap became visible (an IAM session revocation had no effect\\\\nhere), so every issued token now carries a `jti` recorded on this table and\\\\nJwtStrategy refuses a token whose row is revoked.\\\\n\\\\nRows are written ONLY while tracking is enabled, and JwtStrategy only\\\\nenforces them while it is enabled, so a deployment that does not want the\\\\nextra lookup behaves exactly as before.\"},\"SalesExpertProfile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToSalesExpertProfile\",\"relationFromFields\":[\"adminUserId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.city_id — a filterable grid column\\\\n(ReagentListModel.js:14) and the source of the commission autofill\\\\n(ReagentCustomer.vue:215-228).\"},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToSalesExpertProfile\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"gramLevel\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.gram_level — the «سطح اعتبار» column, filterable.\\\\nDecimal(14,4) matches Customer.goldCreditLimitGrams exactly so the same\\\\ncredit limit has identical precision on both tables.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.phone (varchar 15) and ncode (varchar 20). The reference\\\\nstores both and reads neither back; kept so the form matches it. Neither\\\\nis unique and neither has a validation rule in the reference — inventing\\\\none would reject data the reference accepts.\"},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"tradingCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The Customer row carrying this expert's OWN orders, debt and credit limit.\\\\n\\\\nThe reference stored a sales agent AS a Customer (type=1), so an order the\\\\nagent placed from the app was simply their own, against their own\\\\ngram_level (ApiMobileController.php:534-535). Here the expert is an\\\\nAdminUser (D17), which has no ledger and cannot be an Order's subject, so\\\\nthis one linked Customer plays that part.\\\\n\\\\nDistinct from the expert's REFERRED customers, which are ordinary Customer\\\\nrows pointing at the AdminUser through Customer.referredByAgentId.\\\\n\\\\nNull until the expert first signs into the app, when it is created from\\\\nthis profile. See D21.\"},{\"name\":\"tradingCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[\"tradingCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"The sales-expert fields legacy kept on the `customers` row (type=1) and that\\\\nwere lost when a sales expert became an AdminUser (D17).\\\\n\\\\nA separate table rather than columns on AdminUser: these are meaningful only\\\\nfor role = SALES_EXPERT and would be permanently null for every other admin.\\\\nA row is created for every SALES_EXPERT by the migration, and upserted by the\\\\nservice whenever one is created or a user's role becomes SALES_EXPERT — but\\\\nreaders still left-join, so a missing profile degrades to nulls rather than\\\\ndropping the agent from the grid.\\\\n\\\\n`reagent_id` is deliberately NOT here — see D17: in the reference it was a\\\\nside effect of the shared customers form, and filling it removed that expert\\\\nfrom the selectable-agent list (queryReagent, AdminController.php:420).\"},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"⚠️ `fullName`, `firstName` and `lastName` are kept in sync BY A DATABASE\\\\nTRIGGER — `customer_sync_full_name`, created in migration\\\\n20260922120000_customer_name_parts. Prisma does not know about it, so a\\\\nwrite here is NOT the whole story:\\\\n\\\\n* write the parts -> fullName is rebuilt as \\\"first last\\\"\\\\n* write fullName only -> the parts are re-derived from it\\\\n* write BOTH in one update -> THE PARTS WIN; fullName is overwritten\\\\nwith \\\"first last\\\" and whatever you passed for fullName is discarded\\\\n\\\\nSo a value you wrote can differ from the value that lands in the row.\\\\nRe-read after writing if you need the stored value. Prefer writing the\\\\nparts; `fullName` exists for the legacy readers that predate D0.\\\\n\\\\nReference has these as two columns from the start\\\\n(henza_server 2020_10_01_120430_customers_table.php:18-19 fname/lname);\\\\nthe port collapsed them, which is the D0 defect.\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.ncode. OPTIONAL since 2026-10-07: not one of the 1,616\\\\nlegacy customers has a national code (1595/1595 empty), and fabricating\\\\none is a data violation that would block later legal identity checks\\\\n(owner ruling). Still @unique — in PostgreSQL NULLs do not collide, so\\\\nthe migration tool must write NULL and never '', which would collide on\\\\nthe second row.\\\\n\\\\nThree service-layer workarounds exist ONLY because this used to be\\\\nrequired, and they store the MOBILE NUMBER here:\\\\nadmin-customers.service.ts:625,685 and customer-auth.service.ts:258.\\\\nRetiring them is a separate change; see docs/DATA-MIGRATION-MAP.md §10.4.\"},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityNameRaw\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.new_city — the city name exactly as the customer typed it\\\\nat app sign-up (Major/CustomerController.php:36). Kept verbatim because\\\\nthe legacy city table has only 15 rows, so the typed name is often the only\\\\nrecord of where the customer is (172 customers; 43 match no known city).\\\\ncityId is set alongside it only on an exact, ي/ك-normalised name match.\\\\nLegacy sign-up also forced city_id = 5 (Tehran) on everyone\\\\n(Major/CustomerController.php:21), so for those rows the typed name, not\\\\ncityId, is the truth. Owner ruling 2026-10-07: keep both.\"},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CustomerKind\",\"default\":\"APP_SHOPKEEPER\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\\\\nBankerList / ShopkeeperList screens filter on.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy contact + shop columns, shown on the wholesale customer form and as\\\\n(hidden-by-default) columns in its grid.\"},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy mcode — the operator-assigned customer code.\"},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesExpertTradingFor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SalesExpertProfile\",\"relationName\":\"SalesExpertTradingAccount\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set only on the one Customer row that acts as a sales expert's own trading\\\\naccount (see SalesExpertProfile.tradingCustomerId). Empty for every\\\\nordinary customer.\"},{\"name\":\"referredOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy orders that named THIS customer as their referrer — see\\\\nOrder.referrerCustomerId. History only.\"},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingGoldBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Balance as last read from the accounting software (D27), in the app's own\\\\nsign convention (positive = owes). Shown to the customer when the\\\\nintegration is on; the credit-limit check still uses goldDebtGrams above.\\\\nNull until the first successful sync.\"},{\"name\":\"accountingRialBalance\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingBalanceAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"makingChargeOffsetPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `customers.percent` — the per-customer making-charge offset. It is\\\\nADDED to the variant's making charge when pricing an order line\\\\n(henza_pwa src/Mixins/product/index.ts:69-75:\\\\ngetWage(v) = state.percent + v.percentage_pay)\\\\nand it shifts the catalogue making-charge filter bounds\\\\n(ApiMobileController.php:391-396,76-77). It is NOT part of the price\\\\nformula itself — that extra percent is ConfigStatic['product_price_extra_percent'].\\\\n\\\\nNOT the wallet cashback rate (storefront ConfigStatic['percent'], D13) and\\\\nNOT the wholesale per-line charge (OrderItem.wagePercentSnapshot).\\\\n\\\\nDB default 0 keeps every existing customer's price unchanged. The\\\\nreference's application-layer default for NEW customers is 3\\\\n(AdminController.php:338) and the field is required on create (:354).\"},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationRejectionReason\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Why verification was rejected (VerificationStep.REJECTED).\\\\n\\\\nLegacy recorded NO reason: none of its 49 `customers` columns is a\\\\nreason/note field, and on rejection it only sent a fixed SMS. So the 14\\\\nrows migrated from the legacy system carry the sentinel\\\\n«رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support\\\\nknows why it is blank (owner ruling 2026-10-07). The migration tool\\\\nwrites it only WHERE this IS NULL, so a re-run cannot overwrite a real\\\\nreason entered in the new system.\"},{\"name\":\"verificationRejectedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"NULL for rows migrated from the legacy system — it recorded no rejection time.\"},{\"name\":\"birthDate\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the\\\\nbirthday SMS / loyalty campaigns (owner ruling 2026-10-07).\\\\n\\\\n⚠ Legacy stores dates as JALALI STRINGS in other tables\\\\n(cashes.recive_date is varchar, 88/89 values starting \\\"14…\\\"), so this\\\\ntimestamp may hold mis-entered Jalali years. Confirm the calendar with\\\\ndocs/migration-precheck-3.sql BEFORE backfilling: copying them unchanged\\\\nwould produce 917 wrong birthdays, worse for an SMS campaign than none.\"},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\\\\nform. Legacy stored an FK to its Image table and read it back as a nested\\\\n`image: { id, image }`, so this is a relation, not a bare URL string.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canPlaceOrders\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had TWO independent switches on a customer:\\\\nsts -> may they place orders (this field)\\\\nactive -> is the account enabled (isActive, below)\\\\nThe port previously drove both from isActive; they are separate again.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isArchived\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy archive flag — the archived list filtered on this, not on isActive.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activityLogs\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerActivityLog\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"otpChallenges\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerOtp\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favorites\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerFavorite\":{\"dbName\":null,\"fields\":[{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerFavorite\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"customerId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy `fav` (251 rows) — saved products. The target had no model for this,\\\\nso every customer's favourites would have been lost in the migration; the\\\\nowner confirmed on 2026-10-06 that they matter.\\\\n\\\\nLegacy `fav` has two columns and NO primary key. The composite key here\\\\nsupplies the constraint the source lacks (the precheck found 0 duplicate\\\\npairs, but the tool should still SELECT DISTINCT). 14 of the 251 rows point\\\\nat a deleted customer and must be skipped.\\\\n\\\\nLegacy's denormalised `product.count_fav` counter is deliberately NOT\\\\nrecreated as a column — derive it from this table.\"},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Branch.address / phone — both are columns in the branch grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy GET branch/active/{id} toggles this.\"},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"admins\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Workshop.address / phone — both are columns in the workshop grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The supervisor created alongside the workshop by the legacy Add form.\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[\"supervisorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":1,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.type — which storefront the category belongs to:\\\\n1 سایت | 2 اپلیکشن موبایل. Drives the \\\"type_str\\\" grid column.\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.image / icon — the grid renders the image, the storefront the icon.\"},{\"name\":\"iconUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"metaTag\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy meta tag + description, used for SEO on the site categories.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.product_code — the human-facing SKU shown in the grid.\"},{\"name\":\"showType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.show_type: 1 site, 2 mobile, 3 both.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockWeight\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Stock of the linked کارساخته as last read from the accounting software\\\\n(D27). Weight for gram-type items, count for count-type ones — whichever\\\\nthe software reports. At zero or below the product is unavailable in the\\\\napp (pre-order variants excepted). Null = not linked or never synced.\"},{\"name\":\"accountingStockCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountingStockAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"favoritedBy\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerFavorite\",\"relationName\":\"CustomerFavoriteToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"ProductImageRole\",\"default\":\"GALLERY\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /\\\\nگالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so\\\\nexisting rows and any generic \\\"just attach an image\\\" caller keep working.\"},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Variants that display this image. A gallery image may back several\\\\nvariants (one photo, several weights), which is why this is a plain\\\\none-to-many and not a join table.\"}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"qty\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\\\\nqty 0 unless it is flagged pre-order, so both fields are required for that\\\\nguard to work (see apps/admin-panel/src/stores/cart.ts).\"},{\"name\":\"isPreOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy is_pre_order: orderable even at zero stock.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"color\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy color enum: 0=سفید, 1=زرد, 2=شکلاتی, 3=رزگلد\"},{\"name\":\"rialWage\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy rial_pay — fixed Rial making charge per variant.\"},{\"name\":\"details\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy details — short description for variant.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy description — full description for variant.\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The gallery image shown for this variant, picked from its own product's\\\\nimages — never a re-uploaded copy. onDelete: SetNull because dropping an\\\\nimage must never cascade into the variant: OrderItem rows reference\\\\nvariants, so losing one would break order history.\"},{\"name\":\"image\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductImageToProductVariant\",\"relationFromFields\":[\"imageId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channel\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderChannel\",\"default\":\"RETAIL\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which sales channel placed this order — see OrderChannel.\"},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"salesAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The sales expert this order is credited to, fixed when it is placed:\\\\nthe customer's referring expert AT THAT MOMENT. Legacy `orders.reagent_id`,\\\\nset once at creation (ApiMobileController.php:601) and never moved, so a\\\\ncustomer changing expert later does not move past sales or commission\\\\n(owner ruling 2026-10-08). «میزان فروش» counts from here, never from the\\\\ncustomer's current referrer.\"},{\"name\":\"salesAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"OrderSalesAgent\",\"relationFromFields\":[\"salesAgentId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referrerCustomerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"History only: a legacy order whose `reagent_id` named a customer who is\\\\nnot a sales expert (one such customer, 17 orders in 2022). Legacy counted\\\\nthose orders in that customer's own «میزان فروش»; this keeps that figure\\\\nexact. Never set for a new order.\"},{\"name\":\"referrerCustomer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"OrderReferrerCustomer\",\"relationFromFields\":[\"referrerCustomerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"SetNull\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminId\",\"dbName\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminId\",\"dbName\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminId\",\"dbName\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToLedgerEntry\",\"relationFromFields\":[\"postedByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"labName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Instrument metadata from the legacy \\\"cash\\\" document form. Which fields are\\\\nfilled depends on sourceType: a melted-gold receipt carries lab/hallmark and\\\\nthe pre-normalization weight, a cheque carries the account and bank, and a\\\\ntransfer carries its destination.\\\\nLegacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\"},{\"name\":\"hallmark\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bankName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transferTo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"originalValue\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight as handed over, BEFORE karat normalization (legacy original_value).\"},{\"name\":\"priceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Rial amount for cash/cheque documents (legacy price).\"},{\"name\":\"receivedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"},\"UserType\":{\"dbName\":\"user_type\",\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\\\\nrows keep their legacy identity rather than getting new cuids.\"},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"permissions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Permission\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"admins\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AdminToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Permission\":{\"dbName\":\"permission\",\"fields\":[{\"name\":\"rid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Dotted permission id, e.g. \\\"order.list\\\", \\\"persons.list.client.omde\\\".\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"rid\",\"userTypeId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Comment\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CommentStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replyToId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `reply_to`: a staff reply threads under the comment it answers.\"},{\"name\":\"replyTo\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[\"replyToId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replies\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Setting\":{\"dbName\":null,\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AccountingLink\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingEntityType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record's code in the accounting software (Tahesab Moshtari_Code /\\\\nZarrin idHesab; for products the Zarrin idKar or the Tahesab Name_Kar).\"},{\"name\":\"externalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"origin\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How the link came to be: LINKED (matched by mobile/name), IMPORTED (app\\\\nrow created from the accounting record), PUSHED (accounting record created\\\\nfrom the app row) or MANUAL (an admin typed the code).\"},{\"name\":\"snapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The record as last read, for display only.\"},{\"name\":\"syncedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"entityType\",\"entityId\"],[\"provider\",\"entityType\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"entityId\"]},{\"name\":null,\"fields\":[\"provider\",\"entityType\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"One app row ↔ one record in the accounting software (customer account or\\\\nکارساخته).\"},\"AccountingOutbox\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AccountingOutboxKind\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"AccountingOutboxStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nextAttemptAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"lastError\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalRef\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"What the accounting software returned as the document/record id.\"},{\"name\":\"progress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Per-step progress of multi-call jobs (a Zarrin document is one call per\\\\nline), so a failure resumes where it stopped.\"},{\"name\":\"lastRequest\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Last request/response, for the log screen. Never contains the token.\"},{\"name\":\"lastResponse\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"resolvedById\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Work to push to the accounting software. Written in the SAME transaction as\\\\nthe change that causes it, so an outage of the accounting software never\\\\nloses an event and never blocks the app.\"},\"AccountingIssue\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"provider\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"externalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"entityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"message\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"data\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"resolvedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"provider\",\"kind\",\"externalCode\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"provider\",\"kind\",\"externalCode\"]}],\"isGenerated\":false,\"documentation\":\"Something a pull found that needs a human: an account with no mobile, two\\\\naccounts sharing one mobile, a کارساخته group with no category mapping.\"},\"Promotion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scope\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionScope\",\"default\":\"PRODUCT\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"usage\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionUsage\",\"default\":\"ONCE\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Percentage off, 0-100 (legacy discount_percent).\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"platform\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which storefront it shows on, mirroring Product.showType (legacy platform).\"},{\"name\":\"startsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Exactly one of these is populated, per `scope`.\"},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PromotionExclusion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"itemId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"type\",\"itemId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"type\",\"itemId\"]}],\"isGenerated\":false,\"documentation\":\"Legacy \\\"ignore\\\" table (views/offersIgnore) — specific products, categories,\\\\ncustomers or brands excluded from the automatic discount engine.\\\\nLegacy posts { type, item_id[] }: \\\"type\\\" reuses the promotion scope codes\\\\n(1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \\\"itemId\\\" is the excluded row.\"},\"BranchAllocation\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocatorAdminId\",\"dbName\":\"allocatorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `allocator_user` — the admin who filed the allocation.\"},{\"name\":\"allocatorAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[\"allocatorAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"BranchAllocationItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocation\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[\"allocationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"weightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight snapshot at allocation time, so later catalog edits do not rewrite history.\"}],\"primaryKey\":null,\"uniqueFields\":[[\"allocationId\",\"productId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"allocationId\",\"productId\"]}],\"isGenerated\":false},\"SmsMessage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MessageAudience\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Comma-separated recipients for the SINGLE/MULTIPLE audiences.\"},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How many numbers the send actually resolved to.\"},{\"name\":\"sentByAdminId\",\"dbName\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[\"sentByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"MessageAudience\",\"default\":\"ALL_CUSTOMERS\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminId\",\"dbName\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[\"sentByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"NotificationRecipient\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notificationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notification\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[\"notificationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"readAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"notificationId\",\"customerId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"notificationId\",\"customerId\"]}],\"isGenerated\":false,\"documentation\":\"Per-customer delivery + read state — legacy `GET notify/read/{id}`.\"},\"NewsletterSubscriber\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"email\"],[\"mobile\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"email\"]},{\"name\":null,\"fields\":[\"mobile\"]}],\"isGenerated\":false,\"documentation\":\"Legacy views/newsletters — the mailing-list signups collected by the site.\"},\"CustomerActivityLog\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"action\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\"},{\"name\":\"detail\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy views/statics — the customer activity log the \\\"آمار\\\" screen reads\\\\n(`log/list/customer`, `log/ago/{customerId}`).\"},\"UploadedFile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Public URL the stored file is served from.\"},{\"name\":\"originalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mimeType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeBytes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"purpose\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form tag for what the file belongs to, e.g. 'product', 'category',\\\\n'customer.nationalId'. Kept loose so a new form needs no schema change.\"},{\"name\":\"uploadedByAdminId\",\"dbName\":\"uploadedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedByAdmin\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Admin\",\"relationName\":\"FileUploader\",\"relationFromFields\":[\"uploadedByAdminId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUserAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerOtp\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Normalised to English digits before storing, as the reference does with\\\\nUtility::faTOen() on both send and verify.\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerOtp\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"codeHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"bcrypt hash of the 4-digit code. Never the code itself.\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempts\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Failed verify attempts against THIS challenge.\"},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Set when the code is accepted, so one challenge cannot be reused.\"},{\"name\":\"requestIp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Kept for the per-IP send throttle.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"One OTP login challenge for a customer.\\\\n\\\\nPorts henza_server's flow (ApiMobileController.php:39-78), where userAuth\\\\ngenerated rand(1000,9999), stored it on the customer row as `send_password`\\\\nand sent it by SMS, and userVerfiy compared the submitted code against it\\\\n(mismatch -> HTTP 422).\\\\n\\\\nThree deliberate improvements over the reference, approved by the user\\\\n(docs/parity/DECISIONS.md D6 and T1):\\\\n1. the code is stored as a bcrypt hash, never in plain text — the\\\\nreference kept it readable in a customer column;\\\\n2. it expires (`expiresAt`) — the reference's code stayed valid forever;\\\\n3. attempts are counted and the challenge locks out — the reference had\\\\nno limit at all.\\\\nThe parity behaviour itself is the code comparison and the rejection.\"}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"CustomerKind\":{\"values\":[{\"name\":\"SALES_AGENT\",\"dbName\":null},{\"name\":\"APP_SHOPKEEPER\",\"dbName\":null},{\"name\":\"WALK_IN_SHOPKEEPER\",\"dbName\":null},{\"name\":\"BANKER\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"RETAIL\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Customer.type — what kind of wholesale customer this is. Values and\\\\nlabels taken verbatim from bulkCustomer.vue's userTypes list.\\\\n\\\\nSALES_AGENT is a LEGACY value only: legacy stored a sales agent as a\\\\nCustomer row with type=1, but the redesigned system models a sales agent\\\\nas an AdminUser (role SALES_EXPERT) instead — see admin-users.service.ts\\\\nand admin-customers.service.ts's listReagents()/create(). No Customer row\\\\nshould be created with kind SALES_AGENT going forward; the value is kept\\\\nonly so legacyTypeToKind()/kindToLegacyType() stay total functions and any\\\\nalready-migrated data keeps a readable label.\\\\n\\\\nRETAIL marks a \\\"تک\\\" (single/retail) customer — legacy kept these in an\\\\nentirely separate table (SingleCustomer/`login`) that could never contain\\\\na wholesale/agent/shopkeeper/banker row. The redesigned schema folded both\\\\ninto one Customer model, so this value is what listSingle() now filters on\\\\nto reproduce that same separation.\"},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null,\"documentation\":\"Legacy had THREE states per step, not two\\\\n(MajorCustomerController.php:106-135): 1 = awaiting, 2 = approved,\\\\n3 = REJECTED. Mapping rejected customers to UNVERIFIED would put closed\\\\ncases back in the review queue, so the owner ruled it out (2026-10-07).\\\\n14 legacy rows land here; see Customer.verificationRejectionReason.\"}],\"dbName\":null},\"OrderChannel\":{\"values\":[{\"name\":\"RETAIL\",\"dbName\":null},{\"name\":\"WHOLESALE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy kept retail and wholesale orders in two SEPARATE tables\\\\n(orders_orders vs orders). The redesigned schema has one Order model, so the\\\\ndistinction lives here instead.\"},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null},\"ProductImageRole\":{\"values\":[{\"name\":\"FEATURED\",\"dbName\":null},{\"name\":\"FEATURED_MOBILE\",\"dbName\":null},{\"name\":\"GALLERY\",\"dbName\":null},{\"name\":\"GALLERY_MOBILE\",\"dbName\":null}],\"dbName\":null},\"CommentStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"APPROVED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null}],\"dbName\":null},\"AccountingEntityType\":{\"values\":[{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"PRODUCT\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxKind\":{\"values\":[{\"name\":\"CUSTOMER_PUSH\",\"dbName\":null},{\"name\":\"PRODUCT_PUSH\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT\",\"dbName\":null},{\"name\":\"ORDER_DOCUMENT_DELETE\",\"dbName\":null}],\"dbName\":null},\"AccountingOutboxStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"SENDING\",\"dbName\":null,\"documentation\":\"A call was in flight. Found at startup, it means the process died mid-call\\\\nand the outcome is unknown — see AccountingOutboxWorker.\"},{\"name\":\"SENT\",\"dbName\":null},{\"name\":\"FAILED\",\"dbName\":null},{\"name\":\"NEEDS_REVIEW\",\"dbName\":null,\"documentation\":\"Unsafe to retry automatically (e.g. a Zarrin call timed out: Zarrin has no\\\\nidempotency key, so a blind retry could post the document twice).\"},{\"name\":\"RESOLVED\",\"dbName\":null,\"documentation\":\"Closed by an admin from the log screen.\"}],\"dbName\":null},\"PromotionScope\":{\"values\":[{\"name\":\"PRODUCT\",\"dbName\":null},{\"name\":\"CATEGORY\",\"dbName\":null},{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"BRAND\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.type — what the discount is scoped to.\"},\"PromotionUsage\":{\"values\":[{\"name\":\"ONCE\",\"dbName\":null},{\"name\":\"UNTIL_END_DATE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.use_only — how often a customer may redeem it.\"},\"MessageAudience\":{\"values\":[{\"name\":\"SINGLE_NUMBER\",\"dbName\":null},{\"name\":\"MULTIPLE_NUMBERS\",\"dbName\":null},{\"name\":\"ALL_CUSTOMERS\",\"dbName\":null},{\"name\":\"WHOLESALE_CUSTOMERS\",\"dbName\":null},{\"name\":\"RETAIL_CUSTOMERS\",\"dbName\":null},{\"name\":\"SALES_AGENTS\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Who an SMS or notification was aimed at. Legacy's sms/create offered these\\\\naudiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\"}},\"types\":{}}") defineDmmfProperty(exports.Prisma, config.runtimeDataModel) config.engineWasm = undefined diff --git a/apps/api/release/vendor/.prisma/client/package.json b/apps/api/release/vendor/.prisma/client/package.json index 91d3aa9..7525063 100644 --- a/apps/api/release/vendor/.prisma/client/package.json +++ b/apps/api/release/vendor/.prisma/client/package.json @@ -1,5 +1,5 @@ { - "name": "prisma-client-8945b25ad1891f9eaff8d38ca7f3c1b19a3f2d11c0c8521549c219186ff7566b", + "name": "prisma-client-d98bddf3599c950eb3fcd511efa7f226c4ef4c5c3cbc261683fb1118a763a924", "main": "index.js", "types": "index.d.ts", "browser": "index-browser.js", diff --git a/apps/api/release/vendor/.prisma/client/schema.prisma b/apps/api/release/vendor/.prisma/client/schema.prisma index 52bf8d0..d10ba4c 100644 --- a/apps/api/release/vendor/.prisma/client/schema.prisma +++ b/apps/api/release/vendor/.prisma/client/schema.prisma @@ -140,6 +140,61 @@ model City { @@index([parentId]) } +/// A staff account for the ADMIN PANEL — and nothing else. +/// +/// Split out of AdminUser (which now holds sales experts only) so that: +/// * the same mobile can be an admin AND a sales expert — they are two +/// separate roles, each unique only within its own table; +/// * the expert table (production: ~12,000 rows) is never written by panel +/// staff management. +/// Migration 20261026120000_split_admin_table copies the existing non-expert +/// AdminUser rows here WITH THEIR IDS, so issued panel tokens and every +/// "who did this" column keep resolving. The old rows are left in AdminUser, +/// dormant; no code reads them as admins any more. +/// +/// ⚠️ fullName/firstName/lastName are kept in sync by the DB trigger +/// `admin_sync_full_name_trg` (it shares the function admin_user_sync_full_name) — same semantics as AdminUser: the parts win. +model Admin { + id String @id @default(cuid()) + + fullName String + firstName String? + lastName String? + + mobile String @unique + passwordHash String + /// Never SALES_EXPERT — that role lives in AdminUser. Enforced in + /// AdminUsersService, not in the database, so the enum stays shared. + role AdminRole + userTypeId Int? + userType UserType? @relation(fields: [userTypeId], references: [id]) + branchId String? + branch Branch? @relation(fields: [branchId], references: [id]) + isActive Boolean @default(true) + createdAt DateTime @default(now()) + + supervisedWorkshops Workshop[] @relation("WorkshopSupervisor") + branchAllocations BranchAllocation[] @relation("AllocationAuthor") + postedLedgerEntries LedgerEntry[] + orderStatusEvents OrderStatusEvent[] + preOrderStatusEvents PreOrderStatusEvent[] + sentSmsMessages SmsMessage[] @relation("SmsAuthor") + sentNotifications Notification[] @relation("NotificationAuthor") + uploadedFiles UploadedFile[] @relation("FileUploader") + + /// Issued admin-panel tokens, recorded only while session tracking is on + /// (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a + /// token can be revoked before it expires. See AdminSession. + sessions AdminSession[] + + @@index([role]) + @@index([userTypeId]) + @@index([firstName]) + @@index([lastName]) +} + +/// A SALES EXPERT (role SALES_EXPERT). Panel staff live in `Admin`; rows here with +/// any other role are pre-split leftovers and are ignored by the code. model AdminUser { id String @id @default(cuid()) @@ -185,26 +240,13 @@ model AdminUser { pasazhName String? // legacy pasazh_name memberCode String? // legacy mcode - referredCustomers Customer[] @relation("ReferralAgent") + referredCustomers Customer[] @relation("ReferralAgent") /// Orders credited to this sales expert — see Order.salesAgentId. - creditedOrders Order[] @relation("OrderSalesAgent") - supervisedWorkshops Workshop[] @relation("WorkshopSupervisor") - branchAllocations BranchAllocation[] @relation("AllocationAuthor") - postedLedgerEntries LedgerEntry[] - orderStatusEvents OrderStatusEvent[] - preOrderStatusEvents PreOrderStatusEvent[] - sentSmsMessages SmsMessage[] @relation("SmsAuthor") - sentNotifications Notification[] @relation("NotificationAuthor") - uploadedFiles UploadedFile[] @relation("FileUploader") + creditedOrders Order[] @relation("OrderSalesAgent") /// Only ever set for role = SALES_EXPERT (D17). salesExpertProfile SalesExpertProfile? - /// Issued admin-panel tokens, recorded only while session tracking is on - /// (AUTH_SESSION_TRACKING, or implicitly whenever the IAM is enabled) so a - /// token can be revoked before it expires. See AdminSession. - sessions AdminSession[] - @@index([role]) @@index([userTypeId]) @@index([avatarFileId]) @@ -274,8 +316,8 @@ model AdminSession { /// The token's `jti` claim. Unique: one row per issued token. jti String @unique - adminUserId String - adminUser AdminUser @relation(fields: [adminUserId], references: [id], onDelete: Cascade) + adminId String @map("adminUserId") + admin Admin @relation(fields: [adminId], references: [id], onDelete: Cascade) /// Set when the login was verified by the IAM: its session id (`sid`) and the /// stable user id (`sub`) there. Back-channel logout arrives keyed by these — @@ -294,7 +336,7 @@ model AdminSession { revokedAt DateTime? revokedReason String? - @@index([adminUserId]) + @@index([adminId], map: "AdminSession_adminUserId_idx") @@index([iamSessionId]) @@index([iamSub]) @@index([expiresAt]) @@ -571,6 +613,7 @@ model Branch { cityId String? city City? @relation(fields: [cityId], references: [id]) adminUsers AdminUser[] + admins Admin[] orders Order[] allocations BranchAllocation[] } @@ -583,7 +626,7 @@ model Workshop { phone String? /// The supervisor created alongside the workshop by the legacy Add form. supervisorId String? - supervisor AdminUser? @relation("WorkshopSupervisor", fields: [supervisorId], references: [id]) + supervisor Admin? @relation("WorkshopSupervisor", fields: [supervisorId], references: [id]) isActive Boolean @default(true) preOrders PreOrder[] } @@ -826,15 +869,15 @@ model OrderItem { } model OrderStatusEvent { - id String @id @default(cuid()) - orderId String - order Order @relation(fields: [orderId], references: [id]) - fromStatus OrderStatus? - toStatus OrderStatus - note String? - actorAdminUserId String? - actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id]) - createdAt DateTime @default(now()) + id String @id @default(cuid()) + orderId String + order Order @relation(fields: [orderId], references: [id]) + fromStatus OrderStatus? + toStatus OrderStatus + note String? + actorAdminId String? @map("actorAdminUserId") + actorAdmin Admin? @relation(fields: [actorAdminId], references: [id]) + createdAt DateTime @default(now()) @@index([orderId]) } @@ -875,15 +918,15 @@ model PreOrder { } model PreOrderStatusEvent { - id String @id @default(cuid()) - preOrderId String - preOrder PreOrder @relation(fields: [preOrderId], references: [id]) + id String @id @default(cuid()) + preOrderId String + preOrder PreOrder @relation(fields: [preOrderId], references: [id]) /// Field-level diff, e.g. {"status": {"old": "PLACED", "new": "ADMIN_APPROVED"}} - changes Json - actorAdminUserId String? - actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id]) - ipAddress String? - createdAt DateTime @default(now()) + changes Json + actorAdminId String? @map("actorAdminUserId") + actorAdmin Admin? @relation(fields: [actorAdminId], references: [id]) + ipAddress String? + createdAt DateTime @default(now()) @@index([preOrderId]) } @@ -912,10 +955,10 @@ model LedgerEntry { order Order? @relation(fields: [orderId], references: [id]) /// Pending entries don't count toward the cached customer balance until confirmed. - confirmed Boolean @default(false) - confirmedAt DateTime? - postedByAdminUserId String? - postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id]) + confirmed Boolean @default(false) + confirmedAt DateTime? + postedByAdminId String? @map("postedByAdminUserId") + postedByAdmin Admin? @relation(fields: [postedByAdminId], references: [id]) /// Instrument metadata from the legacy "cash" document form. Which fields are /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and @@ -997,6 +1040,7 @@ model UserType { permissions Permission[] adminUsers AdminUser[] + admins Admin[] @@map("user_type") } @@ -1251,8 +1295,8 @@ model BranchAllocation { branch Branch @relation(fields: [branchId], references: [id]) /// Legacy `allocator_user` — the admin who filed the allocation. - allocatorAdminUserId String? - allocatorAdminUser AdminUser? @relation("AllocationAuthor", fields: [allocatorAdminUserId], references: [id]) + allocatorAdminId String? @map("allocatorAdminUserId") + allocatorAdmin Admin? @relation("AllocationAuthor", fields: [allocatorAdminId], references: [id]) note String? createdAt DateTime @default(now()) @@ -1299,8 +1343,8 @@ model SmsMessage { /// How many numbers the send actually resolved to. sentCount Int @default(0) - sentByAdminUserId String? - sentByAdminUser AdminUser? @relation("SmsAuthor", fields: [sentByAdminUserId], references: [id]) + sentByAdminId String? @map("sentByAdminUserId") + sentByAdmin Admin? @relation("SmsAuthor", fields: [sentByAdminId], references: [id]) createdAt DateTime @default(now()) @@ -1313,8 +1357,8 @@ model Notification { body String audience MessageAudience @default(ALL_CUSTOMERS) - sentByAdminUserId String? - sentByAdminUser AdminUser? @relation("NotificationAuthor", fields: [sentByAdminUserId], references: [id]) + sentByAdminId String? @map("sentByAdminUserId") + sentByAdmin Admin? @relation("NotificationAuthor", fields: [sentByAdminId], references: [id]) createdAt DateTime @default(now()) @@ -1379,8 +1423,8 @@ model UploadedFile { /// 'customer.nationalId'. Kept loose so a new form needs no schema change. purpose String? - uploadedByAdminUserId String? - uploadedByAdminUser AdminUser? @relation("FileUploader", fields: [uploadedByAdminUserId], references: [id]) + uploadedByAdminId String? @map("uploadedByAdminUserId") + uploadedByAdmin Admin? @relation("FileUploader", fields: [uploadedByAdminId], references: [id]) createdAt DateTime @default(now()) customerAvatars Customer[] @relation("CustomerAvatar") diff --git a/apps/api/release/vendor/.prisma/client/wasm.js b/apps/api/release/vendor/.prisma/client/wasm.js index 8625ae2..85baad2 100644 --- a/apps/api/release/vendor/.prisma/client/wasm.js +++ b/apps/api/release/vendor/.prisma/client/wasm.js @@ -130,6 +130,20 @@ exports.Prisma.CityScalarFieldEnum = { percentAux: 'percentAux' }; +exports.Prisma.AdminScalarFieldEnum = { + id: 'id', + fullName: 'fullName', + firstName: 'firstName', + lastName: 'lastName', + mobile: 'mobile', + passwordHash: 'passwordHash', + role: 'role', + userTypeId: 'userTypeId', + branchId: 'branchId', + isActive: 'isActive', + createdAt: 'createdAt' +}; + exports.Prisma.AdminUserScalarFieldEnum = { id: 'id', fullName: 'fullName', @@ -170,7 +184,7 @@ exports.Prisma.AppSessionScalarFieldEnum = { exports.Prisma.AdminSessionScalarFieldEnum = { id: 'id', jti: 'jti', - adminUserId: 'adminUserId', + adminId: 'adminId', iamSessionId: 'iamSessionId', iamSub: 'iamSub', ipAddress: 'ipAddress', @@ -370,7 +384,7 @@ exports.Prisma.OrderStatusEventScalarFieldEnum = { fromStatus: 'fromStatus', toStatus: 'toStatus', note: 'note', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', createdAt: 'createdAt' }; @@ -397,7 +411,7 @@ exports.Prisma.PreOrderStatusEventScalarFieldEnum = { id: 'id', preOrderId: 'preOrderId', changes: 'changes', - actorAdminUserId: 'actorAdminUserId', + actorAdminId: 'actorAdminId', ipAddress: 'ipAddress', createdAt: 'createdAt' }; @@ -414,7 +428,7 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { orderId: 'orderId', confirmed: 'confirmed', confirmedAt: 'confirmedAt', - postedByAdminUserId: 'postedByAdminUserId', + postedByAdminId: 'postedByAdminId', labName: 'labName', hallmark: 'hallmark', accountName: 'accountName', @@ -549,7 +563,7 @@ exports.Prisma.PromotionExclusionScalarFieldEnum = { exports.Prisma.BranchAllocationScalarFieldEnum = { id: 'id', branchId: 'branchId', - allocatorAdminUserId: 'allocatorAdminUserId', + allocatorAdminId: 'allocatorAdminId', note: 'note', createdAt: 'createdAt' }; @@ -567,7 +581,7 @@ exports.Prisma.SmsMessageScalarFieldEnum = { recipients: 'recipients', body: 'body', sentCount: 'sentCount', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -576,7 +590,7 @@ exports.Prisma.NotificationScalarFieldEnum = { title: 'title', body: 'body', audience: 'audience', - sentByAdminUserId: 'sentByAdminUserId', + sentByAdminId: 'sentByAdminId', createdAt: 'createdAt' }; @@ -609,7 +623,7 @@ exports.Prisma.UploadedFileScalarFieldEnum = { mimeType: 'mimeType', sizeBytes: 'sizeBytes', purpose: 'purpose', - uploadedByAdminUserId: 'uploadedByAdminUserId', + uploadedByAdminId: 'uploadedByAdminId', createdAt: 'createdAt' }; @@ -782,6 +796,7 @@ exports.MessageAudience = exports.$Enums.MessageAudience = { exports.Prisma.ModelName = { City: 'City', + Admin: 'Admin', AdminUser: 'AdminUser', AppSession: 'AppSession', AdminSession: 'AdminSession',