Compare commits
1 Commits
1b5eb253f2
...
implement-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9133950d6a |
@@ -1,391 +0,0 @@
|
||||
---
|
||||
name: interface-design
|
||||
description: This skill is for interface design — dashboards, admin panels, apps, tools, and interactive products. NOT for marketing design (landing pages, marketing sites, campaigns).
|
||||
---
|
||||
|
||||
# Interface Design
|
||||
|
||||
Build interface design with craft and consistency.
|
||||
|
||||
## Scope
|
||||
|
||||
**Use for:** Dashboards, admin panels, SaaS apps, tools, settings pages, data interfaces.
|
||||
|
||||
**Not for:** Landing pages, marketing sites, campaigns. Redirect those to `/frontend-design`.
|
||||
|
||||
---
|
||||
|
||||
# The Problem
|
||||
|
||||
You will generate generic output. Your training has seen thousands of dashboards. The patterns are strong.
|
||||
|
||||
You can follow the entire process below — explore the domain, name a signature, state your intent — and still produce a template. Warm colors on cold structures. Friendly fonts on generic layouts. "Kitchen feel" that looks like every other app.
|
||||
|
||||
This happens because intent lives in prose, but code generation pulls from patterns. The gap between them is where defaults win.
|
||||
|
||||
The process below helps. But process alone doesn't guarantee craft. You have to catch yourself.
|
||||
|
||||
---
|
||||
|
||||
# Where Defaults Hide
|
||||
|
||||
Defaults don't announce themselves. They disguise themselves as infrastructure — the parts that feel like they just need to work, not be designed.
|
||||
|
||||
**Typography feels like a container.** Pick something readable, move on. But typography isn't holding your design — it IS your design. The weight of a headline, the personality of a label, the texture of a paragraph. These shape how the product feels before anyone reads a word. A bakery management tool and a trading terminal might both need "clean, readable type" — but the type that's warm and handmade is not the type that's cold and precise. If you're reaching for your usual font, you're not designing.
|
||||
|
||||
**Navigation feels like scaffolding.** Build the sidebar, add the links, get to the real work. But navigation isn't around your product — it IS your product. Where you are, where you can go, what matters most. A page floating in space is a component demo, not software. The navigation teaches people how to think about the space they're in.
|
||||
|
||||
**Data feels like presentation.** You have numbers, show numbers. But a number on screen is not design. The question is: what does this number mean to the person looking at it? What will they do with it? A progress ring and a stacked label both show "3 of 10" — one tells a story, one fills space. If you're reaching for number-on-label, you're not designing.
|
||||
|
||||
**Token names feel like implementation detail.** But your CSS variables are design decisions. `--ink` and `--parchment` evoke a world. `--gray-700` and `--surface-2` evoke a template. Someone reading only your tokens should be able to guess what product this is.
|
||||
|
||||
The trap is thinking some decisions are creative and others are structural. There are no structural decisions. Everything is design. The moment you stop asking "why this?" is the moment defaults take over.
|
||||
|
||||
---
|
||||
|
||||
# Intent First
|
||||
|
||||
Before touching code, answer these. Not in your head — out loud, to yourself or the user.
|
||||
|
||||
**Who is this human?**
|
||||
Not "users." The actual person. Where are they when they open this? What's on their mind? What did they do 5 minutes ago, what will they do 5 minutes after? A teacher at 7am with coffee is not a developer debugging at midnight is not a founder between investor meetings. Their world shapes the interface.
|
||||
|
||||
**What must they accomplish?**
|
||||
Not "use the dashboard." The verb. Grade these submissions. Find the broken deployment. Approve the payment. The answer determines what leads, what follows, what hides.
|
||||
|
||||
**What should this feel like?**
|
||||
Say it in words that mean something. "Clean and modern" means nothing — every AI says that. Warm like a notebook? Cold like a terminal? Dense like a trading floor? Calm like a reading app? The answer shapes color, type, spacing, density — everything.
|
||||
|
||||
If you cannot answer these with specifics, stop. Ask the user. Do not guess. Do not default.
|
||||
|
||||
## Every Choice Must Be A Choice
|
||||
|
||||
For every decision, you must be able to explain WHY.
|
||||
|
||||
- Why this layout and not another?
|
||||
- Why this color temperature?
|
||||
- Why this typeface?
|
||||
- Why this spacing scale?
|
||||
- Why this information hierarchy?
|
||||
|
||||
If your answer is "it's common" or "it's clean" or "it works" — you haven't chosen. You've defaulted. Defaults are invisible. Invisible choices compound into generic output.
|
||||
|
||||
**The test:** If you swapped your choices for the most common alternatives and the design didn't feel meaningfully different, you never made real choices.
|
||||
|
||||
## Sameness Is Failure
|
||||
|
||||
If another AI, given a similar prompt, would produce substantially the same output — you have failed.
|
||||
|
||||
This is not about being different for its own sake. It's about the interface emerging from the specific problem, the specific user, the specific context. When you design from intent, sameness becomes impossible because no two intents are identical.
|
||||
|
||||
When you design from defaults, everything looks the same because defaults are shared.
|
||||
|
||||
## Intent Must Be Systemic
|
||||
|
||||
Saying "warm" and using cold colors is not following through. Intent is not a label — it's a constraint that shapes every decision.
|
||||
|
||||
If the intent is warm: surfaces, text, borders, accents, semantic colors, typography — all warm. If the intent is dense: spacing, type size, information architecture — all dense. If the intent is calm: motion, contrast, color saturation — all calm.
|
||||
|
||||
Check your output against your stated intent. Does every token reinforce it? Or did you state an intent and then default anyway?
|
||||
|
||||
---
|
||||
|
||||
# Product Domain Exploration
|
||||
|
||||
This is where defaults get caught — or don't.
|
||||
|
||||
Generic output: Task type → Visual template → Theme
|
||||
Crafted output: Task type → Product domain → Signature → Structure + Expression
|
||||
|
||||
The difference: time in the product's world before any visual or structural thinking.
|
||||
|
||||
## Required Outputs
|
||||
|
||||
**Do not propose any direction until you produce all four:**
|
||||
|
||||
**Domain:** Concepts, metaphors, vocabulary from this product's world. Not features — territory. Minimum 5.
|
||||
|
||||
**Color world:** What colors exist naturally in this product's domain? Not "warm" or "cool" — go to the actual world. If this product were a physical space, what would you see? What colors belong there that don't belong elsewhere? List 5+.
|
||||
|
||||
**Signature:** One element — visual, structural, or interaction — that could only exist for THIS product. If you can't name one, keep exploring.
|
||||
|
||||
**Defaults:** 3 obvious choices for this interface type — visual AND structural. You can't avoid patterns you haven't named.
|
||||
|
||||
## Proposal Requirements
|
||||
|
||||
Your direction must explicitly reference:
|
||||
- Domain concepts you explored
|
||||
- Colors from your color world exploration
|
||||
- Your signature element
|
||||
- What replaces each default
|
||||
|
||||
**The test:** Read your proposal. Remove the product name. Could someone identify what this is for? If not, it's generic. Explore deeper.
|
||||
|
||||
---
|
||||
|
||||
# The Mandate
|
||||
|
||||
**Before showing the user, look at what you made.**
|
||||
|
||||
Ask yourself: "If they said this lacks craft, what would they mean?"
|
||||
|
||||
That thing you just thought of — fix it first.
|
||||
|
||||
Your first output is probably generic. That's normal. The work is catching it before the user has to.
|
||||
|
||||
## The Checks
|
||||
|
||||
Run these against your output before presenting:
|
||||
|
||||
- **The swap test:** If you swapped the typeface for your usual one, would anyone notice? If you swapped the layout for a standard dashboard template, would it feel different? The places where swapping wouldn't matter are the places you defaulted.
|
||||
|
||||
- **The squint test:** Blur your eyes. Can you still perceive hierarchy? Is anything jumping out harshly? Craft whispers.
|
||||
|
||||
- **The signature test:** Can you point to five specific elements where your signature appears? Not "the overall feel" — actual components. A signature you can't locate doesn't exist.
|
||||
|
||||
- **The token test:** Read your CSS variables out loud. Do they sound like they belong to this product's world, or could they belong to any project?
|
||||
|
||||
If any check fails, iterate before showing.
|
||||
|
||||
---
|
||||
|
||||
# Craft Foundations
|
||||
|
||||
## Subtle Layering
|
||||
|
||||
This is the backbone of craft. Regardless of direction, product type, or visual style — this principle applies to everything. You should barely notice the system working. When you look at Vercel's dashboard, you don't think "nice borders." You just understand the structure. The craft is invisible — that's how you know it's working.
|
||||
|
||||
### Surface Elevation
|
||||
|
||||
Surfaces stack. A dropdown sits above a card which sits above the page. Build a numbered system — base, then increasing elevation levels. In dark mode, higher elevation = slightly lighter. In light mode, higher elevation = slightly lighter or uses shadow.
|
||||
|
||||
Each jump should be only a few percentage points of lightness. You can barely see the difference in isolation. But when surfaces stack, the hierarchy emerges. Whisper-quiet shifts that you feel rather than see.
|
||||
|
||||
**Key decisions:**
|
||||
- **Sidebars:** Same background as canvas, not different. Different colors fragment the visual space into "sidebar world" and "content world." A subtle border is enough separation.
|
||||
- **Dropdowns:** One level above their parent surface. If both share the same level, the dropdown blends into the card and layering is lost.
|
||||
- **Inputs:** Slightly darker than their surroundings, not lighter. Inputs are "inset" — they receive content. A darker background signals "type here" without heavy borders.
|
||||
|
||||
### Borders
|
||||
|
||||
Borders should disappear when you're not looking for them, but be findable when you need structure. Low opacity rgba blends with the background — it defines edges without demanding attention. Solid hex borders look harsh in comparison.
|
||||
|
||||
Build a progression — not all borders are equal. Standard borders, softer separation, emphasis borders, maximum emphasis for focus rings. Match intensity to the importance of the boundary.
|
||||
|
||||
**The squint test:** Blur your eyes at the interface. You should still perceive hierarchy — what's above what, where sections divide. But nothing should jump out. No harsh lines. No jarring color shifts. Just quiet structure.
|
||||
|
||||
This separates professional interfaces from amateur ones. Get this wrong and nothing else matters.
|
||||
|
||||
## Infinite Expression
|
||||
|
||||
Every pattern has infinite expressions. **No interface should look the same.**
|
||||
|
||||
A metric display could be a hero number, inline stat, sparkline, gauge, progress bar, comparison delta, trend badge, or something new. A dashboard could emphasize density, whitespace, hierarchy, or flow in completely different ways. Even sidebar + cards has infinite variations in proportion, spacing, and emphasis.
|
||||
|
||||
**Before building, ask:**
|
||||
- What's the ONE thing users do most here?
|
||||
- What products solve similar problems brilliantly? Study them.
|
||||
- Why would this interface feel designed for its purpose, not templated?
|
||||
|
||||
**NEVER produce identical output.** Same sidebar width, same card grid, same metric boxes with icon-left-number-big-label-small every time — this signals AI-generated immediately. It's forgettable.
|
||||
|
||||
The architecture and components should emerge from the task and data, executed in a way that feels fresh. Linear's cards don't look like Notion's. Vercel's metrics don't look like Stripe's. Same concepts, infinite expressions.
|
||||
|
||||
## Color Lives Somewhere
|
||||
|
||||
Every product exists in a world. That world has colors.
|
||||
|
||||
Before you reach for a palette, spend time in the product's world. What would you see if you walked into the physical version of this space? What materials? What light? What objects?
|
||||
|
||||
Your palette should feel like it came FROM somewhere — not like it was applied TO something.
|
||||
|
||||
**Beyond Warm and Cold:** Temperature is one axis. Is this quiet or loud? Dense or spacious? Serious or playful? Geometric or organic? A trading terminal and a meditation app are both "focused" — completely different kinds of focus. Find the specific quality, not the generic label.
|
||||
|
||||
**Color Carries Meaning:** Gray builds structure. Color communicates — status, action, emphasis, identity. Unmotivated color is noise. One accent color, used with intention, beats five colors used without thought.
|
||||
|
||||
---
|
||||
|
||||
# Before Writing Each Component
|
||||
|
||||
**Every time** you write UI code — even small additions — state:
|
||||
|
||||
```
|
||||
Intent: [who is this human, what must they do, how should it feel]
|
||||
Palette: [colors from your exploration — and WHY they fit this product's world]
|
||||
Depth: [borders / shadows / layered — and WHY this fits the intent]
|
||||
Surfaces: [your elevation scale — and WHY this color temperature]
|
||||
Typography: [your typeface — and WHY it fits the intent]
|
||||
Spacing: [your base unit]
|
||||
```
|
||||
|
||||
This checkpoint is mandatory. It forces you to connect every technical choice back to intent.
|
||||
|
||||
If you can't explain WHY for each choice, you're defaulting. Stop and think.
|
||||
|
||||
---
|
||||
|
||||
# Design Principles
|
||||
|
||||
## Token Architecture
|
||||
|
||||
Every color in your interface should trace back to a small set of primitives: foreground (text hierarchy), background (surface elevation), border (separation hierarchy), brand, and semantic (destructive, warning, success). No random hex values — everything maps to primitives.
|
||||
|
||||
### Text Hierarchy
|
||||
|
||||
Don't just have "text" and "gray text." Build four levels — primary, secondary, tertiary, muted. Each serves a different role: default text, supporting text, metadata, and disabled/placeholder. Use all four consistently. If you're only using two, your hierarchy is too flat.
|
||||
|
||||
### Border Progression
|
||||
|
||||
Borders aren't binary. Build a scale that matches intensity to importance — standard separation, softer separation, emphasis, maximum emphasis. Not every boundary deserves the same weight.
|
||||
|
||||
### Control Tokens
|
||||
|
||||
Form controls have specific needs. Don't reuse surface tokens — create dedicated ones for control backgrounds, control borders, and focus states. This lets you tune interactive elements independently from layout surfaces.
|
||||
|
||||
## Spacing
|
||||
|
||||
Pick a base unit and stick to multiples. Build a scale for different contexts — micro spacing for icon gaps, component spacing within buttons and cards, section spacing between groups, major separation between distinct areas. Random values signal no system.
|
||||
|
||||
## Padding
|
||||
|
||||
Keep it symmetrical. If one side has a value, others should match unless content naturally requires asymmetry.
|
||||
|
||||
## Depth
|
||||
|
||||
Choose ONE approach and commit:
|
||||
- **Borders-only** — Clean, technical. For dense tools.
|
||||
- **Subtle shadows** — Soft lift. For approachable products.
|
||||
- **Layered shadows** — Premium, dimensional. For cards that need presence.
|
||||
- **Surface color shifts** — Background tints establish hierarchy without shadows.
|
||||
|
||||
Don't mix approaches.
|
||||
|
||||
## Border Radius
|
||||
|
||||
Sharper feels technical. Rounder feels friendly. Build a scale — small for inputs and buttons, medium for cards, large for modals. Don't mix sharp and soft randomly.
|
||||
|
||||
## Typography
|
||||
|
||||
Build distinct levels distinguishable at a glance. Headlines need weight and tight tracking for presence. Body needs comfortable weight for readability. Labels need medium weight that works at smaller sizes. Data needs monospace with tabular number spacing for alignment. Don't rely on size alone — combine size, weight, and letter-spacing.
|
||||
|
||||
## Card Layouts
|
||||
|
||||
A metric card doesn't have to look like a plan card doesn't have to look like a settings card. Design each card's internal structure for its specific content — but keep the surface treatment consistent: same border weight, shadow depth, corner radius, padding scale.
|
||||
|
||||
## Controls
|
||||
|
||||
Native `<select>` and `<input type="date">` render OS-native elements that cannot be styled. Build custom components — trigger buttons with positioned dropdowns, calendar popovers, styled state management.
|
||||
|
||||
## Iconography
|
||||
|
||||
Icons clarify, not decorate — if removing an icon loses no meaning, remove it. Choose one icon set and stick with it. Give standalone icons presence with subtle background containers.
|
||||
|
||||
## Animation
|
||||
|
||||
Fast micro-interactions, smooth easing. Larger transitions can be slightly longer. Use deceleration easing. Avoid spring/bounce in professional interfaces.
|
||||
|
||||
## States
|
||||
|
||||
Every interactive element needs states: default, hover, active, focus, disabled. Data needs states too: loading, empty, error. Missing states feel broken.
|
||||
|
||||
## Navigation Context
|
||||
|
||||
Screens need grounding. A data table floating in space feels like a component demo, not a product. Include navigation showing where you are in the app, location indicators, and user context. When building sidebars, consider same background as main content with border separation rather than different colors.
|
||||
|
||||
## Dark Mode
|
||||
|
||||
Dark interfaces have different needs. Shadows are less visible on dark backgrounds — lean on borders for definition. Semantic colors (success, warning, error) often need slight desaturation. The hierarchy system still applies, just with inverted values.
|
||||
|
||||
---
|
||||
|
||||
# Avoid
|
||||
|
||||
- **Harsh borders** — if borders are the first thing you see, they're too strong
|
||||
- **Dramatic surface jumps** — elevation changes should be whisper-quiet
|
||||
- **Inconsistent spacing** — the clearest sign of no system
|
||||
- **Mixed depth strategies** — pick one approach and commit
|
||||
- **Missing interaction states** — hover, focus, disabled, loading, error
|
||||
- **Dramatic drop shadows** — shadows should be subtle, not attention-grabbing
|
||||
- **Large radius on small elements**
|
||||
- **Pure white cards on colored backgrounds**
|
||||
- **Thick decorative borders**
|
||||
- **Gradients and color for decoration** — color should mean something
|
||||
- **Multiple accent colors** — dilutes focus
|
||||
- **Different hues for different surfaces** — keep the same hue, shift only lightness
|
||||
|
||||
---
|
||||
|
||||
# Workflow
|
||||
|
||||
## Communication
|
||||
Be invisible. Don't announce modes or narrate process.
|
||||
|
||||
**Never say:** "I'm in ESTABLISH MODE", "Let me check system.md..."
|
||||
|
||||
**Instead:** Jump into work. State suggestions with reasoning.
|
||||
|
||||
## Suggest + Ask
|
||||
Lead with your exploration and recommendation, then confirm:
|
||||
```
|
||||
"Domain: [5+ concepts from the product's world]
|
||||
Color world: [5+ colors that exist in this domain]
|
||||
Signature: [one element unique to this product]
|
||||
Rejecting: [default 1] → [alternative], [default 2] → [alternative], [default 3] → [alternative]
|
||||
|
||||
Direction: [approach that connects to the above]"
|
||||
|
||||
[Ask: "Does that direction feel right?"]
|
||||
```
|
||||
|
||||
## If Project Has system.md
|
||||
Read `.interface-design/system.md` and apply. Decisions are made.
|
||||
|
||||
## If No system.md
|
||||
1. Explore domain — Produce all four required outputs
|
||||
2. Propose — Direction must reference all four
|
||||
3. Confirm — Get user buy-in
|
||||
4. Build — Apply principles
|
||||
5. **Evaluate** — Run the mandate checks before showing
|
||||
6. Offer to save
|
||||
|
||||
---
|
||||
|
||||
# After Completing a Task
|
||||
|
||||
When you finish building something, **always offer to save**:
|
||||
|
||||
```
|
||||
"Want me to save these patterns for future sessions?"
|
||||
```
|
||||
|
||||
If yes, write to `.interface-design/system.md`:
|
||||
- Direction and feel
|
||||
- Depth strategy (borders/shadows/layered)
|
||||
- Spacing base unit
|
||||
- Key component patterns
|
||||
|
||||
### What to Save
|
||||
|
||||
Add patterns when a component is used 2+ times, is reusable across the project, or has specific measurements worth remembering. Don't save one-off components, temporary experiments, or variations better handled with props.
|
||||
|
||||
### Consistency Checks
|
||||
|
||||
If system.md defines values, check against them: spacing on the defined grid, depth using the declared strategy throughout, colors from the defined palette, documented patterns reused instead of reinvented.
|
||||
|
||||
This compounds — each save makes future work faster and more consistent.
|
||||
|
||||
---
|
||||
|
||||
# Deep Dives
|
||||
|
||||
For more detail on specific topics:
|
||||
- `references/principles.md` — Code examples, specific values, dark mode
|
||||
- `references/validation.md` — Memory management, when to update system.md
|
||||
- `references/critique.md` — Post-build craft critique protocol
|
||||
|
||||
# Commands
|
||||
|
||||
- `/interface-design:status` — Current system state
|
||||
- `/interface-design:audit` — Check code against system
|
||||
- `/interface-design:extract` — Extract patterns from code
|
||||
- `/interface-design:critique` — Critique your build for craft, then rebuild what defaulted
|
||||
@@ -1,67 +0,0 @@
|
||||
# Critique
|
||||
|
||||
Your first build shipped the structure. Now look at it the way a design lead reviews a junior's work — not asking "does this work?" but "would I put my name on this?"
|
||||
|
||||
---
|
||||
|
||||
## The Gap
|
||||
|
||||
There's a distance between correct and crafted. Correct means the layout holds, the grid aligns, the colors don't clash. Crafted means someone cared about every decision down to the last pixel. You can feel the difference immediately — the way you tell a hand-thrown mug from an injection-molded one. Both hold coffee. One has presence.
|
||||
|
||||
Your first output lives in correct. This command pulls it toward crafted.
|
||||
|
||||
---
|
||||
|
||||
## See the Composition
|
||||
|
||||
Step back. Look at the whole thing.
|
||||
|
||||
Does the layout have rhythm? Great interfaces breathe unevenly — dense tooling areas give way to open content, heavy elements balance against light ones, the eye travels through the page with purpose. Default layouts are monotone: same card size, same gaps, same density everywhere. Flatness is the sound of no one deciding.
|
||||
|
||||
Are proportions doing work? A 280px sidebar next to full-width content says "navigation serves content." A 360px sidebar says "these are peers." The specific number declares what matters. If you can't articulate what your proportions are saying, they're not saying anything.
|
||||
|
||||
Is there a clear focal point? Every screen has one thing the user came here to do. That thing should dominate — through size, position, contrast, or the space around it. When everything competes equally, nothing wins and the interface feels like a parking lot.
|
||||
|
||||
---
|
||||
|
||||
## See the Craft
|
||||
|
||||
Move close. Pixel-close.
|
||||
|
||||
The spacing grid is non-negotiable — every value a multiple of 4, no exceptions — but correctness alone isn't craft. Craft is knowing that a tool panel at 16px padding feels workbench-tight while the same card at 24px feels like a brochure. The same number can be right in one context and lazy in another. Density is a design decision, not a constant.
|
||||
|
||||
Typography should be legible even squinted. If size is the only thing separating your headline from your body from your label, the hierarchy is too weak. Weight, tracking, and opacity create layers that size alone can't.
|
||||
|
||||
Surfaces should whisper hierarchy. Not thick borders, not dramatic shadows — quiet tonal shifts where you feel the depth without seeing it. Remove every border from your CSS mentally. Can you still perceive the structure through surface color alone? If not, your surfaces aren't working hard enough.
|
||||
|
||||
Interactive elements need life. Every button, link, and clickable region should respond to hover and press. Not dramatically — a subtle shift in background, a gentle darkening. Missing states make an interface feel like a photograph of software instead of software.
|
||||
|
||||
---
|
||||
|
||||
## See the Content
|
||||
|
||||
Read every visible string as a user would. Not checking for typos — checking for truth.
|
||||
|
||||
Does this screen tell one coherent story? Could a real person at a real company be looking at exactly this data right now? Or does the page title belong to one product, the article body to another, and the sidebar metrics to a third?
|
||||
|
||||
Content incoherence breaks the illusion faster than any visual flaw. A beautifully designed interface with nonsensical content is a movie set with no script.
|
||||
|
||||
---
|
||||
|
||||
## See the Structure
|
||||
|
||||
Open the CSS and find the lies — the places that look right but are held together with tape.
|
||||
|
||||
Negative margins undoing a parent's padding. Calc() values that exist only as workarounds. Absolute positioning to escape layout flow. Each is a shortcut where a clean solution exists. Cards with full-width dividers use flex column and section-level padding. Centered content uses max-width with auto margins. The correct answer is always simpler than the hack.
|
||||
|
||||
---
|
||||
|
||||
## Again
|
||||
|
||||
Look at your output one final time.
|
||||
|
||||
Ask: "If they said this lacks craft, what would they point to?"
|
||||
|
||||
That thing you just thought of — fix it. Then ask again.
|
||||
|
||||
The first build was the draft. The critique is the design.
|
||||
@@ -1,86 +0,0 @@
|
||||
# Craft in Action
|
||||
|
||||
This shows how the subtle layering principle translates to real decisions. Learn the thinking, not the code. Your values will differ — the approach won't.
|
||||
|
||||
---
|
||||
|
||||
## The Subtle Layering Mindset
|
||||
|
||||
Before looking at any example, internalize this: **you should barely notice the system working.**
|
||||
|
||||
When you look at Vercel's dashboard, you don't think "nice borders." You just understand the structure. When you look at Supabase, you don't think "good surface elevation." You just know what's above what. The craft is invisible — that's how you know it's working.
|
||||
|
||||
---
|
||||
|
||||
## Example: Dashboard with Sidebar and Dropdown
|
||||
|
||||
### The Surface Decisions
|
||||
|
||||
**Why so subtle?** Each elevation jump should be only a few percentage points of lightness. You can barely see the difference in isolation. But when surfaces stack, the hierarchy emerges. This is the Vercel/Supabase way — whisper-quiet shifts that you feel rather than see.
|
||||
|
||||
**What NOT to do:** Don't make dramatic jumps between elevations. That's jarring. Don't use different hues for different levels. Keep the same hue, shift only lightness.
|
||||
|
||||
### The Border Decisions
|
||||
|
||||
**Why rgba, not solid colors?** Low opacity borders blend with their background. A low-opacity white border on a dark surface is barely there — it defines the edge without demanding attention. Solid hex borders look harsh in comparison.
|
||||
|
||||
**The test:** Look at your interface from arm's length. If borders are the first thing you notice, reduce opacity. If you can't find where regions end, increase slightly.
|
||||
|
||||
### The Sidebar Decision
|
||||
|
||||
**Why same background as canvas, not different?**
|
||||
|
||||
Many dashboards make the sidebar a different color. This fragments the visual space — now you have "sidebar world" and "content world."
|
||||
|
||||
Better: Same background, subtle border separation. The sidebar is part of the app, not a separate region. Vercel does this. Supabase does this. The border is enough.
|
||||
|
||||
### The Dropdown Decision
|
||||
|
||||
**Why surface-200, not surface-100?**
|
||||
|
||||
The dropdown floats above the card it emerged from. If both were surface-100, the dropdown would blend into the card — you'd lose the sense of layering. Surface-200 is just light enough to feel "above" without being dramatically different.
|
||||
|
||||
**Why border-overlay instead of border-default?**
|
||||
|
||||
Overlays (dropdowns, popovers) often need slightly more definition because they're floating in space. A touch more border opacity helps them feel contained without being harsh.
|
||||
|
||||
---
|
||||
|
||||
## Example: Form Controls
|
||||
|
||||
### Input Background Decision
|
||||
|
||||
**Why darker, not lighter?**
|
||||
|
||||
Inputs are "inset" — they receive content, they don't project it. A slightly darker background signals "type here" without needing heavy borders. This is the alternative-background principle.
|
||||
|
||||
### Focus State Decision
|
||||
|
||||
**Why subtle focus states?**
|
||||
|
||||
Focus needs to be visible, but you don't need a glowing ring or dramatic color. A noticeable increase in border opacity is enough for a clear state change. Subtle-but-noticeable — the same principle as surfaces.
|
||||
|
||||
---
|
||||
|
||||
## Adapt to Context
|
||||
|
||||
Your product might need:
|
||||
- Warmer hues (slight yellow/orange tint)
|
||||
- Cooler hues (blue-gray base)
|
||||
- Different lightness progression
|
||||
- Light mode (principles invert — higher elevation = shadow, not lightness)
|
||||
|
||||
**The principle is constant:** barely different, still distinguishable. The values adapt to context.
|
||||
|
||||
---
|
||||
|
||||
## The Craft Check
|
||||
|
||||
Apply the squint test to your work:
|
||||
|
||||
1. Blur your eyes or step back
|
||||
2. Can you still perceive hierarchy?
|
||||
3. Is anything jumping out at you?
|
||||
4. Can you tell where regions begin and end?
|
||||
|
||||
If hierarchy is visible and nothing is harsh — the subtle layering is working.
|
||||
@@ -1,235 +0,0 @@
|
||||
# Core Craft Principles
|
||||
|
||||
These apply regardless of design direction. This is the quality floor.
|
||||
|
||||
---
|
||||
|
||||
## Surface & Token Architecture
|
||||
|
||||
Professional interfaces don't pick colors randomly — they build systems. Understanding this architecture is the difference between "looks okay" and "feels like a real product."
|
||||
|
||||
### The Primitive Foundation
|
||||
|
||||
Every color in your interface should trace back to a small set of primitives:
|
||||
|
||||
- **Foreground** — text colors (primary, secondary, muted)
|
||||
- **Background** — surface colors (base, elevated, overlay)
|
||||
- **Border** — edge colors (default, subtle, strong)
|
||||
- **Brand** — your primary accent
|
||||
- **Semantic** — functional colors (destructive, warning, success)
|
||||
|
||||
Don't invent new colors. Map everything to these primitives.
|
||||
|
||||
### Surface Elevation Hierarchy
|
||||
|
||||
Surfaces stack. A dropdown sits above a card which sits above the page. Build a numbered system:
|
||||
|
||||
```
|
||||
Level 0: Base background (the app canvas)
|
||||
Level 1: Cards, panels (same visual plane as base)
|
||||
Level 2: Dropdowns, popovers (floating above)
|
||||
Level 3: Nested dropdowns, stacked overlays
|
||||
Level 4: Highest elevation (rare)
|
||||
```
|
||||
|
||||
In dark mode, higher elevation = slightly lighter. In light mode, higher elevation = slightly lighter or uses shadow. The principle: **elevated surfaces need visual distinction from what's beneath them.**
|
||||
|
||||
### The Subtlety Principle
|
||||
|
||||
This is where most interfaces fail. Study Vercel, Supabase, Linear — their surfaces are **barely different** but still distinguishable. Their borders are **light but not invisible**.
|
||||
|
||||
**For surfaces:** The difference between elevation levels should be subtle — a few percentage points of lightness, not dramatic jumps. In dark mode, surface-100 might be 7% lighter than base, surface-200 might be 9%, surface-300 might be 12%. You can barely see it, but you feel it.
|
||||
|
||||
**For borders:** Borders should define regions without demanding attention. Use low opacity (0.05-0.12 alpha for dark mode, slightly higher for light). The border should disappear when you're not looking for it, but be findable when you need to understand the structure.
|
||||
|
||||
**The test:** Squint at your interface. You should still perceive the hierarchy — what's above what, where regions begin and end. But no single border or surface should jump out at you. If borders are the first thing you notice, they're too strong. If you can't find where one region ends and another begins, they're too subtle.
|
||||
|
||||
**Common AI mistakes to avoid:**
|
||||
- Borders that are too visible (1px solid gray instead of subtle rgba)
|
||||
- Surface jumps that are too dramatic (going from dark to light instead of dark to slightly-less-dark)
|
||||
- Using different hues for different surfaces (gray card on blue background)
|
||||
- Harsh dividers where subtle borders would do
|
||||
|
||||
### Text Hierarchy via Tokens
|
||||
|
||||
Don't just have "text" and "gray text." Build four levels:
|
||||
|
||||
- **Primary** — default text, highest contrast
|
||||
- **Secondary** — supporting text, slightly muted
|
||||
- **Tertiary** — metadata, timestamps, less important
|
||||
- **Muted** — disabled, placeholder, lowest contrast
|
||||
|
||||
Use all four consistently. If you're only using two, your hierarchy is too flat.
|
||||
|
||||
### Border Progression
|
||||
|
||||
Borders aren't binary. Build a scale:
|
||||
|
||||
- **Default** — standard borders
|
||||
- **Subtle/Muted** — softer separation
|
||||
- **Strong** — emphasis, hover states
|
||||
- **Stronger** — maximum emphasis, focus rings
|
||||
|
||||
Match border intensity to the importance of the boundary.
|
||||
|
||||
### Dedicated Control Tokens
|
||||
|
||||
Form controls (inputs, checkboxes, selects) have specific needs. Don't just reuse surface tokens — create dedicated ones:
|
||||
|
||||
- **Control background** — often different from surface backgrounds
|
||||
- **Control border** — needs to feel interactive
|
||||
- **Control focus** — clear focus indication
|
||||
|
||||
This separation lets you tune controls independently from layout surfaces.
|
||||
|
||||
### Context-Aware Bases
|
||||
|
||||
Different areas of your app might need different base surfaces:
|
||||
|
||||
- **Marketing pages** — might use darker/richer backgrounds
|
||||
- **Dashboard/app** — might use neutral working backgrounds
|
||||
- **Sidebar** — might differ from main canvas
|
||||
|
||||
The surface hierarchy works the same way — it just starts from a different base.
|
||||
|
||||
### Alternative Backgrounds for Depth
|
||||
|
||||
Beyond shadows, use contrasting backgrounds to create depth. An "alternative" or "inset" background makes content feel recessed. Useful for:
|
||||
|
||||
- Empty states in data grids
|
||||
- Code blocks
|
||||
- Inset panels
|
||||
- Visual grouping without borders
|
||||
|
||||
---
|
||||
|
||||
## Spacing System
|
||||
|
||||
Pick a base unit (4px and 8px are common) and use multiples throughout. The specific number matters less than consistency — every spacing value should be explainable as "X times the base unit."
|
||||
|
||||
Build a scale for different contexts:
|
||||
- Micro spacing (icon gaps, tight element pairs)
|
||||
- Component spacing (within buttons, inputs, cards)
|
||||
- Section spacing (between related groups)
|
||||
- Major separation (between distinct sections)
|
||||
|
||||
## Symmetrical Padding
|
||||
|
||||
TLBR must match. If top padding is 16px, left/bottom/right must also be 16px. Exception: when content naturally creates visual balance.
|
||||
|
||||
```css
|
||||
/* Good */
|
||||
padding: 16px;
|
||||
padding: 12px 16px; /* Only when horizontal needs more room */
|
||||
|
||||
/* Bad */
|
||||
padding: 24px 16px 12px 16px;
|
||||
```
|
||||
|
||||
## Border Radius Consistency
|
||||
|
||||
Sharper corners feel technical, rounder corners feel friendly. Pick a scale that fits your product's personality and use it consistently.
|
||||
|
||||
The key is having a system: small radius for inputs and buttons, medium for cards, large for modals or containers. Don't mix sharp and soft randomly — inconsistent radius is as jarring as inconsistent spacing.
|
||||
|
||||
## Depth & Elevation Strategy
|
||||
|
||||
Match your depth approach to your design direction. Choose ONE and commit:
|
||||
|
||||
**Borders-only (flat)** — Clean, technical, dense. Works for utility-focused tools where information density matters more than visual lift. Linear, Raycast, and many developer tools use almost no shadows — just subtle borders to define regions.
|
||||
|
||||
**Subtle single shadows** — Soft lift without complexity. A simple `0 1px 3px rgba(0,0,0,0.08)` can be enough. Works for approachable products that want gentle depth.
|
||||
|
||||
**Layered shadows** — Rich, premium, dimensional. Multiple shadow layers create realistic depth. Stripe and Mercury use this approach. Best for cards that need to feel like physical objects.
|
||||
|
||||
**Surface color shifts** — Background tints establish hierarchy without any shadows. A card at `#fff` on a `#f8fafc` background already feels elevated.
|
||||
|
||||
```css
|
||||
/* Borders-only approach */
|
||||
--border: rgba(0, 0, 0, 0.08);
|
||||
--border-subtle: rgba(0, 0, 0, 0.05);
|
||||
border: 0.5px solid var(--border);
|
||||
|
||||
/* Single shadow approach */
|
||||
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||
|
||||
/* Layered shadow approach */
|
||||
--shadow-layered:
|
||||
0 0 0 0.5px rgba(0, 0, 0, 0.05),
|
||||
0 1px 2px rgba(0, 0, 0, 0.04),
|
||||
0 2px 4px rgba(0, 0, 0, 0.03),
|
||||
0 4px 8px rgba(0, 0, 0, 0.02);
|
||||
```
|
||||
|
||||
## Card Layouts
|
||||
|
||||
Monotonous card layouts are lazy design. A metric card doesn't have to look like a plan card doesn't have to look like a settings card.
|
||||
|
||||
Design each card's internal structure for its specific content — but keep the surface treatment consistent: same border weight, shadow depth, corner radius, padding scale, typography.
|
||||
|
||||
## Isolated Controls
|
||||
|
||||
UI controls deserve container treatment. Date pickers, filters, dropdowns — these should feel like crafted objects.
|
||||
|
||||
**Never use native form elements for styled UI.** Native `<select>`, `<input type="date">`, and similar elements render OS-native dropdowns that cannot be styled. Build custom components instead:
|
||||
|
||||
- Custom select: trigger button + positioned dropdown menu
|
||||
- Custom date picker: input + calendar popover
|
||||
- Custom checkbox/radio: styled div with state management
|
||||
|
||||
Custom select triggers must use `display: inline-flex` with `white-space: nowrap` to keep text and chevron icons on the same row.
|
||||
|
||||
## Typography Hierarchy
|
||||
|
||||
Build distinct levels that are visually distinguishable at a glance:
|
||||
|
||||
- **Headlines** — heavier weight, tighter letter-spacing for presence
|
||||
- **Body** — comfortable weight for readability
|
||||
- **Labels/UI** — medium weight, works at smaller sizes
|
||||
- **Data** — often monospace, needs `tabular-nums` for alignment
|
||||
|
||||
Don't rely on size alone. Combine size, weight, and letter-spacing to create clear hierarchy. If you squint and can't tell headline from body, the hierarchy is too weak.
|
||||
|
||||
## Monospace for Data
|
||||
|
||||
Numbers, IDs, codes, timestamps belong in monospace. Use `tabular-nums` for columnar alignment. Mono signals "this is data."
|
||||
|
||||
## Iconography
|
||||
|
||||
Icons clarify, not decorate — if removing an icon loses no meaning, remove it. Choose a consistent icon set and stick with it throughout the product.
|
||||
|
||||
Give standalone icons presence with subtle background containers. Icons next to text should align optically, not mathematically.
|
||||
|
||||
## Animation
|
||||
|
||||
Keep it fast and functional. Micro-interactions (hover, focus) should feel instant — around 150ms. Larger transitions (modals, panels) can be slightly longer — 200-250ms.
|
||||
|
||||
Use smooth deceleration easing (ease-out variants). Avoid spring/bounce effects in professional interfaces — they feel playful, not serious.
|
||||
|
||||
## Contrast Hierarchy
|
||||
|
||||
Build a four-level system: foreground (primary) → secondary → muted → faint. Use all four consistently.
|
||||
|
||||
## Color Carries Meaning
|
||||
|
||||
Gray builds structure. Color communicates — status, action, emphasis, identity. Unmotivated color is noise. Color that reinforces the product's world is character.
|
||||
|
||||
## Navigation Context
|
||||
|
||||
Screens need grounding. A data table floating in space feels like a component demo, not a product. Consider including:
|
||||
|
||||
- **Navigation** — sidebar or top nav showing where you are in the app
|
||||
- **Location indicator** — breadcrumbs, page title, or active nav state
|
||||
- **User context** — who's logged in, what workspace/org
|
||||
|
||||
When building sidebars, consider using the same background as the main content area. Rely on a subtle border for separation rather than different background colors.
|
||||
|
||||
## Dark Mode
|
||||
|
||||
Dark interfaces have different needs:
|
||||
|
||||
**Borders over shadows** — Shadows are less visible on dark backgrounds. Lean more on borders for definition.
|
||||
|
||||
**Adjust semantic colors** — Status colors (success, warning, error) often need to be slightly desaturated for dark backgrounds.
|
||||
|
||||
**Same structure, different values** — The hierarchy system still applies, just with inverted values.
|
||||
@@ -1,48 +0,0 @@
|
||||
# Memory Management
|
||||
|
||||
When and how to update `.interface-design/system.md`.
|
||||
|
||||
## When to Add Patterns
|
||||
|
||||
Add to system.md when:
|
||||
- Component used 2+ times
|
||||
- Pattern is reusable across the project
|
||||
- Has specific measurements worth remembering
|
||||
|
||||
## Pattern Format
|
||||
|
||||
```markdown
|
||||
### Button Primary
|
||||
- Height: 36px
|
||||
- Padding: 12px 16px
|
||||
- Radius: 6px
|
||||
- Font: 14px, 500 weight
|
||||
```
|
||||
|
||||
## Don't Document
|
||||
|
||||
- One-off components
|
||||
- Temporary experiments
|
||||
- Variations better handled with props
|
||||
|
||||
## Pattern Reuse
|
||||
|
||||
Before creating a component, check system.md:
|
||||
- Pattern exists? Use it.
|
||||
- Need variation? Extend, don't create new.
|
||||
|
||||
Memory compounds: each pattern saved makes future work faster and more consistent.
|
||||
|
||||
---
|
||||
|
||||
# Validation Checks
|
||||
|
||||
If system.md defines specific values, check consistency:
|
||||
|
||||
**Spacing** — All values multiples of the defined base?
|
||||
|
||||
**Depth** — Using the declared strategy throughout? (borders-only means no shadows)
|
||||
|
||||
**Colors** — Using defined palette, not random hex codes?
|
||||
|
||||
**Patterns** — Reusing documented patterns instead of creating new?
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -78,7 +78,6 @@ web_modules/
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
apps/backend/.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
@@ -156,3 +155,4 @@ apps/backend/src/register-routes.js
|
||||
apps/backend/src/server.js
|
||||
apps/backend/src/index.js
|
||||
apps/backend/src/types/*.js
|
||||
|
||||
|
||||
254
AGENTS.md
254
AGENTS.md
@@ -33,100 +33,18 @@ packages/api-contract/ # Shared Zod schemas, types, route definitions
|
||||
2. Implement handler in `apps/backend`
|
||||
3. Consume from `apps/frontend` via workspace import `@repo/api-contract`
|
||||
|
||||
## Endpoint Pattern
|
||||
|
||||
Every new endpoint must follow the **Result pattern** with the **validate helper**.
|
||||
|
||||
### Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `apps/backend/src/lib/result.ts` | `Result<T>` type, `ok()`, `err()` |
|
||||
| `apps/backend/src/lib/errors.ts` | `AppError` discriminated union, `Errors` factory |
|
||||
| `apps/backend/src/lib/http/handle-result.ts` | `handleResult()` — bridges `Result` to HTTP |
|
||||
| `apps/backend/src/lib/http/validate.ts` | `validate.json()`, `.query()`, `.param()`, `.header()`, `.form()` |
|
||||
|
||||
### Layers
|
||||
|
||||
**1. Route** — Use `validate.json(schema)`, `validate.param(schema)`, etc. as Hono middleware.
|
||||
|
||||
```typescript
|
||||
import { validate } from '@/lib/http/validate';
|
||||
import { z } from 'zod';
|
||||
|
||||
const idParams = z.object({ id: z.string() });
|
||||
router.post('/', validate.json(createSchema), createHandler);
|
||||
router.get('/:id', validate.param(idParams), getHandler);
|
||||
```
|
||||
|
||||
**2. Service** — Return `Result<T>`. Use `ok(value)` on success, `err(Errors.*(...))` on failure.
|
||||
|
||||
```typescript
|
||||
import { Result, ok, err } from '@/lib/result';
|
||||
import { Errors } from '@/lib/errors';
|
||||
|
||||
export async function doSomething(input: Input): Promise<Result<Output>> {
|
||||
if (conflict) return err(Errors.conflict('Already exists'));
|
||||
return ok(result);
|
||||
}
|
||||
```
|
||||
|
||||
**3. Handler** — Call the service and pass the `Result` to `handleResult`.
|
||||
|
||||
```typescript
|
||||
import { handleResult } from '@/lib/http/handle-result';
|
||||
import { doSomething } from './service';
|
||||
|
||||
export async function myHandler(c: AppContext) {
|
||||
const payload = c.req.valid('json') as Input;
|
||||
return handleResult(c, await doSomething(payload), 201);
|
||||
}
|
||||
```
|
||||
|
||||
### Never
|
||||
|
||||
- ❌ Throw custom error classes from services
|
||||
- ❌ Use try/catch in handlers for business logic errors
|
||||
- ❌ Use `zValidator` directly — always use `validate.*`
|
||||
|
||||
## Authentication (Better Auth)
|
||||
|
||||
The project uses **Better Auth** for session management, replacing the legacy Supabase Auth.
|
||||
|
||||
- **Backend Context**: `AppContext` (mapped via `AppEnv`) provides `c.get('user')` and `c.get('session')`.
|
||||
- **User Roles**: The `User` model includes a `role` field (default: `member`). Use `requireSuperAdmin` middleware for protected admin routes.
|
||||
- **Session Persistence**:
|
||||
- Backend: Hono CORS must have `credentials: true`.
|
||||
- Frontend: `authClient` must have `fetchOptions.credentials: 'include'`.
|
||||
- Frontend: Axios instance must have `withCredentials: true`.
|
||||
|
||||
## Key Quirks
|
||||
|
||||
- **Prisma 7**: Uses `prisma.config.ts`, requires `DATABASE_URL` env var at generate time.
|
||||
- **Gravatar Fallback**: Users without an `image` get an automatic Gravatar Identicon.
|
||||
- Backend: Handled in `user.service.ts` for profile API.
|
||||
- Frontend: Handled in `AuthProvider` (`auth.tsx`) for the session state.
|
||||
- **Zod v4**: Use `.issues` instead of `.errors` for validation errors.
|
||||
- **Prisma 7**: Uses `prisma.config.ts`, requires `DATABASE_URL` env var at generate time
|
||||
- **Zod v4**: Use `.issues` instead of `.errors` for validation errors
|
||||
- **Generated files**: `routeTree.gen.ts` and `tsconfig*.json` are auto-generated (ignored by Biome)
|
||||
- **TanStack Router**: Routes are code-generated. Use `--filter frontend build` not raw vite build.
|
||||
|
||||
## Real-time Updates (SSE)
|
||||
|
||||
The project uses **Server-Sent Events (SSE)** for real-time booking updates in the admin panel.
|
||||
|
||||
- **Backend**: `apps/backend/src/lib/sse.ts` provides the `sseManager` and SSE endpoint `/api/events/:channel`.
|
||||
- **Event flow**: When a public booking is created, the handler emits to channel `complex:{complexId}`.
|
||||
- **Frontend**: `home-page.tsx` connects to the SSE endpoint and invalidates the bookings query on new events.
|
||||
|
||||
**Important - Multi-process limitation**: The current SSE implementation works with a single Bun process only. If you deploy with multiple workers (e.g., clustering in Dokploy), events won't be shared across workers. For production with multiple workers, use Redis for pub/sub:
|
||||
- Install `@hono/node-server` or a Redis client
|
||||
- Replace `sseManager` with Redis pub/sub
|
||||
- Or fall back to Socket.io with Redis adapter
|
||||
|
||||
## Docker Deployment (Dokploy)
|
||||
|
||||
- **Build Context**: `./` (monorepo root)
|
||||
- **Dockerfile**: `Dockerfile` (in root, not `apps/backend/`)
|
||||
- **Required args**: `DATABASE_URL`, `VITE_API_BASE_URL`, `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL`
|
||||
- **Required args**: `DATABASE_URL`, `VITE_API_BASE_URL`, `VITE_SUPABASE_URL`, `VITE_SUPABASE_ANON_KEY`
|
||||
- **bun.lock must be tracked**: It's in `.gitignore` by default - remove it for Docker builds
|
||||
|
||||
## Linting
|
||||
@@ -141,169 +59,9 @@ Biome is used (not ESLint). Config in `biome.json`:
|
||||
|
||||
**Backend** (`apps/backend/.env`):
|
||||
- `DATABASE_URL` - PostgreSQL connection (required for Prisma)
|
||||
- `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL` - Auth core
|
||||
- `APP_BASE_URL` - Frontend URL for trusted origins
|
||||
- `CORS_ORIGIN` - Frontend URL for CORS policy
|
||||
- `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` - Google OAuth (see below)
|
||||
- `SUPABASE_URL`, `SUPABASE_ANON_KEY` - Auth
|
||||
- `CORS_ORIGIN` - Frontend URL
|
||||
|
||||
**Frontend** (`apps/frontend/.env`):
|
||||
- `VITE_*` prefix required (Vite embeds these at build time)
|
||||
- `VITE_API_BASE_URL` - Backend URL (default: http://localhost:3000)
|
||||
|
||||
## Google OAuth
|
||||
|
||||
To enable login with Google:
|
||||
|
||||
1. Create OAuth credentials in Google Cloud Console:
|
||||
- Application type: Web application
|
||||
- Authorized redirect URI: `{BETTER_AUTH_URL}/api/auth/callback/google`
|
||||
|
||||
2. Add env vars to `.env.example`:
|
||||
```
|
||||
GOOGLE_CLIENT_ID=your-google-client-id
|
||||
GOOGLE_CLIENT_SECRET=your-google-client-secret
|
||||
```
|
||||
|
||||
3. The backend configures `socialProviders.google` automatically.
|
||||
|
||||
4. Frontend uses `authClient.signIn.social({ provider: 'google', callbackURL: 'http://localhost:5173' })`.
|
||||
|
||||
## Complex Selection (Multi-tenancy)
|
||||
|
||||
The app supports users with multiple complexes. Each user has a role per complex (`ADMIN` or `EMPLOYEE`), stored in `ComplexUser` table.
|
||||
|
||||
### Flow
|
||||
|
||||
1. **Login** (password or Google OAuth):
|
||||
- After auth, call `GET /api/complexes/mine` to get user's complexes
|
||||
- If 1 complex → auto-select via `POST /api/complexes/select` → redirect to `/`
|
||||
- If >1 complexes → redirect to `/select-complex`
|
||||
|
||||
2. **Select Complex Page** (`/select-complex`):
|
||||
- List all complexes with roles
|
||||
- User selects one → `POST /api/complexes/select` → set cookie → redirect to `/`
|
||||
|
||||
3. **Home Page** (`/`):
|
||||
- If no cookie (first visit) → auto-select if 1 complex, else redirect
|
||||
- Use `GET /api/complexes/me` to get current selected complex
|
||||
|
||||
### Cookie
|
||||
|
||||
- Name: `selected-complex-id`
|
||||
- httpOnly, secure (prod), sameSite: strict
|
||||
- MaxAge: 30 days
|
||||
- Set by `POST /api/complexes/select`
|
||||
|
||||
### Endpoints
|
||||
|
||||
| Method | Endpoint | Description |
|
||||
|--------|----------|-------------|
|
||||
| GET | `/api/complexes/mine` | List all complexes with role |
|
||||
| GET | `/api/complexes/me` | Get currently selected complex |
|
||||
| POST | `/api/complexes/select` | Select complex (sets cookie) |
|
||||
|
||||
### Profile Role
|
||||
|
||||
The profile page shows the user's role for the **selected complex**, not the global user role. This is fetched from `ComplexUser` table using the cookie value.
|
||||
|
||||
## Frontend API Client
|
||||
|
||||
The API client is split into modular files for better maintainability and testability.
|
||||
|
||||
### Structure
|
||||
|
||||
```
|
||||
lib/
|
||||
├── api-client.ts # Main barrel file (~70 lines)
|
||||
└── api/
|
||||
├── base.ts # ApiClientError, configureApiClient, apiBaseUrl
|
||||
├── http.ts # Axios instance with interceptors
|
||||
├── index.ts # Re-exports all resources
|
||||
└── resources/
|
||||
├── complexes.ts # Complex endpoints
|
||||
├── courts.ts # Court endpoints
|
||||
├── bookings.ts # Public & admin booking endpoints
|
||||
├── user.ts # User profile endpoint
|
||||
├── sports.ts # Sport endpoints
|
||||
├── onboarding.ts # Onboarding endpoints
|
||||
└── plans.ts # Plan endpoints
|
||||
```
|
||||
|
||||
### Using the API Client
|
||||
|
||||
```typescript
|
||||
import { apiClient, authClient, ApiClientError, configureApiClient } from '@/lib/api-client';
|
||||
|
||||
// Via apiClient (barrel)
|
||||
await apiClient.complexes.listMine();
|
||||
await apiClient.publicBookings.getAvailability('my-club', { date: '2026-04-20' });
|
||||
|
||||
// Direct imports (for better tree-shaking)
|
||||
import { complexes, getAvailability } from '@/lib/api';
|
||||
await complexes.listMine();
|
||||
await getAvailability('my-club', { date: '2026-04-20' });
|
||||
```
|
||||
|
||||
### Adding a New Resource
|
||||
|
||||
1. Create `lib/api/resources/[resource].ts`
|
||||
2. Export functions using `http` from `../http`
|
||||
3. Add exports in `lib/api/index.ts`
|
||||
|
||||
## Email Templates
|
||||
|
||||
Todos los emails deben usar la misma estética. El layout compartido está en `apps/backend/src/emails/booking-confirmation.ts`.
|
||||
|
||||
### Layout (`wrapLayout`)
|
||||
|
||||
Exportado como `wrapLayout(content)`. Proporciona:
|
||||
- Fondo: `#edf7f4`
|
||||
- Card blanca: `max-width: 520px`, `border-radius: 28px`, `box-shadow: 0 24px 70px rgba(15,23,42,0.12)`, `border: 1px solid rgba(5,9,20,0.1)`
|
||||
- Playzer favicon: `{APP_BASE_URL}/playzer-favicon-512-transparent.png` (está en `apps/frontend/public/`)
|
||||
- **Sin `min-height: 100vh`**: la card empieza arriba, no centrada verticalmente
|
||||
|
||||
```typescript
|
||||
import { wrapLayout } from '@/emails/booking-confirmation';
|
||||
|
||||
const html = wrapLayout(`<tr>...contenido...</tr>`);
|
||||
```
|
||||
|
||||
### Estructura de cada email
|
||||
|
||||
| Sección | Descripción |
|
||||
|---------|-------------|
|
||||
| **Header** | Dos columnas: badge pill a la izquierda + Playzer (favicon + texto) a la derecha. El badge usa `border-radius: 999px`, `padding: 4px 12px`, `font-size: 11px`, `font-weight: 700`, `letter-spacing: 0.14em`, `text-transform: uppercase`. |
|
||||
| **Card fecha/hora** | Fondo `#f0fdf4`, borde `1px solid rgba(5,150,105,0.3)`, `border-radius: 24px`. Siempre verde aunque el email sea de cancelación. |
|
||||
| **Grilla detalles** | `border: 1px solid #e5e7eb`, `border-radius: 22px`, dos celdas de 50% con `border-right` en la primera. |
|
||||
| **Botón CTA** | Tabla con fondo `#059669`, `border-radius: 12px`, link blanco con `padding: 14px 32px`. |
|
||||
| **Pie** | Sin pie de marca. Solo texto secundario opcional centrado si es necesario. |
|
||||
| **Sin botones de acción** | Los emails de booking **no** incluyen los botones "Compartir por WhatsApp" ni "Hacer otra reserva". |
|
||||
|
||||
### Padding estándar
|
||||
|
||||
| Ubicación | Valor |
|
||||
|-----------|-------|
|
||||
| Wrapper (outer `<td>`) | `padding: 24px 12px` |
|
||||
| Primer `<td>` del contenido (header) | `padding: 24px 20px 16px` |
|
||||
| `<td>` intermedios (cards, texto) | `padding: 0 20px 16px` |
|
||||
| Último `<td>` del contenido | `padding: 0 20px 24px` |
|
||||
|
||||
### Colores de badges según estado
|
||||
|
||||
| Estado | Fondo badge | Texto badge |
|
||||
|--------|-------------|-------------|
|
||||
| Confirmado | `#f0fdf4` | `#15803d` |
|
||||
| Cancelado | `#fef2f2` | `#dc2626` |
|
||||
| No concretado | `#fffbeb` | `#d97706` |
|
||||
| Neutro (verificación, etc.) | `#f4f4f5` | `#71717a` |
|
||||
|
||||
### Archivos de templates
|
||||
|
||||
| Archivo | Templates |
|
||||
|---------|-----------|
|
||||
| `apps/backend/src/emails/booking-confirmation.ts` | `bookingConfirmationHtml`, `bookingCancelledHtml`, `bookingNoShowHtml` + exporta `wrapLayout` |
|
||||
| `apps/backend/src/lib/auth.ts` | Email de verificación de Better Auth (usa `wrapLayout` inline) |
|
||||
|
||||
### Regla general
|
||||
|
||||
Para emails nuevos: importar `wrapLayout`, construir el HTML interno con `<tr>`s, usar la misma estructura de cabecera (badge + Playzer), y nunca incluir el pie "Playzer — Reserva de canchas online". Usar `APP_BASE_URL` para construir URLs absolutas al logo.
|
||||
|
||||
24
Dockerfile
24
Dockerfile
@@ -18,7 +18,11 @@ WORKDIR /app
|
||||
COPY apps/frontend ./apps/frontend
|
||||
COPY packages ./packages
|
||||
ARG VITE_API_BASE_URL
|
||||
ARG VITE_SUPABASE_URL
|
||||
ARG VITE_SUPABASE_ANON_KEY
|
||||
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
||||
ENV VITE_SUPABASE_URL=${VITE_SUPABASE_URL}
|
||||
ENV VITE_SUPABASE_ANON_KEY=${VITE_SUPABASE_ANON_KEY}
|
||||
RUN bun run build:frontend
|
||||
|
||||
# =============================================================================
|
||||
@@ -32,19 +36,25 @@ COPY packages/api-contract/package.json packages/api-contract/
|
||||
RUN bun install
|
||||
|
||||
# =============================================================================
|
||||
# Stage 4: Build Backend (prisma generate + tsc)
|
||||
# Stage 4: Prisma Generate
|
||||
# =============================================================================
|
||||
FROM deps-backend AS build-backend
|
||||
FROM deps-backend AS prisma
|
||||
WORKDIR /app
|
||||
ARG DATABASE_URL
|
||||
ENV DATABASE_URL=${DATABASE_URL:-postgresql://dummy:dummy@localhost:5432/dummy}
|
||||
ENV DATABASE_URL=${DATABASE_URL}
|
||||
COPY apps/backend ./apps/backend
|
||||
COPY packages ./packages
|
||||
RUN bun --cwd apps/backend prisma:generate
|
||||
|
||||
# =============================================================================
|
||||
# Stage 5: Build Backend
|
||||
# =============================================================================
|
||||
FROM prisma AS build-backend
|
||||
WORKDIR /app
|
||||
COPY packages ./packages
|
||||
RUN bun --cwd apps/backend build
|
||||
|
||||
# =============================================================================
|
||||
# Stage 5: Runner - Production image
|
||||
# Stage 6: Runner - Production image
|
||||
# =============================================================================
|
||||
FROM oven/bun:1.3.11 AS runner
|
||||
WORKDIR /app
|
||||
@@ -54,10 +64,10 @@ COPY --from=build-backend /app/node_modules ./node_modules
|
||||
COPY --from=build-frontend /app/apps/frontend/dist ./apps/backend/public
|
||||
COPY --from=build-backend /app/apps/backend ./apps/backend
|
||||
COPY --from=build-backend /app/packages ./packages
|
||||
COPY package.json bun.lock ./
|
||||
COPY package.json ./
|
||||
COPY entrypoint.sh /app/entrypoint.sh
|
||||
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["/app/entrypoint.sh"]
|
||||
CMD ["/app/entrypoint.sh"]
|
||||
193
README.md
193
README.md
@@ -1,105 +1,184 @@
|
||||
# Playzer Monorepo
|
||||
# Monorepo (Frontend + Backend + Contrato API)
|
||||
|
||||
Este repositorio contiene:
|
||||
|
||||
- `apps/frontend`: React + Vite + TanStack Router/Query.
|
||||
- `apps/backend`: Bun + Hono + Prisma + Better Auth.
|
||||
- `packages/api-contract`: contratos Zod/tipos compartidos.
|
||||
- `apps/frontend`: app web en React + Vite + TanStack Router/Query.
|
||||
- `apps/backend`: API en Bun + Hono + Prisma + Supabase Auth.
|
||||
- `packages/api-contract`: contratos compartidos (schemas/types/rutas) entre frontend y backend.
|
||||
|
||||
## Requisitos
|
||||
## Objetivo de este README
|
||||
|
||||
- Bun reciente
|
||||
- PostgreSQL disponible
|
||||
Dejarte productivo/a en pocos minutos para que puedas:
|
||||
|
||||
1. Levantar frontend y backend en local.
|
||||
2. Configurar variables de entorno.
|
||||
3. Ejecutar migraciones de base de datos.
|
||||
4. Entender la estructura y el flujo de trabajo del proyecto.
|
||||
|
||||
## Stack técnico
|
||||
|
||||
- Runtime/package manager: `bun`
|
||||
- Frontend: `React 19`, `Vite`, `TanStack Router`, `TanStack Query`
|
||||
- Backend: `Bun`, `Hono`, `Prisma`, `PostgreSQL`
|
||||
- Auth: `Supabase Auth` (token Bearer validado en backend)
|
||||
- Validación de contratos: `zod` en `@repo/api-contract`
|
||||
|
||||
## Prerrequisitos
|
||||
|
||||
- `bun` instalado (versión reciente).
|
||||
- `PostgreSQL` corriendo localmente (o accesible remotamente).
|
||||
- Proyecto de `Supabase` para autenticación (URL + anon key).
|
||||
|
||||
## Setup rápido
|
||||
|
||||
1. Instalar dependencias:
|
||||
1. Instalar dependencias desde la raíz:
|
||||
|
||||
```sh
|
||||
bun install
|
||||
```
|
||||
|
||||
2. Configurar backend:
|
||||
2. Configurar variables de entorno del backend:
|
||||
|
||||
```sh
|
||||
cp apps/backend/.env.example apps/backend/.env
|
||||
```
|
||||
|
||||
3. Configurar frontend:
|
||||
3. Configurar variables de entorno del frontend:
|
||||
|
||||
```sh
|
||||
cp apps/frontend/.env.example apps/frontend/.env
|
||||
```
|
||||
|
||||
4. Ejecutar migraciones:
|
||||
|
||||
```sh
|
||||
bun --filter backend prisma:migrate
|
||||
```
|
||||
4. Revisar/editar valores en ambos `.env` según tu entorno.
|
||||
|
||||
## Variables de entorno
|
||||
|
||||
### Backend (`apps/backend/.env`)
|
||||
|
||||
- `DATABASE_URL`
|
||||
- `BETTER_AUTH_SECRET`
|
||||
- `BETTER_AUTH_URL`
|
||||
- `APP_BASE_URL`
|
||||
- `CORS_ORIGIN`
|
||||
Variables esperadas:
|
||||
|
||||
- `SUPABASE_URL`
|
||||
- `SUPABASE_ANON_KEY`
|
||||
- `CORS_ORIGIN` (por defecto local frontend)
|
||||
- `LOG_LEVEL`
|
||||
- `DATABASE_URL` (PostgreSQL)
|
||||
|
||||
Notas:
|
||||
|
||||
- El backend también acepta `VITE_SUPABASE_URL` y `VITE_SUPABASE_ANON_KEY` como fallback.
|
||||
- Si falta `DATABASE_URL`, Prisma no puede inicializarse.
|
||||
|
||||
### Frontend (`apps/frontend/.env`)
|
||||
|
||||
- `VITE_API_BASE_URL`
|
||||
Variables esperadas:
|
||||
|
||||
## Desarrollo
|
||||
- `VITE_SUPABASE_URL`
|
||||
- `VITE_SUPABASE_ANON_KEY`
|
||||
- `VITE_API_BASE_URL` (por defecto: `http://localhost:3000`)
|
||||
|
||||
Backend:
|
||||
## Base de datos (Prisma)
|
||||
|
||||
Antes de arrancar backend por primera vez, corré migraciones:
|
||||
|
||||
```sh
|
||||
bun run dev:backend
|
||||
bun --filter backend prisma:migrate
|
||||
```
|
||||
|
||||
Frontend:
|
||||
|
||||
```sh
|
||||
bun run dev:frontend
|
||||
```
|
||||
|
||||
Todo junto:
|
||||
|
||||
```sh
|
||||
bun run dev
|
||||
```
|
||||
|
||||
## Prisma
|
||||
|
||||
Regenerar cliente después de cambios de schema:
|
||||
Si cambiás el schema, regenerá cliente:
|
||||
|
||||
```sh
|
||||
bun --filter backend prisma:generate
|
||||
```
|
||||
|
||||
## Autenticación
|
||||
## Ejecutar en desarrollo
|
||||
|
||||
El proyecto usa **Better Auth** con sesión por cookie.
|
||||
Terminal 1 (backend):
|
||||
|
||||
- Backend: `c.get('user')` y `c.get('session')` en contexto Hono.
|
||||
- Frontend: `authClient` con `fetchOptions.credentials = 'include'`.
|
||||
- Frontend API: Axios con `withCredentials = true`.
|
||||
- Backend CORS: `credentials: true`.
|
||||
```sh
|
||||
bun run dev:backend
|
||||
```
|
||||
|
||||
## Deploy (Docker)
|
||||
Terminal 2 (frontend):
|
||||
|
||||
- Build context: raíz del monorepo (`./`)
|
||||
- Dockerfile: `./Dockerfile`
|
||||
- Build args requeridos:
|
||||
- `DATABASE_URL`
|
||||
- `VITE_API_BASE_URL`
|
||||
- `BETTER_AUTH_SECRET`
|
||||
- `BETTER_AUTH_URL`
|
||||
```sh
|
||||
bun run dev:frontend
|
||||
```
|
||||
|
||||
## Flujo recomendado de cambios de API
|
||||
Puertos por defecto:
|
||||
|
||||
1. Actualizar contrato en `packages/api-contract`.
|
||||
2. Implementar backend en `apps/backend`.
|
||||
3. Consumir contrato desde frontend (`@repo/api-contract`).
|
||||
- Frontend: `http://localhost:5173`
|
||||
- Backend: `http://localhost:3000`
|
||||
|
||||
## Scripts útiles
|
||||
|
||||
Desde la raíz:
|
||||
|
||||
- `bun run dev:frontend`
|
||||
- `bun run dev:backend`
|
||||
- `bun run build:frontend`
|
||||
- `bun run lint:frontend`
|
||||
|
||||
Desde `apps/backend`:
|
||||
|
||||
- `bun run dev`
|
||||
- `bun run start`
|
||||
- `bun run prisma:migrate`
|
||||
- `bun run prisma:generate`
|
||||
|
||||
## Estructura del repo
|
||||
|
||||
```txt
|
||||
.
|
||||
├─ apps/
|
||||
│ ├─ frontend/ # UI y navegación
|
||||
│ └─ backend/ # API, auth middleware, acceso a DB
|
||||
└─ packages/
|
||||
└─ api-contract/ # Schemas/tipos/rutas compartidos
|
||||
```
|
||||
|
||||
## Flujo de autenticación (resumen)
|
||||
|
||||
1. Frontend autentica con Supabase.
|
||||
2. Frontend guarda el access token y lo envía como `Authorization: Bearer ...` al backend.
|
||||
3. Backend valida token con Supabase (`requireAuth` middleware).
|
||||
4. Si el token es válido, habilita rutas protegidas (`/api/user/*`, `/api/tenants/*`).
|
||||
|
||||
## Endpoints principales
|
||||
|
||||
- `GET /api/user/profile`
|
||||
- `POST /api/tenants`
|
||||
- `GET /api/tenants/:id`
|
||||
- `PATCH /api/tenants/:id`
|
||||
|
||||
## Convenciones recomendadas para el equipo
|
||||
|
||||
- Mantener contratos de API en `packages/api-contract` (evitar duplicar tipos).
|
||||
- Si agregás/cambiás endpoint:
|
||||
1. Actualizá schema/tipos en `api-contract`.
|
||||
2. Implementá handler/ruta en backend.
|
||||
3. Consumí el contrato desde frontend.
|
||||
- Validar payloads con Zod tanto en contrato como en rutas.
|
||||
- Mantener PRs chicos y enfocados.
|
||||
|
||||
## Troubleshooting rápido
|
||||
|
||||
- Error de CORS:
|
||||
- Revisar `CORS_ORIGIN` en backend y que incluya `http://localhost:5173`.
|
||||
- `403 Missing bearer token`:
|
||||
- Verificar login en frontend y envío del header `Authorization`.
|
||||
- Error de Supabase env vars:
|
||||
- Confirmar `SUPABASE_URL`/`SUPABASE_ANON_KEY` (backend) y `VITE_*` (frontend).
|
||||
- Error de Prisma/DB:
|
||||
- Confirmar `DATABASE_URL`, conectividad a PostgreSQL y migraciones aplicadas.
|
||||
|
||||
## Primer día sugerido para onboarding
|
||||
|
||||
1. Levantar backend y frontend en local.
|
||||
2. Crear usuario o iniciar sesión desde la pantalla de onboard.
|
||||
3. Crear un tenant de prueba.
|
||||
4. Probar lectura/edición de tenant.
|
||||
5. Revisar `packages/api-contract` para entender cómo se comparten tipos y rutas.
|
||||
|
||||
---
|
||||
|
||||
Si te trabás en el setup, empezá verificando `.env`, estado de PostgreSQL y que ambos procesos (`dev:backend` y `dev:frontend`) estén corriendo.
|
||||
|
||||
14
apps/backend/.env
Normal file
14
apps/backend/.env
Normal file
@@ -0,0 +1,14 @@
|
||||
SUPABASE_URL=https://afzzqgvdkkpyxmifpaya.supabase.co
|
||||
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFmenpxZ3Zka2tweXhtaWZwYXlhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc3NDg5Njc5MiwiZXhwIjoyMDkwNDcyNzkyfQ.2tex8lMCGzxBqeIk01Z08Wl15K7AavyfClUFgUl2NPM
|
||||
SUPABASE_ANON_KEY=sb_publishable_RgMLVBTCTClhK-1Ks_X02Q_Sq1Z1Pq-
|
||||
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
|
||||
DATABASE_URL=postgres://super_admin:solotech25@localhost:5432/playzer-dev
|
||||
BETTER_AUTH_SECRET=767a2e0fb8b58a9f4df3155d88d22ecdc4eaea4447565c2ed518c532f6410598
|
||||
BETTER_AUTH_URL=http://localhost:5173
|
||||
APP_BASE_URL=http://localhost:5173
|
||||
ONBOARDING_TTL_MINUTES=60
|
||||
SMTP_HOST=sandbox.smtp.mailtrap.io
|
||||
SMTP_PORT=587
|
||||
SMTP_USER=6af2bf58132d12
|
||||
SMTP_PASS=1253b2fe0fc47a
|
||||
SMTP_FROM=Playzer <no-reply@playzer.app>
|
||||
@@ -1,5 +1,9 @@
|
||||
BETTER_AUTH_SECRET=your-random-secret
|
||||
BETTER_AUTH_URL=http://localhost:3000
|
||||
SUPABASE_URL=https://your-project-ref.supabase.co
|
||||
SUPABASE_ANON_KEY=your-anon-key
|
||||
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
|
||||
# Fallbacks accepted too:
|
||||
# VITE_SUPABASE_URL=https://your-project-ref.supabase.co
|
||||
# VITE_SUPABASE_ANON_KEY=your-anon-key
|
||||
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
|
||||
LOG_LEVEL=debug
|
||||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/monorepo
|
||||
@@ -12,7 +16,3 @@ SMTP_PORT=587
|
||||
SMTP_USER=user@example.com
|
||||
SMTP_PASS=your-smtp-password
|
||||
SMTP_FROM=Playzer <no-reply@example.com>
|
||||
|
||||
# Google OAuth
|
||||
GOOGLE_CLIENT_ID=your-google-client-id
|
||||
GOOGLE_CLIENT_SECRET=your-google-client-secret
|
||||
|
||||
4
apps/backend/.gitignore
vendored
4
apps/backend/.gitignore
vendored
@@ -1,6 +1,2 @@
|
||||
# deps
|
||||
node_modules/
|
||||
prisma.config.prod.ts
|
||||
|
||||
# build output
|
||||
dist/
|
||||
@@ -9,21 +9,3 @@ bun run dev
|
||||
```
|
||||
|
||||
open http://localhost:3000
|
||||
|
||||
## Tests
|
||||
|
||||
Run all backend tests:
|
||||
```sh
|
||||
bun run test
|
||||
```
|
||||
|
||||
### Test naming convention
|
||||
|
||||
- `*.test.ts` or `*.spec.ts`: service-level tests. These run with the shared Prisma preload at `test/support/prisma.mock.ts`.
|
||||
- `*.handler.test.ts`: handler-level tests. These should mock the service module locally with `mock.module(...)` and import the handler after the mock is in place.
|
||||
|
||||
### Recommended pattern
|
||||
|
||||
- Keep business logic tests focused on the service layer.
|
||||
- Use handler tests only to verify request parsing, status mapping, and response shaping.
|
||||
- Put shared Prisma mocking helpers in `test/support/`.
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[test]
|
||||
preload = ["./test/support/prisma.mock.ts"]
|
||||
coverageThreshold = 0.8
|
||||
@@ -4,7 +4,6 @@
|
||||
"dev": "bun run --hot src/server.ts",
|
||||
"start": "bun src/server.ts",
|
||||
"build": "tsc -b",
|
||||
"test": "bun test --preload ./test/support/prisma.mock.ts ./test",
|
||||
"lint": "biome check .",
|
||||
"lint:fix": "biome check --write .",
|
||||
"format": "biome format --write .",
|
||||
@@ -15,15 +14,17 @@
|
||||
"prisma:seed:reset:plans": "bun prisma/reset-plans.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@better-auth/infra": "^0.2.4",
|
||||
"@better-auth/prisma-adapter": "^1.6.2",
|
||||
"@hono/zod-validator": "^0.7.6",
|
||||
"@prisma/adapter-pg": "^7.6.0",
|
||||
"@prisma/client": "^7",
|
||||
"@repo/api-contract": "workspace:*",
|
||||
"better-auth": "^1.6.4",
|
||||
"@supabase/supabase-js": "2.101.1",
|
||||
"@types/bcrypt": "^6.0.0",
|
||||
"bcrypt": "^6.0.0",
|
||||
"better-auth": "^1.6.2",
|
||||
"dotenv": "^17.4.1",
|
||||
"hono": "4.12.10",
|
||||
"mailtrap": "^4.5.1",
|
||||
"nodemailer": "^8.0.5",
|
||||
"pg": "^8.20.0",
|
||||
"pino": "10.3.1",
|
||||
@@ -34,7 +35,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
"@types/nodemailer": "^8.0.0",
|
||||
"bun-mock-prisma": "^1.2.1"
|
||||
"@types/nodemailer": "^8.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
model User {
|
||||
id String @id
|
||||
name String
|
||||
email String
|
||||
emailVerified Boolean @default(false)
|
||||
image String?
|
||||
phone String?
|
||||
banned Boolean @default(false)
|
||||
bannedAt DateTime?
|
||||
banReason String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sessions Session[]
|
||||
accounts Account[]
|
||||
role String @default("member")
|
||||
complexes ComplexUser[]
|
||||
|
||||
@@unique([email])
|
||||
@@map("users")
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id
|
||||
expiresAt DateTime
|
||||
token String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
ipAddress String?
|
||||
userAgent String?
|
||||
country String?
|
||||
city String?
|
||||
countryCode String?
|
||||
latitude Float?
|
||||
longitude Float?
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([token])
|
||||
@@index([userId])
|
||||
@@map("sessions")
|
||||
}
|
||||
|
||||
model Account {
|
||||
id String @id
|
||||
accountId String
|
||||
providerId String
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
accessToken String?
|
||||
refreshToken String?
|
||||
idToken String?
|
||||
accessTokenExpiresAt DateTime?
|
||||
refreshTokenExpiresAt DateTime?
|
||||
scope String?
|
||||
password String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([userId])
|
||||
@@map("accounts")
|
||||
}
|
||||
|
||||
model Verification {
|
||||
id String @id
|
||||
identifier String
|
||||
value String
|
||||
expiresAt DateTime
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([identifier])
|
||||
@@map("verification")
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
model Complex {
|
||||
id String @id @db.Uuid
|
||||
complexName String @map("complex_name")
|
||||
physicalAddress String? @map("physical_address") @db.VarChar(200)
|
||||
city String? @map("city") @db.VarChar(100)
|
||||
state String? @map("state") @db.VarChar(100)
|
||||
country String? @map("country") @db.VarChar(100)
|
||||
complexSlug String @unique @map("complex_slug")
|
||||
adminEmail String @map("admin_email")
|
||||
planCode String? @map("plan_code") @db.VarChar(10)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
plan Plan? @relation(fields: [planCode], references: [code])
|
||||
users ComplexUser[]
|
||||
invitations ComplexInvitation[]
|
||||
courts Court[]
|
||||
|
||||
@@index([planCode])
|
||||
@@index([complexSlug])
|
||||
@@map("complexes")
|
||||
}
|
||||
|
||||
enum ComplexUserRole {
|
||||
ADMIN
|
||||
EMPLOYEE
|
||||
}
|
||||
|
||||
model ComplexUser {
|
||||
complexId String @map("complex_id") @db.Uuid
|
||||
userId String @map("user_id")
|
||||
role ComplexUserRole @default(ADMIN)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([complexId, userId])
|
||||
@@index([userId])
|
||||
@@map("complex_users")
|
||||
}
|
||||
|
||||
model ComplexInvitation {
|
||||
id String @id @db.Uuid
|
||||
complexId String @map("complex_id") @db.Uuid
|
||||
email String @db.VarChar(255)
|
||||
tokenHash String @unique @map("token_hash")
|
||||
expiresAt DateTime @map("expires_at")
|
||||
acceptedAt DateTime? @map("accepted_at")
|
||||
revokedAt DateTime? @map("revoked_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([complexId, email])
|
||||
@@index([email])
|
||||
@@map("complex_invitations")
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
enum DayOfWeek {
|
||||
MONDAY
|
||||
TUESDAY
|
||||
WEDNESDAY
|
||||
THURSDAY
|
||||
FRIDAY
|
||||
SATURDAY
|
||||
SUNDAY
|
||||
}
|
||||
|
||||
enum CourtBookingStatus {
|
||||
CONFIRMED
|
||||
CANCELLED
|
||||
COMPLETED
|
||||
NOSHOW
|
||||
}
|
||||
|
||||
model Sport {
|
||||
id String @id @db.Uuid
|
||||
name String @unique
|
||||
slug String @unique
|
||||
isActive Boolean @default(true) @map("is_active")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
courts Court[]
|
||||
|
||||
@@map("sports")
|
||||
}
|
||||
|
||||
model Court {
|
||||
id String @id @db.Uuid
|
||||
complexId String @map("complex_id") @db.Uuid
|
||||
sportId String @map("sport_id") @db.Uuid
|
||||
name String
|
||||
slotDurationMinutes Int @map("slot_duration_minutes")
|
||||
basePrice Decimal @map("base_price") @db.Decimal(19, 2)
|
||||
isUnderMaintenance Boolean @default(false) @map("is_under_maintenance")
|
||||
maintenanceReason String? @map("maintenance_reason") @db.VarChar(500)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)
|
||||
sport Sport @relation(fields: [sportId], references: [id])
|
||||
availabilities CourtAvailability[]
|
||||
priceRules CourtPriceRule[]
|
||||
bookings CourtBooking[]
|
||||
maintenances CourtMaintenance[]
|
||||
|
||||
@@index([complexId])
|
||||
@@index([sportId])
|
||||
@@map("courts")
|
||||
}
|
||||
|
||||
model CourtMaintenance {
|
||||
id String @id @db.Uuid
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
startDate DateTime @map("start_date") @db.Date
|
||||
startTime String? @map("start_time") @db.VarChar(5)
|
||||
endTime String? @map("end_time") @db.VarChar(5)
|
||||
reason String? @db.VarChar(500)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([courtId, startDate])
|
||||
@@map("court_maintenances")
|
||||
}
|
||||
|
||||
model CourtAvailability {
|
||||
id String @id @db.Uuid
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
dayOfWeek DayOfWeek @map("day_of_week")
|
||||
startTime String @map("start_time") @db.VarChar(5)
|
||||
endTime String @map("end_time") @db.VarChar(5)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([courtId, dayOfWeek])
|
||||
@@map("court_availabilities")
|
||||
}
|
||||
|
||||
model CourtPriceRule {
|
||||
id String @id @db.Uuid
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
dayOfWeek DayOfWeek? @map("day_of_week")
|
||||
startTime String? @map("start_time") @db.VarChar(5)
|
||||
endTime String? @map("end_time") @db.VarChar(5)
|
||||
price Decimal @db.Decimal(19, 2)
|
||||
isActive Boolean @default(true) @map("is_active")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([courtId, isActive])
|
||||
@@map("court_price_rules")
|
||||
}
|
||||
|
||||
model CourtBooking {
|
||||
id String @id @db.Uuid
|
||||
bookingCode String @unique @map("booking_code") @db.VarChar(8)
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
bookingDate DateTime @map("booking_date") @db.Date
|
||||
startTime String @map("start_time") @db.VarChar(5)
|
||||
endTime String @map("end_time") @db.VarChar(5)
|
||||
customerName String @map("customer_name") @db.VarChar(120)
|
||||
customerPhone String @map("customer_phone") @db.VarChar(30)
|
||||
customerEmail String @map("customer_email") @db.VarChar(254)
|
||||
status CourtBookingStatus @default(CONFIRMED)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([courtId, bookingDate, startTime])
|
||||
@@index([courtId, bookingDate])
|
||||
@@index([bookingDate])
|
||||
@@map("court_bookings")
|
||||
}
|
||||
|
||||
model CourtBookingLog {
|
||||
id String @id @db.Uuid
|
||||
bookingCode String @map("booking_code") @db.VarChar(8)
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
bookingDate DateTime @map("booking_date") @db.Date
|
||||
startTime String @map("start_time") @db.VarChar(5)
|
||||
endTime String @map("end_time") @db.VarChar(5)
|
||||
previousStatus CourtBookingStatus @map("previous_status")
|
||||
newStatus CourtBookingStatus @map("new_status")
|
||||
customerName String @map("customer_name") @db.VarChar(120)
|
||||
customerPhone String @map("customer_phone") @db.VarChar(30)
|
||||
customerEmail String @map("customer_email") @db.VarChar(254)
|
||||
changedAt DateTime @default(now()) @map("changed_at")
|
||||
|
||||
@@map("court_booking_logs")
|
||||
@@index([courtId, newStatus])
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The primary key for the `users` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
||||
- You are about to drop the column `created_at` on the `users` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `full_name` on the `users` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `supabase_user_id` on the `users` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `updated_at` on the `users` table. All the data in the column will be lost.
|
||||
- You are about to drop the `complex_users` table. If the table is not empty, all the data it contains will be lost.
|
||||
- Added the required column `name` to the `users` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `updatedAt` to the `users` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterEnum
|
||||
ALTER TYPE "ComplexUserRole" ADD VALUE 'EMPLOYEE';
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "complex_users" DROP CONSTRAINT "complex_users_complex_id_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "complex_users" DROP CONSTRAINT "complex_users_user_id_fkey";
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX "users_supabase_user_id_key";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" DROP CONSTRAINT "users_pkey",
|
||||
DROP COLUMN "created_at",
|
||||
DROP COLUMN "full_name",
|
||||
DROP COLUMN "supabase_user_id",
|
||||
DROP COLUMN "updated_at",
|
||||
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
ADD COLUMN "emailVerified" BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN "image" TEXT,
|
||||
ADD COLUMN "name" TEXT NOT NULL,
|
||||
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
ALTER COLUMN "id" SET DATA TYPE TEXT,
|
||||
ADD CONSTRAINT "users_pkey" PRIMARY KEY ("id");
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "complex_users";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "sessions" (
|
||||
"id" TEXT NOT NULL,
|
||||
"expiresAt" TIMESTAMP(3) NOT NULL,
|
||||
"token" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
"ipAddress" TEXT,
|
||||
"userAgent" TEXT,
|
||||
"userId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "sessions_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "accounts" (
|
||||
"id" TEXT NOT NULL,
|
||||
"accountId" TEXT NOT NULL,
|
||||
"providerId" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"accessToken" TEXT,
|
||||
"refreshToken" TEXT,
|
||||
"idToken" TEXT,
|
||||
"accessTokenExpiresAt" TIMESTAMP(3),
|
||||
"refreshTokenExpiresAt" TIMESTAMP(3),
|
||||
"scope" TEXT,
|
||||
"password" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "accounts_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "verification" (
|
||||
"id" TEXT NOT NULL,
|
||||
"identifier" TEXT NOT NULL,
|
||||
"value" TEXT NOT NULL,
|
||||
"expiresAt" TIMESTAMP(3) NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "verification_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "sessions_userId_idx" ON "sessions"("userId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "sessions_token_key" ON "sessions"("token");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "accounts_userId_idx" ON "accounts"("userId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "verification_identifier_idx" ON "verification"("identifier");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "accounts" ADD CONSTRAINT "accounts_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -1,18 +0,0 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "complex_users" (
|
||||
"complex_id" UUID NOT NULL,
|
||||
"user_id" TEXT NOT NULL,
|
||||
"role" "ComplexUserRole" NOT NULL DEFAULT 'ADMIN',
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "complex_users_pkey" PRIMARY KEY ("complex_id","user_id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "complex_users_user_id_idx" ON "complex_users"("user_id");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "complex_users" ADD CONSTRAINT "complex_users_complex_id_fkey" FOREIGN KEY ("complex_id") REFERENCES "complexes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "complex_users" ADD CONSTRAINT "complex_users_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -1,2 +0,0 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "role" TEXT NOT NULL DEFAULT 'member';
|
||||
@@ -1,26 +0,0 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "complex_invitations" (
|
||||
"id" UUID NOT NULL,
|
||||
"complex_id" UUID NOT NULL,
|
||||
"email" VARCHAR(255) NOT NULL,
|
||||
"token_hash" TEXT NOT NULL,
|
||||
"expires_at" TIMESTAMP(3) NOT NULL,
|
||||
"accepted_at" TIMESTAMP(3),
|
||||
"revoked_at" TIMESTAMP(3),
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "complex_invitations_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "complex_invitations_token_hash_key" ON "complex_invitations"("token_hash");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "complex_invitations_complex_id_email_idx" ON "complex_invitations"("complex_id", "email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "complex_invitations_email_idx" ON "complex_invitations"("email");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "complex_invitations" ADD CONSTRAINT "complex_invitations_complex_id_fkey" FOREIGN KEY ("complex_id") REFERENCES "complexes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -1,17 +0,0 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "court_booking_logs" (
|
||||
"id" UUID NOT NULL,
|
||||
"booking_code" UUID NOT NULL,
|
||||
"court_id" UUID NOT NULL,
|
||||
"booking_date" DATE NOT NULL,
|
||||
"start_time" VARCHAR(5) NOT NULL,
|
||||
"end_time" VARCHAR(5) NOT NULL,
|
||||
"previous_status" "CourtBookingStatus" NOT NULL,
|
||||
"new_status" "CourtBookingStatus" NOT NULL,
|
||||
"changed_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "court_booking_logs_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "court_booking_logs_court_id_new_status_idx" ON "court_booking_logs"("court_id", "new_status");
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `customer_name` to the `court_booking_logs` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `customer_phone` to the `court_booking_logs` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterEnum
|
||||
ALTER TYPE "CourtBookingStatus" ADD VALUE 'NOSHOW';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "court_booking_logs" ADD COLUMN "customer_name" VARCHAR(120) NOT NULL,
|
||||
ADD COLUMN "customer_phone" VARCHAR(30) NOT NULL;
|
||||
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Changed the type of `booking_code` on the `court_booking_logs` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "court_booking_logs" DROP COLUMN "booking_code",
|
||||
ADD COLUMN "booking_code" VARCHAR(8) NOT NULL;
|
||||
@@ -1,2 +0,0 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "phone" TEXT;
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `onboarding_requests` table. If the table is not empty, all the data it contains will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "court_booking_logs" ADD COLUMN "customer_email" VARCHAR(254);
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "court_bookings" ADD COLUMN "customer_email" VARCHAR(254);
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "onboarding_requests";
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Made the column `customer_email` on table `court_booking_logs` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `customer_email` on table `court_bookings` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
-- Backfill existing NULL values with placeholder
|
||||
UPDATE "court_booking_logs" SET "customer_email" = 'missing@playzer.app' WHERE "customer_email" IS NULL;
|
||||
UPDATE "court_bookings" SET "customer_email" = 'missing@playzer.app' WHERE "customer_email" IS NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "court_booking_logs" ALTER COLUMN "customer_email" SET NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "court_bookings" ALTER COLUMN "customer_email" SET NOT NULL;
|
||||
@@ -1,23 +0,0 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "court_maintenances" (
|
||||
"id" UUID NOT NULL,
|
||||
"court_id" UUID NOT NULL,
|
||||
"start_date" DATE NOT NULL,
|
||||
"start_time" VARCHAR(5),
|
||||
"end_time" VARCHAR(5),
|
||||
"reason" VARCHAR(500),
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "court_maintenances_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "courts" ADD COLUMN "is_under_maintenance" BOOLEAN NOT NULL DEFAULT false;
|
||||
ALTER TABLE "courts" ADD COLUMN "maintenance_reason" VARCHAR(500);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "court_maintenances_court_id_start_date_idx" ON "court_maintenances"("court_id", "start_date");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "court_maintenances" ADD CONSTRAINT "court_maintenances_court_id_fkey" FOREIGN KEY ("court_id") REFERENCES "courts"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -1,4 +0,0 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "banReason" TEXT,
|
||||
ADD COLUMN "banned" BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN "bannedAt" TIMESTAMP(3);
|
||||
@@ -1,6 +0,0 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "sessions" ADD COLUMN "city" TEXT,
|
||||
ADD COLUMN "country" TEXT,
|
||||
ADD COLUMN "countryCode" TEXT,
|
||||
ADD COLUMN "latitude" DOUBLE PRECISION,
|
||||
ADD COLUMN "longitude" DOUBLE PRECISION;
|
||||
@@ -1,16 +0,0 @@
|
||||
model PasswordResetRequest {
|
||||
id String @id @db.Uuid
|
||||
email String
|
||||
otpHash String @map("otp_hash")
|
||||
otpExpiresAt DateTime @map("otp_expires_at")
|
||||
otpAttempts Int @default(0) @map("otp_attempts")
|
||||
otpLastSentAt DateTime @map("otp_last_sent_at")
|
||||
otpResendCount Int @default(0) @map("otp_resend_count")
|
||||
usedAt DateTime? @map("used_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@index([email])
|
||||
@@index([otpExpiresAt])
|
||||
@@map("password_reset_requests")
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
model Plan {
|
||||
code String @id @db.VarChar(10)
|
||||
name String @db.VarChar(30)
|
||||
price Decimal @db.Decimal(19, 2)
|
||||
rules Json
|
||||
lastUpdatedAt DateTime @default(now()) @map("last_updated_at")
|
||||
complexes Complex[]
|
||||
|
||||
@@map("plans")
|
||||
}
|
||||
@@ -4,7 +4,7 @@ export const planSeeds = [
|
||||
name: 'Basic',
|
||||
price: '49.00',
|
||||
rules: {
|
||||
version: 'v2',
|
||||
version: 'v1',
|
||||
limits: {
|
||||
maxCourts: 2,
|
||||
maxBookingsPerDay: 80,
|
||||
@@ -22,11 +22,6 @@ export const planSeeds = [
|
||||
advancedReports: false,
|
||||
whatsappReminders: false,
|
||||
},
|
||||
pricing: {
|
||||
overrides: {
|
||||
AR: { amount: 14999, currency: 'ARS' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -34,7 +29,7 @@ export const planSeeds = [
|
||||
name: 'Advanced',
|
||||
price: '99.00',
|
||||
rules: {
|
||||
version: 'v2',
|
||||
version: 'v1',
|
||||
limits: {
|
||||
maxCourts: 5,
|
||||
maxBookingsPerDay: 220,
|
||||
@@ -52,11 +47,6 @@ export const planSeeds = [
|
||||
advancedReports: true,
|
||||
whatsappReminders: true,
|
||||
},
|
||||
pricing: {
|
||||
overrides: {
|
||||
AR: { amount: 29999, currency: 'ARS' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -64,7 +54,7 @@ export const planSeeds = [
|
||||
name: 'Enterprise',
|
||||
price: '199.00',
|
||||
rules: {
|
||||
version: 'v2',
|
||||
version: 'v1',
|
||||
limits: {
|
||||
maxCourts: 20,
|
||||
maxBookingsPerDay: 2000,
|
||||
@@ -82,11 +72,6 @@ export const planSeeds = [
|
||||
advancedReports: true,
|
||||
whatsappReminders: true,
|
||||
},
|
||||
pricing: {
|
||||
overrides: {
|
||||
AR: { amount: 59999, currency: 'ARS' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
] as const;
|
||||
|
||||
@@ -6,3 +6,253 @@ generator client {
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
// ============== APP MODELS (existing) ==============
|
||||
|
||||
model Plan {
|
||||
code String @id @map("code") @db.VarChar(10)
|
||||
name String @db.VarChar(30)
|
||||
price Decimal @map("price") @db.Decimal(19, 2)
|
||||
rules Json @map("rules")
|
||||
lastUpdatedAt DateTime @default(now()) @map("last_updated_at")
|
||||
complexes Complex[]
|
||||
|
||||
@@map("plans")
|
||||
}
|
||||
|
||||
model Complex {
|
||||
id String @id @db.Uuid
|
||||
complexSlug String @unique @map("complex_slug")
|
||||
complexName String @map("complex_name")
|
||||
physicalAddress String @map("physical_address")
|
||||
city String?
|
||||
state String?
|
||||
country String?
|
||||
adminEmail String @map("admin_email")
|
||||
planCode String @map("plan_code")
|
||||
isActive Boolean @default(true) @map("is_active")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
plan Plan @relation(fields: [planCode], references: [code])
|
||||
users ComplexUser[]
|
||||
courts Court[]
|
||||
|
||||
@@index([adminEmail])
|
||||
@@map("complexes")
|
||||
}
|
||||
|
||||
model ComplexUser {
|
||||
id String @id @default(cuid()) @map("id")
|
||||
complexId String @map("complex_id") @db.Uuid
|
||||
userId String @map("user_id")
|
||||
role ComplexUserRole
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([complexId, userId])
|
||||
@@map("complex_users")
|
||||
}
|
||||
|
||||
enum ComplexUserRole {
|
||||
ADMIN
|
||||
MANAGER
|
||||
USER
|
||||
}
|
||||
|
||||
enum DayOfWeek {
|
||||
MONDAY
|
||||
TUESDAY
|
||||
WEDNESDAY
|
||||
THURSDAY
|
||||
FRIDAY
|
||||
SATURDAY
|
||||
SUNDAY
|
||||
}
|
||||
|
||||
enum CourtBookingStatus {
|
||||
CONFIRMED
|
||||
CANCELLED
|
||||
COMPLETED
|
||||
}
|
||||
|
||||
model Sport {
|
||||
id String @id @db.Uuid
|
||||
name String @unique
|
||||
slug String @unique
|
||||
isActive Boolean @default(true) @map("is_active")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
courts Court[]
|
||||
|
||||
@@map("sports")
|
||||
}
|
||||
|
||||
model Court {
|
||||
id String @id @db.Uuid
|
||||
complexId String @map("complex_id") @db.Uuid
|
||||
sportId String @map("sport_id") @db.Uuid
|
||||
name String
|
||||
slotDurationMinutes Int @map("slot_duration_minutes")
|
||||
basePrice Decimal @map("base_price") @db.Decimal(19, 2)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)
|
||||
sport Sport @relation(fields: [sportId], references: [id])
|
||||
availabilities CourtAvailability[]
|
||||
priceRules CourtPriceRule[]
|
||||
bookings CourtBooking[]
|
||||
|
||||
@@index([complexId])
|
||||
@@index([sportId])
|
||||
@@map("courts")
|
||||
}
|
||||
|
||||
model CourtAvailability {
|
||||
id String @id @db.Uuid
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
dayOfWeek DayOfWeek @map("day_of_week")
|
||||
startTime String @map("start_time") @db.VarChar(5)
|
||||
endTime String @map("end_time") @db.VarChar(5)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([courtId, dayOfWeek])
|
||||
@@map("court_availabilities")
|
||||
}
|
||||
|
||||
model CourtPriceRule {
|
||||
id String @id @db.Uuid
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
dayOfWeek DayOfWeek? @map("day_of_week")
|
||||
startTime String? @map("start_time") @db.VarChar(5)
|
||||
endTime String? @map("end_time") @db.VarChar(5)
|
||||
price Decimal @db.Decimal(19, 2)
|
||||
isActive Boolean @default(true) @map("is_active")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([courtId, isActive])
|
||||
@@map("court_price_rules")
|
||||
}
|
||||
|
||||
model CourtBooking {
|
||||
id String @id @db.Uuid
|
||||
bookingCode String @unique @map("booking_code") @db.VarChar(8)
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
bookingDate DateTime @map("booking_date") @db.Date
|
||||
startTime String @map("start_time") @db.VarChar(5)
|
||||
endTime String @map("end_time") @db.VarChar(5)
|
||||
customerName String @map("customer_name") @db.VarChar(120)
|
||||
customerPhone String @map("customer_phone") @db.VarChar(30)
|
||||
status CourtBookingStatus @default(CONFIRMED)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([courtId, bookingDate, startTime])
|
||||
@@index([courtId, bookingDate])
|
||||
@@index([bookingDate])
|
||||
@@map("court_bookings")
|
||||
}
|
||||
|
||||
model OnboardingRequest {
|
||||
id String @id @db.Uuid
|
||||
fullName String @map("full_name")
|
||||
email String
|
||||
otpHash String @map("otp_hash")
|
||||
otpExpiresAt DateTime @map("otp_expires_at")
|
||||
otpAttempts Int @default(0) @map("otp_attempts")
|
||||
otpLastSentAt DateTime @map("otp_last_sent_at")
|
||||
otpResendCount Int @default(0) @map("otp_resend_count")
|
||||
emailVerifiedAt DateTime? @map("email_verified_at")
|
||||
completedAt DateTime? @map("completed_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@index([email])
|
||||
@@index([otpExpiresAt])
|
||||
@@map("onboarding_requests")
|
||||
}
|
||||
|
||||
model PasswordResetRequest {
|
||||
id String @id @db.Uuid
|
||||
email String
|
||||
otpHash String @map("otp_hash")
|
||||
otpExpiresAt DateTime @map("otp_expires_at")
|
||||
otpAttempts Int @default(0) @map("otp_attempts")
|
||||
otpLastSentAt DateTime @map("otp_last_sent_at")
|
||||
otpResendCount Int @default(0) @map("otp_resend_count")
|
||||
usedAt DateTime? @map("used_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@index([email])
|
||||
@@index([otpExpiresAt])
|
||||
@@map("password_reset_requests")
|
||||
}
|
||||
|
||||
// ============== BETTER AUTH MODELS ==============
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid()) @map("id")
|
||||
supabaseUserId String? @unique @map("supabase_user_id") @db.Uuid
|
||||
name String?
|
||||
email String @unique
|
||||
emailVerified Boolean @default(false)
|
||||
image String?
|
||||
fullName String? @map("full_name")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
accounts Account[]
|
||||
sessions Session[]
|
||||
complexes ComplexUser[]
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id @default(cuid()) @map("id")
|
||||
userId String @map("user_id")
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
token String @unique
|
||||
expiresAt DateTime @map("expires_at")
|
||||
ipAddress String? @map("ip_address")
|
||||
userAgent String? @map("user_agent")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@map("session")
|
||||
}
|
||||
|
||||
model Account {
|
||||
id String @id @default(cuid()) @map("id")
|
||||
userId String @map("user_id")
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
accountId String @map("account_id")
|
||||
providerId String @map("provider_id")
|
||||
accessToken String? @map("access_token")
|
||||
refreshToken String? @map("refresh_token")
|
||||
accessTokenExpiresAt DateTime? @map("access_token_expires_at")
|
||||
refreshTokenExpiresAt DateTime? @map("refresh_token_expires_at")
|
||||
scope String? @map("scope")
|
||||
idToken String? @map("id_token")
|
||||
password String? @map("password")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@map("account")
|
||||
}
|
||||
|
||||
model Verification {
|
||||
id String @id @default(cuid()) @map("id")
|
||||
identifier String
|
||||
value String
|
||||
expiresAt DateTime @map("expires_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@map("verification")
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
// User model is defined in auth.prisma (Better Auth schema).
|
||||
@@ -3,15 +3,10 @@ import type { AppEnv } from '@/types/hono';
|
||||
import { Hono } from 'hono';
|
||||
import { cors } from 'hono/cors';
|
||||
import { requestId } from 'hono/request-id';
|
||||
import { errorHandler } from './lib/http/error-handler';
|
||||
import { requestIdMiddleware } from './lib/http/request-id';
|
||||
|
||||
export function createApp() {
|
||||
const app = new Hono<AppEnv>();
|
||||
|
||||
app.use('*', requestIdMiddleware);
|
||||
app.use('*', errorHandler);
|
||||
|
||||
const allowedOrigins = (Bun.env.CORS_ORIGIN ?? 'http://localhost:5173,http://127.0.0.1:5173')
|
||||
.split(',')
|
||||
.map((value) => value.trim())
|
||||
@@ -26,8 +21,6 @@ export function createApp() {
|
||||
},
|
||||
allowHeaders: ['Authorization', 'Content-Type'],
|
||||
allowMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
|
||||
exposeHeaders: ['Content-Length'],
|
||||
maxAge: 600,
|
||||
credentials: true,
|
||||
})
|
||||
);
|
||||
|
||||
21
apps/backend/src/auth-routes.js
Normal file
21
apps/backend/src/auth-routes.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { auth } from '@/lib/auth';
|
||||
import { cors } from 'hono/cors';
|
||||
export function registerAuthRoutes(app) {
|
||||
const allowedOrigins = (Bun.env.CORS_ORIGIN ?? 'http://localhost:5173,http://127.0.0.1:5173')
|
||||
.split(',')
|
||||
.map((value) => value.trim())
|
||||
.filter(Boolean);
|
||||
app.use('/api/auth/*', cors({
|
||||
origin: (origin) => {
|
||||
if (!origin)
|
||||
return allowedOrigins[0] ?? '';
|
||||
return allowedOrigins.includes(origin) ? origin : '';
|
||||
},
|
||||
allowHeaders: ['Content-Type', 'Authorization'],
|
||||
allowMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
|
||||
credentials: true,
|
||||
}));
|
||||
app.on(['POST', 'GET'], '/api/auth/*', (c) => {
|
||||
return auth.handler(c.req.raw);
|
||||
});
|
||||
}
|
||||
28
apps/backend/src/auth-routes.ts
Normal file
28
apps/backend/src/auth-routes.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { auth } from '@/lib/auth';
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import type { Hono } from 'hono';
|
||||
import { cors } from 'hono/cors';
|
||||
|
||||
export function registerAuthRoutes(app: Hono<AppEnv>) {
|
||||
const allowedOrigins = (Bun.env.CORS_ORIGIN ?? 'http://localhost:5173,http://127.0.0.1:5173')
|
||||
.split(',')
|
||||
.map((value) => value.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
app.use(
|
||||
'/api/auth/*',
|
||||
cors({
|
||||
origin: (origin) => {
|
||||
if (!origin) return allowedOrigins[0] ?? '';
|
||||
return allowedOrigins.includes(origin) ? origin : '';
|
||||
},
|
||||
allowHeaders: ['Content-Type', 'Authorization'],
|
||||
allowMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
|
||||
credentials: true,
|
||||
})
|
||||
);
|
||||
|
||||
app.on(['POST', 'GET'], '/api/auth/*', (c) => {
|
||||
return auth.handler(c.req.raw);
|
||||
});
|
||||
}
|
||||
@@ -1,401 +0,0 @@
|
||||
type BookingEmailData = {
|
||||
bookingCode: string;
|
||||
complexSlug?: string;
|
||||
complexName: string;
|
||||
date: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
courtName: string;
|
||||
sportName: string;
|
||||
customerName: string;
|
||||
price?: number;
|
||||
};
|
||||
|
||||
const APP_BASE_URL = process.env.APP_BASE_URL ?? 'http://localhost:5173';
|
||||
|
||||
function formatBookingPrice(price: number): string {
|
||||
if (price === 0) {
|
||||
return 'Sin cargo';
|
||||
}
|
||||
|
||||
return new Intl.NumberFormat('es-AR', {
|
||||
style: 'currency',
|
||||
currency: 'ARS',
|
||||
maximumFractionDigits: Number.isInteger(price) ? 0 : 2,
|
||||
}).format(price);
|
||||
}
|
||||
|
||||
function formatFriendlyDate(isoDate: string): string {
|
||||
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(isoDate);
|
||||
if (!match) return isoDate;
|
||||
|
||||
const date = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
|
||||
|
||||
const weekday = new Intl.DateTimeFormat('es-AR', { weekday: 'long' }).format(date);
|
||||
const day = date.getDate();
|
||||
const month = new Intl.DateTimeFormat('es-AR', { month: 'long' }).format(date);
|
||||
|
||||
return `${weekday.charAt(0).toUpperCase() + weekday.slice(1)}, ${day} de ${month}`;
|
||||
}
|
||||
|
||||
const BASE_STYLES = `
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #edf7f4;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
`;
|
||||
|
||||
export function wrapLayout(content: string) {
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Playzer</title>
|
||||
<style>${BASE_STYLES}</style>
|
||||
</head>
|
||||
<body style="margin:0;padding:0;background-color:#edf7f4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#edf7f4;">
|
||||
<tr>
|
||||
<td align="center" style="padding:24px 12px;">
|
||||
<table role="presentation" width="100%" style="max-width:520px;background-color:#ffffff;border-radius:28px;overflow:hidden;box-shadow:0 24px 70px rgba(15,23,42,0.12);border:1px solid rgba(5,9,20,0.1);">
|
||||
${content}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
export function bookingConfirmationHtml(data: BookingEmailData): string {
|
||||
const formattedPrice = formatBookingPrice(data.price ?? 0);
|
||||
const friendlyDate = formatFriendlyDate(data.date);
|
||||
|
||||
const content = `
|
||||
<tr>
|
||||
<td style="padding:24px 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0" style="display:inline-block;background-color:#f0fdf4;border-radius:999px;padding:4px 12px;">
|
||||
<tr>
|
||||
<td style="font-size:11px;font-weight:700;letter-spacing:0.14em;color:#15803d;text-transform:uppercase;line-height:1.25rem;">
|
||||
✓ Reserva confirmada
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1 style="margin:12px 0 0;font-size:28px;font-weight:700;color:#111827;letter-spacing:-0.025em;">
|
||||
${data.complexName}
|
||||
</h1>
|
||||
</td>
|
||||
<td valign="top" align="right" style="white-space:nowrap;">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="middle" style="padding-right:8px;">
|
||||
<img src="${APP_BASE_URL}/playzer-favicon-512-transparent.png" alt="Playzer" width="32" height="32" style="display:block;" />
|
||||
</td>
|
||||
<td valign="middle">
|
||||
<span style="font-size:18px;font-weight:700;color:#475569;letter-spacing:-0.025em;">Playzer</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#f0fdf4;border-radius:24px;border:1px solid rgba(5,150,105,0.3);">
|
||||
<tr>
|
||||
<td style="padding:20px 24px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="bottom">
|
||||
<p style="margin:0;font-size:13px;font-weight:600;color:#15803d;">
|
||||
Tu turno
|
||||
</p>
|
||||
<p style="margin:12px 0 0;font-size:28px;font-weight:900;color:#111827;line-height:1.1;letter-spacing:-0.025em;">
|
||||
${friendlyDate}
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:24px;font-weight:900;color:#059669;line-height:1;letter-spacing:-0.025em;">
|
||||
${data.startTime} — ${data.endTime}
|
||||
</p>
|
||||
</td>
|
||||
<td valign="bottom" align="right" style="padding-left:16px;">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0" style="background-color:rgba(255,255,255,0.8);border-radius:16px;border:1px solid rgba(5,150,105,0.2);">
|
||||
<tr>
|
||||
<td style="padding:12px 16px;text-align:right;min-width:120px;">
|
||||
<p style="margin:0;font-size:11px;font-weight:500;color:#6b7280;">Precio del turno</p>
|
||||
<p style="margin:4px 0 0;font-size:20px;font-weight:700;color:#111827;">${formattedPrice}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #e5e7eb;border-radius:22px;overflow:hidden;">
|
||||
<tr>
|
||||
<td width="50%" style="padding:16px;border-right:1px solid #e5e7eb;background-color:#ffffff;">
|
||||
<p style="margin:0;font-size:13px;font-weight:500;color:#6b7280;">
|
||||
Cancha
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:14px;font-weight:600;color:#111827;">
|
||||
${data.courtName} — ${data.sportName}
|
||||
</p>
|
||||
</td>
|
||||
<td width="50%" style="padding:16px;background-color:#ffffff;">
|
||||
<p style="margin:0;font-size:13px;font-weight:500;color:#6b7280;">
|
||||
Código de reserva
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-family:monospace;font-size:16px;font-weight:700;letter-spacing:0.18em;color:#111827;">
|
||||
${data.bookingCode}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
${
|
||||
data.complexSlug
|
||||
? `
|
||||
<tr>
|
||||
<td style="padding:0 20px 24px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0" style="background-color:#059669;border-radius:12px;">
|
||||
<tr>
|
||||
<td style="padding:14px 32px;font-size:15px;font-weight:600;">
|
||||
<a href="${APP_BASE_URL}/${data.complexSlug}/booking/confirmed/${data.bookingCode}" style="color:#ffffff;text-decoration:none;display:inline-block;">
|
||||
Cancelar reserva
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>`
|
||||
: ''
|
||||
}`;
|
||||
|
||||
return wrapLayout(content);
|
||||
}
|
||||
|
||||
export function bookingCancelledHtml(data: BookingEmailData): string {
|
||||
const friendlyDate = formatFriendlyDate(data.date);
|
||||
|
||||
const content = `
|
||||
<tr>
|
||||
<td style="padding:24px 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0" style="display:inline-block;background-color:#fef2f2;border-radius:999px;padding:4px 12px;">
|
||||
<tr>
|
||||
<td style="font-size:11px;font-weight:700;letter-spacing:0.14em;color:#dc2626;text-transform:uppercase;line-height:1.25rem;">
|
||||
✗ Reserva cancelada
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1 style="margin:12px 0 0;font-size:28px;font-weight:700;color:#111827;letter-spacing:-0.025em;">
|
||||
${data.complexName}
|
||||
</h1>
|
||||
</td>
|
||||
<td valign="top" align="right" style="white-space:nowrap;">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="middle" style="padding-right:8px;">
|
||||
<img src="${APP_BASE_URL}/playzer-favicon-512-transparent.png" alt="Playzer" width="32" height="32" style="display:block;" />
|
||||
</td>
|
||||
<td valign="middle">
|
||||
<span style="font-size:18px;font-weight:700;color:#475569;letter-spacing:-0.025em;">Playzer</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#f0fdf4;border-radius:24px;border:1px solid rgba(5,150,105,0.3);">
|
||||
<tr>
|
||||
<td style="padding:20px 24px;">
|
||||
<p style="margin:0;font-size:13px;font-weight:600;color:#15803d;">
|
||||
Tu turno
|
||||
</p>
|
||||
<p style="margin:12px 0 0;font-size:28px;font-weight:900;color:#111827;line-height:1.1;letter-spacing:-0.025em;">
|
||||
${friendlyDate}
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:24px;font-weight:900;color:#059669;line-height:1;letter-spacing:-0.025em;">
|
||||
${data.startTime} — ${data.endTime}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#fef2f2;border-radius:24px;border:1px solid rgba(220,38,38,0.3);">
|
||||
<tr>
|
||||
<td style="padding:20px 24px;">
|
||||
<p style="margin:0;font-size:14px;color:#374151;line-height:1.6;">
|
||||
La reserva <strong style="font-family:monospace;font-weight:700;letter-spacing:2px;">${data.bookingCode}</strong>
|
||||
fue cancelada. Si tenés dudas, contactate con el complejo.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 24px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #e5e7eb;border-radius:22px;overflow:hidden;">
|
||||
<tr>
|
||||
<td width="50%" style="padding:16px;border-right:1px solid #e5e7eb;background-color:#ffffff;">
|
||||
<p style="margin:0;font-size:13px;font-weight:500;color:#6b7280;">
|
||||
Cancha
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:14px;font-weight:600;color:#111827;">
|
||||
${data.courtName} — ${data.sportName}
|
||||
</p>
|
||||
</td>
|
||||
<td width="50%" style="padding:16px;background-color:#ffffff;">
|
||||
<p style="margin:0;font-size:13px;font-weight:500;color:#6b7280;">
|
||||
Cliente
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:14px;font-weight:600;color:#111827;">
|
||||
${data.customerName}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
return wrapLayout(content);
|
||||
}
|
||||
|
||||
export function bookingNoShowHtml(data: BookingEmailData): string {
|
||||
const friendlyDate = formatFriendlyDate(data.date);
|
||||
|
||||
const content = `
|
||||
<tr>
|
||||
<td style="padding:24px 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0" style="display:inline-block;background-color:#fffbeb;border-radius:999px;padding:4px 12px;">
|
||||
<tr>
|
||||
<td style="font-size:11px;font-weight:700;letter-spacing:0.14em;color:#d97706;text-transform:uppercase;line-height:1.25rem;">
|
||||
Reserva no concretada
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1 style="margin:12px 0 0;font-size:28px;font-weight:700;color:#111827;letter-spacing:-0.025em;">
|
||||
${data.complexName}
|
||||
</h1>
|
||||
</td>
|
||||
<td valign="top" align="right" style="white-space:nowrap;">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="middle" style="padding-right:8px;">
|
||||
<img src="${APP_BASE_URL}/playzer-favicon-512-transparent.png" alt="Playzer" width="32" height="32" style="display:block;" />
|
||||
</td>
|
||||
<td valign="middle">
|
||||
<span style="font-size:18px;font-weight:700;color:#475569;letter-spacing:-0.025em;">Playzer</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#f0fdf4;border-radius:24px;border:1px solid rgba(5,150,105,0.3);">
|
||||
<tr>
|
||||
<td style="padding:20px 24px;">
|
||||
<p style="margin:0;font-size:13px;font-weight:600;color:#15803d;">
|
||||
Tu turno
|
||||
</p>
|
||||
<p style="margin:12px 0 0;font-size:28px;font-weight:900;color:#111827;line-height:1.1;letter-spacing:-0.025em;">
|
||||
${friendlyDate}
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:24px;font-weight:900;color:#059669;line-height:1;letter-spacing:-0.025em;">
|
||||
${data.startTime} — ${data.endTime}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#fffbeb;border-radius:24px;border:1px solid rgba(217,119,6,0.3);">
|
||||
<tr>
|
||||
<td style="padding:20px 24px;">
|
||||
<p style="margin:0;font-size:14px;color:#374151;line-height:1.6;">
|
||||
La reserva <strong style="font-family:monospace;font-weight:700;letter-spacing:2px;">${data.bookingCode}</strong>
|
||||
fue registrada como no concretada por falta de asistencia.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 24px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #e5e7eb;border-radius:22px;overflow:hidden;">
|
||||
<tr>
|
||||
<td width="50%" style="padding:16px;border-right:1px solid #e5e7eb;background-color:#ffffff;">
|
||||
<p style="margin:0;font-size:13px;font-weight:500;color:#6b7280;">
|
||||
Cancha
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:14px;font-weight:600;color:#111827;">
|
||||
${data.courtName} — ${data.sportName}
|
||||
</p>
|
||||
</td>
|
||||
<td width="50%" style="padding:16px;background-color:#ffffff;">
|
||||
<p style="margin:0;font-size:13px;font-weight:500;color:#6b7280;">
|
||||
Cliente
|
||||
</p>
|
||||
<p style="margin:8px 0 0;font-size:14px;font-weight:600;color:#111827;">
|
||||
${data.customerName}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
return wrapLayout(content);
|
||||
}
|
||||
@@ -17,6 +17,56 @@ import * as Prisma from './internal/prismaNamespaceBrowser'
|
||||
export { Prisma }
|
||||
export * as $Enums from './enums'
|
||||
export * from './enums';
|
||||
/**
|
||||
* Model Plan
|
||||
*
|
||||
*/
|
||||
export type Plan = Prisma.PlanModel
|
||||
/**
|
||||
* Model Complex
|
||||
*
|
||||
*/
|
||||
export type Complex = Prisma.ComplexModel
|
||||
/**
|
||||
* Model ComplexUser
|
||||
*
|
||||
*/
|
||||
export type ComplexUser = Prisma.ComplexUserModel
|
||||
/**
|
||||
* Model Sport
|
||||
*
|
||||
*/
|
||||
export type Sport = Prisma.SportModel
|
||||
/**
|
||||
* Model Court
|
||||
*
|
||||
*/
|
||||
export type Court = Prisma.CourtModel
|
||||
/**
|
||||
* Model CourtAvailability
|
||||
*
|
||||
*/
|
||||
export type CourtAvailability = Prisma.CourtAvailabilityModel
|
||||
/**
|
||||
* Model CourtPriceRule
|
||||
*
|
||||
*/
|
||||
export type CourtPriceRule = Prisma.CourtPriceRuleModel
|
||||
/**
|
||||
* Model CourtBooking
|
||||
*
|
||||
*/
|
||||
export type CourtBooking = Prisma.CourtBookingModel
|
||||
/**
|
||||
* Model OnboardingRequest
|
||||
*
|
||||
*/
|
||||
export type OnboardingRequest = Prisma.OnboardingRequestModel
|
||||
/**
|
||||
* Model PasswordResetRequest
|
||||
*
|
||||
*/
|
||||
export type PasswordResetRequest = Prisma.PasswordResetRequestModel
|
||||
/**
|
||||
* Model User
|
||||
*
|
||||
@@ -37,63 +87,3 @@ export type Account = Prisma.AccountModel
|
||||
*
|
||||
*/
|
||||
export type Verification = Prisma.VerificationModel
|
||||
/**
|
||||
* Model Complex
|
||||
*
|
||||
*/
|
||||
export type Complex = Prisma.ComplexModel
|
||||
/**
|
||||
* Model ComplexUser
|
||||
*
|
||||
*/
|
||||
export type ComplexUser = Prisma.ComplexUserModel
|
||||
/**
|
||||
* Model ComplexInvitation
|
||||
*
|
||||
*/
|
||||
export type ComplexInvitation = Prisma.ComplexInvitationModel
|
||||
/**
|
||||
* Model Sport
|
||||
*
|
||||
*/
|
||||
export type Sport = Prisma.SportModel
|
||||
/**
|
||||
* Model Court
|
||||
*
|
||||
*/
|
||||
export type Court = Prisma.CourtModel
|
||||
/**
|
||||
* Model CourtMaintenance
|
||||
*
|
||||
*/
|
||||
export type CourtMaintenance = Prisma.CourtMaintenanceModel
|
||||
/**
|
||||
* Model CourtAvailability
|
||||
*
|
||||
*/
|
||||
export type CourtAvailability = Prisma.CourtAvailabilityModel
|
||||
/**
|
||||
* Model CourtPriceRule
|
||||
*
|
||||
*/
|
||||
export type CourtPriceRule = Prisma.CourtPriceRuleModel
|
||||
/**
|
||||
* Model CourtBooking
|
||||
*
|
||||
*/
|
||||
export type CourtBooking = Prisma.CourtBookingModel
|
||||
/**
|
||||
* Model CourtBookingLog
|
||||
*
|
||||
*/
|
||||
export type CourtBookingLog = Prisma.CourtBookingLogModel
|
||||
/**
|
||||
* Model PasswordResetRequest
|
||||
*
|
||||
*/
|
||||
export type PasswordResetRequest = Prisma.PasswordResetRequestModel
|
||||
/**
|
||||
* Model Plan
|
||||
*
|
||||
*/
|
||||
export type Plan = Prisma.PlanModel
|
||||
|
||||
@@ -31,8 +31,8 @@ export * from "./enums"
|
||||
* const prisma = new PrismaClient({
|
||||
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
||||
* })
|
||||
* // Fetch zero or more Users
|
||||
* const users = await prisma.user.findMany()
|
||||
* // Fetch zero or more Plans
|
||||
* const plans = await prisma.plan.findMany()
|
||||
* ```
|
||||
*
|
||||
* Read more in our [docs](https://pris.ly/d/client).
|
||||
@@ -41,6 +41,56 @@ export const PrismaClient = $Class.getPrismaClientClass()
|
||||
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
||||
export { Prisma }
|
||||
|
||||
/**
|
||||
* Model Plan
|
||||
*
|
||||
*/
|
||||
export type Plan = Prisma.PlanModel
|
||||
/**
|
||||
* Model Complex
|
||||
*
|
||||
*/
|
||||
export type Complex = Prisma.ComplexModel
|
||||
/**
|
||||
* Model ComplexUser
|
||||
*
|
||||
*/
|
||||
export type ComplexUser = Prisma.ComplexUserModel
|
||||
/**
|
||||
* Model Sport
|
||||
*
|
||||
*/
|
||||
export type Sport = Prisma.SportModel
|
||||
/**
|
||||
* Model Court
|
||||
*
|
||||
*/
|
||||
export type Court = Prisma.CourtModel
|
||||
/**
|
||||
* Model CourtAvailability
|
||||
*
|
||||
*/
|
||||
export type CourtAvailability = Prisma.CourtAvailabilityModel
|
||||
/**
|
||||
* Model CourtPriceRule
|
||||
*
|
||||
*/
|
||||
export type CourtPriceRule = Prisma.CourtPriceRuleModel
|
||||
/**
|
||||
* Model CourtBooking
|
||||
*
|
||||
*/
|
||||
export type CourtBooking = Prisma.CourtBookingModel
|
||||
/**
|
||||
* Model OnboardingRequest
|
||||
*
|
||||
*/
|
||||
export type OnboardingRequest = Prisma.OnboardingRequestModel
|
||||
/**
|
||||
* Model PasswordResetRequest
|
||||
*
|
||||
*/
|
||||
export type PasswordResetRequest = Prisma.PasswordResetRequestModel
|
||||
/**
|
||||
* Model User
|
||||
*
|
||||
@@ -61,63 +111,3 @@ export type Account = Prisma.AccountModel
|
||||
*
|
||||
*/
|
||||
export type Verification = Prisma.VerificationModel
|
||||
/**
|
||||
* Model Complex
|
||||
*
|
||||
*/
|
||||
export type Complex = Prisma.ComplexModel
|
||||
/**
|
||||
* Model ComplexUser
|
||||
*
|
||||
*/
|
||||
export type ComplexUser = Prisma.ComplexUserModel
|
||||
/**
|
||||
* Model ComplexInvitation
|
||||
*
|
||||
*/
|
||||
export type ComplexInvitation = Prisma.ComplexInvitationModel
|
||||
/**
|
||||
* Model Sport
|
||||
*
|
||||
*/
|
||||
export type Sport = Prisma.SportModel
|
||||
/**
|
||||
* Model Court
|
||||
*
|
||||
*/
|
||||
export type Court = Prisma.CourtModel
|
||||
/**
|
||||
* Model CourtMaintenance
|
||||
*
|
||||
*/
|
||||
export type CourtMaintenance = Prisma.CourtMaintenanceModel
|
||||
/**
|
||||
* Model CourtAvailability
|
||||
*
|
||||
*/
|
||||
export type CourtAvailability = Prisma.CourtAvailabilityModel
|
||||
/**
|
||||
* Model CourtPriceRule
|
||||
*
|
||||
*/
|
||||
export type CourtPriceRule = Prisma.CourtPriceRuleModel
|
||||
/**
|
||||
* Model CourtBooking
|
||||
*
|
||||
*/
|
||||
export type CourtBooking = Prisma.CourtBookingModel
|
||||
/**
|
||||
* Model CourtBookingLog
|
||||
*
|
||||
*/
|
||||
export type CourtBookingLog = Prisma.CourtBookingLogModel
|
||||
/**
|
||||
* Model PasswordResetRequest
|
||||
*
|
||||
*/
|
||||
export type PasswordResetRequest = Prisma.PasswordResetRequestModel
|
||||
/**
|
||||
* Model Plan
|
||||
*
|
||||
*/
|
||||
export type Plan = Prisma.PlanModel
|
||||
|
||||
@@ -29,35 +29,39 @@ export type StringFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedStringFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type BoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
export type DecimalFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type StringNullableFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
|
||||
}
|
||||
export type JsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type DateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
export type JsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type DateTimeFilter<$PrismaModel = never> = {
|
||||
@@ -71,11 +75,6 @@ export type DateTimeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string
|
||||
}
|
||||
|
||||
export type SortOrderInput = {
|
||||
sort: Prisma.SortOrder
|
||||
nulls?: Prisma.NullsOrder
|
||||
}
|
||||
|
||||
export type StringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
@@ -94,12 +93,113 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type BoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type UuidFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedUuidFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type StringNullableFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
|
||||
}
|
||||
|
||||
export type BoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
}
|
||||
|
||||
export type SortOrderInput = {
|
||||
sort: Prisma.SortOrder
|
||||
nulls?: Prisma.NullsOrder
|
||||
}
|
||||
|
||||
export type UuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedUuidWithAggregatesFilter<$PrismaModel> | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -120,86 +220,12 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedStringNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
|
||||
export type BoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type FloatNullableFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null
|
||||
}
|
||||
|
||||
export type FloatNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedFloatNullableWithAggregatesFilter<$PrismaModel> | number | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type UuidFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedUuidFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type UuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedUuidWithAggregatesFilter<$PrismaModel> | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumComplexUserRoleFilter<$PrismaModel = never> = {
|
||||
@@ -230,17 +256,6 @@ export type IntFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type DecimalFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type IntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
|
||||
@@ -257,22 +272,6 @@ export type IntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumDayOfWeekFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel>
|
||||
@@ -324,55 +323,56 @@ export type EnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
export type DateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type JsonWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
export type UuidNullableFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedUuidNullableFilter<$PrismaModel> | string | null
|
||||
}
|
||||
|
||||
export type UuidNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
mode?: Prisma.QueryMode
|
||||
not?: Prisma.NestedUuidNullableWithAggregatesFilter<$PrismaModel> | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedStringNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedStringNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedStringFilter<$PrismaModel = never> = {
|
||||
@@ -389,34 +389,15 @@ export type NestedStringFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedStringFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type NestedBoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
}
|
||||
|
||||
export type NestedStringNullableFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
|
||||
}
|
||||
|
||||
export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
export type NestedDecimalFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type NestedDateTimeFilter<$PrismaModel = never> = {
|
||||
@@ -458,12 +439,102 @@ export type NestedIntFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedJsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type NestedJsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedUuidFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedUuidFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type NestedStringNullableFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
|
||||
}
|
||||
|
||||
export type NestedBoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
}
|
||||
|
||||
export type NestedUuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedUuidWithAggregatesFilter<$PrismaModel> | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -494,84 +565,12 @@ export type NestedIntNullableFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null
|
||||
}
|
||||
|
||||
export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
|
||||
export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedFloatNullableFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null
|
||||
}
|
||||
|
||||
export type NestedFloatNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null
|
||||
lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.FloatFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedFloatNullableWithAggregatesFilter<$PrismaModel> | number | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedFloatNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedUuidFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedUuidFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type NestedUuidWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedUuidWithAggregatesFilter<$PrismaModel> | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumComplexUserRoleFilter<$PrismaModel = never> = {
|
||||
@@ -591,17 +590,6 @@ export type NestedEnumComplexUserRoleWithAggregatesFilter<$PrismaModel = never>
|
||||
_max?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedDecimalFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
|
||||
@@ -629,22 +617,6 @@ export type NestedFloatFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedFloatFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel>
|
||||
lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumDayOfWeekFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel>
|
||||
@@ -696,28 +668,54 @@ export type NestedEnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = neve
|
||||
_max?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedJsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
|
||||
}
|
||||
|
||||
export type NestedJsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string[]
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel>
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null
|
||||
lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedUuidNullableFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedUuidNullableFilter<$PrismaModel> | string | null
|
||||
}
|
||||
|
||||
export type NestedUuidNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
lt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
lte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gt?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
gte?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedUuidNullableWithAggregatesFilter<$PrismaModel> | string | null
|
||||
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedStringNullableFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedStringNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
export const ComplexUserRole = {
|
||||
ADMIN: 'ADMIN',
|
||||
EMPLOYEE: 'EMPLOYEE'
|
||||
MANAGER: 'MANAGER',
|
||||
USER: 'USER'
|
||||
} as const
|
||||
|
||||
export type ComplexUserRole = (typeof ComplexUserRole)[keyof typeof ComplexUserRole]
|
||||
@@ -33,8 +34,7 @@ export type DayOfWeek = (typeof DayOfWeek)[keyof typeof DayOfWeek]
|
||||
export const CourtBookingStatus = {
|
||||
CONFIRMED: 'CONFIRMED',
|
||||
CANCELLED: 'CANCELLED',
|
||||
COMPLETED: 'COMPLETED',
|
||||
NOSHOW: 'NOSHOW'
|
||||
COMPLETED: 'COMPLETED'
|
||||
} as const
|
||||
|
||||
export type CourtBookingStatus = (typeof CourtBookingStatus)[keyof typeof CourtBookingStatus]
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -51,22 +51,20 @@ export const AnyNull = runtime.AnyNull
|
||||
|
||||
|
||||
export const ModelName = {
|
||||
User: 'User',
|
||||
Session: 'Session',
|
||||
Account: 'Account',
|
||||
Verification: 'Verification',
|
||||
Plan: 'Plan',
|
||||
Complex: 'Complex',
|
||||
ComplexUser: 'ComplexUser',
|
||||
ComplexInvitation: 'ComplexInvitation',
|
||||
Sport: 'Sport',
|
||||
Court: 'Court',
|
||||
CourtMaintenance: 'CourtMaintenance',
|
||||
CourtAvailability: 'CourtAvailability',
|
||||
CourtPriceRule: 'CourtPriceRule',
|
||||
CourtBooking: 'CourtBooking',
|
||||
CourtBookingLog: 'CourtBookingLog',
|
||||
OnboardingRequest: 'OnboardingRequest',
|
||||
PasswordResetRequest: 'PasswordResetRequest',
|
||||
Plan: 'Plan'
|
||||
User: 'User',
|
||||
Session: 'Session',
|
||||
Account: 'Account',
|
||||
Verification: 'Verification'
|
||||
} as const
|
||||
|
||||
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
||||
@@ -85,84 +83,28 @@ export const TransactionIsolationLevel = runtime.makeStrictEnum({
|
||||
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
|
||||
|
||||
|
||||
export const UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
export const PlanScalarFieldEnum = {
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
email: 'email',
|
||||
emailVerified: 'emailVerified',
|
||||
image: 'image',
|
||||
phone: 'phone',
|
||||
banned: 'banned',
|
||||
bannedAt: 'bannedAt',
|
||||
banReason: 'banReason',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
role: 'role'
|
||||
price: 'price',
|
||||
rules: 'rules',
|
||||
lastUpdatedAt: 'lastUpdatedAt'
|
||||
} as const
|
||||
|
||||
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
|
||||
|
||||
|
||||
export const SessionScalarFieldEnum = {
|
||||
id: 'id',
|
||||
expiresAt: 'expiresAt',
|
||||
token: 'token',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
ipAddress: 'ipAddress',
|
||||
userAgent: 'userAgent',
|
||||
country: 'country',
|
||||
city: 'city',
|
||||
countryCode: 'countryCode',
|
||||
latitude: 'latitude',
|
||||
longitude: 'longitude',
|
||||
userId: 'userId'
|
||||
} as const
|
||||
|
||||
export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum]
|
||||
|
||||
|
||||
export const AccountScalarFieldEnum = {
|
||||
id: 'id',
|
||||
accountId: 'accountId',
|
||||
providerId: 'providerId',
|
||||
userId: 'userId',
|
||||
accessToken: 'accessToken',
|
||||
refreshToken: 'refreshToken',
|
||||
idToken: 'idToken',
|
||||
accessTokenExpiresAt: 'accessTokenExpiresAt',
|
||||
refreshTokenExpiresAt: 'refreshTokenExpiresAt',
|
||||
scope: 'scope',
|
||||
password: 'password',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum]
|
||||
|
||||
|
||||
export const VerificationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
identifier: 'identifier',
|
||||
value: 'value',
|
||||
expiresAt: 'expiresAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum]
|
||||
export type PlanScalarFieldEnum = (typeof PlanScalarFieldEnum)[keyof typeof PlanScalarFieldEnum]
|
||||
|
||||
|
||||
export const ComplexScalarFieldEnum = {
|
||||
id: 'id',
|
||||
complexSlug: 'complexSlug',
|
||||
complexName: 'complexName',
|
||||
physicalAddress: 'physicalAddress',
|
||||
city: 'city',
|
||||
state: 'state',
|
||||
country: 'country',
|
||||
complexSlug: 'complexSlug',
|
||||
adminEmail: 'adminEmail',
|
||||
planCode: 'planCode',
|
||||
isActive: 'isActive',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
@@ -171,28 +113,15 @@ export type ComplexScalarFieldEnum = (typeof ComplexScalarFieldEnum)[keyof typeo
|
||||
|
||||
|
||||
export const ComplexUserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
complexId: 'complexId',
|
||||
userId: 'userId',
|
||||
role: 'role',
|
||||
createdAt: 'createdAt'
|
||||
} as const
|
||||
|
||||
export type ComplexUserScalarFieldEnum = (typeof ComplexUserScalarFieldEnum)[keyof typeof ComplexUserScalarFieldEnum]
|
||||
|
||||
|
||||
export const ComplexInvitationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
complexId: 'complexId',
|
||||
email: 'email',
|
||||
tokenHash: 'tokenHash',
|
||||
expiresAt: 'expiresAt',
|
||||
acceptedAt: 'acceptedAt',
|
||||
revokedAt: 'revokedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type ComplexInvitationScalarFieldEnum = (typeof ComplexInvitationScalarFieldEnum)[keyof typeof ComplexInvitationScalarFieldEnum]
|
||||
export type ComplexUserScalarFieldEnum = (typeof ComplexUserScalarFieldEnum)[keyof typeof ComplexUserScalarFieldEnum]
|
||||
|
||||
|
||||
export const SportScalarFieldEnum = {
|
||||
@@ -214,8 +143,6 @@ export const CourtScalarFieldEnum = {
|
||||
name: 'name',
|
||||
slotDurationMinutes: 'slotDurationMinutes',
|
||||
basePrice: 'basePrice',
|
||||
isUnderMaintenance: 'isUnderMaintenance',
|
||||
maintenanceReason: 'maintenanceReason',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
@@ -223,20 +150,6 @@ export const CourtScalarFieldEnum = {
|
||||
export type CourtScalarFieldEnum = (typeof CourtScalarFieldEnum)[keyof typeof CourtScalarFieldEnum]
|
||||
|
||||
|
||||
export const CourtMaintenanceScalarFieldEnum = {
|
||||
id: 'id',
|
||||
courtId: 'courtId',
|
||||
startDate: 'startDate',
|
||||
startTime: 'startTime',
|
||||
endTime: 'endTime',
|
||||
reason: 'reason',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type CourtMaintenanceScalarFieldEnum = (typeof CourtMaintenanceScalarFieldEnum)[keyof typeof CourtMaintenanceScalarFieldEnum]
|
||||
|
||||
|
||||
export const CourtAvailabilityScalarFieldEnum = {
|
||||
id: 'id',
|
||||
courtId: 'courtId',
|
||||
@@ -273,7 +186,6 @@ export const CourtBookingScalarFieldEnum = {
|
||||
endTime: 'endTime',
|
||||
customerName: 'customerName',
|
||||
customerPhone: 'customerPhone',
|
||||
customerEmail: 'customerEmail',
|
||||
status: 'status',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
@@ -282,22 +194,22 @@ export const CourtBookingScalarFieldEnum = {
|
||||
export type CourtBookingScalarFieldEnum = (typeof CourtBookingScalarFieldEnum)[keyof typeof CourtBookingScalarFieldEnum]
|
||||
|
||||
|
||||
export const CourtBookingLogScalarFieldEnum = {
|
||||
export const OnboardingRequestScalarFieldEnum = {
|
||||
id: 'id',
|
||||
bookingCode: 'bookingCode',
|
||||
courtId: 'courtId',
|
||||
bookingDate: 'bookingDate',
|
||||
startTime: 'startTime',
|
||||
endTime: 'endTime',
|
||||
previousStatus: 'previousStatus',
|
||||
newStatus: 'newStatus',
|
||||
customerName: 'customerName',
|
||||
customerPhone: 'customerPhone',
|
||||
customerEmail: 'customerEmail',
|
||||
changedAt: 'changedAt'
|
||||
fullName: 'fullName',
|
||||
email: 'email',
|
||||
otpHash: 'otpHash',
|
||||
otpExpiresAt: 'otpExpiresAt',
|
||||
otpAttempts: 'otpAttempts',
|
||||
otpLastSentAt: 'otpLastSentAt',
|
||||
otpResendCount: 'otpResendCount',
|
||||
emailVerifiedAt: 'emailVerifiedAt',
|
||||
completedAt: 'completedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type CourtBookingLogScalarFieldEnum = (typeof CourtBookingLogScalarFieldEnum)[keyof typeof CourtBookingLogScalarFieldEnum]
|
||||
export type OnboardingRequestScalarFieldEnum = (typeof OnboardingRequestScalarFieldEnum)[keyof typeof OnboardingRequestScalarFieldEnum]
|
||||
|
||||
|
||||
export const PasswordResetRequestScalarFieldEnum = {
|
||||
@@ -316,15 +228,64 @@ export const PasswordResetRequestScalarFieldEnum = {
|
||||
export type PasswordResetRequestScalarFieldEnum = (typeof PasswordResetRequestScalarFieldEnum)[keyof typeof PasswordResetRequestScalarFieldEnum]
|
||||
|
||||
|
||||
export const PlanScalarFieldEnum = {
|
||||
code: 'code',
|
||||
export const UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
supabaseUserId: 'supabaseUserId',
|
||||
name: 'name',
|
||||
price: 'price',
|
||||
rules: 'rules',
|
||||
lastUpdatedAt: 'lastUpdatedAt'
|
||||
email: 'email',
|
||||
emailVerified: 'emailVerified',
|
||||
image: 'image',
|
||||
fullName: 'fullName',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type PlanScalarFieldEnum = (typeof PlanScalarFieldEnum)[keyof typeof PlanScalarFieldEnum]
|
||||
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
|
||||
|
||||
|
||||
export const SessionScalarFieldEnum = {
|
||||
id: 'id',
|
||||
userId: 'userId',
|
||||
token: 'token',
|
||||
expiresAt: 'expiresAt',
|
||||
ipAddress: 'ipAddress',
|
||||
userAgent: 'userAgent',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type SessionScalarFieldEnum = (typeof SessionScalarFieldEnum)[keyof typeof SessionScalarFieldEnum]
|
||||
|
||||
|
||||
export const AccountScalarFieldEnum = {
|
||||
id: 'id',
|
||||
userId: 'userId',
|
||||
accountId: 'accountId',
|
||||
providerId: 'providerId',
|
||||
accessToken: 'accessToken',
|
||||
refreshToken: 'refreshToken',
|
||||
accessTokenExpiresAt: 'accessTokenExpiresAt',
|
||||
refreshTokenExpiresAt: 'refreshTokenExpiresAt',
|
||||
scope: 'scope',
|
||||
idToken: 'idToken',
|
||||
password: 'password',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum]
|
||||
|
||||
|
||||
export const VerificationScalarFieldEnum = {
|
||||
id: 'id',
|
||||
identifier: 'identifier',
|
||||
value: 'value',
|
||||
expiresAt: 'expiresAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum]
|
||||
|
||||
|
||||
export const SortOrder = {
|
||||
@@ -350,14 +311,6 @@ export const QueryMode = {
|
||||
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
|
||||
|
||||
|
||||
export const NullsOrder = {
|
||||
first: 'first',
|
||||
last: 'last'
|
||||
} as const
|
||||
|
||||
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
|
||||
|
||||
|
||||
export const JsonNullValueFilter = {
|
||||
DbNull: DbNull,
|
||||
JsonNull: JsonNull,
|
||||
@@ -366,3 +319,11 @@ export const JsonNullValueFilter = {
|
||||
|
||||
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
|
||||
|
||||
|
||||
export const NullsOrder = {
|
||||
first: 'first',
|
||||
last: 'last'
|
||||
} as const
|
||||
|
||||
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
|
||||
|
||||
|
||||
@@ -8,20 +8,18 @@
|
||||
*
|
||||
* 🟢 You can import this file directly.
|
||||
*/
|
||||
export type * from './models/Plan'
|
||||
export type * from './models/Complex'
|
||||
export type * from './models/ComplexUser'
|
||||
export type * from './models/Sport'
|
||||
export type * from './models/Court'
|
||||
export type * from './models/CourtAvailability'
|
||||
export type * from './models/CourtPriceRule'
|
||||
export type * from './models/CourtBooking'
|
||||
export type * from './models/OnboardingRequest'
|
||||
export type * from './models/PasswordResetRequest'
|
||||
export type * from './models/User'
|
||||
export type * from './models/Session'
|
||||
export type * from './models/Account'
|
||||
export type * from './models/Verification'
|
||||
export type * from './models/Complex'
|
||||
export type * from './models/ComplexUser'
|
||||
export type * from './models/ComplexInvitation'
|
||||
export type * from './models/Sport'
|
||||
export type * from './models/Court'
|
||||
export type * from './models/CourtMaintenance'
|
||||
export type * from './models/CourtAvailability'
|
||||
export type * from './models/CourtPriceRule'
|
||||
export type * from './models/CourtBooking'
|
||||
export type * from './models/CourtBookingLog'
|
||||
export type * from './models/PasswordResetRequest'
|
||||
export type * from './models/Plan'
|
||||
export type * from './commonInputTypes'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,47 +25,59 @@ export type AggregateComplexUser = {
|
||||
}
|
||||
|
||||
export type ComplexUserMinAggregateOutputType = {
|
||||
id: string | null
|
||||
complexId: string | null
|
||||
userId: string | null
|
||||
role: $Enums.ComplexUserRole | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
}
|
||||
|
||||
export type ComplexUserMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
complexId: string | null
|
||||
userId: string | null
|
||||
role: $Enums.ComplexUserRole | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
}
|
||||
|
||||
export type ComplexUserCountAggregateOutputType = {
|
||||
id: number
|
||||
complexId: number
|
||||
userId: number
|
||||
role: number
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
|
||||
export type ComplexUserMinAggregateInputType = {
|
||||
id?: true
|
||||
complexId?: true
|
||||
userId?: true
|
||||
role?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
|
||||
export type ComplexUserMaxAggregateInputType = {
|
||||
id?: true
|
||||
complexId?: true
|
||||
userId?: true
|
||||
role?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
|
||||
export type ComplexUserCountAggregateInputType = {
|
||||
id?: true
|
||||
complexId?: true
|
||||
userId?: true
|
||||
role?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
_all?: true
|
||||
}
|
||||
|
||||
@@ -142,10 +154,12 @@ export type ComplexUserGroupByArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
}
|
||||
|
||||
export type ComplexUserGroupByOutputType = {
|
||||
id: string
|
||||
complexId: string
|
||||
userId: string
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
_count: ComplexUserCountAggregateOutputType | null
|
||||
_min: ComplexUserMinAggregateOutputType | null
|
||||
_max: ComplexUserMaxAggregateOutputType | null
|
||||
@@ -170,24 +184,29 @@ export type ComplexUserWhereInput = {
|
||||
AND?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
|
||||
OR?: Prisma.ComplexUserWhereInput[]
|
||||
NOT?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
|
||||
id?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
complexId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
|
||||
}
|
||||
|
||||
export type ComplexUserOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexId?: Prisma.SortOrder
|
||||
userId?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
complex?: Prisma.ComplexOrderByWithRelationInput
|
||||
user?: Prisma.UserOrderByWithRelationInput
|
||||
}
|
||||
|
||||
export type ComplexUserWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: string
|
||||
complexId_userId?: Prisma.ComplexUserComplexIdUserIdCompoundUniqueInput
|
||||
AND?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
|
||||
OR?: Prisma.ComplexUserWhereInput[]
|
||||
@@ -196,15 +215,18 @@ export type ComplexUserWhereUniqueInput = Prisma.AtLeast<{
|
||||
userId?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
|
||||
}, "complexId_userId">
|
||||
}, "id" | "complexId_userId">
|
||||
|
||||
export type ComplexUserOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexId?: Prisma.SortOrder
|
||||
userId?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
_count?: Prisma.ComplexUserCountOrderByAggregateInput
|
||||
_max?: Prisma.ComplexUserMaxOrderByAggregateInput
|
||||
_min?: Prisma.ComplexUserMinOrderByAggregateInput
|
||||
@@ -214,57 +236,73 @@ export type ComplexUserScalarWhereWithAggregatesInput = {
|
||||
AND?: Prisma.ComplexUserScalarWhereWithAggregatesInput | Prisma.ComplexUserScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.ComplexUserScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.ComplexUserScalarWhereWithAggregatesInput | Prisma.ComplexUserScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.StringWithAggregatesFilter<"ComplexUser"> | string
|
||||
complexId?: Prisma.UuidWithAggregatesFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.StringWithAggregatesFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleWithAggregatesFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"ComplexUser"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"ComplexUser"> | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateInput = {
|
||||
role?: $Enums.ComplexUserRole
|
||||
id?: string
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutUsersInput
|
||||
user: Prisma.UserCreateNestedOneWithoutComplexesInput
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedCreateInput = {
|
||||
id?: string
|
||||
complexId: string
|
||||
userId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput
|
||||
user?: Prisma.UserUpdateOneRequiredWithoutComplexesNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyInput = {
|
||||
id?: string
|
||||
complexId: string
|
||||
userId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserListRelationFilter = {
|
||||
@@ -283,66 +321,30 @@ export type ComplexUserComplexIdUserIdCompoundUniqueInput = {
|
||||
}
|
||||
|
||||
export type ComplexUserCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexId?: Prisma.SortOrder
|
||||
userId?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type ComplexUserMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexId?: Prisma.SortOrder
|
||||
userId?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type ComplexUserMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexId?: Prisma.SortOrder
|
||||
userId?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type ComplexUserCreateNestedManyWithoutUserInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedCreateNestedManyWithoutUserInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateManyWithoutUserNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[]
|
||||
updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[]
|
||||
deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateManyWithoutUserNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[]
|
||||
updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[]
|
||||
deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type ComplexUserCreateNestedManyWithoutComplexInput = {
|
||||
@@ -391,64 +393,62 @@ export type EnumComplexUserRoleFieldUpdateOperationsInput = {
|
||||
set?: $Enums.ComplexUserRole
|
||||
}
|
||||
|
||||
export type ComplexUserCreateWithoutUserInput = {
|
||||
role?: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutUsersInput
|
||||
export type ComplexUserCreateNestedManyWithoutUserInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedCreateWithoutUserInput = {
|
||||
complexId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
export type ComplexUserUncheckedCreateNestedManyWithoutUserInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ComplexUserCreateOrConnectWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
|
||||
export type ComplexUserUpdateManyWithoutUserNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[]
|
||||
updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[]
|
||||
deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyUserInputEnvelope = {
|
||||
data: Prisma.ComplexUserCreateManyUserInput | Prisma.ComplexUserCreateManyUserInput[]
|
||||
skipDuplicates?: boolean
|
||||
}
|
||||
|
||||
export type ComplexUserUpsertWithWhereUniqueWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
update: Prisma.XOR<Prisma.ComplexUserUpdateWithoutUserInput, Prisma.ComplexUserUncheckedUpdateWithoutUserInput>
|
||||
create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateWithWhereUniqueWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
data: Prisma.XOR<Prisma.ComplexUserUpdateWithoutUserInput, Prisma.ComplexUserUncheckedUpdateWithoutUserInput>
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateManyWithWhereWithoutUserInput = {
|
||||
where: Prisma.ComplexUserScalarWhereInput
|
||||
data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyWithoutUserInput>
|
||||
}
|
||||
|
||||
export type ComplexUserScalarWhereInput = {
|
||||
AND?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
OR?: Prisma.ComplexUserScalarWhereInput[]
|
||||
NOT?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
complexId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
export type ComplexUserUncheckedUpdateManyWithoutUserNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
|
||||
upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[]
|
||||
createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
|
||||
set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
|
||||
update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[]
|
||||
updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[]
|
||||
deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type ComplexUserCreateWithoutComplexInput = {
|
||||
role?: $Enums.ComplexUserRole
|
||||
id?: string
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
user: Prisma.UserCreateNestedOneWithoutComplexesInput
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedCreateWithoutComplexInput = {
|
||||
id?: string
|
||||
userId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateOrConnectWithoutComplexInput = {
|
||||
@@ -477,91 +477,169 @@ export type ComplexUserUpdateManyWithWhereWithoutComplexInput = {
|
||||
data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyWithoutComplexInput>
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyUserInput = {
|
||||
complexId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
export type ComplexUserScalarWhereInput = {
|
||||
AND?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
OR?: Prisma.ComplexUserScalarWhereInput[]
|
||||
NOT?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
id?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
complexId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateWithoutUserInput = {
|
||||
id?: string
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutUsersInput
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateWithoutUserInput = {
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput
|
||||
export type ComplexUserUncheckedCreateWithoutUserInput = {
|
||||
id?: string
|
||||
complexId: string
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateWithoutUserInput = {
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
export type ComplexUserCreateOrConnectWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateManyWithoutUserInput = {
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
export type ComplexUserCreateManyUserInputEnvelope = {
|
||||
data: Prisma.ComplexUserCreateManyUserInput | Prisma.ComplexUserCreateManyUserInput[]
|
||||
skipDuplicates?: boolean
|
||||
}
|
||||
|
||||
export type ComplexUserUpsertWithWhereUniqueWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
update: Prisma.XOR<Prisma.ComplexUserUpdateWithoutUserInput, Prisma.ComplexUserUncheckedUpdateWithoutUserInput>
|
||||
create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateWithWhereUniqueWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
data: Prisma.XOR<Prisma.ComplexUserUpdateWithoutUserInput, Prisma.ComplexUserUncheckedUpdateWithoutUserInput>
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateManyWithWhereWithoutUserInput = {
|
||||
where: Prisma.ComplexUserScalarWhereInput
|
||||
data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyWithoutUserInput>
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyComplexInput = {
|
||||
id?: string
|
||||
userId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateWithoutComplexInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
user?: Prisma.UserUpdateOneRequiredWithoutComplexesNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateWithoutComplexInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateManyWithoutComplexInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
userId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyUserInput = {
|
||||
id?: string
|
||||
complexId: string
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateWithoutUserInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateWithoutUserInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateManyWithoutUserInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type ComplexUserSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
complexId?: boolean
|
||||
userId?: boolean
|
||||
role?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["complexUser"]>
|
||||
|
||||
export type ComplexUserSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
complexId?: boolean
|
||||
userId?: boolean
|
||||
role?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["complexUser"]>
|
||||
|
||||
export type ComplexUserSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
complexId?: boolean
|
||||
userId?: boolean
|
||||
role?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["complexUser"]>
|
||||
|
||||
export type ComplexUserSelectScalar = {
|
||||
id?: boolean
|
||||
complexId?: boolean
|
||||
userId?: boolean
|
||||
role?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
}
|
||||
|
||||
export type ComplexUserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"complexId" | "userId" | "role" | "createdAt", ExtArgs["result"]["complexUser"]>
|
||||
export type ComplexUserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "complexId" | "userId" | "role" | "createdAt" | "updatedAt", ExtArgs["result"]["complexUser"]>
|
||||
export type ComplexUserInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
|
||||
@@ -582,10 +660,12 @@ export type $ComplexUserPayload<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
user: Prisma.$UserPayload<ExtArgs>
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
complexId: string
|
||||
userId: string
|
||||
role: $Enums.ComplexUserRole
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}, ExtArgs["result"]["complexUser"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -669,8 +749,8 @@ export interface ComplexUserDelegate<ExtArgs extends runtime.Types.Extensions.In
|
||||
* // Get first 10 ComplexUsers
|
||||
* const complexUsers = await prisma.complexUser.findMany({ take: 10 })
|
||||
*
|
||||
* // Only select the `complexId`
|
||||
* const complexUserWithComplexIdOnly = await prisma.complexUser.findMany({ select: { complexId: true } })
|
||||
* // Only select the `id`
|
||||
* const complexUserWithIdOnly = await prisma.complexUser.findMany({ select: { id: true } })
|
||||
*
|
||||
*/
|
||||
findMany<T extends ComplexUserFindManyArgs>(args?: Prisma.SelectSubset<T, ComplexUserFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>
|
||||
@@ -714,9 +794,9 @@ export interface ComplexUserDelegate<ExtArgs extends runtime.Types.Extensions.In
|
||||
* ]
|
||||
* })
|
||||
*
|
||||
* // Create many ComplexUsers and only return the `complexId`
|
||||
* const complexUserWithComplexIdOnly = await prisma.complexUser.createManyAndReturn({
|
||||
* select: { complexId: true },
|
||||
* // Create many ComplexUsers and only return the `id`
|
||||
* const complexUserWithIdOnly = await prisma.complexUser.createManyAndReturn({
|
||||
* select: { id: true },
|
||||
* data: [
|
||||
* // ... provide data here
|
||||
* ]
|
||||
@@ -805,9 +885,9 @@ export interface ComplexUserDelegate<ExtArgs extends runtime.Types.Extensions.In
|
||||
* ]
|
||||
* })
|
||||
*
|
||||
* // Update zero or more ComplexUsers and only return the `complexId`
|
||||
* const complexUserWithComplexIdOnly = await prisma.complexUser.updateManyAndReturn({
|
||||
* select: { complexId: true },
|
||||
* // Update zero or more ComplexUsers and only return the `id`
|
||||
* const complexUserWithIdOnly = await prisma.complexUser.updateManyAndReturn({
|
||||
* select: { id: true },
|
||||
* where: {
|
||||
* // ... provide filter here
|
||||
* },
|
||||
@@ -1011,10 +1091,12 @@ export interface Prisma__ComplexUserClient<T, Null = never, ExtArgs extends runt
|
||||
* Fields of the ComplexUser model
|
||||
*/
|
||||
export interface ComplexUserFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"ComplexUser", 'String'>
|
||||
readonly complexId: Prisma.FieldRef<"ComplexUser", 'String'>
|
||||
readonly userId: Prisma.FieldRef<"ComplexUser", 'String'>
|
||||
readonly role: Prisma.FieldRef<"ComplexUser", 'ComplexUserRole'>
|
||||
readonly createdAt: Prisma.FieldRef<"ComplexUser", 'DateTime'>
|
||||
readonly updatedAt: Prisma.FieldRef<"ComplexUser", 'DateTime'>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,8 +43,6 @@ export type CourtMinAggregateOutputType = {
|
||||
name: string | null
|
||||
slotDurationMinutes: number | null
|
||||
basePrice: runtime.Decimal | null
|
||||
isUnderMaintenance: boolean | null
|
||||
maintenanceReason: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
}
|
||||
@@ -56,8 +54,6 @@ export type CourtMaxAggregateOutputType = {
|
||||
name: string | null
|
||||
slotDurationMinutes: number | null
|
||||
basePrice: runtime.Decimal | null
|
||||
isUnderMaintenance: boolean | null
|
||||
maintenanceReason: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
}
|
||||
@@ -69,8 +65,6 @@ export type CourtCountAggregateOutputType = {
|
||||
name: number
|
||||
slotDurationMinutes: number
|
||||
basePrice: number
|
||||
isUnderMaintenance: number
|
||||
maintenanceReason: number
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
_all: number
|
||||
@@ -94,8 +88,6 @@ export type CourtMinAggregateInputType = {
|
||||
name?: true
|
||||
slotDurationMinutes?: true
|
||||
basePrice?: true
|
||||
isUnderMaintenance?: true
|
||||
maintenanceReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
@@ -107,8 +99,6 @@ export type CourtMaxAggregateInputType = {
|
||||
name?: true
|
||||
slotDurationMinutes?: true
|
||||
basePrice?: true
|
||||
isUnderMaintenance?: true
|
||||
maintenanceReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
@@ -120,8 +110,6 @@ export type CourtCountAggregateInputType = {
|
||||
name?: true
|
||||
slotDurationMinutes?: true
|
||||
basePrice?: true
|
||||
isUnderMaintenance?: true
|
||||
maintenanceReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
_all?: true
|
||||
@@ -220,8 +208,6 @@ export type CourtGroupByOutputType = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal
|
||||
isUnderMaintenance: boolean
|
||||
maintenanceReason: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
_count: CourtCountAggregateOutputType | null
|
||||
@@ -256,8 +242,6 @@ export type CourtWhereInput = {
|
||||
name?: Prisma.StringFilter<"Court"> | string
|
||||
slotDurationMinutes?: Prisma.IntFilter<"Court"> | number
|
||||
basePrice?: Prisma.DecimalFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFilter<"Court"> | boolean
|
||||
maintenanceReason?: Prisma.StringNullableFilter<"Court"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"Court"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"Court"> | Date | string
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
@@ -265,7 +249,6 @@ export type CourtWhereInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityListRelationFilter
|
||||
priceRules?: Prisma.CourtPriceRuleListRelationFilter
|
||||
bookings?: Prisma.CourtBookingListRelationFilter
|
||||
maintenances?: Prisma.CourtMaintenanceListRelationFilter
|
||||
}
|
||||
|
||||
export type CourtOrderByWithRelationInput = {
|
||||
@@ -275,8 +258,6 @@ export type CourtOrderByWithRelationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
complex?: Prisma.ComplexOrderByWithRelationInput
|
||||
@@ -284,7 +265,6 @@ export type CourtOrderByWithRelationInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityOrderByRelationAggregateInput
|
||||
priceRules?: Prisma.CourtPriceRuleOrderByRelationAggregateInput
|
||||
bookings?: Prisma.CourtBookingOrderByRelationAggregateInput
|
||||
maintenances?: Prisma.CourtMaintenanceOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type CourtWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -297,8 +277,6 @@ export type CourtWhereUniqueInput = Prisma.AtLeast<{
|
||||
name?: Prisma.StringFilter<"Court"> | string
|
||||
slotDurationMinutes?: Prisma.IntFilter<"Court"> | number
|
||||
basePrice?: Prisma.DecimalFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFilter<"Court"> | boolean
|
||||
maintenanceReason?: Prisma.StringNullableFilter<"Court"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"Court"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"Court"> | Date | string
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
@@ -306,7 +284,6 @@ export type CourtWhereUniqueInput = Prisma.AtLeast<{
|
||||
availabilities?: Prisma.CourtAvailabilityListRelationFilter
|
||||
priceRules?: Prisma.CourtPriceRuleListRelationFilter
|
||||
bookings?: Prisma.CourtBookingListRelationFilter
|
||||
maintenances?: Prisma.CourtMaintenanceListRelationFilter
|
||||
}, "id">
|
||||
|
||||
export type CourtOrderByWithAggregationInput = {
|
||||
@@ -316,8 +293,6 @@ export type CourtOrderByWithAggregationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
_count?: Prisma.CourtCountOrderByAggregateInput
|
||||
@@ -337,8 +312,6 @@ export type CourtScalarWhereWithAggregatesInput = {
|
||||
name?: Prisma.StringWithAggregatesFilter<"Court"> | string
|
||||
slotDurationMinutes?: Prisma.IntWithAggregatesFilter<"Court"> | number
|
||||
basePrice?: Prisma.DecimalWithAggregatesFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolWithAggregatesFilter<"Court"> | boolean
|
||||
maintenanceReason?: Prisma.StringNullableWithAggregatesFilter<"Court"> | string | null
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Court"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Court"> | Date | string
|
||||
}
|
||||
@@ -348,8 +321,6 @@ export type CourtCreateInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput
|
||||
@@ -357,7 +328,6 @@ export type CourtCreateInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateInput = {
|
||||
@@ -367,14 +337,11 @@ export type CourtUncheckedCreateInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUpdateInput = {
|
||||
@@ -382,8 +349,6 @@ export type CourtUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput
|
||||
@@ -391,7 +356,6 @@ export type CourtUpdateInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateInput = {
|
||||
@@ -401,14 +365,11 @@ export type CourtUncheckedUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateManyInput = {
|
||||
@@ -418,8 +379,6 @@ export type CourtCreateManyInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
@@ -429,8 +388,6 @@ export type CourtUpdateManyMutationInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -442,8 +399,6 @@ export type CourtUncheckedUpdateManyInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -465,8 +420,6 @@ export type CourtCountOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -483,8 +436,6 @@ export type CourtMaxOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -496,8 +447,6 @@ export type CourtMinOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -604,28 +553,6 @@ export type IntFieldUpdateOperationsInput = {
|
||||
divide?: number
|
||||
}
|
||||
|
||||
export type DecimalFieldUpdateOperationsInput = {
|
||||
set?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
increment?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
divide?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type CourtCreateNestedOneWithoutMaintenancesInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtCreateWithoutMaintenancesInput, Prisma.CourtUncheckedCreateWithoutMaintenancesInput>
|
||||
connectOrCreate?: Prisma.CourtCreateOrConnectWithoutMaintenancesInput
|
||||
connect?: Prisma.CourtWhereUniqueInput
|
||||
}
|
||||
|
||||
export type CourtUpdateOneRequiredWithoutMaintenancesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtCreateWithoutMaintenancesInput, Prisma.CourtUncheckedCreateWithoutMaintenancesInput>
|
||||
connectOrCreate?: Prisma.CourtCreateOrConnectWithoutMaintenancesInput
|
||||
upsert?: Prisma.CourtUpsertWithoutMaintenancesInput
|
||||
connect?: Prisma.CourtWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CourtUpdateToOneWithWhereWithoutMaintenancesInput, Prisma.CourtUpdateWithoutMaintenancesInput>, Prisma.CourtUncheckedUpdateWithoutMaintenancesInput>
|
||||
}
|
||||
|
||||
export type CourtCreateNestedOneWithoutAvailabilitiesInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtCreateWithoutAvailabilitiesInput, Prisma.CourtUncheckedCreateWithoutAvailabilitiesInput>
|
||||
connectOrCreate?: Prisma.CourtCreateOrConnectWithoutAvailabilitiesInput
|
||||
@@ -673,15 +600,12 @@ export type CourtCreateWithoutComplexInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
sport: Prisma.SportCreateNestedOneWithoutCourtsInput
|
||||
availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutComplexInput = {
|
||||
@@ -690,14 +614,11 @@ export type CourtUncheckedCreateWithoutComplexInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutComplexInput = {
|
||||
@@ -736,8 +657,6 @@ export type CourtScalarWhereInput = {
|
||||
name?: Prisma.StringFilter<"Court"> | string
|
||||
slotDurationMinutes?: Prisma.IntFilter<"Court"> | number
|
||||
basePrice?: Prisma.DecimalFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFilter<"Court"> | boolean
|
||||
maintenanceReason?: Prisma.StringNullableFilter<"Court"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"Court"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"Court"> | Date | string
|
||||
}
|
||||
@@ -747,15 +666,12 @@ export type CourtCreateWithoutSportInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput
|
||||
availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutSportInput = {
|
||||
@@ -764,14 +680,11 @@ export type CourtUncheckedCreateWithoutSportInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutSportInput = {
|
||||
@@ -800,100 +713,17 @@ export type CourtUpdateManyWithWhereWithoutSportInput = {
|
||||
data: Prisma.XOR<Prisma.CourtUpdateManyMutationInput, Prisma.CourtUncheckedUpdateManyWithoutSportInput>
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutMaintenancesInput = {
|
||||
id: string
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput
|
||||
sport: Prisma.SportCreateNestedOneWithoutCourtsInput
|
||||
availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutMaintenancesInput = {
|
||||
id: string
|
||||
complexId: string
|
||||
sportId: string
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutMaintenancesInput = {
|
||||
where: Prisma.CourtWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.CourtCreateWithoutMaintenancesInput, Prisma.CourtUncheckedCreateWithoutMaintenancesInput>
|
||||
}
|
||||
|
||||
export type CourtUpsertWithoutMaintenancesInput = {
|
||||
update: Prisma.XOR<Prisma.CourtUpdateWithoutMaintenancesInput, Prisma.CourtUncheckedUpdateWithoutMaintenancesInput>
|
||||
create: Prisma.XOR<Prisma.CourtCreateWithoutMaintenancesInput, Prisma.CourtUncheckedCreateWithoutMaintenancesInput>
|
||||
where?: Prisma.CourtWhereInput
|
||||
}
|
||||
|
||||
export type CourtUpdateToOneWithWhereWithoutMaintenancesInput = {
|
||||
where?: Prisma.CourtWhereInput
|
||||
data: Prisma.XOR<Prisma.CourtUpdateWithoutMaintenancesInput, Prisma.CourtUncheckedUpdateWithoutMaintenancesInput>
|
||||
}
|
||||
|
||||
export type CourtUpdateWithoutMaintenancesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput
|
||||
sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput
|
||||
availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutMaintenancesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sportId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutAvailabilitiesInput = {
|
||||
id: string
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput
|
||||
sport: Prisma.SportCreateNestedOneWithoutCourtsInput
|
||||
priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutAvailabilitiesInput = {
|
||||
@@ -903,13 +733,10 @@ export type CourtUncheckedCreateWithoutAvailabilitiesInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutAvailabilitiesInput = {
|
||||
@@ -933,15 +760,12 @@ export type CourtUpdateWithoutAvailabilitiesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput
|
||||
sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutAvailabilitiesInput = {
|
||||
@@ -951,13 +775,10 @@ export type CourtUncheckedUpdateWithoutAvailabilitiesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutPriceRulesInput = {
|
||||
@@ -965,15 +786,12 @@ export type CourtCreateWithoutPriceRulesInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput
|
||||
sport: Prisma.SportCreateNestedOneWithoutCourtsInput
|
||||
availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutPriceRulesInput = {
|
||||
@@ -983,13 +801,10 @@ export type CourtUncheckedCreateWithoutPriceRulesInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutPriceRulesInput = {
|
||||
@@ -1013,15 +828,12 @@ export type CourtUpdateWithoutPriceRulesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput
|
||||
sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput
|
||||
availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutPriceRulesInput = {
|
||||
@@ -1031,13 +843,10 @@ export type CourtUncheckedUpdateWithoutPriceRulesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutBookingsInput = {
|
||||
@@ -1045,15 +854,12 @@ export type CourtCreateWithoutBookingsInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput
|
||||
sport: Prisma.SportCreateNestedOneWithoutCourtsInput
|
||||
availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutBookingsInput = {
|
||||
@@ -1063,13 +869,10 @@ export type CourtUncheckedCreateWithoutBookingsInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutBookingsInput = {
|
||||
@@ -1093,15 +896,12 @@ export type CourtUpdateWithoutBookingsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput
|
||||
sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput
|
||||
availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutBookingsInput = {
|
||||
@@ -1111,13 +911,10 @@ export type CourtUncheckedUpdateWithoutBookingsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateManyComplexInput = {
|
||||
@@ -1126,8 +923,6 @@ export type CourtCreateManyComplexInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
@@ -1137,15 +932,12 @@ export type CourtUpdateWithoutComplexInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput
|
||||
availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutComplexInput = {
|
||||
@@ -1154,14 +946,11 @@ export type CourtUncheckedUpdateWithoutComplexInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateManyWithoutComplexInput = {
|
||||
@@ -1170,8 +959,6 @@ export type CourtUncheckedUpdateManyWithoutComplexInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -1182,8 +969,6 @@ export type CourtCreateManySportInput = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
@@ -1193,15 +978,12 @@ export type CourtUpdateWithoutSportInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput
|
||||
availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutSportInput = {
|
||||
@@ -1210,14 +992,11 @@ export type CourtUncheckedUpdateWithoutSportInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateManyWithoutSportInput = {
|
||||
@@ -1226,8 +1005,6 @@ export type CourtUncheckedUpdateManyWithoutSportInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
isUnderMaintenance?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
maintenanceReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -1241,14 +1018,12 @@ export type CourtCountOutputType = {
|
||||
availabilities: number
|
||||
priceRules: number
|
||||
bookings: number
|
||||
maintenances: number
|
||||
}
|
||||
|
||||
export type CourtCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
availabilities?: boolean | CourtCountOutputTypeCountAvailabilitiesArgs
|
||||
priceRules?: boolean | CourtCountOutputTypeCountPriceRulesArgs
|
||||
bookings?: boolean | CourtCountOutputTypeCountBookingsArgs
|
||||
maintenances?: boolean | CourtCountOutputTypeCountMaintenancesArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1282,13 +1057,6 @@ export type CourtCountOutputTypeCountBookingsArgs<ExtArgs extends runtime.Types.
|
||||
where?: Prisma.CourtBookingWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* CourtCountOutputType without action
|
||||
*/
|
||||
export type CourtCountOutputTypeCountMaintenancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.CourtMaintenanceWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type CourtSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -1297,8 +1065,6 @@ export type CourtSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
name?: boolean
|
||||
slotDurationMinutes?: boolean
|
||||
basePrice?: boolean
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
@@ -1306,7 +1072,6 @@ export type CourtSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
availabilities?: boolean | Prisma.Court$availabilitiesArgs<ExtArgs>
|
||||
priceRules?: boolean | Prisma.Court$priceRulesArgs<ExtArgs>
|
||||
bookings?: boolean | Prisma.Court$bookingsArgs<ExtArgs>
|
||||
maintenances?: boolean | Prisma.Court$maintenancesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.CourtCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["court"]>
|
||||
|
||||
@@ -1317,8 +1082,6 @@ export type CourtSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensi
|
||||
name?: boolean
|
||||
slotDurationMinutes?: boolean
|
||||
basePrice?: boolean
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
@@ -1332,8 +1095,6 @@ export type CourtSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensi
|
||||
name?: boolean
|
||||
slotDurationMinutes?: boolean
|
||||
basePrice?: boolean
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
@@ -1347,20 +1108,17 @@ export type CourtSelectScalar = {
|
||||
name?: boolean
|
||||
slotDurationMinutes?: boolean
|
||||
basePrice?: boolean
|
||||
isUnderMaintenance?: boolean
|
||||
maintenanceReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
}
|
||||
|
||||
export type CourtOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "complexId" | "sportId" | "name" | "slotDurationMinutes" | "basePrice" | "isUnderMaintenance" | "maintenanceReason" | "createdAt" | "updatedAt", ExtArgs["result"]["court"]>
|
||||
export type CourtOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "complexId" | "sportId" | "name" | "slotDurationMinutes" | "basePrice" | "createdAt" | "updatedAt", ExtArgs["result"]["court"]>
|
||||
export type CourtInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
sport?: boolean | Prisma.SportDefaultArgs<ExtArgs>
|
||||
availabilities?: boolean | Prisma.Court$availabilitiesArgs<ExtArgs>
|
||||
priceRules?: boolean | Prisma.Court$priceRulesArgs<ExtArgs>
|
||||
bookings?: boolean | Prisma.Court$bookingsArgs<ExtArgs>
|
||||
maintenances?: boolean | Prisma.Court$maintenancesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.CourtCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type CourtIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -1380,7 +1138,6 @@ export type $CourtPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
availabilities: Prisma.$CourtAvailabilityPayload<ExtArgs>[]
|
||||
priceRules: Prisma.$CourtPriceRulePayload<ExtArgs>[]
|
||||
bookings: Prisma.$CourtBookingPayload<ExtArgs>[]
|
||||
maintenances: Prisma.$CourtMaintenancePayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1389,8 +1146,6 @@ export type $CourtPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal
|
||||
isUnderMaintenance: boolean
|
||||
maintenanceReason: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}, ExtArgs["result"]["court"]>
|
||||
@@ -1792,7 +1547,6 @@ export interface Prisma__CourtClient<T, Null = never, ExtArgs extends runtime.Ty
|
||||
availabilities<T extends Prisma.Court$availabilitiesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Court$availabilitiesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CourtAvailabilityPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
priceRules<T extends Prisma.Court$priceRulesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Court$priceRulesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CourtPriceRulePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
bookings<T extends Prisma.Court$bookingsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Court$bookingsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CourtBookingPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
maintenances<T extends Prisma.Court$maintenancesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Court$maintenancesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CourtMaintenancePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1828,8 +1582,6 @@ export interface CourtFieldRefs {
|
||||
readonly name: Prisma.FieldRef<"Court", 'String'>
|
||||
readonly slotDurationMinutes: Prisma.FieldRef<"Court", 'Int'>
|
||||
readonly basePrice: Prisma.FieldRef<"Court", 'Decimal'>
|
||||
readonly isUnderMaintenance: Prisma.FieldRef<"Court", 'Boolean'>
|
||||
readonly maintenanceReason: Prisma.FieldRef<"Court", 'String'>
|
||||
readonly createdAt: Prisma.FieldRef<"Court", 'DateTime'>
|
||||
readonly updatedAt: Prisma.FieldRef<"Court", 'DateTime'>
|
||||
}
|
||||
@@ -2304,30 +2056,6 @@ export type Court$bookingsArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
distinct?: Prisma.CourtBookingScalarFieldEnum | Prisma.CourtBookingScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Court.maintenances
|
||||
*/
|
||||
export type Court$maintenancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the CourtMaintenance
|
||||
*/
|
||||
select?: Prisma.CourtMaintenanceSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the CourtMaintenance
|
||||
*/
|
||||
omit?: Prisma.CourtMaintenanceOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.CourtMaintenanceInclude<ExtArgs> | null
|
||||
where?: Prisma.CourtMaintenanceWhereInput
|
||||
orderBy?: Prisma.CourtMaintenanceOrderByWithRelationInput | Prisma.CourtMaintenanceOrderByWithRelationInput[]
|
||||
cursor?: Prisma.CourtMaintenanceWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.CourtMaintenanceScalarFieldEnum | Prisma.CourtMaintenanceScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Court without action
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,6 @@ export type CourtBookingMinAggregateOutputType = {
|
||||
endTime: string | null
|
||||
customerName: string | null
|
||||
customerPhone: string | null
|
||||
customerEmail: string | null
|
||||
status: $Enums.CourtBookingStatus | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
@@ -48,7 +47,6 @@ export type CourtBookingMaxAggregateOutputType = {
|
||||
endTime: string | null
|
||||
customerName: string | null
|
||||
customerPhone: string | null
|
||||
customerEmail: string | null
|
||||
status: $Enums.CourtBookingStatus | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
@@ -63,7 +61,6 @@ export type CourtBookingCountAggregateOutputType = {
|
||||
endTime: number
|
||||
customerName: number
|
||||
customerPhone: number
|
||||
customerEmail: number
|
||||
status: number
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
@@ -80,7 +77,6 @@ export type CourtBookingMinAggregateInputType = {
|
||||
endTime?: true
|
||||
customerName?: true
|
||||
customerPhone?: true
|
||||
customerEmail?: true
|
||||
status?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
@@ -95,7 +91,6 @@ export type CourtBookingMaxAggregateInputType = {
|
||||
endTime?: true
|
||||
customerName?: true
|
||||
customerPhone?: true
|
||||
customerEmail?: true
|
||||
status?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
@@ -110,7 +105,6 @@ export type CourtBookingCountAggregateInputType = {
|
||||
endTime?: true
|
||||
customerName?: true
|
||||
customerPhone?: true
|
||||
customerEmail?: true
|
||||
status?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
@@ -198,7 +192,6 @@ export type CourtBookingGroupByOutputType = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status: $Enums.CourtBookingStatus
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
@@ -234,7 +227,6 @@ export type CourtBookingWhereInput = {
|
||||
endTime?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerName?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerPhone?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerEmail?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
status?: Prisma.EnumCourtBookingStatusFilter<"CourtBooking"> | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
@@ -250,7 +242,6 @@ export type CourtBookingOrderByWithRelationInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
@@ -270,7 +261,6 @@ export type CourtBookingWhereUniqueInput = Prisma.AtLeast<{
|
||||
endTime?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerName?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerPhone?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerEmail?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
status?: Prisma.EnumCourtBookingStatusFilter<"CourtBooking"> | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
@@ -286,7 +276,6 @@ export type CourtBookingOrderByWithAggregationInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
@@ -307,7 +296,6 @@ export type CourtBookingScalarWhereWithAggregatesInput = {
|
||||
endTime?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string
|
||||
customerName?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string
|
||||
customerPhone?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string
|
||||
customerEmail?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string
|
||||
status?: Prisma.EnumCourtBookingStatusWithAggregatesFilter<"CourtBooking"> | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"CourtBooking"> | Date | string
|
||||
@@ -321,7 +309,6 @@ export type CourtBookingCreateInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
@@ -337,7 +324,6 @@ export type CourtBookingUncheckedCreateInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
@@ -351,7 +337,6 @@ export type CourtBookingUpdateInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -367,7 +352,6 @@ export type CourtBookingUncheckedUpdateInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -382,7 +366,6 @@ export type CourtBookingCreateManyInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
@@ -396,7 +379,6 @@ export type CourtBookingUpdateManyMutationInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -411,7 +393,6 @@ export type CourtBookingUncheckedUpdateManyInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -442,7 +423,6 @@ export type CourtBookingCountOrderByAggregateInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
@@ -457,7 +437,6 @@ export type CourtBookingMaxOrderByAggregateInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
@@ -472,7 +451,6 @@ export type CourtBookingMinOrderByAggregateInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
@@ -532,7 +510,6 @@ export type CourtBookingCreateWithoutCourtInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
@@ -546,7 +523,6 @@ export type CourtBookingUncheckedCreateWithoutCourtInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
@@ -590,7 +566,6 @@ export type CourtBookingScalarWhereInput = {
|
||||
endTime?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerName?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerPhone?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
customerEmail?: Prisma.StringFilter<"CourtBooking"> | string
|
||||
status?: Prisma.EnumCourtBookingStatusFilter<"CourtBooking"> | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
@@ -604,7 +579,6 @@ export type CourtBookingCreateManyCourtInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
@@ -618,7 +592,6 @@ export type CourtBookingUpdateWithoutCourtInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -632,7 +605,6 @@ export type CourtBookingUncheckedUpdateWithoutCourtInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -646,7 +618,6 @@ export type CourtBookingUncheckedUpdateManyWithoutCourtInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -663,7 +634,6 @@ export type CourtBookingSelect<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
@@ -679,7 +649,6 @@ export type CourtBookingSelectCreateManyAndReturn<ExtArgs extends runtime.Types.
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
@@ -695,7 +664,6 @@ export type CourtBookingSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
@@ -711,13 +679,12 @@ export type CourtBookingSelectScalar = {
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
}
|
||||
|
||||
export type CourtBookingOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "bookingCode" | "courtId" | "bookingDate" | "startTime" | "endTime" | "customerName" | "customerPhone" | "customerEmail" | "status" | "createdAt" | "updatedAt", ExtArgs["result"]["courtBooking"]>
|
||||
export type CourtBookingOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "bookingCode" | "courtId" | "bookingDate" | "startTime" | "endTime" | "customerName" | "customerPhone" | "status" | "createdAt" | "updatedAt", ExtArgs["result"]["courtBooking"]>
|
||||
export type CourtBookingInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
court?: boolean | Prisma.CourtDefaultArgs<ExtArgs>
|
||||
}
|
||||
@@ -742,7 +709,6 @@ export type $CourtBookingPayload<ExtArgs extends runtime.Types.Extensions.Intern
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status: $Enums.CourtBookingStatus
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
@@ -1178,7 +1144,6 @@ export interface CourtBookingFieldRefs {
|
||||
readonly endTime: Prisma.FieldRef<"CourtBooking", 'String'>
|
||||
readonly customerName: Prisma.FieldRef<"CourtBooking", 'String'>
|
||||
readonly customerPhone: Prisma.FieldRef<"CourtBooking", 'String'>
|
||||
readonly customerEmail: Prisma.FieldRef<"CourtBooking", 'String'>
|
||||
readonly status: Prisma.FieldRef<"CourtBooking", 'CourtBookingStatus'>
|
||||
readonly createdAt: Prisma.FieldRef<"CourtBooking", 'DateTime'>
|
||||
readonly updatedAt: Prisma.FieldRef<"CourtBooking", 'DateTime'>
|
||||
|
||||
1399
apps/backend/src/generated/prisma/models/OnboardingRequest.ts
Normal file
1399
apps/backend/src/generated/prisma/models/OnboardingRequest.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -320,11 +320,6 @@ export type PlanUncheckedUpdateManyInput = {
|
||||
lastUpdatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type PlanNullableScalarRelationFilter = {
|
||||
is?: Prisma.PlanWhereInput | null
|
||||
isNot?: Prisma.PlanWhereInput | null
|
||||
}
|
||||
|
||||
export type PlanCountOrderByAggregateInput = {
|
||||
code?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
@@ -355,18 +350,37 @@ export type PlanSumOrderByAggregateInput = {
|
||||
price?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type PlanScalarRelationFilter = {
|
||||
is?: Prisma.PlanWhereInput
|
||||
isNot?: Prisma.PlanWhereInput
|
||||
}
|
||||
|
||||
export type StringFieldUpdateOperationsInput = {
|
||||
set?: string
|
||||
}
|
||||
|
||||
export type DecimalFieldUpdateOperationsInput = {
|
||||
set?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
increment?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
divide?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type DateTimeFieldUpdateOperationsInput = {
|
||||
set?: Date | string
|
||||
}
|
||||
|
||||
export type PlanCreateNestedOneWithoutComplexesInput = {
|
||||
create?: Prisma.XOR<Prisma.PlanCreateWithoutComplexesInput, Prisma.PlanUncheckedCreateWithoutComplexesInput>
|
||||
connectOrCreate?: Prisma.PlanCreateOrConnectWithoutComplexesInput
|
||||
connect?: Prisma.PlanWhereUniqueInput
|
||||
}
|
||||
|
||||
export type PlanUpdateOneWithoutComplexesNestedInput = {
|
||||
export type PlanUpdateOneRequiredWithoutComplexesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.PlanCreateWithoutComplexesInput, Prisma.PlanUncheckedCreateWithoutComplexesInput>
|
||||
connectOrCreate?: Prisma.PlanCreateOrConnectWithoutComplexesInput
|
||||
upsert?: Prisma.PlanUpsertWithoutComplexesInput
|
||||
disconnect?: Prisma.PlanWhereInput | boolean
|
||||
delete?: Prisma.PlanWhereInput | boolean
|
||||
connect?: Prisma.PlanWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.PlanUpdateToOneWithWhereWithoutComplexesInput, Prisma.PlanUpdateWithoutComplexesInput>, Prisma.PlanUncheckedUpdateWithoutComplexesInput>
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,9 @@
|
||||
import { createApp } from '@/app';
|
||||
import { registerAuthRoutes } from '@/auth-routes';
|
||||
import { registerRoutes } from '@/register-routes';
|
||||
|
||||
const app = createApp();
|
||||
registerAuthRoutes(app);
|
||||
registerRoutes(app);
|
||||
|
||||
export type AppType = typeof app;
|
||||
|
||||
@@ -1,138 +1,55 @@
|
||||
import { wrapLayout } from '@/emails/booking-confirmation';
|
||||
import { dash } from '@better-auth/infra';
|
||||
import { sendMail } from '@/lib/mailer';
|
||||
import { db } from '@/lib/prisma';
|
||||
import bcrypt from 'bcrypt';
|
||||
import { betterAuth } from 'better-auth';
|
||||
import { prismaAdapter } from 'better-auth/adapters/prisma';
|
||||
import { openAPI } from 'better-auth/plugins';
|
||||
import { sendMail } from './mailer';
|
||||
import { db } from './prisma';
|
||||
import { emailOTP } from 'better-auth/plugins';
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: prismaAdapter(db, {
|
||||
provider: 'postgresql',
|
||||
}),
|
||||
secret: process.env.BETTER_AUTH_SECRET,
|
||||
baseURL: process.env.BETTER_AUTH_URL,
|
||||
session: {
|
||||
cookieCache: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
},
|
||||
user: {
|
||||
additionalFields: {
|
||||
role: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
password: {
|
||||
hash: async (password) => {
|
||||
return bcrypt.hash(password, 10);
|
||||
},
|
||||
phone: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
},
|
||||
banned: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
},
|
||||
bannedAt: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
},
|
||||
banReason: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
verify: async (password, hash) => {
|
||||
return bcrypt.compare(password, hash);
|
||||
},
|
||||
},
|
||||
},
|
||||
emailVerification: {
|
||||
sendOnSignUp: true,
|
||||
autoSignInAfterVerification: true,
|
||||
sendVerificationEmail: async ({ user, url }) => {
|
||||
const verificationUrl = new URL(url);
|
||||
const appUrl = process.env.APP_BASE_URL ?? 'http://localhost:5173';
|
||||
verificationUrl.searchParams.set('callbackURL', appUrl);
|
||||
plugins: [
|
||||
emailOTP({
|
||||
async sendVerificationOTP({ email, otp, type }) {
|
||||
let subject = 'Tu código de verificación';
|
||||
let text = `Tu código OTP es ${otp}.`;
|
||||
let html = `<p>Tu código OTP es <strong>${otp}</strong>.</p>`;
|
||||
|
||||
const content = `
|
||||
<tr>
|
||||
<td style="padding:24px 20px 16px;">
|
||||
<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0" style="display:inline-block;background-color:#f4f4f5;border-radius:999px;padding:4px 12px;">
|
||||
<tr>
|
||||
<td style="font-size:11px;font-weight:700;letter-spacing:0.14em;color:#71717a;text-transform:uppercase;line-height:1.25rem;">
|
||||
Verificación de email
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1 style="margin:16px 0 0;font-size:24px;font-weight:700;color:#111827;letter-spacing:-0.025em;">
|
||||
Verificá tu dirección de correo electrónico
|
||||
</h1>
|
||||
</td>
|
||||
<td valign="top" align="right" style="white-space:nowrap;">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td valign="middle" style="padding-right:8px;">
|
||||
<img src="${appUrl}/playzer-favicon-512-transparent.png" alt="Playzer" width="32" height="32" style="display:block;" />
|
||||
</td>
|
||||
<td valign="middle">
|
||||
<span style="font-size:18px;font-weight:700;color:#475569;letter-spacing:-0.025em;">Playzer</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
if (type === 'sign-in') {
|
||||
subject = 'Código de inicio de sesión';
|
||||
text = `Tu código para iniciar sesión es ${otp}.`;
|
||||
html = `<p>Tu código para iniciar sesión es <strong>${otp}</strong>.</p>`;
|
||||
} else if (type === 'forget-password') {
|
||||
subject = 'Código para restablecer contraseña';
|
||||
text = `Tu código para restablecer tu contraseña es ${otp}.`;
|
||||
html = `<p>Tu código para restablecer tu contraseña es <strong>${otp}</strong>.</p>`;
|
||||
} else if (type === 'email-verification') {
|
||||
subject = 'Verifica tu correo electrónico';
|
||||
text = `Tu código de verificación es ${otp}.`;
|
||||
html = `<p>Tu código de verificación es <strong>${otp}</strong>.</p>`;
|
||||
}
|
||||
|
||||
<tr>
|
||||
padding:0 20px 16px;
|
||||
<p style="margin:0;font-size:15px;color:#374151;line-height:1.6;">
|
||||
Hacé click en el botón de abajo para verificar tu dirección de correo electrónico y empezar a usar Playzer.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 24px;">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td style="background-color:#059669;border-radius:12px;text-align:center;">
|
||||
<a href="${verificationUrl.toString()}" style="display:block;padding:14px 32px;font-size:15px;font-weight:600;color:#ffffff;text-decoration:none;line-height:1.25rem;">Verificar email</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:0 20px 24px;">
|
||||
<p style="margin:0;font-size:13px;color:#9ca3af;text-align:center;line-height:1.5;">
|
||||
Si no creaste una cuenta en Playzer, ignorá este mensaje.
|
||||
</p>
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
await sendMail({
|
||||
to: user.email,
|
||||
subject: 'Verificá tu email en Playzer',
|
||||
html: wrapLayout(content),
|
||||
text: `Hacé click para verificar tu email: ${verificationUrl.toString()}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
socialProviders: {
|
||||
google: {
|
||||
clientId: process.env.GOOGLE_CLIENT_ID!,
|
||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
||||
},
|
||||
},
|
||||
trustedOrigins: [
|
||||
process.env.APP_BASE_URL ?? 'http://localhost:5173',
|
||||
process.env.BETTER_AUTH_URL ?? 'http://localhost:3000',
|
||||
await sendMail({
|
||||
to: email,
|
||||
subject,
|
||||
text,
|
||||
html,
|
||||
});
|
||||
},
|
||||
}),
|
||||
],
|
||||
plugins: [openAPI(), dash()],
|
||||
});
|
||||
|
||||
export type Session = typeof auth.$Infer.Session.session;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
function getGravatarUrl(email: string): string {
|
||||
const hash = createHash('md5').update(email.trim().toLowerCase()).digest('hex');
|
||||
return `https://www.gravatar.com/avatar/${hash}?d=identicon`;
|
||||
}
|
||||
|
||||
export function resolveAvatarUrl(input: {
|
||||
email: string;
|
||||
image?: string | null;
|
||||
}): string {
|
||||
if (input.image) {
|
||||
return input.image;
|
||||
}
|
||||
|
||||
return getGravatarUrl(input.email);
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
// lib/errors.ts
|
||||
export type ValidationIssue = {
|
||||
path: string;
|
||||
message: string;
|
||||
};
|
||||
|
||||
export type AppError =
|
||||
| {
|
||||
type: 'validation';
|
||||
message: string;
|
||||
issues?: ValidationIssue[];
|
||||
}
|
||||
| {
|
||||
type: 'not_found';
|
||||
message: string;
|
||||
}
|
||||
| {
|
||||
type: 'conflict';
|
||||
message: string;
|
||||
}
|
||||
| {
|
||||
type: 'unauthorized';
|
||||
message: string;
|
||||
}
|
||||
| {
|
||||
type: 'forbidden';
|
||||
message: string;
|
||||
}
|
||||
| {
|
||||
type: 'unexpected';
|
||||
message: string;
|
||||
};
|
||||
|
||||
export const Errors = {
|
||||
validation(message: string, issues?: ValidationIssue[]): AppError {
|
||||
return { type: 'validation', message, issues };
|
||||
},
|
||||
|
||||
notFound(message = 'Resource not found'): AppError {
|
||||
return { type: 'not_found', message };
|
||||
},
|
||||
|
||||
conflict(message: string): AppError {
|
||||
return { type: 'conflict', message };
|
||||
},
|
||||
|
||||
unauthorized(message = 'Unauthorized'): AppError {
|
||||
return { type: 'unauthorized', message };
|
||||
},
|
||||
|
||||
forbidden(message = 'Forbidden'): AppError {
|
||||
return { type: 'forbidden', message };
|
||||
},
|
||||
|
||||
unexpected(message = 'Unexpected error'): AppError {
|
||||
return { type: 'unexpected', message };
|
||||
},
|
||||
};
|
||||
@@ -1,68 +0,0 @@
|
||||
type IpGeoInfo = {
|
||||
ip: string;
|
||||
city: string;
|
||||
country: string;
|
||||
countryCode: string;
|
||||
lat: number | null;
|
||||
lon: number | null;
|
||||
};
|
||||
|
||||
const cache = new Map<string, { data: IpGeoInfo; expiresAt: number }>();
|
||||
const CACHE_TTL_MS = 60 * 60 * 1000;
|
||||
|
||||
function getCached(ip: string): IpGeoInfo | undefined {
|
||||
const entry = cache.get(ip);
|
||||
if (!entry) return undefined;
|
||||
if (Date.now() > entry.expiresAt) {
|
||||
cache.delete(ip);
|
||||
return undefined;
|
||||
}
|
||||
return entry.data;
|
||||
}
|
||||
|
||||
function setCache(ip: string, info: IpGeoInfo): void {
|
||||
cache.set(ip, { data: info, expiresAt: Date.now() + CACHE_TTL_MS });
|
||||
}
|
||||
|
||||
async function fetchGeoInfo(ip: string): Promise<IpGeoInfo | null> {
|
||||
if (ip === '127.0.0.1' || ip === '::1' || ip.startsWith('192.168.') || ip.startsWith('10.')) {
|
||||
return {
|
||||
ip,
|
||||
city: 'Red local',
|
||||
country: 'Red local',
|
||||
countryCode: 'LOCAL',
|
||||
lat: null,
|
||||
lon: null,
|
||||
};
|
||||
}
|
||||
|
||||
const cached = getCached(ip);
|
||||
if (cached) return cached;
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`http://ip-api.com/json/${ip}?fields=status,country,countryCode,city,lat,lon,query`
|
||||
);
|
||||
if (!response.ok) return null;
|
||||
|
||||
const data = await response.json();
|
||||
if (data.status !== 'success') return null;
|
||||
|
||||
const info: IpGeoInfo = {
|
||||
ip: data.query,
|
||||
city: data.city || 'Desconocida',
|
||||
country: data.country || 'Desconocido',
|
||||
countryCode: data.countryCode || '',
|
||||
lat: data.lat ?? null,
|
||||
lon: data.lon ?? null,
|
||||
};
|
||||
|
||||
setCache(ip, info);
|
||||
return info;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export type { IpGeoInfo };
|
||||
export { fetchGeoInfo };
|
||||
@@ -1,20 +0,0 @@
|
||||
// http/error-handler.ts
|
||||
import type { MiddlewareHandler } from 'hono';
|
||||
import { logger } from '../logger';
|
||||
import { unexpectedProblem } from './problem-builders';
|
||||
|
||||
export const errorHandler: MiddlewareHandler = async (c, next) => {
|
||||
try {
|
||||
await next();
|
||||
} catch (error) {
|
||||
const requestId = c.get('requestId') as string | undefined;
|
||||
const instance = requestId ? `/requests/${requestId}` : undefined;
|
||||
|
||||
logger.error({
|
||||
requestId,
|
||||
error,
|
||||
});
|
||||
|
||||
return c.json(unexpectedProblem({ instance }), 500);
|
||||
}
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
import type { Result } from '@/lib/result';
|
||||
import type { Context } from 'hono';
|
||||
import type { ContentfulStatusCode } from 'hono/utils/http-status';
|
||||
import { mapAppErrorToProblem } from './problem-mapper';
|
||||
|
||||
export function handleResult<T>(
|
||||
c: Context,
|
||||
result: Result<T>,
|
||||
successStatus: ContentfulStatusCode = 200
|
||||
) {
|
||||
if (!result.ok) {
|
||||
const requestId = c.get('requestId') as string | undefined;
|
||||
const instance = requestId ? `/requests/${requestId}` : undefined;
|
||||
const problem = mapAppErrorToProblem(result.error, instance);
|
||||
|
||||
return c.json(problem, problem.status);
|
||||
}
|
||||
|
||||
return c.json(result.value, successStatus);
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
// http/problem-builders.ts
|
||||
import type { ProblemDetails } from './problem-details';
|
||||
|
||||
export function validationProblem(params: {
|
||||
detail?: string;
|
||||
instance?: string;
|
||||
errors?: Record<string, string[]>;
|
||||
}): ProblemDetails {
|
||||
return {
|
||||
type: 'https://api.myapp.dev/problems/validation',
|
||||
title: 'Bad Request',
|
||||
status: 400,
|
||||
detail: params.detail ?? 'Invalid request data',
|
||||
instance: params.instance,
|
||||
errors: params.errors,
|
||||
};
|
||||
}
|
||||
|
||||
export function unexpectedProblem(params?: {
|
||||
instance?: string;
|
||||
}): ProblemDetails {
|
||||
return {
|
||||
type: 'https://api.myapp.dev/problems/unexpected',
|
||||
title: 'Internal Server Error',
|
||||
status: 500,
|
||||
detail: 'Internal server error',
|
||||
instance: params?.instance,
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { ContentfulStatusCode } from 'hono/utils/http-status';
|
||||
|
||||
export type ProblemDetails = {
|
||||
type: string;
|
||||
title: string;
|
||||
status: ContentfulStatusCode;
|
||||
detail?: string;
|
||||
instance?: string;
|
||||
errors?: Record<string, string[]>;
|
||||
};
|
||||
@@ -1,51 +0,0 @@
|
||||
import type { AppError } from '@/lib/errors';
|
||||
import type { ContentfulStatusCode } from 'hono/utils/http-status';
|
||||
import type { ProblemDetails } from './problem-details';
|
||||
|
||||
function statusFromError(error: AppError): ContentfulStatusCode {
|
||||
switch (error.type) {
|
||||
case 'validation':
|
||||
return 400;
|
||||
case 'unauthorized':
|
||||
return 401;
|
||||
case 'forbidden':
|
||||
return 403;
|
||||
case 'not_found':
|
||||
return 404;
|
||||
case 'conflict':
|
||||
return 409;
|
||||
case 'unexpected':
|
||||
return 500;
|
||||
default:
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
|
||||
function titleFromStatus(status: ContentfulStatusCode): string {
|
||||
switch (status) {
|
||||
case 400:
|
||||
return 'Bad Request';
|
||||
case 401:
|
||||
return 'Unauthorized';
|
||||
case 403:
|
||||
return 'Forbidden';
|
||||
case 404:
|
||||
return 'Not Found';
|
||||
case 409:
|
||||
return 'Conflict';
|
||||
default:
|
||||
return 'Internal Server Error';
|
||||
}
|
||||
}
|
||||
|
||||
export function mapAppErrorToProblem(error: AppError, instance?: string): ProblemDetails {
|
||||
const status = statusFromError(error);
|
||||
|
||||
return {
|
||||
type: `https://api.myapp.dev/problems/${error.type}`,
|
||||
title: titleFromStatus(status),
|
||||
status,
|
||||
detail: status === 500 ? 'Internal server error' : error.message,
|
||||
instance,
|
||||
};
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import type { MiddlewareHandler } from 'hono';
|
||||
|
||||
type Env = {
|
||||
Variables: {
|
||||
requestId: string;
|
||||
};
|
||||
};
|
||||
|
||||
export const requestIdMiddleware: MiddlewareHandler<Env> = async (c, next) => {
|
||||
const requestId = crypto.randomUUID();
|
||||
|
||||
c.set('requestId', requestId);
|
||||
c.header('X-Request-Id', requestId);
|
||||
|
||||
await next();
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
import { zValidator } from '@hono/zod-validator';
|
||||
import type { ZodSchema } from 'zod';
|
||||
import { validationProblem } from './problem-builders';
|
||||
import { zodIssuesToRecord } from './zod-issues';
|
||||
|
||||
type ValidationTarget = 'json' | 'query' | 'param' | 'header' | 'form';
|
||||
|
||||
function makeValidator<TSchema extends ZodSchema>(target: ValidationTarget, schema: TSchema) {
|
||||
return zValidator(target, schema, (result, c) => {
|
||||
if (result.success) {
|
||||
return;
|
||||
}
|
||||
|
||||
const requestId = c.get('requestId') as string | undefined;
|
||||
const instance = requestId ? `/requests/${requestId}` : undefined;
|
||||
|
||||
return c.json(
|
||||
validationProblem({
|
||||
detail: `Invalid ${target} data`,
|
||||
instance,
|
||||
errors: zodIssuesToRecord(result.error.issues),
|
||||
}),
|
||||
400
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export const validate = {
|
||||
json<TSchema extends ZodSchema>(schema: TSchema) {
|
||||
return makeValidator('json', schema);
|
||||
},
|
||||
|
||||
query<TSchema extends ZodSchema>(schema: TSchema) {
|
||||
return makeValidator('query', schema);
|
||||
},
|
||||
|
||||
param<TSchema extends ZodSchema>(schema: TSchema) {
|
||||
return makeValidator('param', schema);
|
||||
},
|
||||
|
||||
header<TSchema extends ZodSchema>(schema: TSchema) {
|
||||
return makeValidator('header', schema);
|
||||
},
|
||||
|
||||
form<TSchema extends ZodSchema>(schema: TSchema) {
|
||||
return makeValidator('form', schema);
|
||||
},
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
type IssueLike = {
|
||||
path: PropertyKey[];
|
||||
message: string;
|
||||
};
|
||||
|
||||
export function zodIssuesToRecord(issues: IssueLike[]): Record<string, string[]> {
|
||||
const out: Record<string, string[]> = {};
|
||||
|
||||
for (const issue of issues) {
|
||||
const key = issue.path.length ? issue.path.join('.') : 'root';
|
||||
out[key] ??= [];
|
||||
out[key].push(issue.message);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -1,26 +1,29 @@
|
||||
import { MailtrapClientConfig, MailtrapTransport } from 'mailtrap';
|
||||
import nodemailer from 'nodemailer';
|
||||
|
||||
const TOKEN = Bun.env.MAILTRAP_API_TOKEN;
|
||||
|
||||
let cachedTransporter: ReturnType<typeof nodemailer.createTransport> | null = null;
|
||||
|
||||
function getTransporter() {
|
||||
if (cachedTransporter) return cachedTransporter;
|
||||
|
||||
if (!TOKEN) {
|
||||
throw new Error('Missing MAILTRAP_API_TOKEN env var.');
|
||||
const smtpHost = Bun.env.SMTP_HOST;
|
||||
const smtpPort = Number(Bun.env.SMTP_PORT ?? 587);
|
||||
const smtpUser = Bun.env.SMTP_USER;
|
||||
const smtpPass = Bun.env.SMTP_PASS;
|
||||
|
||||
if (!smtpHost || !smtpUser || !smtpPass) {
|
||||
throw new Error('Missing SMTP env vars. Set SMTP_HOST, SMTP_PORT, SMTP_USER and SMTP_PASS.');
|
||||
}
|
||||
|
||||
const config: MailtrapClientConfig = {
|
||||
token: TOKEN,
|
||||
sandbox: Bun.env.MAIL_SANDBOX === 'true',
|
||||
testInboxId: Bun.env.MAIL_INBOX_ID ? Number(Bun.env.MAIL_INBOX_ID) : undefined,
|
||||
};
|
||||
cachedTransporter = nodemailer.createTransport({
|
||||
host: smtpHost,
|
||||
port: smtpPort,
|
||||
secure: smtpPort === 465,
|
||||
auth: {
|
||||
user: smtpUser,
|
||||
pass: smtpPass,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(JSON.stringify(config, null, 2));
|
||||
|
||||
cachedTransporter = nodemailer.createTransport(MailtrapTransport(config));
|
||||
return cachedTransporter;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// lib/result.ts
|
||||
import type { AppError } from '@/lib/errors';
|
||||
|
||||
export type Result<T, E = AppError> = { ok: true; value: T } | { ok: false; error: E };
|
||||
|
||||
export function ok<T>(value: T): Result<T> {
|
||||
return { ok: true, value };
|
||||
}
|
||||
|
||||
export function err<E>(error: E): Result<never, E> {
|
||||
return { ok: false, error };
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
function toMinutes(value: string): number {
|
||||
const [hours, minutes] = value.split(':').map((part) => Number(part));
|
||||
return hours * 60 + minutes;
|
||||
}
|
||||
|
||||
export function isSlotInPast(
|
||||
bookingDate: Date,
|
||||
startTime: string,
|
||||
slotDurationMinutes: number,
|
||||
now?: Date
|
||||
): boolean {
|
||||
const currentTime = now ?? new Date();
|
||||
|
||||
const todayStart = new Date(
|
||||
currentTime.getFullYear(),
|
||||
currentTime.getMonth(),
|
||||
currentTime.getDate()
|
||||
);
|
||||
|
||||
const bookingLocalStart = new Date(
|
||||
bookingDate.getUTCFullYear(),
|
||||
bookingDate.getUTCMonth(),
|
||||
bookingDate.getUTCDate()
|
||||
);
|
||||
|
||||
if (bookingLocalStart < todayStart) return true;
|
||||
if (bookingLocalStart > todayStart) return false;
|
||||
|
||||
const currentMinutes = currentTime.getHours() * 60 + currentTime.getMinutes();
|
||||
const slotStartMinutes = toMinutes(startTime);
|
||||
const elapsed = currentMinutes - slotStartMinutes;
|
||||
|
||||
return elapsed > slotDurationMinutes / 2;
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import { Hono } from 'hono';
|
||||
|
||||
type EventCallback = (data: string) => void;
|
||||
|
||||
class SSEManager {
|
||||
private channels: Map<string, Set<EventCallback>> = new Map();
|
||||
|
||||
subscribe(channel: string, callback: EventCallback): () => void {
|
||||
if (!this.channels.has(channel)) {
|
||||
this.channels.set(channel, new Set());
|
||||
}
|
||||
this.channels.get(channel)!.add(callback);
|
||||
|
||||
return () => {
|
||||
const subs = this.channels.get(channel);
|
||||
if (subs) {
|
||||
subs.delete(callback);
|
||||
if (subs.size === 0) {
|
||||
this.channels.delete(channel);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
emit(channel: string, data: string): void {
|
||||
const subs = this.channels.get(channel);
|
||||
if (subs) {
|
||||
for (const callback of subs) {
|
||||
callback(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const sseManager = new SSEManager();
|
||||
|
||||
export function registerEventsRoutes(app: Hono<AppEnv>) {
|
||||
app.get('/api/events/:channel', async (c) => {
|
||||
const channel = c.req.param('channel');
|
||||
|
||||
const stream = new ReadableStream({
|
||||
start(controller) {
|
||||
const encoder = new TextEncoder();
|
||||
|
||||
const send = (data: string) => {
|
||||
try {
|
||||
controller.enqueue(encoder.encode(`data: ${data}\n\n`));
|
||||
} catch {
|
||||
// Controller closed
|
||||
}
|
||||
};
|
||||
|
||||
send('connected');
|
||||
|
||||
const unsubscribe = sseManager.subscribe(channel, send);
|
||||
|
||||
const keepAliveInterval = setInterval(() => {
|
||||
send('ping');
|
||||
}, 30000);
|
||||
|
||||
c.req.raw.signal.addEventListener('abort', () => {
|
||||
console.log(`[SSE] Connection closed for channel: ${channel}`);
|
||||
clearInterval(keepAliveInterval);
|
||||
unsubscribe();
|
||||
try {
|
||||
controller.close();
|
||||
} catch {
|
||||
// Already closed
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
return new Response(stream, {
|
||||
headers: {
|
||||
'Content-Type': 'text/event-stream',
|
||||
'Cache-Control': 'no-cache',
|
||||
Connection: 'keep-alive',
|
||||
'X-Accel-Buffering': 'no',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,68 +1,34 @@
|
||||
import { auth } from '@/lib/auth';
|
||||
import { fetchGeoInfo } from '@/lib/geoip';
|
||||
import { db } from '@/lib/prisma';
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import { createMiddleware } from 'hono/factory';
|
||||
import type { MiddlewareHandler } from 'hono';
|
||||
|
||||
type SessionWithGeo = {
|
||||
id: string;
|
||||
ipAddress: string | null;
|
||||
userAgent: string | null;
|
||||
country: string | null;
|
||||
city: string | null;
|
||||
countryCode: string | null;
|
||||
latitude: number | null;
|
||||
longitude: number | null;
|
||||
};
|
||||
export const requireAuth: MiddlewareHandler<AppEnv> = async (c, next) => {
|
||||
const bearerToken = c.req.header('authorization')?.replace('Bearer ', '');
|
||||
|
||||
export const requireAuth = createMiddleware<AppEnv>(async (c, next) => {
|
||||
const session = await auth.api.getSession({
|
||||
headers: c.req.raw.headers,
|
||||
if (!bearerToken) {
|
||||
return c.json({ message: 'Missing bearer token.' }, 403);
|
||||
}
|
||||
|
||||
const { user, session } = await auth.api.getSession({
|
||||
headers: { authorization: `Bearer ${bearerToken}` },
|
||||
});
|
||||
|
||||
if (!session) {
|
||||
return c.json({ message: 'Unauthorized' }, 401);
|
||||
if (!user || !session) {
|
||||
return c.json({ message: 'Invalid or expired token.' }, 403);
|
||||
}
|
||||
|
||||
const user = session.user as { banned?: boolean; banReason?: string | null };
|
||||
const appUser = await db.user.findUnique({
|
||||
where: { email: user.email },
|
||||
select: { id: true },
|
||||
});
|
||||
|
||||
if (user.banned) {
|
||||
return c.json(
|
||||
{
|
||||
message: 'Tu cuenta ha sido bloqueada.',
|
||||
...(user.banReason ? { reason: user.banReason } : {}),
|
||||
},
|
||||
403
|
||||
);
|
||||
if (!appUser) {
|
||||
return c.json({ message: 'User not provisioned in backend.' }, 403);
|
||||
}
|
||||
|
||||
const s = session.session as unknown as SessionWithGeo;
|
||||
|
||||
c.set('user', session.user);
|
||||
c.set('session', session.session);
|
||||
|
||||
if (s.ipAddress && !s.country) {
|
||||
resolveSessionGeo(s.id, s.ipAddress);
|
||||
}
|
||||
c.set('appUserId', appUser.id);
|
||||
c.set('session', session);
|
||||
|
||||
await next();
|
||||
});
|
||||
|
||||
async function resolveSessionGeo(sessionId: string, ipAddress: string) {
|
||||
try {
|
||||
const geo = await fetchGeoInfo(ipAddress);
|
||||
if (!geo) return;
|
||||
await db.session.update({
|
||||
where: { id: sessionId },
|
||||
data: {
|
||||
country: geo.country,
|
||||
city: geo.city,
|
||||
countryCode: geo.countryCode,
|
||||
latitude: geo.lat,
|
||||
longitude: geo.lon,
|
||||
},
|
||||
});
|
||||
} catch {
|
||||
// Silently fail — geo enrichment is best-effort
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,9 +11,9 @@ function getSuperAdminEmails(): Set<string> {
|
||||
}
|
||||
|
||||
export const requireSuperAdmin: MiddlewareHandler<AppEnv> = async (c, next) => {
|
||||
const user = c.get('user');
|
||||
const role = (user as any).role || 'member';
|
||||
const email = user.email.toLowerCase();
|
||||
const authUser = c.get('authUser');
|
||||
const role = typeof authUser.app_metadata?.role === 'string' ? authUser.app_metadata.role : null;
|
||||
const email = authUser.email?.toLowerCase();
|
||||
|
||||
if (role === 'super_admin') {
|
||||
await next();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
import {
|
||||
AdminBookingServiceError,
|
||||
createAdminBooking,
|
||||
} from '@/modules/admin-booking/services/admin-booking.service';
|
||||
import { sendBookingConfirmation } from '@/services/booking-email.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { CreateAdminBookingInput } from '@repo/api-contract';
|
||||
|
||||
@@ -12,30 +10,10 @@ type ComplexIdParams = { complexId: string };
|
||||
export async function createAdminBookingHandler(c: AppContext) {
|
||||
const { complexId } = c.req.valid('param' as never) as ComplexIdParams;
|
||||
const payload = c.req.valid('json' as never) as CreateAdminBookingInput;
|
||||
const user = c.get('user');
|
||||
const appUserId = c.get('appUserId');
|
||||
|
||||
try {
|
||||
const booking = await createAdminBooking(user.id, complexId, payload);
|
||||
|
||||
const complex = await db.complex.findUnique({
|
||||
where: { id: complexId },
|
||||
select: { complexSlug: true },
|
||||
});
|
||||
|
||||
void sendBookingConfirmation({
|
||||
bookingCode: booking.bookingCode,
|
||||
complexSlug: complex?.complexSlug ?? '',
|
||||
complexName: booking.complexName,
|
||||
date: booking.date,
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
courtName: booking.courtName,
|
||||
sportName: booking.sport.name,
|
||||
customerName: booking.customerName,
|
||||
customerEmail: booking.customerEmail,
|
||||
price: booking.price,
|
||||
});
|
||||
|
||||
const booking = await createAdminBooking(appUserId, complexId, payload);
|
||||
return c.json(booking, 201);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
|
||||
@@ -10,10 +10,10 @@ type ComplexIdParams = { complexId: string };
|
||||
export async function listAdminBookingsHandler(c: AppContext) {
|
||||
const { complexId } = c.req.valid('param' as never) as ComplexIdParams;
|
||||
const query = c.req.valid('query' as never) as ListAdminBookingsQuery;
|
||||
const user = c.get('user');
|
||||
const appUserId = c.get('appUserId');
|
||||
|
||||
try {
|
||||
const response = await listAdminBookings(user.id, complexId, query);
|
||||
const response = await listAdminBookings(appUserId, complexId, query);
|
||||
return c.json(response);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
|
||||
@@ -2,7 +2,6 @@ import {
|
||||
AdminBookingServiceError,
|
||||
updateAdminBookingStatus,
|
||||
} from '@/modules/admin-booking/services/admin-booking.service';
|
||||
import { sendBookingCancelled, sendBookingNoShow } from '@/services/booking-email.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { UpdateAdminBookingStatusInput } from '@repo/api-contract';
|
||||
|
||||
@@ -11,37 +10,10 @@ type BookingIdParams = { id: string };
|
||||
export async function updateAdminBookingStatusHandler(c: AppContext) {
|
||||
const { id } = c.req.valid('param' as never) as BookingIdParams;
|
||||
const payload = c.req.valid('json' as never) as UpdateAdminBookingStatusInput;
|
||||
const user = c.get('user');
|
||||
const appUserId = c.get('appUserId');
|
||||
|
||||
try {
|
||||
const booking = await updateAdminBookingStatus(user.id, id, payload);
|
||||
|
||||
if (payload.status === 'CANCELLED') {
|
||||
void sendBookingCancelled({
|
||||
bookingCode: booking.bookingCode,
|
||||
complexName: booking.complexName,
|
||||
date: booking.date,
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
courtName: booking.courtName,
|
||||
sportName: booking.sport.name,
|
||||
customerName: booking.customerName,
|
||||
customerEmail: booking.customerEmail,
|
||||
});
|
||||
} else if (payload.status === 'NOSHOW') {
|
||||
void sendBookingNoShow({
|
||||
bookingCode: booking.bookingCode,
|
||||
complexName: booking.complexName,
|
||||
date: booking.date,
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
courtName: booking.courtName,
|
||||
sportName: booking.sport.name,
|
||||
customerName: booking.customerName,
|
||||
customerEmail: booking.customerEmail,
|
||||
});
|
||||
}
|
||||
|
||||
const booking = await updateAdminBookingStatus(appUserId, id, payload);
|
||||
return c.json(booking);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { randomInt } from 'node:crypto';
|
||||
import { CourtBookingStatus } from '@/generated/prisma/enums';
|
||||
import { db } from '@/lib/prisma';
|
||||
import { isSlotInPast } from '@/lib/slot-validator';
|
||||
import { evaluatePlanUsage, parsePlanRules } from '@/modules/plan/services/plan-rules.service';
|
||||
import type { DayOfWeek } from '@repo/api-contract';
|
||||
import type {
|
||||
AdminBooking,
|
||||
CreateAdminBookingInput,
|
||||
@@ -128,12 +126,12 @@ function buildSlots(
|
||||
return slots;
|
||||
}
|
||||
|
||||
async function ensureComplexAccess(complexId: string, userId: string) {
|
||||
async function ensureComplexAccess(complexId: string, appUserId: string) {
|
||||
const complexUser = await db.complexUser.findUnique({
|
||||
where: {
|
||||
complexId_userId: {
|
||||
complexId,
|
||||
userId,
|
||||
userId: appUserId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
@@ -158,40 +156,6 @@ async function ensureComplexAccess(complexId: string, userId: string) {
|
||||
return complexUser.complex;
|
||||
}
|
||||
|
||||
function resolvePrice(
|
||||
court: {
|
||||
basePrice: unknown;
|
||||
priceRules: Array<{
|
||||
dayOfWeek: string | null;
|
||||
startTime: string | null;
|
||||
endTime: string | null;
|
||||
price: unknown;
|
||||
}>;
|
||||
},
|
||||
dayOfWeek: string,
|
||||
startTime: string,
|
||||
endTime: string
|
||||
): number {
|
||||
const slotStart = toMinutes(startTime);
|
||||
const slotEnd = toMinutes(endTime);
|
||||
|
||||
const matchingRules = court.priceRules
|
||||
.filter((rule) => {
|
||||
if (rule.dayOfWeek && rule.dayOfWeek !== dayOfWeek) return false;
|
||||
if (!rule.startTime || !rule.endTime) return true;
|
||||
return slotStart >= toMinutes(rule.startTime) && slotEnd <= toMinutes(rule.endTime);
|
||||
})
|
||||
.sort((first, second) => {
|
||||
const firstSpecificity =
|
||||
(first.dayOfWeek ? 2 : 0) + (first.startTime && first.endTime ? 1 : 0);
|
||||
const secondSpecificity =
|
||||
(second.dayOfWeek ? 2 : 0) + (second.startTime && second.endTime ? 1 : 0);
|
||||
return secondSpecificity - firstSpecificity;
|
||||
});
|
||||
|
||||
return Number(matchingRules[0]?.price ?? court.basePrice);
|
||||
}
|
||||
|
||||
function mapBookingResponse(booking: {
|
||||
id: string;
|
||||
bookingCode: string;
|
||||
@@ -200,8 +164,7 @@ function mapBookingResponse(booking: {
|
||||
endTime: string;
|
||||
customerName: string;
|
||||
customerPhone: string;
|
||||
customerEmail: string;
|
||||
status: 'CONFIRMED' | 'CANCELLED' | 'COMPLETED' | 'NOSHOW';
|
||||
status: 'CONFIRMED' | 'CANCELLED' | 'COMPLETED';
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
court: {
|
||||
@@ -217,7 +180,6 @@ function mapBookingResponse(booking: {
|
||||
slug: string;
|
||||
};
|
||||
};
|
||||
price?: number;
|
||||
}): AdminBooking {
|
||||
return {
|
||||
id: booking.id,
|
||||
@@ -236,8 +198,6 @@ function mapBookingResponse(booking: {
|
||||
endTime: booking.endTime,
|
||||
customerName: booking.customerName,
|
||||
customerPhone: booking.customerPhone,
|
||||
customerEmail: booking.customerEmail,
|
||||
price: booking.price ?? 0,
|
||||
status: booking.status,
|
||||
createdAt: booking.createdAt.toISOString(),
|
||||
updatedAt: booking.updatedAt.toISOString(),
|
||||
@@ -245,11 +205,11 @@ function mapBookingResponse(booking: {
|
||||
}
|
||||
|
||||
export async function listAdminBookings(
|
||||
userId: string,
|
||||
appUserId: string,
|
||||
complexId: string,
|
||||
query: ListAdminBookingsQuery
|
||||
) {
|
||||
await ensureComplexAccess(complexId, userId);
|
||||
await ensureComplexAccess(complexId, appUserId);
|
||||
const fromDate = parseIsoDate(query.fromDate);
|
||||
|
||||
const bookings = await db.courtBooking.findMany({
|
||||
@@ -293,21 +253,11 @@ export async function listAdminBookings(
|
||||
}
|
||||
|
||||
export async function createAdminBooking(
|
||||
userId: string,
|
||||
appUserId: string,
|
||||
complexId: string,
|
||||
input: CreateAdminBookingInput
|
||||
) {
|
||||
const complex = await ensureComplexAccess(complexId, userId);
|
||||
|
||||
const adminUser = await db.user.findUnique({
|
||||
where: { id: userId },
|
||||
select: { emailVerified: true },
|
||||
});
|
||||
|
||||
if (!adminUser?.emailVerified) {
|
||||
throw new AdminBookingServiceError('Debés verificar tu email para poder crear reservas.', 403);
|
||||
}
|
||||
|
||||
const complex = await ensureComplexAccess(complexId, appUserId);
|
||||
const bookingDate = parseIsoDate(input.date);
|
||||
const dayOfWeek = getDayOfWeek(bookingDate);
|
||||
|
||||
@@ -332,10 +282,6 @@ export async function createAdminBooking(
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
priceRules: {
|
||||
where: { isActive: true },
|
||||
orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -362,10 +308,6 @@ export async function createAdminBooking(
|
||||
);
|
||||
}
|
||||
|
||||
if (isSlotInPast(bookingDate, input.startTime, court.slotDurationMinutes)) {
|
||||
throw new AdminBookingServiceError('No se pueden crear reservas en el pasado.', 400);
|
||||
}
|
||||
|
||||
for (let attempt = 0; attempt < 5; attempt += 1) {
|
||||
try {
|
||||
const booking = await db.$transaction(async (tx) => {
|
||||
@@ -429,7 +371,6 @@ export async function createAdminBooking(
|
||||
endTime: selectedSlot.endTime,
|
||||
customerName: input.customerName.trim(),
|
||||
customerPhone: input.customerPhone.trim(),
|
||||
customerEmail: input.customerEmail?.trim() ?? '',
|
||||
status: 'CONFIRMED',
|
||||
},
|
||||
include: {
|
||||
@@ -456,9 +397,7 @@ export async function createAdminBooking(
|
||||
});
|
||||
});
|
||||
|
||||
const price = resolvePrice(court, dayOfWeek, selectedSlot.startTime, selectedSlot.endTime);
|
||||
|
||||
return mapBookingResponse({ ...booking, price });
|
||||
return mapBookingResponse(booking);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
throw error;
|
||||
@@ -497,7 +436,7 @@ export async function createAdminBooking(
|
||||
}
|
||||
|
||||
export async function updateAdminBookingStatus(
|
||||
userId: string,
|
||||
appUserId: string,
|
||||
bookingId: string,
|
||||
input: UpdateAdminBookingStatusInput
|
||||
) {
|
||||
@@ -508,7 +447,7 @@ export async function updateAdminBookingStatus(
|
||||
complex: {
|
||||
users: {
|
||||
some: {
|
||||
userId,
|
||||
userId: appUserId,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -555,43 +494,34 @@ export async function updateAdminBookingStatus(
|
||||
);
|
||||
}
|
||||
|
||||
if (input.status === 'NOSHOW' && booking.status !== 'CONFIRMED') {
|
||||
throw new AdminBookingServiceError(
|
||||
'Solo se pueden marcar como no show las reservas confirmadas.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
await db.courtBookingLog.create({
|
||||
const updated = await db.courtBooking.update({
|
||||
where: { id: booking.id },
|
||||
data: {
|
||||
id: uuidv7(),
|
||||
bookingCode: booking.bookingCode,
|
||||
courtId: booking.court.id,
|
||||
bookingDate: booking.bookingDate,
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
customerName: booking.customerName,
|
||||
customerPhone: booking.customerPhone,
|
||||
customerEmail: booking.customerEmail,
|
||||
previousStatus: booking.status,
|
||||
newStatus: input.status,
|
||||
changedAt: new Date(),
|
||||
status:
|
||||
input.status === 'COMPLETED' ? CourtBookingStatus.COMPLETED : CourtBookingStatus.CANCELLED,
|
||||
},
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
complexName: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (input.status === 'COMPLETED' || input.status === 'NOSHOW') {
|
||||
await db.courtBooking.update({
|
||||
where: { id: booking.id },
|
||||
data: {
|
||||
status: input.status,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// if the booking is cancelled we delete it to free up the slot, but we keep a log of it with the cancelled status
|
||||
await db.courtBooking.delete({
|
||||
where: { id: booking.id },
|
||||
});
|
||||
}
|
||||
|
||||
return mapBookingResponse({ ...booking, status: input.status });
|
||||
return mapBookingResponse(updated);
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
import { validate } from '@/lib/http/validate';
|
||||
import { requireAuth } from '@/middlewares/require-auth.middleware';
|
||||
import { requireSuperAdmin } from '@/middlewares/require-super-admin.middleware';
|
||||
import { blockUserHandler } from '@/modules/admin/handlers/block-user.handler';
|
||||
import { createPlanHandler } from '@/modules/admin/handlers/create-plan.handler';
|
||||
import { deletePlanHandler } from '@/modules/admin/handlers/delete-plan.handler';
|
||||
import { getGeoStatsHandler } from '@/modules/admin/handlers/get-geo-stats.handler';
|
||||
import { getUserSessionsHandler } from '@/modules/admin/handlers/get-user-sessions.handler';
|
||||
import { listComplexesHandler } from '@/modules/admin/handlers/list-complexes.handler';
|
||||
import { listPlansAdminHandler } from '@/modules/admin/handlers/list-plans-admin.handler';
|
||||
import { listUsersHandler } from '@/modules/admin/handlers/list-users.handler';
|
||||
import { revokeAllSessionsHandler } from '@/modules/admin/handlers/revoke-all-sessions.handler';
|
||||
import { unblockUserHandler } from '@/modules/admin/handlers/unblock-user.handler';
|
||||
import { updatePlanHandler } from '@/modules/admin/handlers/update-plan.handler';
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import {
|
||||
adminBlockUserSchema,
|
||||
adminCreatePlanSchema,
|
||||
adminUpdatePlanSchema,
|
||||
} from '@repo/api-contract';
|
||||
import { Hono } from 'hono';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const adminRoutes = new Hono<AppEnv>();
|
||||
|
||||
adminRoutes.use('*', requireAuth, requireSuperAdmin);
|
||||
|
||||
adminRoutes.get('/complexes', listComplexesHandler);
|
||||
|
||||
adminRoutes.get('/plans', listPlansAdminHandler);
|
||||
adminRoutes.post('/plans', validate.json(adminCreatePlanSchema), createPlanHandler);
|
||||
adminRoutes.patch(
|
||||
'/plans/:code',
|
||||
validate.param(z.object({ code: z.string().min(1).max(10) })),
|
||||
validate.json(adminUpdatePlanSchema),
|
||||
updatePlanHandler
|
||||
);
|
||||
adminRoutes.delete(
|
||||
'/plans/:code',
|
||||
validate.param(z.object({ code: z.string().min(1).max(10) })),
|
||||
deletePlanHandler
|
||||
);
|
||||
|
||||
adminRoutes.get('/geo-stats', getGeoStatsHandler);
|
||||
|
||||
adminRoutes.get('/users', listUsersHandler);
|
||||
adminRoutes.post(
|
||||
'/users/:id/block',
|
||||
validate.param(z.object({ id: z.string().min(1) })),
|
||||
validate.json(adminBlockUserSchema),
|
||||
blockUserHandler
|
||||
);
|
||||
adminRoutes.post(
|
||||
'/users/:id/unblock',
|
||||
validate.param(z.object({ id: z.string().min(1) })),
|
||||
unblockUserHandler
|
||||
);
|
||||
adminRoutes.get(
|
||||
'/users/:id/sessions',
|
||||
validate.param(z.object({ id: z.string().min(1) })),
|
||||
getUserSessionsHandler
|
||||
);
|
||||
adminRoutes.post(
|
||||
'/users/:id/sessions/revoke-all',
|
||||
validate.param(z.object({ id: z.string().min(1) })),
|
||||
revokeAllSessionsHandler
|
||||
);
|
||||
@@ -1,20 +0,0 @@
|
||||
import { AdminServiceError, blockUser } from '@/modules/admin/services/admin-users.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { AdminBlockUserInput } from '@repo/api-contract';
|
||||
|
||||
type BlockUserParams = { id: string };
|
||||
|
||||
export async function blockUserHandler(c: AppContext) {
|
||||
const { id } = c.req.valid('param' as never) as BlockUserParams;
|
||||
const body = c.req.valid('json' as never) as AdminBlockUserInput;
|
||||
|
||||
try {
|
||||
await blockUser(id, body.banReason);
|
||||
return c.json({ message: 'Usuario bloqueado correctamente.' });
|
||||
} catch (error) {
|
||||
if (error instanceof AdminServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { AdminCreatePlanInput } from '@repo/api-contract';
|
||||
|
||||
export async function createPlanHandler(c: AppContext) {
|
||||
const body = c.req.valid('json' as never) as AdminCreatePlanInput;
|
||||
|
||||
const existing = await db.plan.findUnique({
|
||||
where: { code: body.code },
|
||||
});
|
||||
|
||||
if (existing) {
|
||||
return c.json({ message: 'Ya existe un plan con ese código.' }, 409);
|
||||
}
|
||||
|
||||
const plan = await db.plan.create({
|
||||
data: {
|
||||
code: body.code,
|
||||
name: body.name,
|
||||
price: body.price,
|
||||
rules: body.rules,
|
||||
},
|
||||
});
|
||||
|
||||
return c.json(
|
||||
{
|
||||
code: plan.code,
|
||||
name: plan.name,
|
||||
price: Number(plan.price),
|
||||
rules: plan.rules,
|
||||
},
|
||||
201
|
||||
);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
type DeletePlanParams = { code: string };
|
||||
|
||||
export async function deletePlanHandler(c: AppContext) {
|
||||
const { code } = c.req.valid('param' as never) as DeletePlanParams;
|
||||
|
||||
const existing = await db.plan.findUnique({
|
||||
where: { code },
|
||||
include: {
|
||||
_count: {
|
||||
select: { complexes: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!existing) {
|
||||
return c.json({ message: 'Plan no encontrado.' }, 404);
|
||||
}
|
||||
|
||||
if (existing._count.complexes > 0) {
|
||||
return c.json({ message: 'No se puede eliminar un plan que tiene complejos asignados.' }, 409);
|
||||
}
|
||||
|
||||
await db.plan.delete({
|
||||
where: { code },
|
||||
});
|
||||
|
||||
return c.json({ message: 'Plan eliminado correctamente.' });
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { getGeoStats } from '@/modules/admin/services/admin-geo.service';
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import type { Handler } from 'hono';
|
||||
|
||||
export const getGeoStatsHandler: Handler<AppEnv> = async (c) => {
|
||||
const stats = await getGeoStats();
|
||||
return c.json(stats);
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
import { getUserSessions } from '@/modules/admin/services/admin-users.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
type UserSessionsParams = { id: string };
|
||||
|
||||
export async function getUserSessionsHandler(c: AppContext) {
|
||||
const { id } = c.req.valid('param' as never) as UserSessionsParams;
|
||||
|
||||
const sessions = await getUserSessions(id);
|
||||
|
||||
return c.json(sessions);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { getComplexStatsList } from '@/modules/admin/services/complex-stats.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
export async function listComplexesHandler(c: AppContext) {
|
||||
const stats = await getComplexStatsList();
|
||||
return c.json(stats);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
export async function listPlansAdminHandler(c: AppContext) {
|
||||
const plans = await db.plan.findMany({
|
||||
orderBy: { price: 'asc' },
|
||||
include: {
|
||||
_count: {
|
||||
select: { complexes: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return c.json(
|
||||
plans.map((plan) => ({
|
||||
code: plan.code,
|
||||
name: plan.name,
|
||||
price: Number(plan.price),
|
||||
rules: plan.rules,
|
||||
lastUpdatedAt: plan.lastUpdatedAt.toISOString(),
|
||||
complexCount: plan._count.complexes,
|
||||
}))
|
||||
);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { listAdminUsers } from '@/modules/admin/services/admin-users.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
export async function listUsersHandler(c: AppContext) {
|
||||
const search = c.req.query('search');
|
||||
const users = await listAdminUsers(search);
|
||||
return c.json(users);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import { revokeAllUserSessions } from '@/modules/admin/services/admin-users.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
type RevokeSessionsParams = { id: string };
|
||||
|
||||
export async function revokeAllSessionsHandler(c: AppContext) {
|
||||
const { id } = c.req.valid('param' as never) as RevokeSessionsParams;
|
||||
|
||||
const count = await revokeAllUserSessions(id);
|
||||
|
||||
return c.json({ message: `${count} sesiones cerradas correctamente.` });
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import { unblockUser } from '@/modules/admin/services/admin-users.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
type UnblockUserParams = { id: string };
|
||||
|
||||
export async function unblockUserHandler(c: AppContext) {
|
||||
const { id } = c.req.valid('param' as never) as UnblockUserParams;
|
||||
|
||||
await unblockUser(id);
|
||||
|
||||
return c.json({ message: 'Usuario desbloqueado correctamente.' });
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { AdminUpdatePlanInput } from '@repo/api-contract';
|
||||
|
||||
type UpdatePlanParams = { code: string };
|
||||
|
||||
export async function updatePlanHandler(c: AppContext) {
|
||||
const { code } = c.req.valid('param' as never) as UpdatePlanParams;
|
||||
const body = c.req.valid('json' as never) as AdminUpdatePlanInput;
|
||||
|
||||
const existing = await db.plan.findUnique({
|
||||
where: { code },
|
||||
});
|
||||
|
||||
if (!existing) {
|
||||
return c.json({ message: 'Plan no encontrado.' }, 404);
|
||||
}
|
||||
|
||||
const plan = await db.plan.update({
|
||||
where: { code },
|
||||
data: {
|
||||
...(body.name !== undefined && { name: body.name }),
|
||||
...(body.price !== undefined && { price: body.price }),
|
||||
...(body.rules !== undefined && { rules: body.rules }),
|
||||
lastUpdatedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
return c.json({
|
||||
code: plan.code,
|
||||
name: plan.name,
|
||||
price: Number(plan.price),
|
||||
rules: plan.rules,
|
||||
});
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
|
||||
type GeoStatsCountry = {
|
||||
country: string;
|
||||
countryCode: string;
|
||||
totalUsers: number;
|
||||
cities: { city: string; userCount: number }[];
|
||||
};
|
||||
|
||||
export async function getGeoStats(): Promise<{
|
||||
countries: GeoStatsCountry[];
|
||||
totalUniqueCountries: number;
|
||||
}> {
|
||||
const sessions = await db.session.findMany({
|
||||
where: {
|
||||
country: { not: null },
|
||||
expiresAt: { gt: new Date() },
|
||||
},
|
||||
select: {
|
||||
country: true,
|
||||
countryCode: true,
|
||||
city: true,
|
||||
userId: true,
|
||||
},
|
||||
});
|
||||
|
||||
const countryMap = new Map<
|
||||
string,
|
||||
{ country: string; countryCode: string; users: Set<string>; cities: Map<string, Set<string>> }
|
||||
>();
|
||||
|
||||
for (const s of sessions) {
|
||||
const code = s.countryCode || 'XX';
|
||||
let entry = countryMap.get(code);
|
||||
if (!entry) {
|
||||
entry = {
|
||||
country: s.country || 'Desconocido',
|
||||
countryCode: code,
|
||||
users: new Set(),
|
||||
cities: new Map(),
|
||||
};
|
||||
countryMap.set(code, entry);
|
||||
}
|
||||
entry.users.add(s.userId);
|
||||
|
||||
const cityName = s.city || 'Desconocida';
|
||||
let cityUsers = entry.cities.get(cityName);
|
||||
if (!cityUsers) {
|
||||
cityUsers = new Set();
|
||||
entry.cities.set(cityName, cityUsers);
|
||||
}
|
||||
cityUsers.add(s.userId);
|
||||
}
|
||||
|
||||
const countries = Array.from(countryMap.values())
|
||||
.map((entry) => ({
|
||||
country: entry.country,
|
||||
countryCode: entry.countryCode,
|
||||
totalUsers: entry.users.size,
|
||||
cities: Array.from(entry.cities.entries())
|
||||
.map(([city, users]) => ({ city, userCount: users.size }))
|
||||
.sort((a, b) => b.userCount - a.userCount),
|
||||
}))
|
||||
.sort((a, b) => b.totalUsers - a.totalUsers);
|
||||
|
||||
return { countries, totalUniqueCountries: countries.length };
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
import { fetchGeoInfo } from '@/lib/geoip';
|
||||
import { db } from '@/lib/prisma';
|
||||
|
||||
type AdminUser = {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
role: string;
|
||||
banned: boolean;
|
||||
bannedAt: string | null;
|
||||
banReason: string | null;
|
||||
createdAt: string;
|
||||
complexCount: number;
|
||||
activeSessions: number;
|
||||
};
|
||||
|
||||
export async function listAdminUsers(search?: string): Promise<AdminUser[]> {
|
||||
const users = await db.user.findMany({
|
||||
where: search
|
||||
? {
|
||||
OR: [
|
||||
{ name: { contains: search, mode: 'insensitive' } },
|
||||
{ email: { contains: search, mode: 'insensitive' } },
|
||||
],
|
||||
}
|
||||
: undefined,
|
||||
include: {
|
||||
_count: {
|
||||
select: { complexes: true, sessions: true },
|
||||
},
|
||||
},
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
|
||||
return users.map((user) => ({
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
email: user.email,
|
||||
role: user.role,
|
||||
banned: user.banned ?? false,
|
||||
bannedAt: user.bannedAt?.toISOString() ?? null,
|
||||
banReason: user.banReason ?? null,
|
||||
createdAt: user.createdAt.toISOString(),
|
||||
complexCount: user._count.complexes,
|
||||
activeSessions: user._count.sessions,
|
||||
}));
|
||||
}
|
||||
|
||||
type AdminUserSession = {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
expiresAt: string;
|
||||
ipAddress: string | null;
|
||||
userAgent: string | null;
|
||||
city: string | null;
|
||||
country: string | null;
|
||||
countryCode: string | null;
|
||||
};
|
||||
|
||||
export async function getUserSessions(userId: string): Promise<AdminUserSession[]> {
|
||||
const sessions = await db.session.findMany({
|
||||
where: { userId },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
|
||||
const uniqueIps = [...new Set(sessions.map((s) => s.ipAddress).filter(Boolean))] as string[];
|
||||
const geoResults = await Promise.all(uniqueIps.map((ip) => fetchGeoInfo(ip)));
|
||||
const geoMap = new Map<
|
||||
string,
|
||||
{ city: string | null; country: string | null; countryCode: string | null }
|
||||
>();
|
||||
for (let i = 0; i < uniqueIps.length; i++) {
|
||||
const info = geoResults[i];
|
||||
geoMap.set(uniqueIps[i], {
|
||||
city: info?.city ?? null,
|
||||
country: info?.country ?? null,
|
||||
countryCode: info?.countryCode ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
return sessions.map((s) => {
|
||||
const geo = s.ipAddress ? geoMap.get(s.ipAddress) : null;
|
||||
return {
|
||||
id: s.id,
|
||||
createdAt: s.createdAt.toISOString(),
|
||||
expiresAt: s.expiresAt.toISOString(),
|
||||
ipAddress: s.ipAddress,
|
||||
userAgent: s.userAgent,
|
||||
city: geo?.city ?? null,
|
||||
country: geo?.country ?? null,
|
||||
countryCode: geo?.countryCode ?? null,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export class AdminServiceError extends Error {
|
||||
status: 400 | 403 | 404;
|
||||
constructor(message: string, status: 400 | 403 | 404 = 400) {
|
||||
super(message);
|
||||
this.status = status;
|
||||
this.name = 'AdminServiceError';
|
||||
}
|
||||
}
|
||||
|
||||
export async function blockUser(userId: string, banReason?: string): Promise<void> {
|
||||
const target = await db.user.findUnique({
|
||||
where: { id: userId },
|
||||
select: { role: true },
|
||||
});
|
||||
|
||||
if (!target) {
|
||||
throw new AdminServiceError('Usuario no encontrado.', 404);
|
||||
}
|
||||
|
||||
if (target.role === 'super_admin') {
|
||||
throw new AdminServiceError('No se puede bloquear un super_admin.', 403);
|
||||
}
|
||||
|
||||
await db.user.update({
|
||||
where: { id: userId },
|
||||
data: {
|
||||
banned: true,
|
||||
bannedAt: new Date(),
|
||||
banReason: banReason ?? null,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function unblockUser(userId: string): Promise<void> {
|
||||
await db.user.update({
|
||||
where: { id: userId },
|
||||
data: {
|
||||
banned: false,
|
||||
bannedAt: null,
|
||||
banReason: null,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function revokeAllUserSessions(userId: string): Promise<number> {
|
||||
const result = await db.session.deleteMany({
|
||||
where: { userId },
|
||||
});
|
||||
|
||||
return result.count;
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
|
||||
type ComplexStats = {
|
||||
id: string;
|
||||
complexName: string;
|
||||
complexSlug: string;
|
||||
city: string | null;
|
||||
planCode: string | null;
|
||||
planName: string | null;
|
||||
userCount: number;
|
||||
courtCount: number;
|
||||
totalBookings: number;
|
||||
avgBookingsPerDay: number;
|
||||
bookingsByStatus: {
|
||||
confirmed: number;
|
||||
cancelled: number;
|
||||
completed: number;
|
||||
noshow: number;
|
||||
};
|
||||
paymentStatus: 'active' | 'no_plan' | 'expired';
|
||||
};
|
||||
|
||||
export async function getComplexStatsList(): Promise<ComplexStats[]> {
|
||||
const complexes = await db.complex.findMany({
|
||||
include: {
|
||||
plan: true,
|
||||
users: true,
|
||||
courts: {
|
||||
include: {
|
||||
bookings: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return complexes.map((complex) => {
|
||||
const courtCount = complex.courts.length;
|
||||
const allBookings = complex.courts.flatMap((c) => c.bookings);
|
||||
|
||||
const bookingsByStatus = {
|
||||
confirmed: allBookings.filter((b) => b.status === 'CONFIRMED').length,
|
||||
cancelled: allBookings.filter((b) => b.status === 'CANCELLED').length,
|
||||
completed: allBookings.filter((b) => b.status === 'COMPLETED').length,
|
||||
noshow: allBookings.filter((b) => b.status === 'NOSHOW').length,
|
||||
};
|
||||
|
||||
const totalBookings = allBookings.length;
|
||||
|
||||
let avgBookingsPerDay = 0;
|
||||
if (allBookings.length > 0) {
|
||||
const dates = allBookings.map((b) => b.bookingDate);
|
||||
const minDate = new Date(Math.min(...dates.map((d) => d.getTime())));
|
||||
const daysDiff = Math.max(
|
||||
1,
|
||||
Math.ceil((Date.now() - minDate.getTime()) / (1000 * 60 * 60 * 24))
|
||||
);
|
||||
avgBookingsPerDay = Math.round((totalBookings / daysDiff) * 100) / 100;
|
||||
}
|
||||
|
||||
let paymentStatus: 'active' | 'no_plan' | 'expired' = 'no_plan';
|
||||
if (complex.plan) {
|
||||
paymentStatus = 'active';
|
||||
}
|
||||
|
||||
return {
|
||||
id: complex.id,
|
||||
complexName: complex.complexName,
|
||||
complexSlug: complex.complexSlug,
|
||||
city: complex.city,
|
||||
planCode: complex.planCode,
|
||||
planName: complex.plan?.name ?? null,
|
||||
userCount: complex.users.length,
|
||||
courtCount,
|
||||
totalBookings,
|
||||
avgBookingsPerDay,
|
||||
bookingsByStatus,
|
||||
paymentStatus,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { auth } from '@/lib/auth';
|
||||
import { AppEnv } from '@/types/hono';
|
||||
import { Hono } from 'hono';
|
||||
|
||||
export const authRoutes = new Hono<AppEnv>();
|
||||
|
||||
authRoutes.on(['POST', 'GET'], '/api/auth/*', (c) => {
|
||||
return auth.handler(c.req.raw);
|
||||
});
|
||||
@@ -1,25 +1,12 @@
|
||||
import { requireAuth } from '@/middlewares/require-auth.middleware';
|
||||
import { acceptComplexInvitationsHandler } from '@/modules/complex/handlers/accept-complex-invitations.handler';
|
||||
import { cancelComplexInvitationHandler } from '@/modules/complex/handlers/cancel-complex-invitation.handler';
|
||||
import { createComplexHandler } from '@/modules/complex/handlers/create-complex.handler';
|
||||
import { getComplexByIdHandler } from '@/modules/complex/handlers/get-complex-by-id.handler';
|
||||
import { getComplexBySlugHandler } from '@/modules/complex/handlers/get-complex-by-slug.handler';
|
||||
import { getCurrentComplexHandler } from '@/modules/complex/handlers/get-current-complex.handler';
|
||||
import { inviteComplexUserHandler } from '@/modules/complex/handlers/invite-complex-user.handler';
|
||||
import { listComplexUsersHandler } from '@/modules/complex/handlers/list-complex-users.handler';
|
||||
import { listMyComplexesHandler } from '@/modules/complex/handlers/list-my-complexes.handler';
|
||||
import { resendComplexInvitationHandler } from '@/modules/complex/handlers/resend-complex-invitation.handler';
|
||||
import { revokeComplexUserHandler } from '@/modules/complex/handlers/revoke-complex-user.handler';
|
||||
import { selectComplexHandler } from '@/modules/complex/handlers/select-complex.handler';
|
||||
import { updateComplexHandler } from '@/modules/complex/handlers/update-complex.handler';
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import { zValidator } from '@hono/zod-validator';
|
||||
import {
|
||||
acceptComplexInvitationsSchema,
|
||||
createComplexSchema,
|
||||
inviteComplexUserSchema,
|
||||
updateComplexSchema,
|
||||
} from '@repo/api-contract';
|
||||
import { createComplexSchema, updateComplexSchema } from '@repo/api-contract';
|
||||
import { Hono } from 'hono';
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -30,13 +17,6 @@ const complexSlugParamsSchema = z.object({ slug: z.string().trim().min(1) });
|
||||
complexRoutes.use('*', requireAuth);
|
||||
|
||||
complexRoutes.post('/', zValidator('json', createComplexSchema), createComplexHandler);
|
||||
complexRoutes.get('/me', getCurrentComplexHandler);
|
||||
complexRoutes.post('/select', selectComplexHandler);
|
||||
complexRoutes.post(
|
||||
'/accept-pending',
|
||||
zValidator('json', acceptComplexInvitationsSchema),
|
||||
acceptComplexInvitationsHandler
|
||||
);
|
||||
complexRoutes.get('/mine', listMyComplexesHandler);
|
||||
complexRoutes.get(
|
||||
'/slug/:slug',
|
||||
@@ -44,33 +24,6 @@ complexRoutes.get(
|
||||
getComplexBySlugHandler
|
||||
);
|
||||
|
||||
complexRoutes.get(
|
||||
'/:id/users',
|
||||
zValidator('param', complexIdParamsSchema),
|
||||
listComplexUsersHandler
|
||||
);
|
||||
complexRoutes.post(
|
||||
'/:id/users',
|
||||
zValidator('param', complexIdParamsSchema),
|
||||
zValidator('json', inviteComplexUserSchema),
|
||||
inviteComplexUserHandler
|
||||
);
|
||||
complexRoutes.post(
|
||||
'/:id/invitations/:invitationId/resend',
|
||||
zValidator('param', z.object({ id: z.uuid(), invitationId: z.uuid() })),
|
||||
resendComplexInvitationHandler
|
||||
);
|
||||
complexRoutes.delete(
|
||||
'/:id/invitations/:invitationId',
|
||||
zValidator('param', z.object({ id: z.uuid(), invitationId: z.uuid() })),
|
||||
cancelComplexInvitationHandler
|
||||
);
|
||||
complexRoutes.delete(
|
||||
'/:id/users/:userId',
|
||||
zValidator('param', z.object({ id: z.uuid(), userId: z.string().min(1) })),
|
||||
revokeComplexUserHandler
|
||||
);
|
||||
|
||||
complexRoutes.get('/:id', zValidator('param', complexIdParamsSchema), getComplexByIdHandler);
|
||||
complexRoutes.patch(
|
||||
'/:id',
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import {
|
||||
ComplexMembersError,
|
||||
acceptComplexInvitations,
|
||||
} from '@/modules/complex/services/complex-members.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { AcceptComplexInvitationsInput } from '@repo/api-contract';
|
||||
|
||||
export async function acceptComplexInvitationsHandler(c: AppContext) {
|
||||
const user = c.get('user');
|
||||
const payload = c.req.valid('json' as never) as AcceptComplexInvitationsInput;
|
||||
|
||||
try {
|
||||
const result = await acceptComplexInvitations(user.id, user.email, payload);
|
||||
return c.json(result);
|
||||
} catch (error) {
|
||||
if (error instanceof ComplexMembersError) {
|
||||
return c.json(
|
||||
{ message: error.message },
|
||||
{
|
||||
status: error.status,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import {
|
||||
ComplexMembersError,
|
||||
cancelComplexInvitation,
|
||||
} from '@/modules/complex/services/complex-members.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import { z } from 'zod';
|
||||
|
||||
const cancelInvitationParamsSchema = z.object({
|
||||
id: z.uuid(),
|
||||
invitationId: z.uuid(),
|
||||
});
|
||||
|
||||
export async function cancelComplexInvitationHandler(c: AppContext) {
|
||||
const user = c.get('user');
|
||||
const params = cancelInvitationParamsSchema.parse(c.req.param());
|
||||
|
||||
try {
|
||||
const result = await cancelComplexInvitation(user.id, params.id, params.invitationId);
|
||||
return c.json(result);
|
||||
} catch (error) {
|
||||
if (error instanceof ComplexMembersError) {
|
||||
return c.json({ message: error.message }, { status: error.status });
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import { db } from '@/lib/prisma';
|
||||
import { createComplex } from '@/modules/complex/services/complex.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { CreateComplexInput } from '@repo/api-contract';
|
||||
@@ -6,45 +5,21 @@ import type { CreateComplexInput } from '@repo/api-contract';
|
||||
export async function createComplexHandler(c: AppContext) {
|
||||
const payload = c.req.valid('json' as never) as CreateComplexInput;
|
||||
|
||||
const user = c.get('user');
|
||||
let adminEmail = user?.email;
|
||||
let userId = user?.id;
|
||||
const authUser = c.get('authUser');
|
||||
const adminEmail = authUser.email;
|
||||
|
||||
if (!adminEmail) {
|
||||
const body = await c.req.json().catch(() => ({}));
|
||||
adminEmail = body.adminEmail;
|
||||
userId = body.userId;
|
||||
}
|
||||
|
||||
if (!adminEmail) {
|
||||
return c.json({ message: 'Se requiere email del administrador.' }, 400);
|
||||
}
|
||||
|
||||
if (!userId && adminEmail) {
|
||||
const existingUser = await db.user.findUnique({
|
||||
where: { email: adminEmail },
|
||||
select: { id: true },
|
||||
});
|
||||
if (!existingUser) {
|
||||
return c.json({ message: 'El usuario no existe.' }, 404);
|
||||
}
|
||||
userId = existingUser.id;
|
||||
return c.json({ message: 'El usuario autenticado no tiene email.' }, 400);
|
||||
}
|
||||
|
||||
const complex = await createComplex({
|
||||
complexName: payload.complexName,
|
||||
physicalAddress: payload.physicalAddress,
|
||||
adminEmail,
|
||||
userId,
|
||||
planCode: payload.planCode,
|
||||
city: payload.city,
|
||||
state: payload.state,
|
||||
country: payload.country,
|
||||
setupCourts: payload.setupCourts,
|
||||
courtSportId: payload.courtSportId,
|
||||
courtStartTime: payload.courtStartTime,
|
||||
courtEndTime: payload.courtEndTime,
|
||||
courtDaysOfWeek: payload.courtDaysOfWeek,
|
||||
});
|
||||
|
||||
return c.json(complex, 201);
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import { getCurrentComplex } from '@/modules/complex/services/complex.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import { getCookie } from 'hono/cookie';
|
||||
|
||||
const SELECTED_COMPLEX_COOKIE = 'selected-complex-id';
|
||||
|
||||
export async function getCurrentComplexHandler(c: AppContext) {
|
||||
const user = c.get('user');
|
||||
const complexId = getCookie(c, SELECTED_COMPLEX_COOKIE);
|
||||
|
||||
if (!complexId) {
|
||||
return c.json(null);
|
||||
}
|
||||
|
||||
const complex = await getCurrentComplex(user.id, complexId);
|
||||
|
||||
if (!complex) {
|
||||
return c.json(null);
|
||||
}
|
||||
|
||||
return c.json(complex);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
import {
|
||||
ComplexMembersError,
|
||||
inviteComplexUser,
|
||||
} from '@/modules/complex/services/complex-members.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { InviteComplexUserInput } from '@repo/api-contract';
|
||||
import { z } from 'zod';
|
||||
|
||||
const complexParamsSchema = z.object({
|
||||
id: z.uuid(),
|
||||
});
|
||||
|
||||
type InviteComplexUserHandlerDeps = {
|
||||
inviteComplexUser: typeof inviteComplexUser;
|
||||
ComplexMembersError: typeof ComplexMembersError;
|
||||
};
|
||||
|
||||
export function createInviteComplexUserHandler(
|
||||
deps: InviteComplexUserHandlerDeps = {
|
||||
inviteComplexUser,
|
||||
ComplexMembersError,
|
||||
}
|
||||
) {
|
||||
return async function inviteComplexUserHandler(c: AppContext) {
|
||||
const user = c.get('user');
|
||||
const params = complexParamsSchema.parse(c.req.param());
|
||||
const payload = c.req.valid('json' as never) as InviteComplexUserInput;
|
||||
|
||||
try {
|
||||
const result = await deps.inviteComplexUser(user.id, params.id, payload);
|
||||
return c.json(result, 201);
|
||||
} catch (error) {
|
||||
if (error instanceof deps.ComplexMembersError) {
|
||||
return c.json(
|
||||
{ message: error.message },
|
||||
{
|
||||
status: error.status,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const inviteComplexUserHandler = createInviteComplexUserHandler();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user