Refactor TypeScript schemas and enums for consistency and readability
- Updated enum definitions in PaymentStatusEnum and TipologiaPosizioneEnum to use single quotes and consistent formatting. - Refactored Payments, Prezziario, Ratelimiter, Servizio, and other schema files to ensure consistent indentation and formatting. - Added `updated_at` field to various queries in interests and servizio controllers. - Removed unused imageCache utility file.
This commit is contained in:
parent
40076ce48a
commit
8fe0b6636d
46 changed files with 451 additions and 890 deletions
|
|
@ -89,7 +89,8 @@ func AnnunciInsert(annunci typesdefs.AnnunciParsed, resetAllBeforeUpdate bool) e
|
|||
og_url = $48,
|
||||
disponibile_da = $49,
|
||||
permanenza = $50,
|
||||
persone = $51
|
||||
persone = $51,
|
||||
updated_at = NOW()
|
||||
WHERE codice = $47
|
||||
`, annuncio.Locatore, annuncio.Numero, annuncio.Idlocatore,
|
||||
annuncio.Email, annuncio.Creato_il, annuncio.Modificato_il,
|
||||
|
|
@ -157,9 +158,10 @@ func AnnunciInsert(annunci typesdefs.AnnunciParsed, resetAllBeforeUpdate bool) e
|
|||
og_url,
|
||||
disponibile_da,
|
||||
permanenza,
|
||||
persone
|
||||
persone,
|
||||
updated_at
|
||||
)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, NOW())
|
||||
`, annuncio.Locatore, annuncio.Numero, annuncio.Idlocatore,
|
||||
annuncio.Email, annuncio.Creato_il, annuncio.Modificato_il,
|
||||
annuncio.Indirizzo, annuncio.Civico, annuncio.Comune, annuncio.Cap,
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@ async function createNextConfig(): Promise<NextConfig> {
|
|||
// esmExternals: "loose", // This if react-pdf gives compilation issues
|
||||
},
|
||||
|
||||
env: {
|
||||
NEXT_PUBLIC_BUILD_ID: Math.random().toString(36).slice(2, 8),
|
||||
},
|
||||
|
||||
devIndicators: false,
|
||||
headers: async () => {
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export const AnnunciGrid = ({ pagedata }: { pagedata: AnnuncioRicerca[] }) => {
|
|||
titolo_en: annuncio.titolo_en,
|
||||
titolo_it: annuncio.titolo_it,
|
||||
})}
|
||||
updated_at={annuncio.updated_at}
|
||||
videos={annuncio.url_video || undefined}
|
||||
/>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import { useTranslation } from "~/providers/I18nProvider";
|
|||
import { useRicerca } from "~/providers/RicercaProvider";
|
||||
import type { AnnuncioRicercaWPosition } from "~/server/controllers/annunci.controller";
|
||||
import { api } from "~/utils/api";
|
||||
import { CacheKey } from "~/utils/imageCache";
|
||||
|
||||
const MapComp = dynamic(() => import("~/components/map/Map"), {
|
||||
ssr: false,
|
||||
|
|
@ -124,7 +123,7 @@ const SelectedComp = memo(
|
|||
alt="a"
|
||||
className="size-24 rounded-md object-cover sm:size-40"
|
||||
height={500}
|
||||
src={`${selected.url_immagini[0]}?${CacheKey}`}
|
||||
src={`${selected.url_immagini[0]}?${selected.updated_at?.toString() || new Date().toString()}`}
|
||||
width={500}
|
||||
/>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import {
|
|||
import { camereTesti, handleConsegna } from "~/lib/annuncio_details";
|
||||
import { cn, formatCurrency } from "~/lib/utils";
|
||||
import { useTranslation } from "~/providers/I18nProvider";
|
||||
import { CacheKey } from "~/utils/imageCache";
|
||||
|
||||
import { VideoPlayer } from "./videoPlayer";
|
||||
|
||||
type CardAnnuncioProps = {
|
||||
|
|
@ -38,6 +38,7 @@ type CardAnnuncioProps = {
|
|||
stato: string | null;
|
||||
className?: string;
|
||||
videos?: string[] | undefined;
|
||||
updated_at: Date | null;
|
||||
};
|
||||
|
||||
export const CardAnnuncio = ({
|
||||
|
|
@ -55,6 +56,7 @@ export const CardAnnuncio = ({
|
|||
stato,
|
||||
className,
|
||||
videos,
|
||||
updated_at,
|
||||
}: CardAnnuncioProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
|
@ -93,7 +95,7 @@ export const CardAnnuncio = ({
|
|||
}
|
||||
height={400}
|
||||
priority={idx === 0}
|
||||
src={`${img}?${CacheKey}`}
|
||||
src={`${img}?${updated_at?.toString() || new Date().toString()}`}
|
||||
width={800}
|
||||
/>
|
||||
</CarouselItem>
|
||||
|
|
@ -113,10 +115,11 @@ export const CardAnnuncio = ({
|
|||
}}
|
||||
>
|
||||
<VideoPlayer
|
||||
cacheKey={updated_at?.toString() || new Date().toString()}
|
||||
className="h-56"
|
||||
coverImage={immagini?.[0] ? immagini[0] : ""}
|
||||
key={`videoplayer-${idx}`}
|
||||
videoSrc={`${video}?${CacheKey}`}
|
||||
videoSrc={video}
|
||||
/>
|
||||
</CarouselItem>
|
||||
);
|
||||
|
|
@ -233,10 +236,12 @@ export const CarouselAnnuncio = ({
|
|||
single,
|
||||
immagini,
|
||||
videos,
|
||||
updated_at,
|
||||
}: {
|
||||
single?: boolean;
|
||||
immagini: string[] | null;
|
||||
videos: string[] | null;
|
||||
updated_at: Date | null;
|
||||
}) => {
|
||||
const [openModal, setOpenModal] = useState(false);
|
||||
const [idxModal, setIdxModal] = useState(0);
|
||||
|
|
@ -269,7 +274,7 @@ export const CarouselAnnuncio = ({
|
|||
height={400}
|
||||
onClick={() => handleOpenModal(idx)}
|
||||
priority={idx === 0}
|
||||
src={`${img}?${CacheKey}`}
|
||||
src={`${img}?${updated_at?.toString() || new Date().toString()}`}
|
||||
width={800}
|
||||
/>
|
||||
<Maximize2
|
||||
|
|
@ -294,10 +299,11 @@ export const CarouselAnnuncio = ({
|
|||
key={`videoplayer-${video}`}
|
||||
>
|
||||
<VideoPlayer
|
||||
cacheKey={updated_at?.toString() || new Date().toString()}
|
||||
className="h-72"
|
||||
coverImage={immagini?.[0] ? immagini[0] : ""}
|
||||
key={`videoplayer-${idx}-${openModal}`}
|
||||
videoSrc={`${video}?${CacheKey}`}
|
||||
videoSrc={video}
|
||||
/>
|
||||
|
||||
<Maximize2
|
||||
|
|
@ -338,7 +344,7 @@ export const CarouselAnnuncio = ({
|
|||
alt={`carousel-img-${idx}`}
|
||||
className="mx-auto h-[90vh] w-full rounded-md object-contain sm:w-[80vw]"
|
||||
height={1080}
|
||||
src={`${img}?${CacheKey}`}
|
||||
src={`${img}?${updated_at?.toString() || new Date().toString()}`}
|
||||
width={1920}
|
||||
/>
|
||||
</CarouselItem>
|
||||
|
|
@ -354,9 +360,10 @@ export const CarouselAnnuncio = ({
|
|||
key={`carousel-videoplayer-${video}`}
|
||||
>
|
||||
<VideoPlayer
|
||||
cacheKey={updated_at?.toString() || new Date().toString()}
|
||||
className="absolute mx-auto h-[90vh] w-full max-w-fit rounded-md object-contain"
|
||||
coverImage={immagini?.[0] ? immagini[0] : ""}
|
||||
videoSrc={`${video}?${CacheKey}`}
|
||||
videoSrc={video}
|
||||
/>
|
||||
</CarouselItem>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -29,8 +29,23 @@ import { cn, formatCurrency } from "~/lib/utils";
|
|||
import { useTranslation } from "~/providers/I18nProvider";
|
||||
import { useServizioAnnuncio } from "~/providers/ServizioProvider";
|
||||
import type { Annunci } from "~/schemas/public/Annunci";
|
||||
import { CacheKey } from "~/utils/imageCache";
|
||||
|
||||
type AnnuncioData = Pick<
|
||||
Annunci,
|
||||
| "id"
|
||||
| "codice"
|
||||
| "prezzo"
|
||||
| "desc_en"
|
||||
| "desc_it"
|
||||
| "url_immagini"
|
||||
| "titolo_en"
|
||||
| "titolo_it"
|
||||
| "tipo"
|
||||
| "consegna"
|
||||
| "stato"
|
||||
| "web"
|
||||
| "updated_at"
|
||||
>;
|
||||
export const AnnuncioCard = ({ className }: { className?: string }) => {
|
||||
const { data } = useServizioAnnuncio();
|
||||
|
||||
|
|
@ -38,7 +53,10 @@ export const AnnuncioCard = ({ className }: { className?: string }) => {
|
|||
<BasicAnnuncioCard
|
||||
actions={<AnnuncioActions />}
|
||||
className={className}
|
||||
data={data}
|
||||
data={{
|
||||
...data,
|
||||
updated_at: data.updated_at ? new Date(data.updated_at) : null,
|
||||
}}
|
||||
interactions={<Interactions />}
|
||||
/>
|
||||
);
|
||||
|
|
@ -52,21 +70,7 @@ export const BasicAnnuncioCard = ({
|
|||
actions?: React.ReactNode;
|
||||
interactions?: React.ReactNode;
|
||||
className?: string;
|
||||
data: Pick<
|
||||
Annunci,
|
||||
| "id"
|
||||
| "codice"
|
||||
| "prezzo"
|
||||
| "desc_en"
|
||||
| "desc_it"
|
||||
| "url_immagini"
|
||||
| "titolo_en"
|
||||
| "titolo_it"
|
||||
| "tipo"
|
||||
| "consegna"
|
||||
| "stato"
|
||||
| "web"
|
||||
>;
|
||||
data: AnnuncioData;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
|
@ -85,7 +89,7 @@ export const BasicAnnuncioCard = ({
|
|||
priority
|
||||
src={
|
||||
(data.url_immagini &&
|
||||
`/go-api/images/get/${data.url_immagini[0]}?${CacheKey}`) ||
|
||||
`/go-api/images/get/${data.url_immagini[0]}?${data.updated_at?.toString() || new Date().toString()}`) ||
|
||||
"/fallback-image.png"
|
||||
}
|
||||
width={1920}
|
||||
|
|
@ -148,25 +152,7 @@ const TipoBadge = ({ tipo }: { tipo: Annunci["tipo"] }) => {
|
|||
);
|
||||
};
|
||||
|
||||
const AnnuncioDettaglio = ({
|
||||
data,
|
||||
}: {
|
||||
data: Pick<
|
||||
Annunci,
|
||||
| "id"
|
||||
| "codice"
|
||||
| "prezzo"
|
||||
| "desc_en"
|
||||
| "desc_it"
|
||||
| "url_immagini"
|
||||
| "titolo_en"
|
||||
| "titolo_it"
|
||||
| "tipo"
|
||||
| "consegna"
|
||||
| "stato"
|
||||
| "web"
|
||||
>;
|
||||
}) => {
|
||||
const AnnuncioDettaglio = ({ data }: { data: AnnuncioData }) => {
|
||||
const { locale, t } = useTranslation();
|
||||
|
||||
return (
|
||||
|
|
@ -200,7 +186,7 @@ const AnnuncioDettaglio = ({
|
|||
className={"h-80 w-full object-contain sm:h-[35rem]"}
|
||||
height={200}
|
||||
priority={idx === 0}
|
||||
src={`/go-api/images/get/${img}?${CacheKey}`}
|
||||
src={`/go-api/images/get/${img}?${data.updated_at?.toString() || new Date().toString()}`}
|
||||
width={400}
|
||||
/>
|
||||
</CarouselItem>
|
||||
|
|
|
|||
|
|
@ -3,14 +3,10 @@ import Link from "next/link";
|
|||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
import { AnnuncioCard } from "~/components/servizio/annuncio_card";
|
||||
import { SaldoButton } from "~/components/servizio/interactions";
|
||||
import { ServizioDuration } from "~/components/servizio/service-duration-display";
|
||||
import {
|
||||
ServizioActions,
|
||||
ServizioActions2,
|
||||
} from "~/components/servizio/servizio_actions";
|
||||
import { ServizioActions2 } from "~/components/servizio/servizio_actions";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
|
|
@ -23,11 +19,8 @@ import { Progress } from "~/components/ui/progress";
|
|||
import { cn } from "~/lib/utils";
|
||||
import {
|
||||
ServizioAnnuncioProvider,
|
||||
ServizioProvider,
|
||||
useServizio,
|
||||
} from "~/providers/ServizioProvider";
|
||||
import type { UsersId } from "~/schemas/public/Users";
|
||||
import type { ServizioData } from "~/server/controllers/servizio.controller";
|
||||
import { api } from "~/utils/api";
|
||||
import {
|
||||
AnnunciCompatibili,
|
||||
|
|
@ -35,27 +28,6 @@ import {
|
|||
AnnunciSelezionati,
|
||||
} from "./servizio_annunci_accordions";
|
||||
|
||||
export const ServizioContainer = ({
|
||||
servizio,
|
||||
userId,
|
||||
isAdmin,
|
||||
}: {
|
||||
servizio: ServizioData;
|
||||
userId: UsersId;
|
||||
isAdmin: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<ServizioProvider
|
||||
isAdmin={isAdmin}
|
||||
servizio={servizio}
|
||||
servizioId={servizio.servizio_id}
|
||||
userId={userId}
|
||||
>
|
||||
<ServizioMain />
|
||||
</ServizioProvider>
|
||||
);
|
||||
};
|
||||
|
||||
const ServizioCard = ({
|
||||
cardClassName,
|
||||
header,
|
||||
|
|
@ -299,257 +271,3 @@ export const ServizioContent = () => {
|
|||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const ServizioMain = () => {
|
||||
const { servizio, isAdmin, userId } = useServizio();
|
||||
const utils = api.useUtils();
|
||||
const { mutate: updateServizio } = api.servizio.updateServizio.useMutation({
|
||||
onError: (error) => {
|
||||
toast.error(error.message);
|
||||
},
|
||||
onSuccess: async () => {
|
||||
toast.success("Servizio modificato con successo");
|
||||
await utils.servizio.getAllServizioAnnunci.invalidate({ userId });
|
||||
},
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
useEffect(() => {
|
||||
const id = router.asPath.split("#")[1];
|
||||
if (id) {
|
||||
document.getElementById(id)?.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (servizio.isInterrotto) {
|
||||
return (
|
||||
<ServizioCard
|
||||
cardClassName="bg-neutral-100 border-neutral-300"
|
||||
content={
|
||||
<>
|
||||
<p className="font-medium text-lg">Servizio interrotto</p>
|
||||
<p>
|
||||
Non è possibile riutilizzare questo servizio, poichè è stato
|
||||
interrotto.
|
||||
</p>
|
||||
</>
|
||||
}
|
||||
header={
|
||||
<>
|
||||
<div className="flex flex-col gap-4">
|
||||
<CardTitle className="flex items-center gap-2 text-xl sm:text-2xl">
|
||||
<Package className="size-6 text-primary" />
|
||||
Cerco Affitto {servizio.tipologia}
|
||||
</CardTitle>
|
||||
|
||||
<CardDescription className="space-y-2 pl-2 text-foreground/70">
|
||||
<p>
|
||||
aggiunto il{" "}
|
||||
{servizio.created_at.toLocaleDateString("it", {
|
||||
day: "2-digit",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
})}
|
||||
</p>
|
||||
</CardDescription>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (!servizio.isOkAcconto || servizio.decorrenza === null) {
|
||||
return (
|
||||
<ServizioCard
|
||||
content={
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex flex-wrap gap-3">
|
||||
<Link
|
||||
aria-label="Attiva Servizio"
|
||||
href={`/servizio/onboard/${servizio.servizio_id}`}
|
||||
>
|
||||
<Button>Procedi all'attivazione</Button>
|
||||
</Link>
|
||||
{isAdmin && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
updateServizio({
|
||||
data: {
|
||||
decorrenza: new Date(),
|
||||
isOkAcconto: true,
|
||||
},
|
||||
servizioId: servizio.servizio_id,
|
||||
})
|
||||
}
|
||||
variant="success"
|
||||
>
|
||||
Attiva Manualmente (Azione Admin)
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
{isAdmin && <AnnunciSelezionati annunci={servizio.annunci} />}
|
||||
</div>
|
||||
}
|
||||
header={
|
||||
<>
|
||||
<div className="flex w-full flex-col gap-4">
|
||||
<CardTitle className="flex items-center gap-2 text-xl sm:text-2xl">
|
||||
<Package className="size-6 text-primary" />
|
||||
Cerco Affitto {servizio.tipologia}
|
||||
</CardTitle>
|
||||
<CardDescription className="pl-2 text-foreground/70">
|
||||
<p>Servizio non attivo</p>
|
||||
</CardDescription>
|
||||
</div>
|
||||
<ServizioActions />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
const annuncioConfermato = servizio.annunci.filter(
|
||||
(a) => a.accettato_conferma_at !== null,
|
||||
);
|
||||
|
||||
if (servizio.isOkSaldo) {
|
||||
return (
|
||||
<ServizioCard
|
||||
content={
|
||||
<>
|
||||
{annuncioConfermato.map((data) => {
|
||||
return (
|
||||
<ServizioAnnuncioProvider data={data} key={data.id}>
|
||||
<AnnuncioCard />
|
||||
</ServizioAnnuncioProvider>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
}
|
||||
header={
|
||||
<>
|
||||
<div className="flex w-full flex-wrap items-center gap-2">
|
||||
<CardTitle className="flex items-center gap-2 text-xl sm:text-2xl">
|
||||
<Package className="size-6 text-primary" />
|
||||
Cerco Affitto {servizio.tipologia}
|
||||
</CardTitle>
|
||||
|
||||
<CardDescription className="space-y-2 pl-2 text-foreground/70">
|
||||
<p>
|
||||
aggiunto il{" "}
|
||||
{servizio.created_at.toLocaleDateString("it", {
|
||||
day: "2-digit",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
})}
|
||||
</p>
|
||||
</CardDescription>
|
||||
</div>
|
||||
|
||||
<ServizioActions />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const openContattiCount = servizio.annunci.filter(
|
||||
(a) => a.open_contatti_at !== null,
|
||||
).length;
|
||||
|
||||
const annunciInConferma = servizio.annunci.filter(
|
||||
(a) => a.user_confirmed_at !== null,
|
||||
);
|
||||
const annunciNotInConferma = servizio.annunci.filter(
|
||||
(a) => a.user_confirmed_at === null,
|
||||
);
|
||||
|
||||
return (
|
||||
<ServizioCard
|
||||
content={
|
||||
<>
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<UserCircle className="size-6 text-primary" />
|
||||
<span className="font-medium">Contatti sbloccati</span>
|
||||
</div>
|
||||
<span className="text-sm">{openContattiCount} / 10</span>
|
||||
</div>
|
||||
<Progress className="h-2" value={openContattiCount * 10} />
|
||||
</div>
|
||||
|
||||
<ServizioDuration decorrenza={servizio.decorrenza} />
|
||||
|
||||
{annuncioConfermato.length > 0 && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<PackageCheck className="size-6 text-primary" />
|
||||
<span className="font-medium">Saldi in attesa:</span>
|
||||
</div>
|
||||
{servizio.annunci
|
||||
.filter((a) => a.accettato_conferma_at !== null)
|
||||
.map((a) => (
|
||||
<div
|
||||
className="flex items-center gap-2 rounded-md bg-sky-400 p-2"
|
||||
key={a.annunci_id}
|
||||
>
|
||||
<h3>
|
||||
{a.codice} - confermato il:{" "}
|
||||
{/** biome-ignore lint/style/noNonNullAssertion: <already checked> */}
|
||||
{new Date(a.accettato_conferma_at!).toLocaleDateString(
|
||||
"it",
|
||||
{
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
},
|
||||
)}
|
||||
</h3>
|
||||
<SaldoButton
|
||||
annuncioId={a.annunci_id}
|
||||
className="border-none"
|
||||
variant={"outline"}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="space-y-2">
|
||||
<AnnunciInConferma annunci={annunciInConferma} />
|
||||
<AnnunciSelezionati annunci={annunciNotInConferma} />
|
||||
<AnnunciCompatibili />
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
header={
|
||||
<>
|
||||
<div className="flex w-full flex-col gap-2">
|
||||
<CardTitle className="flex items-center gap-2 text-xl sm:text-2xl">
|
||||
<Package className="size-6 text-primary" />
|
||||
Cerco Affitto {servizio.tipologia}
|
||||
</CardTitle>
|
||||
|
||||
<CardDescription className="space-y-2 pl-2 text-foreground/70">
|
||||
<p>
|
||||
aggiunto il{" "}
|
||||
{servizio.created_at.toLocaleDateString("it", {
|
||||
day: "2-digit",
|
||||
month: "2-digit",
|
||||
year: "numeric",
|
||||
})}
|
||||
</p>
|
||||
</CardDescription>
|
||||
</div>
|
||||
|
||||
<ServizioActions />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -50,35 +50,6 @@ import type { ServizioServizioId } from "~/schemas/public/Servizio";
|
|||
import type { UsersId } from "~/schemas/public/Users";
|
||||
import { api } from "~/utils/api";
|
||||
|
||||
export const ServizioActions = () => {
|
||||
const { servizio, isAdmin, userId } = useServizio();
|
||||
|
||||
const canUserEdit =
|
||||
servizio.isOkAcconto &&
|
||||
servizio.decorrenza !== null &&
|
||||
!servizio.annunci.some((a) => a.user_confirmed_at !== null);
|
||||
|
||||
if (!isAdmin && !canUserEdit) {
|
||||
return null; // If the user is not an admin and cannot edit, do not render the actions
|
||||
}
|
||||
return (
|
||||
<div className="flex w-full flex-wrap justify-start gap-3 sm:justify-end">
|
||||
{(isAdmin || canUserEdit) && (
|
||||
<>
|
||||
<EditPreferenze />
|
||||
<InterruzioneServizio />
|
||||
</>
|
||||
)}
|
||||
{isAdmin && (
|
||||
<>
|
||||
<AddAnnuncio servizioId={servizio.servizio_id} userId={userId} />
|
||||
<EditServizioAdmin />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const ServizioActions2 = () => {
|
||||
const { servizio, isAdmin, userId } = useServizio();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { Play } from "lucide-react";
|
|||
import Image from "next/image";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { cn } from "~/lib/utils";
|
||||
import { CacheKey } from "~/utils/imageCache";
|
||||
|
||||
interface VideoPlayerProps {
|
||||
coverImage: string;
|
||||
|
|
@ -13,6 +12,7 @@ interface VideoPlayerProps {
|
|||
title?: string;
|
||||
aspectRatio?: "square" | "video" | "vertical";
|
||||
className?: string;
|
||||
cacheKey: string;
|
||||
}
|
||||
|
||||
export function VideoPlayer({
|
||||
|
|
@ -21,6 +21,7 @@ export function VideoPlayer({
|
|||
title,
|
||||
aspectRatio = "video",
|
||||
className,
|
||||
cacheKey,
|
||||
}: VideoPlayerProps) {
|
||||
const [isPlaying, setIsPlaying] = useState(false);
|
||||
const videoRef = useRef<HTMLDivElement>(null);
|
||||
|
|
@ -63,7 +64,7 @@ export function VideoPlayer({
|
|||
className="object-cover"
|
||||
fill
|
||||
priority
|
||||
src={`${coverImage}?${CacheKey}` || "/fallback-video.png"}
|
||||
src={`${coverImage}?${cacheKey}` || "/fallback-video.png"}
|
||||
/>
|
||||
<div className="absolute inset-0 flex items-center justify-center bg-black/20">
|
||||
<motion.div
|
||||
|
|
@ -98,7 +99,7 @@ export function VideoPlayer({
|
|||
disableRemotePlayback
|
||||
muted
|
||||
onEnded={() => setIsPlaying(false)}
|
||||
src={`${videoSrc}?${CacheKey}`}
|
||||
src={`${videoSrc}?${cacheKey}`}
|
||||
>
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
|
|
|
|||
|
|
@ -236,6 +236,7 @@ export const AnnuncioEditForm = ({ data }: { data: Annunci }) => {
|
|||
Annuncio {data.codice}
|
||||
</h1>
|
||||
<StatusBadge status={data.stato} />
|
||||
<span>{data.updated_at?.toLocaleString("it-IT")}</span>
|
||||
<div className="ml-auto flex items-center gap-2">
|
||||
<Button className="bg-green-500" size="sm" type="submit">
|
||||
Salva
|
||||
|
|
@ -539,6 +540,7 @@ export const AnnuncioEditForm = ({ data }: { data: Annunci }) => {
|
|||
) || null
|
||||
}
|
||||
single
|
||||
updated_at={data.updated_at}
|
||||
videos={data.url_video}
|
||||
/>
|
||||
</CardContent>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ import type { Annunci } from "~/schemas/public/Annunci";
|
|||
import TipologiaPosizioneEnum from "~/schemas/public/TipologiaPosizioneEnum";
|
||||
import { generateSSGHelper } from "~/server/utils/ssgHelper";
|
||||
import { api } from "~/utils/api";
|
||||
import { CacheKey } from "~/utils/imageCache";
|
||||
|
||||
type AnnuncioProps = {
|
||||
cod: string;
|
||||
|
|
@ -136,6 +135,7 @@ const AnnuncioView = ({ cod, flag }: Omit<AnnuncioProps, "meta">) => {
|
|||
<div className="mx-auto w-full px-2 sm:px-8">
|
||||
<CarouselAnnuncio
|
||||
immagini={data.url_immagini}
|
||||
updated_at={data.updated_at}
|
||||
videos={data.url_video}
|
||||
/>
|
||||
|
||||
|
|
@ -204,6 +204,7 @@ const AnnuncioView = ({ cod, flag }: Omit<AnnuncioProps, "meta">) => {
|
|||
consegna={data.consegna}
|
||||
first_image={data.url_immagini?.[0] ? data.url_immagini[0] : ""}
|
||||
tipo={data.tipo}
|
||||
updated_at={data.updated_at}
|
||||
url_video={data.url_video || []}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -623,12 +624,14 @@ const AnnuncioFooter = ({
|
|||
consegna,
|
||||
url_video,
|
||||
first_image,
|
||||
updated_at,
|
||||
}: {
|
||||
tipo: string | null;
|
||||
comune: string | null;
|
||||
consegna: number | null;
|
||||
url_video: string[];
|
||||
first_image: string;
|
||||
updated_at: Date | null;
|
||||
}) => {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
|
|
@ -641,10 +644,11 @@ const AnnuncioFooter = ({
|
|||
}
|
||||
return (
|
||||
<VideoPlayer
|
||||
cacheKey={updated_at?.toString() || new Date().toString()}
|
||||
className="h-96 max-w-96"
|
||||
coverImage={first_image}
|
||||
key={`videoplayer-${video}`}
|
||||
videoSrc={`${video}?${CacheKey}`}
|
||||
key={`videoplayer-${video}`} // Cache busting
|
||||
videoSrc={video}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { default as PublicSchema } from "./public/PublicSchema";
|
||||
import type { default as PublicSchema } from './public/PublicSchema';
|
||||
|
||||
type Database = PublicSchema;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,133 +1,119 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { Caratteristiche } from "../../utils/kanel-types.ts";
|
||||
import type { Caratteristiche } from '../../utils/kanel-types.ts';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.annunci */
|
||||
export type AnnunciId = number & { __brand: "public.annunci" };
|
||||
export type AnnunciId = number & { __brand: 'public.annunci' };
|
||||
|
||||
/** Represents the table public.annunci */
|
||||
export default interface AnnunciTable {
|
||||
id: ColumnType<AnnunciId, AnnunciId | undefined, AnnunciId>;
|
||||
id: ColumnType<AnnunciId, AnnunciId | undefined, AnnunciId>;
|
||||
|
||||
codice: ColumnType<string, string, string>;
|
||||
codice: ColumnType<string, string, string>;
|
||||
|
||||
locatore: ColumnType<string | null, string | null, string | null>;
|
||||
locatore: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
numero: ColumnType<string | null, string | null, string | null>;
|
||||
numero: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
idlocatore: ColumnType<string | null, string | null, string | null>;
|
||||
idlocatore: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
indirizzo: ColumnType<string | null, string | null, string | null>;
|
||||
indirizzo: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
civico: ColumnType<string | null, string | null, string | null>;
|
||||
civico: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
comune: ColumnType<string | null, string | null, string | null>;
|
||||
comune: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
cap: ColumnType<string | null, string | null, string | null>;
|
||||
cap: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
provincia: ColumnType<string | null, string | null, string | null>;
|
||||
provincia: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
regione: ColumnType<string | null, string | null, string | null>;
|
||||
regione: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
lat: ColumnType<string | null, string | null, string | null>;
|
||||
lat: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
lon: ColumnType<string | null, string | null, string | null>;
|
||||
lon: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
indirizzo_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
indirizzo_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
civico_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
civico_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
lat_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
lat_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
lon_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
lon_secondario: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
tipo: ColumnType<string | null, string | null, string | null>;
|
||||
tipo: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
categorie: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
categorie: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
|
||||
prezzo: ColumnType<number, number | undefined, number>;
|
||||
prezzo: ColumnType<number, number | undefined, number>;
|
||||
|
||||
anno: ColumnType<string | null, string | null, string | null>;
|
||||
anno: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
classe: ColumnType<string | null, string | null, string | null>;
|
||||
classe: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
mq: ColumnType<string | null, string | null, string | null>;
|
||||
mq: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
piano: ColumnType<string | null, string | null, string | null>;
|
||||
piano: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
piano_palazzo: ColumnType<number | null, number | null, number | null>;
|
||||
piano_palazzo: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
unita_condominio: ColumnType<number | null, number | null, number | null>;
|
||||
unita_condominio: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
numero_vani: ColumnType<number | null, number | null, number | null>;
|
||||
numero_vani: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
numero_camere: ColumnType<number | null, number | null, number | null>;
|
||||
numero_camere: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
numero_bagni: ColumnType<number | null, number | null, number | null>;
|
||||
numero_bagni: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
numero_balconi: ColumnType<number | null, number | null, number | null>;
|
||||
numero_balconi: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
numero_terrazzi: ColumnType<number | null, number | null, number | null>;
|
||||
numero_terrazzi: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
numero_box: ColumnType<number | null, number | null, number | null>;
|
||||
numero_box: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
numero_postiauto: ColumnType<number | null, number | null, number | null>;
|
||||
numero_postiauto: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
accessori: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
accessori: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
|
||||
titolo_it: ColumnType<string | null, string | null, string | null>;
|
||||
titolo_it: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
desc_it: ColumnType<string | null, string | null, string | null>;
|
||||
desc_it: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
titolo_en: ColumnType<string | null, string | null, string | null>;
|
||||
titolo_en: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
desc_en: ColumnType<string | null, string | null, string | null>;
|
||||
desc_en: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
stato: ColumnType<string | null, string | null, string | null>;
|
||||
stato: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
web: ColumnType<boolean | null, boolean | null, boolean | null>;
|
||||
web: ColumnType<boolean | null, boolean | null, boolean | null>;
|
||||
|
||||
caratteristiche: ColumnType<
|
||||
Caratteristiche | null,
|
||||
Caratteristiche | null,
|
||||
Caratteristiche | null
|
||||
>;
|
||||
caratteristiche: ColumnType<Caratteristiche | null, Caratteristiche | null, Caratteristiche | null>;
|
||||
|
||||
url_immagini: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
url_immagini: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
|
||||
homepage: ColumnType<boolean | null, boolean | null, boolean | null>;
|
||||
homepage: ColumnType<boolean | null, boolean | null, boolean | null>;
|
||||
|
||||
url_video: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
url_video: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
|
||||
email: ColumnType<string | null, string | null, string | null>;
|
||||
email: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
creato_il: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
creato_il: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
modificato_il: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
modificato_il: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
consegna: ColumnType<number | null, number | null, number | null>;
|
||||
consegna: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
og_url: ColumnType<string | null, string | null, string | null>;
|
||||
og_url: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
disponibile_da: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
disponibile_da: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
permanenza: ColumnType<number[] | null, number[] | null, number[] | null>;
|
||||
permanenza: ColumnType<number[] | null, number[] | null, number[] | null>;
|
||||
|
||||
persone: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
persone: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
|
||||
updated_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
}
|
||||
|
||||
export type Annunci = Selectable<AnnunciTable>;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
/** Represents the enum public.BanType */
|
||||
enum BanType {
|
||||
ip = "ip",
|
||||
email = "email",
|
||||
phone = "phone",
|
||||
cf = "cf",
|
||||
}
|
||||
ip = 'ip',
|
||||
email = 'email',
|
||||
phone = 'phone',
|
||||
cf = 'cf',
|
||||
};
|
||||
|
||||
export default BanType;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { default as BanType } from "./BanType";
|
||||
import type { default as BanType } from './BanType';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.banlist */
|
||||
export type BanlistId = number & { __brand: "public.banlist" };
|
||||
export type BanlistId = number & { __brand: 'public.banlist' };
|
||||
|
||||
/** Represents the table public.banlist */
|
||||
export default interface BanlistTable {
|
||||
id: ColumnType<BanlistId, BanlistId | undefined, BanlistId>;
|
||||
id: ColumnType<BanlistId, BanlistId | undefined, BanlistId>;
|
||||
|
||||
value: ColumnType<string, string, string>;
|
||||
value: ColumnType<string, string, string>;
|
||||
|
||||
type: ColumnType<BanType, BanType, BanType>;
|
||||
type: ColumnType<BanType, BanType, BanType>;
|
||||
}
|
||||
|
||||
export type Banlist = Selectable<BanlistTable>;
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.banners */
|
||||
export type BannersIdbanner = string & { __brand: "public.banners" };
|
||||
export type BannersIdbanner = string & { __brand: 'public.banners' };
|
||||
|
||||
/** Represents the table public.banners */
|
||||
export default interface BannersTable {
|
||||
idbanner: ColumnType<BannersIdbanner, BannersIdbanner, BannersIdbanner>;
|
||||
idbanner: ColumnType<BannersIdbanner, BannersIdbanner, BannersIdbanner>;
|
||||
|
||||
titolo: ColumnType<string | null, string | null, string | null>;
|
||||
titolo: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
testo: ColumnType<string | null, string | null, string | null>;
|
||||
testo: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
is_unskippable: ColumnType<boolean, boolean, boolean>;
|
||||
is_unskippable: ColumnType<boolean, boolean, boolean>;
|
||||
|
||||
has_cta: ColumnType<boolean, boolean, boolean>;
|
||||
has_cta: ColumnType<boolean, boolean, boolean>;
|
||||
|
||||
cta_href: ColumnType<string | null, string | null, string | null>;
|
||||
cta_href: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
cta_icon: ColumnType<string | null, string | null, string | null>;
|
||||
cta_icon: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
cta_text: ColumnType<string | null, string | null, string | null>;
|
||||
cta_text: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
color: ColumnType<string | null, string | null, string | null>;
|
||||
color: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
is_active: ColumnType<boolean, boolean, boolean>;
|
||||
is_active: ColumnType<boolean, boolean, boolean>;
|
||||
|
||||
show_public: ColumnType<boolean, boolean, boolean>;
|
||||
show_public: ColumnType<boolean, boolean, boolean>;
|
||||
|
||||
show_private: ColumnType<boolean, boolean, boolean>;
|
||||
show_private: ColumnType<boolean, boolean, boolean>;
|
||||
|
||||
hide_duration: ColumnType<number | null, number | null, number | null>;
|
||||
hide_duration: ColumnType<number | null, number | null, number | null>;
|
||||
}
|
||||
|
||||
export type Banners = Selectable<BannersTable>;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { UsersId } from './Users';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.chats */
|
||||
export type ChatsChatid = string & { __brand: "public.chats" };
|
||||
export type ChatsChatid = string & { __brand: 'public.chats' };
|
||||
|
||||
/** Represents the table public.chats */
|
||||
export default interface ChatsTable {
|
||||
chatid: ColumnType<ChatsChatid, ChatsChatid | undefined, ChatsChatid>;
|
||||
chatid: ColumnType<ChatsChatid, ChatsChatid | undefined, ChatsChatid>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string, Date | string>;
|
||||
|
||||
user_ref: ColumnType<UsersId, UsersId, UsersId>;
|
||||
user_ref: ColumnType<UsersId, UsersId, UsersId>;
|
||||
|
||||
tags: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
tags: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
}
|
||||
|
||||
export type Chats = Selectable<ChatsTable>;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ChatsChatid } from "./Chats";
|
||||
import type { EtichetteIdEtichetta } from "./Etichette";
|
||||
import type { ChatsChatid } from './Chats';
|
||||
import type { EtichetteIdEtichetta } from './Etichette';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Represents the table public.chats_etichette */
|
||||
export default interface ChatsEtichetteTable {
|
||||
chatid: ColumnType<ChatsChatid, ChatsChatid, ChatsChatid>;
|
||||
chatid: ColumnType<ChatsChatid, ChatsChatid, ChatsChatid>;
|
||||
|
||||
etichettaid: ColumnType<
|
||||
EtichetteIdEtichetta,
|
||||
EtichetteIdEtichetta,
|
||||
EtichetteIdEtichetta
|
||||
>;
|
||||
etichettaid: ColumnType<EtichetteIdEtichetta, EtichetteIdEtichetta, EtichetteIdEtichetta>;
|
||||
}
|
||||
|
||||
export type ChatsEtichette = Selectable<ChatsEtichetteTable>;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { UsersId } from './Users';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.emails */
|
||||
export type EmailsIdEmail = number & { __brand: "public.emails" };
|
||||
export type EmailsIdEmail = number & { __brand: 'public.emails' };
|
||||
|
||||
/** Represents the table public.emails */
|
||||
export default interface EmailsTable {
|
||||
id_email: ColumnType<EmailsIdEmail, EmailsIdEmail | undefined, EmailsIdEmail>;
|
||||
id_email: ColumnType<EmailsIdEmail, EmailsIdEmail | undefined, EmailsIdEmail>;
|
||||
|
||||
user_id: ColumnType<UsersId, UsersId, UsersId>;
|
||||
user_id: ColumnType<UsersId, UsersId, UsersId>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
|
||||
data: ColumnType<unknown, unknown, unknown>;
|
||||
data: ColumnType<unknown, unknown, unknown>;
|
||||
}
|
||||
|
||||
export type Emails = Selectable<EmailsTable>;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,18 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.etichette */
|
||||
export type EtichetteIdEtichetta = number & { __brand: "public.etichette" };
|
||||
export type EtichetteIdEtichetta = number & { __brand: 'public.etichette' };
|
||||
|
||||
/** Represents the table public.etichette */
|
||||
export default interface EtichetteTable {
|
||||
id_etichetta: ColumnType<
|
||||
EtichetteIdEtichetta,
|
||||
EtichetteIdEtichetta | undefined,
|
||||
EtichetteIdEtichetta
|
||||
>;
|
||||
id_etichetta: ColumnType<EtichetteIdEtichetta, EtichetteIdEtichetta | undefined, EtichetteIdEtichetta>;
|
||||
|
||||
title: ColumnType<string, string, string>;
|
||||
title: ColumnType<string, string, string>;
|
||||
|
||||
color_hex: ColumnType<string, string, string>;
|
||||
color_hex: ColumnType<string, string, string>;
|
||||
}
|
||||
|
||||
export type Etichette = Selectable<EtichetteTable>;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,20 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.event_queue */
|
||||
export type EventQueueEventId = number & { __brand: "public.event_queue" };
|
||||
export type EventQueueEventId = number & { __brand: 'public.event_queue' };
|
||||
|
||||
/** Represents the table public.event_queue */
|
||||
export default interface EventQueueTable {
|
||||
event_id: ColumnType<
|
||||
EventQueueEventId,
|
||||
EventQueueEventId | undefined,
|
||||
EventQueueEventId
|
||||
>;
|
||||
event_id: ColumnType<EventQueueEventId, EventQueueEventId | undefined, EventQueueEventId>;
|
||||
|
||||
lock_expires: ColumnType<Date, Date | string, Date | string>;
|
||||
lock_expires: ColumnType<Date, Date | string, Date | string>;
|
||||
|
||||
data: ColumnType<unknown | null, unknown | null, unknown | null>;
|
||||
data: ColumnType<unknown | null, unknown | null, unknown | null>;
|
||||
|
||||
status: ColumnType<string, string | undefined, string>;
|
||||
status: ColumnType<string, string | undefined, string>;
|
||||
}
|
||||
|
||||
export type EventQueue = Selectable<EventQueueTable>;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.flags */
|
||||
export type FlagsId = string & { __brand: "public.flags" };
|
||||
export type FlagsId = string & { __brand: 'public.flags' };
|
||||
|
||||
/** Represents the table public.flags */
|
||||
export default interface FlagsTable {
|
||||
id: ColumnType<FlagsId, FlagsId, FlagsId>;
|
||||
id: ColumnType<FlagsId, FlagsId, FlagsId>;
|
||||
|
||||
value: ColumnType<string, string, string>;
|
||||
value: ColumnType<string, string, string>;
|
||||
}
|
||||
|
||||
export type Flags = Selectable<FlagsTable>;
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
/** Represents the enum public.GenericStatusEnum */
|
||||
enum GenericStatusEnum {
|
||||
pending = "pending",
|
||||
success = "success",
|
||||
failed = "failed",
|
||||
}
|
||||
pending = 'pending',
|
||||
success = 'success',
|
||||
failed = 'failed',
|
||||
};
|
||||
|
||||
export default GenericStatusEnum;
|
||||
|
|
|
|||
|
|
@ -1,30 +1,26 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ChatsChatid } from "./Chats";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { ChatsChatid } from './Chats';
|
||||
import type { UsersId } from './Users';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.messages */
|
||||
export type MessagesMessageid = string & { __brand: "public.messages" };
|
||||
export type MessagesMessageid = string & { __brand: 'public.messages' };
|
||||
|
||||
/** Represents the table public.messages */
|
||||
export default interface MessagesTable {
|
||||
messageid: ColumnType<
|
||||
MessagesMessageid,
|
||||
MessagesMessageid | undefined,
|
||||
MessagesMessageid
|
||||
>;
|
||||
messageid: ColumnType<MessagesMessageid, MessagesMessageid | undefined, MessagesMessageid>;
|
||||
|
||||
chatid: ColumnType<ChatsChatid, ChatsChatid, ChatsChatid>;
|
||||
chatid: ColumnType<ChatsChatid, ChatsChatid, ChatsChatid>;
|
||||
|
||||
message: ColumnType<string | null, string | null, string | null>;
|
||||
message: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
time: ColumnType<Date, Date | string, Date | string>;
|
||||
time: ColumnType<Date, Date | string, Date | string>;
|
||||
|
||||
isread: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isread: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
sender: ColumnType<UsersId, UsersId, UsersId>;
|
||||
sender: ColumnType<UsersId, UsersId, UsersId>;
|
||||
}
|
||||
|
||||
export type Messages = Selectable<MessagesTable>;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,16 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.miogest_images_ref */
|
||||
export type MiogestImagesRefCodice = string & {
|
||||
__brand: "public.miogest_images_ref";
|
||||
};
|
||||
export type MiogestImagesRefCodice = string & { __brand: 'public.miogest_images_ref' };
|
||||
|
||||
/** Represents the table public.miogest_images_ref */
|
||||
export default interface MiogestImagesRefTable {
|
||||
codice: ColumnType<
|
||||
MiogestImagesRefCodice,
|
||||
MiogestImagesRefCodice,
|
||||
MiogestImagesRefCodice
|
||||
>;
|
||||
codice: ColumnType<MiogestImagesRefCodice, MiogestImagesRefCodice, MiogestImagesRefCodice>;
|
||||
|
||||
foto: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
foto: ColumnType<string[] | null, string[] | null, string[] | null>;
|
||||
}
|
||||
|
||||
export type MiogestImagesRef = Selectable<MiogestImagesRefTable>;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
/** Represents the enum public.OrderTypeEnum */
|
||||
enum OrderTypeEnum {
|
||||
Acconto = "Acconto",
|
||||
Saldo = "Saldo",
|
||||
Consulenza = "Consulenza",
|
||||
Altro = "Altro",
|
||||
}
|
||||
Acconto = 'Acconto',
|
||||
Saldo = 'Saldo',
|
||||
Consulenza = 'Consulenza',
|
||||
Altro = 'Altro',
|
||||
};
|
||||
|
||||
export default OrderTypeEnum;
|
||||
|
|
|
|||
|
|
@ -1,42 +1,30 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { default as OrderTypeEnum } from "./OrderTypeEnum";
|
||||
import type { PrezziarioIdprezziario } from "./Prezziario";
|
||||
import type { ServizioServizioId } from "./Servizio";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { UsersId } from './Users';
|
||||
import type { PrezziarioIdprezziario } from './Prezziario';
|
||||
import type { ServizioServizioId } from './Servizio';
|
||||
import type { default as OrderTypeEnum } from './OrderTypeEnum';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.ordini */
|
||||
export type OrdiniOrdineId = string & { __brand: "public.ordini" };
|
||||
export type OrdiniOrdineId = string & { __brand: 'public.ordini' };
|
||||
|
||||
/** Represents the table public.ordini */
|
||||
export default interface OrdiniTable {
|
||||
ordine_id: ColumnType<
|
||||
OrdiniOrdineId,
|
||||
OrdiniOrdineId | undefined,
|
||||
OrdiniOrdineId
|
||||
>;
|
||||
ordine_id: ColumnType<OrdiniOrdineId, OrdiniOrdineId | undefined, OrdiniOrdineId>;
|
||||
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
|
||||
packid: ColumnType<
|
||||
PrezziarioIdprezziario,
|
||||
PrezziarioIdprezziario,
|
||||
PrezziarioIdprezziario
|
||||
>;
|
||||
packid: ColumnType<PrezziarioIdprezziario, PrezziarioIdprezziario, PrezziarioIdprezziario>;
|
||||
|
||||
servizio_id: ColumnType<
|
||||
ServizioServizioId,
|
||||
ServizioServizioId,
|
||||
ServizioServizioId
|
||||
>;
|
||||
servizio_id: ColumnType<ServizioServizioId, ServizioServizioId, ServizioServizioId>;
|
||||
|
||||
type: ColumnType<OrderTypeEnum, OrderTypeEnum, OrderTypeEnum>;
|
||||
type: ColumnType<OrderTypeEnum, OrderTypeEnum, OrderTypeEnum>;
|
||||
|
||||
isActive: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isActive: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
}
|
||||
|
||||
export type Ordini = Selectable<OrdiniTable>;
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
/** Represents the enum public.PaymentStatusEnum */
|
||||
enum PaymentStatusEnum {
|
||||
processing = "processing",
|
||||
success = "success",
|
||||
failed = "failed",
|
||||
}
|
||||
processing = 'processing',
|
||||
success = 'success',
|
||||
failed = 'failed',
|
||||
};
|
||||
|
||||
export default PaymentStatusEnum;
|
||||
|
|
|
|||
|
|
@ -1,46 +1,38 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { OrdiniOrdineId } from "./Ordini";
|
||||
import type { default as PaymentStatusEnum } from "./PaymentStatusEnum";
|
||||
import type { ServizioServizioId } from "./Servizio";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { UsersId } from './Users';
|
||||
import type { default as PaymentStatusEnum } from './PaymentStatusEnum';
|
||||
import type { ServizioServizioId } from './Servizio';
|
||||
import type { OrdiniOrdineId } from './Ordini';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.payments */
|
||||
export type PaymentsId = string & { __brand: "public.payments" };
|
||||
export type PaymentsId = string & { __brand: 'public.payments' };
|
||||
|
||||
/** Represents the table public.payments */
|
||||
export default interface PaymentsTable {
|
||||
id: ColumnType<PaymentsId, PaymentsId | undefined, PaymentsId>;
|
||||
id: ColumnType<PaymentsId, PaymentsId | undefined, PaymentsId>;
|
||||
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
|
||||
amount_cent: ColumnType<number, number, number>;
|
||||
amount_cent: ColumnType<number, number, number>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
|
||||
paymentmethod: ColumnType<string | null, string | null, string | null>;
|
||||
paymentmethod: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
paymentname: ColumnType<string, string, string>;
|
||||
paymentname: ColumnType<string, string, string>;
|
||||
|
||||
paid_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
paid_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
intent_id: ColumnType<string | null, string | null, string | null>;
|
||||
intent_id: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
paymentstatus: ColumnType<
|
||||
PaymentStatusEnum | null,
|
||||
PaymentStatusEnum | null,
|
||||
PaymentStatusEnum | null
|
||||
>;
|
||||
paymentstatus: ColumnType<PaymentStatusEnum | null, PaymentStatusEnum | null, PaymentStatusEnum | null>;
|
||||
|
||||
servizio_id: ColumnType<
|
||||
ServizioServizioId,
|
||||
ServizioServizioId,
|
||||
ServizioServizioId
|
||||
>;
|
||||
servizio_id: ColumnType<ServizioServizioId, ServizioServizioId, ServizioServizioId>;
|
||||
|
||||
ordine_id: ColumnType<OrdiniOrdineId, OrdiniOrdineId, OrdiniOrdineId>;
|
||||
ordine_id: ColumnType<OrdiniOrdineId, OrdiniOrdineId, OrdiniOrdineId>;
|
||||
}
|
||||
|
||||
export type Payments = Selectable<PaymentsTable>;
|
||||
|
|
|
|||
|
|
@ -1,44 +1,40 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.prezziario */
|
||||
export type PrezziarioIdprezziario = string & { __brand: "public.prezziario" };
|
||||
export type PrezziarioIdprezziario = string & { __brand: 'public.prezziario' };
|
||||
|
||||
/** Represents the table public.prezziario */
|
||||
export default interface PrezziarioTable {
|
||||
idprezziario: ColumnType<
|
||||
PrezziarioIdprezziario,
|
||||
PrezziarioIdprezziario,
|
||||
PrezziarioIdprezziario
|
||||
>;
|
||||
idprezziario: ColumnType<PrezziarioIdprezziario, PrezziarioIdprezziario, PrezziarioIdprezziario>;
|
||||
|
||||
prezzo_cent: ColumnType<number, number, number>;
|
||||
prezzo_cent: ColumnType<number, number, number>;
|
||||
|
||||
testo_condizioni: ColumnType<string | null, string | null, string | null>;
|
||||
testo_condizioni: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
isActive: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isActive: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
nome_it: ColumnType<string, string, string>;
|
||||
nome_it: ColumnType<string, string, string>;
|
||||
|
||||
nome_en: ColumnType<string, string, string>;
|
||||
nome_en: ColumnType<string, string, string>;
|
||||
|
||||
desc_it: ColumnType<string, string, string>;
|
||||
desc_it: ColumnType<string, string, string>;
|
||||
|
||||
desc_en: ColumnType<string, string, string>;
|
||||
desc_en: ColumnType<string, string, string>;
|
||||
|
||||
sconto: ColumnType<number, number | undefined, number>;
|
||||
sconto: ColumnType<number, number | undefined, number>;
|
||||
|
||||
isAcconto: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isAcconto: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
isSaldo: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isSaldo: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
isConsulenza: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isConsulenza: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
isStabile: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isStabile: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
isTransitorio: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isTransitorio: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
}
|
||||
|
||||
export type Prezziario = Selectable<PrezziarioTable>;
|
||||
|
|
|
|||
|
|
@ -1,77 +1,77 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { default as AnnunciTable } from "./Annunci";
|
||||
import type { default as BanlistTable } from "./Banlist";
|
||||
import type { default as BannersTable } from "./Banners";
|
||||
import type { default as ChatsTable } from "./Chats";
|
||||
import type { default as ChatsEtichetteTable } from "./ChatsEtichette";
|
||||
import type { default as EmailsTable } from "./Emails";
|
||||
import type { default as EtichetteTable } from "./Etichette";
|
||||
import type { default as EventQueueTable } from "./EventQueue";
|
||||
import type { default as FlagsTable } from "./Flags";
|
||||
import type { default as MessagesTable } from "./Messages";
|
||||
import type { default as MiogestImagesRefTable } from "./MiogestImagesRef";
|
||||
import type { default as OrdiniTable } from "./Ordini";
|
||||
import type { default as PaymentsTable } from "./Payments";
|
||||
import type { default as PrezziarioTable } from "./Prezziario";
|
||||
import type { default as RatelimiterTable } from "./Ratelimiter";
|
||||
import type { default as ServizioTable } from "./Servizio";
|
||||
import type { default as ServizioAnnunciTable } from "./ServizioAnnunci";
|
||||
import type { default as ServizioInteressiTable } from "./ServizioInteressi";
|
||||
import type { default as StorageindexTable } from "./Storageindex";
|
||||
import type { default as TempTokensTable } from "./TempTokens";
|
||||
import type { default as TestiEStringheTable } from "./TestiEStringhe";
|
||||
import type { default as UsersTable } from "./Users";
|
||||
import type { default as UsersAnagraficaTable } from "./UsersAnagrafica";
|
||||
import type { default as UsersStorageTable } from "./UsersStorage";
|
||||
import type { default as ServizioInteressiTable } from './ServizioInteressi';
|
||||
import type { default as FlagsTable } from './Flags';
|
||||
import type { default as AnnunciTable } from './Annunci';
|
||||
import type { default as UsersTable } from './Users';
|
||||
import type { default as ChatsEtichetteTable } from './ChatsEtichette';
|
||||
import type { default as TestiEStringheTable } from './TestiEStringhe';
|
||||
import type { default as UsersStorageTable } from './UsersStorage';
|
||||
import type { default as ServizioAnnunciTable } from './ServizioAnnunci';
|
||||
import type { default as EmailsTable } from './Emails';
|
||||
import type { default as PaymentsTable } from './Payments';
|
||||
import type { default as MiogestImagesRefTable } from './MiogestImagesRef';
|
||||
import type { default as TempTokensTable } from './TempTokens';
|
||||
import type { default as EventQueueTable } from './EventQueue';
|
||||
import type { default as OrdiniTable } from './Ordini';
|
||||
import type { default as PrezziarioTable } from './Prezziario';
|
||||
import type { default as RatelimiterTable } from './Ratelimiter';
|
||||
import type { default as ChatsTable } from './Chats';
|
||||
import type { default as EtichetteTable } from './Etichette';
|
||||
import type { default as StorageindexTable } from './Storageindex';
|
||||
import type { default as MessagesTable } from './Messages';
|
||||
import type { default as UsersAnagraficaTable } from './UsersAnagrafica';
|
||||
import type { default as BanlistTable } from './Banlist';
|
||||
import type { default as BannersTable } from './Banners';
|
||||
import type { default as ServizioTable } from './Servizio';
|
||||
|
||||
export default interface PublicSchema {
|
||||
servizio_interessi: ServizioInteressiTable;
|
||||
servizio_interessi: ServizioInteressiTable;
|
||||
|
||||
flags: FlagsTable;
|
||||
flags: FlagsTable;
|
||||
|
||||
annunci: AnnunciTable;
|
||||
annunci: AnnunciTable;
|
||||
|
||||
users: UsersTable;
|
||||
users: UsersTable;
|
||||
|
||||
chats_etichette: ChatsEtichetteTable;
|
||||
chats_etichette: ChatsEtichetteTable;
|
||||
|
||||
testi_e_stringhe: TestiEStringheTable;
|
||||
testi_e_stringhe: TestiEStringheTable;
|
||||
|
||||
users_storage: UsersStorageTable;
|
||||
users_storage: UsersStorageTable;
|
||||
|
||||
servizio_annunci: ServizioAnnunciTable;
|
||||
servizio_annunci: ServizioAnnunciTable;
|
||||
|
||||
emails: EmailsTable;
|
||||
emails: EmailsTable;
|
||||
|
||||
payments: PaymentsTable;
|
||||
payments: PaymentsTable;
|
||||
|
||||
miogest_images_ref: MiogestImagesRefTable;
|
||||
miogest_images_ref: MiogestImagesRefTable;
|
||||
|
||||
temp_tokens: TempTokensTable;
|
||||
temp_tokens: TempTokensTable;
|
||||
|
||||
event_queue: EventQueueTable;
|
||||
event_queue: EventQueueTable;
|
||||
|
||||
ordini: OrdiniTable;
|
||||
ordini: OrdiniTable;
|
||||
|
||||
prezziario: PrezziarioTable;
|
||||
prezziario: PrezziarioTable;
|
||||
|
||||
ratelimiter: RatelimiterTable;
|
||||
ratelimiter: RatelimiterTable;
|
||||
|
||||
chats: ChatsTable;
|
||||
chats: ChatsTable;
|
||||
|
||||
etichette: EtichetteTable;
|
||||
etichette: EtichetteTable;
|
||||
|
||||
storageindex: StorageindexTable;
|
||||
storageindex: StorageindexTable;
|
||||
|
||||
messages: MessagesTable;
|
||||
messages: MessagesTable;
|
||||
|
||||
users_anagrafica: UsersAnagraficaTable;
|
||||
users_anagrafica: UsersAnagraficaTable;
|
||||
|
||||
banlist: BanlistTable;
|
||||
banlist: BanlistTable;
|
||||
|
||||
banners: BannersTable;
|
||||
banners: BannersTable;
|
||||
|
||||
servizio: ServizioTable;
|
||||
servizio: ServizioTable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Represents the table public.ratelimiter */
|
||||
export default interface RatelimiterTable {
|
||||
key: ColumnType<string, string, string>;
|
||||
key: ColumnType<string, string, string>;
|
||||
|
||||
request_timestamp: ColumnType<Date, Date | string, Date | string>;
|
||||
request_timestamp: ColumnType<Date, Date | string, Date | string>;
|
||||
|
||||
request_count: ColumnType<number, number, number>;
|
||||
request_count: ColumnType<number, number, number>;
|
||||
}
|
||||
|
||||
export type Ratelimiter = Selectable<RatelimiterTable>;
|
||||
|
|
|
|||
|
|
@ -1,80 +1,64 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { default as TipologiaPosizioneEnum } from "./TipologiaPosizioneEnum";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { UsersId } from './Users';
|
||||
import type { default as TipologiaPosizioneEnum } from './TipologiaPosizioneEnum';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.servizio */
|
||||
export type ServizioServizioId = string & { __brand: "public.servizio" };
|
||||
export type ServizioServizioId = string & { __brand: 'public.servizio' };
|
||||
|
||||
/** Represents the table public.servizio */
|
||||
export default interface ServizioTable {
|
||||
servizio_id: ColumnType<
|
||||
ServizioServizioId,
|
||||
ServizioServizioId | undefined,
|
||||
ServizioServizioId
|
||||
>;
|
||||
servizio_id: ColumnType<ServizioServizioId, ServizioServizioId | undefined, ServizioServizioId>;
|
||||
|
||||
user_id: ColumnType<UsersId, UsersId, UsersId>;
|
||||
user_id: ColumnType<UsersId, UsersId, UsersId>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
|
||||
tipologia: ColumnType<
|
||||
TipologiaPosizioneEnum,
|
||||
TipologiaPosizioneEnum,
|
||||
TipologiaPosizioneEnum
|
||||
>;
|
||||
tipologia: ColumnType<TipologiaPosizioneEnum, TipologiaPosizioneEnum, TipologiaPosizioneEnum>;
|
||||
|
||||
arredato: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
arredato: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
budget: ColumnType<number, number, number>;
|
||||
budget: ColumnType<number, number, number>;
|
||||
|
||||
n_adulti: ColumnType<number, number, number>;
|
||||
n_adulti: ColumnType<number, number, number>;
|
||||
|
||||
n_minori: ColumnType<number, number, number>;
|
||||
n_minori: ColumnType<number, number, number>;
|
||||
|
||||
animali: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
animali: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
fumatori: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
fumatori: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
giardino: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
giardino: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
parcheggio: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
parcheggio: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
terrazzo: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
terrazzo: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
ascensore: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
ascensore: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
pianoterra: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
pianoterra: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
motivazione_transitorio: ColumnType<
|
||||
string | null,
|
||||
string | null,
|
||||
string | null
|
||||
>;
|
||||
motivazione_transitorio: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
reddito: ColumnType<string | null, string | null, string | null>;
|
||||
reddito: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
isSent: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isSent: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
decorrenza: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
decorrenza: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
isInterrotto: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isInterrotto: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
entromese: ColumnType<number | null, number | null, number | null>;
|
||||
entromese: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
permanenza: ColumnType<number | null, number | null, number | null>;
|
||||
permanenza: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
isOkAcconto: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isOkAcconto: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
isOkSaldo: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isOkSaldo: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
isOkConsulenza: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isOkConsulenza: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
}
|
||||
|
||||
export type Servizio = Selectable<ServizioTable>;
|
||||
|
|
|
|||
|
|
@ -1,90 +1,54 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { AnnunciId } from "./Annunci";
|
||||
import type { ServizioServizioId } from "./Servizio";
|
||||
import type { StorageindexId } from "./Storageindex";
|
||||
import type { ServizioServizioId } from './Servizio';
|
||||
import type { AnnunciId } from './Annunci';
|
||||
import type { StorageindexId } from './Storageindex';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Represents the table public.servizio_annunci */
|
||||
export default interface ServizioAnnunciTable {
|
||||
servizio_id: ColumnType<
|
||||
ServizioServizioId,
|
||||
ServizioServizioId,
|
||||
ServizioServizioId
|
||||
>;
|
||||
servizio_id: ColumnType<ServizioServizioId, ServizioServizioId, ServizioServizioId>;
|
||||
|
||||
annunci_id: ColumnType<AnnunciId, AnnunciId, AnnunciId>;
|
||||
annunci_id: ColumnType<AnnunciId, AnnunciId, AnnunciId>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
|
||||
open_contatti_at: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
open_contatti_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
doc_conferma_ref: ColumnType<
|
||||
StorageindexId | null,
|
||||
StorageindexId | null,
|
||||
StorageindexId | null
|
||||
>;
|
||||
doc_conferma_ref: ColumnType<StorageindexId | null, StorageindexId | null, StorageindexId | null>;
|
||||
|
||||
user_confirmed_at: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
user_confirmed_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
accettato_conferma_at: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
accettato_conferma_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
caparra_causale: ColumnType<string | null, string | null, string | null>;
|
||||
caparra_causale: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
caparra_iban: ColumnType<string | null, string | null, string | null>;
|
||||
caparra_iban: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
caparra_importo: ColumnType<string | null, string | null, string | null>;
|
||||
caparra_importo: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
caparra_intestazione: ColumnType<string | null, string | null, string | null>;
|
||||
caparra_intestazione: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
hasConfermaAdmin: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
hasConfermaAdmin: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
doc_contratto_ref: ColumnType<
|
||||
StorageindexId | null,
|
||||
StorageindexId | null,
|
||||
StorageindexId | null
|
||||
>;
|
||||
doc_contratto_ref: ColumnType<StorageindexId | null, StorageindexId | null, StorageindexId | null>;
|
||||
|
||||
gestionale_id: ColumnType<number | null, number | null, number | null>;
|
||||
gestionale_id: ColumnType<number | null, number | null, number | null>;
|
||||
|
||||
contratto_decorrenza: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
contratto_decorrenza: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
contratto_scadenza: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
contratto_scadenza: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
contratto_tipo: ColumnType<string | null, string | null, string | null>;
|
||||
contratto_tipo: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
doc_registrazione_ref: ColumnType<
|
||||
StorageindexId | null,
|
||||
StorageindexId | null,
|
||||
StorageindexId | null
|
||||
>;
|
||||
doc_registrazione_ref: ColumnType<StorageindexId | null, StorageindexId | null, StorageindexId | null>;
|
||||
|
||||
doc_conferma_added: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
doc_conferma_added: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
doc_contratto_added: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
doc_contratto_added: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
doc_registrazione_added: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
doc_registrazione_added: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
}
|
||||
|
||||
export type ServizioAnnunci = Selectable<ServizioAnnunciTable>;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { AnnunciId } from "./Annunci";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { AnnunciId } from './Annunci';
|
||||
import type { UsersId } from './Users';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Represents the table public.servizio_interessi */
|
||||
export default interface ServizioInteressiTable {
|
||||
annuncioId: ColumnType<AnnunciId, AnnunciId, AnnunciId>;
|
||||
annuncioId: ColumnType<AnnunciId, AnnunciId, AnnunciId>;
|
||||
|
||||
userId: ColumnType<UsersId, UsersId, UsersId>;
|
||||
userId: ColumnType<UsersId, UsersId, UsersId>;
|
||||
}
|
||||
|
||||
export type ServizioInteressi = Selectable<ServizioInteressiTable>;
|
||||
|
|
|
|||
|
|
@ -1,28 +1,24 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.storageindex */
|
||||
export type StorageindexId = string & { __brand: "public.storageindex" };
|
||||
export type StorageindexId = string & { __brand: 'public.storageindex' };
|
||||
|
||||
/** Represents the table public.storageindex */
|
||||
export default interface StorageindexTable {
|
||||
id: ColumnType<StorageindexId, StorageindexId | undefined, StorageindexId>;
|
||||
id: ColumnType<StorageindexId, StorageindexId | undefined, StorageindexId>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
|
||||
filename: ColumnType<string | null, string | null, string | null>;
|
||||
filename: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
ext: ColumnType<string | null, string | null, string | null>;
|
||||
ext: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
from_admin: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
from_admin: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
expires_at: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
expires_at: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
}
|
||||
|
||||
export type Storageindex = Selectable<StorageindexTable>;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,16 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.temp_tokens */
|
||||
export type TempTokensToken = string & { __brand: "public.temp_tokens" };
|
||||
export type TempTokensToken = string & { __brand: 'public.temp_tokens' };
|
||||
|
||||
/** Represents the table public.temp_tokens */
|
||||
export default interface TempTokensTable {
|
||||
token: ColumnType<
|
||||
TempTokensToken,
|
||||
TempTokensToken | undefined,
|
||||
TempTokensToken
|
||||
>;
|
||||
token: ColumnType<TempTokensToken, TempTokensToken | undefined, TempTokensToken>;
|
||||
|
||||
elapse: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
elapse: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
}
|
||||
|
||||
export type TempTokens = Selectable<TempTokensTable>;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,16 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.testi_e_stringhe */
|
||||
export type TestiEStringheStingaId = string & {
|
||||
__brand: "public.testi_e_stringhe";
|
||||
};
|
||||
export type TestiEStringheStingaId = string & { __brand: 'public.testi_e_stringhe' };
|
||||
|
||||
/** Represents the table public.testi_e_stringhe */
|
||||
export default interface TestiEStringheTable {
|
||||
stinga_id: ColumnType<
|
||||
TestiEStringheStingaId,
|
||||
TestiEStringheStingaId,
|
||||
TestiEStringheStingaId
|
||||
>;
|
||||
stinga_id: ColumnType<TestiEStringheStingaId, TestiEStringheStingaId, TestiEStringheStingaId>;
|
||||
|
||||
stringa_value: ColumnType<string | null, string | null, string | null>;
|
||||
stringa_value: ColumnType<string | null, string | null, string | null>;
|
||||
}
|
||||
|
||||
export type TestiEStringhe = Selectable<TestiEStringheTable>;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
/** Represents the enum public.TipologiaPosizioneEnum */
|
||||
enum TipologiaPosizioneEnum {
|
||||
Transitorio = "Transitorio",
|
||||
Stabile = "Stabile",
|
||||
}
|
||||
Transitorio = 'Transitorio',
|
||||
Stabile = 'Stabile',
|
||||
};
|
||||
|
||||
export default TipologiaPosizioneEnum;
|
||||
|
|
|
|||
|
|
@ -1,54 +1,46 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.users */
|
||||
export type UsersId = string & { __brand: "public.users" };
|
||||
export type UsersId = string & { __brand: 'public.users' };
|
||||
|
||||
/** Represents the table public.users */
|
||||
export default interface UsersTable {
|
||||
id: ColumnType<UsersId, UsersId | undefined, UsersId>;
|
||||
id: ColumnType<UsersId, UsersId | undefined, UsersId>;
|
||||
|
||||
username: ColumnType<string, string, string>;
|
||||
username: ColumnType<string, string, string>;
|
||||
|
||||
email: ColumnType<string, string, string>;
|
||||
email: ColumnType<string, string, string>;
|
||||
|
||||
isAdmin: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isAdmin: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
isBlocked: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isBlocked: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
password: ColumnType<string, string, string>;
|
||||
password: ColumnType<string, string, string>;
|
||||
|
||||
nome: ColumnType<string, string, string>;
|
||||
nome: ColumnType<string, string, string>;
|
||||
|
||||
cognome: ColumnType<string, string, string>;
|
||||
cognome: ColumnType<string, string, string>;
|
||||
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
created_at: ColumnType<Date, Date | string | undefined, Date | string>;
|
||||
|
||||
reset_password_token: ColumnType<string | null, string | null, string | null>;
|
||||
reset_password_token: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
reset_password_expires: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
reset_password_expires: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
telefono: ColumnType<string, string, string>;
|
||||
telefono: ColumnType<string, string, string>;
|
||||
|
||||
isAdminMade: ColumnType<boolean | null, boolean | null, boolean | null>;
|
||||
isAdminMade: ColumnType<boolean | null, boolean | null, boolean | null>;
|
||||
|
||||
isVerified: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
isVerified: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
verificationToken: ColumnType<string | null, string | null, string | null>;
|
||||
verificationToken: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
verificationTokenExpires: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
verificationTokenExpires: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
salt: ColumnType<string, string, string>;
|
||||
salt: ColumnType<string, string, string>;
|
||||
}
|
||||
|
||||
export type Users = Selectable<UsersTable>;
|
||||
|
|
|
|||
|
|
@ -1,67 +1,53 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { UsersId } from './Users';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Identifier type for public.users_anagrafica */
|
||||
export type UsersAnagraficaIdanagrafica = string & {
|
||||
__brand: "public.users_anagrafica";
|
||||
};
|
||||
export type UsersAnagraficaIdanagrafica = string & { __brand: 'public.users_anagrafica' };
|
||||
|
||||
/** Represents the table public.users_anagrafica */
|
||||
export default interface UsersAnagraficaTable {
|
||||
idanagrafica: ColumnType<
|
||||
UsersAnagraficaIdanagrafica,
|
||||
UsersAnagraficaIdanagrafica | undefined,
|
||||
UsersAnagraficaIdanagrafica
|
||||
>;
|
||||
idanagrafica: ColumnType<UsersAnagraficaIdanagrafica, UsersAnagraficaIdanagrafica | undefined, UsersAnagraficaIdanagrafica>;
|
||||
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
|
||||
luogo_nascita: ColumnType<string | null, string | null, string | null>;
|
||||
luogo_nascita: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
data_nascita: ColumnType<
|
||||
Date | null,
|
||||
Date | string | null,
|
||||
Date | string | null
|
||||
>;
|
||||
data_nascita: ColumnType<Date | null, Date | string | null, Date | string | null>;
|
||||
|
||||
nazione_nascita: ColumnType<string | null, string | null, string | null>;
|
||||
nazione_nascita: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
codice_fiscale: ColumnType<string | null, string | null, string | null>;
|
||||
codice_fiscale: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
via_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
via_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
civico_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
civico_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
comune_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
comune_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
provincia_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
provincia_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
cap_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
cap_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
nazione_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
nazione_residenza: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
sesso: ColumnType<string | null, string | null, string | null>;
|
||||
sesso: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
azienda: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
azienda: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
ragione_sociale: ColumnType<string | null, string | null, string | null>;
|
||||
ragione_sociale: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
sede_legale: ColumnType<string | null, string | null, string | null>;
|
||||
sede_legale: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
p_iva: ColumnType<string | null, string | null, string | null>;
|
||||
p_iva: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
fatturazione_aziendale: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
fatturazione_aziendale: ColumnType<boolean, boolean | undefined, boolean>;
|
||||
|
||||
codice_destinatario: ColumnType<string | null, string | null, string | null>;
|
||||
codice_destinatario: ColumnType<string | null, string | null, string | null>;
|
||||
|
||||
legale_rappresentante: ColumnType<
|
||||
string | null,
|
||||
string | null,
|
||||
string | null
|
||||
>;
|
||||
legale_rappresentante: ColumnType<string | null, string | null, string | null>;
|
||||
}
|
||||
|
||||
export type UsersAnagrafica = Selectable<UsersAnagraficaTable>;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
// @generated
|
||||
// This file is automatically generated by Kanel. Do not modify manually.
|
||||
|
||||
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
|
||||
import type { StorageindexId } from "./Storageindex";
|
||||
import type { UsersId } from "./Users";
|
||||
import type { UsersId } from './Users';
|
||||
import type { StorageindexId } from './Storageindex';
|
||||
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
||||
|
||||
/** Represents the table public.users_storage */
|
||||
export default interface UsersStorageTable {
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
userid: ColumnType<UsersId, UsersId, UsersId>;
|
||||
|
||||
storageid: ColumnType<StorageindexId, StorageindexId, StorageindexId>;
|
||||
storageid: ColumnType<StorageindexId, StorageindexId, StorageindexId>;
|
||||
}
|
||||
|
||||
export type UsersStorage = Selectable<UsersStorageTable>;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ export const intrestsRouter = createTRPCRouter({
|
|||
"annunci.consegna",
|
||||
"annunci.stato",
|
||||
"annunci.web",
|
||||
"annunci.updated_at",
|
||||
])
|
||||
.where("web", "=", true)
|
||||
.where("stato", "!=", "Sospeso")
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@ export const get_AnnunciPositionsHandler = async ({
|
|||
"url_video",
|
||||
"lon_secondario",
|
||||
"lat_secondario",
|
||||
"updated_at",
|
||||
])
|
||||
|
||||
.where("web", "=", true)
|
||||
|
|
@ -237,6 +238,7 @@ export type AnnuncioRicerca = Pick<
|
|||
| "modificato_il"
|
||||
| "stato"
|
||||
| "url_video"
|
||||
| "updated_at"
|
||||
>;
|
||||
|
||||
export const getCursor_AnnunciHandler = async ({
|
||||
|
|
@ -273,6 +275,7 @@ export const getCursor_AnnunciHandler = async ({
|
|||
"modificato_il",
|
||||
"stato",
|
||||
"url_video",
|
||||
"updated_at",
|
||||
])
|
||||
|
||||
.where("web", "=", true)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { jsonArrayFrom, jsonObjectFrom } from "kysely/helpers/postgres";
|
|||
import { z } from "zod/v4";
|
||||
import type { PurchaseData } from "~/components/acquisto_receipt";
|
||||
import { env } from "~/env";
|
||||
import type { AnnunciId } from "~/schemas/public/Annunci";
|
||||
import type { Annunci, AnnunciId } from "~/schemas/public/Annunci";
|
||||
import OrderTypeEnum from "~/schemas/public/OrderTypeEnum";
|
||||
import type { OrdiniOrdineId } from "~/schemas/public/Ordini";
|
||||
import PaymentStatusEnum from "~/schemas/public/PaymentStatusEnum";
|
||||
|
|
@ -645,6 +645,7 @@ export const getAllServizioAnnunci = async (userId: UsersId) => {
|
|||
"annunci.consegna",
|
||||
"annunci.stato",
|
||||
"annunci.web",
|
||||
"annunci.updated_at",
|
||||
])
|
||||
//ignora annunci che non sono disponibili
|
||||
.where("annunci.web", "=", true)
|
||||
|
|
@ -1463,6 +1464,23 @@ export const SendContactEmail = async ({
|
|||
}
|
||||
};
|
||||
|
||||
export type AnnuncioData = Pick<
|
||||
Annunci,
|
||||
| "id"
|
||||
| "codice"
|
||||
| "prezzo"
|
||||
| "desc_en"
|
||||
| "desc_it"
|
||||
| "url_immagini"
|
||||
| "titolo_en"
|
||||
| "titolo_it"
|
||||
| "tipo"
|
||||
| "consegna"
|
||||
| "stato"
|
||||
| "web"
|
||||
| "updated_at"
|
||||
>;
|
||||
|
||||
export const getCompatibileAnnunci = async (servizioId: ServizioServizioId) => {
|
||||
try {
|
||||
const servizio = await getServizioById(servizioId);
|
||||
|
|
@ -1488,6 +1506,7 @@ export const getCompatibileAnnunci = async (servizioId: ServizioServizioId) => {
|
|||
"annunci.consegna",
|
||||
"annunci.stato",
|
||||
"annunci.web",
|
||||
"annunci.updated_at",
|
||||
])
|
||||
.where("web", "=", true)
|
||||
.where("stato", "!=", "Sospeso")
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export const CacheKey = `cachekey=${process.env.NEXT_PUBLIC_BUILD_ID}`;
|
||||
Loading…
Add table
Reference in a new issue