mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-22 22:54:22 +00:00
Indent using 4 spaces
This commit is contained in:
parent
333ca3d55e
commit
d6e9a44443
4 changed files with 96 additions and 170 deletions
|
@ -1,8 +1,8 @@
|
||||||
import '../styles/globals.css'
|
import '../styles/globals.css'
|
||||||
import type { AppProps } from 'next/app'
|
import type { AppProps } from 'next/app'
|
||||||
|
|
||||||
function MyApp({ Component, pageProps }: AppProps) {
|
const App = ({ Component, pageProps }: AppProps): React.ReactNode => {
|
||||||
return <Component {...pageProps} />
|
return <Component {...pageProps} />
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MyApp
|
export default App
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
||||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
|
||||||
|
|
||||||
type Data = {
|
|
||||||
name: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function handler(
|
|
||||||
req: NextApiRequest,
|
|
||||||
res: NextApiResponse<Data>
|
|
||||||
) {
|
|
||||||
res.status(200).json({ name: 'John Doe' })
|
|
||||||
}
|
|
|
@ -1,72 +1,11 @@
|
||||||
import type { NextPage } from 'next'
|
import type { NextPage } from 'next'
|
||||||
import Head from 'next/head'
|
|
||||||
import Image from 'next/image'
|
|
||||||
import styles from '../styles/Home.module.css'
|
|
||||||
|
|
||||||
const Home: NextPage = () => {
|
const Page: NextPage = () => {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div>
|
||||||
<Head>
|
sus
|
||||||
<title>Create Next App</title>
|
|
||||||
<meta name="description" content="Generated by create next app" />
|
|
||||||
<link rel="icon" href="/favicon.ico" />
|
|
||||||
</Head>
|
|
||||||
|
|
||||||
<main className={styles.main}>
|
|
||||||
<h1 className={styles.title}>
|
|
||||||
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<p className={styles.description}>
|
|
||||||
Get started by editing{' '}
|
|
||||||
<code className={styles.code}>pages/index.tsx</code>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div className={styles.grid}>
|
|
||||||
<a href="https://nextjs.org/docs" className={styles.card}>
|
|
||||||
<h2>Documentation →</h2>
|
|
||||||
<p>Find in-depth information about Next.js features and API.</p>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="https://nextjs.org/learn" className={styles.card}>
|
|
||||||
<h2>Learn →</h2>
|
|
||||||
<p>Learn about Next.js in an interactive course with quizzes!</p>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://github.com/vercel/next.js/tree/canary/examples"
|
|
||||||
className={styles.card}
|
|
||||||
>
|
|
||||||
<h2>Examples →</h2>
|
|
||||||
<p>Discover and deploy boilerplate example Next.js projects.</p>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
|
||||||
className={styles.card}
|
|
||||||
>
|
|
||||||
<h2>Deploy →</h2>
|
|
||||||
<p>
|
|
||||||
Instantly deploy your Next.js site to a public URL with Vercel.
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
)
|
||||||
|
|
||||||
<footer className={styles.footer}>
|
|
||||||
<a
|
|
||||||
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
Powered by{' '}
|
|
||||||
<span className={styles.logo}>
|
|
||||||
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Home
|
export default Page
|
||||||
|
|
|
@ -2,126 +2,126 @@
|
||||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||||
|
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "postgresql"
|
||||||
url = env("DATABASE_URL")
|
url = env("DATABASE_URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An event is the representation of a gathering of people in a certain place at a certain time.
|
/// An event is the representation of a gathering of people in a certain place at a certain time.
|
||||||
model Event {
|
model Event {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
//
|
//
|
||||||
slug String
|
slug String
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
viewPassword String?
|
viewPassword String?
|
||||||
joinPassword String?
|
joinPassword String?
|
||||||
//
|
//
|
||||||
name String
|
name String
|
||||||
description String
|
description String
|
||||||
postcard String?
|
postcard String?
|
||||||
startTime DateTime?
|
startTime DateTime?
|
||||||
endTime DateTime?
|
endTime DateTime?
|
||||||
location String?
|
location String?
|
||||||
//
|
//
|
||||||
partecipants Partecipant[]
|
partecipants Partecipant[]
|
||||||
neededItems Item[]
|
neededItems Item[]
|
||||||
vehicles Vehicle[]
|
vehicles Vehicle[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A partecipant is a person who may or may not partecipate to the event.
|
/// A partecipant is a person who may or may not partecipate to the event.
|
||||||
model Partecipant {
|
model Partecipant {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
eventId Int
|
eventId Int
|
||||||
event Event @relation(fields: [eventId], references: [id])
|
event Event @relation(fields: [eventId], references: [id])
|
||||||
//
|
//
|
||||||
name String
|
name String
|
||||||
email String
|
email String
|
||||||
//
|
//
|
||||||
means PartecipationMeans
|
means PartecipationMeans
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
joinedAt DateTime?
|
joinedAt DateTime?
|
||||||
//
|
//
|
||||||
answer PartecipationAnswer
|
answer PartecipationAnswer
|
||||||
shouldBring Item[]
|
shouldBring Item[]
|
||||||
drives Vehicle[] @relation("VehicleDrive")
|
drives Vehicle[] @relation("VehicleDrive")
|
||||||
rides Vehicle[] @relation("VehicleRide")
|
rides Vehicle[] @relation("VehicleRide")
|
||||||
expenses Transaction[] @relation("TransactionFrom")
|
expenses Transaction[] @relation("TransactionFrom")
|
||||||
income Transaction[] @relation("TransactionTo")
|
income Transaction[] @relation("TransactionTo")
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PartecipationMeans {
|
enum PartecipationMeans {
|
||||||
CREATOR
|
CREATOR
|
||||||
INVITED
|
INVITED
|
||||||
ACCEPTED
|
ACCEPTED
|
||||||
JOINED
|
JOINED
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PartecipationAnswer {
|
enum PartecipationAnswer {
|
||||||
HOST
|
HOST
|
||||||
YES
|
YES
|
||||||
MAYBE
|
MAYBE
|
||||||
NO
|
NO
|
||||||
PENDING
|
PENDING
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An item which should be bought and brought by somebody to the event.
|
/// An item which should be bought and brought by somebody to the event.
|
||||||
model Item {
|
model Item {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
eventId Int
|
eventId Int
|
||||||
event Event @relation(fields: [eventId], references: [id])
|
event Event @relation(fields: [eventId], references: [id])
|
||||||
//
|
//
|
||||||
quantity Int
|
quantity Int
|
||||||
name String
|
name String
|
||||||
purchased Boolean @default(false)
|
purchased Boolean @default(false)
|
||||||
//
|
//
|
||||||
assignedId Int?
|
assignedId Int?
|
||||||
assigned Partecipant? @relation(fields: [assignedId], references: [id])
|
assigned Partecipant? @relation(fields: [assignedId], references: [id])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A vehicle which is being used to transport people from and to the event.
|
/// A vehicle which is being used to transport people from and to the event.
|
||||||
model Vehicle {
|
model Vehicle {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
eventId Int
|
eventId Int
|
||||||
event Event @relation(fields: [eventId], references: [id])
|
event Event @relation(fields: [eventId], references: [id])
|
||||||
//
|
//
|
||||||
driverId Int
|
driverId Int
|
||||||
driver Partecipant @relation("VehicleDrive", fields: [driverId], references: [id])
|
driver Partecipant @relation("VehicleDrive", fields: [driverId], references: [id])
|
||||||
riders Partecipant[] @relation("VehicleRide")
|
riders Partecipant[] @relation("VehicleRide")
|
||||||
//
|
//
|
||||||
type VehicleType @default(CAR)
|
type VehicleType @default(CAR)
|
||||||
slots Int @default(4)
|
slots Int @default(4)
|
||||||
password String?
|
password String?
|
||||||
//
|
//
|
||||||
voyage VoyageType
|
voyage VoyageType
|
||||||
location String
|
location String
|
||||||
departureAt DateTime
|
departureAt DateTime
|
||||||
arrivalAt DateTime
|
arrivalAt DateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
enum VehicleType {
|
enum VehicleType {
|
||||||
CAR
|
CAR
|
||||||
OTHER
|
OTHER
|
||||||
}
|
}
|
||||||
|
|
||||||
enum VoyageType {
|
enum VoyageType {
|
||||||
TO
|
TO
|
||||||
FROM
|
FROM
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A monetary transaction related to the event.
|
/// A monetary transaction related to the event.
|
||||||
model Transaction {
|
model Transaction {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
//
|
//
|
||||||
fromId Int?
|
fromId Int?
|
||||||
from Partecipant? @relation("TransactionFrom", fields: [fromId], references: [id])
|
from Partecipant? @relation("TransactionFrom", fields: [fromId], references: [id])
|
||||||
toId Int?
|
toId Int?
|
||||||
to Partecipant? @relation("TransactionTo", fields: [toId], references: [id])
|
to Partecipant? @relation("TransactionTo", fields: [toId], references: [id])
|
||||||
//
|
//
|
||||||
amount Decimal
|
amount Decimal
|
||||||
currency String
|
currency String
|
||||||
reason String
|
reason String
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue