feat build

This commit is contained in:
mahmood
2026-09-18 17:30:32 +03:30
parent ffd952d754
commit 062fe80a68
341 changed files with 461 additions and 561 deletions
+71 -7
View File
@@ -88488,10 +88488,16 @@ var require_admin_products_service = __commonJS({
category: p.category ? { id: p.category.id, title: p.category.title, collection: { title: p.category.title } } : null,
// legacy grid slot reads `ProductImage`
ProductImage: p.images.map((i) => ({ id: i.id, image: i.url, full: i.url, url: i.url })),
images: p.images.map((i) => ({ id: i.id, url: i.url, sortOrder: i.sortOrder })),
images: p.images.map((i) => ({ id: i.id, url: i.url, sortOrder: i.sortOrder, role: i.role })),
// The order builder's grid reads `thumb.full` and `variants_all` directly
// off each row, so both travel with the list as they did in legacy.
thumb: p.images[0] ? { full: p.images[0].url } : null,
// off each row, so both travel with the list as they did in legacy. Legacy's
// grid thumbnail was always the featured image (تصویر شاخص) when one was
// set — fall back to the first gallery image only if no featured image
// was uploaded, rather than picking whichever image happens to sort first.
thumb: (() => {
const featured = p.images.find((i) => i.role === "FEATURED") ?? p.images[0];
return featured ? { full: featured.url } : null;
})(),
variants_all: p.variants.map((v) => this.variantRow(v)),
variants_count: p.variants.length,
// legacy min_gram / max_gram: the product's lightest and heaviest variant,
@@ -88521,7 +88527,14 @@ var require_admin_products_service = __commonJS({
brand_id: p.brandId,
cats: p.categoryId ? [p.categoryId] : [],
ciny_ids: p.collections.map((c) => c.collectionId),
variants_all: p.variants.map((v) => this.variantRow(v))
variants_all: p.variants.map((v) => this.variantRow(v)),
// The 4 image slots the product form edits, split back out by role —
// mirrors the shape AddProduct.vue posts (indicator_id / mobile_pic /
// images / images_mobile).
indicator_id: p.images.find((i) => i.role === "FEATURED")?.url ?? null,
mobile_pic: p.images.find((i) => i.role === "FEATURED_MOBILE")?.url ?? null,
images_gallery: p.images.filter((i) => i.role === "GALLERY").map((i) => i.url),
images_mobile: p.images.filter((i) => i.role === "GALLERY_MOBILE").map((i) => i.url)
};
}
variantRow(v) {
@@ -88629,6 +88642,35 @@ var require_admin_products_service = __commonJS({
isActive: v.is_active !== void 0 ? Boolean(v.is_active) : true
};
}
/**
* Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /
* گالری تصاویر سایت / گالری تصاویر موبایل — AddProduct.vue's `indicator_id`,
* `mobile_pic`, `images`, and a mobile gallery). The form posts one URL each
* for the two featured slots and one URL array each for the two galleries;
* this flattens all four into the role-tagged rows ProductImage.create wants.
*/
imageCreateData(data) {
const rows = [];
const single = (v, role) => {
const url = typeof v === "string" ? v : String(v?.url ?? "");
if (url)
rows.push({ url, sortOrder: 0, role });
};
const gallery = (v, role) => {
if (!Array.isArray(v))
return;
v.forEach((item, i) => {
const url = typeof item === "string" ? item : String(item?.url ?? "");
if (url)
rows.push({ url, sortOrder: i, role });
});
};
single(data.indicator_id, "FEATURED");
single(data.mobile_pic, "FEATURED_MOBILE");
gallery(data.images, "GALLERY");
gallery(data.images_mobile, "GALLERY_MOBILE");
return rows;
}
/** Legacy `POST product/create`. */
async create(data) {
const title = String(data.title ?? "").trim();
@@ -88637,6 +88679,7 @@ var require_admin_products_service = __commonJS({
const cats = Array.isArray(data.cats) ? data.cats : [];
const cinyIds = Array.isArray(data.ciny_ids) ? data.ciny_ids : [];
const variants = Array.isArray(data.variants) ? data.variants : [];
const images = this.imageCreateData(data);
return this.prisma.product.create({
data: {
title,
@@ -88647,9 +88690,10 @@ var require_admin_products_service = __commonJS({
brandId: data.brand_id || null,
categoryId: cats[0] ?? null,
collections: cinyIds.length ? { create: cinyIds.map((collectionId) => ({ collectionId })) } : void 0,
variants: variants.length ? { create: variants.map((v) => this.variantCreateData(v)) } : void 0
variants: variants.length ? { create: variants.map((v) => this.variantCreateData(v)) } : void 0,
images: images.length ? { create: images } : void 0
},
include: { variants: true }
include: { variants: true, images: true }
});
}
/** Legacy `PUT product/update/{id}`. */
@@ -88699,6 +88743,15 @@ var require_admin_products_service = __commonJS({
data: { isActive: false }
});
}
if (["indicator_id", "mobile_pic", "images", "images_mobile"].some((k) => k in data)) {
const images = this.imageCreateData(data);
await this.prisma.productImage.deleteMany({ where: { productId: id } });
if (images.length) {
await this.prisma.productImage.createMany({
data: images.map((img) => ({ ...img, productId: id }))
});
}
}
return this.findOne(id);
}
/**
@@ -93248,7 +93301,18 @@ async function bootstrap() {
res.setHeader("Content-Type", mime);
}
});
await app.listen(process.env.PORT ?? 3e3, "0.0.0.0");
const port = Number(process.env.PORT ?? 3e3);
try {
await app.listen(port, "0.0.0.0");
} catch (err) {
if (err.code === "EADDRINUSE") {
console.error(`
[api] Port ${port} is already in use. Free it or change API_PORT in the repo-root .env (and PORT in apps/api/.env to match) \u2014 the API will not fall back to a different port.
`);
process.exit(1);
}
throw err;
}
}
bootstrap();
/*! Bundled license information:
@@ -0,0 +1,8 @@
-- Placeholder: the original migration.sql for this migration was lost from
-- disk (directory existed but was empty) while the database's
-- _prisma_migrations ledger already recorded it as applied and finished.
-- Recreated as an empty no-op file, then registered via
-- `prisma migrate resolve --applied`, so Prisma tooling stops blocking on
-- P3015 without re-running or guessing at SQL that already ran against this
-- database. The actual schema effect (CustomerKind.RETAIL) is present in
-- schema.prisma and already exists in the live database.
@@ -0,0 +1,12 @@
-- Placeholder: this migration is recorded as applied in the database's
-- _prisma_migrations ledger, but no migration.sql for it ever existed on
-- disk in this checkout (added Customer.firstName/lastName/productPercent
-- directly against the live DB, schema.prisma was never regenerated from it
-- as a tracked migration). Recreated as an empty no-op file purely so Prisma
-- CLI tooling (migrate status/dev) stops blocking on a missing-migration
-- error. Does not re-run or alter anything — the columns already exist live.
--
-- NOT reconciled with schema.prisma: Customer.firstName, Customer.lastName,
-- Customer.productPercent exist in the database but have no field in
-- prisma/schema.prisma's Customer model. This is a pre-existing drift,
-- separate from this change, and should be looked at on its own.
@@ -0,0 +1,12 @@
-- Placeholder: this migration is recorded as applied in the database's
-- _prisma_migrations ledger, but no migration.sql for it ever existed on
-- disk in this checkout (added Customer.parentAgentId + Customer.birthDate
-- directly against the live DB; schema.prisma was never regenerated from it
-- as a tracked migration). Recreated as an empty no-op file purely so Prisma
-- CLI tooling (migrate status/dev) stops blocking on a missing-migration
-- error. Does not re-run or alter anything — the columns already exist live.
--
-- NOT reconciled with schema.prisma: Customer.parentAgentId,
-- Customer.birthDate exist in the database but have no field in
-- prisma/schema.prisma's Customer model. This is a pre-existing drift,
-- separate from this change, and should be looked at on its own.
@@ -0,0 +1,5 @@
-- CreateEnum
CREATE TYPE "ProductImageRole" AS ENUM ('FEATURED', 'FEATURED_MOBILE', 'GALLERY', 'GALLERY_MOBILE');
-- AlterTable
ALTER TABLE "ProductImage" ADD COLUMN "role" "ProductImageRole" NOT NULL DEFAULT 'GALLERY';
File diff suppressed because one or more lines are too long
+9 -1
View File
@@ -243,7 +243,8 @@ exports.Prisma.ProductImageScalarFieldEnum = {
id: 'id',
productId: 'productId',
url: 'url',
sortOrder: 'sortOrder'
sortOrder: 'sortOrder',
role: 'role'
};
exports.Prisma.ProductVariantScalarFieldEnum = {
@@ -537,6 +538,13 @@ exports.VerificationStep = exports.$Enums.VerificationStep = {
VERIFIED: 'VERIFIED'
};
exports.ProductImageRole = exports.$Enums.ProductImageRole = {
FEATURED: 'FEATURED',
FEATURED_MOBILE: 'FEATURED_MOBILE',
GALLERY: 'GALLERY',
GALLERY_MOBILE: 'GALLERY_MOBILE'
};
exports.OrderChannel = exports.$Enums.OrderChannel = {
RETAIL: 'RETAIL',
WHOLESALE: 'WHOLESALE'
+107 -1
View File
@@ -230,6 +230,16 @@ export const VerificationStep: {
export type VerificationStep = (typeof VerificationStep)[keyof typeof VerificationStep]
export const ProductImageRole: {
FEATURED: 'FEATURED',
FEATURED_MOBILE: 'FEATURED_MOBILE',
GALLERY: 'GALLERY',
GALLERY_MOBILE: 'GALLERY_MOBILE'
};
export type ProductImageRole = (typeof ProductImageRole)[keyof typeof ProductImageRole]
export const OrderChannel: {
RETAIL: 'RETAIL',
WHOLESALE: 'WHOLESALE'
@@ -346,6 +356,10 @@ export type VerificationStep = $Enums.VerificationStep
export const VerificationStep: typeof $Enums.VerificationStep
export type ProductImageRole = $Enums.ProductImageRole
export const ProductImageRole: typeof $Enums.ProductImageRole
export type OrderChannel = $Enums.OrderChannel
export const OrderChannel: typeof $Enums.OrderChannel
@@ -16760,6 +16774,7 @@ export namespace Prisma {
productId: string | null
url: string | null
sortOrder: number | null
role: $Enums.ProductImageRole | null
}
export type ProductImageMaxAggregateOutputType = {
@@ -16767,6 +16782,7 @@ export namespace Prisma {
productId: string | null
url: string | null
sortOrder: number | null
role: $Enums.ProductImageRole | null
}
export type ProductImageCountAggregateOutputType = {
@@ -16774,6 +16790,7 @@ export namespace Prisma {
productId: number
url: number
sortOrder: number
role: number
_all: number
}
@@ -16791,6 +16808,7 @@ export namespace Prisma {
productId?: true
url?: true
sortOrder?: true
role?: true
}
export type ProductImageMaxAggregateInputType = {
@@ -16798,6 +16816,7 @@ export namespace Prisma {
productId?: true
url?: true
sortOrder?: true
role?: true
}
export type ProductImageCountAggregateInputType = {
@@ -16805,6 +16824,7 @@ export namespace Prisma {
productId?: true
url?: true
sortOrder?: true
role?: true
_all?: true
}
@@ -16899,6 +16919,7 @@ export namespace Prisma {
productId: string
url: string
sortOrder: number
role: $Enums.ProductImageRole
_count: ProductImageCountAggregateOutputType | null
_avg: ProductImageAvgAggregateOutputType | null
_sum: ProductImageSumAggregateOutputType | null
@@ -16925,6 +16946,7 @@ export namespace Prisma {
productId?: boolean
url?: boolean
sortOrder?: boolean
role?: boolean
product?: boolean | ProductDefaultArgs<ExtArgs>
}, ExtArgs["result"]["productImage"]>
@@ -16933,6 +16955,7 @@ export namespace Prisma {
productId?: boolean
url?: boolean
sortOrder?: boolean
role?: boolean
product?: boolean | ProductDefaultArgs<ExtArgs>
}, ExtArgs["result"]["productImage"]>
@@ -16941,6 +16964,7 @@ export namespace Prisma {
productId?: boolean
url?: boolean
sortOrder?: boolean
role?: boolean
}
export type ProductImageInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
@@ -16960,6 +16984,12 @@ export namespace Prisma {
productId: string
url: string
sortOrder: number
/**
* Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /
* گالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so
* existing rows and any generic "just attach an image" caller keep working.
*/
role: $Enums.ProductImageRole
}, ExtArgs["result"]["productImage"]>
composites: {}
}
@@ -17358,6 +17388,7 @@ export namespace Prisma {
readonly productId: FieldRef<"ProductImage", 'String'>
readonly url: FieldRef<"ProductImage", 'String'>
readonly sortOrder: FieldRef<"ProductImage", 'Int'>
readonly role: FieldRef<"ProductImage", 'ProductImageRole'>
}
@@ -41095,7 +41126,8 @@ export namespace Prisma {
id: 'id',
productId: 'productId',
url: 'url',
sortOrder: 'sortOrder'
sortOrder: 'sortOrder',
role: 'role'
};
export type ProductImageScalarFieldEnum = (typeof ProductImageScalarFieldEnum)[keyof typeof ProductImageScalarFieldEnum]
@@ -41564,6 +41596,20 @@ export namespace Prisma {
/**
* Reference to a field of type 'ProductImageRole'
*/
export type EnumProductImageRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'ProductImageRole'>
/**
* Reference to a field of type 'ProductImageRole[]'
*/
export type ListEnumProductImageRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'ProductImageRole[]'>
/**
* Reference to a field of type 'OrderChannel'
*/
@@ -42620,6 +42666,7 @@ export namespace Prisma {
productId?: StringFilter<"ProductImage"> | string
url?: StringFilter<"ProductImage"> | string
sortOrder?: IntFilter<"ProductImage"> | number
role?: EnumProductImageRoleFilter<"ProductImage"> | $Enums.ProductImageRole
product?: XOR<ProductRelationFilter, ProductWhereInput>
}
@@ -42628,6 +42675,7 @@ export namespace Prisma {
productId?: SortOrder
url?: SortOrder
sortOrder?: SortOrder
role?: SortOrder
product?: ProductOrderByWithRelationInput
}
@@ -42639,6 +42687,7 @@ export namespace Prisma {
productId?: StringFilter<"ProductImage"> | string
url?: StringFilter<"ProductImage"> | string
sortOrder?: IntFilter<"ProductImage"> | number
role?: EnumProductImageRoleFilter<"ProductImage"> | $Enums.ProductImageRole
product?: XOR<ProductRelationFilter, ProductWhereInput>
}, "id">
@@ -42647,6 +42696,7 @@ export namespace Prisma {
productId?: SortOrder
url?: SortOrder
sortOrder?: SortOrder
role?: SortOrder
_count?: ProductImageCountOrderByAggregateInput
_avg?: ProductImageAvgOrderByAggregateInput
_max?: ProductImageMaxOrderByAggregateInput
@@ -42662,6 +42712,7 @@ export namespace Prisma {
productId?: StringWithAggregatesFilter<"ProductImage"> | string
url?: StringWithAggregatesFilter<"ProductImage"> | string
sortOrder?: IntWithAggregatesFilter<"ProductImage"> | number
role?: EnumProductImageRoleWithAggregatesFilter<"ProductImage"> | $Enums.ProductImageRole
}
export type ProductVariantWhereInput = {
@@ -45295,6 +45346,7 @@ export namespace Prisma {
id?: string
url: string
sortOrder?: number
role?: $Enums.ProductImageRole
product: ProductCreateNestedOneWithoutImagesInput
}
@@ -45303,12 +45355,14 @@ export namespace Prisma {
productId: string
url: string
sortOrder?: number
role?: $Enums.ProductImageRole
}
export type ProductImageUpdateInput = {
id?: StringFieldUpdateOperationsInput | string
url?: StringFieldUpdateOperationsInput | string
sortOrder?: IntFieldUpdateOperationsInput | number
role?: EnumProductImageRoleFieldUpdateOperationsInput | $Enums.ProductImageRole
product?: ProductUpdateOneRequiredWithoutImagesNestedInput
}
@@ -45317,6 +45371,7 @@ export namespace Prisma {
productId?: StringFieldUpdateOperationsInput | string
url?: StringFieldUpdateOperationsInput | string
sortOrder?: IntFieldUpdateOperationsInput | number
role?: EnumProductImageRoleFieldUpdateOperationsInput | $Enums.ProductImageRole
}
export type ProductImageCreateManyInput = {
@@ -45324,12 +45379,14 @@ export namespace Prisma {
productId: string
url: string
sortOrder?: number
role?: $Enums.ProductImageRole
}
export type ProductImageUpdateManyMutationInput = {
id?: StringFieldUpdateOperationsInput | string
url?: StringFieldUpdateOperationsInput | string
sortOrder?: IntFieldUpdateOperationsInput | number
role?: EnumProductImageRoleFieldUpdateOperationsInput | $Enums.ProductImageRole
}
export type ProductImageUncheckedUpdateManyInput = {
@@ -45337,6 +45394,7 @@ export namespace Prisma {
productId?: StringFieldUpdateOperationsInput | string
url?: StringFieldUpdateOperationsInput | string
sortOrder?: IntFieldUpdateOperationsInput | number
role?: EnumProductImageRoleFieldUpdateOperationsInput | $Enums.ProductImageRole
}
export type ProductVariantCreateInput = {
@@ -48032,11 +48090,19 @@ export namespace Prisma {
showType?: SortOrder
}
export type EnumProductImageRoleFilter<$PrismaModel = never> = {
equals?: $Enums.ProductImageRole | EnumProductImageRoleFieldRefInput<$PrismaModel>
in?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
not?: NestedEnumProductImageRoleFilter<$PrismaModel> | $Enums.ProductImageRole
}
export type ProductImageCountOrderByAggregateInput = {
id?: SortOrder
productId?: SortOrder
url?: SortOrder
sortOrder?: SortOrder
role?: SortOrder
}
export type ProductImageAvgOrderByAggregateInput = {
@@ -48048,6 +48114,7 @@ export namespace Prisma {
productId?: SortOrder
url?: SortOrder
sortOrder?: SortOrder
role?: SortOrder
}
export type ProductImageMinOrderByAggregateInput = {
@@ -48055,12 +48122,23 @@ export namespace Prisma {
productId?: SortOrder
url?: SortOrder
sortOrder?: SortOrder
role?: SortOrder
}
export type ProductImageSumOrderByAggregateInput = {
sortOrder?: SortOrder
}
export type EnumProductImageRoleWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.ProductImageRole | EnumProductImageRoleFieldRefInput<$PrismaModel>
in?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
not?: NestedEnumProductImageRoleWithAggregatesFilter<$PrismaModel> | $Enums.ProductImageRole
_count?: NestedIntFilter<$PrismaModel>
_min?: NestedEnumProductImageRoleFilter<$PrismaModel>
_max?: NestedEnumProductImageRoleFilter<$PrismaModel>
}
export type OrderItemListRelationFilter = {
every?: OrderItemWhereInput
some?: OrderItemWhereInput
@@ -51177,6 +51255,10 @@ export namespace Prisma {
connect?: ProductWhereUniqueInput
}
export type EnumProductImageRoleFieldUpdateOperationsInput = {
set?: $Enums.ProductImageRole
}
export type ProductUpdateOneRequiredWithoutImagesNestedInput = {
create?: XOR<ProductCreateWithoutImagesInput, ProductUncheckedCreateWithoutImagesInput>
connectOrCreate?: ProductCreateOrConnectWithoutImagesInput
@@ -52532,6 +52614,23 @@ export namespace Prisma {
not?: NestedFloatFilter<$PrismaModel> | number
}
export type NestedEnumProductImageRoleFilter<$PrismaModel = never> = {
equals?: $Enums.ProductImageRole | EnumProductImageRoleFieldRefInput<$PrismaModel>
in?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
not?: NestedEnumProductImageRoleFilter<$PrismaModel> | $Enums.ProductImageRole
}
export type NestedEnumProductImageRoleWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.ProductImageRole | EnumProductImageRoleFieldRefInput<$PrismaModel>
in?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
notIn?: $Enums.ProductImageRole[] | ListEnumProductImageRoleFieldRefInput<$PrismaModel>
not?: NestedEnumProductImageRoleWithAggregatesFilter<$PrismaModel> | $Enums.ProductImageRole
_count?: NestedIntFilter<$PrismaModel>
_min?: NestedEnumProductImageRoleFilter<$PrismaModel>
_max?: NestedEnumProductImageRoleFilter<$PrismaModel>
}
export type NestedEnumOrderChannelFilter<$PrismaModel = never> = {
equals?: $Enums.OrderChannel | EnumOrderChannelFieldRefInput<$PrismaModel>
in?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel>
@@ -55882,12 +55981,14 @@ export namespace Prisma {
id?: string
url: string
sortOrder?: number
role?: $Enums.ProductImageRole
}
export type ProductImageUncheckedCreateWithoutProductInput = {
id?: string
url: string
sortOrder?: number
role?: $Enums.ProductImageRole
}
export type ProductImageCreateOrConnectWithoutProductInput = {
@@ -56133,6 +56234,7 @@ export namespace Prisma {
productId?: StringFilter<"ProductImage"> | string
url?: StringFilter<"ProductImage"> | string
sortOrder?: IntFilter<"ProductImage"> | number
role?: EnumProductImageRoleFilter<"ProductImage"> | $Enums.ProductImageRole
}
export type CollectionProductUpsertWithWhereUniqueWithoutProductInput = {
@@ -62235,6 +62337,7 @@ export namespace Prisma {
id?: string
url: string
sortOrder?: number
role?: $Enums.ProductImageRole
}
export type CollectionProductCreateManyProductInput = {
@@ -62314,18 +62417,21 @@ export namespace Prisma {
id?: StringFieldUpdateOperationsInput | string
url?: StringFieldUpdateOperationsInput | string
sortOrder?: IntFieldUpdateOperationsInput | number
role?: EnumProductImageRoleFieldUpdateOperationsInput | $Enums.ProductImageRole
}
export type ProductImageUncheckedUpdateWithoutProductInput = {
id?: StringFieldUpdateOperationsInput | string
url?: StringFieldUpdateOperationsInput | string
sortOrder?: IntFieldUpdateOperationsInput | number
role?: EnumProductImageRoleFieldUpdateOperationsInput | $Enums.ProductImageRole
}
export type ProductImageUncheckedUpdateManyWithoutProductInput = {
id?: StringFieldUpdateOperationsInput | string
url?: StringFieldUpdateOperationsInput | string
sortOrder?: IntFieldUpdateOperationsInput | number
role?: EnumProductImageRoleFieldUpdateOperationsInput | $Enums.ProductImageRole
}
export type CollectionProductUpdateWithoutProductInput = {
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "prisma-client-9a5464add1bac751da0fd2476fcc0a15f434a77547c687bcb5959b29d451c62b",
"name": "prisma-client-ed6338840581098d1a6f6e7ebfa38995b890cf67ba58cec8ad302fd997d92a01",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",
+14 -3
View File
@@ -320,11 +320,22 @@ model Product {
}
model ProductImage {
id String @id @default(cuid())
id String @id @default(cuid())
productId String
product Product @relation(fields: [productId], references: [id])
product Product @relation(fields: [productId], references: [id])
url String
sortOrder Int @default(0)
sortOrder Int @default(0)
/// Legacy had 4 distinct upload slots (تصویر شاخص / تصویر شاخص موبایل /
/// گالری تصاویر سایت / گالری تصاویر موبایل) — GALLERY is the default so
/// existing rows and any generic "just attach an image" caller keep working.
role ProductImageRole @default(GALLERY)
}
enum ProductImageRole {
FEATURED
FEATURED_MOBILE
GALLERY
GALLERY_MOBILE
}
model ProductVariant {
+9 -1
View File
@@ -243,7 +243,8 @@ exports.Prisma.ProductImageScalarFieldEnum = {
id: 'id',
productId: 'productId',
url: 'url',
sortOrder: 'sortOrder'
sortOrder: 'sortOrder',
role: 'role'
};
exports.Prisma.ProductVariantScalarFieldEnum = {
@@ -537,6 +538,13 @@ exports.VerificationStep = exports.$Enums.VerificationStep = {
VERIFIED: 'VERIFIED'
};
exports.ProductImageRole = exports.$Enums.ProductImageRole = {
FEATURED: 'FEATURED',
FEATURED_MOBILE: 'FEATURED_MOBILE',
GALLERY: 'GALLERY',
GALLERY_MOBILE: 'GALLERY_MOBILE'
};
exports.OrderChannel = exports.$Enums.OrderChannel = {
RETAIL: 'RETAIL',
WHOLESALE: 'WHOLESALE'