Fix Docker deploy Prisma build
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -37,8 +37,5 @@ yarn-error.log*
|
|||||||
next-env.d.ts
|
next-env.d.ts
|
||||||
|
|
||||||
# Prisma
|
# Prisma
|
||||||
# Note: We keep generated Prisma client for deployment in Iran servers
|
# Keep lib/generated/prisma committed so Docker builds do not need to
|
||||||
# /node_modules/.prisma
|
# download Prisma binaries during deployment.
|
||||||
# /node_modules/@prisma/client
|
|
||||||
# Keep prisma/generated for deployment
|
|
||||||
!/prisma/generated
|
|
||||||
|
|||||||
20
Dockerfile
20
Dockerfile
@@ -1,11 +1,9 @@
|
|||||||
FROM node:20-alpine AS deps
|
FROM node:20-alpine AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# استفاده از Runflare mirror برای NPM
|
|
||||||
RUN npm config set registry https://mirror-npm.runflare.com/ \
|
RUN npm config set registry https://mirror-npm.runflare.com/ \
|
||||||
&& npm config set replace-registry-host always
|
&& npm config set replace-registry-host always
|
||||||
|
|
||||||
# غیرفعال کردن Prisma postinstall
|
|
||||||
ENV PRISMA_SKIP_POSTINSTALL_GENERATE=1
|
ENV PRISMA_SKIP_POSTINSTALL_GENERATE=1
|
||||||
|
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
@@ -16,31 +14,18 @@ WORKDIR /app
|
|||||||
|
|
||||||
ARG DATABASE_URL
|
ARG DATABASE_URL
|
||||||
ARG NEXTAUTH_URL
|
ARG NEXTAUTH_URL
|
||||||
ARG NEXTAUTH_SECRET
|
|
||||||
ARG IPPANEL_TOKEN
|
|
||||||
ENV DATABASE_URL=$DATABASE_URL
|
ENV DATABASE_URL=$DATABASE_URL
|
||||||
ENV NEXTAUTH_URL=$NEXTAUTH_URL
|
ENV NEXTAUTH_URL=$NEXTAUTH_URL
|
||||||
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET
|
|
||||||
ENV IPPANEL_TOKEN=$IPPANEL_TOKEN
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV PRISMA_SKIP_POSTINSTALL_GENERATE=1
|
ENV PRISMA_SKIP_POSTINSTALL_GENERATE=1
|
||||||
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# استفاده از pre-generated Prisma client اگر وجود داشته باشد
|
RUN test -f lib/generated/prisma/index.js
|
||||||
RUN if [ -d "prisma/generated/.prisma-client" ]; then \
|
|
||||||
echo "Using pre-generated Prisma client..."; \
|
|
||||||
mkdir -p node_modules/.prisma; \
|
|
||||||
cp -r prisma/generated/.prisma-client node_modules/.prisma/client; \
|
|
||||||
cp -r prisma/generated/@prisma-client node_modules/@prisma/client; \
|
|
||||||
else \
|
|
||||||
echo "Warning: Pre-generated Prisma client not found"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ساخت بدون Prisma generate
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN npm run build 2>&1 || echo "Build completed with warnings"
|
RUN npm run build:docker
|
||||||
|
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -57,6 +42,7 @@ COPY --from=builder --chown=nextjs:nextjs /app/node_modules ./node_modules
|
|||||||
COPY --from=builder --chown=nextjs:nextjs /app/.next ./.next
|
COPY --from=builder --chown=nextjs:nextjs /app/.next ./.next
|
||||||
COPY --from=builder --chown=nextjs:nextjs /app/public ./public
|
COPY --from=builder --chown=nextjs:nextjs /app/public ./public
|
||||||
COPY --from=builder --chown=nextjs:nextjs /app/prisma ./prisma
|
COPY --from=builder --chown=nextjs:nextjs /app/prisma ./prisma
|
||||||
|
COPY --from=builder --chown=nextjs:nextjs /app/lib/generated ./lib/generated
|
||||||
COPY --from=builder --chown=nextjs:nextjs /app/next.config.* ./
|
COPY --from=builder --chown=nextjs:nextjs /app/next.config.* ./
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { db } from "@/lib/db";
|
|||||||
import bcrypt from "bcryptjs";
|
import bcrypt from "bcryptjs";
|
||||||
|
|
||||||
export const authOptions: NextAuthOptions = {
|
export const authOptions: NextAuthOptions = {
|
||||||
adapter: PrismaAdapter(db) as any,
|
adapter: (PrismaAdapter as any)(db),
|
||||||
session: { strategy: "jwt" },
|
session: { strategy: "jwt" },
|
||||||
pages: {
|
pages: {
|
||||||
signIn: "/login",
|
signIn: "/login",
|
||||||
|
|||||||
1
lib/generated/prisma/client.d.ts
vendored
Normal file
1
lib/generated/prisma/client.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from "./index"
|
||||||
5
lib/generated/prisma/client.js
Normal file
5
lib/generated/prisma/client.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
||||||
|
/* eslint-disable */
|
||||||
|
// biome-ignore-all lint: generated file
|
||||||
|
module.exports = { ...require('.') }
|
||||||
1
lib/generated/prisma/default.d.ts
vendored
Normal file
1
lib/generated/prisma/default.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from "./index"
|
||||||
5
lib/generated/prisma/default.js
Normal file
5
lib/generated/prisma/default.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
||||||
|
/* eslint-disable */
|
||||||
|
// biome-ignore-all lint: generated file
|
||||||
|
module.exports = { ...require('#main-entry-point') }
|
||||||
1
lib/generated/prisma/edge.d.ts
vendored
Normal file
1
lib/generated/prisma/edge.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from "./default"
|
||||||
531
lib/generated/prisma/edge.js
Normal file
531
lib/generated/prisma/edge.js
Normal file
File diff suppressed because one or more lines are too long
517
lib/generated/prisma/index-browser.js
Normal file
517
lib/generated/prisma/index-browser.js
Normal file
@@ -0,0 +1,517 @@
|
|||||||
|
|
||||||
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
||||||
|
/* eslint-disable */
|
||||||
|
// biome-ignore-all lint: generated file
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
|
||||||
|
const {
|
||||||
|
Decimal,
|
||||||
|
objectEnumValues,
|
||||||
|
makeStrictEnum,
|
||||||
|
Public,
|
||||||
|
getRuntime,
|
||||||
|
skip
|
||||||
|
} = require('./runtime/index-browser.js')
|
||||||
|
|
||||||
|
|
||||||
|
const Prisma = {}
|
||||||
|
|
||||||
|
exports.Prisma = Prisma
|
||||||
|
exports.$Enums = {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prisma Client JS version: 6.19.3
|
||||||
|
* Query Engine version: c2990dca591cba766e3b7ef5d9e8a84796e47ab7
|
||||||
|
*/
|
||||||
|
Prisma.prismaVersion = {
|
||||||
|
client: "6.19.3",
|
||||||
|
engine: "c2990dca591cba766e3b7ef5d9e8a84796e47ab7"
|
||||||
|
}
|
||||||
|
|
||||||
|
Prisma.PrismaClientKnownRequestError = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)};
|
||||||
|
Prisma.PrismaClientUnknownRequestError = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.PrismaClientRustPanicError = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.PrismaClientInitializationError = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.PrismaClientValidationError = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.Decimal = Decimal
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Re-export of sql-template-tag
|
||||||
|
*/
|
||||||
|
Prisma.sql = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.empty = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.join = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.raw = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.validator = Public.validator
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extensions
|
||||||
|
*/
|
||||||
|
Prisma.getExtensionContext = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
Prisma.defineExtension = () => {
|
||||||
|
const runtimeName = getRuntime().prettyName;
|
||||||
|
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
|
||||||
|
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
|
||||||
|
)}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shorthand utilities for JSON filtering
|
||||||
|
*/
|
||||||
|
Prisma.DbNull = objectEnumValues.instances.DbNull
|
||||||
|
Prisma.JsonNull = objectEnumValues.instances.JsonNull
|
||||||
|
Prisma.AnyNull = objectEnumValues.instances.AnyNull
|
||||||
|
|
||||||
|
Prisma.NullTypes = {
|
||||||
|
DbNull: objectEnumValues.classes.DbNull,
|
||||||
|
JsonNull: objectEnumValues.classes.JsonNull,
|
||||||
|
AnyNull: objectEnumValues.classes.AnyNull
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enums
|
||||||
|
*/
|
||||||
|
|
||||||
|
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
|
||||||
|
ReadUncommitted: 'ReadUncommitted',
|
||||||
|
ReadCommitted: 'ReadCommitted',
|
||||||
|
RepeatableRead: 'RepeatableRead',
|
||||||
|
Serializable: 'Serializable'
|
||||||
|
});
|
||||||
|
|
||||||
|
exports.Prisma.CountryScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
code: 'code',
|
||||||
|
flagUrl: 'flagUrl',
|
||||||
|
flagImage: 'flagImage',
|
||||||
|
confederation: 'confederation',
|
||||||
|
qualificationMethod: 'qualificationMethod',
|
||||||
|
qualificationDate: 'qualificationDate',
|
||||||
|
participationHistory: 'participationHistory',
|
||||||
|
bestResult: 'bestResult',
|
||||||
|
description: 'description',
|
||||||
|
defaultFormation: 'defaultFormation',
|
||||||
|
defaultLineupPlayerIds: 'defaultLineupPlayerIds',
|
||||||
|
defaultCaptainId: 'defaultCaptainId',
|
||||||
|
groupId: 'groupId',
|
||||||
|
isEliminated: 'isEliminated'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.GroupScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.PlayerScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
image: 'image',
|
||||||
|
position: 'position',
|
||||||
|
countryId: 'countryId',
|
||||||
|
price: 'price',
|
||||||
|
totalPoints: 'totalPoints',
|
||||||
|
isActive: 'isActive',
|
||||||
|
isGoldenCardEligible: 'isGoldenCardEligible',
|
||||||
|
cardTier: 'cardTier',
|
||||||
|
createdAt: 'createdAt',
|
||||||
|
updatedAt: 'updatedAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.MatchScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
homeTeamId: 'homeTeamId',
|
||||||
|
awayTeamId: 'awayTeamId',
|
||||||
|
homeScore: 'homeScore',
|
||||||
|
awayScore: 'awayScore',
|
||||||
|
stage: 'stage',
|
||||||
|
status: 'status',
|
||||||
|
matchDate: 'matchDate',
|
||||||
|
matchDatePersian: 'matchDatePersian',
|
||||||
|
stadium: 'stadium',
|
||||||
|
city: 'city',
|
||||||
|
referee: 'referee',
|
||||||
|
assistant1: 'assistant1',
|
||||||
|
assistant2: 'assistant2',
|
||||||
|
fourthOfficial: 'fourthOfficial',
|
||||||
|
attendance: 'attendance',
|
||||||
|
weather: 'weather',
|
||||||
|
description: 'description',
|
||||||
|
roundId: 'roundId',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.RoundScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
number: 'number',
|
||||||
|
name: 'name',
|
||||||
|
isActive: 'isActive',
|
||||||
|
deadline: 'deadline',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.GameweekScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
number: 'number',
|
||||||
|
name: 'name',
|
||||||
|
isActive: 'isActive',
|
||||||
|
deadline: 'deadline',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.MatchEventScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
matchId: 'matchId',
|
||||||
|
playerId: 'playerId',
|
||||||
|
type: 'type',
|
||||||
|
minute: 'minute',
|
||||||
|
extraInfo: 'extraInfo',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.MatchLineupScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
matchId: 'matchId',
|
||||||
|
countryId: 'countryId',
|
||||||
|
formation: 'formation',
|
||||||
|
playerIds: 'playerIds'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.PlayerMatchStatScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
playerId: 'playerId',
|
||||||
|
matchId: 'matchId',
|
||||||
|
goals: 'goals',
|
||||||
|
assists: 'assists',
|
||||||
|
yellowCards: 'yellowCards',
|
||||||
|
redCards: 'redCards',
|
||||||
|
minutesPlayed: 'minutesPlayed',
|
||||||
|
cleanSheet: 'cleanSheet',
|
||||||
|
penaltySaved: 'penaltySaved',
|
||||||
|
penaltyMissed: 'penaltyMissed',
|
||||||
|
ownGoals: 'ownGoals',
|
||||||
|
isMotm: 'isMotm',
|
||||||
|
extraTimeBonus: 'extraTimeBonus',
|
||||||
|
points: 'points'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.ScoringRuleScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
position: 'position',
|
||||||
|
eventType: 'eventType',
|
||||||
|
points: 'points',
|
||||||
|
updatedAt: 'updatedAt',
|
||||||
|
updatedBy: 'updatedBy'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.UserScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
email: 'email',
|
||||||
|
phone: 'phone',
|
||||||
|
password: 'password',
|
||||||
|
role: 'role',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.LoginOtpScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
phone: 'phone',
|
||||||
|
codeHash: 'codeHash',
|
||||||
|
attempts: 'attempts',
|
||||||
|
expiresAt: 'expiresAt',
|
||||||
|
consumedAt: 'consumedAt',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.FantasyNewsScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
icon: 'icon',
|
||||||
|
title: 'title',
|
||||||
|
description: 'description',
|
||||||
|
newsTime: 'newsTime',
|
||||||
|
createdAt: 'createdAt',
|
||||||
|
updatedAt: 'updatedAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.DailyQuizScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
date: 'date',
|
||||||
|
windowStart: 'windowStart',
|
||||||
|
windowEnd: 'windowEnd',
|
||||||
|
goldWinnersCount: 'goldWinnersCount',
|
||||||
|
silverWinnersCount: 'silverWinnersCount',
|
||||||
|
bronzeWinnersCount: 'bronzeWinnersCount',
|
||||||
|
goldMinCorrect: 'goldMinCorrect',
|
||||||
|
silverMinCorrect: 'silverMinCorrect',
|
||||||
|
bronzeMinCorrect: 'bronzeMinCorrect',
|
||||||
|
isProcessed: 'isProcessed',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.QuizQuestionScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
quizId: 'quizId',
|
||||||
|
questionText: 'questionText',
|
||||||
|
options: 'options',
|
||||||
|
correctAnswer: 'correctAnswer',
|
||||||
|
order: 'order'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.QuizSubmissionScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
userId: 'userId',
|
||||||
|
quizId: 'quizId',
|
||||||
|
answers: 'answers',
|
||||||
|
correctAnswers: 'correctAnswers',
|
||||||
|
score: 'score',
|
||||||
|
submittedAt: 'submittedAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.GoldenCardScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
userId: 'userId',
|
||||||
|
quizId: 'quizId',
|
||||||
|
playerId: 'playerId',
|
||||||
|
cardTier: 'cardTier',
|
||||||
|
status: 'status',
|
||||||
|
state: 'state',
|
||||||
|
acquiredDate: 'acquiredDate',
|
||||||
|
openedAt: 'openedAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.SessionScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
sessionToken: 'sessionToken',
|
||||||
|
userId: 'userId',
|
||||||
|
expires: 'expires'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.TeamScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
userId: 'userId',
|
||||||
|
budget: 'budget',
|
||||||
|
totalPoints: 'totalPoints',
|
||||||
|
formation: 'formation',
|
||||||
|
status: 'status',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.TeamPlayerScalarFieldEnum = {
|
||||||
|
teamId: 'teamId',
|
||||||
|
playerId: 'playerId',
|
||||||
|
goldenCardId: 'goldenCardId',
|
||||||
|
isCaptain: 'isCaptain',
|
||||||
|
isViceCaptain: 'isViceCaptain',
|
||||||
|
isBench: 'isBench',
|
||||||
|
positionIndex: 'positionIndex'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.PackageScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
budgetBonus: 'budgetBonus',
|
||||||
|
price: 'price',
|
||||||
|
description: 'description',
|
||||||
|
isActive: 'isActive'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.PaymentScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
userId: 'userId',
|
||||||
|
packageId: 'packageId',
|
||||||
|
amount: 'amount',
|
||||||
|
authority: 'authority',
|
||||||
|
refId: 'refId',
|
||||||
|
status: 'status',
|
||||||
|
createdAt: 'createdAt',
|
||||||
|
updatedAt: 'updatedAt'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.SortOrder = {
|
||||||
|
asc: 'asc',
|
||||||
|
desc: 'desc'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.QueryMode = {
|
||||||
|
default: 'default',
|
||||||
|
insensitive: 'insensitive'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.NullsOrder = {
|
||||||
|
first: 'first',
|
||||||
|
last: 'last'
|
||||||
|
};
|
||||||
|
exports.Position = exports.$Enums.Position = {
|
||||||
|
GK: 'GK',
|
||||||
|
DEF: 'DEF',
|
||||||
|
MID: 'MID',
|
||||||
|
FWD: 'FWD'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.CardTier = exports.$Enums.CardTier = {
|
||||||
|
BRONZE: 'BRONZE',
|
||||||
|
SILVER: 'SILVER',
|
||||||
|
GOLD: 'GOLD'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.MatchStage = exports.$Enums.MatchStage = {
|
||||||
|
GROUP: 'GROUP',
|
||||||
|
ROUND_OF_16: 'ROUND_OF_16',
|
||||||
|
QUARTER_FINAL: 'QUARTER_FINAL',
|
||||||
|
SEMI_FINAL: 'SEMI_FINAL',
|
||||||
|
THIRD_PLACE: 'THIRD_PLACE',
|
||||||
|
FINAL: 'FINAL'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.MatchStatus = exports.$Enums.MatchStatus = {
|
||||||
|
SCHEDULED: 'SCHEDULED',
|
||||||
|
LIVE: 'LIVE',
|
||||||
|
FINISHED: 'FINISHED'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.EventType = exports.$Enums.EventType = {
|
||||||
|
GOAL: 'GOAL',
|
||||||
|
ASSIST: 'ASSIST',
|
||||||
|
YELLOW_CARD: 'YELLOW_CARD',
|
||||||
|
RED_CARD: 'RED_CARD',
|
||||||
|
SECOND_YELLOW: 'SECOND_YELLOW',
|
||||||
|
SUBSTITUTION_IN: 'SUBSTITUTION_IN',
|
||||||
|
SUBSTITUTION_OUT: 'SUBSTITUTION_OUT',
|
||||||
|
INJURY_NO_SUB: 'INJURY_NO_SUB',
|
||||||
|
CLEAN_SHEET: 'CLEAN_SHEET',
|
||||||
|
PENALTY_SAVED: 'PENALTY_SAVED',
|
||||||
|
PENALTY_MISSED: 'PENALTY_MISSED',
|
||||||
|
OWN_GOAL: 'OWN_GOAL',
|
||||||
|
EXTRA_TIME_BONUS: 'EXTRA_TIME_BONUS',
|
||||||
|
MOTM: 'MOTM'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Role = exports.$Enums.Role = {
|
||||||
|
USER: 'USER',
|
||||||
|
ADMIN: 'ADMIN'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.GoldenCardStatus = exports.$Enums.GoldenCardStatus = {
|
||||||
|
SEALED: 'SEALED',
|
||||||
|
OPENED: 'OPENED'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.SpecialCardState = exports.$Enums.SpecialCardState = {
|
||||||
|
IN_INVENTORY: 'IN_INVENTORY',
|
||||||
|
IN_TEAM: 'IN_TEAM',
|
||||||
|
SOLD: 'SOLD'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.TeamStatus = exports.$Enums.TeamStatus = {
|
||||||
|
PENDING: 'PENDING',
|
||||||
|
APPROVED: 'APPROVED',
|
||||||
|
REJECTED: 'REJECTED',
|
||||||
|
ACTIVE: 'ACTIVE',
|
||||||
|
INACTIVE: 'INACTIVE'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.PaymentStatus = exports.$Enums.PaymentStatus = {
|
||||||
|
PENDING: 'PENDING',
|
||||||
|
SUCCESS: 'SUCCESS',
|
||||||
|
FAILED: 'FAILED'
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Prisma.ModelName = {
|
||||||
|
Country: 'Country',
|
||||||
|
Group: 'Group',
|
||||||
|
Player: 'Player',
|
||||||
|
Match: 'Match',
|
||||||
|
Round: 'Round',
|
||||||
|
Gameweek: 'Gameweek',
|
||||||
|
MatchEvent: 'MatchEvent',
|
||||||
|
MatchLineup: 'MatchLineup',
|
||||||
|
PlayerMatchStat: 'PlayerMatchStat',
|
||||||
|
ScoringRule: 'ScoringRule',
|
||||||
|
User: 'User',
|
||||||
|
LoginOtp: 'LoginOtp',
|
||||||
|
FantasyNews: 'FantasyNews',
|
||||||
|
DailyQuiz: 'DailyQuiz',
|
||||||
|
QuizQuestion: 'QuizQuestion',
|
||||||
|
QuizSubmission: 'QuizSubmission',
|
||||||
|
GoldenCard: 'GoldenCard',
|
||||||
|
Session: 'Session',
|
||||||
|
Team: 'Team',
|
||||||
|
TeamPlayer: 'TeamPlayer',
|
||||||
|
Package: 'Package',
|
||||||
|
Payment: 'Payment'
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a stub Prisma Client that will error at runtime if called.
|
||||||
|
*/
|
||||||
|
class PrismaClient {
|
||||||
|
constructor() {
|
||||||
|
return new Proxy(this, {
|
||||||
|
get(target, prop) {
|
||||||
|
let message
|
||||||
|
const runtime = getRuntime()
|
||||||
|
if (runtime.isEdge) {
|
||||||
|
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
|
||||||
|
- Use Prisma Accelerate: https://pris.ly/d/accelerate
|
||||||
|
- Use Driver Adapters: https://pris.ly/d/driver-adapters
|
||||||
|
`;
|
||||||
|
} else {
|
||||||
|
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
|
||||||
|
}
|
||||||
|
|
||||||
|
message += `
|
||||||
|
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
|
||||||
|
|
||||||
|
throw new Error(message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.PrismaClient = PrismaClient
|
||||||
|
|
||||||
|
Object.assign(exports, Prisma)
|
||||||
40347
lib/generated/prisma/index.d.ts
vendored
Normal file
40347
lib/generated/prisma/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
557
lib/generated/prisma/index.js
Normal file
557
lib/generated/prisma/index.js
Normal file
File diff suppressed because one or more lines are too long
183
lib/generated/prisma/package.json
Normal file
183
lib/generated/prisma/package.json
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
{
|
||||||
|
"name": "prisma-client-49385eb0fcdd57042a26789a1a38ea389dc814b2f500cfcebcca17b00a9cad78",
|
||||||
|
"main": "index.js",
|
||||||
|
"types": "index.d.ts",
|
||||||
|
"browser": "default.js",
|
||||||
|
"exports": {
|
||||||
|
"./client": {
|
||||||
|
"require": {
|
||||||
|
"node": "./index.js",
|
||||||
|
"edge-light": "./wasm.js",
|
||||||
|
"workerd": "./wasm.js",
|
||||||
|
"worker": "./wasm.js",
|
||||||
|
"browser": "./index-browser.js",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"import": {
|
||||||
|
"node": "./index.js",
|
||||||
|
"edge-light": "./wasm.js",
|
||||||
|
"workerd": "./wasm.js",
|
||||||
|
"worker": "./wasm.js",
|
||||||
|
"browser": "./index-browser.js",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"./package.json": "./package.json",
|
||||||
|
".": {
|
||||||
|
"require": {
|
||||||
|
"node": "./index.js",
|
||||||
|
"edge-light": "./wasm.js",
|
||||||
|
"workerd": "./wasm.js",
|
||||||
|
"worker": "./wasm.js",
|
||||||
|
"browser": "./index-browser.js",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"import": {
|
||||||
|
"node": "./index.js",
|
||||||
|
"edge-light": "./wasm.js",
|
||||||
|
"workerd": "./wasm.js",
|
||||||
|
"worker": "./wasm.js",
|
||||||
|
"browser": "./index-browser.js",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"./edge": {
|
||||||
|
"types": "./edge.d.ts",
|
||||||
|
"require": "./edge.js",
|
||||||
|
"import": "./edge.js",
|
||||||
|
"default": "./edge.js"
|
||||||
|
},
|
||||||
|
"./react-native": {
|
||||||
|
"types": "./react-native.d.ts",
|
||||||
|
"require": "./react-native.js",
|
||||||
|
"import": "./react-native.js",
|
||||||
|
"default": "./react-native.js"
|
||||||
|
},
|
||||||
|
"./extension": {
|
||||||
|
"types": "./extension.d.ts",
|
||||||
|
"require": "./extension.js",
|
||||||
|
"import": "./extension.js",
|
||||||
|
"default": "./extension.js"
|
||||||
|
},
|
||||||
|
"./index-browser": {
|
||||||
|
"types": "./index.d.ts",
|
||||||
|
"require": "./index-browser.js",
|
||||||
|
"import": "./index-browser.js",
|
||||||
|
"default": "./index-browser.js"
|
||||||
|
},
|
||||||
|
"./index": {
|
||||||
|
"types": "./index.d.ts",
|
||||||
|
"require": "./index.js",
|
||||||
|
"import": "./index.js",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"./wasm": {
|
||||||
|
"types": "./wasm.d.ts",
|
||||||
|
"require": "./wasm.js",
|
||||||
|
"import": "./wasm.mjs",
|
||||||
|
"default": "./wasm.mjs"
|
||||||
|
},
|
||||||
|
"./runtime/client": {
|
||||||
|
"types": "./runtime/client.d.ts",
|
||||||
|
"node": {
|
||||||
|
"require": "./runtime/client.js",
|
||||||
|
"default": "./runtime/client.js"
|
||||||
|
},
|
||||||
|
"require": "./runtime/client.js",
|
||||||
|
"import": "./runtime/client.mjs",
|
||||||
|
"default": "./runtime/client.mjs"
|
||||||
|
},
|
||||||
|
"./runtime/library": {
|
||||||
|
"types": "./runtime/library.d.ts",
|
||||||
|
"require": "./runtime/library.js",
|
||||||
|
"import": "./runtime/library.mjs",
|
||||||
|
"default": "./runtime/library.mjs"
|
||||||
|
},
|
||||||
|
"./runtime/binary": {
|
||||||
|
"types": "./runtime/binary.d.ts",
|
||||||
|
"require": "./runtime/binary.js",
|
||||||
|
"import": "./runtime/binary.mjs",
|
||||||
|
"default": "./runtime/binary.mjs"
|
||||||
|
},
|
||||||
|
"./runtime/wasm-engine-edge": {
|
||||||
|
"types": "./runtime/wasm-engine-edge.d.ts",
|
||||||
|
"require": "./runtime/wasm-engine-edge.js",
|
||||||
|
"import": "./runtime/wasm-engine-edge.mjs",
|
||||||
|
"default": "./runtime/wasm-engine-edge.mjs"
|
||||||
|
},
|
||||||
|
"./runtime/wasm-compiler-edge": {
|
||||||
|
"types": "./runtime/wasm-compiler-edge.d.ts",
|
||||||
|
"require": "./runtime/wasm-compiler-edge.js",
|
||||||
|
"import": "./runtime/wasm-compiler-edge.mjs",
|
||||||
|
"default": "./runtime/wasm-compiler-edge.mjs"
|
||||||
|
},
|
||||||
|
"./runtime/edge": {
|
||||||
|
"types": "./runtime/edge.d.ts",
|
||||||
|
"require": "./runtime/edge.js",
|
||||||
|
"import": "./runtime/edge-esm.js",
|
||||||
|
"default": "./runtime/edge-esm.js"
|
||||||
|
},
|
||||||
|
"./runtime/react-native": {
|
||||||
|
"types": "./runtime/react-native.d.ts",
|
||||||
|
"require": "./runtime/react-native.js",
|
||||||
|
"import": "./runtime/react-native.js",
|
||||||
|
"default": "./runtime/react-native.js"
|
||||||
|
},
|
||||||
|
"./runtime/index-browser": {
|
||||||
|
"types": "./runtime/index-browser.d.ts",
|
||||||
|
"require": "./runtime/index-browser.js",
|
||||||
|
"import": "./runtime/index-browser.mjs",
|
||||||
|
"default": "./runtime/index-browser.mjs"
|
||||||
|
},
|
||||||
|
"./generator-build": {
|
||||||
|
"require": "./generator-build/index.js",
|
||||||
|
"import": "./generator-build/index.js",
|
||||||
|
"default": "./generator-build/index.js"
|
||||||
|
},
|
||||||
|
"./sql": {
|
||||||
|
"require": {
|
||||||
|
"types": "./sql.d.ts",
|
||||||
|
"node": "./sql.js",
|
||||||
|
"default": "./sql.js"
|
||||||
|
},
|
||||||
|
"import": {
|
||||||
|
"types": "./sql.d.ts",
|
||||||
|
"node": "./sql.mjs",
|
||||||
|
"default": "./sql.mjs"
|
||||||
|
},
|
||||||
|
"default": "./sql.js"
|
||||||
|
},
|
||||||
|
"./*": "./*"
|
||||||
|
},
|
||||||
|
"version": "6.19.3",
|
||||||
|
"sideEffects": false,
|
||||||
|
"imports": {
|
||||||
|
"#wasm-compiler-loader": {
|
||||||
|
"edge-light": "./wasm-edge-light-loader.mjs",
|
||||||
|
"workerd": "./wasm-worker-loader.mjs",
|
||||||
|
"worker": "./wasm-worker-loader.mjs",
|
||||||
|
"default": "./wasm-worker-loader.mjs"
|
||||||
|
},
|
||||||
|
"#main-entry-point": {
|
||||||
|
"require": {
|
||||||
|
"node": "./index.js",
|
||||||
|
"edge-light": "./wasm.js",
|
||||||
|
"workerd": "./wasm.js",
|
||||||
|
"worker": "./wasm.js",
|
||||||
|
"browser": "./index-browser.js",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"import": {
|
||||||
|
"node": "./index.js",
|
||||||
|
"edge-light": "./wasm.js",
|
||||||
|
"workerd": "./wasm.js",
|
||||||
|
"worker": "./wasm.js",
|
||||||
|
"browser": "./index-browser.js",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"default": "./index.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
lib/generated/prisma/query_compiler_bg.js
Normal file
2
lib/generated/prisma/query_compiler_bg.js
Normal file
File diff suppressed because one or more lines are too long
BIN
lib/generated/prisma/query_compiler_bg.wasm
Normal file
BIN
lib/generated/prisma/query_compiler_bg.wasm
Normal file
Binary file not shown.
3982
lib/generated/prisma/runtime/client.d.ts
vendored
Normal file
3982
lib/generated/prisma/runtime/client.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
110
lib/generated/prisma/runtime/client.js
Normal file
110
lib/generated/prisma/runtime/client.js
Normal file
File diff suppressed because one or more lines are too long
35
lib/generated/prisma/runtime/edge-esm.js
Normal file
35
lib/generated/prisma/runtime/edge-esm.js
Normal file
File diff suppressed because one or more lines are too long
35
lib/generated/prisma/runtime/edge.js
Normal file
35
lib/generated/prisma/runtime/edge.js
Normal file
File diff suppressed because one or more lines are too long
370
lib/generated/prisma/runtime/index-browser.d.ts
vendored
Normal file
370
lib/generated/prisma/runtime/index-browser.d.ts
vendored
Normal file
@@ -0,0 +1,370 @@
|
|||||||
|
declare class AnyNull extends NullTypesEnumValue {
|
||||||
|
#private;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare type Args<T, F extends Operation> = T extends {
|
||||||
|
[K: symbol]: {
|
||||||
|
types: {
|
||||||
|
operations: {
|
||||||
|
[K in F]: {
|
||||||
|
args: any;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} ? T[symbol]['types']['operations'][F]['args'] : any;
|
||||||
|
|
||||||
|
declare class DbNull extends NullTypesEnumValue {
|
||||||
|
#private;
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare function Decimal(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
export declare namespace Decimal {
|
||||||
|
export type Constructor = typeof Decimal;
|
||||||
|
export type Instance = Decimal;
|
||||||
|
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
||||||
|
export type Modulo = Rounding | 9;
|
||||||
|
export type Value = string | number | Decimal;
|
||||||
|
|
||||||
|
// http://mikemcl.github.io/decimal.js/#constructor-properties
|
||||||
|
export interface Config {
|
||||||
|
precision?: number;
|
||||||
|
rounding?: Rounding;
|
||||||
|
toExpNeg?: number;
|
||||||
|
toExpPos?: number;
|
||||||
|
minE?: number;
|
||||||
|
maxE?: number;
|
||||||
|
crypto?: boolean;
|
||||||
|
modulo?: Modulo;
|
||||||
|
defaults?: boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare class Decimal {
|
||||||
|
readonly d: number[];
|
||||||
|
readonly e: number;
|
||||||
|
readonly s: number;
|
||||||
|
|
||||||
|
constructor(n: Decimal.Value);
|
||||||
|
|
||||||
|
absoluteValue(): Decimal;
|
||||||
|
abs(): Decimal;
|
||||||
|
|
||||||
|
ceil(): Decimal;
|
||||||
|
|
||||||
|
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
|
||||||
|
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
comparedTo(n: Decimal.Value): number;
|
||||||
|
cmp(n: Decimal.Value): number;
|
||||||
|
|
||||||
|
cosine(): Decimal;
|
||||||
|
cos(): Decimal;
|
||||||
|
|
||||||
|
cubeRoot(): Decimal;
|
||||||
|
cbrt(): Decimal;
|
||||||
|
|
||||||
|
decimalPlaces(): number;
|
||||||
|
dp(): number;
|
||||||
|
|
||||||
|
dividedBy(n: Decimal.Value): Decimal;
|
||||||
|
div(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
dividedToIntegerBy(n: Decimal.Value): Decimal;
|
||||||
|
divToInt(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
equals(n: Decimal.Value): boolean;
|
||||||
|
eq(n: Decimal.Value): boolean;
|
||||||
|
|
||||||
|
floor(): Decimal;
|
||||||
|
|
||||||
|
greaterThan(n: Decimal.Value): boolean;
|
||||||
|
gt(n: Decimal.Value): boolean;
|
||||||
|
|
||||||
|
greaterThanOrEqualTo(n: Decimal.Value): boolean;
|
||||||
|
gte(n: Decimal.Value): boolean;
|
||||||
|
|
||||||
|
hyperbolicCosine(): Decimal;
|
||||||
|
cosh(): Decimal;
|
||||||
|
|
||||||
|
hyperbolicSine(): Decimal;
|
||||||
|
sinh(): Decimal;
|
||||||
|
|
||||||
|
hyperbolicTangent(): Decimal;
|
||||||
|
tanh(): Decimal;
|
||||||
|
|
||||||
|
inverseCosine(): Decimal;
|
||||||
|
acos(): Decimal;
|
||||||
|
|
||||||
|
inverseHyperbolicCosine(): Decimal;
|
||||||
|
acosh(): Decimal;
|
||||||
|
|
||||||
|
inverseHyperbolicSine(): Decimal;
|
||||||
|
asinh(): Decimal;
|
||||||
|
|
||||||
|
inverseHyperbolicTangent(): Decimal;
|
||||||
|
atanh(): Decimal;
|
||||||
|
|
||||||
|
inverseSine(): Decimal;
|
||||||
|
asin(): Decimal;
|
||||||
|
|
||||||
|
inverseTangent(): Decimal;
|
||||||
|
atan(): Decimal;
|
||||||
|
|
||||||
|
isFinite(): boolean;
|
||||||
|
|
||||||
|
isInteger(): boolean;
|
||||||
|
isInt(): boolean;
|
||||||
|
|
||||||
|
isNaN(): boolean;
|
||||||
|
|
||||||
|
isNegative(): boolean;
|
||||||
|
isNeg(): boolean;
|
||||||
|
|
||||||
|
isPositive(): boolean;
|
||||||
|
isPos(): boolean;
|
||||||
|
|
||||||
|
isZero(): boolean;
|
||||||
|
|
||||||
|
lessThan(n: Decimal.Value): boolean;
|
||||||
|
lt(n: Decimal.Value): boolean;
|
||||||
|
|
||||||
|
lessThanOrEqualTo(n: Decimal.Value): boolean;
|
||||||
|
lte(n: Decimal.Value): boolean;
|
||||||
|
|
||||||
|
logarithm(n?: Decimal.Value): Decimal;
|
||||||
|
log(n?: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
minus(n: Decimal.Value): Decimal;
|
||||||
|
sub(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
modulo(n: Decimal.Value): Decimal;
|
||||||
|
mod(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
naturalExponential(): Decimal;
|
||||||
|
exp(): Decimal;
|
||||||
|
|
||||||
|
naturalLogarithm(): Decimal;
|
||||||
|
ln(): Decimal;
|
||||||
|
|
||||||
|
negated(): Decimal;
|
||||||
|
neg(): Decimal;
|
||||||
|
|
||||||
|
plus(n: Decimal.Value): Decimal;
|
||||||
|
add(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
precision(includeZeros?: boolean): number;
|
||||||
|
sd(includeZeros?: boolean): number;
|
||||||
|
|
||||||
|
round(): Decimal;
|
||||||
|
|
||||||
|
sine() : Decimal;
|
||||||
|
sin() : Decimal;
|
||||||
|
|
||||||
|
squareRoot(): Decimal;
|
||||||
|
sqrt(): Decimal;
|
||||||
|
|
||||||
|
tangent() : Decimal;
|
||||||
|
tan() : Decimal;
|
||||||
|
|
||||||
|
times(n: Decimal.Value): Decimal;
|
||||||
|
mul(n: Decimal.Value) : Decimal;
|
||||||
|
|
||||||
|
toBinary(significantDigits?: number): string;
|
||||||
|
toBinary(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||||
|
|
||||||
|
toDecimalPlaces(decimalPlaces?: number): Decimal;
|
||||||
|
toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
|
||||||
|
toDP(decimalPlaces?: number): Decimal;
|
||||||
|
toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
|
||||||
|
|
||||||
|
toExponential(decimalPlaces?: number): string;
|
||||||
|
toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string;
|
||||||
|
|
||||||
|
toFixed(decimalPlaces?: number): string;
|
||||||
|
toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string;
|
||||||
|
|
||||||
|
toFraction(max_denominator?: Decimal.Value): Decimal[];
|
||||||
|
|
||||||
|
toHexadecimal(significantDigits?: number): string;
|
||||||
|
toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||||
|
toHex(significantDigits?: number): string;
|
||||||
|
toHex(significantDigits: number, rounding?: Decimal.Rounding): string;
|
||||||
|
|
||||||
|
toJSON(): string;
|
||||||
|
|
||||||
|
toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal;
|
||||||
|
|
||||||
|
toNumber(): number;
|
||||||
|
|
||||||
|
toOctal(significantDigits?: number): string;
|
||||||
|
toOctal(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||||
|
|
||||||
|
toPower(n: Decimal.Value): Decimal;
|
||||||
|
pow(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
toPrecision(significantDigits?: number): string;
|
||||||
|
toPrecision(significantDigits: number, rounding: Decimal.Rounding): string;
|
||||||
|
|
||||||
|
toSignificantDigits(significantDigits?: number): Decimal;
|
||||||
|
toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal;
|
||||||
|
toSD(significantDigits?: number): Decimal;
|
||||||
|
toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal;
|
||||||
|
|
||||||
|
toString(): string;
|
||||||
|
|
||||||
|
truncated(): Decimal;
|
||||||
|
trunc(): Decimal;
|
||||||
|
|
||||||
|
valueOf(): string;
|
||||||
|
|
||||||
|
static abs(n: Decimal.Value): Decimal;
|
||||||
|
static acos(n: Decimal.Value): Decimal;
|
||||||
|
static acosh(n: Decimal.Value): Decimal;
|
||||||
|
static add(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||||
|
static asin(n: Decimal.Value): Decimal;
|
||||||
|
static asinh(n: Decimal.Value): Decimal;
|
||||||
|
static atan(n: Decimal.Value): Decimal;
|
||||||
|
static atanh(n: Decimal.Value): Decimal;
|
||||||
|
static atan2(y: Decimal.Value, x: Decimal.Value): Decimal;
|
||||||
|
static cbrt(n: Decimal.Value): Decimal;
|
||||||
|
static ceil(n: Decimal.Value): Decimal;
|
||||||
|
static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal;
|
||||||
|
static clone(object?: Decimal.Config): Decimal.Constructor;
|
||||||
|
static config(object: Decimal.Config): Decimal.Constructor;
|
||||||
|
static cos(n: Decimal.Value): Decimal;
|
||||||
|
static cosh(n: Decimal.Value): Decimal;
|
||||||
|
static div(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||||
|
static exp(n: Decimal.Value): Decimal;
|
||||||
|
static floor(n: Decimal.Value): Decimal;
|
||||||
|
static hypot(...n: Decimal.Value[]): Decimal;
|
||||||
|
static isDecimal(object: any): object is Decimal;
|
||||||
|
static ln(n: Decimal.Value): Decimal;
|
||||||
|
static log(n: Decimal.Value, base?: Decimal.Value): Decimal;
|
||||||
|
static log2(n: Decimal.Value): Decimal;
|
||||||
|
static log10(n: Decimal.Value): Decimal;
|
||||||
|
static max(...n: Decimal.Value[]): Decimal;
|
||||||
|
static min(...n: Decimal.Value[]): Decimal;
|
||||||
|
static mod(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||||
|
static mul(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||||
|
static noConflict(): Decimal.Constructor; // Browser only
|
||||||
|
static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal;
|
||||||
|
static random(significantDigits?: number): Decimal;
|
||||||
|
static round(n: Decimal.Value): Decimal;
|
||||||
|
static set(object: Decimal.Config): Decimal.Constructor;
|
||||||
|
static sign(n: Decimal.Value): number;
|
||||||
|
static sin(n: Decimal.Value): Decimal;
|
||||||
|
static sinh(n: Decimal.Value): Decimal;
|
||||||
|
static sqrt(n: Decimal.Value): Decimal;
|
||||||
|
static sub(x: Decimal.Value, y: Decimal.Value): Decimal;
|
||||||
|
static sum(...n: Decimal.Value[]): Decimal;
|
||||||
|
static tan(n: Decimal.Value): Decimal;
|
||||||
|
static tanh(n: Decimal.Value): Decimal;
|
||||||
|
static trunc(n: Decimal.Value): Decimal;
|
||||||
|
|
||||||
|
static readonly default?: Decimal.Constructor;
|
||||||
|
static readonly Decimal?: Decimal.Constructor;
|
||||||
|
|
||||||
|
static readonly precision: number;
|
||||||
|
static readonly rounding: Decimal.Rounding;
|
||||||
|
static readonly toExpNeg: number;
|
||||||
|
static readonly toExpPos: number;
|
||||||
|
static readonly minE: number;
|
||||||
|
static readonly maxE: number;
|
||||||
|
static readonly crypto: boolean;
|
||||||
|
static readonly modulo: Decimal.Modulo;
|
||||||
|
|
||||||
|
static readonly ROUND_UP: 0;
|
||||||
|
static readonly ROUND_DOWN: 1;
|
||||||
|
static readonly ROUND_CEIL: 2;
|
||||||
|
static readonly ROUND_FLOOR: 3;
|
||||||
|
static readonly ROUND_HALF_UP: 4;
|
||||||
|
static readonly ROUND_HALF_DOWN: 5;
|
||||||
|
static readonly ROUND_HALF_EVEN: 6;
|
||||||
|
static readonly ROUND_HALF_CEIL: 7;
|
||||||
|
static readonly ROUND_HALF_FLOOR: 8;
|
||||||
|
static readonly EUCLID: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
|
||||||
|
[K in keyof A]: Exact<A[K], W[K]>;
|
||||||
|
} : W) : never) | (A extends Narrowable ? A : never);
|
||||||
|
|
||||||
|
export declare function getRuntime(): GetRuntimeOutput;
|
||||||
|
|
||||||
|
declare type GetRuntimeOutput = {
|
||||||
|
id: RuntimeName;
|
||||||
|
prettyName: string;
|
||||||
|
isEdge: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
declare class JsonNull extends NullTypesEnumValue {
|
||||||
|
#private;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates more strict variant of an enum which, unlike regular enum,
|
||||||
|
* throws on non-existing property access. This can be useful in following situations:
|
||||||
|
* - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
|
||||||
|
* - enum values are generated dynamically from DMMF.
|
||||||
|
*
|
||||||
|
* In that case, if using normal enums and no compile-time typechecking, using non-existing property
|
||||||
|
* will result in `undefined` value being used, which will be accepted. Using strict enum
|
||||||
|
* in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
|
||||||
|
*
|
||||||
|
* Note: if you need to check for existence of a value in the enum you can still use either
|
||||||
|
* `in` operator or `hasOwnProperty` function.
|
||||||
|
*
|
||||||
|
* @param definition
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
|
||||||
|
|
||||||
|
declare type Narrowable = string | number | bigint | boolean | [];
|
||||||
|
|
||||||
|
declare class NullTypesEnumValue extends ObjectEnumValue {
|
||||||
|
_getNamespace(): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for unique values of object-valued enums.
|
||||||
|
*/
|
||||||
|
declare abstract class ObjectEnumValue {
|
||||||
|
constructor(arg?: symbol);
|
||||||
|
abstract _getNamespace(): string;
|
||||||
|
_getName(): string;
|
||||||
|
toString(): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare const objectEnumValues: {
|
||||||
|
classes: {
|
||||||
|
DbNull: typeof DbNull;
|
||||||
|
JsonNull: typeof JsonNull;
|
||||||
|
AnyNull: typeof AnyNull;
|
||||||
|
};
|
||||||
|
instances: {
|
||||||
|
DbNull: DbNull;
|
||||||
|
JsonNull: JsonNull;
|
||||||
|
AnyNull: AnyNull;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
|
||||||
|
|
||||||
|
declare namespace Public {
|
||||||
|
export {
|
||||||
|
validator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export { Public }
|
||||||
|
|
||||||
|
declare type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '';
|
||||||
|
|
||||||
|
declare function validator<V>(): <S>(select: Exact<S, V>) => S;
|
||||||
|
|
||||||
|
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): <S>(select: Exact<S, Args<C[M], O>>) => S;
|
||||||
|
|
||||||
|
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation, P extends keyof Args<C[M], O>>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
|
||||||
|
|
||||||
|
export { }
|
||||||
17
lib/generated/prisma/runtime/index-browser.js
Normal file
17
lib/generated/prisma/runtime/index-browser.js
Normal file
File diff suppressed because one or more lines are too long
3982
lib/generated/prisma/runtime/library.d.ts
vendored
Normal file
3982
lib/generated/prisma/runtime/library.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
84
lib/generated/prisma/runtime/react-native.js
vendored
Normal file
84
lib/generated/prisma/runtime/react-native.js
vendored
Normal file
File diff suppressed because one or more lines are too long
85
lib/generated/prisma/runtime/wasm-compiler-edge.js
Normal file
85
lib/generated/prisma/runtime/wasm-compiler-edge.js
Normal file
File diff suppressed because one or more lines are too long
38
lib/generated/prisma/runtime/wasm-engine-edge.js
Normal file
38
lib/generated/prisma/runtime/wasm-engine-edge.js
Normal file
File diff suppressed because one or more lines are too long
395
lib/generated/prisma/schema.prisma
Normal file
395
lib/generated/prisma/schema.prisma
Normal file
@@ -0,0 +1,395 @@
|
|||||||
|
generator client {
|
||||||
|
provider = "prisma-client-js"
|
||||||
|
engineType = "client"
|
||||||
|
output = "../lib/generated/prisma"
|
||||||
|
}
|
||||||
|
|
||||||
|
datasource db {
|
||||||
|
provider = "postgresql"
|
||||||
|
url = env("DATABASE_URL")
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Role {
|
||||||
|
USER
|
||||||
|
ADMIN
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Position {
|
||||||
|
GK
|
||||||
|
DEF
|
||||||
|
MID
|
||||||
|
FWD
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MatchStage {
|
||||||
|
GROUP
|
||||||
|
ROUND_OF_16
|
||||||
|
QUARTER_FINAL
|
||||||
|
SEMI_FINAL
|
||||||
|
THIRD_PLACE
|
||||||
|
FINAL
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MatchStatus {
|
||||||
|
SCHEDULED
|
||||||
|
LIVE
|
||||||
|
FINISHED
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TeamStatus {
|
||||||
|
PENDING
|
||||||
|
APPROVED
|
||||||
|
REJECTED
|
||||||
|
ACTIVE
|
||||||
|
INACTIVE
|
||||||
|
}
|
||||||
|
|
||||||
|
enum PaymentStatus {
|
||||||
|
PENDING
|
||||||
|
SUCCESS
|
||||||
|
FAILED
|
||||||
|
}
|
||||||
|
|
||||||
|
enum CardTier {
|
||||||
|
BRONZE
|
||||||
|
SILVER
|
||||||
|
GOLD
|
||||||
|
}
|
||||||
|
|
||||||
|
enum EventType {
|
||||||
|
GOAL
|
||||||
|
ASSIST
|
||||||
|
YELLOW_CARD
|
||||||
|
RED_CARD
|
||||||
|
SECOND_YELLOW
|
||||||
|
SUBSTITUTION_IN
|
||||||
|
SUBSTITUTION_OUT
|
||||||
|
INJURY_NO_SUB
|
||||||
|
CLEAN_SHEET
|
||||||
|
PENALTY_SAVED
|
||||||
|
PENALTY_MISSED
|
||||||
|
OWN_GOAL
|
||||||
|
EXTRA_TIME_BONUS
|
||||||
|
MOTM
|
||||||
|
}
|
||||||
|
|
||||||
|
model Country {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String @unique
|
||||||
|
code String @unique
|
||||||
|
flagUrl String?
|
||||||
|
flagImage String? // نام فایل پرچم مثل Flag_of_Australia.webp
|
||||||
|
confederation String? // کنفدراسیون (UEFA, AFC, CAF, ...)
|
||||||
|
qualificationMethod String? // شیوه راهیابی
|
||||||
|
qualificationDate String? // تاریخ راهیابی
|
||||||
|
participationHistory String? // سابقه شرکت
|
||||||
|
bestResult String? // بهترین نتیجه
|
||||||
|
description String? @db.Text // توضیحات کامل
|
||||||
|
defaultFormation String @default("4-3-3")
|
||||||
|
defaultLineupPlayerIds String[] @default([])
|
||||||
|
defaultCaptainId String? // شناسه کاپیتان پیشفرض
|
||||||
|
group Group? @relation(fields: [groupId], references: [id])
|
||||||
|
groupId String?
|
||||||
|
isEliminated Boolean @default(false)
|
||||||
|
players Player[]
|
||||||
|
homeMatches Match[] @relation("HomeTeam")
|
||||||
|
awayMatches Match[] @relation("AwayTeam")
|
||||||
|
}
|
||||||
|
|
||||||
|
model Group {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String @unique
|
||||||
|
countries Country[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model Player {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String
|
||||||
|
image String? // نام فایل تصویر در public/uploads/players/
|
||||||
|
position Position
|
||||||
|
countryId String
|
||||||
|
country Country @relation(fields: [countryId], references: [id])
|
||||||
|
price Float @default(5.0)
|
||||||
|
totalPoints Int @default(0)
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
isGoldenCardEligible Boolean @default(false)
|
||||||
|
cardTier CardTier @default(BRONZE)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
matchStats PlayerMatchStat[]
|
||||||
|
teamPlayers TeamPlayer[]
|
||||||
|
events MatchEvent[]
|
||||||
|
goldenCards GoldenCard[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model Match {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
homeTeamId String
|
||||||
|
awayTeamId String
|
||||||
|
homeTeam Country @relation("HomeTeam", fields: [homeTeamId], references: [id])
|
||||||
|
awayTeam Country @relation("AwayTeam", fields: [awayTeamId], references: [id])
|
||||||
|
homeScore Int?
|
||||||
|
awayScore Int?
|
||||||
|
stage MatchStage @default(GROUP)
|
||||||
|
status MatchStatus @default(SCHEDULED)
|
||||||
|
matchDate DateTime
|
||||||
|
matchDatePersian String? // تاریخ شمسی
|
||||||
|
stadium String? // نام ورزشگاه
|
||||||
|
city String? // شهر
|
||||||
|
referee String? // داور اصلی
|
||||||
|
assistant1 String? // کمک داور 1
|
||||||
|
assistant2 String? // کمک داور 2
|
||||||
|
fourthOfficial String? // داور چهارم
|
||||||
|
attendance Int? // تعداد تماشاگر
|
||||||
|
weather String? // وضعیت آب و هوا
|
||||||
|
description String? @db.Text // توضیحات بازی
|
||||||
|
roundId String?
|
||||||
|
round Round? @relation(fields: [roundId], references: [id])
|
||||||
|
playerStats PlayerMatchStat[]
|
||||||
|
events MatchEvent[]
|
||||||
|
lineups MatchLineup[]
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
}
|
||||||
|
|
||||||
|
model Round {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
number Int @unique
|
||||||
|
name String
|
||||||
|
isActive Boolean @default(false)
|
||||||
|
deadline DateTime
|
||||||
|
matches Match[]
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
}
|
||||||
|
|
||||||
|
model Gameweek {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
number Int @unique
|
||||||
|
name String
|
||||||
|
isActive Boolean @default(false)
|
||||||
|
deadline DateTime
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
}
|
||||||
|
|
||||||
|
model MatchEvent {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
matchId String
|
||||||
|
playerId String
|
||||||
|
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||||
|
player Player @relation(fields: [playerId], references: [id], onDelete: Cascade)
|
||||||
|
type EventType
|
||||||
|
minute Int?
|
||||||
|
extraInfo String?
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
}
|
||||||
|
|
||||||
|
model MatchLineup {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
matchId String
|
||||||
|
countryId String
|
||||||
|
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||||
|
formation String
|
||||||
|
playerIds String[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model PlayerMatchStat {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
playerId String
|
||||||
|
matchId String
|
||||||
|
player Player @relation(fields: [playerId], references: [id], onDelete: Cascade)
|
||||||
|
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||||
|
goals Int @default(0)
|
||||||
|
assists Int @default(0)
|
||||||
|
yellowCards Int @default(0)
|
||||||
|
redCards Int @default(0)
|
||||||
|
minutesPlayed Int @default(0)
|
||||||
|
cleanSheet Boolean @default(false)
|
||||||
|
penaltySaved Int @default(0)
|
||||||
|
penaltyMissed Int @default(0)
|
||||||
|
ownGoals Int @default(0)
|
||||||
|
isMotm Boolean @default(false)
|
||||||
|
extraTimeBonus Int @default(0)
|
||||||
|
points Int @default(0)
|
||||||
|
|
||||||
|
@@unique([playerId, matchId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model ScoringRule {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
position Position
|
||||||
|
eventType EventType
|
||||||
|
points Int
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
updatedBy String?
|
||||||
|
|
||||||
|
@@unique([position, eventType])
|
||||||
|
}
|
||||||
|
|
||||||
|
model User {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String?
|
||||||
|
email String @unique
|
||||||
|
phone String? @unique
|
||||||
|
password String
|
||||||
|
role Role @default(USER)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
team Team?
|
||||||
|
sessions Session[]
|
||||||
|
payments Payment[]
|
||||||
|
quizSubmissions QuizSubmission[]
|
||||||
|
goldenCards GoldenCard[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model LoginOtp {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
phone String
|
||||||
|
codeHash String
|
||||||
|
attempts Int @default(0)
|
||||||
|
expiresAt DateTime
|
||||||
|
consumedAt DateTime?
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
|
@@index([phone, createdAt])
|
||||||
|
}
|
||||||
|
|
||||||
|
model FantasyNews {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
icon String
|
||||||
|
title String
|
||||||
|
description String @db.Text
|
||||||
|
newsTime DateTime
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
|
@@index([newsTime])
|
||||||
|
}
|
||||||
|
|
||||||
|
enum GoldenCardStatus {
|
||||||
|
SEALED
|
||||||
|
OPENED
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SpecialCardState {
|
||||||
|
IN_INVENTORY
|
||||||
|
IN_TEAM
|
||||||
|
SOLD
|
||||||
|
}
|
||||||
|
|
||||||
|
model DailyQuiz {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
date DateTime @db.Date
|
||||||
|
windowStart DateTime
|
||||||
|
windowEnd DateTime
|
||||||
|
goldWinnersCount Int @default(1)
|
||||||
|
silverWinnersCount Int @default(0)
|
||||||
|
bronzeWinnersCount Int @default(0)
|
||||||
|
goldMinCorrect Int?
|
||||||
|
silverMinCorrect Int?
|
||||||
|
bronzeMinCorrect Int?
|
||||||
|
isProcessed Boolean @default(false)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
questions QuizQuestion[]
|
||||||
|
submissions QuizSubmission[]
|
||||||
|
awardedCards GoldenCard[]
|
||||||
|
|
||||||
|
@@unique([date])
|
||||||
|
}
|
||||||
|
|
||||||
|
model QuizQuestion {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
quizId String
|
||||||
|
quiz DailyQuiz @relation(fields: [quizId], references: [id], onDelete: Cascade)
|
||||||
|
questionText String
|
||||||
|
options String[]
|
||||||
|
correctAnswer Int // index of correct option (0-based)
|
||||||
|
order Int @default(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
model QuizSubmission {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
userId String
|
||||||
|
quizId String
|
||||||
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
quiz DailyQuiz @relation(fields: [quizId], references: [id], onDelete: Cascade)
|
||||||
|
answers Int[] // user's selected option indexes
|
||||||
|
correctAnswers Int @default(0)
|
||||||
|
score Int @default(0) // percentage 0-100
|
||||||
|
submittedAt DateTime @default(now())
|
||||||
|
|
||||||
|
@@unique([userId, quizId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model GoldenCard {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
userId String
|
||||||
|
quizId String?
|
||||||
|
playerId String
|
||||||
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
quiz DailyQuiz? @relation(fields: [quizId], references: [id], onDelete: SetNull)
|
||||||
|
player Player @relation(fields: [playerId], references: [id], onDelete: Cascade)
|
||||||
|
cardTier CardTier @default(GOLD)
|
||||||
|
status GoldenCardStatus @default(SEALED)
|
||||||
|
state SpecialCardState @default(IN_INVENTORY)
|
||||||
|
acquiredDate DateTime @default(now())
|
||||||
|
openedAt DateTime?
|
||||||
|
teamPlayer TeamPlayer?
|
||||||
|
}
|
||||||
|
|
||||||
|
model Session {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
sessionToken String @unique
|
||||||
|
userId String
|
||||||
|
expires DateTime
|
||||||
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
}
|
||||||
|
|
||||||
|
model Team {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String
|
||||||
|
userId String @unique
|
||||||
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
budget Float @default(100.0)
|
||||||
|
totalPoints Int @default(0)
|
||||||
|
formation String @default("4-3-3")
|
||||||
|
status TeamStatus @default(INACTIVE)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
players TeamPlayer[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model TeamPlayer {
|
||||||
|
teamId String
|
||||||
|
playerId String
|
||||||
|
goldenCardId String? @unique
|
||||||
|
isCaptain Boolean @default(false)
|
||||||
|
isViceCaptain Boolean @default(false)
|
||||||
|
isBench Boolean @default(false)
|
||||||
|
positionIndex Int @default(0)
|
||||||
|
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||||
|
player Player @relation(fields: [playerId], references: [id], onDelete: Cascade)
|
||||||
|
goldenCard GoldenCard? @relation(fields: [goldenCardId], references: [id], onDelete: SetNull)
|
||||||
|
|
||||||
|
@@id([teamId, playerId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model Package {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String
|
||||||
|
budgetBonus Float
|
||||||
|
price Int
|
||||||
|
description String?
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
payments Payment[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model Payment {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
userId String
|
||||||
|
packageId String
|
||||||
|
user User @relation(fields: [userId], references: [id])
|
||||||
|
package Package @relation(fields: [packageId], references: [id])
|
||||||
|
amount Int
|
||||||
|
authority String? @unique
|
||||||
|
refId String?
|
||||||
|
status PaymentStatus @default(PENDING)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
}
|
||||||
5
lib/generated/prisma/wasm-edge-light-loader.mjs
Normal file
5
lib/generated/prisma/wasm-edge-light-loader.mjs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
||||||
|
/* eslint-disable */
|
||||||
|
// biome-ignore-all lint: generated file
|
||||||
|
export default import('./query_compiler_bg.wasm?module')
|
||||||
5
lib/generated/prisma/wasm-worker-loader.mjs
Normal file
5
lib/generated/prisma/wasm-worker-loader.mjs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
||||||
|
/* eslint-disable */
|
||||||
|
// biome-ignore-all lint: generated file
|
||||||
|
export default import('./query_compiler_bg.wasm')
|
||||||
1
lib/generated/prisma/wasm.d.ts
vendored
Normal file
1
lib/generated/prisma/wasm.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from "./default"
|
||||||
538
lib/generated/prisma/wasm.js
Normal file
538
lib/generated/prisma/wasm.js
Normal file
File diff suppressed because one or more lines are too long
@@ -2,6 +2,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "prisma generate && next build",
|
"build": "prisma generate && next build",
|
||||||
|
"build:docker": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"db:push": "prisma db push",
|
"db:push": "prisma db push",
|
||||||
"db:generate": "prisma generate",
|
"db:generate": "prisma generate",
|
||||||
|
|||||||
@@ -1,28 +1,19 @@
|
|||||||
# اسکریپت کپی کردن Prisma generated files برای deployment
|
Write-Host "Generating Prisma client for deployment..." -ForegroundColor Cyan
|
||||||
|
|
||||||
Write-Host "Copying Prisma generated files..." -ForegroundColor Cyan
|
npx prisma generate
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
exit $LASTEXITCODE
|
||||||
|
}
|
||||||
|
|
||||||
# ساخت پوشه
|
if (-not (Test-Path "lib/generated/prisma/index.js")) {
|
||||||
New-Item -ItemType Directory -Force -Path "prisma/generated" | Out-Null
|
Write-Host "Error: lib/generated/prisma/index.js was not created." -ForegroundColor Red
|
||||||
|
|
||||||
# بررسی وجود فایلها
|
|
||||||
if (-not (Test-Path "node_modules/.prisma/client")) {
|
|
||||||
Write-Host "Error: Prisma client not found!" -ForegroundColor Red
|
|
||||||
Write-Host "Please run: npm install && npx prisma generate" -ForegroundColor Yellow
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# کپی کردن
|
|
||||||
Write-Host "Copying .prisma/client..." -ForegroundColor Green
|
|
||||||
Copy-Item -Recurse -Force "node_modules/.prisma/client" "prisma/generated/.prisma-client"
|
|
||||||
|
|
||||||
Write-Host "Copying @prisma/client..." -ForegroundColor Green
|
|
||||||
Copy-Item -Recurse -Force "node_modules/@prisma/client" "prisma/generated/@prisma-client"
|
|
||||||
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "✓ Files copied successfully!" -ForegroundColor Green
|
Write-Host "Prisma client generated successfully." -ForegroundColor Green
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "Now commit and push:" -ForegroundColor Cyan
|
Write-Host "Commit these files before deploying:" -ForegroundColor Cyan
|
||||||
Write-Host "git add prisma/generated"
|
Write-Host "git add lib/generated/prisma"
|
||||||
Write-Host "git commit -m 'Add pre-generated Prisma client'"
|
Write-Host "git commit -m 'Add generated Prisma client'"
|
||||||
Write-Host "git push"
|
Write-Host "git push"
|
||||||
|
|||||||
@@ -1,28 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "Copying Prisma generated files..."
|
echo "Generating Prisma client for deployment..."
|
||||||
|
|
||||||
# ساخت پوشه
|
npx prisma generate
|
||||||
mkdir -p prisma/generated
|
|
||||||
|
|
||||||
# بررسی وجود فایلها
|
if [ ! -f "lib/generated/prisma/index.js" ]; then
|
||||||
if [ ! -d "node_modules/.prisma/client" ]; then
|
echo "Error: lib/generated/prisma/index.js was not created."
|
||||||
echo "Error: Prisma client not found!"
|
|
||||||
echo "Please run: npm install && npx prisma generate"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# کپی کردن
|
|
||||||
echo "Copying .prisma/client..."
|
|
||||||
cp -r node_modules/.prisma/client prisma/generated/.prisma-client
|
|
||||||
|
|
||||||
echo "Copying @prisma/client..."
|
|
||||||
cp -r node_modules/@prisma/client prisma/generated/@prisma-client
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "✓ Files copied successfully!"
|
echo "Prisma client generated successfully."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Now commit and push:"
|
echo "Commit these files before deploying:"
|
||||||
echo "git add prisma/generated"
|
echo "git add lib/generated/prisma"
|
||||||
echo "git commit -m 'Add pre-generated Prisma client'"
|
echo "git commit -m 'Add generated Prisma client'"
|
||||||
echo "git push"
|
echo "git push"
|
||||||
|
|||||||
Reference in New Issue
Block a user