diff --git a/.env b/.env index d26da95..f279691 100644 --- a/.env +++ b/.env @@ -51,7 +51,4 @@ LOGGER=pino NEXT_PUBLIC_DEFAULT_LOCALE=et NEXT_PUBLIC_TEAM_NAVIGATION_STYLE=custom -NEXT_PUBLIC_USER_NAVIGATION_STYLE=custom - -# MEDUSA -NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY= \ No newline at end of file +NEXT_PUBLIC_USER_NAVIGATION_STYLE=custom \ No newline at end of file diff --git a/.env.development b/.env.development index c22cdb6..7599ba1 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,9 @@ # This file is used to define environment variables for the development environment. # These values are only used when running the app in development mode. -# SUPABASE -NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321 -NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0 -SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU +# SUPABASE DEVELOPMENT +NEXT_PUBLIC_SUPABASE_URL=https://oqsdacktkhmbylmzstjq.supabase.co +NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9xc2RhY2t0a2htYnlsbXpzdGpxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDY1MjgxMjMsImV4cCI6MjA2MjEwNDEyM30.LdHCTWxijFmhXdnT9KVuLRAVbtSwY7OO-oLtpd8GmO0 ## THIS IS FOR DEVELOPMENT ONLY - DO NOT USE IN PRODUCTION SUPABASE_DB_WEBHOOK_SECRET=WEBHOOKSECRET @@ -14,8 +13,6 @@ SUPABASE_DB_WEBHOOK_SECRET=WEBHOOKSECRET # CONTACT FORM CONTACT_EMAIL=test@makerkit.dev -# STRIPE -NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= # MAILER MAILER_PROVIDER=nodemailer diff --git a/.env.production b/.env.production index 417308e..593d99f 100644 --- a/.env.production +++ b/.env.production @@ -6,7 +6,7 @@ ## PUBLIC KEYS OR CONFIGURATION ARE OKAY TO BE PLACED HERE. # SUPABASE -NEXT_PUBLIC_SUPABASE_URL= +NEXT_PUBLIC_SUPABASE_URL=https://oqsdacktkhmbylmzstjq.supabase.co +NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9xc2RhY2t0a2htYnlsbXpzdGpxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDY1MjgxMjMsImV4cCI6MjA2MjEwNDEyM30.LdHCTWxijFmhXdnT9KVuLRAVbtSwY7OO-oLtpd8GmO0 + -# STRIPE -NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= diff --git a/Dockerfile b/Dockerfile index be22dd3..ff86f18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,50 @@ +# --- Stage 1: Build --- FROM node:20-alpine as builder WORKDIR /app RUN npm install -g pnpm@9 +RUN npm install -g dotenv-cli -# Copy necessary files for workspace resolution COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ COPY packages packages COPY tooling tooling +COPY .env .env +COPY .env.production .env.production -# Install all dependencies +# Load env file and echo a specific variable +# RUN dotenv -e .env -- printenv | grep 'SUPABASE' || true RUN pnpm install --frozen-lockfile COPY . . -RUN pnpm build \ No newline at end of file +ENV NODE_ENV=production + +# 🔍 Optional: Log key envs for debug +RUN echo "📄 .env.production contents:" && cat .env.production \ + && echo "🔧 Current ENV available to Next.js build:" && printenv | grep -E 'SUPABASE|STRIPE|NEXT|NODE_ENV' || true +RUN node check-env.js + +RUN pnpm build + + +# --- Stage 2: Runtime --- +FROM node:20-alpine + +WORKDIR /app + +COPY --from=builder /app ./ + +RUN npm install -g pnpm@9 \ + && pnpm install --prod --frozen-lockfile + +ENV NODE_ENV=production + +# 🔍 Optional: Log key envs for debug +RUN echo "📄 .env.production contents:" && cat .env.production \ + && echo "🔧 Current ENV available to Next.js build:" && printenv | grep -E 'SUPABASE|STRIPE|NEXT|NODE_ENV' || true + + +EXPOSE 3000 + +CMD ["pnpm", "start"] diff --git a/app/(public)/company-offer/page.tsx b/app/(public)/company-offer/page.tsx index 01f46b1..62070b7 100644 --- a/app/(public)/company-offer/page.tsx +++ b/app/(public)/company-offer/page.tsx @@ -10,7 +10,7 @@ import CompanyOfferForm from './_components/company-offer-form'; function CompanyOffer() { return (
-
+

