diff --git a/webapp/CHANGELOG.md b/webapp/CHANGELOG.md index 0eeee9c7..6782b180 100644 --- a/webapp/CHANGELOG.md +++ b/webapp/CHANGELOG.md @@ -1,3 +1,24 @@ +# [0.67.0](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.66.5...v0.67.0) (2024-11-18) + + +### Bug Fixes + +* add ok/ko to condition block in bo ([0ef3aee](https://github.com/SocialGouv/carte-jeune-engage/commit/0ef3aee5b9dbe6ce9dc81ad48015d55927e6d6b1)) +* dynamic icon io path import ([3b3abd1](https://github.com/SocialGouv/carte-jeune-engage/commit/3b3abd1d93b7be9e3b17a44e05cdf84e6674d150)) +* wording for terms of use in cje offer ([c39ca18](https://github.com/SocialGouv/carte-jeune-engage/commit/c39ca1834b2c4662315df6244ec9d0c06ccab1e2)) + + +### Features + +* refactor conditions blocks for cje and obiz offer ([8cd7934](https://github.com/SocialGouv/carte-jeune-engage/commit/8cd7934b5cfead45591ae36a409a83f7d75d848c)) + +## [0.66.5](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.66.4...v0.66.5) (2024-11-18) + + +### Bug Fixes + +* small minor design issues ([805d361](https://github.com/SocialGouv/carte-jeune-engage/commit/805d361aaf728d0a68f2ba325620180d131a63af)) + ## [0.66.4](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.66.3...v0.66.4) (2024-11-18) ### Bug Fixes diff --git a/webapp/package.json b/webapp/package.json index fbbac558..3b7ad944 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -1,6 +1,6 @@ { "name": "webapp", - "version": "0.66.4", + "version": "0.67.0", "private": true, "scripts": { "dev": "next dev", diff --git a/webapp/src/components/cards/OfferCard.tsx b/webapp/src/components/cards/OfferCard.tsx index 30d2d57c..4399f962 100644 --- a/webapp/src/components/cards/OfferCard.tsx +++ b/webapp/src/components/cards/OfferCard.tsx @@ -8,7 +8,6 @@ import { dottedPattern } from "~/utils/chakra-theme"; import ConditionalLink from "../ConditionalLink"; import ExpiryTag from "../offer/ExpiryTag"; import { BsEyeFill } from "react-icons/bs"; -import Cookies from "js-cookie"; import { ObizCard } from "./ObizCard"; import PartnerImage from "../ui/PartnerImage"; diff --git a/webapp/src/components/offer/ConditionBlocksSection.tsx b/webapp/src/components/offer/ConditionBlocksSection.tsx new file mode 100644 index 00000000..cda690c4 --- /dev/null +++ b/webapp/src/components/offer/ConditionBlocksSection.tsx @@ -0,0 +1,55 @@ +import { Flex, Icon, Text } from "@chakra-ui/react"; +import { HiCheckCircle, HiXCircle } from "react-icons/hi2"; +import { getItemsConditionBlocks } from "~/payload/components/CustomSelectBlocksOfUse"; +import { Offer } from "~/payload/payload-types"; +import { theme } from "~/utils/chakra-theme"; +import ReactIcon from "~/utils/dynamicIcon"; + +const disabledColor = theme.colors["disabled"] as string; + +type ConditionBlocksSectionProps = { + offerConditionBlocks: { text: string; icon: string; isCrossed: boolean }[]; + offerSource: Offer["source"]; +}; + +const ConditionBlocksSection = ({ + offerConditionBlocks, + offerSource, +}: ConditionBlocksSectionProps) => { + return ( + + {offerConditionBlocks.map(({ text, icon, isCrossed }) => { + return ( + + {typeof icon === "string" && ( + + )} + + {text} + + + + ); + })} + + ); +}; + +export default ConditionBlocksSection; diff --git a/webapp/src/components/offer/page/OfferContent.tsx b/webapp/src/components/offer/page/OfferContent.tsx index 24307f58..5bcfb93f 100644 --- a/webapp/src/components/offer/page/OfferContent.tsx +++ b/webapp/src/components/offer/page/OfferContent.tsx @@ -1,34 +1,27 @@ import { Box, Button, - Center, Divider, Flex, HStack, Icon, ListItem, OrderedList, - Tag, Text, UnorderedList, - useDisclosure, } from "@chakra-ui/react"; import { push } from "@socialgouv/matomo-next"; import Image from "next/image"; import { useMemo, useRef, useState } from "react"; -import { HiArrowRight } from "react-icons/hi"; import { HiBookmark, HiMiniEye, HiOutlineBookmark } from "react-icons/hi2"; -import ConfirmModal from "~/components/modals/ConfirmModal"; -import { getItemsConditionBlocks } from "~/payload/components/CustomSelectBlocksOfUse"; import { getItemsTermsOfUse } from "~/payload/components/CustomSelectTermsOfUse"; import { CouponIncluded } from "~/server/api/routers/coupon"; import { OfferIncluded } from "~/server/api/routers/offer"; -import { api } from "~/utils/api"; import { dottedPattern } from "~/utils/chakra-theme"; -import ReactIcon from "~/utils/dynamicIcon"; import InStoreSection from "../InStoreSection"; -import { StackItem } from "../StackItems"; import TextWithLinks from "../TextWithLinks"; +import ConditionBlocksSection from "../ConditionBlocksSection"; +import { getItemsConditionBlocks } from "~/payload/components/CustomSelectBlocksOfUse"; type OfferContentProps = { offer: OfferIncluded; @@ -49,11 +42,18 @@ const OfferContent = (props: OfferContentProps) => { const offerConditionBlocks = useMemo(() => { if (!offer) return []; - return getItemsConditionBlocks(offer.kind).filter((item) => - offer.conditionBlocks - ?.map((conditionBlock) => conditionBlock.slug) - .includes(item.slug) - ) as StackItem[]; + return getItemsConditionBlocks(offer.source) + .filter((conditionBlock) => + offer.conditionBlocks + ?.map((cb) => cb.slug) + .includes(conditionBlock.slug) + ) + .map((conditionBlock) => ({ + ...conditionBlock, + isCrossed: + offer.conditionBlocks?.find((cb) => cb.slug === conditionBlock.slug) + ?.isCrossed ?? false, + })); }, [offer]); const itemsTermsOfUse = useMemo(() => { @@ -101,77 +101,12 @@ const OfferContent = (props: OfferContentProps) => { )} {offerConditionBlocks.length > 0 && ( - - {offerConditionBlocks.map(({ text, icon }, index) => ( - - - - {typeof icon === "string" && ( - - )} - - - {text} - - - ))} -
- { - setIsConditionsOpen(true); - conditionsRef.current?.scrollIntoView({ - behavior: "smooth", - }); - }} - > - Lire toutes -
- les conditions{" "} - -
-
-
+ + + )} {offer.kind.startsWith("voucher") && ( diff --git a/webapp/src/pages/dashboard/offer/obiz/[id]/index.tsx b/webapp/src/pages/dashboard/offer/obiz/[id]/index.tsx index f2663338..25433c7f 100644 --- a/webapp/src/pages/dashboard/offer/obiz/[id]/index.tsx +++ b/webapp/src/pages/dashboard/offer/obiz/[id]/index.tsx @@ -1,5 +1,4 @@ import { - Box, Button, Center, Divider, @@ -19,14 +18,13 @@ import { useEffect, useMemo, useState } from "react"; import { BarcodeIcon } from "~/components/icons/barcode"; import LoadingLoader from "~/components/LoadingLoader"; import ObizOrderProcessModal from "~/components/modals/ObizOrderProcessModal"; -import { StackItem } from "~/components/offer/StackItems"; +import ConditionBlocksSection from "~/components/offer/ConditionBlocksSection"; import BackButton from "~/components/ui/BackButton"; import Image from "~/components/ui/Image"; import PartnerImage from "~/components/ui/PartnerImage"; import { getItemsConditionBlocks } from "~/payload/components/CustomSelectBlocksOfUse"; import { getItemsTermsOfUse } from "~/payload/components/CustomSelectTermsOfUse"; import { api } from "~/utils/api"; -import ReactIcon from "~/utils/dynamicIcon"; import { cleanHtml } from "~/utils/tools"; type OfferObizPageProps = { @@ -52,14 +50,25 @@ export default function OfferObizPage({ offer_id }: OfferObizPageProps) { const { data: offer } = resultOffer || {}; - const itemsTermsOfUse = useMemo(() => { + const offerConditionBlocks = useMemo(() => { if (!offer) return []; - return getItemsTermsOfUse(offer.kind); + return getItemsConditionBlocks(offer.source) + .filter((conditionBlock) => + offer.conditionBlocks + ?.map((cb) => cb.slug) + .includes(conditionBlock.slug) + ) + .map((conditionBlock) => ({ + ...conditionBlock, + isCrossed: + offer.conditionBlocks?.find((cb) => cb.slug === conditionBlock.slug) + ?.isCrossed ?? false, + })); }, [offer]); - const offerConditionBlocks = useMemo(() => { + const itemsTermsOfUse = useMemo(() => { if (!offer) return []; - return getItemsConditionBlocks(offer.kind) as StackItem[]; + return getItemsTermsOfUse(offer.kind); }, [offer]); const onRedirectPayment = () => { @@ -153,52 +162,10 @@ export default function OfferObizPage({ offer_id }: OfferObizPageProps) { Acheter un bon - {offerConditionBlocks.length > 0 && ( - - {offerConditionBlocks.map(({ text, icon }, index) => ( - - - - {typeof icon === "string" && ( - - )} - - - {text} - - - ))} - - )} + diff --git a/webapp/src/payload/collections/Offer.ts b/webapp/src/payload/collections/Offer.ts index 6e1d6933..4e586a68 100644 --- a/webapp/src/payload/collections/Offer.ts +++ b/webapp/src/payload/collections/Offer.ts @@ -287,10 +287,6 @@ export const Offers: CollectionConfig = { singular: "Condition Bloc", plural: "Condition Blocs", }, - admin: { - condition: (_, siblingData) => - !!siblingData.source && siblingData.source === "cje", - }, fields: [ { name: "slug", @@ -301,7 +297,11 @@ export const Offers: CollectionConfig = { Field: CustomSelectConditionBlocks, }, }, - required: true, + }, + { + name: "isCrossed", + type: "checkbox", + label: "Barré", }, ], }, diff --git a/webapp/src/payload/components/CustomSelectBlocksOfUse.tsx b/webapp/src/payload/components/CustomSelectBlocksOfUse.tsx index f158063a..010e0dfe 100644 --- a/webapp/src/payload/components/CustomSelectBlocksOfUse.tsx +++ b/webapp/src/payload/components/CustomSelectBlocksOfUse.tsx @@ -1,84 +1,49 @@ import { SelectInput, useField, useFormFields } from "payload/components/forms"; -import { Offer } from "../payload-types"; import React from "react"; +import { Offer } from "../payload-types"; -export const getItemsConditionBlocks = (offerKind: Offer["kind"]) => { - const items: { text: string; slug: string; icon: string }[] = []; - - if (offerKind === "code_obiz") { - return [ - { - text: "en magasin uniquement", - slug: "go-to-store", - icon: "HiBuildingStorefront", - }, - { - text: "utilisable en plusieurs fois", - slug: "usable-in-parts", - icon: "HiRectangleStack", - }, - { - text: "cumulable avec carte ou espèce", - slug: "cumulative-with-other-payment-methods", - icon: "HiCreditCard", - }, - { - text: "cumulable avec d'autres bons", - slug: "cumulative-with-other-codes", - icon: "BsCashStack", - }, - ]; - } +export const getItemsConditionBlocks = (source: Offer["source"]) => { + const cjeSpecificConditions = [ + { + text: "Offre valable 1 seule fois", + slug: "one-time", + icon: "HiMiniEye", + }, + { + text: "Offre utilisable à l'infini", + slug: "all-time", + icon: "TiInfinity", + }, + ]; - let defaultItems = [ + return [ + { + text: "Utilisable en magasin", + slug: "go-to-store", + icon: "HiBuildingStorefront", + }, { - text: "en ligne ou en magasin", - slug: "use-link-or-go-to-store", + text: "Utilisable en ligne", + slug: "use-link", icon: "HiCursorArrowRays", }, { - text: "réservé aux nouveaux clients", - slug: "new-customers", - icon: "HiUser", + text: "Utilisable en plusieurs fois", + slug: "usable-in-parts", + icon: "HiRectangleStack", }, + ...(source === "cje" ? cjeSpecificConditions : []), { - text: "valable 1 seule fois", - slug: "one-time", - icon: "HiMiniEye", + text: "Cumulable avec d’autres moyens de paiement", + slug: "cumulative-with-other-payment-methods", + icon: "HiCreditCard", }, { - text: "valable tout le temps", - slug: "all-time", - icon: "HiOutlineInformationCircle", + text: "Cumulable avec d’autres bons", + slug: "cumulative-with-other-codes", + icon: "BsCashStack", }, ]; - - if (offerKind.startsWith("code")) { - items.push( - { - text: "en ligne uniquement", - slug: "use-link", - icon: "HiCursorArrowRays", - }, - ...defaultItems - ); - } else { - items.push( - { - text: "en magasin uniquement", - slug: "go-to-store", - icon: "HiBuildingStorefront", - }, - { - text: "uniquement sur certains produits", - slug: "specific-products", - icon: "HiShoppingCart", - }, - ...defaultItems - ); - } - - return items; }; export const CustomSelectConditionBlocks: React.FC<{ path: string }> = ({ @@ -89,17 +54,19 @@ export const CustomSelectConditionBlocks: React.FC<{ path: string }> = ({ { label: string; value: string }[] >([]); - const offerKind = useFormFields(([fields, _]) => fields.kind); + const offerSource = useFormFields(([fields, _]) => fields.kind); + + console.log("offerSource", offerSource); React.useEffect(() => { const tmpOptions = getItemsConditionBlocks( - offerKind?.value as Offer["kind"] + offerSource.value as Offer["source"] ).map((item) => ({ label: item.text, value: item.slug, })); setOptions(tmpOptions); - }, [offerKind]); + }, [offerSource]); return (
diff --git a/webapp/src/payload/components/CustomSelectTermsOfUse.tsx b/webapp/src/payload/components/CustomSelectTermsOfUse.tsx index c8881c27..2175c5d4 100644 --- a/webapp/src/payload/components/CustomSelectTermsOfUse.tsx +++ b/webapp/src/payload/components/CustomSelectTermsOfUse.tsx @@ -27,68 +27,81 @@ export const getItemsTermsOfUse = (offerKind: Offer["kind"]) => { } if (offerKind.startsWith("code")) { - const defaultCodeItems = [ - { - text: 'Cliquez sur "Voir le code"', - slug: "use-link", - icon: "HiLink", - }, - { - text: "On vous emmène sur le bon site", - slug: "accept-cookies", - icon: "HiCheckBadge", - }, - ]; - if (offerKind === "code") { - items.push(...defaultCodeItems, { - text: "Dès qu’il faut mettre le code carte “jeune engagé” on vous prévient 🙂", - slug: "paste-code", - icon: "FiCopy", - }); + items.push( + { + text: "Affichez votre code", + slug: "use-link", + icon: "HiLink", + }, + { + text: "Ouvrez le lien qui se trouve sous votre code", + slug: "accept-cookies", + icon: "HiCheckBadge", + }, + { + text: "Sur le site du partenaire collez le code au moment où on vous le demande", + slug: "paste-code", + icon: "FiCopy", + } + ); } else if (offerKind === "code_space") { - items.push(...defaultCodeItems, { - text: "Vous n’avez plus qu’à acheter ce qu’il vous faut", - slug: "no-code", - icon: "HiLockClosed", - }); + items.push( + { + text: "Affichez votre lien", + slug: "use-link", + icon: "HiLink", + }, + { + text: "Ouvrez le lien qui s’affiche sous le code", + slug: "accept-cookies", + icon: "HiCheckBadge", + }, + { + text: "Le lien contient déjà la réduction, pas besoin de code ici", + slug: "no-code", + icon: "HiLockClosed", + } + ); } } else { const defaultVoucherItems = [ { - text: "Cliquez sur “Voir le code”", + text: "Affichez votre code", slug: "go-to-store", icon: "MdOutlineDirectionsWalk", }, { - text: "Rendez-vous dans un des magasins participants", + text: "Rendez-vous dans un magasin participant", slug: "buy-items", icon: "HiShoppingCart", }, - { - text: "Achetez les articles correspondants à la réduction", - slug: "scan-barcode", - icon: "HiReceiptPercent", - }, - { - text: "Au moment de payer, scannez votre code barre en caisse", - slug: "show-pass", - icon: "PassIcon", - }, ]; if (offerKind === "voucher") { - items.push(...defaultVoucherItems); + items.push( + ...defaultVoucherItems, + { + text: "Vérifiez que vos articles sont éligibles à la réduction", + slug: "check-eligibility", + icon: "HiReceiptPercent", + }, + { + text: "Avant de payer en caisse, scannez votre code", + slug: "scan-code", + icon: "PassIcon", + } + ); } else if (offerKind === "voucher_pass") { items.push( - ...defaultVoucherItems.filter((item) => item.slug === "buy-items"), + ...defaultVoucherItems, { - text: 'Cliquez sur "présenter ma carte"', + text: "Avant de payer en caisse, montrez votre carte virtuelle “jeune engagé”", slug: "show-pass", icon: "PassIcon", }, { - text: "La personne en caisse vous offre la réduction", + text: "La personne en caisse vous fait la réduction", slug: "offer-reduction", icon: "PassIcon", } diff --git a/webapp/src/payload/migrations/20241118_164830.json b/webapp/src/payload/migrations/20241118_164830.json new file mode 100644 index 00000000..101c4430 --- /dev/null +++ b/webapp/src/payload/migrations/20241118_164830.json @@ -0,0 +1,4327 @@ +{ + "id": "03031c54-ae21-4682-aab6-4e74174161a6", + "prevId": "00000000-0000-0000-0000-000000000000", + "version": "5", + "dialect": "pg", + "tables": { + "admins": { + "name": "admins", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "first_name": { + "name": "first_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "last_name": { + "name": "last_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "reset_password_token": { + "name": "reset_password_token", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reset_password_expiration": { + "name": "reset_password_expiration", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "salt": { + "name": "salt", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "hash": { + "name": "hash", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "login_attempts": { + "name": "login_attempts", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "lock_until": { + "name": "lock_until", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "admins_created_at_idx": { + "name": "admins_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "admins_email_idx": { + "name": "admins_email_idx", + "columns": [ + "email" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "phone_number": { + "name": "phone_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "civility": { + "name": "civility", + "type": "enum_users_civility", + "primaryKey": false, + "notNull": false + }, + "birth_date": { + "name": "birth_date", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "first_name": { + "name": "first_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "last_name": { + "name": "last_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "user_email": { + "name": "user_email", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "cejFrom": { + "name": "cejFrom", + "type": "enum_users_cej_from", + "primaryKey": false, + "notNull": false + }, + "timeAtCEJ": { + "name": "timeAtCEJ", + "type": "enum_users_time_at_c_e_j", + "primaryKey": false, + "notNull": false + }, + "hasAJobIdea": { + "name": "hasAJobIdea", + "type": "enum_users_has_a_job_idea", + "primaryKey": false, + "notNull": false + }, + "project_title": { + "name": "project_title", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "project_description": { + "name": "project_description", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "status_image": { + "name": "status_image", + "type": "enum_users_status_image", + "primaryKey": false, + "notNull": false + }, + "notification_status": { + "name": "notification_status", + "type": "enum_users_notification_status", + "primaryKey": false, + "notNull": false + }, + "notification_subscription": { + "name": "notification_subscription", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "otp_request_token": { + "name": "otp_request_token", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "cej_id": { + "name": "cej_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "reset_password_token": { + "name": "reset_password_token", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reset_password_expiration": { + "name": "reset_password_expiration", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "salt": { + "name": "salt", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "hash": { + "name": "hash", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "login_attempts": { + "name": "login_attempts", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "lock_until": { + "name": "lock_until", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "users_phone_number_idx": { + "name": "users_phone_number_idx", + "columns": [ + "phone_number" + ], + "isUnique": true + }, + "users_cej_id_idx": { + "name": "users_cej_id_idx", + "columns": [ + "cej_id" + ], + "isUnique": true + }, + "users_created_at_idx": { + "name": "users_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "users_email_idx": { + "name": "users_email_idx", + "columns": [ + "email" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "users_rels": { + "name": "users_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tags_id": { + "name": "tags_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "users_rels_order_idx": { + "name": "users_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "users_rels_parent_idx": { + "name": "users_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "users_rels_path_idx": { + "name": "users_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "users_rels_parent_id_users_id_fk": { + "name": "users_rels_parent_id_users_id_fk", + "tableFrom": "users_rels", + "tableTo": "users", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "users_rels_media_id_media_id_fk": { + "name": "users_rels_media_id_media_id_fk", + "tableFrom": "users_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "users_rels_tags_id_tags_id_fk": { + "name": "users_rels_tags_id_tags_id_fk", + "tableFrom": "users_rels", + "tableTo": "tags", + "columnsFrom": [ + "tags_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "supervisors": { + "name": "supervisors", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "cgu": { + "name": "cgu", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "enum_supervisors_kind", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "reset_password_token": { + "name": "reset_password_token", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reset_password_expiration": { + "name": "reset_password_expiration", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "salt": { + "name": "salt", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "hash": { + "name": "hash", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "login_attempts": { + "name": "login_attempts", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "lock_until": { + "name": "lock_until", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "supervisors_created_at_idx": { + "name": "supervisors_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "supervisors_email_idx": { + "name": "supervisors_email_idx", + "columns": [ + "email" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "permissions": { + "name": "permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "phone_number": { + "name": "phone_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "supervisorKind": { + "name": "supervisorKind", + "type": "enum_permissions_supervisor_kind", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "permissions_phone_number_idx": { + "name": "permissions_phone_number_idx", + "columns": [ + "phone_number" + ], + "isUnique": true + }, + "permissions_created_at_idx": { + "name": "permissions_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "permissions_rels": { + "name": "permissions_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "supervisors_id": { + "name": "supervisors_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "permissions_rels_order_idx": { + "name": "permissions_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "permissions_rels_parent_idx": { + "name": "permissions_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "permissions_rels_path_idx": { + "name": "permissions_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "permissions_rels_parent_id_permissions_id_fk": { + "name": "permissions_rels_parent_id_permissions_id_fk", + "tableFrom": "permissions_rels", + "tableTo": "permissions", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permissions_rels_supervisors_id_supervisors_id_fk": { + "name": "permissions_rels_supervisors_id_supervisors_id_fk", + "tableFrom": "permissions_rels", + "tableTo": "supervisors", + "columnsFrom": [ + "supervisors_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "apikeys": { + "name": "apikeys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "apikeys_key_idx": { + "name": "apikeys_key_idx", + "columns": [ + "key" + ], + "isUnique": true + }, + "apikeys_created_at_idx": { + "name": "apikeys_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "categories": { + "name": "categories", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "color": { + "name": "color", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "text_white": { + "name": "text_white", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "categories_slug_idx": { + "name": "categories_slug_idx", + "columns": [ + "slug" + ], + "isUnique": true + }, + "categories_created_at_idx": { + "name": "categories_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "categories_rels": { + "name": "categories_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "categories_rels_order_idx": { + "name": "categories_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "categories_rels_parent_idx": { + "name": "categories_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "categories_rels_path_idx": { + "name": "categories_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "categories_rels_parent_id_categories_id_fk": { + "name": "categories_rels_parent_id_categories_id_fk", + "tableFrom": "categories_rels", + "tableTo": "categories", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "categories_rels_media_id_media_id_fk": { + "name": "categories_rels_media_id_media_id_fk", + "tableFrom": "categories_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "tags": { + "name": "tags", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "tags_slug_idx": { + "name": "tags_slug_idx", + "columns": [ + "slug" + ], + "isUnique": true + }, + "tags_created_at_idx": { + "name": "tags_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "tags_rels": { + "name": "tags_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "tags_rels_order_idx": { + "name": "tags_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "tags_rels_parent_idx": { + "name": "tags_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "tags_rels_path_idx": { + "name": "tags_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "tags_rels_parent_id_tags_id_fk": { + "name": "tags_rels_parent_id_tags_id_fk", + "tableFrom": "tags_rels", + "tableTo": "tags", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "tags_rels_media_id_media_id_fk": { + "name": "tags_rels_media_id_media_id_fk", + "tableFrom": "tags_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "partners": { + "name": "partners", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "stared": { + "name": "stared", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "partners_name_idx": { + "name": "partners_name_idx", + "columns": [ + "name" + ], + "isUnique": true + }, + "partners_created_at_idx": { + "name": "partners_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "partners_rels": { + "name": "partners_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "partners_rels_order_idx": { + "name": "partners_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "partners_rels_parent_idx": { + "name": "partners_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "partners_rels_path_idx": { + "name": "partners_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "partners_rels_parent_id_partners_id_fk": { + "name": "partners_rels_parent_id_partners_id_fk", + "tableFrom": "partners_rels", + "tableTo": "partners", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "partners_rels_media_id_media_id_fk": { + "name": "partners_rels_media_id_media_id_fk", + "tableFrom": "partners_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "media": { + "name": "media", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "alt": { + "name": "alt", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "prefix": { + "name": "prefix", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filename": { + "name": "filename", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "mime_type": { + "name": "mime_type", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filesize": { + "name": "filesize", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "width": { + "name": "width", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "height": { + "name": "height", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "focal_x": { + "name": "focal_x", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "focal_y": { + "name": "focal_y", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "media_created_at_idx": { + "name": "media_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "media_filename_idx": { + "name": "media_filename_idx", + "columns": [ + "filename" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "offers_terms_of_use": { + "name": "offers_terms_of_use", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "is_highlighted": { + "name": "is_highlighted", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "offers_terms_of_use_order_idx": { + "name": "offers_terms_of_use_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "offers_terms_of_use_parent_id_idx": { + "name": "offers_terms_of_use_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "offers_terms_of_use__parent_id_offers_id_fk": { + "name": "offers_terms_of_use__parent_id_offers_id_fk", + "tableFrom": "offers_terms_of_use", + "tableTo": "offers", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "offers_conditions": { + "name": "offers_conditions", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "text": { + "name": "text", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "offers_conditions_order_idx": { + "name": "offers_conditions_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "offers_conditions_parent_id_idx": { + "name": "offers_conditions_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "offers_conditions__parent_id_offers_id_fk": { + "name": "offers_conditions__parent_id_offers_id_fk", + "tableFrom": "offers_conditions", + "tableTo": "offers", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "offers_condition_blocks": { + "name": "offers_condition_blocks", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "is_crossed": { + "name": "is_crossed", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "offers_condition_blocks_order_idx": { + "name": "offers_condition_blocks_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "offers_condition_blocks_parent_id_idx": { + "name": "offers_condition_blocks_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "offers_condition_blocks__parent_id_offers_id_fk": { + "name": "offers_condition_blocks__parent_id_offers_id_fk", + "tableFrom": "offers_condition_blocks", + "tableTo": "offers", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "offers_articles": { + "name": "offers_articles", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "available": { + "name": "available", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reference": { + "name": "reference", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reduction_percentage": { + "name": "reduction_percentage", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "validity_to": { + "name": "validity_to", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "enum_offers_articles_kind", + "primaryKey": false, + "notNull": false + }, + "minimum_price": { + "name": "minimum_price", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "maximum_price": { + "name": "maximum_price", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "public_price": { + "name": "public_price", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "price": { + "name": "price", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "obiz_json": { + "name": "obiz_json", + "type": "jsonb", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "offers_articles_order_idx": { + "name": "offers_articles_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "offers_articles_parent_id_idx": { + "name": "offers_articles_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + }, + "offers_articles_reference_idx": { + "name": "offers_articles_reference_idx", + "columns": [ + "reference" + ], + "isUnique": true + } + }, + "foreignKeys": { + "offers_articles__parent_id_offers_id_fk": { + "name": "offers_articles__parent_id_offers_id_fk", + "tableFrom": "offers_articles", + "tableTo": "offers", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "offers": { + "name": "offers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "formated_title": { + "name": "formated_title", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "validity_from": { + "name": "validity_from", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "validity_to": { + "name": "validity_to", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true + }, + "published": { + "name": "published", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "enum_offers_source", + "primaryKey": false, + "notNull": true + }, + "obiz_id": { + "name": "obiz_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "nb_of_eligible_stores": { + "name": "nb_of_eligible_stores", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "link_of_eligible_stores": { + "name": "link_of_eligible_stores", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "barcodeFormat": { + "name": "barcodeFormat", + "type": "enum_offers_barcode_format", + "primaryKey": false, + "notNull": false + }, + "nb_seen": { + "name": "nb_seen", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "offers_created_at_idx": { + "name": "offers_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "offers_rels": { + "name": "offers_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "partners_id": { + "name": "partners_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "categories_id": { + "name": "categories_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tags_id": { + "name": "tags_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "offers_rels_order_idx": { + "name": "offers_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "offers_rels_parent_idx": { + "name": "offers_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "offers_rels_path_idx": { + "name": "offers_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "offers_rels_parent_id_offers_id_fk": { + "name": "offers_rels_parent_id_offers_id_fk", + "tableFrom": "offers_rels", + "tableTo": "offers", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "offers_rels_partners_id_partners_id_fk": { + "name": "offers_rels_partners_id_partners_id_fk", + "tableFrom": "offers_rels", + "tableTo": "partners", + "columnsFrom": [ + "partners_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "offers_rels_categories_id_categories_id_fk": { + "name": "offers_rels_categories_id_categories_id_fk", + "tableFrom": "offers_rels", + "tableTo": "categories", + "columnsFrom": [ + "categories_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "offers_rels_tags_id_tags_id_fk": { + "name": "offers_rels_tags_id_tags_id_fk", + "tableFrom": "offers_rels", + "tableTo": "tags", + "columnsFrom": [ + "tags_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "offers_rels_media_id_media_id_fk": { + "name": "offers_rels_media_id_media_id_fk", + "tableFrom": "offers_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "coupons": { + "name": "coupons", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "used": { + "name": "used", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "used_at": { + "name": "used_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "assign_user_at": { + "name": "assign_user_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "coupons_created_at_idx": { + "name": "coupons_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "coupons_rels": { + "name": "coupons_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "offers_id": { + "name": "offers_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "coupons_rels_order_idx": { + "name": "coupons_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "coupons_rels_parent_idx": { + "name": "coupons_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "coupons_rels_path_idx": { + "name": "coupons_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "coupons_rels_parent_id_coupons_id_fk": { + "name": "coupons_rels_parent_id_coupons_id_fk", + "tableFrom": "coupons_rels", + "tableTo": "coupons", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "coupons_rels_users_id_users_id_fk": { + "name": "coupons_rels_users_id_users_id_fk", + "tableFrom": "coupons_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "coupons_rels_offers_id_offers_id_fk": { + "name": "coupons_rels_offers_id_offers_id_fk", + "tableFrom": "coupons_rels", + "tableTo": "offers", + "columnsFrom": [ + "offers_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "orders_articles": { + "name": "orders_articles", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "article_reference": { + "name": "article_reference", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "article_quantity": { + "name": "article_quantity", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "article_montant": { + "name": "article_montant", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "article_montant_discounted": { + "name": "article_montant_discounted", + "type": "numeric", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "orders_articles_order_idx": { + "name": "orders_articles_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "orders_articles_parent_id_idx": { + "name": "orders_articles_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "orders_articles__parent_id_orders_id_fk": { + "name": "orders_articles__parent_id_orders_id_fk", + "tableFrom": "orders_articles", + "tableTo": "orders", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "orders": { + "name": "orders", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "number": { + "name": "number", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "enum_orders_status", + "primaryKey": false, + "notNull": true + }, + "obiz_status": { + "name": "obiz_status", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "payment_url": { + "name": "payment_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "orders_created_at_idx": { + "name": "orders_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "orders_rels": { + "name": "orders_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "offers_id": { + "name": "offers_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "orders_rels_order_idx": { + "name": "orders_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "orders_rels_parent_idx": { + "name": "orders_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "orders_rels_path_idx": { + "name": "orders_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "orders_rels_parent_id_orders_id_fk": { + "name": "orders_rels_parent_id_orders_id_fk", + "tableFrom": "orders_rels", + "tableTo": "orders", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "orders_rels_users_id_users_id_fk": { + "name": "orders_rels_users_id_users_id_fk", + "tableFrom": "orders_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "orders_rels_offers_id_offers_id_fk": { + "name": "orders_rels_offers_id_offers_id_fk", + "tableFrom": "orders_rels", + "tableTo": "offers", + "columnsFrom": [ + "offers_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "orders_rels_media_id_media_id_fk": { + "name": "orders_rels_media_id_media_id_fk", + "tableFrom": "orders_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "savings": { + "name": "savings", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "savings_created_at_idx": { + "name": "savings_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "savings_rels": { + "name": "savings_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "coupons_id": { + "name": "coupons_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "savings_rels_order_idx": { + "name": "savings_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "savings_rels_parent_idx": { + "name": "savings_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "savings_rels_path_idx": { + "name": "savings_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "savings_rels_parent_id_savings_id_fk": { + "name": "savings_rels_parent_id_savings_id_fk", + "tableFrom": "savings_rels", + "tableTo": "savings", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "savings_rels_coupons_id_coupons_id_fk": { + "name": "savings_rels_coupons_id_coupons_id_fk", + "tableFrom": "savings_rels", + "tableTo": "coupons", + "columnsFrom": [ + "coupons_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "ordersignals": { + "name": "ordersignals", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "ordersignals_created_at_idx": { + "name": "ordersignals_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "ordersignals_rels": { + "name": "ordersignals_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "orders_id": { + "name": "orders_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "ordersignals_rels_order_idx": { + "name": "ordersignals_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "ordersignals_rels_parent_idx": { + "name": "ordersignals_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "ordersignals_rels_path_idx": { + "name": "ordersignals_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "ordersignals_rels_parent_id_ordersignals_id_fk": { + "name": "ordersignals_rels_parent_id_ordersignals_id_fk", + "tableFrom": "ordersignals_rels", + "tableTo": "ordersignals", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ordersignals_rels_orders_id_orders_id_fk": { + "name": "ordersignals_rels_orders_id_orders_id_fk", + "tableFrom": "ordersignals_rels", + "tableTo": "orders", + "columnsFrom": [ + "orders_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "notifications": { + "name": "notifications", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "message": { + "name": "message", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "app_version": { + "name": "app_version", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "notifications_created_at_idx": { + "name": "notifications_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "notifications_rels": { + "name": "notifications_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "offers_id": { + "name": "offers_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "notifications_rels_order_idx": { + "name": "notifications_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "notifications_rels_parent_idx": { + "name": "notifications_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "notifications_rels_path_idx": { + "name": "notifications_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "notifications_rels_parent_id_notifications_id_fk": { + "name": "notifications_rels_parent_id_notifications_id_fk", + "tableFrom": "notifications_rels", + "tableTo": "notifications", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notifications_rels_users_id_users_id_fk": { + "name": "notifications_rels_users_id_users_id_fk", + "tableFrom": "notifications_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notifications_rels_offers_id_offers_id_fk": { + "name": "notifications_rels_offers_id_offers_id_fk", + "tableFrom": "notifications_rels", + "tableTo": "offers", + "columnsFrom": [ + "offers_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "search_requests": { + "name": "search_requests", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "count": { + "name": "count", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "search_requests_name_idx": { + "name": "search_requests_name_idx", + "columns": [ + "name" + ], + "isUnique": true + }, + "search_requests_created_at_idx": { + "name": "search_requests_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "email_auth_tokens": { + "name": "email_auth_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "expiration": { + "name": "expiration", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "email_auth_tokens_created_at_idx": { + "name": "email_auth_tokens_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "email_auth_tokens_rels": { + "name": "email_auth_tokens_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "email_auth_tokens_rels_order_idx": { + "name": "email_auth_tokens_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "email_auth_tokens_rels_parent_idx": { + "name": "email_auth_tokens_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "email_auth_tokens_rels_path_idx": { + "name": "email_auth_tokens_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "email_auth_tokens_rels_parent_id_email_auth_tokens_id_fk": { + "name": "email_auth_tokens_rels_parent_id_email_auth_tokens_id_fk", + "tableFrom": "email_auth_tokens_rels", + "tableTo": "email_auth_tokens", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "email_auth_tokens_rels_users_id_users_id_fk": { + "name": "email_auth_tokens_rels_users_id_users_id_fk", + "tableFrom": "email_auth_tokens_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "payload_preferences": { + "name": "payload_preferences", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_preferences_key_idx": { + "name": "payload_preferences_key_idx", + "columns": [ + "key" + ], + "isUnique": false + }, + "payload_preferences_created_at_idx": { + "name": "payload_preferences_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "payload_preferences_rels": { + "name": "payload_preferences_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "admins_id": { + "name": "admins_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "supervisors_id": { + "name": "supervisors_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "payload_preferences_rels_order_idx": { + "name": "payload_preferences_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "payload_preferences_rels_parent_idx": { + "name": "payload_preferences_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "payload_preferences_rels_path_idx": { + "name": "payload_preferences_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "payload_preferences_rels_parent_id_payload_preferences_id_fk": { + "name": "payload_preferences_rels_parent_id_payload_preferences_id_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "payload_preferences", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_preferences_rels_admins_id_admins_id_fk": { + "name": "payload_preferences_rels_admins_id_admins_id_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "admins", + "columnsFrom": [ + "admins_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_preferences_rels_users_id_users_id_fk": { + "name": "payload_preferences_rels_users_id_users_id_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_preferences_rels_supervisors_id_supervisors_id_fk": { + "name": "payload_preferences_rels_supervisors_id_supervisors_id_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "supervisors", + "columnsFrom": [ + "supervisors_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "payload_migrations": { + "name": "payload_migrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "batch": { + "name": "batch", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_migrations_created_at_idx": { + "name": "payload_migrations_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "quick_access_items": { + "name": "quick_access_items", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + } + }, + "indexes": { + "quick_access_items_order_idx": { + "name": "quick_access_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "quick_access_items_parent_id_idx": { + "name": "quick_access_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "quick_access_items__parent_id_quick_access_id_fk": { + "name": "quick_access_items__parent_id_quick_access_id_fk", + "tableFrom": "quick_access_items", + "tableTo": "quick_access", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "quick_access": { + "name": "quick_access", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "quick_access_rels": { + "name": "quick_access_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "partners_id": { + "name": "partners_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "offers_id": { + "name": "offers_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "quick_access_rels_order_idx": { + "name": "quick_access_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "quick_access_rels_parent_idx": { + "name": "quick_access_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "quick_access_rels_path_idx": { + "name": "quick_access_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "quick_access_rels_parent_id_quick_access_id_fk": { + "name": "quick_access_rels_parent_id_quick_access_id_fk", + "tableFrom": "quick_access_rels", + "tableTo": "quick_access", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "quick_access_rels_partners_id_partners_id_fk": { + "name": "quick_access_rels_partners_id_partners_id_fk", + "tableFrom": "quick_access_rels", + "tableTo": "partners", + "columnsFrom": [ + "partners_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "quick_access_rels_offers_id_offers_id_fk": { + "name": "quick_access_rels_offers_id_offers_id_fk", + "tableFrom": "quick_access_rels", + "tableTo": "offers", + "columnsFrom": [ + "offers_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "landing_partners_items": { + "name": "landing_partners_items", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + } + }, + "indexes": { + "landing_partners_items_order_idx": { + "name": "landing_partners_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "landing_partners_items_parent_id_idx": { + "name": "landing_partners_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "landing_partners_items__parent_id_landing_partners_id_fk": { + "name": "landing_partners_items__parent_id_landing_partners_id_fk", + "tableFrom": "landing_partners_items", + "tableTo": "landing_partners", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "landing_partners": { + "name": "landing_partners", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "landing_partners_rels": { + "name": "landing_partners_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "partners_id": { + "name": "partners_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "landing_partners_rels_order_idx": { + "name": "landing_partners_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "landing_partners_rels_parent_idx": { + "name": "landing_partners_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "landing_partners_rels_path_idx": { + "name": "landing_partners_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "landing_partners_rels_parent_id_landing_partners_id_fk": { + "name": "landing_partners_rels_parent_id_landing_partners_id_fk", + "tableFrom": "landing_partners_rels", + "tableTo": "landing_partners", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "landing_partners_rels_partners_id_partners_id_fk": { + "name": "landing_partners_rels_partners_id_partners_id_fk", + "tableFrom": "landing_partners_rels", + "tableTo": "partners", + "columnsFrom": [ + "partners_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "landing_f_a_q_items": { + "name": "landing_f_a_q_items", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "landing_f_a_q_items_order_idx": { + "name": "landing_f_a_q_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "landing_f_a_q_items_parent_id_idx": { + "name": "landing_f_a_q_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "landing_f_a_q_items__parent_id_landing_f_a_q_id_fk": { + "name": "landing_f_a_q_items__parent_id_landing_f_a_q_id_fk", + "tableFrom": "landing_f_a_q_items", + "tableTo": "landing_f_a_q", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "landing_f_a_q": { + "name": "landing_f_a_q", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "new_category_items": { + "name": "new_category_items", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + } + }, + "indexes": { + "new_category_items_order_idx": { + "name": "new_category_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "new_category_items_parent_id_idx": { + "name": "new_category_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "new_category_items__parent_id_new_category_id_fk": { + "name": "new_category_items__parent_id_new_category_id_fk", + "tableFrom": "new_category_items", + "tableTo": "new_category", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "new_category": { + "name": "new_category", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "new_category_rels": { + "name": "new_category_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "offers_id": { + "name": "offers_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "new_category_rels_order_idx": { + "name": "new_category_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "new_category_rels_parent_idx": { + "name": "new_category_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "new_category_rels_path_idx": { + "name": "new_category_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "new_category_rels_parent_id_new_category_id_fk": { + "name": "new_category_rels_parent_id_new_category_id_fk", + "tableFrom": "new_category_rels", + "tableTo": "new_category", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "new_category_rels_media_id_media_id_fk": { + "name": "new_category_rels_media_id_media_id_fk", + "tableFrom": "new_category_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "new_category_rels_offers_id_offers_id_fk": { + "name": "new_category_rels_offers_id_offers_id_fk", + "tableFrom": "new_category_rels", + "tableTo": "offers", + "columnsFrom": [ + "offers_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "categories_list_items": { + "name": "categories_list_items", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + } + }, + "indexes": { + "categories_list_items_order_idx": { + "name": "categories_list_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "categories_list_items_parent_id_idx": { + "name": "categories_list_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "categories_list_items__parent_id_categories_list_id_fk": { + "name": "categories_list_items__parent_id_categories_list_id_fk", + "tableFrom": "categories_list_items", + "tableTo": "categories_list", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "categories_list": { + "name": "categories_list", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "categories_list_rels": { + "name": "categories_list_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "categories_id": { + "name": "categories_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "categories_list_rels_order_idx": { + "name": "categories_list_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "categories_list_rels_parent_idx": { + "name": "categories_list_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "categories_list_rels_path_idx": { + "name": "categories_list_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "categories_list_rels_parent_id_categories_list_id_fk": { + "name": "categories_list_rels_parent_id_categories_list_id_fk", + "tableFrom": "categories_list_rels", + "tableTo": "categories_list", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "categories_list_rels_categories_id_categories_id_fk": { + "name": "categories_list_rels_categories_id_categories_id_fk", + "tableFrom": "categories_list_rels", + "tableTo": "categories", + "columnsFrom": [ + "categories_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "tags_list_items": { + "name": "tags_list_items", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + } + }, + "indexes": { + "tags_list_items_order_idx": { + "name": "tags_list_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "tags_list_items_parent_id_idx": { + "name": "tags_list_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "tags_list_items__parent_id_tags_list_id_fk": { + "name": "tags_list_items__parent_id_tags_list_id_fk", + "tableFrom": "tags_list_items", + "tableTo": "tags_list", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "tags_list": { + "name": "tags_list", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "tags_list_rels": { + "name": "tags_list_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tags_id": { + "name": "tags_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "tags_list_rels_order_idx": { + "name": "tags_list_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "tags_list_rels_parent_idx": { + "name": "tags_list_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "tags_list_rels_path_idx": { + "name": "tags_list_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + } + }, + "foreignKeys": { + "tags_list_rels_parent_id_tags_list_id_fk": { + "name": "tags_list_rels_parent_id_tags_list_id_fk", + "tableFrom": "tags_list_rels", + "tableTo": "tags_list", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "tags_list_rels_tags_id_tags_id_fk": { + "name": "tags_list_rels_tags_id_tags_id_fk", + "tableFrom": "tags_list_rels", + "tableTo": "tags", + "columnsFrom": [ + "tags_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "_locales": { + "name": "_locales", + "values": { + "fr": "fr" + } + }, + "enum_users_civility": { + "name": "enum_users_civility", + "values": { + "man": "man", + "woman": "woman" + } + }, + "enum_users_cej_from": { + "name": "enum_users_cej_from", + "values": { + "franceTravail": "franceTravail", + "missionLocale": "missionLocale", + "serviceCivique": "serviceCivique", + "ecole2ndeChance": "ecole2ndeChance", + "epide": "epide" + } + }, + "enum_users_time_at_c_e_j": { + "name": "enum_users_time_at_c_e_j", + "values": { + "started": "started", + "lessThan3Months": "lessThan3Months", + "moreThan3Months": "moreThan3Months" + } + }, + "enum_users_has_a_job_idea": { + "name": "enum_users_has_a_job_idea", + "values": { + "yes": "yes", + "no": "no" + } + }, + "enum_users_status_image": { + "name": "enum_users_status_image", + "values": { + "pending": "pending", + "approved": "approved" + } + }, + "enum_users_notification_status": { + "name": "enum_users_notification_status", + "values": { + "enabled": "enabled", + "disabled": "disabled" + } + }, + "enum_supervisors_kind": { + "name": "enum_supervisors_kind", + "values": { + "ML": "ML", + "SC": "SC", + "FT": "FT" + } + }, + "enum_permissions_supervisor_kind": { + "name": "enum_permissions_supervisor_kind", + "values": { + "ML": "ML", + "SC": "SC", + "FT": "FT" + } + }, + "enum_offers_source": { + "name": "enum_offers_source", + "values": { + "cje": "cje", + "obiz": "obiz" + } + }, + "enum_offers_barcode_format": { + "name": "enum_offers_barcode_format", + "values": { + "CODE39": "CODE39", + "EAN13": "EAN13", + "ITF14": "ITF14", + "MSI": "MSI", + "pharmacode": "pharmacode", + "codabar": "codabar", + "upc": "upc" + } + }, + "enum_offers_articles_kind": { + "name": "enum_offers_articles_kind", + "values": { + "variable_price": "variable_price", + "fixed_price": "fixed_price" + } + }, + "enum_orders_status": { + "name": "enum_orders_status", + "values": { + "init": "init", + "awaiting_payment": "awaiting_payment", + "payment_completed": "payment_completed", + "delivered": "delivered", + "archived": "archived" + } + } + }, + "schemas": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + } +} \ No newline at end of file diff --git a/webapp/src/payload/migrations/20241118_164830.ts b/webapp/src/payload/migrations/20241118_164830.ts new file mode 100644 index 00000000..f90bcf4a --- /dev/null +++ b/webapp/src/payload/migrations/20241118_164830.ts @@ -0,0 +1,16 @@ +import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-postgres' +import { sql } from 'drizzle-orm' + +export async function up({ payload }: MigrateUpArgs): Promise { +await payload.db.drizzle.execute(sql` + +ALTER TABLE "offers_condition_blocks" ADD COLUMN "is_crossed" boolean;`); + +}; + +export async function down({ payload }: MigrateDownArgs): Promise { +await payload.db.drizzle.execute(sql` + +ALTER TABLE "offers_condition_blocks" DROP COLUMN IF EXISTS "is_crossed";`); + +}; diff --git a/webapp/src/payload/payload-types.ts b/webapp/src/payload/payload-types.ts index f12f9031..f7c6f273 100644 --- a/webapp/src/payload/payload-types.ts +++ b/webapp/src/payload/payload-types.ts @@ -115,6 +115,7 @@ export interface User { export interface Media { id: number; alt?: string | null; + prefix?: string | null; updatedAt: string; createdAt: string; url?: string | null; @@ -250,6 +251,7 @@ export interface Offer { conditionBlocks?: | { slug: string; + isCrossed?: boolean | null; id?: string | null; }[] | null;