@@ -20,7 +20,7 @@ function CompanyOffer() {

-
+
); } diff --git a/packages/features/auth/src/components/update-account-form.tsx b/app/auth/update-account/_components/update-account-form.tsx similarity index 97% rename from packages/features/auth/src/components/update-account-form.tsx rename to app/auth/update-account/_components/update-account-form.tsx index 403ef6d..5caf2e0 100644 --- a/packages/features/auth/src/components/update-account-form.tsx +++ b/app/auth/update-account/_components/update-account-form.tsx @@ -21,8 +21,8 @@ import { import { Input } from '@kit/ui/input'; import { Trans } from '@kit/ui/trans'; -import { UpdateAccountSchema } from '../schemas/update-account.schema'; -import { onUpdateAccount } from '../server/actions/update-account-actions'; +import { UpdateAccountSchema } from '../_lib/schemas/update-account.schema'; +import { onUpdateAccount } from '../_lib/server/update-account'; export function UpdateAccountForm({ user }: { user: User }) { const form = useForm({ diff --git a/packages/features/auth/src/schemas/update-account.schema.ts b/app/auth/update-account/_lib/schemas/update-account.schema.ts similarity index 100% rename from packages/features/auth/src/schemas/update-account.schema.ts rename to app/auth/update-account/_lib/schemas/update-account.schema.ts diff --git a/packages/features/auth/src/server/actions/update-account-actions.ts b/app/auth/update-account/_lib/server/update-account.ts similarity index 92% rename from packages/features/auth/src/server/actions/update-account-actions.ts rename to app/auth/update-account/_lib/server/update-account.ts index abb847f..9a14f36 100644 --- a/packages/features/auth/src/server/actions/update-account-actions.ts +++ b/app/auth/update-account/_lib/server/update-account.ts @@ -2,14 +2,14 @@ import { redirect } from 'next/navigation'; +import { createAuthApi } from '@kit/auth/api'; import { enhanceAction } from '@kit/next/actions'; import { getSupabaseServerClient } from '@kit/supabase/server-client'; import pathsConfig from '~/config/paths.config'; import { updateCustomer } from '@lib/data/customer'; -import { UpdateAccountSchema } from '../../schemas/update-account.schema'; -import { createAuthApi } from '../api'; +import { UpdateAccountSchema } from '../schemas/update-account.schema'; export interface AccountSubmitData { firstName: string; diff --git a/app/auth/update-account/page.tsx b/app/auth/update-account/page.tsx index 8d0231c..c594570 100644 --- a/app/auth/update-account/page.tsx +++ b/app/auth/update-account/page.tsx @@ -4,13 +4,14 @@ import { BackButton } from '@/components/back-button'; import { MedReportLogo } from '@/components/med-report-logo'; import pathsConfig from '@/config/paths.config'; import { signOutAction } from '@/lib/actions/sign-out'; -import { UpdateAccountForm } from '@/packages/features/auth/src/components/update-account-form'; import { getSupabaseServerClient } from '@/packages/supabase/src/clients/server-client'; import { Trans } from '@kit/ui/trans'; import { withI18n } from '~/lib/i18n/with-i18n'; +import { UpdateAccountForm } from './_components/update-account-form'; + async function UpdateAccount() { const client = getSupabaseServerClient(); @@ -24,7 +25,7 @@ async function UpdateAccount() { return (
-
+

@@ -35,7 +36,7 @@ async function UpdateAccount() {

-
+
); } diff --git a/app/home/(user)/(dashboard)/analysis-results/_components/analysis-level-bar.tsx b/app/home/(user)/(dashboard)/analysis-results/_components/analysis-level-bar.tsx new file mode 100644 index 0000000..9b23701 --- /dev/null +++ b/app/home/(user)/(dashboard)/analysis-results/_components/analysis-level-bar.tsx @@ -0,0 +1,89 @@ +import React from 'react'; + +import { ArrowDown } from 'lucide-react'; + +import { cn } from '@kit/ui/utils'; + +export enum AnalysisResultLevel { + VERY_LOW = 0, + LOW = 1, + NORMAL = 2, + HIGH = 3, + VERY_HIGH = 4, +} + +const Level = ({ + isActive = false, + color, + isFirst = false, + isLast = false, +}: { + isActive?: boolean; + color: 'destructive' | 'success' | 'warning'; + isFirst?: boolean; + isLast?: boolean; +}) => { + return ( +
+ {isActive && ( +
+ +
+ )} +
+ ); +}; + +const AnalysisLevelBar = ({ + normLowerIncluded = true, + normUpperIncluded = true, + level, +}: { + normLowerIncluded?: boolean; + normUpperIncluded?: boolean; + level: AnalysisResultLevel; +}) => { + return ( +
+ {normLowerIncluded && ( + <> + + + + )} + + + + {normUpperIncluded && ( + <> + + + + )} +
+ ); +}; + +export default AnalysisLevelBar; diff --git a/app/home/(user)/(dashboard)/analysis-results/_components/analysis.tsx b/app/home/(user)/(dashboard)/analysis-results/_components/analysis.tsx new file mode 100644 index 0000000..5c67a32 --- /dev/null +++ b/app/home/(user)/(dashboard)/analysis-results/_components/analysis.tsx @@ -0,0 +1,98 @@ +'use client'; + +import React, { useState } from 'react'; + +import { Info } from 'lucide-react'; + +import { cn } from '@kit/ui/utils'; + +import AnalysisLevelBar, { AnalysisResultLevel } from './analysis-level-bar'; + +export enum AnalysisStatus { + NORMAL = 0, + MEDIUM = 1, + HIGH = 2, +} + +const Analysis = ({ + analysis: { + name, + status, + unit, + value, + normLowerIncluded, + normUpperIncluded, + normLower, + normUpper, + }, +}: { + analysis: { + name: string; + status: AnalysisStatus; + unit: string; + value: number; + normLowerIncluded: boolean; + normUpperIncluded: boolean; + normLower: number; + normUpper: number; + }; +}) => { + const [showTooltip, setShowTooltip] = useState(false); + const isUnderNorm = value < normLower; + const getAnalysisResultLevel = () => { + if (isUnderNorm) { + switch (status) { + case AnalysisStatus.MEDIUM: + return AnalysisResultLevel.LOW; + default: + return AnalysisResultLevel.VERY_LOW; + } + } + switch (status) { + case AnalysisStatus.MEDIUM: + return AnalysisResultLevel.HIGH; + case AnalysisStatus.HIGH: + return AnalysisResultLevel.VERY_HIGH; + default: + return AnalysisResultLevel.NORMAL; + } + }; + + return ( +
+
+ {name} +
setShowTooltip(!showTooltip)} + onMouseLeave={() => setShowTooltip(false)} + > + {' '} + +
+
+
+
{value}
+
{unit}
+
+
+ {normLower} - {normUpper} +
Normaalne vahemik
+
+ +
+ ); +}; + +export default Analysis; diff --git a/app/home/(user)/(dashboard)/analysis-results/page.tsx b/app/home/(user)/(dashboard)/analysis-results/page.tsx new file mode 100644 index 0000000..23a79f8 --- /dev/null +++ b/app/home/(user)/(dashboard)/analysis-results/page.tsx @@ -0,0 +1,59 @@ +import { createI18nServerInstance } from '@/lib/i18n/i18n.server'; +import { withI18n } from '@/lib/i18n/with-i18n'; + +import { Trans } from '@kit/ui/makerkit/trans'; +import { PageBody } from '@kit/ui/page'; +import { Button } from '@kit/ui/shadcn/button'; + +import { loadUserAnalysis } from '../../_lib/server/load-user-analysis'; +import Analysis, { AnalysisStatus } from './_components/analysis'; + +export const generateMetadata = async () => { + const i18n = await createI18nServerInstance(); + const title = i18n.t('account:analysisResults.pageTitle'); + + return { + title, + }; +}; + +async function AnalysisResultsPage() { + const analysisList = await loadUserAnalysis(); + + return ( + +
+
+

+ +

+

+ +

+
+ +
+
+ {analysisList?.map((analysis, index) => ( + + ))} +
+
+ ); +} + +export default withI18n(AnalysisResultsPage); diff --git a/app/home/(user)/_components/dashboard.tsx b/app/home/(user)/_components/dashboard.tsx index 3351444..0498cdb 100644 --- a/app/home/(user)/_components/dashboard.tsx +++ b/app/home/(user)/_components/dashboard.tsx @@ -1,6 +1,7 @@ 'use client'; import Link from 'next/link'; + import { InfoTooltip } from '@/components/ui/info-tooltip'; import { BlendingModeIcon, RulerHorizontalIcon } from '@radix-ui/react-icons'; import { @@ -130,7 +131,7 @@ const dummyRecommendations = [ export default function Dashboard() { return ( <> -
+
{dummyCards.map( ({ title, @@ -190,7 +191,7 @@ export default function Dashboard() { ) => { return (
-
+
>; + +/** + * @name loadUserAccount + * @description + * Load the user account. It's a cached per-request function that fetches the user workspace data. + * It can be used across the server components to load the user workspace data. + */ +export const loadUserAnalysis = cache(analysisLoader); + +async function analysisLoader(): Promise { + const client = getSupabaseServerClient(); + const api = createAccountsApi(client); + + return api.getUserAnalysis(); +} diff --git a/app/select-package/page.tsx b/app/select-package/page.tsx index a446b97..3ebc34b 100644 --- a/app/select-package/page.tsx +++ b/app/select-package/page.tsx @@ -1,14 +1,14 @@ import Link from 'next/link'; +import SelectAnalysisPackages from '@/components/select-analysis-packages'; import { CaretRightIcon } from '@radix-ui/react-icons'; import { Scale } from 'lucide-react'; -import { Trans } from '@kit/ui/trans'; import { Button } from '@kit/ui/button'; +import { Trans } from '@kit/ui/trans'; import { createI18nServerInstance } from '~/lib/i18n/i18n.server'; import { withI18n } from '~/lib/i18n/with-i18n'; -import SelectAnalysisPackages from '@/components/select-analysis-packages'; import { MedReportLogo } from '../../components/med-report-logo'; import pathsConfig from '../../config/paths.config'; @@ -44,12 +44,14 @@ async function SelectPackagePage() { />
- - - +
+ + + +
); } diff --git a/check-env.js b/check-env.js new file mode 100644 index 0000000..140854c --- /dev/null +++ b/check-env.js @@ -0,0 +1 @@ +console.log('ENV =', process.env.MEDUSA_BACKEND_URL); diff --git a/components/package-header.tsx b/components/package-header.tsx index 274d148..6a02286 100644 --- a/components/package-header.tsx +++ b/components/package-header.tsx @@ -17,8 +17,8 @@ export const PackageHeader = ({ }) => { return (
-

{title}

-

+

{title}

+

{formatCurrency({ currencyCode: 'eur', locale: language, diff --git a/components/select-analysis-packages.tsx b/components/select-analysis-packages.tsx index 2f1cfff..921c696 100644 --- a/components/select-analysis-packages.tsx +++ b/components/select-analysis-packages.tsx @@ -11,7 +11,7 @@ export default function SelectAnalysisPackages({ analysisPackages, countryCode } )) : (

- +

)}

diff --git a/config/paths.config.ts b/config/paths.config.ts index 5bc2960..0a9ff76 100644 --- a/config/paths.config.ts +++ b/config/paths.config.ts @@ -61,7 +61,7 @@ const pathsConfig = PathsSchema.parse({ orderAnalysisPackage: '/home/order-analysis-package', // these routes are added as placeholders and can be changed when the pages are added myOrders: '/my-orders', - analysisResults: '/analysis-results', + analysisResults: '/home/analysis-results', orderAnalysis: '/order-analysis', orderHealthAnalysis: '/order-health-analysis', }, diff --git a/lib/services/medipost.service.ts b/lib/services/medipost.service.ts index 7952634..775f870 100644 --- a/lib/services/medipost.service.ts +++ b/lib/services/medipost.service.ts @@ -617,6 +617,7 @@ export async function syncPrivateMessage( response_value: response.VastuseVaartus, unit: element.Mootyhik ?? null, original_response_element: element, + analysis_name: element.UuringNimi || element.KNimetus, })), ); } diff --git a/next.config.mjs b/next.config.mjs index 73c7188..5d942af 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,7 @@ import withBundleAnalyzer from '@next/bundle-analyzer'; +import transpileModules from 'next-transpile-modules'; + +const withTM = transpileModules(['lucide-react']); const IS_PRODUCTION = process.env.NODE_ENV === 'production'; const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL; @@ -24,7 +27,7 @@ const INTERNAL_PACKAGES = [ ]; /** @type {import('next').NextConfig} */ -const config = { +const config = withTM({ reactStrictMode: true, /** Enables hot reloading for local packages without a build step */ transpilePackages: INTERNAL_PACKAGES, @@ -67,7 +70,7 @@ const config = { /** We already do linting and typechecking as separate tasks in CI */ eslint: { ignoreDuringBuilds: true }, typescript: { ignoreBuildErrors: true }, -}; +}); export default withBundleAnalyzer({ enabled: process.env.ANALYZE === 'true', diff --git a/package.json b/package.json index 0f29eed..a042b25 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "supabase:test": "supabase db test", "supabase:db:reset": "supabase db reset", "supabase:db:lint": "supabase db lint", - "supabase:db:diff": "supabase db diff", + "supabase:db:diff": "supabase db diff --schema auth --schema audit --schema medreport", "supabase:deploy": "supabase link --project-ref $SUPABASE_PROJECT_REF && supabase db push", "supabase:typegen": "supabase gen types typescript --local > ./packages/supabase/src/database.types.ts", "supabase:db:dump:local": "supabase db dump --local --data-only", @@ -101,9 +101,9 @@ "babel-plugin-react-compiler": "19.1.0-rc.2", "cssnano": "^7.0.7", "dotenv": "^16.5.0", + "next-transpile-modules": "^10.0.1", "pino-pretty": "^13.0.0", "prettier": "^3.5.3", - "react-hook-form": "^7.57.0", "supabase": "^2.30.4", "tailwindcss": "4.1.7", "tailwindcss-animate": "^1.0.7", diff --git a/packages/billing/gateway/package.json b/packages/billing/gateway/package.json index 57d05cc..1288bcd 100644 --- a/packages/billing/gateway/package.json +++ b/packages/billing/gateway/package.json @@ -32,8 +32,7 @@ "date-fns": "^4.1.0", "lucide-react": "^0.510.0", "next": "15.3.2", - "react": "19.1.0", - "react-hook-form": "^7.56.3" + "react": "19.1.0" }, "typesVersions": { "*": { diff --git a/packages/features/accounts/package.json b/packages/features/accounts/package.json index 148e428..8377355 100644 --- a/packages/features/accounts/package.json +++ b/packages/features/accounts/package.json @@ -14,7 +14,8 @@ "./personal-account-settings": "./src/components/personal-account-settings/index.ts", "./components": "./src/components/index.ts", "./hooks/*": "./src/hooks/*.ts", - "./api": "./src/server/api.ts" + "./api": "./src/server/api.ts", + "./types/*": "./src/types/*.ts" }, "dependencies": { "nanoid": "^5.1.5" @@ -43,7 +44,6 @@ "next-themes": "0.4.6", "react": "19.1.0", "react-dom": "19.1.0", - "react-hook-form": "^7.56.3", "sonner": "^2.0.3" }, "prettier": "@kit/prettier-config", diff --git a/packages/features/accounts/src/server/api.ts b/packages/features/accounts/src/server/api.ts index 7cb680c..62c25d9 100644 --- a/packages/features/accounts/src/server/api.ts +++ b/packages/features/accounts/src/server/api.ts @@ -2,6 +2,8 @@ import { SupabaseClient } from '@supabase/supabase-js'; import { Database } from '@kit/supabase/database'; +import { UserAnalysis } from '../types/accounts'; + /** * Class representing an API for interacting with user accounts. * @constructor @@ -169,6 +171,51 @@ class AccountsApi { return response.data?.customer_id; } + + async getUserAnalysis(): Promise { + const authUser = await this.client.auth.getUser(); + const { data, error: userError } = authUser; + + if (userError) { + console.error('Failed to get user', userError); + throw userError; + } + + const { user } = data; + + const { data: analysisResponses } = await this.client + .schema('medreport') + .from('analysis_responses') + .select('*') + .eq('user_id', user.id); + + if (!analysisResponses) { + return null; + } + + const analysisResponseIds = analysisResponses.map((r) => r.id); + + const { data: analysisResponseElements } = await this.client + .schema('medreport') + .from('analysis_response_elements') + .select('*') + .in('analysis_response_id', analysisResponseIds); + + if (!analysisResponseElements) { + return null; + } + + const elementMap = new Map( + analysisResponseElements.map((e) => [e.analysis_response_id, e]), + ); + + return analysisResponses + .filter((r) => elementMap.has(r.id)) + .map((r) => ({ + ...r, + element: elementMap.get(r.id)!, + })); + } } export function createAccountsApi(client: SupabaseClient) { diff --git a/packages/features/accounts/src/types/accounts.ts b/packages/features/accounts/src/types/accounts.ts new file mode 100644 index 0000000..459b53d --- /dev/null +++ b/packages/features/accounts/src/types/accounts.ts @@ -0,0 +1,6 @@ +import { Database } from '@kit/supabase/database'; + +export type UserAnalysis = + (Database['medreport']['Tables']['analysis_responses']['Row'] & { + element: Database['medreport']['Tables']['analysis_response_elements']['Row']; + })[]; diff --git a/packages/features/admin/package.json b/packages/features/admin/package.json index f47481a..df33e44 100644 --- a/packages/features/admin/package.json +++ b/packages/features/admin/package.json @@ -27,8 +27,7 @@ "lucide-react": "^0.510.0", "next": "15.3.2", "react": "19.1.0", - "react-dom": "19.1.0", - "react-hook-form": "^7.56.3" + "react-dom": "19.1.0" }, "exports": { ".": "./src/index.ts", diff --git a/packages/features/auth/package.json b/packages/features/auth/package.json index 2ca0885..148aeb4 100644 --- a/packages/features/auth/package.json +++ b/packages/features/auth/package.json @@ -17,7 +17,8 @@ "./captcha/client": "./src/captcha/client/index.ts", "./captcha/server": "./src/captcha/server/index.ts", "./resend-email-link": "./src/components/resend-auth-link-form.tsx", - "./lib/utils/*": "./src/lib/utils/*.ts" + "./lib/utils/*": "./src/lib/utils/*.ts", + "./api": "./src/server/api.ts" }, "devDependencies": { "@hookform/resolvers": "^5.0.1", @@ -34,7 +35,6 @@ "@types/react": "19.1.4", "lucide-react": "^0.510.0", "next": "15.3.2", - "react-hook-form": "^7.56.3", "sonner": "^2.0.3" }, "prettier": "@kit/prettier-config", diff --git a/packages/features/medusa-storefront/src/lib/config.ts b/packages/features/medusa-storefront/src/lib/config.ts index 47c46b1..f48be4b 100644 --- a/packages/features/medusa-storefront/src/lib/config.ts +++ b/packages/features/medusa-storefront/src/lib/config.ts @@ -1,14 +1,16 @@ -import Medusa from "@medusajs/js-sdk" +import Medusa from "@medusajs/js-sdk"; // Defaults to standard port for Medusa server -let MEDUSA_BACKEND_URL = "http://localhost:9000" +let MEDUSA_BACKEND_URL = "http://localhost:9000"; if (process.env.MEDUSA_BACKEND_URL) { - MEDUSA_BACKEND_URL = process.env.MEDUSA_BACKEND_URL + MEDUSA_BACKEND_URL = process.env.MEDUSA_BACKEND_URL; } -export const sdk = new Medusa({ +export const SDK_CONFIG = { baseUrl: MEDUSA_BACKEND_URL, debug: process.env.NODE_ENV === "development", publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, -}) +}; + +export const sdk = new Medusa(SDK_CONFIG); diff --git a/packages/features/medusa-storefront/src/lib/data/collections.ts b/packages/features/medusa-storefront/src/lib/data/collections.ts index cb403ee..ce3b4d6 100644 --- a/packages/features/medusa-storefront/src/lib/data/collections.ts +++ b/packages/features/medusa-storefront/src/lib/data/collections.ts @@ -1,13 +1,13 @@ -"use server" +"use server"; -import { sdk } from "@lib/config" -import { HttpTypes } from "@medusajs/types" -import { getCacheOptions } from "./cookies" +import { sdk, SDK_CONFIG } from "@lib/config"; +import { HttpTypes } from "@medusajs/types"; +import { getCacheOptions } from "./cookies"; export const retrieveCollection = async (id: string) => { const next = { ...(await getCacheOptions("collections")), - } + }; return sdk.client .fetch<{ collection: HttpTypes.StoreCollection }>( @@ -17,19 +17,19 @@ export const retrieveCollection = async (id: string) => { cache: "force-cache", } ) - .then(({ collection }) => collection) -} + .then(({ collection }) => collection); +}; export const listCollections = async ( queryParams: Record = {} ): Promise<{ collections: HttpTypes.StoreCollection[]; count: number }> => { const next = { ...(await getCacheOptions("collections")), - } - - queryParams.limit = queryParams.limit || "100" - queryParams.offset = queryParams.offset || "0" + }; + queryParams.limit = queryParams.limit || "100"; + queryParams.offset = queryParams.offset || "0"; + console.log("SDK_CONFIG: ", SDK_CONFIG.baseUrl); return sdk.client .fetch<{ collections: HttpTypes.StoreCollection[]; count: number }>( "/store/collections", @@ -39,15 +39,15 @@ export const listCollections = async ( cache: "force-cache", } ) - .then(({ collections }) => ({ collections, count: collections.length })) -} + .then(({ collections }) => ({ collections, count: collections.length })); +}; export const getCollectionByHandle = async ( handle: string ): Promise => { const next = { ...(await getCacheOptions("collections")), - } + }; return sdk.client .fetch(`/store/collections`, { @@ -55,5 +55,5 @@ export const getCollectionByHandle = async ( next, cache: "force-cache", }) - .then(({ collections }) => collections[0]) -} + .then(({ collections }) => collections[0]); +}; diff --git a/packages/features/notifications/src/components/success-notification.tsx b/packages/features/notifications/src/components/success-notification.tsx index 17788b2..2702708 100644 --- a/packages/features/notifications/src/components/success-notification.tsx +++ b/packages/features/notifications/src/components/success-notification.tsx @@ -38,7 +38,9 @@ export const SuccessNotification = ({ width={326} height={195} /> -

{title || }

+

+ {title || } +

diff --git a/packages/features/team-accounts/package.json b/packages/features/team-accounts/package.json index 81c0c6d..7a789c9 100644 --- a/packages/features/team-accounts/package.json +++ b/packages/features/team-accounts/package.json @@ -44,7 +44,6 @@ "next": "15.3.2", "react": "19.1.0", "react-dom": "19.1.0", - "react-hook-form": "^7.56.3", "sonner": "^2.0.3" }, "prettier": "@kit/prettier-config", diff --git a/packages/otp/package.json b/packages/otp/package.json index b983fc0..f880271 100644 --- a/packages/otp/package.json +++ b/packages/otp/package.json @@ -29,8 +29,7 @@ "@types/react": "19.1.4", "@types/react-dom": "19.1.5", "react": "19.1.0", - "react-dom": "19.1.0", - "react-hook-form": "^7.56.3" + "react-dom": "19.1.0" }, "typesVersions": { "*": { diff --git a/packages/supabase/src/database.types.ts b/packages/supabase/src/database.types.ts index 17ac293..9a735ee 100644 --- a/packages/supabase/src/database.types.ts +++ b/packages/supabase/src/database.types.ts @@ -481,6 +481,7 @@ export type Database = { analysis_response_elements: { Row: { analysis_element_original_id: string + analysis_name: string | null analysis_response_id: number created_at: string id: number @@ -491,12 +492,13 @@ export type Database = { norm_upper_included: boolean | null original_response_element: Json response_time: string - response_value: Json + response_value: number unit: string | null updated_at: string | null } Insert: { analysis_element_original_id: string + analysis_name?: string | null analysis_response_id: number created_at?: string id?: number @@ -507,12 +509,13 @@ export type Database = { norm_upper_included?: boolean | null original_response_element: Json response_time: string - response_value: Json + response_value: number unit?: string | null updated_at?: string | null } Update: { analysis_element_original_id?: string + analysis_name?: string | null analysis_response_id?: number created_at?: string id?: number @@ -523,7 +526,7 @@ export type Database = { norm_upper_included?: boolean | null original_response_element?: Json response_time?: string - response_value?: Json + response_value?: number unit?: string | null updated_at?: string | null } @@ -1779,7 +1782,5681 @@ export type Database = { } public: { Tables: { - [_ in never]: never + account_holder: { + Row: { + created_at: string + data: Json + deleted_at: string | null + email: string | null + external_id: string + id: string + metadata: Json | null + provider_id: string + updated_at: string + } + Insert: { + created_at?: string + data?: Json + deleted_at?: string | null + email?: string | null + external_id: string + id: string + metadata?: Json | null + provider_id: string + updated_at?: string + } + Update: { + created_at?: string + data?: Json + deleted_at?: string | null + email?: string | null + external_id?: string + id?: string + metadata?: Json | null + provider_id?: string + updated_at?: string + } + Relationships: [] + } + api_key: { + Row: { + created_at: string + created_by: string + deleted_at: string | null + id: string + last_used_at: string | null + redacted: string + revoked_at: string | null + revoked_by: string | null + salt: string + title: string + token: string + type: string + updated_at: string + } + Insert: { + created_at?: string + created_by: string + deleted_at?: string | null + id: string + last_used_at?: string | null + redacted: string + revoked_at?: string | null + revoked_by?: string | null + salt: string + title: string + token: string + type: string + updated_at?: string + } + Update: { + created_at?: string + created_by?: string + deleted_at?: string | null + id?: string + last_used_at?: string | null + redacted?: string + revoked_at?: string | null + revoked_by?: string | null + salt?: string + title?: string + token?: string + type?: string + updated_at?: string + } + Relationships: [] + } + application_method_buy_rules: { + Row: { + application_method_id: string + promotion_rule_id: string + } + Insert: { + application_method_id: string + promotion_rule_id: string + } + Update: { + application_method_id?: string + promotion_rule_id?: string + } + Relationships: [ + { + foreignKeyName: "application_method_buy_rules_application_method_id_foreign" + columns: ["application_method_id"] + isOneToOne: false + referencedRelation: "promotion_application_method" + referencedColumns: ["id"] + }, + { + foreignKeyName: "application_method_buy_rules_promotion_rule_id_foreign" + columns: ["promotion_rule_id"] + isOneToOne: false + referencedRelation: "promotion_rule" + referencedColumns: ["id"] + }, + ] + } + application_method_target_rules: { + Row: { + application_method_id: string + promotion_rule_id: string + } + Insert: { + application_method_id: string + promotion_rule_id: string + } + Update: { + application_method_id?: string + promotion_rule_id?: string + } + Relationships: [ + { + foreignKeyName: "application_method_target_rules_application_method_id_foreign" + columns: ["application_method_id"] + isOneToOne: false + referencedRelation: "promotion_application_method" + referencedColumns: ["id"] + }, + { + foreignKeyName: "application_method_target_rules_promotion_rule_id_foreign" + columns: ["promotion_rule_id"] + isOneToOne: false + referencedRelation: "promotion_rule" + referencedColumns: ["id"] + }, + ] + } + auth_identity: { + Row: { + app_metadata: Json | null + created_at: string + deleted_at: string | null + id: string + updated_at: string + } + Insert: { + app_metadata?: Json | null + created_at?: string + deleted_at?: string | null + id: string + updated_at?: string + } + Update: { + app_metadata?: Json | null + created_at?: string + deleted_at?: string | null + id?: string + updated_at?: string + } + Relationships: [] + } + capture: { + Row: { + amount: number + created_at: string + created_by: string | null + deleted_at: string | null + id: string + metadata: Json | null + payment_id: string + raw_amount: Json + updated_at: string + } + Insert: { + amount: number + created_at?: string + created_by?: string | null + deleted_at?: string | null + id: string + metadata?: Json | null + payment_id: string + raw_amount: Json + updated_at?: string + } + Update: { + amount?: number + created_at?: string + created_by?: string | null + deleted_at?: string | null + id?: string + metadata?: Json | null + payment_id?: string + raw_amount?: Json + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "capture_payment_id_foreign" + columns: ["payment_id"] + isOneToOne: false + referencedRelation: "payment" + referencedColumns: ["id"] + }, + ] + } + cart: { + Row: { + billing_address_id: string | null + completed_at: string | null + created_at: string + currency_code: string + customer_id: string | null + deleted_at: string | null + email: string | null + id: string + metadata: Json | null + region_id: string | null + sales_channel_id: string | null + shipping_address_id: string | null + updated_at: string + } + Insert: { + billing_address_id?: string | null + completed_at?: string | null + created_at?: string + currency_code: string + customer_id?: string | null + deleted_at?: string | null + email?: string | null + id: string + metadata?: Json | null + region_id?: string | null + sales_channel_id?: string | null + shipping_address_id?: string | null + updated_at?: string + } + Update: { + billing_address_id?: string | null + completed_at?: string | null + created_at?: string + currency_code?: string + customer_id?: string | null + deleted_at?: string | null + email?: string | null + id?: string + metadata?: Json | null + region_id?: string | null + sales_channel_id?: string | null + shipping_address_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "cart_billing_address_id_foreign" + columns: ["billing_address_id"] + isOneToOne: false + referencedRelation: "cart_address" + referencedColumns: ["id"] + }, + { + foreignKeyName: "cart_shipping_address_id_foreign" + columns: ["shipping_address_id"] + isOneToOne: false + referencedRelation: "cart_address" + referencedColumns: ["id"] + }, + ] + } + cart_address: { + Row: { + address_1: string | null + address_2: string | null + city: string | null + company: string | null + country_code: string | null + created_at: string + customer_id: string | null + deleted_at: string | null + first_name: string | null + id: string + last_name: string | null + metadata: Json | null + phone: string | null + postal_code: string | null + province: string | null + updated_at: string + } + Insert: { + address_1?: string | null + address_2?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + customer_id?: string | null + deleted_at?: string | null + first_name?: string | null + id: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Update: { + address_1?: string | null + address_2?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + customer_id?: string | null + deleted_at?: string | null + first_name?: string | null + id?: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Relationships: [] + } + cart_line_item: { + Row: { + cart_id: string + compare_at_unit_price: number | null + created_at: string + deleted_at: string | null + id: string + is_custom_price: boolean + is_discountable: boolean + is_giftcard: boolean + is_tax_inclusive: boolean + metadata: Json | null + product_collection: string | null + product_description: string | null + product_handle: string | null + product_id: string | null + product_subtitle: string | null + product_title: string | null + product_type: string | null + product_type_id: string | null + quantity: number + raw_compare_at_unit_price: Json | null + raw_unit_price: Json + requires_shipping: boolean + subtitle: string | null + thumbnail: string | null + title: string + unit_price: number + updated_at: string + variant_barcode: string | null + variant_id: string | null + variant_option_values: Json | null + variant_sku: string | null + variant_title: string | null + } + Insert: { + cart_id: string + compare_at_unit_price?: number | null + created_at?: string + deleted_at?: string | null + id: string + is_custom_price?: boolean + is_discountable?: boolean + is_giftcard?: boolean + is_tax_inclusive?: boolean + metadata?: Json | null + product_collection?: string | null + product_description?: string | null + product_handle?: string | null + product_id?: string | null + product_subtitle?: string | null + product_title?: string | null + product_type?: string | null + product_type_id?: string | null + quantity: number + raw_compare_at_unit_price?: Json | null + raw_unit_price: Json + requires_shipping?: boolean + subtitle?: string | null + thumbnail?: string | null + title: string + unit_price: number + updated_at?: string + variant_barcode?: string | null + variant_id?: string | null + variant_option_values?: Json | null + variant_sku?: string | null + variant_title?: string | null + } + Update: { + cart_id?: string + compare_at_unit_price?: number | null + created_at?: string + deleted_at?: string | null + id?: string + is_custom_price?: boolean + is_discountable?: boolean + is_giftcard?: boolean + is_tax_inclusive?: boolean + metadata?: Json | null + product_collection?: string | null + product_description?: string | null + product_handle?: string | null + product_id?: string | null + product_subtitle?: string | null + product_title?: string | null + product_type?: string | null + product_type_id?: string | null + quantity?: number + raw_compare_at_unit_price?: Json | null + raw_unit_price?: Json + requires_shipping?: boolean + subtitle?: string | null + thumbnail?: string | null + title?: string + unit_price?: number + updated_at?: string + variant_barcode?: string | null + variant_id?: string | null + variant_option_values?: Json | null + variant_sku?: string | null + variant_title?: string | null + } + Relationships: [ + { + foreignKeyName: "cart_line_item_cart_id_foreign" + columns: ["cart_id"] + isOneToOne: false + referencedRelation: "cart" + referencedColumns: ["id"] + }, + ] + } + cart_line_item_adjustment: { + Row: { + amount: number + code: string | null + created_at: string + deleted_at: string | null + description: string | null + id: string + is_tax_inclusive: boolean + item_id: string | null + metadata: Json | null + promotion_id: string | null + provider_id: string | null + raw_amount: Json + updated_at: string + } + Insert: { + amount: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + is_tax_inclusive?: boolean + item_id?: string | null + metadata?: Json | null + promotion_id?: string | null + provider_id?: string | null + raw_amount: Json + updated_at?: string + } + Update: { + amount?: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + is_tax_inclusive?: boolean + item_id?: string | null + metadata?: Json | null + promotion_id?: string | null + provider_id?: string | null + raw_amount?: Json + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "cart_line_item_adjustment_item_id_foreign" + columns: ["item_id"] + isOneToOne: false + referencedRelation: "cart_line_item" + referencedColumns: ["id"] + }, + ] + } + cart_line_item_tax_line: { + Row: { + code: string + created_at: string + deleted_at: string | null + description: string | null + id: string + item_id: string | null + metadata: Json | null + provider_id: string | null + rate: number + tax_rate_id: string | null + updated_at: string + } + Insert: { + code: string + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + item_id?: string | null + metadata?: Json | null + provider_id?: string | null + rate: number + tax_rate_id?: string | null + updated_at?: string + } + Update: { + code?: string + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + item_id?: string | null + metadata?: Json | null + provider_id?: string | null + rate?: number + tax_rate_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "cart_line_item_tax_line_item_id_foreign" + columns: ["item_id"] + isOneToOne: false + referencedRelation: "cart_line_item" + referencedColumns: ["id"] + }, + ] + } + cart_payment_collection: { + Row: { + cart_id: string + created_at: string + deleted_at: string | null + id: string + payment_collection_id: string + updated_at: string + } + Insert: { + cart_id: string + created_at?: string + deleted_at?: string | null + id: string + payment_collection_id: string + updated_at?: string + } + Update: { + cart_id?: string + created_at?: string + deleted_at?: string | null + id?: string + payment_collection_id?: string + updated_at?: string + } + Relationships: [] + } + cart_promotion: { + Row: { + cart_id: string + created_at: string + deleted_at: string | null + id: string + promotion_id: string + updated_at: string + } + Insert: { + cart_id: string + created_at?: string + deleted_at?: string | null + id: string + promotion_id: string + updated_at?: string + } + Update: { + cart_id?: string + created_at?: string + deleted_at?: string | null + id?: string + promotion_id?: string + updated_at?: string + } + Relationships: [] + } + cart_shipping_method: { + Row: { + amount: number + cart_id: string + created_at: string + data: Json | null + deleted_at: string | null + description: Json | null + id: string + is_tax_inclusive: boolean + metadata: Json | null + name: string + raw_amount: Json + shipping_option_id: string | null + updated_at: string + } + Insert: { + amount: number + cart_id: string + created_at?: string + data?: Json | null + deleted_at?: string | null + description?: Json | null + id: string + is_tax_inclusive?: boolean + metadata?: Json | null + name: string + raw_amount: Json + shipping_option_id?: string | null + updated_at?: string + } + Update: { + amount?: number + cart_id?: string + created_at?: string + data?: Json | null + deleted_at?: string | null + description?: Json | null + id?: string + is_tax_inclusive?: boolean + metadata?: Json | null + name?: string + raw_amount?: Json + shipping_option_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "cart_shipping_method_cart_id_foreign" + columns: ["cart_id"] + isOneToOne: false + referencedRelation: "cart" + referencedColumns: ["id"] + }, + ] + } + cart_shipping_method_adjustment: { + Row: { + amount: number + code: string | null + created_at: string + deleted_at: string | null + description: string | null + id: string + metadata: Json | null + promotion_id: string | null + provider_id: string | null + raw_amount: Json + shipping_method_id: string | null + updated_at: string + } + Insert: { + amount: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + metadata?: Json | null + promotion_id?: string | null + provider_id?: string | null + raw_amount: Json + shipping_method_id?: string | null + updated_at?: string + } + Update: { + amount?: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + metadata?: Json | null + promotion_id?: string | null + provider_id?: string | null + raw_amount?: Json + shipping_method_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "cart_shipping_method_adjustment_shipping_method_id_foreign" + columns: ["shipping_method_id"] + isOneToOne: false + referencedRelation: "cart_shipping_method" + referencedColumns: ["id"] + }, + ] + } + cart_shipping_method_tax_line: { + Row: { + code: string + created_at: string + deleted_at: string | null + description: string | null + id: string + metadata: Json | null + provider_id: string | null + rate: number + shipping_method_id: string | null + tax_rate_id: string | null + updated_at: string + } + Insert: { + code: string + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + metadata?: Json | null + provider_id?: string | null + rate: number + shipping_method_id?: string | null + tax_rate_id?: string | null + updated_at?: string + } + Update: { + code?: string + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + metadata?: Json | null + provider_id?: string | null + rate?: number + shipping_method_id?: string | null + tax_rate_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "cart_shipping_method_tax_line_shipping_method_id_foreign" + columns: ["shipping_method_id"] + isOneToOne: false + referencedRelation: "cart_shipping_method" + referencedColumns: ["id"] + }, + ] + } + credit_line: { + Row: { + amount: number + cart_id: string + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + raw_amount: Json + reference: string | null + reference_id: string | null + updated_at: string + } + Insert: { + amount: number + cart_id: string + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + raw_amount: Json + reference?: string | null + reference_id?: string | null + updated_at?: string + } + Update: { + amount?: number + cart_id?: string + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + raw_amount?: Json + reference?: string | null + reference_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "credit_line_cart_id_foreign" + columns: ["cart_id"] + isOneToOne: false + referencedRelation: "cart" + referencedColumns: ["id"] + }, + ] + } + currency: { + Row: { + code: string + created_at: string + decimal_digits: number + deleted_at: string | null + name: string + raw_rounding: Json + rounding: number + symbol: string + symbol_native: string + updated_at: string + } + Insert: { + code: string + created_at?: string + decimal_digits?: number + deleted_at?: string | null + name: string + raw_rounding: Json + rounding?: number + symbol: string + symbol_native: string + updated_at?: string + } + Update: { + code?: string + created_at?: string + decimal_digits?: number + deleted_at?: string | null + name?: string + raw_rounding?: Json + rounding?: number + symbol?: string + symbol_native?: string + updated_at?: string + } + Relationships: [] + } + customer: { + Row: { + company_name: string | null + created_at: string + created_by: string | null + deleted_at: string | null + email: string | null + first_name: string | null + has_account: boolean + id: string + last_name: string | null + metadata: Json | null + phone: string | null + updated_at: string + } + Insert: { + company_name?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + email?: string | null + first_name?: string | null + has_account?: boolean + id: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + updated_at?: string + } + Update: { + company_name?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + email?: string | null + first_name?: string | null + has_account?: boolean + id?: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + updated_at?: string + } + Relationships: [] + } + customer_account_holder: { + Row: { + account_holder_id: string + created_at: string + customer_id: string + deleted_at: string | null + id: string + updated_at: string + } + Insert: { + account_holder_id: string + created_at?: string + customer_id: string + deleted_at?: string | null + id: string + updated_at?: string + } + Update: { + account_holder_id?: string + created_at?: string + customer_id?: string + deleted_at?: string | null + id?: string + updated_at?: string + } + Relationships: [] + } + customer_address: { + Row: { + address_1: string | null + address_2: string | null + address_name: string | null + city: string | null + company: string | null + country_code: string | null + created_at: string + customer_id: string + deleted_at: string | null + first_name: string | null + id: string + is_default_billing: boolean + is_default_shipping: boolean + last_name: string | null + metadata: Json | null + phone: string | null + postal_code: string | null + province: string | null + updated_at: string + } + Insert: { + address_1?: string | null + address_2?: string | null + address_name?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + customer_id: string + deleted_at?: string | null + first_name?: string | null + id: string + is_default_billing?: boolean + is_default_shipping?: boolean + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Update: { + address_1?: string | null + address_2?: string | null + address_name?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + customer_id?: string + deleted_at?: string | null + first_name?: string | null + id?: string + is_default_billing?: boolean + is_default_shipping?: boolean + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "customer_address_customer_id_foreign" + columns: ["customer_id"] + isOneToOne: false + referencedRelation: "customer" + referencedColumns: ["id"] + }, + ] + } + customer_group: { + Row: { + created_at: string + created_by: string | null + deleted_at: string | null + id: string + metadata: Json | null + name: string + updated_at: string + } + Insert: { + created_at?: string + created_by?: string | null + deleted_at?: string | null + id: string + metadata?: Json | null + name: string + updated_at?: string + } + Update: { + created_at?: string + created_by?: string | null + deleted_at?: string | null + id?: string + metadata?: Json | null + name?: string + updated_at?: string + } + Relationships: [] + } + customer_group_customer: { + Row: { + created_at: string + created_by: string | null + customer_group_id: string + customer_id: string + deleted_at: string | null + id: string + metadata: Json | null + updated_at: string + } + Insert: { + created_at?: string + created_by?: string | null + customer_group_id: string + customer_id: string + deleted_at?: string | null + id: string + metadata?: Json | null + updated_at?: string + } + Update: { + created_at?: string + created_by?: string | null + customer_group_id?: string + customer_id?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "customer_group_customer_customer_group_id_foreign" + columns: ["customer_group_id"] + isOneToOne: false + referencedRelation: "customer_group" + referencedColumns: ["id"] + }, + { + foreignKeyName: "customer_group_customer_customer_id_foreign" + columns: ["customer_id"] + isOneToOne: false + referencedRelation: "customer" + referencedColumns: ["id"] + }, + ] + } + fulfillment: { + Row: { + canceled_at: string | null + created_at: string + created_by: string | null + data: Json | null + deleted_at: string | null + delivered_at: string | null + delivery_address_id: string | null + id: string + location_id: string + marked_shipped_by: string | null + metadata: Json | null + packed_at: string | null + provider_id: string | null + requires_shipping: boolean + shipped_at: string | null + shipping_option_id: string | null + updated_at: string + } + Insert: { + canceled_at?: string | null + created_at?: string + created_by?: string | null + data?: Json | null + deleted_at?: string | null + delivered_at?: string | null + delivery_address_id?: string | null + id: string + location_id: string + marked_shipped_by?: string | null + metadata?: Json | null + packed_at?: string | null + provider_id?: string | null + requires_shipping?: boolean + shipped_at?: string | null + shipping_option_id?: string | null + updated_at?: string + } + Update: { + canceled_at?: string | null + created_at?: string + created_by?: string | null + data?: Json | null + deleted_at?: string | null + delivered_at?: string | null + delivery_address_id?: string | null + id?: string + location_id?: string + marked_shipped_by?: string | null + metadata?: Json | null + packed_at?: string | null + provider_id?: string | null + requires_shipping?: boolean + shipped_at?: string | null + shipping_option_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "fulfillment_delivery_address_id_foreign" + columns: ["delivery_address_id"] + isOneToOne: false + referencedRelation: "fulfillment_address" + referencedColumns: ["id"] + }, + { + foreignKeyName: "fulfillment_provider_id_foreign" + columns: ["provider_id"] + isOneToOne: false + referencedRelation: "fulfillment_provider" + referencedColumns: ["id"] + }, + { + foreignKeyName: "fulfillment_shipping_option_id_foreign" + columns: ["shipping_option_id"] + isOneToOne: false + referencedRelation: "shipping_option" + referencedColumns: ["id"] + }, + ] + } + fulfillment_address: { + Row: { + address_1: string | null + address_2: string | null + city: string | null + company: string | null + country_code: string | null + created_at: string + deleted_at: string | null + first_name: string | null + id: string + last_name: string | null + metadata: Json | null + phone: string | null + postal_code: string | null + province: string | null + updated_at: string + } + Insert: { + address_1?: string | null + address_2?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + deleted_at?: string | null + first_name?: string | null + id: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Update: { + address_1?: string | null + address_2?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + deleted_at?: string | null + first_name?: string | null + id?: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Relationships: [] + } + fulfillment_item: { + Row: { + barcode: string + created_at: string + deleted_at: string | null + fulfillment_id: string + id: string + inventory_item_id: string | null + line_item_id: string | null + quantity: number + raw_quantity: Json + sku: string + title: string + updated_at: string + } + Insert: { + barcode: string + created_at?: string + deleted_at?: string | null + fulfillment_id: string + id: string + inventory_item_id?: string | null + line_item_id?: string | null + quantity: number + raw_quantity: Json + sku: string + title: string + updated_at?: string + } + Update: { + barcode?: string + created_at?: string + deleted_at?: string | null + fulfillment_id?: string + id?: string + inventory_item_id?: string | null + line_item_id?: string | null + quantity?: number + raw_quantity?: Json + sku?: string + title?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "fulfillment_item_fulfillment_id_foreign" + columns: ["fulfillment_id"] + isOneToOne: false + referencedRelation: "fulfillment" + referencedColumns: ["id"] + }, + ] + } + fulfillment_label: { + Row: { + created_at: string + deleted_at: string | null + fulfillment_id: string + id: string + label_url: string + tracking_number: string + tracking_url: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + fulfillment_id: string + id: string + label_url: string + tracking_number: string + tracking_url: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + fulfillment_id?: string + id?: string + label_url?: string + tracking_number?: string + tracking_url?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "fulfillment_label_fulfillment_id_foreign" + columns: ["fulfillment_id"] + isOneToOne: false + referencedRelation: "fulfillment" + referencedColumns: ["id"] + }, + ] + } + fulfillment_provider: { + Row: { + created_at: string + deleted_at: string | null + id: string + is_enabled: boolean + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + is_enabled?: boolean + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + is_enabled?: boolean + updated_at?: string + } + Relationships: [] + } + fulfillment_set: { + Row: { + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + name: string + type: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + name: string + type: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + name?: string + type?: string + updated_at?: string + } + Relationships: [] + } + geo_zone: { + Row: { + city: string | null + country_code: string + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + postal_expression: Json | null + province_code: string | null + service_zone_id: string + type: string + updated_at: string + } + Insert: { + city?: string | null + country_code: string + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + postal_expression?: Json | null + province_code?: string | null + service_zone_id: string + type?: string + updated_at?: string + } + Update: { + city?: string | null + country_code?: string + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + postal_expression?: Json | null + province_code?: string | null + service_zone_id?: string + type?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "geo_zone_service_zone_id_foreign" + columns: ["service_zone_id"] + isOneToOne: false + referencedRelation: "service_zone" + referencedColumns: ["id"] + }, + ] + } + image: { + Row: { + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + product_id: string + rank: number + updated_at: string + url: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + product_id: string + rank?: number + updated_at?: string + url: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + product_id?: string + rank?: number + updated_at?: string + url?: string + } + Relationships: [ + { + foreignKeyName: "image_product_id_foreign" + columns: ["product_id"] + isOneToOne: false + referencedRelation: "product" + referencedColumns: ["id"] + }, + ] + } + inventory_item: { + Row: { + created_at: string + deleted_at: string | null + description: string | null + height: number | null + hs_code: string | null + id: string + length: number | null + material: string | null + metadata: Json | null + mid_code: string | null + origin_country: string | null + requires_shipping: boolean + sku: string | null + thumbnail: string | null + title: string | null + updated_at: string + weight: number | null + width: number | null + } + Insert: { + created_at?: string + deleted_at?: string | null + description?: string | null + height?: number | null + hs_code?: string | null + id: string + length?: number | null + material?: string | null + metadata?: Json | null + mid_code?: string | null + origin_country?: string | null + requires_shipping?: boolean + sku?: string | null + thumbnail?: string | null + title?: string | null + updated_at?: string + weight?: number | null + width?: number | null + } + Update: { + created_at?: string + deleted_at?: string | null + description?: string | null + height?: number | null + hs_code?: string | null + id?: string + length?: number | null + material?: string | null + metadata?: Json | null + mid_code?: string | null + origin_country?: string | null + requires_shipping?: boolean + sku?: string | null + thumbnail?: string | null + title?: string | null + updated_at?: string + weight?: number | null + width?: number | null + } + Relationships: [] + } + inventory_level: { + Row: { + created_at: string + deleted_at: string | null + id: string + incoming_quantity: number + inventory_item_id: string + location_id: string + metadata: Json | null + raw_incoming_quantity: Json | null + raw_reserved_quantity: Json | null + raw_stocked_quantity: Json | null + reserved_quantity: number + stocked_quantity: number + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + incoming_quantity?: number + inventory_item_id: string + location_id: string + metadata?: Json | null + raw_incoming_quantity?: Json | null + raw_reserved_quantity?: Json | null + raw_stocked_quantity?: Json | null + reserved_quantity?: number + stocked_quantity?: number + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + incoming_quantity?: number + inventory_item_id?: string + location_id?: string + metadata?: Json | null + raw_incoming_quantity?: Json | null + raw_reserved_quantity?: Json | null + raw_stocked_quantity?: Json | null + reserved_quantity?: number + stocked_quantity?: number + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "inventory_level_inventory_item_id_foreign" + columns: ["inventory_item_id"] + isOneToOne: false + referencedRelation: "inventory_item" + referencedColumns: ["id"] + }, + ] + } + invite: { + Row: { + accepted: boolean + created_at: string + deleted_at: string | null + email: string + expires_at: string + id: string + metadata: Json | null + token: string + updated_at: string + } + Insert: { + accepted?: boolean + created_at?: string + deleted_at?: string | null + email: string + expires_at: string + id: string + metadata?: Json | null + token: string + updated_at?: string + } + Update: { + accepted?: boolean + created_at?: string + deleted_at?: string | null + email?: string + expires_at?: string + id?: string + metadata?: Json | null + token?: string + updated_at?: string + } + Relationships: [] + } + link_module_migrations: { + Row: { + created_at: string | null + id: number + link_descriptor: Json + table_name: string + } + Insert: { + created_at?: string | null + id?: number + link_descriptor?: Json + table_name: string + } + Update: { + created_at?: string | null + id?: number + link_descriptor?: Json + table_name?: string + } + Relationships: [] + } + location_fulfillment_provider: { + Row: { + created_at: string + deleted_at: string | null + fulfillment_provider_id: string + id: string + stock_location_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + fulfillment_provider_id: string + id: string + stock_location_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + fulfillment_provider_id?: string + id?: string + stock_location_id?: string + updated_at?: string + } + Relationships: [] + } + location_fulfillment_set: { + Row: { + created_at: string + deleted_at: string | null + fulfillment_set_id: string + id: string + stock_location_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + fulfillment_set_id: string + id: string + stock_location_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + fulfillment_set_id?: string + id?: string + stock_location_id?: string + updated_at?: string + } + Relationships: [] + } + mikro_orm_migrations: { + Row: { + executed_at: string | null + id: number + name: string | null + } + Insert: { + executed_at?: string | null + id?: number + name?: string | null + } + Update: { + executed_at?: string | null + id?: number + name?: string | null + } + Relationships: [] + } + notification: { + Row: { + channel: string + created_at: string + data: Json | null + deleted_at: string | null + external_id: string | null + id: string + idempotency_key: string | null + original_notification_id: string | null + provider_id: string | null + receiver_id: string | null + resource_id: string | null + resource_type: string | null + status: string + template: string + to: string + trigger_type: string | null + updated_at: string + } + Insert: { + channel: string + created_at?: string + data?: Json | null + deleted_at?: string | null + external_id?: string | null + id: string + idempotency_key?: string | null + original_notification_id?: string | null + provider_id?: string | null + receiver_id?: string | null + resource_id?: string | null + resource_type?: string | null + status?: string + template: string + to: string + trigger_type?: string | null + updated_at?: string + } + Update: { + channel?: string + created_at?: string + data?: Json | null + deleted_at?: string | null + external_id?: string | null + id?: string + idempotency_key?: string | null + original_notification_id?: string | null + provider_id?: string | null + receiver_id?: string | null + resource_id?: string | null + resource_type?: string | null + status?: string + template?: string + to?: string + trigger_type?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "notification_provider_id_foreign" + columns: ["provider_id"] + isOneToOne: false + referencedRelation: "notification_provider" + referencedColumns: ["id"] + }, + ] + } + notification_provider: { + Row: { + channels: string[] + created_at: string + deleted_at: string | null + handle: string + id: string + is_enabled: boolean + name: string + updated_at: string + } + Insert: { + channels?: string[] + created_at?: string + deleted_at?: string | null + handle: string + id: string + is_enabled?: boolean + name: string + updated_at?: string + } + Update: { + channels?: string[] + created_at?: string + deleted_at?: string | null + handle?: string + id?: string + is_enabled?: boolean + name?: string + updated_at?: string + } + Relationships: [] + } + order: { + Row: { + billing_address_id: string | null + canceled_at: string | null + created_at: string + currency_code: string + customer_id: string | null + deleted_at: string | null + display_id: number | null + email: string | null + id: string + is_draft_order: boolean + metadata: Json | null + no_notification: boolean | null + region_id: string | null + sales_channel_id: string | null + shipping_address_id: string | null + status: Database["public"]["Enums"]["order_status_enum"] + updated_at: string + version: number + } + Insert: { + billing_address_id?: string | null + canceled_at?: string | null + created_at?: string + currency_code: string + customer_id?: string | null + deleted_at?: string | null + display_id?: number | null + email?: string | null + id: string + is_draft_order?: boolean + metadata?: Json | null + no_notification?: boolean | null + region_id?: string | null + sales_channel_id?: string | null + shipping_address_id?: string | null + status?: Database["public"]["Enums"]["order_status_enum"] + updated_at?: string + version?: number + } + Update: { + billing_address_id?: string | null + canceled_at?: string | null + created_at?: string + currency_code?: string + customer_id?: string | null + deleted_at?: string | null + display_id?: number | null + email?: string | null + id?: string + is_draft_order?: boolean + metadata?: Json | null + no_notification?: boolean | null + region_id?: string | null + sales_channel_id?: string | null + shipping_address_id?: string | null + status?: Database["public"]["Enums"]["order_status_enum"] + updated_at?: string + version?: number + } + Relationships: [ + { + foreignKeyName: "order_billing_address_id_foreign" + columns: ["billing_address_id"] + isOneToOne: false + referencedRelation: "order_address" + referencedColumns: ["id"] + }, + { + foreignKeyName: "order_shipping_address_id_foreign" + columns: ["shipping_address_id"] + isOneToOne: false + referencedRelation: "order_address" + referencedColumns: ["id"] + }, + ] + } + order_address: { + Row: { + address_1: string | null + address_2: string | null + city: string | null + company: string | null + country_code: string | null + created_at: string + customer_id: string | null + deleted_at: string | null + first_name: string | null + id: string + last_name: string | null + metadata: Json | null + phone: string | null + postal_code: string | null + province: string | null + updated_at: string + } + Insert: { + address_1?: string | null + address_2?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + customer_id?: string | null + deleted_at?: string | null + first_name?: string | null + id: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Update: { + address_1?: string | null + address_2?: string | null + city?: string | null + company?: string | null + country_code?: string | null + created_at?: string + customer_id?: string | null + deleted_at?: string | null + first_name?: string | null + id?: string + last_name?: string | null + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Relationships: [] + } + order_cart: { + Row: { + cart_id: string + created_at: string + deleted_at: string | null + id: string + order_id: string + updated_at: string + } + Insert: { + cart_id: string + created_at?: string + deleted_at?: string | null + id: string + order_id: string + updated_at?: string + } + Update: { + cart_id?: string + created_at?: string + deleted_at?: string | null + id?: string + order_id?: string + updated_at?: string + } + Relationships: [] + } + order_change: { + Row: { + canceled_at: string | null + canceled_by: string | null + change_type: string | null + claim_id: string | null + confirmed_at: string | null + confirmed_by: string | null + created_at: string + created_by: string | null + declined_at: string | null + declined_by: string | null + declined_reason: string | null + deleted_at: string | null + description: string | null + exchange_id: string | null + id: string + internal_note: string | null + metadata: Json | null + order_id: string + requested_at: string | null + requested_by: string | null + return_id: string | null + status: string + updated_at: string + version: number + } + Insert: { + canceled_at?: string | null + canceled_by?: string | null + change_type?: string | null + claim_id?: string | null + confirmed_at?: string | null + confirmed_by?: string | null + created_at?: string + created_by?: string | null + declined_at?: string | null + declined_by?: string | null + declined_reason?: string | null + deleted_at?: string | null + description?: string | null + exchange_id?: string | null + id: string + internal_note?: string | null + metadata?: Json | null + order_id: string + requested_at?: string | null + requested_by?: string | null + return_id?: string | null + status?: string + updated_at?: string + version: number + } + Update: { + canceled_at?: string | null + canceled_by?: string | null + change_type?: string | null + claim_id?: string | null + confirmed_at?: string | null + confirmed_by?: string | null + created_at?: string + created_by?: string | null + declined_at?: string | null + declined_by?: string | null + declined_reason?: string | null + deleted_at?: string | null + description?: string | null + exchange_id?: string | null + id?: string + internal_note?: string | null + metadata?: Json | null + order_id?: string + requested_at?: string | null + requested_by?: string | null + return_id?: string | null + status?: string + updated_at?: string + version?: number + } + Relationships: [ + { + foreignKeyName: "order_change_order_id_foreign" + columns: ["order_id"] + isOneToOne: false + referencedRelation: "order" + referencedColumns: ["id"] + }, + ] + } + order_change_action: { + Row: { + action: string + amount: number | null + applied: boolean + claim_id: string | null + created_at: string + deleted_at: string | null + details: Json | null + exchange_id: string | null + id: string + internal_note: string | null + order_change_id: string | null + order_id: string | null + ordering: number + raw_amount: Json | null + reference: string | null + reference_id: string | null + return_id: string | null + updated_at: string + version: number | null + } + Insert: { + action: string + amount?: number | null + applied?: boolean + claim_id?: string | null + created_at?: string + deleted_at?: string | null + details?: Json | null + exchange_id?: string | null + id: string + internal_note?: string | null + order_change_id?: string | null + order_id?: string | null + ordering?: number + raw_amount?: Json | null + reference?: string | null + reference_id?: string | null + return_id?: string | null + updated_at?: string + version?: number | null + } + Update: { + action?: string + amount?: number | null + applied?: boolean + claim_id?: string | null + created_at?: string + deleted_at?: string | null + details?: Json | null + exchange_id?: string | null + id?: string + internal_note?: string | null + order_change_id?: string | null + order_id?: string | null + ordering?: number + raw_amount?: Json | null + reference?: string | null + reference_id?: string | null + return_id?: string | null + updated_at?: string + version?: number | null + } + Relationships: [ + { + foreignKeyName: "order_change_action_order_change_id_foreign" + columns: ["order_change_id"] + isOneToOne: false + referencedRelation: "order_change" + referencedColumns: ["id"] + }, + ] + } + order_claim: { + Row: { + canceled_at: string | null + created_at: string + created_by: string | null + deleted_at: string | null + display_id: number + id: string + metadata: Json | null + no_notification: boolean | null + order_id: string + order_version: number + raw_refund_amount: Json | null + refund_amount: number | null + return_id: string | null + type: Database["public"]["Enums"]["order_claim_type_enum"] + updated_at: string + } + Insert: { + canceled_at?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + display_id?: number + id: string + metadata?: Json | null + no_notification?: boolean | null + order_id: string + order_version: number + raw_refund_amount?: Json | null + refund_amount?: number | null + return_id?: string | null + type: Database["public"]["Enums"]["order_claim_type_enum"] + updated_at?: string + } + Update: { + canceled_at?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + display_id?: number + id?: string + metadata?: Json | null + no_notification?: boolean | null + order_id?: string + order_version?: number + raw_refund_amount?: Json | null + refund_amount?: number | null + return_id?: string | null + type?: Database["public"]["Enums"]["order_claim_type_enum"] + updated_at?: string + } + Relationships: [] + } + order_claim_item: { + Row: { + claim_id: string + created_at: string + deleted_at: string | null + id: string + is_additional_item: boolean + item_id: string + metadata: Json | null + note: string | null + quantity: number + raw_quantity: Json + reason: Database["public"]["Enums"]["claim_reason_enum"] | null + updated_at: string + } + Insert: { + claim_id: string + created_at?: string + deleted_at?: string | null + id: string + is_additional_item?: boolean + item_id: string + metadata?: Json | null + note?: string | null + quantity: number + raw_quantity: Json + reason?: Database["public"]["Enums"]["claim_reason_enum"] | null + updated_at?: string + } + Update: { + claim_id?: string + created_at?: string + deleted_at?: string | null + id?: string + is_additional_item?: boolean + item_id?: string + metadata?: Json | null + note?: string | null + quantity?: number + raw_quantity?: Json + reason?: Database["public"]["Enums"]["claim_reason_enum"] | null + updated_at?: string + } + Relationships: [] + } + order_claim_item_image: { + Row: { + claim_item_id: string + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + updated_at: string + url: string + } + Insert: { + claim_item_id: string + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + updated_at?: string + url: string + } + Update: { + claim_item_id?: string + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + updated_at?: string + url?: string + } + Relationships: [] + } + order_credit_line: { + Row: { + amount: number + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + order_id: string + raw_amount: Json + reference: string | null + reference_id: string | null + updated_at: string + } + Insert: { + amount: number + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + order_id: string + raw_amount: Json + reference?: string | null + reference_id?: string | null + updated_at?: string + } + Update: { + amount?: number + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + order_id?: string + raw_amount?: Json + reference?: string | null + reference_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "order_credit_line_order_id_foreign" + columns: ["order_id"] + isOneToOne: false + referencedRelation: "order" + referencedColumns: ["id"] + }, + ] + } + order_exchange: { + Row: { + allow_backorder: boolean + canceled_at: string | null + created_at: string + created_by: string | null + deleted_at: string | null + difference_due: number | null + display_id: number + id: string + metadata: Json | null + no_notification: boolean | null + order_id: string + order_version: number + raw_difference_due: Json | null + return_id: string | null + updated_at: string + } + Insert: { + allow_backorder?: boolean + canceled_at?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + difference_due?: number | null + display_id?: number + id: string + metadata?: Json | null + no_notification?: boolean | null + order_id: string + order_version: number + raw_difference_due?: Json | null + return_id?: string | null + updated_at?: string + } + Update: { + allow_backorder?: boolean + canceled_at?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + difference_due?: number | null + display_id?: number + id?: string + metadata?: Json | null + no_notification?: boolean | null + order_id?: string + order_version?: number + raw_difference_due?: Json | null + return_id?: string | null + updated_at?: string + } + Relationships: [] + } + order_exchange_item: { + Row: { + created_at: string + deleted_at: string | null + exchange_id: string + id: string + item_id: string + metadata: Json | null + note: string | null + quantity: number + raw_quantity: Json + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + exchange_id: string + id: string + item_id: string + metadata?: Json | null + note?: string | null + quantity: number + raw_quantity: Json + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + exchange_id?: string + id?: string + item_id?: string + metadata?: Json | null + note?: string | null + quantity?: number + raw_quantity?: Json + updated_at?: string + } + Relationships: [] + } + order_fulfillment: { + Row: { + created_at: string + deleted_at: string | null + fulfillment_id: string + id: string + order_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + fulfillment_id: string + id: string + order_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + fulfillment_id?: string + id?: string + order_id?: string + updated_at?: string + } + Relationships: [] + } + order_item: { + Row: { + compare_at_unit_price: number | null + created_at: string + deleted_at: string | null + delivered_quantity: number + fulfilled_quantity: number + id: string + item_id: string + metadata: Json | null + order_id: string + quantity: number + raw_compare_at_unit_price: Json | null + raw_delivered_quantity: Json + raw_fulfilled_quantity: Json + raw_quantity: Json + raw_return_dismissed_quantity: Json + raw_return_received_quantity: Json + raw_return_requested_quantity: Json + raw_shipped_quantity: Json + raw_unit_price: Json | null + raw_written_off_quantity: Json + return_dismissed_quantity: number + return_received_quantity: number + return_requested_quantity: number + shipped_quantity: number + unit_price: number | null + updated_at: string + version: number + written_off_quantity: number + } + Insert: { + compare_at_unit_price?: number | null + created_at?: string + deleted_at?: string | null + delivered_quantity?: number + fulfilled_quantity: number + id: string + item_id: string + metadata?: Json | null + order_id: string + quantity: number + raw_compare_at_unit_price?: Json | null + raw_delivered_quantity: Json + raw_fulfilled_quantity: Json + raw_quantity: Json + raw_return_dismissed_quantity: Json + raw_return_received_quantity: Json + raw_return_requested_quantity: Json + raw_shipped_quantity: Json + raw_unit_price?: Json | null + raw_written_off_quantity: Json + return_dismissed_quantity: number + return_received_quantity: number + return_requested_quantity: number + shipped_quantity: number + unit_price?: number | null + updated_at?: string + version: number + written_off_quantity: number + } + Update: { + compare_at_unit_price?: number | null + created_at?: string + deleted_at?: string | null + delivered_quantity?: number + fulfilled_quantity?: number + id?: string + item_id?: string + metadata?: Json | null + order_id?: string + quantity?: number + raw_compare_at_unit_price?: Json | null + raw_delivered_quantity?: Json + raw_fulfilled_quantity?: Json + raw_quantity?: Json + raw_return_dismissed_quantity?: Json + raw_return_received_quantity?: Json + raw_return_requested_quantity?: Json + raw_shipped_quantity?: Json + raw_unit_price?: Json | null + raw_written_off_quantity?: Json + return_dismissed_quantity?: number + return_received_quantity?: number + return_requested_quantity?: number + shipped_quantity?: number + unit_price?: number | null + updated_at?: string + version?: number + written_off_quantity?: number + } + Relationships: [ + { + foreignKeyName: "order_item_item_id_foreign" + columns: ["item_id"] + isOneToOne: false + referencedRelation: "order_line_item" + referencedColumns: ["id"] + }, + { + foreignKeyName: "order_item_order_id_foreign" + columns: ["order_id"] + isOneToOne: false + referencedRelation: "order" + referencedColumns: ["id"] + }, + ] + } + order_line_item: { + Row: { + compare_at_unit_price: number | null + created_at: string + deleted_at: string | null + id: string + is_custom_price: boolean + is_discountable: boolean + is_giftcard: boolean + is_tax_inclusive: boolean + metadata: Json | null + product_collection: string | null + product_description: string | null + product_handle: string | null + product_id: string | null + product_subtitle: string | null + product_title: string | null + product_type: string | null + product_type_id: string | null + raw_compare_at_unit_price: Json | null + raw_unit_price: Json + requires_shipping: boolean + subtitle: string | null + thumbnail: string | null + title: string + totals_id: string | null + unit_price: number + updated_at: string + variant_barcode: string | null + variant_id: string | null + variant_option_values: Json | null + variant_sku: string | null + variant_title: string | null + } + Insert: { + compare_at_unit_price?: number | null + created_at?: string + deleted_at?: string | null + id: string + is_custom_price?: boolean + is_discountable?: boolean + is_giftcard?: boolean + is_tax_inclusive?: boolean + metadata?: Json | null + product_collection?: string | null + product_description?: string | null + product_handle?: string | null + product_id?: string | null + product_subtitle?: string | null + product_title?: string | null + product_type?: string | null + product_type_id?: string | null + raw_compare_at_unit_price?: Json | null + raw_unit_price: Json + requires_shipping?: boolean + subtitle?: string | null + thumbnail?: string | null + title: string + totals_id?: string | null + unit_price: number + updated_at?: string + variant_barcode?: string | null + variant_id?: string | null + variant_option_values?: Json | null + variant_sku?: string | null + variant_title?: string | null + } + Update: { + compare_at_unit_price?: number | null + created_at?: string + deleted_at?: string | null + id?: string + is_custom_price?: boolean + is_discountable?: boolean + is_giftcard?: boolean + is_tax_inclusive?: boolean + metadata?: Json | null + product_collection?: string | null + product_description?: string | null + product_handle?: string | null + product_id?: string | null + product_subtitle?: string | null + product_title?: string | null + product_type?: string | null + product_type_id?: string | null + raw_compare_at_unit_price?: Json | null + raw_unit_price?: Json + requires_shipping?: boolean + subtitle?: string | null + thumbnail?: string | null + title?: string + totals_id?: string | null + unit_price?: number + updated_at?: string + variant_barcode?: string | null + variant_id?: string | null + variant_option_values?: Json | null + variant_sku?: string | null + variant_title?: string | null + } + Relationships: [ + { + foreignKeyName: "order_line_item_totals_id_foreign" + columns: ["totals_id"] + isOneToOne: false + referencedRelation: "order_item" + referencedColumns: ["id"] + }, + ] + } + order_line_item_adjustment: { + Row: { + amount: number + code: string | null + created_at: string + deleted_at: string | null + description: string | null + id: string + item_id: string + promotion_id: string | null + provider_id: string | null + raw_amount: Json + updated_at: string + } + Insert: { + amount: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + item_id: string + promotion_id?: string | null + provider_id?: string | null + raw_amount: Json + updated_at?: string + } + Update: { + amount?: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + item_id?: string + promotion_id?: string | null + provider_id?: string | null + raw_amount?: Json + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "order_line_item_adjustment_item_id_foreign" + columns: ["item_id"] + isOneToOne: false + referencedRelation: "order_line_item" + referencedColumns: ["id"] + }, + ] + } + order_line_item_tax_line: { + Row: { + code: string + created_at: string + deleted_at: string | null + description: string | null + id: string + item_id: string + provider_id: string | null + rate: number + raw_rate: Json + tax_rate_id: string | null + updated_at: string + } + Insert: { + code: string + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + item_id: string + provider_id?: string | null + rate: number + raw_rate: Json + tax_rate_id?: string | null + updated_at?: string + } + Update: { + code?: string + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + item_id?: string + provider_id?: string | null + rate?: number + raw_rate?: Json + tax_rate_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "order_line_item_tax_line_item_id_foreign" + columns: ["item_id"] + isOneToOne: false + referencedRelation: "order_line_item" + referencedColumns: ["id"] + }, + ] + } + order_payment_collection: { + Row: { + created_at: string + deleted_at: string | null + id: string + order_id: string + payment_collection_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + order_id: string + payment_collection_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + order_id?: string + payment_collection_id?: string + updated_at?: string + } + Relationships: [] + } + order_promotion: { + Row: { + created_at: string + deleted_at: string | null + id: string + order_id: string + promotion_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + order_id: string + promotion_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + order_id?: string + promotion_id?: string + updated_at?: string + } + Relationships: [] + } + order_shipping: { + Row: { + claim_id: string | null + created_at: string + deleted_at: string | null + exchange_id: string | null + id: string + order_id: string + return_id: string | null + shipping_method_id: string + updated_at: string + version: number + } + Insert: { + claim_id?: string | null + created_at?: string + deleted_at?: string | null + exchange_id?: string | null + id: string + order_id: string + return_id?: string | null + shipping_method_id: string + updated_at?: string + version: number + } + Update: { + claim_id?: string | null + created_at?: string + deleted_at?: string | null + exchange_id?: string | null + id?: string + order_id?: string + return_id?: string | null + shipping_method_id?: string + updated_at?: string + version?: number + } + Relationships: [ + { + foreignKeyName: "order_shipping_order_id_foreign" + columns: ["order_id"] + isOneToOne: false + referencedRelation: "order" + referencedColumns: ["id"] + }, + ] + } + order_shipping_method: { + Row: { + amount: number + created_at: string + data: Json | null + deleted_at: string | null + description: Json | null + id: string + is_custom_amount: boolean + is_tax_inclusive: boolean + metadata: Json | null + name: string + raw_amount: Json + shipping_option_id: string | null + updated_at: string + } + Insert: { + amount: number + created_at?: string + data?: Json | null + deleted_at?: string | null + description?: Json | null + id: string + is_custom_amount?: boolean + is_tax_inclusive?: boolean + metadata?: Json | null + name: string + raw_amount: Json + shipping_option_id?: string | null + updated_at?: string + } + Update: { + amount?: number + created_at?: string + data?: Json | null + deleted_at?: string | null + description?: Json | null + id?: string + is_custom_amount?: boolean + is_tax_inclusive?: boolean + metadata?: Json | null + name?: string + raw_amount?: Json + shipping_option_id?: string | null + updated_at?: string + } + Relationships: [] + } + order_shipping_method_adjustment: { + Row: { + amount: number + code: string | null + created_at: string + deleted_at: string | null + description: string | null + id: string + promotion_id: string | null + provider_id: string | null + raw_amount: Json + shipping_method_id: string + updated_at: string + } + Insert: { + amount: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + promotion_id?: string | null + provider_id?: string | null + raw_amount: Json + shipping_method_id: string + updated_at?: string + } + Update: { + amount?: number + code?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + promotion_id?: string | null + provider_id?: string | null + raw_amount?: Json + shipping_method_id?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "order_shipping_method_adjustment_shipping_method_id_foreign" + columns: ["shipping_method_id"] + isOneToOne: false + referencedRelation: "order_shipping_method" + referencedColumns: ["id"] + }, + ] + } + order_shipping_method_tax_line: { + Row: { + code: string + created_at: string + deleted_at: string | null + description: string | null + id: string + provider_id: string | null + rate: number + raw_rate: Json + shipping_method_id: string + tax_rate_id: string | null + updated_at: string + } + Insert: { + code: string + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + provider_id?: string | null + rate: number + raw_rate: Json + shipping_method_id: string + tax_rate_id?: string | null + updated_at?: string + } + Update: { + code?: string + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + provider_id?: string | null + rate?: number + raw_rate?: Json + shipping_method_id?: string + tax_rate_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "order_shipping_method_tax_line_shipping_method_id_foreign" + columns: ["shipping_method_id"] + isOneToOne: false + referencedRelation: "order_shipping_method" + referencedColumns: ["id"] + }, + ] + } + order_summary: { + Row: { + created_at: string + deleted_at: string | null + id: string + order_id: string + totals: Json | null + updated_at: string + version: number + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + order_id: string + totals?: Json | null + updated_at?: string + version?: number + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + order_id?: string + totals?: Json | null + updated_at?: string + version?: number + } + Relationships: [ + { + foreignKeyName: "order_summary_order_id_foreign" + columns: ["order_id"] + isOneToOne: false + referencedRelation: "order" + referencedColumns: ["id"] + }, + ] + } + order_transaction: { + Row: { + amount: number + claim_id: string | null + created_at: string + currency_code: string + deleted_at: string | null + exchange_id: string | null + id: string + order_id: string + raw_amount: Json + reference: string | null + reference_id: string | null + return_id: string | null + updated_at: string + version: number + } + Insert: { + amount: number + claim_id?: string | null + created_at?: string + currency_code: string + deleted_at?: string | null + exchange_id?: string | null + id: string + order_id: string + raw_amount: Json + reference?: string | null + reference_id?: string | null + return_id?: string | null + updated_at?: string + version?: number + } + Update: { + amount?: number + claim_id?: string | null + created_at?: string + currency_code?: string + deleted_at?: string | null + exchange_id?: string | null + id?: string + order_id?: string + raw_amount?: Json + reference?: string | null + reference_id?: string | null + return_id?: string | null + updated_at?: string + version?: number + } + Relationships: [ + { + foreignKeyName: "order_transaction_order_id_foreign" + columns: ["order_id"] + isOneToOne: false + referencedRelation: "order" + referencedColumns: ["id"] + }, + ] + } + payment: { + Row: { + amount: number + canceled_at: string | null + captured_at: string | null + created_at: string + currency_code: string + data: Json | null + deleted_at: string | null + id: string + metadata: Json | null + payment_collection_id: string + payment_session_id: string + provider_id: string + raw_amount: Json + updated_at: string + } + Insert: { + amount: number + canceled_at?: string | null + captured_at?: string | null + created_at?: string + currency_code: string + data?: Json | null + deleted_at?: string | null + id: string + metadata?: Json | null + payment_collection_id: string + payment_session_id: string + provider_id: string + raw_amount: Json + updated_at?: string + } + Update: { + amount?: number + canceled_at?: string | null + captured_at?: string | null + created_at?: string + currency_code?: string + data?: Json | null + deleted_at?: string | null + id?: string + metadata?: Json | null + payment_collection_id?: string + payment_session_id?: string + provider_id?: string + raw_amount?: Json + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "payment_payment_collection_id_foreign" + columns: ["payment_collection_id"] + isOneToOne: false + referencedRelation: "payment_collection" + referencedColumns: ["id"] + }, + ] + } + payment_collection: { + Row: { + amount: number + authorized_amount: number | null + captured_amount: number | null + completed_at: string | null + created_at: string + currency_code: string + deleted_at: string | null + id: string + metadata: Json | null + raw_amount: Json + raw_authorized_amount: Json | null + raw_captured_amount: Json | null + raw_refunded_amount: Json | null + refunded_amount: number | null + status: string + updated_at: string + } + Insert: { + amount: number + authorized_amount?: number | null + captured_amount?: number | null + completed_at?: string | null + created_at?: string + currency_code: string + deleted_at?: string | null + id: string + metadata?: Json | null + raw_amount: Json + raw_authorized_amount?: Json | null + raw_captured_amount?: Json | null + raw_refunded_amount?: Json | null + refunded_amount?: number | null + status?: string + updated_at?: string + } + Update: { + amount?: number + authorized_amount?: number | null + captured_amount?: number | null + completed_at?: string | null + created_at?: string + currency_code?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + raw_amount?: Json + raw_authorized_amount?: Json | null + raw_captured_amount?: Json | null + raw_refunded_amount?: Json | null + refunded_amount?: number | null + status?: string + updated_at?: string + } + Relationships: [] + } + payment_collection_payment_providers: { + Row: { + payment_collection_id: string + payment_provider_id: string + } + Insert: { + payment_collection_id: string + payment_provider_id: string + } + Update: { + payment_collection_id?: string + payment_provider_id?: string + } + Relationships: [ + { + foreignKeyName: "payment_collection_payment_providers_payment_col_aa276_foreign" + columns: ["payment_collection_id"] + isOneToOne: false + referencedRelation: "payment_collection" + referencedColumns: ["id"] + }, + { + foreignKeyName: "payment_collection_payment_providers_payment_pro_2d555_foreign" + columns: ["payment_provider_id"] + isOneToOne: false + referencedRelation: "payment_provider" + referencedColumns: ["id"] + }, + ] + } + payment_provider: { + Row: { + created_at: string + deleted_at: string | null + id: string + is_enabled: boolean + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + is_enabled?: boolean + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + is_enabled?: boolean + updated_at?: string + } + Relationships: [] + } + payment_session: { + Row: { + amount: number + authorized_at: string | null + context: Json | null + created_at: string + currency_code: string + data: Json + deleted_at: string | null + id: string + metadata: Json | null + payment_collection_id: string + provider_id: string + raw_amount: Json + status: string + updated_at: string + } + Insert: { + amount: number + authorized_at?: string | null + context?: Json | null + created_at?: string + currency_code: string + data?: Json + deleted_at?: string | null + id: string + metadata?: Json | null + payment_collection_id: string + provider_id: string + raw_amount: Json + status?: string + updated_at?: string + } + Update: { + amount?: number + authorized_at?: string | null + context?: Json | null + created_at?: string + currency_code?: string + data?: Json + deleted_at?: string | null + id?: string + metadata?: Json | null + payment_collection_id?: string + provider_id?: string + raw_amount?: Json + status?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "payment_session_payment_collection_id_foreign" + columns: ["payment_collection_id"] + isOneToOne: false + referencedRelation: "payment_collection" + referencedColumns: ["id"] + }, + ] + } + price: { + Row: { + amount: number + created_at: string + currency_code: string + deleted_at: string | null + id: string + max_quantity: number | null + min_quantity: number | null + price_list_id: string | null + price_set_id: string + raw_amount: Json + rules_count: number | null + title: string | null + updated_at: string + } + Insert: { + amount: number + created_at?: string + currency_code: string + deleted_at?: string | null + id: string + max_quantity?: number | null + min_quantity?: number | null + price_list_id?: string | null + price_set_id: string + raw_amount: Json + rules_count?: number | null + title?: string | null + updated_at?: string + } + Update: { + amount?: number + created_at?: string + currency_code?: string + deleted_at?: string | null + id?: string + max_quantity?: number | null + min_quantity?: number | null + price_list_id?: string | null + price_set_id?: string + raw_amount?: Json + rules_count?: number | null + title?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "price_price_list_id_foreign" + columns: ["price_list_id"] + isOneToOne: false + referencedRelation: "price_list" + referencedColumns: ["id"] + }, + { + foreignKeyName: "price_price_set_id_foreign" + columns: ["price_set_id"] + isOneToOne: false + referencedRelation: "price_set" + referencedColumns: ["id"] + }, + ] + } + price_list: { + Row: { + created_at: string + deleted_at: string | null + description: string + ends_at: string | null + id: string + rules_count: number | null + starts_at: string | null + status: string + title: string + type: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + description: string + ends_at?: string | null + id: string + rules_count?: number | null + starts_at?: string | null + status?: string + title: string + type?: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + description?: string + ends_at?: string | null + id?: string + rules_count?: number | null + starts_at?: string | null + status?: string + title?: string + type?: string + updated_at?: string + } + Relationships: [] + } + price_list_rule: { + Row: { + attribute: string + created_at: string + deleted_at: string | null + id: string + price_list_id: string + updated_at: string + value: Json | null + } + Insert: { + attribute?: string + created_at?: string + deleted_at?: string | null + id: string + price_list_id: string + updated_at?: string + value?: Json | null + } + Update: { + attribute?: string + created_at?: string + deleted_at?: string | null + id?: string + price_list_id?: string + updated_at?: string + value?: Json | null + } + Relationships: [ + { + foreignKeyName: "price_list_rule_price_list_id_foreign" + columns: ["price_list_id"] + isOneToOne: false + referencedRelation: "price_list" + referencedColumns: ["id"] + }, + ] + } + price_preference: { + Row: { + attribute: string + created_at: string + deleted_at: string | null + id: string + is_tax_inclusive: boolean + updated_at: string + value: string | null + } + Insert: { + attribute: string + created_at?: string + deleted_at?: string | null + id: string + is_tax_inclusive?: boolean + updated_at?: string + value?: string | null + } + Update: { + attribute?: string + created_at?: string + deleted_at?: string | null + id?: string + is_tax_inclusive?: boolean + updated_at?: string + value?: string | null + } + Relationships: [] + } + price_rule: { + Row: { + attribute: string + created_at: string + deleted_at: string | null + id: string + operator: string + price_id: string + priority: number + updated_at: string + value: string + } + Insert: { + attribute?: string + created_at?: string + deleted_at?: string | null + id: string + operator?: string + price_id: string + priority?: number + updated_at?: string + value: string + } + Update: { + attribute?: string + created_at?: string + deleted_at?: string | null + id?: string + operator?: string + price_id?: string + priority?: number + updated_at?: string + value?: string + } + Relationships: [ + { + foreignKeyName: "price_rule_price_id_foreign" + columns: ["price_id"] + isOneToOne: false + referencedRelation: "price" + referencedColumns: ["id"] + }, + ] + } + price_set: { + Row: { + created_at: string + deleted_at: string | null + id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + updated_at?: string + } + Relationships: [] + } + product: { + Row: { + collection_id: string | null + created_at: string + deleted_at: string | null + description: string | null + discountable: boolean + external_id: string | null + handle: string + height: string | null + hs_code: string | null + id: string + is_giftcard: boolean + length: string | null + material: string | null + metadata: Json | null + mid_code: string | null + origin_country: string | null + status: string + subtitle: string | null + thumbnail: string | null + title: string + type_id: string | null + updated_at: string + weight: string | null + width: string | null + } + Insert: { + collection_id?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + discountable?: boolean + external_id?: string | null + handle: string + height?: string | null + hs_code?: string | null + id: string + is_giftcard?: boolean + length?: string | null + material?: string | null + metadata?: Json | null + mid_code?: string | null + origin_country?: string | null + status?: string + subtitle?: string | null + thumbnail?: string | null + title: string + type_id?: string | null + updated_at?: string + weight?: string | null + width?: string | null + } + Update: { + collection_id?: string | null + created_at?: string + deleted_at?: string | null + description?: string | null + discountable?: boolean + external_id?: string | null + handle?: string + height?: string | null + hs_code?: string | null + id?: string + is_giftcard?: boolean + length?: string | null + material?: string | null + metadata?: Json | null + mid_code?: string | null + origin_country?: string | null + status?: string + subtitle?: string | null + thumbnail?: string | null + title?: string + type_id?: string | null + updated_at?: string + weight?: string | null + width?: string | null + } + Relationships: [ + { + foreignKeyName: "product_collection_id_foreign" + columns: ["collection_id"] + isOneToOne: false + referencedRelation: "product_collection" + referencedColumns: ["id"] + }, + { + foreignKeyName: "product_type_id_foreign" + columns: ["type_id"] + isOneToOne: false + referencedRelation: "product_type" + referencedColumns: ["id"] + }, + ] + } + product_category: { + Row: { + created_at: string + deleted_at: string | null + description: string + handle: string + id: string + is_active: boolean + is_internal: boolean + metadata: Json | null + mpath: string + name: string + parent_category_id: string | null + rank: number + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + description?: string + handle: string + id: string + is_active?: boolean + is_internal?: boolean + metadata?: Json | null + mpath: string + name: string + parent_category_id?: string | null + rank?: number + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + description?: string + handle?: string + id?: string + is_active?: boolean + is_internal?: boolean + metadata?: Json | null + mpath?: string + name?: string + parent_category_id?: string | null + rank?: number + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "product_category_parent_category_id_foreign" + columns: ["parent_category_id"] + isOneToOne: false + referencedRelation: "product_category" + referencedColumns: ["id"] + }, + ] + } + product_category_product: { + Row: { + product_category_id: string + product_id: string + } + Insert: { + product_category_id: string + product_id: string + } + Update: { + product_category_id?: string + product_id?: string + } + Relationships: [ + { + foreignKeyName: "product_category_product_product_category_id_foreign" + columns: ["product_category_id"] + isOneToOne: false + referencedRelation: "product_category" + referencedColumns: ["id"] + }, + { + foreignKeyName: "product_category_product_product_id_foreign" + columns: ["product_id"] + isOneToOne: false + referencedRelation: "product" + referencedColumns: ["id"] + }, + ] + } + product_collection: { + Row: { + created_at: string + deleted_at: string | null + handle: string + id: string + metadata: Json | null + title: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + handle: string + id: string + metadata?: Json | null + title: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + handle?: string + id?: string + metadata?: Json | null + title?: string + updated_at?: string + } + Relationships: [] + } + product_option: { + Row: { + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + product_id: string + title: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + product_id: string + title: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + product_id?: string + title?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "product_option_product_id_foreign" + columns: ["product_id"] + isOneToOne: false + referencedRelation: "product" + referencedColumns: ["id"] + }, + ] + } + product_option_value: { + Row: { + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + option_id: string | null + updated_at: string + value: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + option_id?: string | null + updated_at?: string + value: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + option_id?: string | null + updated_at?: string + value?: string + } + Relationships: [ + { + foreignKeyName: "product_option_value_option_id_foreign" + columns: ["option_id"] + isOneToOne: false + referencedRelation: "product_option" + referencedColumns: ["id"] + }, + ] + } + product_sales_channel: { + Row: { + created_at: string + deleted_at: string | null + id: string + product_id: string + sales_channel_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + product_id: string + sales_channel_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + product_id?: string + sales_channel_id?: string + updated_at?: string + } + Relationships: [] + } + product_shipping_profile: { + Row: { + created_at: string + deleted_at: string | null + id: string + product_id: string + shipping_profile_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + product_id: string + shipping_profile_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + product_id?: string + shipping_profile_id?: string + updated_at?: string + } + Relationships: [] + } + product_tag: { + Row: { + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + updated_at: string + value: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + updated_at?: string + value: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + updated_at?: string + value?: string + } + Relationships: [] + } + product_tags: { + Row: { + product_id: string + product_tag_id: string + } + Insert: { + product_id: string + product_tag_id: string + } + Update: { + product_id?: string + product_tag_id?: string + } + Relationships: [ + { + foreignKeyName: "product_tags_product_id_foreign" + columns: ["product_id"] + isOneToOne: false + referencedRelation: "product" + referencedColumns: ["id"] + }, + { + foreignKeyName: "product_tags_product_tag_id_foreign" + columns: ["product_tag_id"] + isOneToOne: false + referencedRelation: "product_tag" + referencedColumns: ["id"] + }, + ] + } + product_type: { + Row: { + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + updated_at: string + value: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + updated_at?: string + value: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + updated_at?: string + value?: string + } + Relationships: [] + } + product_variant: { + Row: { + allow_backorder: boolean + barcode: string | null + created_at: string + deleted_at: string | null + ean: string | null + height: number | null + hs_code: string | null + id: string + length: number | null + manage_inventory: boolean + material: string | null + metadata: Json | null + mid_code: string | null + origin_country: string | null + product_id: string | null + sku: string | null + title: string + upc: string | null + updated_at: string + variant_rank: number | null + weight: number | null + width: number | null + } + Insert: { + allow_backorder?: boolean + barcode?: string | null + created_at?: string + deleted_at?: string | null + ean?: string | null + height?: number | null + hs_code?: string | null + id: string + length?: number | null + manage_inventory?: boolean + material?: string | null + metadata?: Json | null + mid_code?: string | null + origin_country?: string | null + product_id?: string | null + sku?: string | null + title: string + upc?: string | null + updated_at?: string + variant_rank?: number | null + weight?: number | null + width?: number | null + } + Update: { + allow_backorder?: boolean + barcode?: string | null + created_at?: string + deleted_at?: string | null + ean?: string | null + height?: number | null + hs_code?: string | null + id?: string + length?: number | null + manage_inventory?: boolean + material?: string | null + metadata?: Json | null + mid_code?: string | null + origin_country?: string | null + product_id?: string | null + sku?: string | null + title?: string + upc?: string | null + updated_at?: string + variant_rank?: number | null + weight?: number | null + width?: number | null + } + Relationships: [ + { + foreignKeyName: "product_variant_product_id_foreign" + columns: ["product_id"] + isOneToOne: false + referencedRelation: "product" + referencedColumns: ["id"] + }, + ] + } + product_variant_inventory_item: { + Row: { + created_at: string + deleted_at: string | null + id: string + inventory_item_id: string + required_quantity: number + updated_at: string + variant_id: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + inventory_item_id: string + required_quantity?: number + updated_at?: string + variant_id: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + inventory_item_id?: string + required_quantity?: number + updated_at?: string + variant_id?: string + } + Relationships: [] + } + product_variant_option: { + Row: { + option_value_id: string + variant_id: string + } + Insert: { + option_value_id: string + variant_id: string + } + Update: { + option_value_id?: string + variant_id?: string + } + Relationships: [ + { + foreignKeyName: "product_variant_option_option_value_id_foreign" + columns: ["option_value_id"] + isOneToOne: false + referencedRelation: "product_option_value" + referencedColumns: ["id"] + }, + { + foreignKeyName: "product_variant_option_variant_id_foreign" + columns: ["variant_id"] + isOneToOne: false + referencedRelation: "product_variant" + referencedColumns: ["id"] + }, + ] + } + product_variant_price_set: { + Row: { + created_at: string + deleted_at: string | null + id: string + price_set_id: string + updated_at: string + variant_id: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + price_set_id: string + updated_at?: string + variant_id: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + price_set_id?: string + updated_at?: string + variant_id?: string + } + Relationships: [] + } + promotion: { + Row: { + campaign_id: string | null + code: string + created_at: string + deleted_at: string | null + id: string + is_automatic: boolean + is_tax_inclusive: boolean + status: string + type: string + updated_at: string + } + Insert: { + campaign_id?: string | null + code: string + created_at?: string + deleted_at?: string | null + id: string + is_automatic?: boolean + is_tax_inclusive?: boolean + status?: string + type: string + updated_at?: string + } + Update: { + campaign_id?: string | null + code?: string + created_at?: string + deleted_at?: string | null + id?: string + is_automatic?: boolean + is_tax_inclusive?: boolean + status?: string + type?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "promotion_campaign_id_foreign" + columns: ["campaign_id"] + isOneToOne: false + referencedRelation: "promotion_campaign" + referencedColumns: ["id"] + }, + ] + } + promotion_application_method: { + Row: { + allocation: string | null + apply_to_quantity: number | null + buy_rules_min_quantity: number | null + created_at: string + currency_code: string | null + deleted_at: string | null + id: string + max_quantity: number | null + promotion_id: string + raw_value: Json | null + target_type: string + type: string + updated_at: string + value: number | null + } + Insert: { + allocation?: string | null + apply_to_quantity?: number | null + buy_rules_min_quantity?: number | null + created_at?: string + currency_code?: string | null + deleted_at?: string | null + id: string + max_quantity?: number | null + promotion_id: string + raw_value?: Json | null + target_type: string + type: string + updated_at?: string + value?: number | null + } + Update: { + allocation?: string | null + apply_to_quantity?: number | null + buy_rules_min_quantity?: number | null + created_at?: string + currency_code?: string | null + deleted_at?: string | null + id?: string + max_quantity?: number | null + promotion_id?: string + raw_value?: Json | null + target_type?: string + type?: string + updated_at?: string + value?: number | null + } + Relationships: [ + { + foreignKeyName: "promotion_application_method_promotion_id_foreign" + columns: ["promotion_id"] + isOneToOne: false + referencedRelation: "promotion" + referencedColumns: ["id"] + }, + ] + } + promotion_campaign: { + Row: { + campaign_identifier: string + created_at: string + deleted_at: string | null + description: string | null + ends_at: string | null + id: string + name: string + starts_at: string | null + updated_at: string + } + Insert: { + campaign_identifier: string + created_at?: string + deleted_at?: string | null + description?: string | null + ends_at?: string | null + id: string + name: string + starts_at?: string | null + updated_at?: string + } + Update: { + campaign_identifier?: string + created_at?: string + deleted_at?: string | null + description?: string | null + ends_at?: string | null + id?: string + name?: string + starts_at?: string | null + updated_at?: string + } + Relationships: [] + } + promotion_campaign_budget: { + Row: { + campaign_id: string + created_at: string + currency_code: string | null + deleted_at: string | null + id: string + limit: number | null + raw_limit: Json | null + raw_used: Json + type: string + updated_at: string + used: number + } + Insert: { + campaign_id: string + created_at?: string + currency_code?: string | null + deleted_at?: string | null + id: string + limit?: number | null + raw_limit?: Json | null + raw_used: Json + type: string + updated_at?: string + used?: number + } + Update: { + campaign_id?: string + created_at?: string + currency_code?: string | null + deleted_at?: string | null + id?: string + limit?: number | null + raw_limit?: Json | null + raw_used?: Json + type?: string + updated_at?: string + used?: number + } + Relationships: [ + { + foreignKeyName: "promotion_campaign_budget_campaign_id_foreign" + columns: ["campaign_id"] + isOneToOne: false + referencedRelation: "promotion_campaign" + referencedColumns: ["id"] + }, + ] + } + promotion_promotion_rule: { + Row: { + promotion_id: string + promotion_rule_id: string + } + Insert: { + promotion_id: string + promotion_rule_id: string + } + Update: { + promotion_id?: string + promotion_rule_id?: string + } + Relationships: [ + { + foreignKeyName: "promotion_promotion_rule_promotion_id_foreign" + columns: ["promotion_id"] + isOneToOne: false + referencedRelation: "promotion" + referencedColumns: ["id"] + }, + { + foreignKeyName: "promotion_promotion_rule_promotion_rule_id_foreign" + columns: ["promotion_rule_id"] + isOneToOne: false + referencedRelation: "promotion_rule" + referencedColumns: ["id"] + }, + ] + } + promotion_rule: { + Row: { + attribute: string + created_at: string + deleted_at: string | null + description: string | null + id: string + operator: string + updated_at: string + } + Insert: { + attribute: string + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + operator: string + updated_at?: string + } + Update: { + attribute?: string + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + operator?: string + updated_at?: string + } + Relationships: [] + } + promotion_rule_value: { + Row: { + created_at: string + deleted_at: string | null + id: string + promotion_rule_id: string + updated_at: string + value: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + promotion_rule_id: string + updated_at?: string + value: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + promotion_rule_id?: string + updated_at?: string + value?: string + } + Relationships: [ + { + foreignKeyName: "promotion_rule_value_promotion_rule_id_foreign" + columns: ["promotion_rule_id"] + isOneToOne: false + referencedRelation: "promotion_rule" + referencedColumns: ["id"] + }, + ] + } + provider_identity: { + Row: { + auth_identity_id: string + created_at: string + deleted_at: string | null + entity_id: string + id: string + provider: string + provider_metadata: Json | null + updated_at: string + user_metadata: Json | null + } + Insert: { + auth_identity_id: string + created_at?: string + deleted_at?: string | null + entity_id: string + id: string + provider: string + provider_metadata?: Json | null + updated_at?: string + user_metadata?: Json | null + } + Update: { + auth_identity_id?: string + created_at?: string + deleted_at?: string | null + entity_id?: string + id?: string + provider?: string + provider_metadata?: Json | null + updated_at?: string + user_metadata?: Json | null + } + Relationships: [ + { + foreignKeyName: "provider_identity_auth_identity_id_foreign" + columns: ["auth_identity_id"] + isOneToOne: false + referencedRelation: "auth_identity" + referencedColumns: ["id"] + }, + ] + } + publishable_api_key_sales_channel: { + Row: { + created_at: string + deleted_at: string | null + id: string + publishable_key_id: string + sales_channel_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + publishable_key_id: string + sales_channel_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + publishable_key_id?: string + sales_channel_id?: string + updated_at?: string + } + Relationships: [] + } + refund: { + Row: { + amount: number + created_at: string + created_by: string | null + deleted_at: string | null + id: string + metadata: Json | null + note: string | null + payment_id: string + raw_amount: Json + refund_reason_id: string | null + updated_at: string + } + Insert: { + amount: number + created_at?: string + created_by?: string | null + deleted_at?: string | null + id: string + metadata?: Json | null + note?: string | null + payment_id: string + raw_amount: Json + refund_reason_id?: string | null + updated_at?: string + } + Update: { + amount?: number + created_at?: string + created_by?: string | null + deleted_at?: string | null + id?: string + metadata?: Json | null + note?: string | null + payment_id?: string + raw_amount?: Json + refund_reason_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "refund_payment_id_foreign" + columns: ["payment_id"] + isOneToOne: false + referencedRelation: "payment" + referencedColumns: ["id"] + }, + ] + } + refund_reason: { + Row: { + created_at: string + deleted_at: string | null + description: string | null + id: string + label: string + metadata: Json | null + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + label: string + metadata?: Json | null + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + label?: string + metadata?: Json | null + updated_at?: string + } + Relationships: [] + } + region: { + Row: { + automatic_taxes: boolean + created_at: string + currency_code: string + deleted_at: string | null + id: string + metadata: Json | null + name: string + updated_at: string + } + Insert: { + automatic_taxes?: boolean + created_at?: string + currency_code: string + deleted_at?: string | null + id: string + metadata?: Json | null + name: string + updated_at?: string + } + Update: { + automatic_taxes?: boolean + created_at?: string + currency_code?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + name?: string + updated_at?: string + } + Relationships: [] + } + region_country: { + Row: { + created_at: string + deleted_at: string | null + display_name: string + iso_2: string + iso_3: string + metadata: Json | null + name: string + num_code: string + region_id: string | null + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + display_name: string + iso_2: string + iso_3: string + metadata?: Json | null + name: string + num_code: string + region_id?: string | null + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + display_name?: string + iso_2?: string + iso_3?: string + metadata?: Json | null + name?: string + num_code?: string + region_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "region_country_region_id_foreign" + columns: ["region_id"] + isOneToOne: false + referencedRelation: "region" + referencedColumns: ["id"] + }, + ] + } + region_payment_provider: { + Row: { + created_at: string + deleted_at: string | null + id: string + payment_provider_id: string + region_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + payment_provider_id: string + region_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + payment_provider_id?: string + region_id?: string + updated_at?: string + } + Relationships: [] + } + reservation_item: { + Row: { + allow_backorder: boolean | null + created_at: string + created_by: string | null + deleted_at: string | null + description: string | null + external_id: string | null + id: string + inventory_item_id: string + line_item_id: string | null + location_id: string + metadata: Json | null + quantity: number + raw_quantity: Json | null + updated_at: string + } + Insert: { + allow_backorder?: boolean | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + description?: string | null + external_id?: string | null + id: string + inventory_item_id: string + line_item_id?: string | null + location_id: string + metadata?: Json | null + quantity: number + raw_quantity?: Json | null + updated_at?: string + } + Update: { + allow_backorder?: boolean | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + description?: string | null + external_id?: string | null + id?: string + inventory_item_id?: string + line_item_id?: string | null + location_id?: string + metadata?: Json | null + quantity?: number + raw_quantity?: Json | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "reservation_item_inventory_item_id_foreign" + columns: ["inventory_item_id"] + isOneToOne: false + referencedRelation: "inventory_item" + referencedColumns: ["id"] + }, + ] + } + return: { + Row: { + canceled_at: string | null + claim_id: string | null + created_at: string + created_by: string | null + deleted_at: string | null + display_id: number + exchange_id: string | null + id: string + location_id: string | null + metadata: Json | null + no_notification: boolean | null + order_id: string + order_version: number + raw_refund_amount: Json | null + received_at: string | null + refund_amount: number | null + requested_at: string | null + status: Database["public"]["Enums"]["return_status_enum"] + updated_at: string + } + Insert: { + canceled_at?: string | null + claim_id?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + display_id?: number + exchange_id?: string | null + id: string + location_id?: string | null + metadata?: Json | null + no_notification?: boolean | null + order_id: string + order_version: number + raw_refund_amount?: Json | null + received_at?: string | null + refund_amount?: number | null + requested_at?: string | null + status?: Database["public"]["Enums"]["return_status_enum"] + updated_at?: string + } + Update: { + canceled_at?: string | null + claim_id?: string | null + created_at?: string + created_by?: string | null + deleted_at?: string | null + display_id?: number + exchange_id?: string | null + id?: string + location_id?: string | null + metadata?: Json | null + no_notification?: boolean | null + order_id?: string + order_version?: number + raw_refund_amount?: Json | null + received_at?: string | null + refund_amount?: number | null + requested_at?: string | null + status?: Database["public"]["Enums"]["return_status_enum"] + updated_at?: string + } + Relationships: [] + } + return_fulfillment: { + Row: { + created_at: string + deleted_at: string | null + fulfillment_id: string + id: string + return_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + fulfillment_id: string + id: string + return_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + fulfillment_id?: string + id?: string + return_id?: string + updated_at?: string + } + Relationships: [] + } + return_item: { + Row: { + created_at: string + damaged_quantity: number + deleted_at: string | null + id: string + item_id: string + metadata: Json | null + note: string | null + quantity: number + raw_damaged_quantity: Json + raw_quantity: Json + raw_received_quantity: Json + reason_id: string | null + received_quantity: number + return_id: string + updated_at: string + } + Insert: { + created_at?: string + damaged_quantity?: number + deleted_at?: string | null + id: string + item_id: string + metadata?: Json | null + note?: string | null + quantity: number + raw_damaged_quantity: Json + raw_quantity: Json + raw_received_quantity: Json + reason_id?: string | null + received_quantity?: number + return_id: string + updated_at?: string + } + Update: { + created_at?: string + damaged_quantity?: number + deleted_at?: string | null + id?: string + item_id?: string + metadata?: Json | null + note?: string | null + quantity?: number + raw_damaged_quantity?: Json + raw_quantity?: Json + raw_received_quantity?: Json + reason_id?: string | null + received_quantity?: number + return_id?: string + updated_at?: string + } + Relationships: [] + } + return_reason: { + Row: { + created_at: string + deleted_at: string | null + description: string | null + id: string + label: string + metadata: Json | null + parent_return_reason_id: string | null + updated_at: string + value: string + } + Insert: { + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + label: string + metadata?: Json | null + parent_return_reason_id?: string | null + updated_at?: string + value: string + } + Update: { + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + label?: string + metadata?: Json | null + parent_return_reason_id?: string | null + updated_at?: string + value?: string + } + Relationships: [ + { + foreignKeyName: "return_reason_parent_return_reason_id_foreign" + columns: ["parent_return_reason_id"] + isOneToOne: false + referencedRelation: "return_reason" + referencedColumns: ["id"] + }, + ] + } + sales_channel: { + Row: { + created_at: string + deleted_at: string | null + description: string | null + id: string + is_disabled: boolean + metadata: Json | null + name: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + is_disabled?: boolean + metadata?: Json | null + name: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + is_disabled?: boolean + metadata?: Json | null + name?: string + updated_at?: string + } + Relationships: [] + } + sales_channel_stock_location: { + Row: { + created_at: string + deleted_at: string | null + id: string + sales_channel_id: string + stock_location_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + sales_channel_id: string + stock_location_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + sales_channel_id?: string + stock_location_id?: string + updated_at?: string + } + Relationships: [] + } + script_migrations: { + Row: { + created_at: string | null + finished_at: string | null + id: number + script_name: string + } + Insert: { + created_at?: string | null + finished_at?: string | null + id?: number + script_name: string + } + Update: { + created_at?: string | null + finished_at?: string | null + id?: number + script_name?: string + } + Relationships: [] + } + service_zone: { + Row: { + created_at: string + deleted_at: string | null + fulfillment_set_id: string + id: string + metadata: Json | null + name: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + fulfillment_set_id: string + id: string + metadata?: Json | null + name: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + fulfillment_set_id?: string + id?: string + metadata?: Json | null + name?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "service_zone_fulfillment_set_id_foreign" + columns: ["fulfillment_set_id"] + isOneToOne: false + referencedRelation: "fulfillment_set" + referencedColumns: ["id"] + }, + ] + } + shipping_option: { + Row: { + created_at: string + data: Json | null + deleted_at: string | null + id: string + metadata: Json | null + name: string + price_type: string + provider_id: string | null + service_zone_id: string + shipping_option_type_id: string + shipping_profile_id: string | null + updated_at: string + } + Insert: { + created_at?: string + data?: Json | null + deleted_at?: string | null + id: string + metadata?: Json | null + name: string + price_type?: string + provider_id?: string | null + service_zone_id: string + shipping_option_type_id: string + shipping_profile_id?: string | null + updated_at?: string + } + Update: { + created_at?: string + data?: Json | null + deleted_at?: string | null + id?: string + metadata?: Json | null + name?: string + price_type?: string + provider_id?: string | null + service_zone_id?: string + shipping_option_type_id?: string + shipping_profile_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "shipping_option_provider_id_foreign" + columns: ["provider_id"] + isOneToOne: false + referencedRelation: "fulfillment_provider" + referencedColumns: ["id"] + }, + { + foreignKeyName: "shipping_option_service_zone_id_foreign" + columns: ["service_zone_id"] + isOneToOne: false + referencedRelation: "service_zone" + referencedColumns: ["id"] + }, + { + foreignKeyName: "shipping_option_shipping_option_type_id_foreign" + columns: ["shipping_option_type_id"] + isOneToOne: false + referencedRelation: "shipping_option_type" + referencedColumns: ["id"] + }, + { + foreignKeyName: "shipping_option_shipping_profile_id_foreign" + columns: ["shipping_profile_id"] + isOneToOne: false + referencedRelation: "shipping_profile" + referencedColumns: ["id"] + }, + ] + } + shipping_option_price_set: { + Row: { + created_at: string + deleted_at: string | null + id: string + price_set_id: string + shipping_option_id: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + price_set_id: string + shipping_option_id: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + price_set_id?: string + shipping_option_id?: string + updated_at?: string + } + Relationships: [] + } + shipping_option_rule: { + Row: { + attribute: string + created_at: string + deleted_at: string | null + id: string + operator: string + shipping_option_id: string + updated_at: string + value: Json | null + } + Insert: { + attribute: string + created_at?: string + deleted_at?: string | null + id: string + operator: string + shipping_option_id: string + updated_at?: string + value?: Json | null + } + Update: { + attribute?: string + created_at?: string + deleted_at?: string | null + id?: string + operator?: string + shipping_option_id?: string + updated_at?: string + value?: Json | null + } + Relationships: [ + { + foreignKeyName: "shipping_option_rule_shipping_option_id_foreign" + columns: ["shipping_option_id"] + isOneToOne: false + referencedRelation: "shipping_option" + referencedColumns: ["id"] + }, + ] + } + shipping_option_type: { + Row: { + code: string + created_at: string + deleted_at: string | null + description: string | null + id: string + label: string + updated_at: string + } + Insert: { + code: string + created_at?: string + deleted_at?: string | null + description?: string | null + id: string + label: string + updated_at?: string + } + Update: { + code?: string + created_at?: string + deleted_at?: string | null + description?: string | null + id?: string + label?: string + updated_at?: string + } + Relationships: [] + } + shipping_profile: { + Row: { + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + name: string + type: string + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + name: string + type: string + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + name?: string + type?: string + updated_at?: string + } + Relationships: [] + } + stock_location: { + Row: { + address_id: string | null + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + name: string + updated_at: string + } + Insert: { + address_id?: string | null + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + name: string + updated_at?: string + } + Update: { + address_id?: string | null + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + name?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "stock_location_address_id_foreign" + columns: ["address_id"] + isOneToOne: false + referencedRelation: "stock_location_address" + referencedColumns: ["id"] + }, + ] + } + stock_location_address: { + Row: { + address_1: string + address_2: string | null + city: string | null + company: string | null + country_code: string + created_at: string + deleted_at: string | null + id: string + metadata: Json | null + phone: string | null + postal_code: string | null + province: string | null + updated_at: string + } + Insert: { + address_1: string + address_2?: string | null + city?: string | null + company?: string | null + country_code: string + created_at?: string + deleted_at?: string | null + id: string + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Update: { + address_1?: string + address_2?: string | null + city?: string | null + company?: string | null + country_code?: string + created_at?: string + deleted_at?: string | null + id?: string + metadata?: Json | null + phone?: string | null + postal_code?: string | null + province?: string | null + updated_at?: string + } + Relationships: [] + } + store: { + Row: { + created_at: string + default_location_id: string | null + default_region_id: string | null + default_sales_channel_id: string | null + deleted_at: string | null + id: string + metadata: Json | null + name: string + updated_at: string + } + Insert: { + created_at?: string + default_location_id?: string | null + default_region_id?: string | null + default_sales_channel_id?: string | null + deleted_at?: string | null + id: string + metadata?: Json | null + name?: string + updated_at?: string + } + Update: { + created_at?: string + default_location_id?: string | null + default_region_id?: string | null + default_sales_channel_id?: string | null + deleted_at?: string | null + id?: string + metadata?: Json | null + name?: string + updated_at?: string + } + Relationships: [] + } + store_currency: { + Row: { + created_at: string + currency_code: string + deleted_at: string | null + id: string + is_default: boolean + store_id: string | null + updated_at: string + } + Insert: { + created_at?: string + currency_code: string + deleted_at?: string | null + id: string + is_default?: boolean + store_id?: string | null + updated_at?: string + } + Update: { + created_at?: string + currency_code?: string + deleted_at?: string | null + id?: string + is_default?: boolean + store_id?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "store_currency_store_id_foreign" + columns: ["store_id"] + isOneToOne: false + referencedRelation: "store" + referencedColumns: ["id"] + }, + ] + } + tax_provider: { + Row: { + created_at: string + deleted_at: string | null + id: string + is_enabled: boolean + updated_at: string + } + Insert: { + created_at?: string + deleted_at?: string | null + id: string + is_enabled?: boolean + updated_at?: string + } + Update: { + created_at?: string + deleted_at?: string | null + id?: string + is_enabled?: boolean + updated_at?: string + } + Relationships: [] + } + tax_rate: { + Row: { + code: string + created_at: string + created_by: string | null + deleted_at: string | null + id: string + is_combinable: boolean + is_default: boolean + metadata: Json | null + name: string + rate: number | null + tax_region_id: string + updated_at: string + } + Insert: { + code: string + created_at?: string + created_by?: string | null + deleted_at?: string | null + id: string + is_combinable?: boolean + is_default?: boolean + metadata?: Json | null + name: string + rate?: number | null + tax_region_id: string + updated_at?: string + } + Update: { + code?: string + created_at?: string + created_by?: string | null + deleted_at?: string | null + id?: string + is_combinable?: boolean + is_default?: boolean + metadata?: Json | null + name?: string + rate?: number | null + tax_region_id?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "FK_tax_rate_tax_region_id" + columns: ["tax_region_id"] + isOneToOne: false + referencedRelation: "tax_region" + referencedColumns: ["id"] + }, + ] + } + tax_rate_rule: { + Row: { + created_at: string + created_by: string | null + deleted_at: string | null + id: string + metadata: Json | null + reference: string + reference_id: string + tax_rate_id: string + updated_at: string + } + Insert: { + created_at?: string + created_by?: string | null + deleted_at?: string | null + id: string + metadata?: Json | null + reference: string + reference_id: string + tax_rate_id: string + updated_at?: string + } + Update: { + created_at?: string + created_by?: string | null + deleted_at?: string | null + id?: string + metadata?: Json | null + reference?: string + reference_id?: string + tax_rate_id?: string + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "FK_tax_rate_rule_tax_rate_id" + columns: ["tax_rate_id"] + isOneToOne: false + referencedRelation: "tax_rate" + referencedColumns: ["id"] + }, + ] + } + tax_region: { + Row: { + country_code: string + created_at: string + created_by: string | null + deleted_at: string | null + id: string + metadata: Json | null + parent_id: string | null + provider_id: string | null + province_code: string | null + updated_at: string + } + Insert: { + country_code: string + created_at?: string + created_by?: string | null + deleted_at?: string | null + id: string + metadata?: Json | null + parent_id?: string | null + provider_id?: string | null + province_code?: string | null + updated_at?: string + } + Update: { + country_code?: string + created_at?: string + created_by?: string | null + deleted_at?: string | null + id?: string + metadata?: Json | null + parent_id?: string | null + provider_id?: string | null + province_code?: string | null + updated_at?: string + } + Relationships: [ + { + foreignKeyName: "FK_tax_region_parent_id" + columns: ["parent_id"] + isOneToOne: false + referencedRelation: "tax_region" + referencedColumns: ["id"] + }, + { + foreignKeyName: "FK_tax_region_provider_id" + columns: ["provider_id"] + isOneToOne: false + referencedRelation: "tax_provider" + referencedColumns: ["id"] + }, + ] + } + user: { + Row: { + avatar_url: string | null + created_at: string + deleted_at: string | null + email: string + first_name: string | null + id: string + last_name: string | null + metadata: Json | null + updated_at: string + } + Insert: { + avatar_url?: string | null + created_at?: string + deleted_at?: string | null + email: string + first_name?: string | null + id: string + last_name?: string | null + metadata?: Json | null + updated_at?: string + } + Update: { + avatar_url?: string | null + created_at?: string + deleted_at?: string | null + email?: string + first_name?: string | null + id?: string + last_name?: string | null + metadata?: Json | null + updated_at?: string + } + Relationships: [] + } + workflow_execution: { + Row: { + context: Json | null + created_at: string + deleted_at: string | null + execution: Json | null + id: string + retention_time: number | null + run_id: string + state: string + transaction_id: string + updated_at: string + workflow_id: string + } + Insert: { + context?: Json | null + created_at?: string + deleted_at?: string | null + execution?: Json | null + id: string + retention_time?: number | null + run_id?: string + state: string + transaction_id: string + updated_at?: string + workflow_id: string + } + Update: { + context?: Json | null + created_at?: string + deleted_at?: string | null + execution?: Json | null + id?: string + retention_time?: number | null + run_id?: string + state?: string + transaction_id?: string + updated_at?: string + workflow_id?: string + } + Relationships: [] + } } Views: { [_ in never]: never @@ -1817,6 +7494,25 @@ export type Database = { | "settings.manage" | "members.manage" | "invites.manage" + claim_reason_enum: + | "missing_item" + | "wrong_item" + | "production_failure" + | "other" + order_claim_type_enum: "refund" | "replace" + order_status_enum: + | "pending" + | "completed" + | "draft" + | "archived" + | "canceled" + | "requires_action" + return_status_enum: + | "open" + | "requested" + | "received" + | "partially_received" + | "canceled" } CompositeTypes: { invitation: { @@ -1986,6 +7682,28 @@ export const Constants = { "members.manage", "invites.manage", ], + claim_reason_enum: [ + "missing_item", + "wrong_item", + "production_failure", + "other", + ], + order_claim_type_enum: ["refund", "replace"], + order_status_enum: [ + "pending", + "completed", + "draft", + "archived", + "canceled", + "requires_action", + ], + return_status_enum: [ + "open", + "requested", + "received", + "partially_received", + "canceled", + ], }, }, } as const diff --git a/packages/ui/package.json b/packages/ui/package.json index 51dcf25..571c31e 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -54,7 +54,6 @@ "next-themes": "0.4.6", "prettier": "^3.5.3", "react-day-picker": "^8.10.1", - "react-hook-form": "^7.56.3", "sonner": "^2.0.3", "tailwindcss": "4.1.7", "tailwindcss-animate": "^1.0.7", diff --git a/packages/ui/src/makerkit/page.tsx b/packages/ui/src/makerkit/page.tsx index 4035d45..4f82a7b 100644 --- a/packages/ui/src/makerkit/page.tsx +++ b/packages/ui/src/makerkit/page.tsx @@ -37,16 +37,12 @@ function PageWithSidebar(props: PageProps) {
{MobileNavigation} -
+
{Children}
@@ -75,7 +71,7 @@ function PageWithHeader(props: PageProps) { const { Navigation, Children, MobileNavigation } = getSlotsFromPage(props); return ( -
+
= 20.0.0} @@ -8519,12 +8504,6 @@ packages: peerDependencies: react: '>=16.13.1' - react-hook-form@7.57.0: - resolution: {integrity: sha512-RbEks3+cbvTP84l/VXGUZ+JMrKOS8ykQCRYdm5aYsxnDquL0vspsyNhGRO7pcH6hsZqWlPOjLye7rJqdtdAmlg==} - engines: {node: '>=18.0.0'} - peerDependencies: - react: ^16.8.0 || ^17 || ^18 || ^19 - react-hook-form@7.58.0: resolution: {integrity: sha512-zGijmEed35oNfOfy7ub99jfjkiLhHwA3dl5AgyKdWC6QQzhnc7tkWewSa+T+A2EpLrc6wo5DUoZctS9kufWJjA==} engines: {node: '>=18.0.0'} @@ -9960,10 +9939,10 @@ snapshots: react-dom: 19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106) use-sync-external-store: 1.5.0(react@19.0.0-rc-66855b96-20241106) - '@hookform/resolvers@5.0.1(react-hook-form@7.57.0(react@19.1.0))': + '@hookform/resolvers@5.0.1(react-hook-form@7.58.0(react@19.1.0))': dependencies: '@standard-schema/utils': 0.3.0 - react-hook-form: 7.57.0(react@19.1.0) + react-hook-form: 7.58.0(react@19.1.0) '@hookform/resolvers@5.1.1(react-hook-form@7.58.0(react@19.1.0))': dependencies: @@ -17650,8 +17629,8 @@ snapshots: '@typescript-eslint/parser': 8.33.1(eslint@8.10.0)(typescript@5.8.3) eslint: 8.10.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0))(eslint@8.10.0) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0)(eslint@8.10.0) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.10.0) eslint-plugin-react: 7.37.5(eslint@8.10.0) eslint-plugin-react-hooks: 5.2.0(eslint@8.10.0) @@ -17670,8 +17649,8 @@ snapshots: '@typescript-eslint/parser': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3) eslint: 9.28.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0)(eslint@9.28.0(jiti@2.4.2)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.28.0(jiti@2.4.2)) eslint-plugin-react: 7.37.5(eslint@9.28.0(jiti@2.4.2)) eslint-plugin-react-hooks: 5.2.0(eslint@9.28.0(jiti@2.4.2)) @@ -17696,22 +17675,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)): - dependencies: - '@nolyfill/is-core-module': 1.0.39 - debug: 4.4.1 - eslint: 9.28.0(jiti@2.4.2) - get-tsconfig: 4.10.1 - is-bun-module: 2.0.0 - stable-hash: 0.0.5 - tinyglobby: 0.2.14 - unrs-resolver: 1.7.11 - optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)) - transitivePeerDependencies: - - supports-color - - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0): + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0)(eslint@8.10.0): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.1 @@ -17722,33 +17686,48 @@ snapshots: tinyglobby: 0.2.14 unrs-resolver: 1.7.11 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0))(eslint@8.10.0) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0))(eslint@8.10.0): + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0)(eslint@9.28.0(jiti@2.4.2)): + dependencies: + '@nolyfill/is-core-module': 1.0.39 + debug: 4.4.1 + eslint: 9.28.0(jiti@2.4.2) + get-tsconfig: 4.10.1 + is-bun-module: 2.0.0 + stable-hash: 0.0.5 + tinyglobby: 0.2.14 + unrs-resolver: 1.7.11 + optionalDependencies: + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)) + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@8.10.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.33.1(eslint@8.10.0)(typescript@5.8.3) eslint: 8.10.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0)(eslint@8.10.0) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@9.28.0(jiti@2.4.2)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3) eslint: 9.28.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.31.0)(eslint@9.28.0(jiti@2.4.2)) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0))(eslint@8.10.0): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -17757,9 +17736,9 @@ snapshots: array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.10.0 + eslint: 9.28.0(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0))(eslint@8.10.0))(eslint@8.10.0) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@9.28.0(jiti@2.4.2)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -17771,13 +17750,13 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.33.1(eslint@8.10.0)(typescript@5.8.3) + '@typescript-eslint/parser': 8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint@8.10.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -17786,9 +17765,9 @@ snapshots: array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.28.0(jiti@2.4.2) + eslint: 8.10.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.33.1(eslint@8.10.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@8.10.0) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -17800,7 +17779,7 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3) + '@typescript-eslint/parser': 8.33.1(eslint@8.10.0)(typescript@5.8.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -19261,6 +19240,10 @@ snapshots: react: 19.1.0 react-dom: 19.1.0(react@19.1.0) + next-transpile-modules@10.0.1: + dependencies: + enhanced-resolve: 5.18.1 + next@15.3.2(@babel/core@7.27.4)(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.0.0-rc-66855b96-20241106(react@19.0.0-rc-66855b96-20241106))(react@19.0.0-rc-66855b96-20241106): dependencies: '@next/env': 15.3.2 @@ -20175,10 +20158,6 @@ snapshots: '@babel/runtime': 7.27.6 react: 19.1.0 - react-hook-form@7.57.0(react@19.1.0): - dependencies: - react: 19.1.0 - react-hook-form@7.58.0(react@19.1.0): dependencies: react: 19.1.0 diff --git a/public/locales/en/account.json b/public/locales/en/account.json index 4718a9b..b262c7f 100644 --- a/public/locales/en/account.json +++ b/public/locales/en/account.json @@ -122,5 +122,10 @@ "consentToAnonymizedCompanyData": { "label": "Consent to be included in employer statistics", "description": "Consent to be included in anonymized company statistics" + }, + "analysisResults": { + "pageTitle": "My analysis results", + "description": "Super, oled käinud tervist kontrollimas. Siin on sinule olulised näitajad:", + "orderNewAnalysis": "Telli uued analüüsid" } -} \ No newline at end of file +} diff --git a/public/locales/et/account.json b/public/locales/et/account.json index ade6520..1c28173 100644 --- a/public/locales/et/account.json +++ b/public/locales/et/account.json @@ -145,5 +145,10 @@ "successTitle": "Tere, {{firstName}} {{lastName}}", "successDescription": "Teie tervisekonto on aktiveeritud ja kasutamiseks valmis!", "successButton": "Jätka" + }, + "analysisResults": { + "pageTitle": "Minu analüüside vastused", + "description": "Super, oled käinud tervist kontrollimas. Siin on sinule olulised näitajad:", + "orderNewAnalysis": "Telli uued analüüsid" } } diff --git a/public/locales/ru/account.json b/public/locales/ru/account.json index cee69b4..04eb229 100644 --- a/public/locales/ru/account.json +++ b/public/locales/ru/account.json @@ -119,5 +119,8 @@ "consentToAnonymizedCompanyData": { "label": "Consent to be included in employer statistics", "description": "Consent to be included in anonymized company statistics" + }, + "analysisResults": { + "pageTitle": "My analysis results" } -} \ No newline at end of file +} diff --git a/supabase/migrations/20250616142604_add_connected_online_tables.sql b/supabase/migrations/20250616142604_add_connected_online_tables.sql index 74f701a..890eb2b 100644 --- a/supabase/migrations/20250616142604_add_connected_online_tables.sql +++ b/supabase/migrations/20250616142604_add_connected_online_tables.sql @@ -1,227 +1,227 @@ -create table "public"."connected_online_providers" ( - "id" bigint not null, - "name" text not null, - "email" text, - "phone_number" text, - "can_select_worker" boolean not null, - "personal_code_required" boolean not null, - "created_at" timestamp with time zone not null default now(), - "updated_at" timestamp without time zone default now() -); +-- create table "public"."connected_online_providers" ( +-- "id" bigint not null, +-- "name" text not null, +-- "email" text, +-- "phone_number" text, +-- "can_select_worker" boolean not null, +-- "personal_code_required" boolean not null, +-- "created_at" timestamp with time zone not null default now(), +-- "updated_at" timestamp without time zone default now() +-- ); -alter table "public"."connected_online_providers" enable row level security; +-- alter table "public"."connected_online_providers" enable row level security; -create table "public"."connected_online_services" ( - "id" bigint not null, - "clinic_id" bigint not null, - "sync_id" bigint not null, - "name" text not null, - "description" text, - "price" double precision not null, - "requires_payment" boolean not null, - "duration" bigint not null, - "neto_duration" bigint, - "display" text, - "price_periods" text, - "online_hide_duration" bigint, - "online_hide_price" bigint, - "code" text not null, - "has_free_codes" boolean not null, - "created_at" timestamp with time zone not null default now(), - "updated_at" timestamp with time zone default now() -); +-- create table "public"."connected_online_services" ( +-- "id" bigint not null, +-- "clinic_id" bigint not null, +-- "sync_id" bigint not null, +-- "name" text not null, +-- "description" text, +-- "price" double precision not null, +-- "requires_payment" boolean not null, +-- "duration" bigint not null, +-- "neto_duration" bigint, +-- "display" text, +-- "price_periods" text, +-- "online_hide_duration" bigint, +-- "online_hide_price" bigint, +-- "code" text not null, +-- "has_free_codes" boolean not null, +-- "created_at" timestamp with time zone not null default now(), +-- "updated_at" timestamp with time zone default now() +-- ); -alter table "public"."connected_online_services" enable row level security; +-- alter table "public"."connected_online_services" enable row level security; -CREATE UNIQUE INDEX connected_online_providers_id_key ON public.connected_online_providers USING btree (id); +-- CREATE UNIQUE INDEX connected_online_providers_id_key ON public.connected_online_providers USING btree (id); -CREATE UNIQUE INDEX connected_online_providers_pkey ON public.connected_online_providers USING btree (id); +-- CREATE UNIQUE INDEX connected_online_providers_pkey ON public.connected_online_providers USING btree (id); -CREATE UNIQUE INDEX connected_online_services_id_key ON public.connected_online_services USING btree (id); +-- CREATE UNIQUE INDEX connected_online_services_id_key ON public.connected_online_services USING btree (id); -CREATE UNIQUE INDEX connected_online_services_pkey ON public.connected_online_services USING btree (id); +-- CREATE UNIQUE INDEX connected_online_services_pkey ON public.connected_online_services USING btree (id); -alter table "public"."connected_online_providers" add constraint "connected_online_providers_pkey" PRIMARY KEY using index "connected_online_providers_pkey"; +-- alter table "public"."connected_online_providers" add constraint "connected_online_providers_pkey" PRIMARY KEY using index "connected_online_providers_pkey"; -alter table "public"."connected_online_services" add constraint "connected_online_services_pkey" PRIMARY KEY using index "connected_online_services_pkey"; +-- alter table "public"."connected_online_services" add constraint "connected_online_services_pkey" PRIMARY KEY using index "connected_online_services_pkey"; -alter table "public"."connected_online_providers" add constraint "connected_online_providers_id_key" UNIQUE using index "connected_online_providers_id_key"; +-- alter table "public"."connected_online_providers" add constraint "connected_online_providers_id_key" UNIQUE using index "connected_online_providers_id_key"; -alter table "public"."connected_online_services" add constraint "connected_online_services_clinic_id_fkey" FOREIGN KEY (clinic_id) REFERENCES connected_online_providers(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."connected_online_services" add constraint "connected_online_services_clinic_id_fkey" FOREIGN KEY (clinic_id) REFERENCES connected_online_providers(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."connected_online_services" validate constraint "connected_online_services_clinic_id_fkey"; +-- alter table "public"."connected_online_services" validate constraint "connected_online_services_clinic_id_fkey"; -alter table "public"."connected_online_services" add constraint "connected_online_services_id_key" UNIQUE using index "connected_online_services_id_key"; +-- alter table "public"."connected_online_services" add constraint "connected_online_services_id_key" UNIQUE using index "connected_online_services_id_key"; -grant delete on table "public"."connected_online_providers" to "service_role"; +-- grant delete on table "public"."connected_online_providers" to "service_role"; -grant insert on table "public"."connected_online_providers" to "service_role"; +-- grant insert on table "public"."connected_online_providers" to "service_role"; -grant references on table "public"."connected_online_providers" to "service_role"; +-- grant references on table "public"."connected_online_providers" to "service_role"; -grant select on table "public"."connected_online_providers" to "service_role"; +-- grant select on table "public"."connected_online_providers" to "service_role"; -grant trigger on table "public"."connected_online_providers" to "service_role"; +-- grant trigger on table "public"."connected_online_providers" to "service_role"; -grant truncate on table "public"."connected_online_providers" to "service_role"; +-- grant truncate on table "public"."connected_online_providers" to "service_role"; -grant update on table "public"."connected_online_providers" to "service_role"; +-- grant update on table "public"."connected_online_providers" to "service_role"; -grant select on table "public"."connected_online_providers" to "authenticated"; +-- grant select on table "public"."connected_online_providers" to "authenticated"; -grant delete on table "public"."connected_online_services" to "service_role"; +-- grant delete on table "public"."connected_online_services" to "service_role"; -grant insert on table "public"."connected_online_services" to "service_role"; +-- grant insert on table "public"."connected_online_services" to "service_role"; -grant references on table "public"."connected_online_services" to "service_role"; +-- grant references on table "public"."connected_online_services" to "service_role"; -grant select on table "public"."connected_online_services" to "service_role"; +-- grant select on table "public"."connected_online_services" to "service_role"; -grant trigger on table "public"."connected_online_services" to "service_role"; +-- grant trigger on table "public"."connected_online_services" to "service_role"; -grant truncate on table "public"."connected_online_services" to "service_role"; +-- grant truncate on table "public"."connected_online_services" to "service_role"; -grant update on table "public"."connected_online_services" to "service_role"; +-- grant update on table "public"."connected_online_services" to "service_role"; -grant select on table "public"."connected_online_services" to "authenticated"; +-- grant select on table "public"."connected_online_services" to "authenticated"; -create type "audit"."request_status" as enum ('SUCCESS', 'FAIL'); +-- create type "audit"."request_status" as enum ('SUCCESS', 'FAIL'); -create table "audit"."request_entries" ( - "id" bigint generated by default as identity not null, - "personal_code" bigint, - "request_api" text not null, - "request_api_method" text not null, - "status" audit.request_status not null, - "comment" text, - "service_provider_id" bigint, - "service_id" bigint, - "requested_start_date" timestamp with time zone, - "requested_end_date" timestamp with time zone, - "created_at" timestamp with time zone not null default now() -); +-- create table "audit"."request_entries" ( +-- "id" bigint generated by default as identity not null, +-- "personal_code" bigint, +-- "request_api" text not null, +-- "request_api_method" text not null, +-- "status" audit.request_status not null, +-- "comment" text, +-- "service_provider_id" bigint, +-- "service_id" bigint, +-- "requested_start_date" timestamp with time zone, +-- "requested_end_date" timestamp with time zone, +-- "created_at" timestamp with time zone not null default now() +-- ); -alter table "audit"."request_entries" enable row level security; +-- alter table "audit"."request_entries" enable row level security; -CREATE UNIQUE INDEX request_entries_pkey ON audit.request_entries USING btree (id); +-- CREATE UNIQUE INDEX request_entries_pkey ON audit.request_entries USING btree (id); -alter table "audit"."request_entries" add constraint "request_entries_pkey" PRIMARY KEY using index "request_entries_pkey"; +-- alter table "audit"."request_entries" add constraint "request_entries_pkey" PRIMARY KEY using index "request_entries_pkey"; -grant delete on table "audit"."request_entries" to "service_role"; +-- grant delete on table "audit"."request_entries" to "service_role"; -grant insert on table "audit"."request_entries" to "service_role"; +-- grant insert on table "audit"."request_entries" to "service_role"; -grant references on table "audit"."request_entries" to "service_role"; +-- grant references on table "audit"."request_entries" to "service_role"; -grant select on table "audit"."request_entries" to "service_role"; +-- grant select on table "audit"."request_entries" to "service_role"; -grant trigger on table "audit"."request_entries" to "service_role"; +-- grant trigger on table "audit"."request_entries" to "service_role"; -grant truncate on table "audit"."request_entries" to "service_role"; +-- grant truncate on table "audit"."request_entries" to "service_role"; -grant update on table "audit"."request_entries" to "service_role"; +-- grant update on table "audit"."request_entries" to "service_role"; -create policy "service_role_all" -on "audit"."request_entries" -as permissive -for all -to service_role -using (true); +-- create policy "service_role_all" +-- on "audit"."request_entries" +-- as permissive +-- for all +-- to service_role +-- using (true); -create table "public"."connected_online_reservation" ( - "id" bigint generated by default as identity not null, - "user_id" uuid not null, - "booking_code" text not null, - "service_id" bigint not null, - "clinic_id" bigint not null, - "service_user_id" bigint, - "sync_user_id" bigint not null, - "requires_payment" boolean not null, - "comments" text, - "start_time" timestamp with time zone not null, - "lang" text not null, - "discount_code" text, - "created_at" timestamp with time zone not null default now(), - "updated_at" timestamp with time zone default now() -); +-- create table "public"."connected_online_reservation" ( +-- "id" bigint generated by default as identity not null, +-- "user_id" uuid not null, +-- "booking_code" text not null, +-- "service_id" bigint not null, +-- "clinic_id" bigint not null, +-- "service_user_id" bigint, +-- "sync_user_id" bigint not null, +-- "requires_payment" boolean not null, +-- "comments" text, +-- "start_time" timestamp with time zone not null, +-- "lang" text not null, +-- "discount_code" text, +-- "created_at" timestamp with time zone not null default now(), +-- "updated_at" timestamp with time zone default now() +-- ); -alter table "public"."connected_online_reservation" enable row level security; +-- alter table "public"."connected_online_reservation" enable row level security; -CREATE UNIQUE INDEX connected_online_reservation_booking_code_key ON public.connected_online_reservation USING btree (booking_code); +-- CREATE UNIQUE INDEX connected_online_reservation_booking_code_key ON public.connected_online_reservation USING btree (booking_code); -CREATE UNIQUE INDEX connected_online_reservation_pkey ON public.connected_online_reservation USING btree (id); +-- CREATE UNIQUE INDEX connected_online_reservation_pkey ON public.connected_online_reservation USING btree (id); -alter table "public"."connected_online_reservation" add constraint "connected_online_reservation_pkey" PRIMARY KEY using index "connected_online_reservation_pkey"; +-- alter table "public"."connected_online_reservation" add constraint "connected_online_reservation_pkey" PRIMARY KEY using index "connected_online_reservation_pkey"; -alter table "public"."connected_online_reservation" add constraint "connected_online_reservation_booking_code_key" UNIQUE using index "connected_online_reservation_booking_code_key"; +-- alter table "public"."connected_online_reservation" add constraint "connected_online_reservation_booking_code_key" UNIQUE using index "connected_online_reservation_booking_code_key"; -alter table "public"."connected_online_reservation" add constraint "connected_online_reservation_user_id_fkey" FOREIGN KEY (user_id) REFERENCES auth.users(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."connected_online_reservation" add constraint "connected_online_reservation_user_id_fkey" FOREIGN KEY (user_id) REFERENCES auth.users(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."connected_online_reservation" validate constraint "connected_online_reservation_user_id_fkey"; +-- alter table "public"."connected_online_reservation" validate constraint "connected_online_reservation_user_id_fkey"; -grant delete on table "public"."connected_online_reservation" to "service_role"; +-- grant delete on table "public"."connected_online_reservation" to "service_role"; -grant insert on table "public"."connected_online_reservation" to "service_role"; +-- grant insert on table "public"."connected_online_reservation" to "service_role"; -grant references on table "public"."connected_online_reservation" to "service_role"; +-- grant references on table "public"."connected_online_reservation" to "service_role"; -grant select on table "public"."connected_online_reservation" to "service_role"; +-- grant select on table "public"."connected_online_reservation" to "service_role"; -grant trigger on table "public"."connected_online_reservation" to "service_role"; +-- grant trigger on table "public"."connected_online_reservation" to "service_role"; -grant truncate on table "public"."connected_online_reservation" to "service_role"; +-- grant truncate on table "public"."connected_online_reservation" to "service_role"; -grant update on table "public"."connected_online_reservation" to "service_role"; +-- grant update on table "public"."connected_online_reservation" to "service_role"; -create policy "service_role_all" -on "public"."connected_online_reservation" -as permissive -for all -to service_role -using (true); +-- create policy "service_role_all" +-- on "public"."connected_online_reservation" +-- as permissive +-- for all +-- to service_role +-- using (true); -CREATE TRIGGER connected_online_providers_change_record_timestamps AFTER INSERT OR UPDATE ON public.connected_online_providers FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamps(); +-- CREATE TRIGGER connected_online_providers_change_record_timestamps AFTER INSERT OR UPDATE ON public.connected_online_providers FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamps(); -CREATE TRIGGER connected_online_services_change_record_timestamps AFTER INSERT OR UPDATE ON public.connected_online_services FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamps(); +-- CREATE TRIGGER connected_online_services_change_record_timestamps AFTER INSERT OR UPDATE ON public.connected_online_services FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamps(); -create policy "service_role_all" -on "public"."connected_online_providers" -as permissive -for all -to service_role -using (true); +-- create policy "service_role_all" +-- on "public"."connected_online_providers" +-- as permissive +-- for all +-- to service_role +-- using (true); -create policy "service_role_all" -on "public"."connected_online_services" -as permissive -for all -to service_role -using (true); +-- create policy "service_role_all" +-- on "public"."connected_online_services" +-- as permissive +-- for all +-- to service_role +-- using (true); -create policy "authenticated_select" -on "public"."connected_online_providers" -as permissive -for select -to authenticated -using (true); +-- create policy "authenticated_select" +-- on "public"."connected_online_providers" +-- as permissive +-- for select +-- to authenticated +-- using (true); -create policy "authenticated_select" -on "public"."connected_online_services" -as permissive -for select -to authenticated -using (true); +-- create policy "authenticated_select" +-- on "public"."connected_online_services" +-- as permissive +-- for select +-- to authenticated +-- using (true); -create policy "own_all" -on "public"."connected_online_reservation" -as permissive -for all -to authenticated -using ((( SELECT auth.uid() AS uid) = user_id)); \ No newline at end of file +-- create policy "own_all" +-- on "public"."connected_online_reservation" +-- as permissive +-- for all +-- to authenticated +-- using ((( SELECT auth.uid() AS uid) = user_id)); \ No newline at end of file diff --git a/supabase/migrations/20250619070038_add_medreport_product_tables.sql b/supabase/migrations/20250619070038_add_medreport_product_tables.sql index 938fe6e..d861040 100644 --- a/supabase/migrations/20250619070038_add_medreport_product_tables.sql +++ b/supabase/migrations/20250619070038_add_medreport_product_tables.sql @@ -1,225 +1,225 @@ -create table "public"."medreport_product_groups" ( - "id" bigint generated by default as identity not null, - "name" text not null, - "created_at" timestamp with time zone not null default now(), - "updated_at" timestamp with time zone -); +-- create table "public"."medreport_product_groups" ( +-- "id" bigint generated by default as identity not null, +-- "name" text not null, +-- "created_at" timestamp with time zone not null default now(), +-- "updated_at" timestamp with time zone +-- ); -create table "public"."medreport_products" ( - "id" bigint generated by default as identity not null, - "name" text not null, - "product_group_id" bigint, - "created_at" timestamp with time zone not null default now(), - "updated_at" timestamp with time zone default now() -); +-- create table "public"."medreport_products" ( +-- "id" bigint generated by default as identity not null, +-- "name" text not null, +-- "product_group_id" bigint, +-- "created_at" timestamp with time zone not null default now(), +-- "updated_at" timestamp with time zone default now() +-- ); -alter table "public"."medreport_products" enable row level security; +-- alter table "public"."medreport_products" enable row level security; -create table "public"."medreport_products_analyses_relations" ( - "product_id" bigint not null, - "analysis_element_id" bigint, - "analysis_id" bigint -); +-- create table "public"."medreport_products_analyses_relations" ( +-- "product_id" bigint not null, +-- "analysis_element_id" bigint, +-- "analysis_id" bigint +-- ); -alter table "public"."medreport_product_groups" enable row level security; +-- alter table "public"."medreport_product_groups" enable row level security; -alter table "public"."medreport_products_analyses_relations" enable row level security; +-- alter table "public"."medreport_products_analyses_relations" enable row level security; -CREATE UNIQUE INDEX medreport_product_groups_name_key ON public.medreport_product_groups USING btree (name); +-- CREATE UNIQUE INDEX medreport_product_groups_name_key ON public.medreport_product_groups USING btree (name); -CREATE UNIQUE INDEX medreport_product_groups_pkey ON public.medreport_product_groups USING btree (id); +-- CREATE UNIQUE INDEX medreport_product_groups_pkey ON public.medreport_product_groups USING btree (id); -alter table "public"."medreport_product_groups" add constraint "medreport_product_groups_pkey" PRIMARY KEY using index "medreport_product_groups_pkey"; +-- alter table "public"."medreport_product_groups" add constraint "medreport_product_groups_pkey" PRIMARY KEY using index "medreport_product_groups_pkey"; -alter table "public"."medreport_product_groups" add constraint "medreport_product_groups_name_key" UNIQUE using index "medreport_product_groups_name_key"; +-- alter table "public"."medreport_product_groups" add constraint "medreport_product_groups_name_key" UNIQUE using index "medreport_product_groups_name_key"; -alter table "public"."medreport_products" add constraint "medreport_products_product_groups_id_fkey" FOREIGN KEY (product_group_id) REFERENCES medreport_product_groups(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."medreport_products" add constraint "medreport_products_product_groups_id_fkey" FOREIGN KEY (product_group_id) REFERENCES medreport_product_groups(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."medreport_products" validate constraint "medreport_products_product_groups_id_fkey"; +-- alter table "public"."medreport_products" validate constraint "medreport_products_product_groups_id_fkey"; -grant select on table "public"."medreport_product_groups" to "anon"; +-- grant select on table "public"."medreport_product_groups" to "anon"; -grant select on table "public"."medreport_product_groups" to "authenticated"; +-- grant select on table "public"."medreport_product_groups" to "authenticated"; -grant delete on table "public"."medreport_product_groups" to "service_role"; +-- grant delete on table "public"."medreport_product_groups" to "service_role"; -grant insert on table "public"."medreport_product_groups" to "service_role"; +-- grant insert on table "public"."medreport_product_groups" to "service_role"; -grant references on table "public"."medreport_product_groups" to "service_role"; +-- grant references on table "public"."medreport_product_groups" to "service_role"; -grant select on table "public"."medreport_product_groups" to "service_role"; +-- grant select on table "public"."medreport_product_groups" to "service_role"; -grant trigger on table "public"."medreport_product_groups" to "service_role"; +-- grant trigger on table "public"."medreport_product_groups" to "service_role"; -grant truncate on table "public"."medreport_product_groups" to "service_role"; +-- grant truncate on table "public"."medreport_product_groups" to "service_role"; -grant update on table "public"."medreport_product_groups" to "service_role"; +-- grant update on table "public"."medreport_product_groups" to "service_role"; -CREATE UNIQUE INDEX medreport_products_analyses_analysis_element_id_key ON public.medreport_products_analyses_relations USING btree (analysis_element_id); +-- CREATE UNIQUE INDEX medreport_products_analyses_analysis_element_id_key ON public.medreport_products_analyses_relations USING btree (analysis_element_id); -CREATE UNIQUE INDEX medreport_products_analyses_analysis_id_key ON public.medreport_products_analyses_relations USING btree (analysis_id); +-- CREATE UNIQUE INDEX medreport_products_analyses_analysis_id_key ON public.medreport_products_analyses_relations USING btree (analysis_id); -CREATE UNIQUE INDEX medreport_products_analyses_pkey ON public.medreport_products_analyses_relations USING btree (product_id); +-- CREATE UNIQUE INDEX medreport_products_analyses_pkey ON public.medreport_products_analyses_relations USING btree (product_id); -CREATE UNIQUE INDEX medreport_products_name_key ON public.medreport_products USING btree (name); +-- CREATE UNIQUE INDEX medreport_products_name_key ON public.medreport_products USING btree (name); -CREATE UNIQUE INDEX medreport_products_pkey ON public.medreport_products USING btree (id); +-- CREATE UNIQUE INDEX medreport_products_pkey ON public.medreport_products USING btree (id); -alter table "public"."medreport_products" add constraint "medreport_products_pkey" PRIMARY KEY using index "medreport_products_pkey"; +-- alter table "public"."medreport_products" add constraint "medreport_products_pkey" PRIMARY KEY using index "medreport_products_pkey"; -alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_pkey" PRIMARY KEY using index "medreport_products_analyses_pkey"; +-- alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_pkey" PRIMARY KEY using index "medreport_products_analyses_pkey"; -alter table "public"."medreport_products" add constraint "medreport_products_name_key" UNIQUE using index "medreport_products_name_key"; +-- alter table "public"."medreport_products" add constraint "medreport_products_name_key" UNIQUE using index "medreport_products_name_key"; -alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_element_id_fkey" FOREIGN KEY (analysis_element_id) REFERENCES analysis_elements(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_element_id_fkey" FOREIGN KEY (analysis_element_id) REFERENCES analysis_elements(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."medreport_products_analyses_relations" validate constraint "medreport_products_analyses_analysis_element_id_fkey"; +-- alter table "public"."medreport_products_analyses_relations" validate constraint "medreport_products_analyses_analysis_element_id_fkey"; -alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_element_id_key" UNIQUE using index "medreport_products_analyses_analysis_element_id_key"; +-- alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_element_id_key" UNIQUE using index "medreport_products_analyses_analysis_element_id_key"; -alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_id_fkey" FOREIGN KEY (analysis_id) REFERENCES analyses(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_id_fkey" FOREIGN KEY (analysis_id) REFERENCES analyses(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."medreport_products_analyses_relations" validate constraint "medreport_products_analyses_analysis_id_fkey"; +-- alter table "public"."medreport_products_analyses_relations" validate constraint "medreport_products_analyses_analysis_id_fkey"; -alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_id_key" UNIQUE using index "medreport_products_analyses_analysis_id_key"; +-- alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_analysis_id_key" UNIQUE using index "medreport_products_analyses_analysis_id_key"; -alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_product_id_fkey" FOREIGN KEY (product_id) REFERENCES medreport_products(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."medreport_products_analyses_relations" add constraint "medreport_products_analyses_product_id_fkey" FOREIGN KEY (product_id) REFERENCES medreport_products(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."medreport_products_analyses_relations" validate constraint "medreport_products_analyses_product_id_fkey"; +-- alter table "public"."medreport_products_analyses_relations" validate constraint "medreport_products_analyses_product_id_fkey"; -alter table "public"."medreport_products_analyses_relations" add constraint "product_can_be_tied_to_only_one_external_item" CHECK (((analysis_id IS NULL) OR (analysis_element_id IS NULL))) not valid; +-- alter table "public"."medreport_products_analyses_relations" add constraint "product_can_be_tied_to_only_one_external_item" CHECK (((analysis_id IS NULL) OR (analysis_element_id IS NULL))) not valid; -alter table "public"."medreport_products_analyses_relations" validate constraint "product_can_be_tied_to_only_one_external_item"; +-- alter table "public"."medreport_products_analyses_relations" validate constraint "product_can_be_tied_to_only_one_external_item"; -grant select on table "public"."medreport_products" to "anon"; +-- grant select on table "public"."medreport_products" to "anon"; -grant select on table "public"."medreport_products" to "authenticated"; +-- grant select on table "public"."medreport_products" to "authenticated"; -grant delete on table "public"."medreport_products" to "service_role"; +-- grant delete on table "public"."medreport_products" to "service_role"; -grant insert on table "public"."medreport_products" to "service_role"; +-- grant insert on table "public"."medreport_products" to "service_role"; -grant references on table "public"."medreport_products" to "service_role"; +-- grant references on table "public"."medreport_products" to "service_role"; -grant select on table "public"."medreport_products" to "service_role"; +-- grant select on table "public"."medreport_products" to "service_role"; -grant trigger on table "public"."medreport_products" to "service_role"; +-- grant trigger on table "public"."medreport_products" to "service_role"; -grant truncate on table "public"."medreport_products" to "service_role"; +-- grant truncate on table "public"."medreport_products" to "service_role"; -grant update on table "public"."medreport_products" to "service_role"; +-- grant update on table "public"."medreport_products" to "service_role"; -grant select on table "public"."medreport_products_analyses_relations" to "anon"; +-- grant select on table "public"."medreport_products_analyses_relations" to "anon"; -grant select on table "public"."medreport_products_analyses_relations" to "authenticated"; +-- grant select on table "public"."medreport_products_analyses_relations" to "authenticated"; -grant delete on table "public"."medreport_products_analyses_relations" to "service_role"; +-- grant delete on table "public"."medreport_products_analyses_relations" to "service_role"; -grant insert on table "public"."medreport_products_analyses_relations" to "service_role"; +-- grant insert on table "public"."medreport_products_analyses_relations" to "service_role"; -grant references on table "public"."medreport_products_analyses_relations" to "service_role"; +-- grant references on table "public"."medreport_products_analyses_relations" to "service_role"; -grant select on table "public"."medreport_products_analyses_relations" to "service_role"; +-- grant select on table "public"."medreport_products_analyses_relations" to "service_role"; -grant trigger on table "public"."medreport_products_analyses_relations" to "service_role"; +-- grant trigger on table "public"."medreport_products_analyses_relations" to "service_role"; -grant truncate on table "public"."medreport_products_analyses_relations" to "service_role"; +-- grant truncate on table "public"."medreport_products_analyses_relations" to "service_role"; -grant update on table "public"."medreport_products_analyses_relations" to "service_role"; +-- grant update on table "public"."medreport_products_analyses_relations" to "service_role"; -create policy "Enable read access for all users" -on "public"."medreport_products_analyses_relations" -as permissive -for select -to public -using (true); +-- create policy "Enable read access for all users" +-- on "public"."medreport_products_analyses_relations" +-- as permissive +-- for select +-- to public +-- using (true); -ALTER TABLE medreport_products_analyses_relations -ADD CONSTRAINT product_can_be_tied_to_only_one_analysis_item -CHECK (analysis_id IS NULL OR analysis_element_id IS NULL); +-- ALTER TABLE medreport_products_analyses_relations +-- ADD CONSTRAINT product_can_be_tied_to_only_one_analysis_item +-- CHECK (analysis_id IS NULL OR analysis_element_id IS NULL); -create table "public"."medreport_products_external_services_relations" ( - "product_id" bigint not null, - "connected_online_service_id" bigint not null -); +-- create table "public"."medreport_products_external_services_relations" ( +-- "product_id" bigint not null, +-- "connected_online_service_id" bigint not null +-- ); -alter table "public"."medreport_products_external_services_relations" enable row level security; +-- alter table "public"."medreport_products_external_services_relations" enable row level security; -CREATE UNIQUE INDEX medreport_products_connected_online_services_id_key ON public.medreport_products_external_services_relations USING btree (connected_online_service_id); +-- CREATE UNIQUE INDEX medreport_products_connected_online_services_id_key ON public.medreport_products_external_services_relations USING btree (connected_online_service_id); -CREATE UNIQUE INDEX medreport_products_connected_online_services_pkey ON public.medreport_products_external_services_relations USING btree (connected_online_service_id); +-- CREATE UNIQUE INDEX medreport_products_connected_online_services_pkey ON public.medreport_products_external_services_relations USING btree (connected_online_service_id); -alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_pkey" PRIMARY KEY using index "medreport_products_connected_online_services_pkey"; +-- alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_pkey" PRIMARY KEY using index "medreport_products_connected_online_services_pkey"; -alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_id_fkey" FOREIGN KEY (connected_online_service_id) REFERENCES connected_online_services(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_id_fkey" FOREIGN KEY (connected_online_service_id) REFERENCES connected_online_services(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."medreport_products_external_services_relations" validate constraint "medreport_products_connected_online_services_id_fkey"; +-- alter table "public"."medreport_products_external_services_relations" validate constraint "medreport_products_connected_online_services_id_fkey"; -alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_id_key" UNIQUE using index "medreport_products_connected_online_services_id_key"; +-- alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_id_key" UNIQUE using index "medreport_products_connected_online_services_id_key"; -alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_product_id_fkey" FOREIGN KEY (product_id) REFERENCES medreport_products(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; +-- alter table "public"."medreport_products_external_services_relations" add constraint "medreport_products_connected_online_services_product_id_fkey" FOREIGN KEY (product_id) REFERENCES medreport_products(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; -alter table "public"."medreport_products_external_services_relations" validate constraint "medreport_products_connected_online_services_product_id_fkey"; +-- alter table "public"."medreport_products_external_services_relations" validate constraint "medreport_products_connected_online_services_product_id_fkey"; -grant select on table "public"."medreport_products_external_services_relations" to "anon"; +-- grant select on table "public"."medreport_products_external_services_relations" to "anon"; -grant select on table "public"."medreport_products_external_services_relations" to "authenticated"; +-- grant select on table "public"."medreport_products_external_services_relations" to "authenticated"; -grant delete on table "public"."medreport_products_external_services_relations" to "service_role"; +-- grant delete on table "public"."medreport_products_external_services_relations" to "service_role"; -grant insert on table "public"."medreport_products_external_services_relations" to "service_role"; +-- grant insert on table "public"."medreport_products_external_services_relations" to "service_role"; -grant references on table "public"."medreport_products_external_services_relations" to "service_role"; +-- grant references on table "public"."medreport_products_external_services_relations" to "service_role"; -grant select on table "public"."medreport_products_external_services_relations" to "service_role"; +-- grant select on table "public"."medreport_products_external_services_relations" to "service_role"; -grant trigger on table "public"."medreport_products_external_services_relations" to "service_role"; +-- grant trigger on table "public"."medreport_products_external_services_relations" to "service_role"; -grant truncate on table "public"."medreport_products_external_services_relations" to "service_role"; +-- grant truncate on table "public"."medreport_products_external_services_relations" to "service_role"; -grant update on table "public"."medreport_products_external_services_relations" to "service_role"; +-- grant update on table "public"."medreport_products_external_services_relations" to "service_role"; -CREATE OR REPLACE FUNCTION check_tied_to_connected_online() -RETURNS TRIGGER AS $$ -BEGIN - IF EXISTS ( - SELECT 1 - FROM medreport_products_external_services_relations - WHERE product_id = NEW.product_id - ) THEN - RAISE EXCEPTION 'Value "%" already exists in medreport_products_external_services_relations', NEW.product_id; - END IF; +-- CREATE OR REPLACE FUNCTION check_tied_to_connected_online() +-- RETURNS TRIGGER AS $$ +-- BEGIN +-- IF EXISTS ( +-- SELECT 1 +-- FROM medreport_products_external_services_relations +-- WHERE product_id = NEW.product_id +-- ) THEN +-- RAISE EXCEPTION 'Value "%" already exists in medreport_products_external_services_relations', NEW.product_id; +-- END IF; - RETURN NEW; -END; -$$ LANGUAGE plpgsql; +-- RETURN NEW; +-- END; +-- $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION check_tied_to_analysis_item() -RETURNS TRIGGER AS $$ -BEGIN - IF EXISTS ( - SELECT 1 - FROM medreport_products_analyses_relations - WHERE product_id = NEW.product_id - ) THEN - RAISE EXCEPTION 'Value "%" already exists in medreport_products_analyses_relations', NEW.product_id; - END IF; +-- CREATE OR REPLACE FUNCTION check_tied_to_analysis_item() +-- RETURNS TRIGGER AS $$ +-- BEGIN +-- IF EXISTS ( +-- SELECT 1 +-- FROM medreport_products_analyses_relations +-- WHERE product_id = NEW.product_id +-- ) THEN +-- RAISE EXCEPTION 'Value "%" already exists in medreport_products_analyses_relations', NEW.product_id; +-- END IF; - RETURN NEW; -END; -$$ LANGUAGE plpgsql; +-- RETURN NEW; +-- END; +-- $$ LANGUAGE plpgsql; -CREATE TRIGGER check_not_already_tied_to_connected_online BEFORE INSERT OR UPDATE ON public.medreport_products_analyses_relations FOR EACH ROW EXECUTE FUNCTION check_tied_to_connected_online(); +-- CREATE TRIGGER check_not_already_tied_to_connected_online BEFORE INSERT OR UPDATE ON public.medreport_products_analyses_relations FOR EACH ROW EXECUTE FUNCTION check_tied_to_connected_online(); -CREATE TRIGGER check_not_already_tied_to_analysis BEFORE INSERT OR UPDATE ON public.medreport_products_external_services_relations FOR EACH ROW EXECUTE FUNCTION check_tied_to_analysis_item(); +-- CREATE TRIGGER check_not_already_tied_to_analysis BEFORE INSERT OR UPDATE ON public.medreport_products_external_services_relations FOR EACH ROW EXECUTE FUNCTION check_tied_to_analysis_item(); -create policy "read_all" -on "public"."medreport_product_groups" -as permissive -for select -to public -using (true); +-- create policy "read_all" +-- on "public"."medreport_product_groups" +-- as permissive +-- for select +-- to public +-- using (true); diff --git a/supabase/migrations/20250703145757_add_medreport_schema.sql b/supabase/migrations/20250703145757_add_medreport_schema.sql index 8e66630..7b7ac0e 100644 --- a/supabase/migrations/20250703145757_add_medreport_schema.sql +++ b/supabase/migrations/20250703145757_add_medreport_schema.sql @@ -680,17 +680,17 @@ drop policy "accounts_self_update" on "public"."accounts"; drop policy "create_org_account" on "public"."accounts"; -drop policy "restrict_mfa_accounts" on "public"."accounts"; +-- drop policy "restrict_mfa_accounts" on "public"."accounts"; -drop policy "super_admins_access_accounts" on "public"."accounts"; +-- drop policy "super_admins_access_accounts" on "public"."accounts"; drop policy "accounts_memberships_delete" on "public"."accounts_memberships"; drop policy "accounts_memberships_read" on "public"."accounts_memberships"; -drop policy "restrict_mfa_accounts_memberships" on "public"."accounts_memberships"; +-- drop policy "restrict_mfa_accounts_memberships" on "public"."accounts_memberships"; -drop policy "super_admins_access_accounts_memberships" on "public"."accounts_memberships"; +-- drop policy "super_admins_access_accounts_memberships" on "public"."accounts_memberships"; drop policy "analysis_all" on "public"."analyses"; @@ -742,53 +742,53 @@ drop policy "invitations_read_self" on "public"."invitations"; drop policy "invitations_update" on "public"."invitations"; -drop policy "restrict_mfa_invitations" on "public"."invitations"; +-- drop policy "restrict_mfa_invitations" on "public"."invitations"; -drop policy "super_admins_access_invitations" on "public"."invitations"; +-- drop policy "super_admins_access_invitations" on "public"."invitations"; drop policy "read_all" on "public"."medreport_product_groups"; drop policy "Enable read access for all users" on "public"."medreport_products_analyses_relations"; -drop policy "Users can read their own nonces" on "public"."nonces"; +-- drop policy "Users can read their own nonces" on "public"."nonces"; drop policy "notifications_read_self" on "public"."notifications"; drop policy "notifications_update_self" on "public"."notifications"; -drop policy "restrict_mfa_notifications" on "public"."notifications"; +-- drop policy "restrict_mfa_notifications" on "public"."notifications"; drop policy "order_items_read_self" on "public"."order_items"; -drop policy "restrict_mfa_order_items" on "public"."order_items"; +-- drop policy "restrict_mfa_order_items" on "public"."order_items"; -drop policy "super_admins_access_order_items" on "public"."order_items"; +-- drop policy "super_admins_access_order_items" on "public"."order_items"; drop policy "orders_read_self" on "public"."orders"; -drop policy "restrict_mfa_orders" on "public"."orders"; +-- drop policy "restrict_mfa_orders" on "public"."orders"; -drop policy "super_admins_access_orders" on "public"."orders"; +-- drop policy "super_admins_access_orders" on "public"."orders"; -drop policy "restrict_mfa_role_permissions" on "public"."role_permissions"; +-- drop policy "restrict_mfa_role_permissions" on "public"."role_permissions"; drop policy "role_permissions_read" on "public"."role_permissions"; -drop policy "super_admins_access_role_permissions" on "public"."role_permissions"; +-- drop policy "super_admins_access_role_permissions" on "public"."role_permissions"; drop policy "roles_read" on "public"."roles"; -drop policy "restrict_mfa_subscription_items" on "public"."subscription_items"; +-- drop policy "restrict_mfa_subscription_items" on "public"."subscription_items"; drop policy "subscription_items_read_self" on "public"."subscription_items"; -drop policy "super_admins_access_subscription_items" on "public"."subscription_items"; +-- drop policy "super_admins_access_subscription_items" on "public"."subscription_items"; -drop policy "restrict_mfa_subscriptions" on "public"."subscriptions"; +-- drop policy "restrict_mfa_subscriptions" on "public"."subscriptions"; drop policy "subscriptions_read_self" on "public"."subscriptions"; -drop policy "super_admins_access_subscriptions" on "public"."subscriptions"; +-- drop policy "super_admins_access_subscriptions" on "public"."subscriptions"; alter table "public"."accounts" drop constraint "accounts_created_by_fkey"; @@ -888,7 +888,7 @@ alter table "public"."medreport_products_analyses_relations" drop constraint "pr alter table "public"."medreport_products_analyses_relations" drop constraint "product_can_be_tied_to_only_one_external_item"; -alter table "public"."nonces" drop constraint "nonces_user_id_fkey"; +-- alter table "public"."nonces" drop constraint "nonces_user_id_fkey"; alter table "public"."notifications" drop constraint "notifications_account_id_fkey"; @@ -956,7 +956,7 @@ alter table "public"."medreport_products_analyses_relations" drop constraint "me alter table "public"."medreport_products_external_services_relations" drop constraint "medreport_products_connected_online_services_pkey"; -alter table "public"."nonces" drop constraint "nonces_pkey"; +-- alter table "public"."nonces" drop constraint "nonces_pkey"; alter table "public"."notifications" drop constraint "notifications_pkey"; @@ -5160,47 +5160,47 @@ revoke truncate on table "public"."medreport_products_external_services_relation revoke update on table "public"."medreport_products_external_services_relations" from "service_role"; -revoke delete on table "public"."nonces" from "anon"; +-- revoke delete on table "public"."nonces" from "anon"; -revoke insert on table "public"."nonces" from "anon"; +-- revoke insert on table "public"."nonces" from "anon"; -revoke references on table "public"."nonces" from "anon"; +-- revoke references on table "public"."nonces" from "anon"; -revoke select on table "public"."nonces" from "anon"; +-- revoke select on table "public"."nonces" from "anon"; -revoke trigger on table "public"."nonces" from "anon"; +-- revoke trigger on table "public"."nonces" from "anon"; -revoke truncate on table "public"."nonces" from "anon"; +-- revoke truncate on table "public"."nonces" from "anon"; -revoke update on table "public"."nonces" from "anon"; +-- revoke update on table "public"."nonces" from "anon"; -revoke delete on table "public"."nonces" from "authenticated"; +-- revoke delete on table "public"."nonces" from "authenticated"; -revoke insert on table "public"."nonces" from "authenticated"; +-- revoke insert on table "public"."nonces" from "authenticated"; -revoke references on table "public"."nonces" from "authenticated"; +-- revoke references on table "public"."nonces" from "authenticated"; -revoke select on table "public"."nonces" from "authenticated"; +-- revoke select on table "public"."nonces" from "authenticated"; -revoke trigger on table "public"."nonces" from "authenticated"; +-- revoke trigger on table "public"."nonces" from "authenticated"; -revoke truncate on table "public"."nonces" from "authenticated"; +-- revoke truncate on table "public"."nonces" from "authenticated"; -revoke update on table "public"."nonces" from "authenticated"; +-- revoke update on table "public"."nonces" from "authenticated"; -revoke delete on table "public"."nonces" from "service_role"; +-- revoke delete on table "public"."nonces" from "service_role"; -revoke insert on table "public"."nonces" from "service_role"; +-- revoke insert on table "public"."nonces" from "service_role"; -revoke references on table "public"."nonces" from "service_role"; +-- revoke references on table "public"."nonces" from "service_role"; -revoke select on table "public"."nonces" from "service_role"; +-- revoke select on table "public"."nonces" from "service_role"; -revoke trigger on table "public"."nonces" from "service_role"; +-- revoke trigger on table "public"."nonces" from "service_role"; -revoke truncate on table "public"."nonces" from "service_role"; +-- revoke truncate on table "public"."nonces" from "service_role"; -revoke update on table "public"."nonces" from "service_role"; +-- revoke update on table "public"."nonces" from "service_role"; revoke delete on table "public"."notifications" from "anon"; @@ -5410,7 +5410,7 @@ drop table "public"."medreport_products_analyses_relations"; drop table "public"."medreport_products_external_services_relations"; -drop table "public"."nonces"; +-- drop table "public"."nonces"; drop table "public"."notifications"; diff --git a/supabase/migrations/20250714093625_analysis_responses.sql b/supabase/migrations/20250714093625_analysis_responses.sql new file mode 100644 index 0000000..c445625 --- /dev/null +++ b/supabase/migrations/20250714093625_analysis_responses.sql @@ -0,0 +1,3 @@ +alter table "medreport"."analysis_response_elements" add column "analysis_name" text; + +alter table "medreport"."analysis_response_elements" alter column "response_value" set data type double precision using "response_value"::double precision; \ No newline at end of file diff --git a/supabase/sql/analysis.sql b/supabase/sql/analysis.sql new file mode 100644 index 0000000..8f2fe5d --- /dev/null +++ b/supabase/sql/analysis.sql @@ -0,0 +1,146 @@ +-- Create analysis for /home/analysis-results +INSERT INTO medreport.analysis_groups ( + id, + original_id, + name, + "order", + created_at, + updated_at +) +VALUES ( + 1, -- id + 'GROUP_ORIG_001', -- original_id + 'Blood Tests', -- name + 1, -- order + NOW(), -- created_at + NOW() -- updated_at +); + +INSERT INTO medreport.analysis_elements ( + id, + analysis_id_oid, + analysis_id_original, + tehik_short_loinc, + tehik_loinc_name, + analysis_name_lab, + "order", + created_at, + updated_at, + parent_analysis_group_id, + material_groups +) +VALUES ( + 1, -- id (must match the one used in analyses) + 'OID12345', -- analysis_id_oid + 'ORIG123', -- analysis_id_original + 'LNC123-4', -- tehik_short_loinc + 'Hemoglobiin', -- tehik_loinc_name + 'Hemoglobiin (Lab)', -- analysis_name_lab + 1, -- order + NOW(), -- created_at + NOW(), -- updated_at + 1, -- parent_analysis_group_id + '{}'::jsonb[] -- material_groups (empty array for now) +); + +INSERT INTO medreport.analyses ( + id, + analysis_id_oid, + analysis_id_original, + tehik_short_loinc, + tehik_loinc_name, + analysis_name_lab, + "order", + created_at, + updated_at, + parent_analysis_element_id +) +VALUES ( + 101, -- id + 'OID12345', -- analysis_id_oid + 'ORIG123', -- analysis_id_original + 'LNC123-4', -- tehik_short_loinc + 'Hemoglobiin', -- tehik_loinc_name + 'Hemoglobiin (Lab)', -- analysis_name_lab + 1, -- order + NOW(), -- created_at + NOW(), -- updated_at + 1 -- parent_analysis_element_id +); + + + + + + +INSERT INTO medreport.analysis_orders ( + analysis_element_ids, + analysis_ids, + user_id, + status, + id +) VALUES ( + ARRAY[1, 2, 3], + ARRAY[101, 102], + '8dcb4354-77be-4915-a2cd-8fc573e675d6', + 'COMPLETED', + '10' -- unique id +); + +INSERT INTO medreport.analysis_responses ( + id, + analysis_order_id, + order_number, + order_status, + user_id +) +VALUES ( + '1', -- unique id + '10', -- ID of medreport.analysis_orders + '123', + 'COMPLETED', + '8dcb4354-77be-4915-a2cd-8fc573e675d6' +) +ON CONFLICT (order_number) +DO UPDATE SET + analysis_order_id = EXCLUDED.analysis_order_id, + order_status = EXCLUDED.order_status, + user_id = EXCLUDED.user_id +RETURNING id; + +INSERT INTO medreport.analysis_response_elements ( + id, + analysis_response_id, + analysis_element_original_id, + unit, + response_value, + response_time, + norm_upper, + norm_upper_included, + norm_lower, + norm_lower_included, + norm_status, + original_response_element, + created_at, + updated_at, + analysis_name +) +VALUES + -- Repeat this row for each element + ( + '1000', -- unique id + '1', -- ID of medreport.analysis_responses + '2', + 'g/L', + 146, + NOW()::timestamptz, + 5, + true, + 1, + false, + 3, + '{"original_name": "Hgb", "value": 13.5}'::jsonb, + NOW(), + NOW(), + 'Hematokrit' + ); diff --git a/tsconfig.json b/tsconfig.json index cef03ce..8abaf1e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,16 +3,18 @@ "compilerOptions": { "baseUrl": ".", "paths": { + "@kit/ui/*": ["packages/ui/src/*"], + "@kit/ui": ["packages/ui/src/index.ts"], "@lib/*": ["packages/features/medusa-storefront/src/lib/*"], "@modules/*": ["packages/features/medusa-storefront/src/modules/*"], "@styles/*": ["packages/features/medusa-storefront/src/styles/*"], "types/*": ["packages/features/medusa-storefront/src/types/*"], - "@/*": ["./*"], - "~/*": ["./app/*"], "~/config/*": ["./config/*"], "~/components/*": ["./components/*"], "~/lib/*": ["./lib/*"], - "~/medusa/*": ["./packages/features/medusa-storefront/src/*"] + "~/medusa/*": ["./packages/features/medusa-storefront/src/*"], + "@/*": ["./*"], + "~/*": ["./app/*"] }, "plugins": [ {