Compare commits
153 Commits
main
...
fd4d8b7abd
| Author | SHA1 | Date | |
|---|---|---|---|
| fd4d8b7abd | |||
|
|
3b3def94ab | ||
|
|
1318e3bf57 | ||
|
|
1b5eb253f2 | ||
| ccee416b6f | |||
|
|
c3e26f8f0e | ||
|
|
ef926c63a2 | ||
|
|
dc8a10a612 | ||
|
|
00f0cf511f | ||
|
|
93b3a82638 | ||
|
|
c1c2f18471 | ||
|
|
c278c78e3d | ||
|
|
d767ac3ac7 | ||
|
|
8c3ca0e7e1 | ||
|
|
72f273354e | ||
|
|
ef2ded9d64 | ||
|
|
4c7b825129 | ||
| 339e6a70d7 | |||
|
|
c70541b4f5 | ||
| 89673c3844 | |||
|
|
630dedb507 | ||
|
|
49d2a13672 | ||
|
|
b2f9a14b87 | ||
|
|
b48dd4f15d | ||
|
|
fee0be7e1f | ||
|
|
721ebaa775 | ||
| 2ccff7dcaa | |||
|
|
4b1b06f00f | ||
|
|
af687fe2d8 | ||
| 9875f22d5a | |||
|
|
260d79fc99 | ||
|
|
1210854c22 | ||
|
|
7ca784d5f5 | ||
|
|
e441f15ee4 | ||
|
|
228004a7e0 | ||
| b20b5c2b8b | |||
|
|
457accfbfa | ||
|
|
43287a4baa | ||
|
|
93fea8ecad | ||
|
|
ba7b0322ff | ||
|
|
473686528e | ||
| c1b47674c8 | |||
|
|
85f234b05e | ||
| 50fa4ed9a5 | |||
|
|
07496e6673 | ||
|
|
9045a8c017 | ||
|
|
3e314a9b9a | ||
| bc4716c48f | |||
|
|
0e69759549 | ||
|
|
88ea7e70da | ||
|
|
7a30f9a29b | ||
| 83fa1ea020 | |||
|
|
4544911f0e | ||
|
|
2aaa91444d | ||
| 4d3867614d | |||
|
|
c18db76c7a | ||
|
|
78df95e985 | ||
| 6738db8c60 | |||
|
|
8acb81e6b4 | ||
|
|
91125e82f5 | ||
|
|
e9bd759fa5 | ||
|
|
57416bf53a | ||
|
|
0b6041d146 | ||
|
|
900e6146e7 | ||
|
|
e905052cc1 | ||
|
|
c1d910708a | ||
| b8abf224cf | |||
|
|
b47f00651e | ||
| a9c74d2f9c | |||
|
|
d1b5bea1bc | ||
|
|
ab22ec86ec | ||
|
|
65295236c5 | ||
|
|
f104161bbd | ||
|
|
844dac206c | ||
| be48b4b295 | |||
|
|
1059d767d5 | ||
|
|
7be776f189 | ||
|
|
41a217e8a9 | ||
| bb48d9c164 | |||
|
|
01688cf042 | ||
|
|
b97eb9c8a4 | ||
|
|
c089215835 | ||
|
|
546a020003 | ||
| 38b2294aad | |||
|
|
c9ecdd2c77 | ||
|
|
21d0c27f4d | ||
|
|
20d6018836 | ||
| 7bfa3b390e | |||
|
|
4658b168ed | ||
|
|
6ad4fc9ee9 | ||
|
|
5f2a7fd494 | ||
|
|
0fd72ea1de | ||
| 0aecbfa3dd | |||
|
|
62b7a75093 | ||
|
|
07408dbbbe | ||
| 23e4218f6f | |||
|
|
34cb63364c | ||
|
|
28fd51f926 | ||
|
|
a5e39c94c5 | ||
|
|
4e327b7318 | ||
| c69ea82f26 | |||
|
|
a4075866f8 | ||
|
|
5b53a10bbc | ||
|
|
585e7d2226 | ||
| a1dbab98be | |||
|
|
e0d755bef7 | ||
|
|
a075f13587 | ||
|
|
7fe1eef297 | ||
|
|
20b70c06c1 | ||
| 4588e63fa5 | |||
|
|
400f67b268 | ||
|
|
ea8e3f6a24 | ||
|
|
32c436e772 | ||
|
|
a1ff9f2831 | ||
|
|
b3f1b72da4 | ||
|
|
aabd9a8266 | ||
|
|
f98a0c2c02 | ||
| 6dc8cae3a8 | |||
|
|
34a24ce6c9 | ||
|
|
e5002ce440 | ||
|
|
f158845279 | ||
|
|
bd30b32b49 | ||
|
|
e2299c6d46 | ||
|
|
62d28734fc | ||
|
|
b7c303377a | ||
|
|
1d09716492 | ||
|
|
c409d44765 | ||
|
|
2b95ab37f6 | ||
|
|
ff42f3cd60 | ||
|
|
43df46f520 | ||
|
|
70273f6760 | ||
|
|
566291fb43 | ||
|
|
91dfdce66d | ||
|
|
8210a4bd9b | ||
|
|
839e316226 | ||
|
|
c2f5c0d97c | ||
|
|
1911d5623c | ||
|
|
9ee98a4cb4 | ||
|
|
77004b14b0 | ||
|
|
2d86881f94 | ||
|
|
4dcaae7136 | ||
|
|
3cba2fa485 | ||
|
|
ae90562d88 | ||
|
|
7ca74970fa | ||
|
|
aa2fe41ecc | ||
|
|
11dd12682c | ||
|
|
e58fa6efa2 | ||
|
|
9f14b74936 | ||
|
|
063991770a | ||
|
|
2a0558347a | ||
|
|
58c5ce339b | ||
|
|
30ac0d569a | ||
|
|
8a01606c80 |
391
.agents/skills/interface-design/SKILL.md
Normal file
391
.agents/skills/interface-design/SKILL.md
Normal file
@@ -0,0 +1,391 @@
|
||||
---
|
||||
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
|
||||
67
.agents/skills/interface-design/references/critique.md
Normal file
67
.agents/skills/interface-design/references/critique.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# 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.
|
||||
86
.agents/skills/interface-design/references/example.md
Normal file
86
.agents/skills/interface-design/references/example.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# 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.
|
||||
235
.agents/skills/interface-design/references/principles.md
Normal file
235
.agents/skills/interface-design/references/principles.md
Normal file
@@ -0,0 +1,235 @@
|
||||
# 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.
|
||||
48
.agents/skills/interface-design/references/validation.md
Normal file
48
.agents/skills/interface-design/references/validation.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# 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?
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
node_modules
|
||||
bun.lock
|
||||
.DS_Store
|
||||
# ---> Node
|
||||
# Logs
|
||||
@@ -10,6 +9,7 @@ yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
.vite
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
@@ -78,6 +78,7 @@ web_modules/
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
apps/backend/.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
@@ -139,3 +140,19 @@ dist
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
# Bun
|
||||
bun.lock
|
||||
|
||||
# Generated
|
||||
apps/backend/src/generated
|
||||
apps/backend/prisma.config.js
|
||||
apps/backend/prisma/*.js
|
||||
apps/backend/prisma/*.seed-data.js
|
||||
apps/backend/src/app.js
|
||||
apps/backend/src/lib/*.js
|
||||
apps/backend/src/middlewares/*.js
|
||||
apps/backend/src/modules/**/*.js
|
||||
apps/backend/src/register-routes.js
|
||||
apps/backend/src/server.js
|
||||
apps/backend/src/index.js
|
||||
apps/backend/src/types/*.js
|
||||
|
||||
309
AGENTS.md
Normal file
309
AGENTS.md
Normal file
@@ -0,0 +1,309 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Commands
|
||||
|
||||
```sh
|
||||
# Root (runs both frontend + backend)
|
||||
bun run dev
|
||||
|
||||
# Individual packages
|
||||
bun run dev:frontend
|
||||
bun run dev:backend
|
||||
bun run build:frontend
|
||||
|
||||
# Linting (Biome - ESLint was replaced)
|
||||
bun run lint
|
||||
bun run lint:fix # fixes and formats
|
||||
|
||||
# Prisma (run from backend)
|
||||
bun --filter backend prisma:generate # regenerate client after schema changes
|
||||
bun --filter backend prisma:migrate # apply migrations
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
apps/frontend/ # React + Vite + TanStack Router/Query
|
||||
apps/backend/ # Bun + Hono + Prisma
|
||||
packages/api-contract/ # Shared Zod schemas, types, route definitions
|
||||
```
|
||||
|
||||
**Shared contract pattern:**
|
||||
1. Update `packages/api-contract` first (schemas/types)
|
||||
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.
|
||||
- **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`
|
||||
- **bun.lock must be tracked**: It's in `.gitignore` by default - remove it for Docker builds
|
||||
|
||||
## Linting
|
||||
|
||||
Biome is used (not ESLint). Config in `biome.json`:
|
||||
- Line width: 100
|
||||
- Quote style: single
|
||||
- Semicolons: always
|
||||
- `noUnusedVariables`: warn
|
||||
|
||||
## Environment Variables
|
||||
|
||||
**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)
|
||||
|
||||
**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.
|
||||
63
Dockerfile
Normal file
63
Dockerfile
Normal file
@@ -0,0 +1,63 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
# =============================================================================
|
||||
# Stage 1: Install frontend dependencies
|
||||
# =============================================================================
|
||||
FROM oven/bun:1.3.11 AS deps-frontend
|
||||
WORKDIR /app
|
||||
COPY package.json bun.lock ./
|
||||
COPY apps/frontend/package.json apps/frontend/
|
||||
COPY packages/api-contract/package.json packages/api-contract/
|
||||
RUN bun install
|
||||
|
||||
# =============================================================================
|
||||
# Stage 2: Build Frontend
|
||||
# =============================================================================
|
||||
FROM deps-frontend AS build-frontend
|
||||
WORKDIR /app
|
||||
COPY apps/frontend ./apps/frontend
|
||||
COPY packages ./packages
|
||||
ARG VITE_API_BASE_URL
|
||||
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
||||
RUN bun run build:frontend
|
||||
|
||||
# =============================================================================
|
||||
# Stage 3: Install backend dependencies
|
||||
# =============================================================================
|
||||
FROM oven/bun:1.3.11 AS deps-backend
|
||||
WORKDIR /app
|
||||
COPY package.json bun.lock ./
|
||||
COPY apps/backend/package.json apps/backend/
|
||||
COPY packages/api-contract/package.json packages/api-contract/
|
||||
RUN bun install
|
||||
|
||||
# =============================================================================
|
||||
# Stage 4: Build Backend (prisma generate + tsc)
|
||||
# =============================================================================
|
||||
FROM deps-backend AS build-backend
|
||||
WORKDIR /app
|
||||
ARG DATABASE_URL
|
||||
ENV DATABASE_URL=${DATABASE_URL:-postgresql://dummy:dummy@localhost:5432/dummy}
|
||||
COPY apps/backend ./apps/backend
|
||||
COPY packages ./packages
|
||||
RUN bun --cwd apps/backend prisma:generate
|
||||
RUN bun --cwd apps/backend build
|
||||
|
||||
# =============================================================================
|
||||
# Stage 5: Runner - Production image
|
||||
# =============================================================================
|
||||
FROM oven/bun:1.3.11 AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production HOST=0.0.0.0 PORT=3000
|
||||
|
||||
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 entrypoint.sh /app/entrypoint.sh
|
||||
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["/app/entrypoint.sh"]
|
||||
183
README.md
183
README.md
@@ -1,184 +1,105 @@
|
||||
# Monorepo (Frontend + Backend + Contrato API)
|
||||
# Playzer Monorepo
|
||||
|
||||
Este repositorio contiene:
|
||||
|
||||
- `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.
|
||||
- `apps/frontend`: React + Vite + TanStack Router/Query.
|
||||
- `apps/backend`: Bun + Hono + Prisma + Better Auth.
|
||||
- `packages/api-contract`: contratos Zod/tipos compartidos.
|
||||
|
||||
## Objetivo de este README
|
||||
## Requisitos
|
||||
|
||||
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).
|
||||
- Bun reciente
|
||||
- PostgreSQL disponible
|
||||
|
||||
## Setup rápido
|
||||
|
||||
1. Instalar dependencias desde la raíz:
|
||||
1. Instalar dependencias:
|
||||
|
||||
```sh
|
||||
bun install
|
||||
```
|
||||
|
||||
2. Configurar variables de entorno del backend:
|
||||
2. Configurar backend:
|
||||
|
||||
```sh
|
||||
cp apps/backend/.env.example apps/backend/.env
|
||||
```
|
||||
|
||||
3. Configurar variables de entorno del frontend:
|
||||
3. Configurar frontend:
|
||||
|
||||
```sh
|
||||
cp apps/frontend/.env.example apps/frontend/.env
|
||||
```
|
||||
|
||||
4. Revisar/editar valores en ambos `.env` según tu entorno.
|
||||
|
||||
## Variables de entorno
|
||||
|
||||
### Backend (`apps/backend/.env`)
|
||||
|
||||
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`)
|
||||
|
||||
Variables esperadas:
|
||||
|
||||
- `VITE_SUPABASE_URL`
|
||||
- `VITE_SUPABASE_ANON_KEY`
|
||||
- `VITE_API_BASE_URL` (por defecto: `http://localhost:3000`)
|
||||
|
||||
## Base de datos (Prisma)
|
||||
|
||||
Antes de arrancar backend por primera vez, corré migraciones:
|
||||
4. Ejecutar migraciones:
|
||||
|
||||
```sh
|
||||
bun --filter backend prisma:migrate
|
||||
```
|
||||
|
||||
Si cambiás el schema, regenerá cliente:
|
||||
## Variables de entorno
|
||||
|
||||
```sh
|
||||
bun --filter backend prisma:generate
|
||||
```
|
||||
### Backend (`apps/backend/.env`)
|
||||
|
||||
## Ejecutar en desarrollo
|
||||
- `DATABASE_URL`
|
||||
- `BETTER_AUTH_SECRET`
|
||||
- `BETTER_AUTH_URL`
|
||||
- `APP_BASE_URL`
|
||||
- `CORS_ORIGIN`
|
||||
|
||||
Terminal 1 (backend):
|
||||
### Frontend (`apps/frontend/.env`)
|
||||
|
||||
- `VITE_API_BASE_URL`
|
||||
|
||||
## Desarrollo
|
||||
|
||||
Backend:
|
||||
|
||||
```sh
|
||||
bun run dev:backend
|
||||
```
|
||||
|
||||
Terminal 2 (frontend):
|
||||
Frontend:
|
||||
|
||||
```sh
|
||||
bun run dev:frontend
|
||||
```
|
||||
|
||||
Puertos por defecto:
|
||||
Todo junto:
|
||||
|
||||
- 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
|
||||
```sh
|
||||
bun run dev
|
||||
```
|
||||
|
||||
## Flujo de autenticación (resumen)
|
||||
## Prisma
|
||||
|
||||
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/*`).
|
||||
Regenerar cliente después de cambios de schema:
|
||||
|
||||
## Endpoints principales
|
||||
```sh
|
||||
bun --filter backend prisma:generate
|
||||
```
|
||||
|
||||
- `GET /api/user/profile`
|
||||
- `POST /api/tenants`
|
||||
- `GET /api/tenants/:id`
|
||||
- `PATCH /api/tenants/:id`
|
||||
## Autenticación
|
||||
|
||||
## Convenciones recomendadas para el equipo
|
||||
El proyecto usa **Better Auth** con sesión por cookie.
|
||||
|
||||
- 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.
|
||||
- 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`.
|
||||
|
||||
## Troubleshooting rápido
|
||||
## Deploy (Docker)
|
||||
|
||||
- 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.
|
||||
- Build context: raíz del monorepo (`./`)
|
||||
- Dockerfile: `./Dockerfile`
|
||||
- Build args requeridos:
|
||||
- `DATABASE_URL`
|
||||
- `VITE_API_BASE_URL`
|
||||
- `BETTER_AUTH_SECRET`
|
||||
- `BETTER_AUTH_URL`
|
||||
|
||||
## Primer día sugerido para onboarding
|
||||
## Flujo recomendado de cambios de API
|
||||
|
||||
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.
|
||||
1. Actualizar contrato en `packages/api-contract`.
|
||||
2. Implementar backend en `apps/backend`.
|
||||
3. Consumir contrato desde frontend (`@repo/api-contract`).
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
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
|
||||
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,9 +1,5 @@
|
||||
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
|
||||
BETTER_AUTH_SECRET=your-random-secret
|
||||
BETTER_AUTH_URL=http://localhost:3000
|
||||
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
|
||||
LOG_LEVEL=debug
|
||||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/monorepo
|
||||
@@ -16,3 +12,7 @@ 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,2 +1,6 @@
|
||||
# deps
|
||||
node_modules/
|
||||
prisma.config.prod.ts
|
||||
|
||||
# build output
|
||||
dist/
|
||||
@@ -1,40 +0,0 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM oven/bun:1.3 AS deps
|
||||
WORKDIR /app
|
||||
|
||||
# Workspace manifests first for better layer caching.
|
||||
COPY package.json bun.lock ./
|
||||
COPY apps/backend/package.json apps/backend/package.json
|
||||
COPY packages/api-contract/package.json packages/api-contract/package.json
|
||||
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
FROM deps AS build
|
||||
WORKDIR /app
|
||||
|
||||
COPY apps/backend apps/backend
|
||||
COPY packages/api-contract packages/api-contract
|
||||
|
||||
# Prisma 7 config resolves DATABASE_URL at generate time.
|
||||
ARG DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
|
||||
ENV DATABASE_URL=${DATABASE_URL}
|
||||
|
||||
RUN bun --cwd apps/backend run prisma:generate
|
||||
|
||||
FROM oven/bun:1.3-slim AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY --from=build /app/apps/backend ./apps/backend
|
||||
COPY --from=build /app/packages ./packages
|
||||
COPY package.json bun.lock ./
|
||||
|
||||
WORKDIR /app/apps/backend
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["bun", "run", "start"]
|
||||
@@ -9,3 +9,21 @@ 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/`.
|
||||
|
||||
26
apps/backend/bun.lock
Normal file
26
apps/backend/bun.lock
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "backend",
|
||||
"dependencies": {
|
||||
"hono": "^4.12.9",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
},
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@types/bun": ["@types/bun@1.3.11", "", { "dependencies": { "bun-types": "1.3.11" } }, "sha512-5vPne5QvtpjGpsGYXiFyycfpDF2ECyPcTSsFBMa0fraoxiQyMJ3SmuQIGhzPg2WJuWxVBoxWJ2kClYTcw/4fAg=="],
|
||||
|
||||
"@types/node": ["@types/node@25.5.0", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw=="],
|
||||
|
||||
"bun-types": ["bun-types@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="],
|
||||
|
||||
"hono": ["hono@4.12.9", "", {}, "sha512-wy3T8Zm2bsEvxKZM5w21VdHDDcwVS1yUFFY6i8UobSsKfFceT7TOwhbhfKsDyx7tYQlmRM5FLpIuYvNFyjctiA=="],
|
||||
|
||||
"undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
|
||||
}
|
||||
}
|
||||
3
apps/backend/bunfig.toml
Normal file
3
apps/backend/bunfig.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[test]
|
||||
preload = ["./test/support/prisma.mock.ts"]
|
||||
coverageThreshold = 0.8
|
||||
@@ -3,29 +3,38 @@
|
||||
"scripts": {
|
||||
"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 .",
|
||||
"prisma:generate": "prisma generate",
|
||||
"prisma:migrate": "prisma migrate dev",
|
||||
"prisma:migrate:deploy": "prisma migrate deploy",
|
||||
"prisma:seed": "prisma db seed",
|
||||
"prisma:seed:reset:plans": "bun prisma/reset-plans.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@better-auth/infra": "^0.2.4",
|
||||
"@hono/zod-validator": "^0.7.6",
|
||||
"@prisma/adapter-pg": "^7.6.0",
|
||||
"@prisma/client": "^7",
|
||||
"@repo/api-contract": "workspace:*",
|
||||
"@supabase/supabase-js": "2.101.1",
|
||||
"better-auth": "^1.6.4",
|
||||
"dotenv": "^17.4.1",
|
||||
"hono": "4.12.10",
|
||||
"mailtrap": "^4.5.1",
|
||||
"nodemailer": "^8.0.5",
|
||||
"pg": "^8.20.0",
|
||||
"pino": "10.3.1",
|
||||
"pino-pretty": "13.1.3",
|
||||
"pino-std-serializers": "7.1.0",
|
||||
"prisma": "^7",
|
||||
"uuid": "^13.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
"@types/nodemailer": "^8.0.0",
|
||||
"prisma": "^7"
|
||||
"bun-mock-prisma": "^1.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'dotenv/config'
|
||||
import { defineConfig, env } from 'prisma/config'
|
||||
import 'dotenv/config';
|
||||
import { defineConfig, env } from 'prisma/config';
|
||||
|
||||
export default defineConfig({
|
||||
schema: 'prisma',
|
||||
@@ -10,4 +10,4 @@ export default defineConfig({
|
||||
datasource: {
|
||||
url: env('DATABASE_URL'),
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
73
apps/backend/prisma/auth.prisma
Normal file
73
apps/backend/prisma/auth.prisma
Normal file
@@ -0,0 +1,73 @@
|
||||
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")
|
||||
}
|
||||
@@ -2,6 +2,9 @@ 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)
|
||||
@@ -9,7 +12,9 @@ model Complex {
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
plan Plan? @relation(fields: [planCode], references: [code])
|
||||
users ComplexUser[]
|
||||
invitations ComplexInvitation[]
|
||||
courts Court[]
|
||||
recurringGroups RecurringBookingGroup[]
|
||||
|
||||
@@index([planCode])
|
||||
@@index([complexSlug])
|
||||
@@ -18,11 +23,12 @@ model Complex {
|
||||
|
||||
enum ComplexUserRole {
|
||||
ADMIN
|
||||
EMPLOYEE
|
||||
}
|
||||
|
||||
model ComplexUser {
|
||||
complexId String @map("complex_id") @db.Uuid
|
||||
userId String @map("user_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)
|
||||
@@ -32,3 +38,20 @@ model ComplexUser {
|
||||
@@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")
|
||||
}
|
||||
|
||||
@@ -11,6 +11,13 @@ enum DayOfWeek {
|
||||
enum CourtBookingStatus {
|
||||
CONFIRMED
|
||||
CANCELLED
|
||||
COMPLETED
|
||||
NOSHOW
|
||||
}
|
||||
|
||||
enum RecurringBookingGroupStatus {
|
||||
ACTIVE
|
||||
CANCELLED
|
||||
}
|
||||
|
||||
model Sport {
|
||||
@@ -32,6 +39,8 @@ model Court {
|
||||
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)
|
||||
@@ -39,12 +48,29 @@ model Court {
|
||||
availabilities CourtAvailability[]
|
||||
priceRules CourtPriceRule[]
|
||||
bookings CourtBooking[]
|
||||
maintenances CourtMaintenance[]
|
||||
recurringGroups RecurringBookingGroup[]
|
||||
|
||||
@@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
|
||||
@@ -83,13 +109,60 @@ model CourtBooking {
|
||||
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)
|
||||
recurringGroupId String? @map("recurring_group_id") @db.Uuid
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
recurringGroup RecurringBookingGroup? @relation(fields: [recurringGroupId], references: [id])
|
||||
|
||||
@@unique([courtId, bookingDate, startTime])
|
||||
@@index([courtId, bookingDate])
|
||||
@@index([bookingDate])
|
||||
@@index([recurringGroupId])
|
||||
@@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])
|
||||
}
|
||||
|
||||
model RecurringBookingGroup {
|
||||
id String @id @db.Uuid
|
||||
complexId String @map("complex_id") @db.Uuid
|
||||
courtId String @map("court_id") @db.Uuid
|
||||
startTime String @map("start_time") @db.VarChar(5)
|
||||
endTime String @map("end_time") @db.VarChar(5)
|
||||
dayOfWeek DayOfWeek @map("day_of_week")
|
||||
startDate DateTime @map("start_date") @db.Date
|
||||
endDate DateTime? @map("end_date") @db.Date
|
||||
status RecurringBookingGroupStatus @default(ACTIVE)
|
||||
customerName String @map("customer_name") @db.VarChar(120)
|
||||
customerPhone String @map("customer_phone") @db.VarChar(30)
|
||||
customerEmail String @map("customer_email") @db.VarChar(254)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)
|
||||
complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)
|
||||
bookings CourtBooking[]
|
||||
|
||||
@@index([complexId])
|
||||
@@index([courtId])
|
||||
@@index([status])
|
||||
@@map("recurring_booking_groups")
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TYPE "CourtBookingStatus" ADD VALUE 'COMPLETED';
|
||||
@@ -0,0 +1,4 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "complexes" ADD COLUMN "city" VARCHAR(100),
|
||||
ADD COLUMN "country" VARCHAR(100),
|
||||
ADD COLUMN "state" VARCHAR(100);
|
||||
@@ -0,0 +1,21 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "password_reset_requests" (
|
||||
"id" UUID NOT NULL,
|
||||
"email" TEXT NOT NULL,
|
||||
"otp_hash" TEXT NOT NULL,
|
||||
"otp_expires_at" TIMESTAMP(3) NOT NULL,
|
||||
"otp_attempts" INTEGER NOT NULL DEFAULT 0,
|
||||
"otp_last_sent_at" TIMESTAMP(3) NOT NULL,
|
||||
"otp_resend_count" INTEGER NOT NULL DEFAULT 0,
|
||||
"used_at" TIMESTAMP(3),
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "password_reset_requests_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "password_reset_requests_email_idx" ON "password_reset_requests"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "password_reset_requests_otp_expires_at_idx" ON "password_reset_requests"("otp_expires_at");
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
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;
|
||||
@@ -0,0 +1,18 @@
|
||||
-- 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;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "role" TEXT NOT NULL DEFAULT 'member';
|
||||
@@ -0,0 +1,26 @@
|
||||
-- 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;
|
||||
@@ -0,0 +1,17 @@
|
||||
-- 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");
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
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;
|
||||
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
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;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "phone" TEXT;
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
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";
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
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;
|
||||
@@ -0,0 +1,23 @@
|
||||
-- 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;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "banReason" TEXT,
|
||||
ADD COLUMN "banned" BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN "bannedAt" TIMESTAMP(3);
|
||||
@@ -0,0 +1,6 @@
|
||||
-- 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;
|
||||
@@ -0,0 +1,46 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "RecurringBookingGroupStatus" AS ENUM ('ACTIVE', 'CANCELLED');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "court_bookings" ADD COLUMN "recurring_group_id" UUID;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "recurring_booking_groups" (
|
||||
"id" UUID NOT NULL,
|
||||
"complex_id" UUID NOT NULL,
|
||||
"court_id" UUID NOT NULL,
|
||||
"start_time" VARCHAR(5) NOT NULL,
|
||||
"end_time" VARCHAR(5) NOT NULL,
|
||||
"day_of_week" "DayOfWeek" NOT NULL,
|
||||
"start_date" DATE NOT NULL,
|
||||
"end_date" DATE,
|
||||
"status" "RecurringBookingGroupStatus" NOT NULL DEFAULT 'ACTIVE',
|
||||
"customer_name" VARCHAR(120) NOT NULL,
|
||||
"customer_phone" VARCHAR(30) NOT NULL,
|
||||
"customer_email" VARCHAR(254) NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "recurring_booking_groups_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "recurring_booking_groups_complex_id_idx" ON "recurring_booking_groups"("complex_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "recurring_booking_groups_court_id_idx" ON "recurring_booking_groups"("court_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "recurring_booking_groups_status_idx" ON "recurring_booking_groups"("status");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "court_bookings_recurring_group_id_idx" ON "court_bookings"("recurring_group_id");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "court_bookings" ADD CONSTRAINT "court_bookings_recurring_group_id_fkey" FOREIGN KEY ("recurring_group_id") REFERENCES "recurring_booking_groups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "recurring_booking_groups" ADD CONSTRAINT "recurring_booking_groups_court_id_fkey" FOREIGN KEY ("court_id") REFERENCES "courts"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "recurring_booking_groups" ADD CONSTRAINT "recurring_booking_groups_complex_id_fkey" FOREIGN KEY ("complex_id") REFERENCES "complexes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -1,18 +1,16 @@
|
||||
model OnboardingRequest {
|
||||
model PasswordResetRequest {
|
||||
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")
|
||||
usedAt DateTime? @map("used_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@index([email])
|
||||
@@index([otpExpiresAt])
|
||||
@@map("onboarding_requests")
|
||||
@@map("password_reset_requests")
|
||||
}
|
||||
@@ -4,7 +4,7 @@ export const planSeeds = [
|
||||
name: 'Basic',
|
||||
price: '49.00',
|
||||
rules: {
|
||||
version: 'v1',
|
||||
version: 'v2',
|
||||
limits: {
|
||||
maxCourts: 2,
|
||||
maxBookingsPerDay: 80,
|
||||
@@ -21,6 +21,12 @@ export const planSeeds = [
|
||||
publicBookingPage: true,
|
||||
advancedReports: false,
|
||||
whatsappReminders: false,
|
||||
fixedSlots: false,
|
||||
},
|
||||
pricing: {
|
||||
overrides: {
|
||||
AR: { amount: 14999, currency: 'ARS' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -29,7 +35,7 @@ export const planSeeds = [
|
||||
name: 'Advanced',
|
||||
price: '99.00',
|
||||
rules: {
|
||||
version: 'v1',
|
||||
version: 'v2',
|
||||
limits: {
|
||||
maxCourts: 5,
|
||||
maxBookingsPerDay: 220,
|
||||
@@ -46,6 +52,12 @@ export const planSeeds = [
|
||||
publicBookingPage: true,
|
||||
advancedReports: true,
|
||||
whatsappReminders: true,
|
||||
fixedSlots: true,
|
||||
},
|
||||
pricing: {
|
||||
overrides: {
|
||||
AR: { amount: 29999, currency: 'ARS' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -54,7 +66,7 @@ export const planSeeds = [
|
||||
name: 'Enterprise',
|
||||
price: '199.00',
|
||||
rules: {
|
||||
version: 'v1',
|
||||
version: 'v2',
|
||||
limits: {
|
||||
maxCourts: 20,
|
||||
maxBookingsPerDay: 2000,
|
||||
@@ -71,7 +83,13 @@ export const planSeeds = [
|
||||
publicBookingPage: true,
|
||||
advancedReports: true,
|
||||
whatsappReminders: true,
|
||||
fixedSlots: true,
|
||||
},
|
||||
pricing: {
|
||||
overrides: {
|
||||
AR: { amount: 59999, currency: 'ARS' },
|
||||
},
|
||||
},
|
||||
},
|
||||
] as const
|
||||
},
|
||||
] as const;
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
import 'dotenv/config'
|
||||
import { PrismaPg } from '@prisma/adapter-pg'
|
||||
import { PrismaClient } from '../src/generated/prisma/client'
|
||||
import { planSeeds } from './plans.seed-data'
|
||||
import 'dotenv/config';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
import { PrismaClient } from '../src/generated/prisma/client';
|
||||
import { planSeeds } from './plans.seed-data';
|
||||
|
||||
const databaseUrl = process.env.DATABASE_URL
|
||||
const databaseUrl = process.env.DATABASE_URL;
|
||||
|
||||
if (!databaseUrl) {
|
||||
throw new Error('Missing DATABASE_URL in environment for plan reset.')
|
||||
throw new Error('Missing DATABASE_URL in environment for plan reset.');
|
||||
}
|
||||
|
||||
const adapter = new PrismaPg({
|
||||
connectionString: databaseUrl,
|
||||
})
|
||||
});
|
||||
|
||||
const prisma = new PrismaClient({ adapter })
|
||||
const prisma = new PrismaClient({ adapter });
|
||||
|
||||
async function run() {
|
||||
const complexesUsingPlans = await prisma.complex.count({
|
||||
where: { planCode: { not: null } },
|
||||
})
|
||||
});
|
||||
|
||||
if (complexesUsingPlans > 0) {
|
||||
throw new Error(
|
||||
`No se puede resetear planes: hay ${complexesUsingPlans} complejos con plan asignado.`,
|
||||
)
|
||||
`No se puede resetear planes: hay ${complexesUsingPlans} complejos con plan asignado.`
|
||||
);
|
||||
}
|
||||
|
||||
await prisma.$transaction(async (tx) => {
|
||||
await tx.plan.deleteMany({})
|
||||
await tx.plan.deleteMany({});
|
||||
|
||||
for (const plan of planSeeds) {
|
||||
await tx.plan.create({
|
||||
@@ -37,19 +37,19 @@ async function run() {
|
||||
price: plan.price,
|
||||
rules: plan.rules,
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
console.log('Planes reseteados: BASIC, ADVANCED, ENTERPRISE')
|
||||
console.log('Planes reseteados: BASIC, ADVANCED, ENTERPRISE');
|
||||
}
|
||||
|
||||
run()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect()
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (error) => {
|
||||
console.error(error)
|
||||
await prisma.$disconnect()
|
||||
process.exit(1)
|
||||
})
|
||||
console.error(error);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import 'dotenv/config'
|
||||
import { PrismaPg } from '@prisma/adapter-pg'
|
||||
import { v7 as uuidv7 } from 'uuid'
|
||||
import { PrismaClient } from '../src/generated/prisma/client'
|
||||
import { planSeeds } from './plans.seed-data'
|
||||
import { sportSeeds } from './sports.seed-data'
|
||||
import 'dotenv/config';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
import { v7 as uuidv7 } from 'uuid';
|
||||
import { PrismaClient } from '../src/generated/prisma/client';
|
||||
import { planSeeds } from './plans.seed-data';
|
||||
import { sportSeeds } from './sports.seed-data';
|
||||
|
||||
const databaseUrl = process.env.DATABASE_URL
|
||||
const databaseUrl = process.env.DATABASE_URL;
|
||||
|
||||
if (!databaseUrl) {
|
||||
throw new Error('Missing DATABASE_URL in environment for seeding.')
|
||||
throw new Error('Missing DATABASE_URL in environment for seeding.');
|
||||
}
|
||||
|
||||
const adapter = new PrismaPg({
|
||||
connectionString: databaseUrl,
|
||||
})
|
||||
});
|
||||
|
||||
const prisma = new PrismaClient({ adapter })
|
||||
const prisma = new PrismaClient({ adapter });
|
||||
|
||||
async function run() {
|
||||
for (const plan of planSeeds) {
|
||||
@@ -33,7 +33,7 @@ async function run() {
|
||||
price: plan.price,
|
||||
rules: plan.rules,
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
for (const sport of sportSeeds) {
|
||||
@@ -49,16 +49,16 @@ async function run() {
|
||||
slug: sport.slug,
|
||||
isActive: true,
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
run()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect()
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (error) => {
|
||||
console.error(error)
|
||||
await prisma.$disconnect()
|
||||
process.exit(1)
|
||||
})
|
||||
console.error(error);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -5,4 +5,4 @@ export const sportSeeds = [
|
||||
{ name: 'Pickleball', slug: 'pickleball' },
|
||||
{ name: 'Basquet', slug: 'basquet' },
|
||||
{ name: 'Basquet 3', slug: 'basquet-3' },
|
||||
] as const
|
||||
] as const;
|
||||
|
||||
@@ -1,11 +1 @@
|
||||
model User {
|
||||
id String @id @db.Uuid
|
||||
supabaseUserId String @unique @map("supabase_user_id") @db.Uuid
|
||||
email String @unique
|
||||
fullName String @map("full_name")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
complexes ComplexUser[]
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
// User model is defined in auth.prisma (Better Auth schema).
|
||||
|
||||
@@ -1,36 +1,41 @@
|
||||
import { Hono } from 'hono'
|
||||
import { cors } from 'hono/cors'
|
||||
import { logger } from '@/lib/logger'
|
||||
import type { AppEnv } from '@/types/hono'
|
||||
import { requestId } from 'hono/request-id'
|
||||
import { logger } from '@/lib/logger';
|
||||
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>()
|
||||
const app = new Hono<AppEnv>();
|
||||
|
||||
const allowedOrigins = (
|
||||
Bun.env.CORS_ORIGIN ??
|
||||
'http://localhost:5173,http://127.0.0.1:5173'
|
||||
)
|
||||
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())
|
||||
.filter(Boolean)
|
||||
.filter(Boolean);
|
||||
|
||||
app.use(
|
||||
'*',
|
||||
cors({
|
||||
origin: (origin) => {
|
||||
if (!origin) return allowedOrigins[0] ?? ''
|
||||
return allowedOrigins.includes(origin) ? origin : ''
|
||||
if (!origin) return allowedOrigins[0] ?? '';
|
||||
return allowedOrigins.includes(origin) ? origin : '';
|
||||
},
|
||||
allowHeaders: ['Authorization', 'Content-Type'],
|
||||
allowMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
|
||||
}),
|
||||
)
|
||||
exposeHeaders: ['Content-Length'],
|
||||
maxAge: 600,
|
||||
credentials: true,
|
||||
})
|
||||
);
|
||||
|
||||
app.use('*', async (c, next) => {
|
||||
const start = performance.now()
|
||||
await next()
|
||||
const durationMs = Number((performance.now() - start).toFixed(1))
|
||||
const start = performance.now();
|
||||
await next();
|
||||
const durationMs = Number((performance.now() - start).toFixed(1));
|
||||
|
||||
logger.info(
|
||||
{
|
||||
@@ -38,11 +43,11 @@ export function createApp() {
|
||||
path: c.req.path,
|
||||
status: c.res.status,
|
||||
durationMs,
|
||||
requestId
|
||||
requestId,
|
||||
},
|
||||
'http_request',
|
||||
)
|
||||
})
|
||||
'http_request'
|
||||
);
|
||||
});
|
||||
|
||||
return app
|
||||
return app;
|
||||
}
|
||||
|
||||
401
apps/backend/src/emails/booking-confirmation.ts
Normal file
401
apps/backend/src/emails/booking-confirmation.ts
Normal file
@@ -0,0 +1,401 @@
|
||||
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,26 @@ import * as Prisma from './internal/prismaNamespaceBrowser'
|
||||
export { Prisma }
|
||||
export * as $Enums from './enums'
|
||||
export * from './enums';
|
||||
/**
|
||||
* Model User
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
/**
|
||||
* Model Session
|
||||
*
|
||||
*/
|
||||
export type Session = Prisma.SessionModel
|
||||
/**
|
||||
* Model Account
|
||||
*
|
||||
*/
|
||||
export type Account = Prisma.AccountModel
|
||||
/**
|
||||
* Model Verification
|
||||
*
|
||||
*/
|
||||
export type Verification = Prisma.VerificationModel
|
||||
/**
|
||||
* Model Complex
|
||||
*
|
||||
@@ -27,6 +47,11 @@ export type Complex = Prisma.ComplexModel
|
||||
*
|
||||
*/
|
||||
export type ComplexUser = Prisma.ComplexUserModel
|
||||
/**
|
||||
* Model ComplexInvitation
|
||||
*
|
||||
*/
|
||||
export type ComplexInvitation = Prisma.ComplexInvitationModel
|
||||
/**
|
||||
* Model Sport
|
||||
*
|
||||
@@ -37,6 +62,11 @@ export type Sport = Prisma.SportModel
|
||||
*
|
||||
*/
|
||||
export type Court = Prisma.CourtModel
|
||||
/**
|
||||
* Model CourtMaintenance
|
||||
*
|
||||
*/
|
||||
export type CourtMaintenance = Prisma.CourtMaintenanceModel
|
||||
/**
|
||||
* Model CourtAvailability
|
||||
*
|
||||
@@ -53,17 +83,22 @@ export type CourtPriceRule = Prisma.CourtPriceRuleModel
|
||||
*/
|
||||
export type CourtBooking = Prisma.CourtBookingModel
|
||||
/**
|
||||
* Model OnboardingRequest
|
||||
* Model CourtBookingLog
|
||||
*
|
||||
*/
|
||||
export type OnboardingRequest = Prisma.OnboardingRequestModel
|
||||
export type CourtBookingLog = Prisma.CourtBookingLogModel
|
||||
/**
|
||||
* Model RecurringBookingGroup
|
||||
*
|
||||
*/
|
||||
export type RecurringBookingGroup = Prisma.RecurringBookingGroupModel
|
||||
/**
|
||||
* Model PasswordResetRequest
|
||||
*
|
||||
*/
|
||||
export type PasswordResetRequest = Prisma.PasswordResetRequestModel
|
||||
/**
|
||||
* Model Plan
|
||||
*
|
||||
*/
|
||||
export type Plan = Prisma.PlanModel
|
||||
/**
|
||||
* Model User
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
|
||||
@@ -31,8 +31,8 @@ export * from "./enums"
|
||||
* const prisma = new PrismaClient({
|
||||
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
||||
* })
|
||||
* // Fetch zero or more Complexes
|
||||
* const complexes = await prisma.complex.findMany()
|
||||
* // Fetch zero or more Users
|
||||
* const users = await prisma.user.findMany()
|
||||
* ```
|
||||
*
|
||||
* Read more in our [docs](https://pris.ly/d/client).
|
||||
@@ -41,6 +41,26 @@ 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 User
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
/**
|
||||
* Model Session
|
||||
*
|
||||
*/
|
||||
export type Session = Prisma.SessionModel
|
||||
/**
|
||||
* Model Account
|
||||
*
|
||||
*/
|
||||
export type Account = Prisma.AccountModel
|
||||
/**
|
||||
* Model Verification
|
||||
*
|
||||
*/
|
||||
export type Verification = Prisma.VerificationModel
|
||||
/**
|
||||
* Model Complex
|
||||
*
|
||||
@@ -51,6 +71,11 @@ export type Complex = Prisma.ComplexModel
|
||||
*
|
||||
*/
|
||||
export type ComplexUser = Prisma.ComplexUserModel
|
||||
/**
|
||||
* Model ComplexInvitation
|
||||
*
|
||||
*/
|
||||
export type ComplexInvitation = Prisma.ComplexInvitationModel
|
||||
/**
|
||||
* Model Sport
|
||||
*
|
||||
@@ -61,6 +86,11 @@ export type Sport = Prisma.SportModel
|
||||
*
|
||||
*/
|
||||
export type Court = Prisma.CourtModel
|
||||
/**
|
||||
* Model CourtMaintenance
|
||||
*
|
||||
*/
|
||||
export type CourtMaintenance = Prisma.CourtMaintenanceModel
|
||||
/**
|
||||
* Model CourtAvailability
|
||||
*
|
||||
@@ -77,17 +107,22 @@ export type CourtPriceRule = Prisma.CourtPriceRuleModel
|
||||
*/
|
||||
export type CourtBooking = Prisma.CourtBookingModel
|
||||
/**
|
||||
* Model OnboardingRequest
|
||||
* Model CourtBookingLog
|
||||
*
|
||||
*/
|
||||
export type OnboardingRequest = Prisma.OnboardingRequestModel
|
||||
export type CourtBookingLog = Prisma.CourtBookingLogModel
|
||||
/**
|
||||
* Model RecurringBookingGroup
|
||||
*
|
||||
*/
|
||||
export type RecurringBookingGroup = Prisma.RecurringBookingGroupModel
|
||||
/**
|
||||
* Model PasswordResetRequest
|
||||
*
|
||||
*/
|
||||
export type PasswordResetRequest = Prisma.PasswordResetRequestModel
|
||||
/**
|
||||
* Model Plan
|
||||
*
|
||||
*/
|
||||
export type Plan = Prisma.PlanModel
|
||||
/**
|
||||
* Model User
|
||||
*
|
||||
*/
|
||||
export type User = Prisma.UserModel
|
||||
|
||||
@@ -14,18 +14,6 @@ import * as $Enums from "./enums"
|
||||
import type * as Prisma from "./internal/prismaNamespace"
|
||||
|
||||
|
||||
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 StringFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
@@ -41,6 +29,11 @@ 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 StringNullableFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
@@ -56,6 +49,17 @@ export type StringNullableFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null
|
||||
}
|
||||
|
||||
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 DateTimeFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
@@ -72,21 +76,6 @@ export type SortOrderInput = {
|
||||
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 StringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
@@ -105,6 +94,14 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type BoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
@@ -123,6 +120,20 @@ 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>
|
||||
@@ -137,6 +148,60 @@ export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_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>
|
||||
}
|
||||
|
||||
export type EnumComplexUserRoleFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.ComplexUserRole | Prisma.EnumComplexUserRoleFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel>
|
||||
@@ -154,19 +219,6 @@ export type EnumComplexUserRoleWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type BoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
}
|
||||
|
||||
export type BoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type IntFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
|
||||
@@ -262,6 +314,18 @@ export type EnumCourtBookingStatusFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> | $Enums.CourtBookingStatus
|
||||
}
|
||||
|
||||
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 EnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CourtBookingStatus | Prisma.EnumCourtBookingStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel>
|
||||
@@ -272,29 +336,36 @@ export type EnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
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 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 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 EnumRecurringBookingGroupStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.RecurringBookingGroupStatus | Prisma.EnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumRecurringBookingGroupStatusFilter<$PrismaModel> | $Enums.RecurringBookingGroupStatus
|
||||
}
|
||||
|
||||
export type EnumRecurringBookingGroupStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.RecurringBookingGroupStatus | Prisma.EnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumRecurringBookingGroupStatusWithAggregatesFilter<$PrismaModel> | $Enums.RecurringBookingGroupStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumRecurringBookingGroupStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumRecurringBookingGroupStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type JsonFilter<$PrismaModel = never> =
|
||||
@@ -348,17 +419,6 @@ export type JsonWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedJsonFilter<$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 NestedStringFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
@@ -373,6 +433,11 @@ 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
|
||||
@@ -387,6 +452,17 @@ export type NestedStringNullableFilter<$PrismaModel = never> = {
|
||||
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 NestedDateTimeFilter<$PrismaModel = never> = {
|
||||
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
|
||||
in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel>
|
||||
@@ -398,31 +474,6 @@ export type NestedDateTimeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | 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>
|
||||
}
|
||||
|
||||
export type NestedIntFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
|
||||
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
|
||||
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel>
|
||||
@@ -440,6 +491,25 @@ export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedIntFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
|
||||
notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel>
|
||||
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
|
||||
in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null
|
||||
@@ -468,6 +538,20 @@ 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>
|
||||
@@ -482,6 +566,58 @@ export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_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>
|
||||
}
|
||||
|
||||
export type NestedEnumComplexUserRoleFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.ComplexUserRole | Prisma.EnumComplexUserRoleFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel>
|
||||
@@ -499,19 +635,6 @@ export type NestedEnumComplexUserRoleWithAggregatesFilter<$PrismaModel = never>
|
||||
_max?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedBoolFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean
|
||||
}
|
||||
|
||||
export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBoolFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBoolFilter<$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>
|
||||
@@ -607,6 +730,17 @@ export type NestedEnumCourtBookingStatusFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> | $Enums.CourtBookingStatus
|
||||
}
|
||||
|
||||
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 NestedEnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.CourtBookingStatus | Prisma.EnumCourtBookingStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel>
|
||||
@@ -617,29 +751,35 @@ export type NestedEnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = neve
|
||||
_max?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
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 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>
|
||||
}
|
||||
|
||||
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 NestedEnumRecurringBookingGroupStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.RecurringBookingGroupStatus | Prisma.EnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumRecurringBookingGroupStatusFilter<$PrismaModel> | $Enums.RecurringBookingGroupStatus
|
||||
}
|
||||
|
||||
export type NestedEnumRecurringBookingGroupStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.RecurringBookingGroupStatus | Prisma.EnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
notIn?: $Enums.RecurringBookingGroupStatus[] | Prisma.ListEnumRecurringBookingGroupStatusFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedEnumRecurringBookingGroupStatusWithAggregatesFilter<$PrismaModel> | $Enums.RecurringBookingGroupStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumRecurringBookingGroupStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumRecurringBookingGroupStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedJsonFilter<$PrismaModel = never> =
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
*/
|
||||
|
||||
export const ComplexUserRole = {
|
||||
ADMIN: 'ADMIN'
|
||||
ADMIN: 'ADMIN',
|
||||
EMPLOYEE: 'EMPLOYEE'
|
||||
} as const
|
||||
|
||||
export type ComplexUserRole = (typeof ComplexUserRole)[keyof typeof ComplexUserRole]
|
||||
@@ -31,7 +32,17 @@ export type DayOfWeek = (typeof DayOfWeek)[keyof typeof DayOfWeek]
|
||||
|
||||
export const CourtBookingStatus = {
|
||||
CONFIRMED: 'CONFIRMED',
|
||||
CANCELLED: 'CANCELLED'
|
||||
CANCELLED: 'CANCELLED',
|
||||
COMPLETED: 'COMPLETED',
|
||||
NOSHOW: 'NOSHOW'
|
||||
} as const
|
||||
|
||||
export type CourtBookingStatus = (typeof CourtBookingStatus)[keyof typeof CourtBookingStatus]
|
||||
|
||||
|
||||
export const RecurringBookingGroupStatus = {
|
||||
ACTIVE: 'ACTIVE',
|
||||
CANCELLED: 'CANCELLED'
|
||||
} as const
|
||||
|
||||
export type RecurringBookingGroupStatus = (typeof RecurringBookingGroupStatus)[keyof typeof RecurringBookingGroupStatus]
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -51,16 +51,23 @@ export const AnyNull = runtime.AnyNull
|
||||
|
||||
|
||||
export const ModelName = {
|
||||
User: 'User',
|
||||
Session: 'Session',
|
||||
Account: 'Account',
|
||||
Verification: 'Verification',
|
||||
Complex: 'Complex',
|
||||
ComplexUser: 'ComplexUser',
|
||||
ComplexInvitation: 'ComplexInvitation',
|
||||
Sport: 'Sport',
|
||||
Court: 'Court',
|
||||
CourtMaintenance: 'CourtMaintenance',
|
||||
CourtAvailability: 'CourtAvailability',
|
||||
CourtPriceRule: 'CourtPriceRule',
|
||||
CourtBooking: 'CourtBooking',
|
||||
OnboardingRequest: 'OnboardingRequest',
|
||||
Plan: 'Plan',
|
||||
User: 'User'
|
||||
CourtBookingLog: 'CourtBookingLog',
|
||||
RecurringBookingGroup: 'RecurringBookingGroup',
|
||||
PasswordResetRequest: 'PasswordResetRequest',
|
||||
Plan: 'Plan'
|
||||
} as const
|
||||
|
||||
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
|
||||
@@ -79,10 +86,81 @@ export const TransactionIsolationLevel = runtime.makeStrictEnum({
|
||||
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
|
||||
|
||||
|
||||
export const UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
email: 'email',
|
||||
emailVerified: 'emailVerified',
|
||||
image: 'image',
|
||||
phone: 'phone',
|
||||
banned: 'banned',
|
||||
bannedAt: 'bannedAt',
|
||||
banReason: 'banReason',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
role: 'role'
|
||||
} 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 const ComplexScalarFieldEnum = {
|
||||
id: 'id',
|
||||
complexName: 'complexName',
|
||||
physicalAddress: 'physicalAddress',
|
||||
city: 'city',
|
||||
state: 'state',
|
||||
country: 'country',
|
||||
complexSlug: 'complexSlug',
|
||||
adminEmail: 'adminEmail',
|
||||
planCode: 'planCode',
|
||||
@@ -103,6 +181,21 @@ export const ComplexUserScalarFieldEnum = {
|
||||
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 const SportScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
@@ -122,6 +215,8 @@ export const CourtScalarFieldEnum = {
|
||||
name: 'name',
|
||||
slotDurationMinutes: 'slotDurationMinutes',
|
||||
basePrice: 'basePrice',
|
||||
isUnderMaintenance: 'isUnderMaintenance',
|
||||
maintenanceReason: 'maintenanceReason',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
@@ -129,6 +224,20 @@ 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',
|
||||
@@ -165,7 +274,9 @@ export const CourtBookingScalarFieldEnum = {
|
||||
endTime: 'endTime',
|
||||
customerName: 'customerName',
|
||||
customerPhone: 'customerPhone',
|
||||
customerEmail: 'customerEmail',
|
||||
status: 'status',
|
||||
recurringGroupId: 'recurringGroupId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
@@ -173,22 +284,58 @@ export const CourtBookingScalarFieldEnum = {
|
||||
export type CourtBookingScalarFieldEnum = (typeof CourtBookingScalarFieldEnum)[keyof typeof CourtBookingScalarFieldEnum]
|
||||
|
||||
|
||||
export const OnboardingRequestScalarFieldEnum = {
|
||||
export const CourtBookingLogScalarFieldEnum = {
|
||||
id: 'id',
|
||||
bookingCode: 'bookingCode',
|
||||
courtId: 'courtId',
|
||||
bookingDate: 'bookingDate',
|
||||
startTime: 'startTime',
|
||||
endTime: 'endTime',
|
||||
previousStatus: 'previousStatus',
|
||||
newStatus: 'newStatus',
|
||||
customerName: 'customerName',
|
||||
customerPhone: 'customerPhone',
|
||||
customerEmail: 'customerEmail',
|
||||
changedAt: 'changedAt'
|
||||
} as const
|
||||
|
||||
export type CourtBookingLogScalarFieldEnum = (typeof CourtBookingLogScalarFieldEnum)[keyof typeof CourtBookingLogScalarFieldEnum]
|
||||
|
||||
|
||||
export const RecurringBookingGroupScalarFieldEnum = {
|
||||
id: 'id',
|
||||
complexId: 'complexId',
|
||||
courtId: 'courtId',
|
||||
startTime: 'startTime',
|
||||
endTime: 'endTime',
|
||||
dayOfWeek: 'dayOfWeek',
|
||||
startDate: 'startDate',
|
||||
endDate: 'endDate',
|
||||
status: 'status',
|
||||
customerName: 'customerName',
|
||||
customerPhone: 'customerPhone',
|
||||
customerEmail: 'customerEmail',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type RecurringBookingGroupScalarFieldEnum = (typeof RecurringBookingGroupScalarFieldEnum)[keyof typeof RecurringBookingGroupScalarFieldEnum]
|
||||
|
||||
|
||||
export const PasswordResetRequestScalarFieldEnum = {
|
||||
id: 'id',
|
||||
fullName: 'fullName',
|
||||
email: 'email',
|
||||
otpHash: 'otpHash',
|
||||
otpExpiresAt: 'otpExpiresAt',
|
||||
otpAttempts: 'otpAttempts',
|
||||
otpLastSentAt: 'otpLastSentAt',
|
||||
otpResendCount: 'otpResendCount',
|
||||
emailVerifiedAt: 'emailVerifiedAt',
|
||||
completedAt: 'completedAt',
|
||||
usedAt: 'usedAt',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type OnboardingRequestScalarFieldEnum = (typeof OnboardingRequestScalarFieldEnum)[keyof typeof OnboardingRequestScalarFieldEnum]
|
||||
export type PasswordResetRequestScalarFieldEnum = (typeof PasswordResetRequestScalarFieldEnum)[keyof typeof PasswordResetRequestScalarFieldEnum]
|
||||
|
||||
|
||||
export const PlanScalarFieldEnum = {
|
||||
@@ -202,18 +349,6 @@ export const PlanScalarFieldEnum = {
|
||||
export type PlanScalarFieldEnum = (typeof PlanScalarFieldEnum)[keyof typeof PlanScalarFieldEnum]
|
||||
|
||||
|
||||
export const UserScalarFieldEnum = {
|
||||
id: 'id',
|
||||
supabaseUserId: 'supabaseUserId',
|
||||
email: 'email',
|
||||
fullName: 'fullName',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt'
|
||||
} as const
|
||||
|
||||
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
|
||||
|
||||
|
||||
export const SortOrder = {
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
|
||||
@@ -8,14 +8,21 @@
|
||||
*
|
||||
* 🟢 You can import this file directly.
|
||||
*/
|
||||
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/OnboardingRequest'
|
||||
export type * from './models/CourtBookingLog'
|
||||
export type * from './models/RecurringBookingGroup'
|
||||
export type * from './models/PasswordResetRequest'
|
||||
export type * from './models/Plan'
|
||||
export type * from './models/User'
|
||||
export type * from './commonInputTypes'
|
||||
@@ -28,6 +28,9 @@ export type ComplexMinAggregateOutputType = {
|
||||
id: string | null
|
||||
complexName: string | null
|
||||
physicalAddress: string | null
|
||||
city: string | null
|
||||
state: string | null
|
||||
country: string | null
|
||||
complexSlug: string | null
|
||||
adminEmail: string | null
|
||||
planCode: string | null
|
||||
@@ -39,6 +42,9 @@ export type ComplexMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
complexName: string | null
|
||||
physicalAddress: string | null
|
||||
city: string | null
|
||||
state: string | null
|
||||
country: string | null
|
||||
complexSlug: string | null
|
||||
adminEmail: string | null
|
||||
planCode: string | null
|
||||
@@ -50,6 +56,9 @@ export type ComplexCountAggregateOutputType = {
|
||||
id: number
|
||||
complexName: number
|
||||
physicalAddress: number
|
||||
city: number
|
||||
state: number
|
||||
country: number
|
||||
complexSlug: number
|
||||
adminEmail: number
|
||||
planCode: number
|
||||
@@ -63,6 +72,9 @@ export type ComplexMinAggregateInputType = {
|
||||
id?: true
|
||||
complexName?: true
|
||||
physicalAddress?: true
|
||||
city?: true
|
||||
state?: true
|
||||
country?: true
|
||||
complexSlug?: true
|
||||
adminEmail?: true
|
||||
planCode?: true
|
||||
@@ -74,6 +86,9 @@ export type ComplexMaxAggregateInputType = {
|
||||
id?: true
|
||||
complexName?: true
|
||||
physicalAddress?: true
|
||||
city?: true
|
||||
state?: true
|
||||
country?: true
|
||||
complexSlug?: true
|
||||
adminEmail?: true
|
||||
planCode?: true
|
||||
@@ -85,6 +100,9 @@ export type ComplexCountAggregateInputType = {
|
||||
id?: true
|
||||
complexName?: true
|
||||
physicalAddress?: true
|
||||
city?: true
|
||||
state?: true
|
||||
country?: true
|
||||
complexSlug?: true
|
||||
adminEmail?: true
|
||||
planCode?: true
|
||||
@@ -169,6 +187,9 @@ export type ComplexGroupByOutputType = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress: string | null
|
||||
city: string | null
|
||||
state: string | null
|
||||
country: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode: string | null
|
||||
@@ -201,6 +222,9 @@ export type ComplexWhereInput = {
|
||||
id?: Prisma.UuidFilter<"Complex"> | string
|
||||
complexName?: Prisma.StringFilter<"Complex"> | string
|
||||
physicalAddress?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
city?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
state?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
country?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
complexSlug?: Prisma.StringFilter<"Complex"> | string
|
||||
adminEmail?: Prisma.StringFilter<"Complex"> | string
|
||||
planCode?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
@@ -208,13 +232,18 @@ export type ComplexWhereInput = {
|
||||
updatedAt?: Prisma.DateTimeFilter<"Complex"> | Date | string
|
||||
plan?: Prisma.XOR<Prisma.PlanNullableScalarRelationFilter, Prisma.PlanWhereInput> | null
|
||||
users?: Prisma.ComplexUserListRelationFilter
|
||||
invitations?: Prisma.ComplexInvitationListRelationFilter
|
||||
courts?: Prisma.CourtListRelationFilter
|
||||
recurringGroups?: Prisma.RecurringBookingGroupListRelationFilter
|
||||
}
|
||||
|
||||
export type ComplexOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexName?: Prisma.SortOrder
|
||||
physicalAddress?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
city?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
state?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
country?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
complexSlug?: Prisma.SortOrder
|
||||
adminEmail?: Prisma.SortOrder
|
||||
planCode?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
@@ -222,7 +251,9 @@ export type ComplexOrderByWithRelationInput = {
|
||||
updatedAt?: Prisma.SortOrder
|
||||
plan?: Prisma.PlanOrderByWithRelationInput
|
||||
users?: Prisma.ComplexUserOrderByRelationAggregateInput
|
||||
invitations?: Prisma.ComplexInvitationOrderByRelationAggregateInput
|
||||
courts?: Prisma.CourtOrderByRelationAggregateInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type ComplexWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -233,19 +264,27 @@ export type ComplexWhereUniqueInput = Prisma.AtLeast<{
|
||||
NOT?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[]
|
||||
complexName?: Prisma.StringFilter<"Complex"> | string
|
||||
physicalAddress?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
city?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
state?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
country?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
adminEmail?: Prisma.StringFilter<"Complex"> | string
|
||||
planCode?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"Complex"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"Complex"> | Date | string
|
||||
plan?: Prisma.XOR<Prisma.PlanNullableScalarRelationFilter, Prisma.PlanWhereInput> | null
|
||||
users?: Prisma.ComplexUserListRelationFilter
|
||||
invitations?: Prisma.ComplexInvitationListRelationFilter
|
||||
courts?: Prisma.CourtListRelationFilter
|
||||
recurringGroups?: Prisma.RecurringBookingGroupListRelationFilter
|
||||
}, "id" | "complexSlug">
|
||||
|
||||
export type ComplexOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexName?: Prisma.SortOrder
|
||||
physicalAddress?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
city?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
state?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
country?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
complexSlug?: Prisma.SortOrder
|
||||
adminEmail?: Prisma.SortOrder
|
||||
planCode?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
@@ -263,6 +302,9 @@ export type ComplexScalarWhereWithAggregatesInput = {
|
||||
id?: Prisma.UuidWithAggregatesFilter<"Complex"> | string
|
||||
complexName?: Prisma.StringWithAggregatesFilter<"Complex"> | string
|
||||
physicalAddress?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null
|
||||
city?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null
|
||||
state?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null
|
||||
country?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null
|
||||
complexSlug?: Prisma.StringWithAggregatesFilter<"Complex"> | string
|
||||
adminEmail?: Prisma.StringWithAggregatesFilter<"Complex"> | string
|
||||
planCode?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null
|
||||
@@ -274,58 +316,81 @@ export type ComplexCreateInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput
|
||||
users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput
|
||||
users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateManyInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode?: string | null
|
||||
@@ -337,6 +402,9 @@ export type ComplexUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -347,6 +415,9 @@ export type ComplexUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -358,6 +429,9 @@ export type ComplexCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexName?: Prisma.SortOrder
|
||||
physicalAddress?: Prisma.SortOrder
|
||||
city?: Prisma.SortOrder
|
||||
state?: Prisma.SortOrder
|
||||
country?: Prisma.SortOrder
|
||||
complexSlug?: Prisma.SortOrder
|
||||
adminEmail?: Prisma.SortOrder
|
||||
planCode?: Prisma.SortOrder
|
||||
@@ -369,6 +443,9 @@ export type ComplexMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexName?: Prisma.SortOrder
|
||||
physicalAddress?: Prisma.SortOrder
|
||||
city?: Prisma.SortOrder
|
||||
state?: Prisma.SortOrder
|
||||
country?: Prisma.SortOrder
|
||||
complexSlug?: Prisma.SortOrder
|
||||
adminEmail?: Prisma.SortOrder
|
||||
planCode?: Prisma.SortOrder
|
||||
@@ -380,6 +457,9 @@ export type ComplexMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
complexName?: Prisma.SortOrder
|
||||
physicalAddress?: Prisma.SortOrder
|
||||
city?: Prisma.SortOrder
|
||||
state?: Prisma.SortOrder
|
||||
country?: Prisma.SortOrder
|
||||
complexSlug?: Prisma.SortOrder
|
||||
adminEmail?: Prisma.SortOrder
|
||||
planCode?: Prisma.SortOrder
|
||||
@@ -402,18 +482,6 @@ export type ComplexOrderByRelationAggregateInput = {
|
||||
_count?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type StringFieldUpdateOperationsInput = {
|
||||
set?: string
|
||||
}
|
||||
|
||||
export type NullableStringFieldUpdateOperationsInput = {
|
||||
set?: string | null
|
||||
}
|
||||
|
||||
export type DateTimeFieldUpdateOperationsInput = {
|
||||
set?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexCreateNestedOneWithoutUsersInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexCreateWithoutUsersInput, Prisma.ComplexUncheckedCreateWithoutUsersInput>
|
||||
connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutUsersInput
|
||||
@@ -428,6 +496,20 @@ export type ComplexUpdateOneRequiredWithoutUsersNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ComplexUpdateToOneWithWhereWithoutUsersInput, Prisma.ComplexUpdateWithoutUsersInput>, Prisma.ComplexUncheckedUpdateWithoutUsersInput>
|
||||
}
|
||||
|
||||
export type ComplexCreateNestedOneWithoutInvitationsInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexCreateWithoutInvitationsInput, Prisma.ComplexUncheckedCreateWithoutInvitationsInput>
|
||||
connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutInvitationsInput
|
||||
connect?: Prisma.ComplexWhereUniqueInput
|
||||
}
|
||||
|
||||
export type ComplexUpdateOneRequiredWithoutInvitationsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexCreateWithoutInvitationsInput, Prisma.ComplexUncheckedCreateWithoutInvitationsInput>
|
||||
connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutInvitationsInput
|
||||
upsert?: Prisma.ComplexUpsertWithoutInvitationsInput
|
||||
connect?: Prisma.ComplexWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ComplexUpdateToOneWithWhereWithoutInvitationsInput, Prisma.ComplexUpdateWithoutInvitationsInput>, Prisma.ComplexUncheckedUpdateWithoutInvitationsInput>
|
||||
}
|
||||
|
||||
export type ComplexCreateNestedOneWithoutCourtsInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexCreateWithoutCourtsInput, Prisma.ComplexUncheckedCreateWithoutCourtsInput>
|
||||
connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutCourtsInput
|
||||
@@ -442,6 +524,20 @@ export type ComplexUpdateOneRequiredWithoutCourtsNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ComplexUpdateToOneWithWhereWithoutCourtsInput, Prisma.ComplexUpdateWithoutCourtsInput>, Prisma.ComplexUncheckedUpdateWithoutCourtsInput>
|
||||
}
|
||||
|
||||
export type ComplexCreateNestedOneWithoutRecurringGroupsInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexCreateWithoutRecurringGroupsInput, Prisma.ComplexUncheckedCreateWithoutRecurringGroupsInput>
|
||||
connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutRecurringGroupsInput
|
||||
connect?: Prisma.ComplexWhereUniqueInput
|
||||
}
|
||||
|
||||
export type ComplexUpdateOneRequiredWithoutRecurringGroupsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexCreateWithoutRecurringGroupsInput, Prisma.ComplexUncheckedCreateWithoutRecurringGroupsInput>
|
||||
connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutRecurringGroupsInput
|
||||
upsert?: Prisma.ComplexUpsertWithoutRecurringGroupsInput
|
||||
connect?: Prisma.ComplexWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ComplexUpdateToOneWithWhereWithoutRecurringGroupsInput, Prisma.ComplexUpdateWithoutRecurringGroupsInput>, Prisma.ComplexUncheckedUpdateWithoutRecurringGroupsInput>
|
||||
}
|
||||
|
||||
export type ComplexCreateNestedManyWithoutPlanInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexCreateWithoutPlanInput, Prisma.ComplexUncheckedCreateWithoutPlanInput> | Prisma.ComplexCreateWithoutPlanInput[] | Prisma.ComplexUncheckedCreateWithoutPlanInput[]
|
||||
connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutPlanInput | Prisma.ComplexCreateOrConnectWithoutPlanInput[]
|
||||
@@ -488,24 +584,34 @@ export type ComplexCreateWithoutUsersInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput
|
||||
invitations?: Prisma.ComplexInvitationCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutUsersInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
invitations?: Prisma.ComplexInvitationUncheckedCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutUsersInput = {
|
||||
@@ -528,48 +634,152 @@ export type ComplexUpdateWithoutUsersInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutUsersInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
invitations?: Prisma.ComplexInvitationUncheckedUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateWithoutCourtsInput = {
|
||||
export type ComplexCreateWithoutInvitationsInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput
|
||||
users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutCourtsInput = {
|
||||
export type ComplexUncheckedCreateWithoutInvitationsInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutInvitationsInput = {
|
||||
where: Prisma.ComplexWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ComplexCreateWithoutInvitationsInput, Prisma.ComplexUncheckedCreateWithoutInvitationsInput>
|
||||
}
|
||||
|
||||
export type ComplexUpsertWithoutInvitationsInput = {
|
||||
update: Prisma.XOR<Prisma.ComplexUpdateWithoutInvitationsInput, Prisma.ComplexUncheckedUpdateWithoutInvitationsInput>
|
||||
create: Prisma.XOR<Prisma.ComplexCreateWithoutInvitationsInput, Prisma.ComplexUncheckedCreateWithoutInvitationsInput>
|
||||
where?: Prisma.ComplexWhereInput
|
||||
}
|
||||
|
||||
export type ComplexUpdateToOneWithWhereWithoutInvitationsInput = {
|
||||
where?: Prisma.ComplexWhereInput
|
||||
data: Prisma.XOR<Prisma.ComplexUpdateWithoutInvitationsInput, Prisma.ComplexUncheckedUpdateWithoutInvitationsInput>
|
||||
}
|
||||
|
||||
export type ComplexUpdateWithoutInvitationsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput
|
||||
users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutInvitationsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateWithoutCourtsInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput
|
||||
users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutCourtsInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutCourtsInput = {
|
||||
@@ -592,48 +802,152 @@ export type ComplexUpdateWithoutCourtsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput
|
||||
users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutCourtsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateWithoutRecurringGroupsInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput
|
||||
users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutRecurringGroupsInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutRecurringGroupsInput = {
|
||||
where: Prisma.ComplexWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ComplexCreateWithoutRecurringGroupsInput, Prisma.ComplexUncheckedCreateWithoutRecurringGroupsInput>
|
||||
}
|
||||
|
||||
export type ComplexUpsertWithoutRecurringGroupsInput = {
|
||||
update: Prisma.XOR<Prisma.ComplexUpdateWithoutRecurringGroupsInput, Prisma.ComplexUncheckedUpdateWithoutRecurringGroupsInput>
|
||||
create: Prisma.XOR<Prisma.ComplexCreateWithoutRecurringGroupsInput, Prisma.ComplexUncheckedCreateWithoutRecurringGroupsInput>
|
||||
where?: Prisma.ComplexWhereInput
|
||||
}
|
||||
|
||||
export type ComplexUpdateToOneWithWhereWithoutRecurringGroupsInput = {
|
||||
where?: Prisma.ComplexWhereInput
|
||||
data: Prisma.XOR<Prisma.ComplexUpdateWithoutRecurringGroupsInput, Prisma.ComplexUncheckedUpdateWithoutRecurringGroupsInput>
|
||||
}
|
||||
|
||||
export type ComplexUpdateWithoutRecurringGroupsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput
|
||||
users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutRecurringGroupsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexCreateWithoutPlanInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedCreateWithoutPlanInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedCreateNestedManyWithoutComplexInput
|
||||
courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutComplexInput
|
||||
}
|
||||
|
||||
export type ComplexCreateOrConnectWithoutPlanInput = {
|
||||
@@ -669,6 +983,9 @@ export type ComplexScalarWhereInput = {
|
||||
id?: Prisma.UuidFilter<"Complex"> | string
|
||||
complexName?: Prisma.StringFilter<"Complex"> | string
|
||||
physicalAddress?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
city?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
state?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
country?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
complexSlug?: Prisma.StringFilter<"Complex"> | string
|
||||
adminEmail?: Prisma.StringFilter<"Complex"> | string
|
||||
planCode?: Prisma.StringNullableFilter<"Complex"> | string | null
|
||||
@@ -680,6 +997,9 @@ export type ComplexCreateManyPlanInput = {
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress?: string | null
|
||||
city?: string | null
|
||||
state?: string | null
|
||||
country?: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
createdAt?: Date | string
|
||||
@@ -690,30 +1010,43 @@ export type ComplexUpdateWithoutPlanInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateWithoutPlanInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput
|
||||
invitations?: Prisma.ComplexInvitationUncheckedUpdateManyWithoutComplexNestedInput
|
||||
courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutComplexNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUncheckedUpdateManyWithoutPlanInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
complexName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
complexSlug?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
adminEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -727,12 +1060,16 @@ export type ComplexUncheckedUpdateManyWithoutPlanInput = {
|
||||
|
||||
export type ComplexCountOutputType = {
|
||||
users: number
|
||||
invitations: number
|
||||
courts: number
|
||||
recurringGroups: number
|
||||
}
|
||||
|
||||
export type ComplexCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
users?: boolean | ComplexCountOutputTypeCountUsersArgs
|
||||
invitations?: boolean | ComplexCountOutputTypeCountInvitationsArgs
|
||||
courts?: boolean | ComplexCountOutputTypeCountCourtsArgs
|
||||
recurringGroups?: boolean | ComplexCountOutputTypeCountRecurringGroupsArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -752,6 +1089,13 @@ export type ComplexCountOutputTypeCountUsersArgs<ExtArgs extends runtime.Types.E
|
||||
where?: Prisma.ComplexUserWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ComplexCountOutputType without action
|
||||
*/
|
||||
export type ComplexCountOutputTypeCountInvitationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ComplexInvitationWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ComplexCountOutputType without action
|
||||
*/
|
||||
@@ -759,11 +1103,21 @@ export type ComplexCountOutputTypeCountCourtsArgs<ExtArgs extends runtime.Types.
|
||||
where?: Prisma.CourtWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* ComplexCountOutputType without action
|
||||
*/
|
||||
export type ComplexCountOutputTypeCountRecurringGroupsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.RecurringBookingGroupWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type ComplexSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
complexName?: boolean
|
||||
physicalAddress?: boolean
|
||||
city?: boolean
|
||||
state?: boolean
|
||||
country?: boolean
|
||||
complexSlug?: boolean
|
||||
adminEmail?: boolean
|
||||
planCode?: boolean
|
||||
@@ -771,7 +1125,9 @@ export type ComplexSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
updatedAt?: boolean
|
||||
plan?: boolean | Prisma.Complex$planArgs<ExtArgs>
|
||||
users?: boolean | Prisma.Complex$usersArgs<ExtArgs>
|
||||
invitations?: boolean | Prisma.Complex$invitationsArgs<ExtArgs>
|
||||
courts?: boolean | Prisma.Complex$courtsArgs<ExtArgs>
|
||||
recurringGroups?: boolean | Prisma.Complex$recurringGroupsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["complex"]>
|
||||
|
||||
@@ -779,6 +1135,9 @@ export type ComplexSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Exten
|
||||
id?: boolean
|
||||
complexName?: boolean
|
||||
physicalAddress?: boolean
|
||||
city?: boolean
|
||||
state?: boolean
|
||||
country?: boolean
|
||||
complexSlug?: boolean
|
||||
adminEmail?: boolean
|
||||
planCode?: boolean
|
||||
@@ -791,6 +1150,9 @@ export type ComplexSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Exten
|
||||
id?: boolean
|
||||
complexName?: boolean
|
||||
physicalAddress?: boolean
|
||||
city?: boolean
|
||||
state?: boolean
|
||||
country?: boolean
|
||||
complexSlug?: boolean
|
||||
adminEmail?: boolean
|
||||
planCode?: boolean
|
||||
@@ -803,6 +1165,9 @@ export type ComplexSelectScalar = {
|
||||
id?: boolean
|
||||
complexName?: boolean
|
||||
physicalAddress?: boolean
|
||||
city?: boolean
|
||||
state?: boolean
|
||||
country?: boolean
|
||||
complexSlug?: boolean
|
||||
adminEmail?: boolean
|
||||
planCode?: boolean
|
||||
@@ -810,11 +1175,13 @@ export type ComplexSelectScalar = {
|
||||
updatedAt?: boolean
|
||||
}
|
||||
|
||||
export type ComplexOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "complexName" | "physicalAddress" | "complexSlug" | "adminEmail" | "planCode" | "createdAt" | "updatedAt", ExtArgs["result"]["complex"]>
|
||||
export type ComplexOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "complexName" | "physicalAddress" | "city" | "state" | "country" | "complexSlug" | "adminEmail" | "planCode" | "createdAt" | "updatedAt", ExtArgs["result"]["complex"]>
|
||||
export type ComplexInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
plan?: boolean | Prisma.Complex$planArgs<ExtArgs>
|
||||
users?: boolean | Prisma.Complex$usersArgs<ExtArgs>
|
||||
invitations?: boolean | Prisma.Complex$invitationsArgs<ExtArgs>
|
||||
courts?: boolean | Prisma.Complex$courtsArgs<ExtArgs>
|
||||
recurringGroups?: boolean | Prisma.Complex$recurringGroupsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type ComplexIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -829,12 +1196,17 @@ export type $ComplexPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
objects: {
|
||||
plan: Prisma.$PlanPayload<ExtArgs> | null
|
||||
users: Prisma.$ComplexUserPayload<ExtArgs>[]
|
||||
invitations: Prisma.$ComplexInvitationPayload<ExtArgs>[]
|
||||
courts: Prisma.$CourtPayload<ExtArgs>[]
|
||||
recurringGroups: Prisma.$RecurringBookingGroupPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
complexName: string
|
||||
physicalAddress: string | null
|
||||
city: string | null
|
||||
state: string | null
|
||||
country: string | null
|
||||
complexSlug: string
|
||||
adminEmail: string
|
||||
planCode: string | null
|
||||
@@ -1236,7 +1608,9 @@ export interface Prisma__ComplexClient<T, Null = never, ExtArgs extends runtime.
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
plan<T extends Prisma.Complex$planArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$planArgs<ExtArgs>>): Prisma.Prisma__PlanClient<runtime.Types.Result.GetResult<Prisma.$PlanPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
users<T extends Prisma.Complex$usersArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$usersArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
invitations<T extends Prisma.Complex$invitationsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$invitationsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexInvitationPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
courts<T extends Prisma.Complex$courtsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$courtsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CourtPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
recurringGroups<T extends Prisma.Complex$recurringGroupsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Complex$recurringGroupsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$RecurringBookingGroupPayload<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.
|
||||
@@ -1269,6 +1643,9 @@ export interface ComplexFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly complexName: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly physicalAddress: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly city: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly state: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly country: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly complexSlug: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly adminEmail: Prisma.FieldRef<"Complex", 'String'>
|
||||
readonly planCode: Prisma.FieldRef<"Complex", 'String'>
|
||||
@@ -1717,6 +2094,30 @@ export type Complex$usersArgs<ExtArgs extends runtime.Types.Extensions.InternalA
|
||||
distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex.invitations
|
||||
*/
|
||||
export type Complex$invitationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the ComplexInvitation
|
||||
*/
|
||||
select?: Prisma.ComplexInvitationSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the ComplexInvitation
|
||||
*/
|
||||
omit?: Prisma.ComplexInvitationOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ComplexInvitationInclude<ExtArgs> | null
|
||||
where?: Prisma.ComplexInvitationWhereInput
|
||||
orderBy?: Prisma.ComplexInvitationOrderByWithRelationInput | Prisma.ComplexInvitationOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ComplexInvitationWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ComplexInvitationScalarFieldEnum | Prisma.ComplexInvitationScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex.courts
|
||||
*/
|
||||
@@ -1741,6 +2142,30 @@ export type Complex$courtsArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
distinct?: Prisma.CourtScalarFieldEnum | Prisma.CourtScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex.recurringGroups
|
||||
*/
|
||||
export type Complex$recurringGroupsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the RecurringBookingGroup
|
||||
*/
|
||||
select?: Prisma.RecurringBookingGroupSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the RecurringBookingGroup
|
||||
*/
|
||||
omit?: Prisma.RecurringBookingGroupOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.RecurringBookingGroupInclude<ExtArgs> | null
|
||||
where?: Prisma.RecurringBookingGroupWhereInput
|
||||
orderBy?: Prisma.RecurringBookingGroupOrderByWithRelationInput | Prisma.RecurringBookingGroupOrderByWithRelationInput[]
|
||||
cursor?: Prisma.RecurringBookingGroupWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.RecurringBookingGroupScalarFieldEnum | Prisma.RecurringBookingGroupScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Complex without action
|
||||
*/
|
||||
|
||||
@@ -171,7 +171,7 @@ export type ComplexUserWhereInput = {
|
||||
OR?: Prisma.ComplexUserWhereInput[]
|
||||
NOT?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
|
||||
complexId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
@@ -193,7 +193,7 @@ export type ComplexUserWhereUniqueInput = Prisma.AtLeast<{
|
||||
OR?: Prisma.ComplexUserWhereInput[]
|
||||
NOT?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
|
||||
complexId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.StringFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
@@ -215,7 +215,7 @@ export type ComplexUserScalarWhereWithAggregatesInput = {
|
||||
OR?: Prisma.ComplexUserScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.ComplexUserScalarWhereWithAggregatesInput | Prisma.ComplexUserScalarWhereWithAggregatesInput[]
|
||||
complexId?: Prisma.UuidWithAggregatesFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.UuidWithAggregatesFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.StringWithAggregatesFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleWithAggregatesFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"ComplexUser"> | Date | string
|
||||
}
|
||||
@@ -303,6 +303,48 @@ export type ComplexUserMinOrderByAggregateInput = {
|
||||
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[]
|
||||
}
|
||||
|
||||
export type ComplexUserCreateNestedManyWithoutComplexInput = {
|
||||
create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutComplexInput, Prisma.ComplexUserUncheckedCreateWithoutComplexInput> | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[]
|
||||
connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[]
|
||||
@@ -349,46 +391,52 @@ export type EnumComplexUserRoleFieldUpdateOperationsInput = {
|
||||
set?: $Enums.ComplexUserRole
|
||||
}
|
||||
|
||||
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 ComplexUserCreateWithoutUserInput = {
|
||||
role?: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutUsersInput
|
||||
}
|
||||
|
||||
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 ComplexUserUncheckedCreateWithoutUserInput = {
|
||||
complexId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
}
|
||||
|
||||
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 ComplexUserCreateOrConnectWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
|
||||
}
|
||||
|
||||
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 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 ComplexUserCreateWithoutComplexInput = {
|
||||
@@ -429,52 +477,28 @@ export type ComplexUserUpdateManyWithWhereWithoutComplexInput = {
|
||||
data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyWithoutComplexInput>
|
||||
}
|
||||
|
||||
export type ComplexUserScalarWhereInput = {
|
||||
AND?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
OR?: Prisma.ComplexUserScalarWhereInput[]
|
||||
NOT?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
|
||||
complexId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
userId?: Prisma.UuidFilter<"ComplexUser"> | string
|
||||
role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateWithoutUserInput = {
|
||||
role?: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutUsersInput
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedCreateWithoutUserInput = {
|
||||
export type ComplexUserCreateManyUserInput = {
|
||||
complexId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateOrConnectWithoutUserInput = {
|
||||
where: Prisma.ComplexUserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
|
||||
export type ComplexUserUpdateWithoutUserInput = {
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyUserInputEnvelope = {
|
||||
data: Prisma.ComplexUserCreateManyUserInput | Prisma.ComplexUserCreateManyUserInput[]
|
||||
skipDuplicates?: boolean
|
||||
export type ComplexUserUncheckedUpdateWithoutUserInput = {
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
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 ComplexUserUncheckedUpdateManyWithoutUserInput = {
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyComplexInput = {
|
||||
@@ -501,30 +525,6 @@ export type ComplexUserUncheckedUpdateManyWithoutComplexInput = {
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserCreateManyUserInput = {
|
||||
complexId: string
|
||||
role?: $Enums.ComplexUserRole
|
||||
createdAt?: Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUpdateWithoutUserInput = {
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateWithoutUserInput = {
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type ComplexUserUncheckedUpdateManyWithoutUserInput = {
|
||||
complexId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type ComplexUserSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
|
||||
@@ -43,6 +43,8 @@ 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
|
||||
}
|
||||
@@ -54,6 +56,8 @@ 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
|
||||
}
|
||||
@@ -65,6 +69,8 @@ export type CourtCountAggregateOutputType = {
|
||||
name: number
|
||||
slotDurationMinutes: number
|
||||
basePrice: number
|
||||
isUnderMaintenance: number
|
||||
maintenanceReason: number
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
_all: number
|
||||
@@ -88,6 +94,8 @@ export type CourtMinAggregateInputType = {
|
||||
name?: true
|
||||
slotDurationMinutes?: true
|
||||
basePrice?: true
|
||||
isUnderMaintenance?: true
|
||||
maintenanceReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
@@ -99,6 +107,8 @@ export type CourtMaxAggregateInputType = {
|
||||
name?: true
|
||||
slotDurationMinutes?: true
|
||||
basePrice?: true
|
||||
isUnderMaintenance?: true
|
||||
maintenanceReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
@@ -110,6 +120,8 @@ export type CourtCountAggregateInputType = {
|
||||
name?: true
|
||||
slotDurationMinutes?: true
|
||||
basePrice?: true
|
||||
isUnderMaintenance?: true
|
||||
maintenanceReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
_all?: true
|
||||
@@ -208,6 +220,8 @@ export type CourtGroupByOutputType = {
|
||||
name: string
|
||||
slotDurationMinutes: number
|
||||
basePrice: runtime.Decimal
|
||||
isUnderMaintenance: boolean
|
||||
maintenanceReason: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
_count: CourtCountAggregateOutputType | null
|
||||
@@ -242,6 +256,8 @@ 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>
|
||||
@@ -249,6 +265,8 @@ export type CourtWhereInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityListRelationFilter
|
||||
priceRules?: Prisma.CourtPriceRuleListRelationFilter
|
||||
bookings?: Prisma.CourtBookingListRelationFilter
|
||||
maintenances?: Prisma.CourtMaintenanceListRelationFilter
|
||||
recurringGroups?: Prisma.RecurringBookingGroupListRelationFilter
|
||||
}
|
||||
|
||||
export type CourtOrderByWithRelationInput = {
|
||||
@@ -258,6 +276,8 @@ 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
|
||||
@@ -265,6 +285,8 @@ export type CourtOrderByWithRelationInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityOrderByRelationAggregateInput
|
||||
priceRules?: Prisma.CourtPriceRuleOrderByRelationAggregateInput
|
||||
bookings?: Prisma.CourtBookingOrderByRelationAggregateInput
|
||||
maintenances?: Prisma.CourtMaintenanceOrderByRelationAggregateInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type CourtWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -277,6 +299,8 @@ 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>
|
||||
@@ -284,6 +308,8 @@ export type CourtWhereUniqueInput = Prisma.AtLeast<{
|
||||
availabilities?: Prisma.CourtAvailabilityListRelationFilter
|
||||
priceRules?: Prisma.CourtPriceRuleListRelationFilter
|
||||
bookings?: Prisma.CourtBookingListRelationFilter
|
||||
maintenances?: Prisma.CourtMaintenanceListRelationFilter
|
||||
recurringGroups?: Prisma.RecurringBookingGroupListRelationFilter
|
||||
}, "id">
|
||||
|
||||
export type CourtOrderByWithAggregationInput = {
|
||||
@@ -293,6 +319,8 @@ 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
|
||||
@@ -312,6 +340,8 @@ 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
|
||||
}
|
||||
@@ -321,6 +351,8 @@ 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
|
||||
@@ -328,6 +360,8 @@ export type CourtCreateInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput
|
||||
priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput
|
||||
bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateInput = {
|
||||
@@ -337,11 +371,15 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUpdateInput = {
|
||||
@@ -349,6 +387,8 @@ 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
|
||||
@@ -356,6 +396,8 @@ export type CourtUpdateInput = {
|
||||
availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput
|
||||
priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput
|
||||
bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateInput = {
|
||||
@@ -365,11 +407,15 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateManyInput = {
|
||||
@@ -379,6 +425,8 @@ 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
|
||||
}
|
||||
@@ -388,6 +436,8 @@ 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
|
||||
}
|
||||
@@ -399,6 +449,8 @@ 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
|
||||
}
|
||||
@@ -420,6 +472,8 @@ export type CourtCountOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -436,6 +490,8 @@ export type CourtMaxOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -447,6 +503,8 @@ export type CourtMinOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
slotDurationMinutes?: Prisma.SortOrder
|
||||
basePrice?: Prisma.SortOrder
|
||||
isUnderMaintenance?: Prisma.SortOrder
|
||||
maintenanceReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -561,6 +619,20 @@ export type DecimalFieldUpdateOperationsInput = {
|
||||
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
|
||||
@@ -603,17 +675,35 @@ export type CourtUpdateOneRequiredWithoutBookingsNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CourtUpdateToOneWithWhereWithoutBookingsInput, Prisma.CourtUpdateWithoutBookingsInput>, Prisma.CourtUncheckedUpdateWithoutBookingsInput>
|
||||
}
|
||||
|
||||
export type CourtCreateNestedOneWithoutRecurringGroupsInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtCreateWithoutRecurringGroupsInput, Prisma.CourtUncheckedCreateWithoutRecurringGroupsInput>
|
||||
connectOrCreate?: Prisma.CourtCreateOrConnectWithoutRecurringGroupsInput
|
||||
connect?: Prisma.CourtWhereUniqueInput
|
||||
}
|
||||
|
||||
export type CourtUpdateOneRequiredWithoutRecurringGroupsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtCreateWithoutRecurringGroupsInput, Prisma.CourtUncheckedCreateWithoutRecurringGroupsInput>
|
||||
connectOrCreate?: Prisma.CourtCreateOrConnectWithoutRecurringGroupsInput
|
||||
upsert?: Prisma.CourtUpsertWithoutRecurringGroupsInput
|
||||
connect?: Prisma.CourtWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.CourtUpdateToOneWithWhereWithoutRecurringGroupsInput, Prisma.CourtUpdateWithoutRecurringGroupsInput>, Prisma.CourtUncheckedUpdateWithoutRecurringGroupsInput>
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutComplexInput = {
|
||||
id: string
|
||||
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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutComplexInput = {
|
||||
@@ -622,11 +712,15 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutComplexInput = {
|
||||
@@ -665,6 +759,8 @@ 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
|
||||
}
|
||||
@@ -674,12 +770,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutSportInput = {
|
||||
@@ -688,11 +788,15 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutSportInput = {
|
||||
@@ -721,17 +825,105 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutAvailabilitiesInput = {
|
||||
@@ -741,10 +933,14 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutAvailabilitiesInput = {
|
||||
@@ -768,12 +964,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutAvailabilitiesInput = {
|
||||
@@ -783,10 +983,14 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutPriceRulesInput = {
|
||||
@@ -794,12 +998,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutPriceRulesInput = {
|
||||
@@ -809,10 +1017,14 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutPriceRulesInput = {
|
||||
@@ -836,12 +1048,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutPriceRulesInput = {
|
||||
@@ -851,10 +1067,14 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutBookingsInput = {
|
||||
@@ -862,12 +1082,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutBookingsInput = {
|
||||
@@ -877,10 +1101,14 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutBookingsInput = {
|
||||
@@ -904,12 +1132,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutBookingsInput = {
|
||||
@@ -919,10 +1151,98 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateWithoutRecurringGroupsInput = {
|
||||
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
|
||||
maintenances?: Prisma.CourtMaintenanceCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedCreateWithoutRecurringGroupsInput = {
|
||||
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
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedCreateNestedManyWithoutCourtInput
|
||||
}
|
||||
|
||||
export type CourtCreateOrConnectWithoutRecurringGroupsInput = {
|
||||
where: Prisma.CourtWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.CourtCreateWithoutRecurringGroupsInput, Prisma.CourtUncheckedCreateWithoutRecurringGroupsInput>
|
||||
}
|
||||
|
||||
export type CourtUpsertWithoutRecurringGroupsInput = {
|
||||
update: Prisma.XOR<Prisma.CourtUpdateWithoutRecurringGroupsInput, Prisma.CourtUncheckedUpdateWithoutRecurringGroupsInput>
|
||||
create: Prisma.XOR<Prisma.CourtCreateWithoutRecurringGroupsInput, Prisma.CourtUncheckedCreateWithoutRecurringGroupsInput>
|
||||
where?: Prisma.CourtWhereInput
|
||||
}
|
||||
|
||||
export type CourtUpdateToOneWithWhereWithoutRecurringGroupsInput = {
|
||||
where?: Prisma.CourtWhereInput
|
||||
data: Prisma.XOR<Prisma.CourtUpdateWithoutRecurringGroupsInput, Prisma.CourtUncheckedUpdateWithoutRecurringGroupsInput>
|
||||
}
|
||||
|
||||
export type CourtUpdateWithoutRecurringGroupsInput = {
|
||||
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
|
||||
maintenances?: Prisma.CourtMaintenanceUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutRecurringGroupsInput = {
|
||||
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
|
||||
maintenances?: Prisma.CourtMaintenanceUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtCreateManyComplexInput = {
|
||||
@@ -931,6 +1251,8 @@ 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
|
||||
}
|
||||
@@ -940,12 +1262,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutComplexInput = {
|
||||
@@ -954,11 +1280,15 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateManyWithoutComplexInput = {
|
||||
@@ -967,6 +1297,8 @@ 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
|
||||
}
|
||||
@@ -977,6 +1309,8 @@ 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
|
||||
}
|
||||
@@ -986,12 +1320,16 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateWithoutSportInput = {
|
||||
@@ -1000,11 +1338,15 @@ 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
|
||||
recurringGroups?: Prisma.RecurringBookingGroupUncheckedUpdateManyWithoutCourtNestedInput
|
||||
}
|
||||
|
||||
export type CourtUncheckedUpdateManyWithoutSportInput = {
|
||||
@@ -1013,6 +1355,8 @@ 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
|
||||
}
|
||||
@@ -1026,12 +1370,16 @@ export type CourtCountOutputType = {
|
||||
availabilities: number
|
||||
priceRules: number
|
||||
bookings: number
|
||||
maintenances: number
|
||||
recurringGroups: 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
|
||||
recurringGroups?: boolean | CourtCountOutputTypeCountRecurringGroupsArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1065,6 +1413,20 @@ 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
|
||||
}
|
||||
|
||||
/**
|
||||
* CourtCountOutputType without action
|
||||
*/
|
||||
export type CourtCountOutputTypeCountRecurringGroupsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.RecurringBookingGroupWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type CourtSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -1073,6 +1435,8 @@ 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>
|
||||
@@ -1080,6 +1444,8 @@ 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>
|
||||
recurringGroups?: boolean | Prisma.Court$recurringGroupsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.CourtCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["court"]>
|
||||
|
||||
@@ -1090,6 +1456,8 @@ 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>
|
||||
@@ -1103,6 +1471,8 @@ 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>
|
||||
@@ -1116,17 +1486,21 @@ 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" | "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" | "isUnderMaintenance" | "maintenanceReason" | "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>
|
||||
recurringGroups?: boolean | Prisma.Court$recurringGroupsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.CourtCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type CourtIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -1146,6 +1520,8 @@ 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>[]
|
||||
recurringGroups: Prisma.$RecurringBookingGroupPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1154,6 +1530,8 @@ 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"]>
|
||||
@@ -1555,6 +1933,8 @@ 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>
|
||||
recurringGroups<T extends Prisma.Court$recurringGroupsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Court$recurringGroupsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$RecurringBookingGroupPayload<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.
|
||||
@@ -1590,6 +1970,8 @@ 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'>
|
||||
}
|
||||
@@ -2064,6 +2446,54 @@ 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.recurringGroups
|
||||
*/
|
||||
export type Court$recurringGroupsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the RecurringBookingGroup
|
||||
*/
|
||||
select?: Prisma.RecurringBookingGroupSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the RecurringBookingGroup
|
||||
*/
|
||||
omit?: Prisma.RecurringBookingGroupOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.RecurringBookingGroupInclude<ExtArgs> | null
|
||||
where?: Prisma.RecurringBookingGroupWhereInput
|
||||
orderBy?: Prisma.RecurringBookingGroupOrderByWithRelationInput | Prisma.RecurringBookingGroupOrderByWithRelationInput[]
|
||||
cursor?: Prisma.RecurringBookingGroupWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.RecurringBookingGroupScalarFieldEnum | Prisma.RecurringBookingGroupScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Court without action
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,9 @@ export type CourtBookingMinAggregateOutputType = {
|
||||
endTime: string | null
|
||||
customerName: string | null
|
||||
customerPhone: string | null
|
||||
customerEmail: string | null
|
||||
status: $Enums.CourtBookingStatus | null
|
||||
recurringGroupId: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
}
|
||||
@@ -47,7 +49,9 @@ export type CourtBookingMaxAggregateOutputType = {
|
||||
endTime: string | null
|
||||
customerName: string | null
|
||||
customerPhone: string | null
|
||||
customerEmail: string | null
|
||||
status: $Enums.CourtBookingStatus | null
|
||||
recurringGroupId: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
}
|
||||
@@ -61,7 +65,9 @@ export type CourtBookingCountAggregateOutputType = {
|
||||
endTime: number
|
||||
customerName: number
|
||||
customerPhone: number
|
||||
customerEmail: number
|
||||
status: number
|
||||
recurringGroupId: number
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
_all: number
|
||||
@@ -77,7 +83,9 @@ export type CourtBookingMinAggregateInputType = {
|
||||
endTime?: true
|
||||
customerName?: true
|
||||
customerPhone?: true
|
||||
customerEmail?: true
|
||||
status?: true
|
||||
recurringGroupId?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
@@ -91,7 +99,9 @@ export type CourtBookingMaxAggregateInputType = {
|
||||
endTime?: true
|
||||
customerName?: true
|
||||
customerPhone?: true
|
||||
customerEmail?: true
|
||||
status?: true
|
||||
recurringGroupId?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
}
|
||||
@@ -105,7 +115,9 @@ export type CourtBookingCountAggregateInputType = {
|
||||
endTime?: true
|
||||
customerName?: true
|
||||
customerPhone?: true
|
||||
customerEmail?: true
|
||||
status?: true
|
||||
recurringGroupId?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
_all?: true
|
||||
@@ -192,7 +204,9 @@ export type CourtBookingGroupByOutputType = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status: $Enums.CourtBookingStatus
|
||||
recurringGroupId: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
_count: CourtBookingCountAggregateOutputType | null
|
||||
@@ -227,10 +241,13 @@ 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
|
||||
recurringGroupId?: Prisma.UuidNullableFilter<"CourtBooking"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
court?: Prisma.XOR<Prisma.CourtScalarRelationFilter, Prisma.CourtWhereInput>
|
||||
recurringGroup?: Prisma.XOR<Prisma.RecurringBookingGroupNullableScalarRelationFilter, Prisma.RecurringBookingGroupWhereInput> | null
|
||||
}
|
||||
|
||||
export type CourtBookingOrderByWithRelationInput = {
|
||||
@@ -242,10 +259,13 @@ export type CourtBookingOrderByWithRelationInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
recurringGroupId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
court?: Prisma.CourtOrderByWithRelationInput
|
||||
recurringGroup?: Prisma.RecurringBookingGroupOrderByWithRelationInput
|
||||
}
|
||||
|
||||
export type CourtBookingWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -261,10 +281,13 @@ 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
|
||||
recurringGroupId?: Prisma.UuidNullableFilter<"CourtBooking"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
court?: Prisma.XOR<Prisma.CourtScalarRelationFilter, Prisma.CourtWhereInput>
|
||||
recurringGroup?: Prisma.XOR<Prisma.RecurringBookingGroupNullableScalarRelationFilter, Prisma.RecurringBookingGroupWhereInput> | null
|
||||
}, "id" | "bookingCode" | "courtId_bookingDate_startTime">
|
||||
|
||||
export type CourtBookingOrderByWithAggregationInput = {
|
||||
@@ -276,7 +299,9 @@ export type CourtBookingOrderByWithAggregationInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
recurringGroupId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
_count?: Prisma.CourtBookingCountOrderByAggregateInput
|
||||
@@ -296,7 +321,9 @@ 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
|
||||
recurringGroupId?: Prisma.UuidNullableWithAggregatesFilter<"CourtBooking"> | string | null
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"CourtBooking"> | Date | string
|
||||
}
|
||||
@@ -309,10 +336,12 @@ export type CourtBookingCreateInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
court: Prisma.CourtCreateNestedOneWithoutBookingsInput
|
||||
recurringGroup?: Prisma.RecurringBookingGroupCreateNestedOneWithoutBookingsInput
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedCreateInput = {
|
||||
@@ -324,7 +353,9 @@ export type CourtBookingUncheckedCreateInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
recurringGroupId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
@@ -337,10 +368,12 @@ 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
|
||||
court?: Prisma.CourtUpdateOneRequiredWithoutBookingsNestedInput
|
||||
recurringGroup?: Prisma.RecurringBookingGroupUpdateOneWithoutBookingsNestedInput
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedUpdateInput = {
|
||||
@@ -352,7 +385,9 @@ export type CourtBookingUncheckedUpdateInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
recurringGroupId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -366,7 +401,9 @@ export type CourtBookingCreateManyInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
recurringGroupId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
@@ -379,6 +416,7 @@ 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
|
||||
@@ -393,7 +431,9 @@ export type CourtBookingUncheckedUpdateManyInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
recurringGroupId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -423,7 +463,9 @@ export type CourtBookingCountOrderByAggregateInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
recurringGroupId?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -437,7 +479,9 @@ export type CourtBookingMaxOrderByAggregateInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
recurringGroupId?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -451,7 +495,9 @@ export type CourtBookingMinOrderByAggregateInput = {
|
||||
endTime?: Prisma.SortOrder
|
||||
customerName?: Prisma.SortOrder
|
||||
customerPhone?: Prisma.SortOrder
|
||||
customerEmail?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
recurringGroupId?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
}
|
||||
@@ -502,6 +548,48 @@ export type EnumCourtBookingStatusFieldUpdateOperationsInput = {
|
||||
set?: $Enums.CourtBookingStatus
|
||||
}
|
||||
|
||||
export type CourtBookingCreateNestedManyWithoutRecurringGroupInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtBookingCreateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput> | Prisma.CourtBookingCreateWithoutRecurringGroupInput[] | Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput[]
|
||||
connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput | Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput[]
|
||||
createMany?: Prisma.CourtBookingCreateManyRecurringGroupInputEnvelope
|
||||
connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedCreateNestedManyWithoutRecurringGroupInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtBookingCreateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput> | Prisma.CourtBookingCreateWithoutRecurringGroupInput[] | Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput[]
|
||||
connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput | Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput[]
|
||||
createMany?: Prisma.CourtBookingCreateManyRecurringGroupInputEnvelope
|
||||
connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type CourtBookingUpdateManyWithoutRecurringGroupNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtBookingCreateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput> | Prisma.CourtBookingCreateWithoutRecurringGroupInput[] | Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput[]
|
||||
connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput | Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput[]
|
||||
upsert?: Prisma.CourtBookingUpsertWithWhereUniqueWithoutRecurringGroupInput | Prisma.CourtBookingUpsertWithWhereUniqueWithoutRecurringGroupInput[]
|
||||
createMany?: Prisma.CourtBookingCreateManyRecurringGroupInputEnvelope
|
||||
set?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
disconnect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
delete?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
update?: Prisma.CourtBookingUpdateWithWhereUniqueWithoutRecurringGroupInput | Prisma.CourtBookingUpdateWithWhereUniqueWithoutRecurringGroupInput[]
|
||||
updateMany?: Prisma.CourtBookingUpdateManyWithWhereWithoutRecurringGroupInput | Prisma.CourtBookingUpdateManyWithWhereWithoutRecurringGroupInput[]
|
||||
deleteMany?: Prisma.CourtBookingScalarWhereInput | Prisma.CourtBookingScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedUpdateManyWithoutRecurringGroupNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.CourtBookingCreateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput> | Prisma.CourtBookingCreateWithoutRecurringGroupInput[] | Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput[]
|
||||
connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput | Prisma.CourtBookingCreateOrConnectWithoutRecurringGroupInput[]
|
||||
upsert?: Prisma.CourtBookingUpsertWithWhereUniqueWithoutRecurringGroupInput | Prisma.CourtBookingUpsertWithWhereUniqueWithoutRecurringGroupInput[]
|
||||
createMany?: Prisma.CourtBookingCreateManyRecurringGroupInputEnvelope
|
||||
set?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
disconnect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
delete?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[]
|
||||
update?: Prisma.CourtBookingUpdateWithWhereUniqueWithoutRecurringGroupInput | Prisma.CourtBookingUpdateWithWhereUniqueWithoutRecurringGroupInput[]
|
||||
updateMany?: Prisma.CourtBookingUpdateManyWithWhereWithoutRecurringGroupInput | Prisma.CourtBookingUpdateManyWithWhereWithoutRecurringGroupInput[]
|
||||
deleteMany?: Prisma.CourtBookingScalarWhereInput | Prisma.CourtBookingScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type CourtBookingCreateWithoutCourtInput = {
|
||||
id: string
|
||||
bookingCode: string
|
||||
@@ -510,9 +598,11 @@ export type CourtBookingCreateWithoutCourtInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
recurringGroup?: Prisma.RecurringBookingGroupCreateNestedOneWithoutBookingsInput
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedCreateWithoutCourtInput = {
|
||||
@@ -523,7 +613,9 @@ export type CourtBookingUncheckedCreateWithoutCourtInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
recurringGroupId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
@@ -566,11 +658,69 @@ 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
|
||||
recurringGroupId?: Prisma.UuidNullableFilter<"CourtBooking"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string
|
||||
}
|
||||
|
||||
export type CourtBookingCreateWithoutRecurringGroupInput = {
|
||||
id: string
|
||||
bookingCode: string
|
||||
bookingDate: Date | string
|
||||
startTime: string
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
court: Prisma.CourtCreateNestedOneWithoutBookingsInput
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedCreateWithoutRecurringGroupInput = {
|
||||
id: string
|
||||
bookingCode: string
|
||||
courtId: string
|
||||
bookingDate: Date | string
|
||||
startTime: string
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type CourtBookingCreateOrConnectWithoutRecurringGroupInput = {
|
||||
where: Prisma.CourtBookingWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.CourtBookingCreateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput>
|
||||
}
|
||||
|
||||
export type CourtBookingCreateManyRecurringGroupInputEnvelope = {
|
||||
data: Prisma.CourtBookingCreateManyRecurringGroupInput | Prisma.CourtBookingCreateManyRecurringGroupInput[]
|
||||
skipDuplicates?: boolean
|
||||
}
|
||||
|
||||
export type CourtBookingUpsertWithWhereUniqueWithoutRecurringGroupInput = {
|
||||
where: Prisma.CourtBookingWhereUniqueInput
|
||||
update: Prisma.XOR<Prisma.CourtBookingUpdateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedUpdateWithoutRecurringGroupInput>
|
||||
create: Prisma.XOR<Prisma.CourtBookingCreateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedCreateWithoutRecurringGroupInput>
|
||||
}
|
||||
|
||||
export type CourtBookingUpdateWithWhereUniqueWithoutRecurringGroupInput = {
|
||||
where: Prisma.CourtBookingWhereUniqueInput
|
||||
data: Prisma.XOR<Prisma.CourtBookingUpdateWithoutRecurringGroupInput, Prisma.CourtBookingUncheckedUpdateWithoutRecurringGroupInput>
|
||||
}
|
||||
|
||||
export type CourtBookingUpdateManyWithWhereWithoutRecurringGroupInput = {
|
||||
where: Prisma.CourtBookingScalarWhereInput
|
||||
data: Prisma.XOR<Prisma.CourtBookingUpdateManyMutationInput, Prisma.CourtBookingUncheckedUpdateManyWithoutRecurringGroupInput>
|
||||
}
|
||||
|
||||
export type CourtBookingCreateManyCourtInput = {
|
||||
id: string
|
||||
bookingCode: string
|
||||
@@ -579,7 +729,9 @@ export type CourtBookingCreateManyCourtInput = {
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
recurringGroupId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
@@ -592,9 +744,11 @@ 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
|
||||
recurringGroup?: Prisma.RecurringBookingGroupUpdateOneWithoutBookingsNestedInput
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedUpdateWithoutCourtInput = {
|
||||
@@ -605,7 +759,9 @@ export type CourtBookingUncheckedUpdateWithoutCourtInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
recurringGroupId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -618,6 +774,68 @@ export type CourtBookingUncheckedUpdateManyWithoutCourtInput = {
|
||||
endTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerPhone?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
customerEmail?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus
|
||||
recurringGroupId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type CourtBookingCreateManyRecurringGroupInput = {
|
||||
id: string
|
||||
bookingCode: string
|
||||
courtId: string
|
||||
bookingDate: Date | string
|
||||
startTime: string
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status?: $Enums.CourtBookingStatus
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
}
|
||||
|
||||
export type CourtBookingUpdateWithoutRecurringGroupInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
bookingCode?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
startTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
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
|
||||
court?: Prisma.CourtUpdateOneRequiredWithoutBookingsNestedInput
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedUpdateWithoutRecurringGroupInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
bookingCode?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
courtId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
startTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
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
|
||||
}
|
||||
|
||||
export type CourtBookingUncheckedUpdateManyWithoutRecurringGroupInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
bookingCode?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
courtId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
startTime?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
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
|
||||
@@ -634,10 +852,13 @@ export type CourtBookingSelect<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
recurringGroupId?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
court?: boolean | Prisma.CourtDefaultArgs<ExtArgs>
|
||||
recurringGroup?: boolean | Prisma.CourtBooking$recurringGroupArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["courtBooking"]>
|
||||
|
||||
export type CourtBookingSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
@@ -649,10 +870,13 @@ export type CourtBookingSelectCreateManyAndReturn<ExtArgs extends runtime.Types.
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
recurringGroupId?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
court?: boolean | Prisma.CourtDefaultArgs<ExtArgs>
|
||||
recurringGroup?: boolean | Prisma.CourtBooking$recurringGroupArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["courtBooking"]>
|
||||
|
||||
export type CourtBookingSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
@@ -664,10 +888,13 @@ export type CourtBookingSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
recurringGroupId?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
court?: boolean | Prisma.CourtDefaultArgs<ExtArgs>
|
||||
recurringGroup?: boolean | Prisma.CourtBooking$recurringGroupArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["courtBooking"]>
|
||||
|
||||
export type CourtBookingSelectScalar = {
|
||||
@@ -679,26 +906,32 @@ export type CourtBookingSelectScalar = {
|
||||
endTime?: boolean
|
||||
customerName?: boolean
|
||||
customerPhone?: boolean
|
||||
customerEmail?: boolean
|
||||
status?: boolean
|
||||
recurringGroupId?: 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" | "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" | "customerEmail" | "status" | "recurringGroupId" | "createdAt" | "updatedAt", ExtArgs["result"]["courtBooking"]>
|
||||
export type CourtBookingInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
court?: boolean | Prisma.CourtDefaultArgs<ExtArgs>
|
||||
recurringGroup?: boolean | Prisma.CourtBooking$recurringGroupArgs<ExtArgs>
|
||||
}
|
||||
export type CourtBookingIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
court?: boolean | Prisma.CourtDefaultArgs<ExtArgs>
|
||||
recurringGroup?: boolean | Prisma.CourtBooking$recurringGroupArgs<ExtArgs>
|
||||
}
|
||||
export type CourtBookingIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
court?: boolean | Prisma.CourtDefaultArgs<ExtArgs>
|
||||
recurringGroup?: boolean | Prisma.CourtBooking$recurringGroupArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $CourtBookingPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "CourtBooking"
|
||||
objects: {
|
||||
court: Prisma.$CourtPayload<ExtArgs>
|
||||
recurringGroup: Prisma.$RecurringBookingGroupPayload<ExtArgs> | null
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -709,7 +942,9 @@ export type $CourtBookingPayload<ExtArgs extends runtime.Types.Extensions.Intern
|
||||
endTime: string
|
||||
customerName: string
|
||||
customerPhone: string
|
||||
customerEmail: string
|
||||
status: $Enums.CourtBookingStatus
|
||||
recurringGroupId: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}, ExtArgs["result"]["courtBooking"]>
|
||||
@@ -1107,6 +1342,7 @@ readonly fields: CourtBookingFieldRefs;
|
||||
export interface Prisma__CourtBookingClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
court<T extends Prisma.CourtDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CourtDefaultArgs<ExtArgs>>): Prisma.Prisma__CourtClient<runtime.Types.Result.GetResult<Prisma.$CourtPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
recurringGroup<T extends Prisma.CourtBooking$recurringGroupArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CourtBooking$recurringGroupArgs<ExtArgs>>): Prisma.Prisma__RecurringBookingGroupClient<runtime.Types.Result.GetResult<Prisma.$RecurringBookingGroupPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1144,7 +1380,9 @@ 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 recurringGroupId: Prisma.FieldRef<"CourtBooking", 'String'>
|
||||
readonly createdAt: Prisma.FieldRef<"CourtBooking", 'DateTime'>
|
||||
readonly updatedAt: Prisma.FieldRef<"CourtBooking", 'DateTime'>
|
||||
}
|
||||
@@ -1547,6 +1785,25 @@ export type CourtBookingDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* CourtBooking.recurringGroup
|
||||
*/
|
||||
export type CourtBooking$recurringGroupArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the RecurringBookingGroup
|
||||
*/
|
||||
select?: Prisma.RecurringBookingGroupSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the RecurringBookingGroup
|
||||
*/
|
||||
omit?: Prisma.RecurringBookingGroupOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.RecurringBookingGroupInclude<ExtArgs> | null
|
||||
where?: Prisma.RecurringBookingGroupWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* CourtBooking without action
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -339,10 +339,6 @@ export type SportScalarRelationFilter = {
|
||||
isNot?: Prisma.SportWhereInput
|
||||
}
|
||||
|
||||
export type BoolFieldUpdateOperationsInput = {
|
||||
set?: boolean
|
||||
}
|
||||
|
||||
export type SportCreateNestedOneWithoutCourtsInput = {
|
||||
create?: Prisma.XOR<Prisma.SportCreateWithoutCourtsInput, Prisma.SportUncheckedCreateWithoutCourtsInput>
|
||||
connectOrCreate?: Prisma.SportCreateOrConnectWithoutCourtsInput
|
||||
|
||||
@@ -26,58 +26,94 @@ export type AggregateUser = {
|
||||
|
||||
export type UserMinAggregateOutputType = {
|
||||
id: string | null
|
||||
supabaseUserId: string | null
|
||||
name: string | null
|
||||
email: string | null
|
||||
fullName: string | null
|
||||
emailVerified: boolean | null
|
||||
image: string | null
|
||||
phone: string | null
|
||||
banned: boolean | null
|
||||
bannedAt: Date | null
|
||||
banReason: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
role: string | null
|
||||
}
|
||||
|
||||
export type UserMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
supabaseUserId: string | null
|
||||
name: string | null
|
||||
email: string | null
|
||||
fullName: string | null
|
||||
emailVerified: boolean | null
|
||||
image: string | null
|
||||
phone: string | null
|
||||
banned: boolean | null
|
||||
bannedAt: Date | null
|
||||
banReason: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
role: string | null
|
||||
}
|
||||
|
||||
export type UserCountAggregateOutputType = {
|
||||
id: number
|
||||
supabaseUserId: number
|
||||
name: number
|
||||
email: number
|
||||
fullName: number
|
||||
emailVerified: number
|
||||
image: number
|
||||
phone: number
|
||||
banned: number
|
||||
bannedAt: number
|
||||
banReason: number
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
role: number
|
||||
_all: number
|
||||
}
|
||||
|
||||
|
||||
export type UserMinAggregateInputType = {
|
||||
id?: true
|
||||
supabaseUserId?: true
|
||||
name?: true
|
||||
email?: true
|
||||
fullName?: true
|
||||
emailVerified?: true
|
||||
image?: true
|
||||
phone?: true
|
||||
banned?: true
|
||||
bannedAt?: true
|
||||
banReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
role?: true
|
||||
}
|
||||
|
||||
export type UserMaxAggregateInputType = {
|
||||
id?: true
|
||||
supabaseUserId?: true
|
||||
name?: true
|
||||
email?: true
|
||||
fullName?: true
|
||||
emailVerified?: true
|
||||
image?: true
|
||||
phone?: true
|
||||
banned?: true
|
||||
bannedAt?: true
|
||||
banReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
role?: true
|
||||
}
|
||||
|
||||
export type UserCountAggregateInputType = {
|
||||
id?: true
|
||||
supabaseUserId?: true
|
||||
name?: true
|
||||
email?: true
|
||||
fullName?: true
|
||||
emailVerified?: true
|
||||
image?: true
|
||||
phone?: true
|
||||
banned?: true
|
||||
bannedAt?: true
|
||||
banReason?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
role?: true
|
||||
_all?: true
|
||||
}
|
||||
|
||||
@@ -155,11 +191,17 @@ export type UserGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
|
||||
export type UserGroupByOutputType = {
|
||||
id: string
|
||||
supabaseUserId: string
|
||||
name: string
|
||||
email: string
|
||||
fullName: string
|
||||
emailVerified: boolean
|
||||
image: string | null
|
||||
phone: string | null
|
||||
banned: boolean
|
||||
bannedAt: Date | null
|
||||
banReason: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
role: string
|
||||
_count: UserCountAggregateOutputType | null
|
||||
_min: UserMinAggregateOutputType | null
|
||||
_max: UserMaxAggregateOutputType | null
|
||||
@@ -184,45 +226,75 @@ export type UserWhereInput = {
|
||||
AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[]
|
||||
OR?: Prisma.UserWhereInput[]
|
||||
NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[]
|
||||
id?: Prisma.UuidFilter<"User"> | string
|
||||
supabaseUserId?: Prisma.UuidFilter<"User"> | string
|
||||
id?: Prisma.StringFilter<"User"> | string
|
||||
name?: Prisma.StringFilter<"User"> | string
|
||||
email?: Prisma.StringFilter<"User"> | string
|
||||
fullName?: Prisma.StringFilter<"User"> | string
|
||||
emailVerified?: Prisma.BoolFilter<"User"> | boolean
|
||||
image?: Prisma.StringNullableFilter<"User"> | string | null
|
||||
phone?: Prisma.StringNullableFilter<"User"> | string | null
|
||||
banned?: Prisma.BoolFilter<"User"> | boolean
|
||||
bannedAt?: Prisma.DateTimeNullableFilter<"User"> | Date | string | null
|
||||
banReason?: Prisma.StringNullableFilter<"User"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||
role?: Prisma.StringFilter<"User"> | string
|
||||
sessions?: Prisma.SessionListRelationFilter
|
||||
accounts?: Prisma.AccountListRelationFilter
|
||||
complexes?: Prisma.ComplexUserListRelationFilter
|
||||
}
|
||||
|
||||
export type UserOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
supabaseUserId?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
fullName?: Prisma.SortOrder
|
||||
emailVerified?: Prisma.SortOrder
|
||||
image?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
phone?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
banned?: Prisma.SortOrder
|
||||
bannedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
banReason?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
sessions?: Prisma.SessionOrderByRelationAggregateInput
|
||||
accounts?: Prisma.AccountOrderByRelationAggregateInput
|
||||
complexes?: Prisma.ComplexUserOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type UserWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: string
|
||||
supabaseUserId?: string
|
||||
email?: string
|
||||
AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[]
|
||||
OR?: Prisma.UserWhereInput[]
|
||||
NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[]
|
||||
fullName?: Prisma.StringFilter<"User"> | string
|
||||
name?: Prisma.StringFilter<"User"> | string
|
||||
emailVerified?: Prisma.BoolFilter<"User"> | boolean
|
||||
image?: Prisma.StringNullableFilter<"User"> | string | null
|
||||
phone?: Prisma.StringNullableFilter<"User"> | string | null
|
||||
banned?: Prisma.BoolFilter<"User"> | boolean
|
||||
bannedAt?: Prisma.DateTimeNullableFilter<"User"> | Date | string | null
|
||||
banReason?: Prisma.StringNullableFilter<"User"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string
|
||||
role?: Prisma.StringFilter<"User"> | string
|
||||
sessions?: Prisma.SessionListRelationFilter
|
||||
accounts?: Prisma.AccountListRelationFilter
|
||||
complexes?: Prisma.ComplexUserListRelationFilter
|
||||
}, "id" | "supabaseUserId" | "email">
|
||||
}, "id" | "email">
|
||||
|
||||
export type UserOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
supabaseUserId?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
fullName?: Prisma.SortOrder
|
||||
emailVerified?: Prisma.SortOrder
|
||||
image?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
phone?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
banned?: Prisma.SortOrder
|
||||
bannedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
banReason?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
_count?: Prisma.UserCountOrderByAggregateInput
|
||||
_max?: Prisma.UserMaxOrderByAggregateInput
|
||||
_min?: Prisma.UserMinOrderByAggregateInput
|
||||
@@ -232,79 +304,180 @@ export type UserScalarWhereWithAggregatesInput = {
|
||||
AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.UserScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.UuidWithAggregatesFilter<"User"> | string
|
||||
supabaseUserId?: Prisma.UuidWithAggregatesFilter<"User"> | string
|
||||
id?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
name?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
email?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
fullName?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
emailVerified?: Prisma.BoolWithAggregatesFilter<"User"> | boolean
|
||||
image?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null
|
||||
phone?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null
|
||||
banned?: Prisma.BoolWithAggregatesFilter<"User"> | boolean
|
||||
bannedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"User"> | Date | string | null
|
||||
banReason?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string
|
||||
role?: Prisma.StringWithAggregatesFilter<"User"> | string
|
||||
}
|
||||
|
||||
export type UserCreateInput = {
|
||||
id: string
|
||||
supabaseUserId: string
|
||||
name: string
|
||||
email: string
|
||||
fullName: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
sessions?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||
accounts?: Prisma.AccountCreateNestedManyWithoutUserInput
|
||||
complexes?: Prisma.ComplexUserCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateInput = {
|
||||
id: string
|
||||
supabaseUserId: string
|
||||
name: string
|
||||
email: string
|
||||
fullName: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
sessions?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||
accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput
|
||||
complexes?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fullName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sessions?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||
accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput
|
||||
complexes?: Prisma.ComplexUserUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fullName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sessions?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||
accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput
|
||||
complexes?: Prisma.ComplexUserUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserCreateManyInput = {
|
||||
id: string
|
||||
supabaseUserId: string
|
||||
name: string
|
||||
email: string
|
||||
fullName: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
}
|
||||
|
||||
export type UserUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fullName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fullName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type UserCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
emailVerified?: Prisma.SortOrder
|
||||
image?: Prisma.SortOrder
|
||||
phone?: Prisma.SortOrder
|
||||
banned?: Prisma.SortOrder
|
||||
bannedAt?: Prisma.SortOrder
|
||||
banReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type UserMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
emailVerified?: Prisma.SortOrder
|
||||
image?: Prisma.SortOrder
|
||||
phone?: Prisma.SortOrder
|
||||
banned?: Prisma.SortOrder
|
||||
bannedAt?: Prisma.SortOrder
|
||||
banReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type UserMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
emailVerified?: Prisma.SortOrder
|
||||
image?: Prisma.SortOrder
|
||||
phone?: Prisma.SortOrder
|
||||
banned?: Prisma.SortOrder
|
||||
bannedAt?: Prisma.SortOrder
|
||||
banReason?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
role?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type UserScalarRelationFilter = {
|
||||
@@ -312,31 +485,52 @@ export type UserScalarRelationFilter = {
|
||||
isNot?: Prisma.UserWhereInput
|
||||
}
|
||||
|
||||
export type UserCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
supabaseUserId?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
fullName?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
export type StringFieldUpdateOperationsInput = {
|
||||
set?: string
|
||||
}
|
||||
|
||||
export type UserMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
supabaseUserId?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
fullName?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
export type BoolFieldUpdateOperationsInput = {
|
||||
set?: boolean
|
||||
}
|
||||
|
||||
export type UserMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
supabaseUserId?: Prisma.SortOrder
|
||||
email?: Prisma.SortOrder
|
||||
fullName?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
export type NullableStringFieldUpdateOperationsInput = {
|
||||
set?: string | null
|
||||
}
|
||||
|
||||
export type NullableDateTimeFieldUpdateOperationsInput = {
|
||||
set?: Date | string | null
|
||||
}
|
||||
|
||||
export type DateTimeFieldUpdateOperationsInput = {
|
||||
set?: Date | string
|
||||
}
|
||||
|
||||
export type UserCreateNestedOneWithoutSessionsInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutSessionsInput, Prisma.UserUncheckedCreateWithoutSessionsInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutSessionsInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
}
|
||||
|
||||
export type UserUpdateOneRequiredWithoutSessionsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutSessionsInput, Prisma.UserUncheckedCreateWithoutSessionsInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutSessionsInput
|
||||
upsert?: Prisma.UserUpsertWithoutSessionsInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutSessionsInput, Prisma.UserUpdateWithoutSessionsInput>, Prisma.UserUncheckedUpdateWithoutSessionsInput>
|
||||
}
|
||||
|
||||
export type UserCreateNestedOneWithoutAccountsInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutAccountsInput, Prisma.UserUncheckedCreateWithoutAccountsInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutAccountsInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
}
|
||||
|
||||
export type UserUpdateOneRequiredWithoutAccountsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.UserCreateWithoutAccountsInput, Prisma.UserUncheckedCreateWithoutAccountsInput>
|
||||
connectOrCreate?: Prisma.UserCreateOrConnectWithoutAccountsInput
|
||||
upsert?: Prisma.UserUpsertWithoutAccountsInput
|
||||
connect?: Prisma.UserWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutAccountsInput, Prisma.UserUpdateWithoutAccountsInput>, Prisma.UserUncheckedUpdateWithoutAccountsInput>
|
||||
}
|
||||
|
||||
export type UserCreateNestedOneWithoutComplexesInput = {
|
||||
@@ -353,22 +547,206 @@ export type UserUpdateOneRequiredWithoutComplexesNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutComplexesInput, Prisma.UserUpdateWithoutComplexesInput>, Prisma.UserUncheckedUpdateWithoutComplexesInput>
|
||||
}
|
||||
|
||||
export type UserCreateWithoutComplexesInput = {
|
||||
export type UserCreateWithoutSessionsInput = {
|
||||
id: string
|
||||
supabaseUserId: string
|
||||
name: string
|
||||
email: string
|
||||
fullName: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
accounts?: Prisma.AccountCreateNestedManyWithoutUserInput
|
||||
complexes?: Prisma.ComplexUserCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateWithoutSessionsInput = {
|
||||
id: string
|
||||
name: string
|
||||
email: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput
|
||||
complexes?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserCreateOrConnectWithoutSessionsInput = {
|
||||
where: Prisma.UserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutSessionsInput, Prisma.UserUncheckedCreateWithoutSessionsInput>
|
||||
}
|
||||
|
||||
export type UserUpsertWithoutSessionsInput = {
|
||||
update: Prisma.XOR<Prisma.UserUpdateWithoutSessionsInput, Prisma.UserUncheckedUpdateWithoutSessionsInput>
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutSessionsInput, Prisma.UserUncheckedCreateWithoutSessionsInput>
|
||||
where?: Prisma.UserWhereInput
|
||||
}
|
||||
|
||||
export type UserUpdateToOneWithWhereWithoutSessionsInput = {
|
||||
where?: Prisma.UserWhereInput
|
||||
data: Prisma.XOR<Prisma.UserUpdateWithoutSessionsInput, Prisma.UserUncheckedUpdateWithoutSessionsInput>
|
||||
}
|
||||
|
||||
export type UserUpdateWithoutSessionsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput
|
||||
complexes?: Prisma.ComplexUserUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateWithoutSessionsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput
|
||||
complexes?: Prisma.ComplexUserUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserCreateWithoutAccountsInput = {
|
||||
id: string
|
||||
name: string
|
||||
email: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
sessions?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||
complexes?: Prisma.ComplexUserCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateWithoutAccountsInput = {
|
||||
id: string
|
||||
name: string
|
||||
email: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
sessions?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||
complexes?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserCreateOrConnectWithoutAccountsInput = {
|
||||
where: Prisma.UserWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutAccountsInput, Prisma.UserUncheckedCreateWithoutAccountsInput>
|
||||
}
|
||||
|
||||
export type UserUpsertWithoutAccountsInput = {
|
||||
update: Prisma.XOR<Prisma.UserUpdateWithoutAccountsInput, Prisma.UserUncheckedUpdateWithoutAccountsInput>
|
||||
create: Prisma.XOR<Prisma.UserCreateWithoutAccountsInput, Prisma.UserUncheckedCreateWithoutAccountsInput>
|
||||
where?: Prisma.UserWhereInput
|
||||
}
|
||||
|
||||
export type UserUpdateToOneWithWhereWithoutAccountsInput = {
|
||||
where?: Prisma.UserWhereInput
|
||||
data: Prisma.XOR<Prisma.UserUpdateWithoutAccountsInput, Prisma.UserUncheckedUpdateWithoutAccountsInput>
|
||||
}
|
||||
|
||||
export type UserUpdateWithoutAccountsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sessions?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||
complexes?: Prisma.ComplexUserUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateWithoutAccountsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sessions?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||
complexes?: Prisma.ComplexUserUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserCreateWithoutComplexesInput = {
|
||||
id: string
|
||||
name: string
|
||||
email: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
sessions?: Prisma.SessionCreateNestedManyWithoutUserInput
|
||||
accounts?: Prisma.AccountCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserUncheckedCreateWithoutComplexesInput = {
|
||||
id: string
|
||||
supabaseUserId: string
|
||||
name: string
|
||||
email: string
|
||||
fullName: string
|
||||
emailVerified?: boolean
|
||||
image?: string | null
|
||||
phone?: string | null
|
||||
banned?: boolean
|
||||
bannedAt?: Date | string | null
|
||||
banReason?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
role?: string
|
||||
sessions?: Prisma.SessionUncheckedCreateNestedManyWithoutUserInput
|
||||
accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type UserCreateOrConnectWithoutComplexesInput = {
|
||||
@@ -389,20 +767,36 @@ export type UserUpdateToOneWithWhereWithoutComplexesInput = {
|
||||
|
||||
export type UserUpdateWithoutComplexesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fullName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sessions?: Prisma.SessionUpdateManyWithoutUserNestedInput
|
||||
accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type UserUncheckedUpdateWithoutComplexesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
email?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fullName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
emailVerified?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
banned?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
bannedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||
banReason?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
role?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
sessions?: Prisma.SessionUncheckedUpdateManyWithoutUserNestedInput
|
||||
accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
|
||||
@@ -411,10 +805,14 @@ export type UserUncheckedUpdateWithoutComplexesInput = {
|
||||
*/
|
||||
|
||||
export type UserCountOutputType = {
|
||||
sessions: number
|
||||
accounts: number
|
||||
complexes: number
|
||||
}
|
||||
|
||||
export type UserCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
sessions?: boolean | UserCountOutputTypeCountSessionsArgs
|
||||
accounts?: boolean | UserCountOutputTypeCountAccountsArgs
|
||||
complexes?: boolean | UserCountOutputTypeCountComplexesArgs
|
||||
}
|
||||
|
||||
@@ -428,6 +826,20 @@ export type UserCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensi
|
||||
select?: Prisma.UserCountOutputTypeSelect<ExtArgs> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* UserCountOutputType without action
|
||||
*/
|
||||
export type UserCountOutputTypeCountSessionsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.SessionWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* UserCountOutputType without action
|
||||
*/
|
||||
export type UserCountOutputTypeCountAccountsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.AccountWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* UserCountOutputType without action
|
||||
*/
|
||||
@@ -438,44 +850,72 @@ export type UserCountOutputTypeCountComplexesArgs<ExtArgs extends runtime.Types.
|
||||
|
||||
export type UserSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
supabaseUserId?: boolean
|
||||
name?: boolean
|
||||
email?: boolean
|
||||
fullName?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
phone?: boolean
|
||||
banned?: boolean
|
||||
bannedAt?: boolean
|
||||
banReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
role?: boolean
|
||||
sessions?: boolean | Prisma.User$sessionsArgs<ExtArgs>
|
||||
accounts?: boolean | Prisma.User$accountsArgs<ExtArgs>
|
||||
complexes?: boolean | Prisma.User$complexesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.UserCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["user"]>
|
||||
|
||||
export type UserSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
supabaseUserId?: boolean
|
||||
name?: boolean
|
||||
email?: boolean
|
||||
fullName?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
phone?: boolean
|
||||
banned?: boolean
|
||||
bannedAt?: boolean
|
||||
banReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
role?: boolean
|
||||
}, ExtArgs["result"]["user"]>
|
||||
|
||||
export type UserSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
supabaseUserId?: boolean
|
||||
name?: boolean
|
||||
email?: boolean
|
||||
fullName?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
phone?: boolean
|
||||
banned?: boolean
|
||||
bannedAt?: boolean
|
||||
banReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
role?: boolean
|
||||
}, ExtArgs["result"]["user"]>
|
||||
|
||||
export type UserSelectScalar = {
|
||||
id?: boolean
|
||||
supabaseUserId?: boolean
|
||||
name?: boolean
|
||||
email?: boolean
|
||||
fullName?: boolean
|
||||
emailVerified?: boolean
|
||||
image?: boolean
|
||||
phone?: boolean
|
||||
banned?: boolean
|
||||
bannedAt?: boolean
|
||||
banReason?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
role?: boolean
|
||||
}
|
||||
|
||||
export type UserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "supabaseUserId" | "email" | "fullName" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]>
|
||||
export type UserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "email" | "emailVerified" | "image" | "phone" | "banned" | "bannedAt" | "banReason" | "createdAt" | "updatedAt" | "role", ExtArgs["result"]["user"]>
|
||||
export type UserInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
sessions?: boolean | Prisma.User$sessionsArgs<ExtArgs>
|
||||
accounts?: boolean | Prisma.User$accountsArgs<ExtArgs>
|
||||
complexes?: boolean | Prisma.User$complexesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.UserCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
@@ -485,15 +925,23 @@ export type UserIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensi
|
||||
export type $UserPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "User"
|
||||
objects: {
|
||||
sessions: Prisma.$SessionPayload<ExtArgs>[]
|
||||
accounts: Prisma.$AccountPayload<ExtArgs>[]
|
||||
complexes: Prisma.$ComplexUserPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
supabaseUserId: string
|
||||
name: string
|
||||
email: string
|
||||
fullName: string
|
||||
emailVerified: boolean
|
||||
image: string | null
|
||||
phone: string | null
|
||||
banned: boolean
|
||||
bannedAt: Date | null
|
||||
banReason: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
role: string
|
||||
}, ExtArgs["result"]["user"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -888,6 +1336,8 @@ readonly fields: UserFieldRefs;
|
||||
*/
|
||||
export interface Prisma__UserClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
sessions<T extends Prisma.User$sessionsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$sessionsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SessionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
accounts<T extends Prisma.User$accountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$accountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
complexes<T extends Prisma.User$complexesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$complexesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
@@ -919,11 +1369,17 @@ export interface Prisma__UserClient<T, Null = never, ExtArgs extends runtime.Typ
|
||||
*/
|
||||
export interface UserFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"User", 'String'>
|
||||
readonly supabaseUserId: Prisma.FieldRef<"User", 'String'>
|
||||
readonly name: Prisma.FieldRef<"User", 'String'>
|
||||
readonly email: Prisma.FieldRef<"User", 'String'>
|
||||
readonly fullName: Prisma.FieldRef<"User", 'String'>
|
||||
readonly emailVerified: Prisma.FieldRef<"User", 'Boolean'>
|
||||
readonly image: Prisma.FieldRef<"User", 'String'>
|
||||
readonly phone: Prisma.FieldRef<"User", 'String'>
|
||||
readonly banned: Prisma.FieldRef<"User", 'Boolean'>
|
||||
readonly bannedAt: Prisma.FieldRef<"User", 'DateTime'>
|
||||
readonly banReason: Prisma.FieldRef<"User", 'String'>
|
||||
readonly createdAt: Prisma.FieldRef<"User", 'DateTime'>
|
||||
readonly updatedAt: Prisma.FieldRef<"User", 'DateTime'>
|
||||
readonly role: Prisma.FieldRef<"User", 'String'>
|
||||
}
|
||||
|
||||
|
||||
@@ -1316,6 +1772,54 @@ export type UserDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* User.sessions
|
||||
*/
|
||||
export type User$sessionsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Session
|
||||
*/
|
||||
select?: Prisma.SessionSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Session
|
||||
*/
|
||||
omit?: Prisma.SessionOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.SessionInclude<ExtArgs> | null
|
||||
where?: Prisma.SessionWhereInput
|
||||
orderBy?: Prisma.SessionOrderByWithRelationInput | Prisma.SessionOrderByWithRelationInput[]
|
||||
cursor?: Prisma.SessionWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.SessionScalarFieldEnum | Prisma.SessionScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* User.accounts
|
||||
*/
|
||||
export type User$accountsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Account
|
||||
*/
|
||||
select?: Prisma.AccountSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Account
|
||||
*/
|
||||
omit?: Prisma.AccountOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.AccountInclude<ExtArgs> | null
|
||||
where?: Prisma.AccountWhereInput
|
||||
orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[]
|
||||
cursor?: Prisma.AccountWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* User.complexes
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { createApp } from '@/app'
|
||||
import { registerRoutes } from '@/register-routes'
|
||||
import { createApp } from '@/app';
|
||||
import { registerRoutes } from '@/register-routes';
|
||||
|
||||
const app = createApp()
|
||||
registerRoutes(app)
|
||||
const app = createApp();
|
||||
registerRoutes(app);
|
||||
|
||||
export type AppType = typeof app
|
||||
export default app
|
||||
export type AppType = typeof app;
|
||||
export default app;
|
||||
|
||||
139
apps/backend/src/lib/auth.ts
Normal file
139
apps/backend/src/lib/auth.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
import { wrapLayout } from '@/emails/booking-confirmation';
|
||||
import { dash } from '@better-auth/infra';
|
||||
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';
|
||||
|
||||
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,
|
||||
},
|
||||
phone: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
},
|
||||
banned: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
},
|
||||
bannedAt: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
},
|
||||
banReason: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
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);
|
||||
|
||||
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>
|
||||
|
||||
<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',
|
||||
],
|
||||
plugins: [openAPI(), dash()],
|
||||
});
|
||||
|
||||
export type Session = typeof auth.$Infer.Session.session;
|
||||
export type User = typeof auth.$Infer.Session.user;
|
||||
17
apps/backend/src/lib/avatar.ts
Normal file
17
apps/backend/src/lib/avatar.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
}
|
||||
58
apps/backend/src/lib/errors.ts
Normal file
58
apps/backend/src/lib/errors.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
// 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 };
|
||||
},
|
||||
};
|
||||
68
apps/backend/src/lib/geoip.ts
Normal file
68
apps/backend/src/lib/geoip.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
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 };
|
||||
20
apps/backend/src/lib/http/error-handler.ts
Normal file
20
apps/backend/src/lib/http/error-handler.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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);
|
||||
}
|
||||
};
|
||||
20
apps/backend/src/lib/http/handle-result.ts
Normal file
20
apps/backend/src/lib/http/handle-result.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
29
apps/backend/src/lib/http/problem-builders.ts
Normal file
29
apps/backend/src/lib/http/problem-builders.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// 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,
|
||||
};
|
||||
}
|
||||
10
apps/backend/src/lib/http/problem-details.ts
Normal file
10
apps/backend/src/lib/http/problem-details.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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[]>;
|
||||
};
|
||||
51
apps/backend/src/lib/http/problem-mapper.ts
Normal file
51
apps/backend/src/lib/http/problem-mapper.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
16
apps/backend/src/lib/http/request-id.ts
Normal file
16
apps/backend/src/lib/http/request-id.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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();
|
||||
};
|
||||
48
apps/backend/src/lib/http/validate.ts
Normal file
48
apps/backend/src/lib/http/validate.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
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);
|
||||
},
|
||||
};
|
||||
16
apps/backend/src/lib/http/zod-issues.ts
Normal file
16
apps/backend/src/lib/http/zod-issues.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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,6 +1,6 @@
|
||||
import pino from 'pino'
|
||||
import pino from 'pino';
|
||||
|
||||
const isProd = Bun.env.NODE_ENV === 'production'
|
||||
const isProd = Bun.env.NODE_ENV === 'production';
|
||||
|
||||
export const logger = pino({
|
||||
level: Bun.env.LOG_LEVEL ?? (isProd ? 'info' : 'debug'),
|
||||
@@ -15,4 +15,4 @@ export const logger = pino({
|
||||
ignore: 'pid,hostname',
|
||||
},
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1,44 +1,39 @@
|
||||
import nodemailer from 'nodemailer'
|
||||
import { MailtrapClientConfig, MailtrapTransport } from 'mailtrap';
|
||||
import nodemailer from 'nodemailer';
|
||||
|
||||
let cachedTransporter: ReturnType<typeof nodemailer.createTransport> | null = null
|
||||
const TOKEN = Bun.env.MAILTRAP_API_TOKEN;
|
||||
|
||||
let cachedTransporter: ReturnType<typeof nodemailer.createTransport> | null = null;
|
||||
|
||||
function getTransporter() {
|
||||
if (cachedTransporter) return cachedTransporter
|
||||
if (cachedTransporter) return cachedTransporter;
|
||||
|
||||
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.',
|
||||
)
|
||||
if (!TOKEN) {
|
||||
throw new Error('Missing MAILTRAP_API_TOKEN env var.');
|
||||
}
|
||||
|
||||
cachedTransporter = nodemailer.createTransport({
|
||||
host: smtpHost,
|
||||
port: smtpPort,
|
||||
secure: smtpPort === 465,
|
||||
auth: {
|
||||
user: smtpUser,
|
||||
pass: smtpPass,
|
||||
},
|
||||
})
|
||||
const config: MailtrapClientConfig = {
|
||||
token: TOKEN,
|
||||
sandbox: Bun.env.MAIL_SANDBOX === 'true',
|
||||
testInboxId: Bun.env.MAIL_INBOX_ID ? Number(Bun.env.MAIL_INBOX_ID) : undefined,
|
||||
};
|
||||
|
||||
return cachedTransporter
|
||||
console.log(JSON.stringify(config, null, 2));
|
||||
|
||||
cachedTransporter = nodemailer.createTransport(MailtrapTransport(config));
|
||||
return cachedTransporter;
|
||||
}
|
||||
|
||||
export async function sendMail(input: {
|
||||
to: string
|
||||
subject: string
|
||||
html: string
|
||||
text: string
|
||||
to: string;
|
||||
subject: string;
|
||||
html: string;
|
||||
text: string;
|
||||
}) {
|
||||
const smtpFrom = Bun.env.SMTP_FROM
|
||||
const smtpFrom = Bun.env.SMTP_FROM;
|
||||
|
||||
if (!smtpFrom) {
|
||||
throw new Error('Missing SMTP_FROM env var.')
|
||||
throw new Error('Missing SMTP_FROM env var.');
|
||||
}
|
||||
|
||||
await getTransporter().sendMail({
|
||||
@@ -47,5 +42,5 @@ export async function sendMail(input: {
|
||||
subject: input.subject,
|
||||
html: input.html,
|
||||
text: input.text,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
import { PrismaPg } from '@prisma/adapter-pg'
|
||||
import { PrismaClient } from '@/generated/prisma/client'
|
||||
import { PrismaClient } from '@/generated/prisma/client';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
|
||||
const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient }
|
||||
const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient };
|
||||
|
||||
function hasExpectedDelegates(client: PrismaClient) {
|
||||
const prismaClient = client as unknown as {
|
||||
court?: { findMany?: unknown }
|
||||
sport?: { findMany?: unknown }
|
||||
}
|
||||
court?: { findMany?: unknown };
|
||||
sport?: { findMany?: unknown };
|
||||
};
|
||||
|
||||
return (
|
||||
typeof prismaClient.court?.findMany === 'function' &&
|
||||
typeof prismaClient.sport?.findMany === 'function'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function buildPrismaClient() {
|
||||
const databaseUrl = Bun.env.DATABASE_URL
|
||||
const databaseUrl = Bun.env.DATABASE_URL;
|
||||
|
||||
if (!databaseUrl) {
|
||||
throw new Error('Missing DATABASE_URL in backend environment.')
|
||||
throw new Error('Missing DATABASE_URL in backend environment.');
|
||||
}
|
||||
|
||||
const adapter = new PrismaPg({
|
||||
connectionString: databaseUrl,
|
||||
})
|
||||
});
|
||||
|
||||
return new PrismaClient({ adapter })
|
||||
return new PrismaClient({ adapter });
|
||||
}
|
||||
|
||||
export function getPrismaClient() {
|
||||
if (globalForPrisma.prisma && hasExpectedDelegates(globalForPrisma.prisma)) {
|
||||
return globalForPrisma.prisma
|
||||
return globalForPrisma.prisma;
|
||||
}
|
||||
|
||||
if (globalForPrisma.prisma && !hasExpectedDelegates(globalForPrisma.prisma)) {
|
||||
void globalForPrisma.prisma.$disconnect()
|
||||
void globalForPrisma.prisma.$disconnect();
|
||||
}
|
||||
|
||||
const prisma = buildPrismaClient()
|
||||
const prisma = buildPrismaClient();
|
||||
|
||||
if (Bun.env.NODE_ENV !== 'production') {
|
||||
globalForPrisma.prisma = prisma
|
||||
globalForPrisma.prisma = prisma;
|
||||
}
|
||||
|
||||
return prisma
|
||||
return prisma;
|
||||
}
|
||||
|
||||
export const db = getPrismaClient()
|
||||
export const db = getPrismaClient();
|
||||
|
||||
12
apps/backend/src/lib/result.ts
Normal file
12
apps/backend/src/lib/result.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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 };
|
||||
}
|
||||
34
apps/backend/src/lib/slot-validator.ts
Normal file
34
apps/backend/src/lib/slot-validator.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
}
|
||||
84
apps/backend/src/lib/sse.ts
Normal file
84
apps/backend/src/lib/sse.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
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,26 +0,0 @@
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
let cachedClient: ReturnType<typeof createClient> | null = null
|
||||
|
||||
export function getSupabaseAdminClient() {
|
||||
if (cachedClient) return cachedClient
|
||||
|
||||
const supabaseUrl = Bun.env.SUPABASE_URL ?? Bun.env.VITE_SUPABASE_URL
|
||||
const supabaseServiceRoleKey = Bun.env.SUPABASE_SERVICE_ROLE_KEY
|
||||
|
||||
if (!supabaseUrl || !supabaseServiceRoleKey) {
|
||||
throw new Error(
|
||||
'Missing Supabase admin env vars. Set SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY in backend environment.',
|
||||
)
|
||||
}
|
||||
|
||||
cachedClient = createClient(supabaseUrl, supabaseServiceRoleKey, {
|
||||
auth: {
|
||||
autoRefreshToken: false,
|
||||
persistSession: false,
|
||||
detectSessionInUrl: false,
|
||||
},
|
||||
})
|
||||
|
||||
return cachedClient
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const supabaseUrl = Bun.env.SUPABASE_URL ?? Bun.env.VITE_SUPABASE_URL
|
||||
const supabaseAnonKey =
|
||||
Bun.env.SUPABASE_ANON_KEY ?? Bun.env.VITE_SUPABASE_ANON_KEY
|
||||
|
||||
if (!supabaseUrl || !supabaseAnonKey) {
|
||||
throw new Error(
|
||||
'Missing Supabase env vars. Set SUPABASE_URL/SUPABASE_ANON_KEY (or VITE_SUPABASE_URL/VITE_SUPABASE_ANON_KEY) in backend environment.',
|
||||
)
|
||||
}
|
||||
|
||||
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
|
||||
auth: {
|
||||
autoRefreshToken: false,
|
||||
persistSession: false,
|
||||
detectSessionInUrl: false,
|
||||
},
|
||||
})
|
||||
@@ -1,50 +1,68 @@
|
||||
import type { MiddlewareHandler } from 'hono'
|
||||
import { db } from '@/lib/prisma'
|
||||
import { supabase } from '@/lib/supabase'
|
||||
import type { AppEnv } from '@/types/hono'
|
||||
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';
|
||||
|
||||
function getBearerToken(value: string | undefined): string | null {
|
||||
if (!value) return null
|
||||
const [scheme, token] = value.split(' ')
|
||||
if (scheme?.toLowerCase() !== 'bearer' || !token) return null
|
||||
return token
|
||||
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 = createMiddleware<AppEnv>(async (c, next) => {
|
||||
const session = await auth.api.getSession({
|
||||
headers: c.req.raw.headers,
|
||||
});
|
||||
|
||||
if (!session) {
|
||||
return c.json({ message: 'Unauthorized' }, 401);
|
||||
}
|
||||
|
||||
export const requireAuth: MiddlewareHandler<AppEnv> = async (
|
||||
c,
|
||||
next,
|
||||
) => {
|
||||
const token = getBearerToken(c.req.header('authorization'))
|
||||
const user = session.user as { banned?: boolean; banReason?: string | null };
|
||||
|
||||
if (!token) {
|
||||
return c.json({ message: 'Missing bearer token.' }, 403)
|
||||
}
|
||||
|
||||
const { data, error } = await supabase.auth.getUser(token)
|
||||
|
||||
if (error || !data.user) {
|
||||
return c.json({ message: 'Invalid or expired token.' }, 403)
|
||||
}
|
||||
|
||||
const email = data.user.email?.toLowerCase()
|
||||
|
||||
if (!email) {
|
||||
return c.json({ message: 'Auth user does not contain email.' }, 403)
|
||||
}
|
||||
|
||||
const appUser = await db.user.findFirst({
|
||||
where: {
|
||||
supabaseUserId: data.user.id,
|
||||
email,
|
||||
if (user.banned) {
|
||||
return c.json(
|
||||
{
|
||||
message: 'Tu cuenta ha sido bloqueada.',
|
||||
...(user.banReason ? { reason: user.banReason } : {}),
|
||||
},
|
||||
select: { id: true },
|
||||
})
|
||||
|
||||
if (!appUser) {
|
||||
return c.json({ message: 'User not provisioned in backend.' }, 403)
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
c.set('authUser', data.user)
|
||||
c.set('appUserId', appUser.id)
|
||||
await next()
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,29 @@
|
||||
import type { MiddlewareHandler } from 'hono'
|
||||
import type { AppEnv } from '@/types/hono'
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import type { MiddlewareHandler } from 'hono';
|
||||
|
||||
function getSuperAdminEmails(): Set<string> {
|
||||
const raw = Bun.env.SUPER_ADMIN_EMAILS ?? ''
|
||||
const raw = Bun.env.SUPER_ADMIN_EMAILS ?? '';
|
||||
const emails = raw
|
||||
.split(',')
|
||||
.map((value) => value.trim().toLowerCase())
|
||||
.filter(Boolean)
|
||||
return new Set(emails)
|
||||
.filter(Boolean);
|
||||
return new Set(emails);
|
||||
}
|
||||
|
||||
export const requireSuperAdmin: MiddlewareHandler<AppEnv> = async (
|
||||
c,
|
||||
next,
|
||||
) => {
|
||||
const authUser = c.get('authUser')
|
||||
const role =
|
||||
typeof authUser.app_metadata?.role === 'string'
|
||||
? authUser.app_metadata.role
|
||||
: null
|
||||
const email = authUser.email?.toLowerCase()
|
||||
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();
|
||||
|
||||
if (role === 'super_admin') {
|
||||
await next()
|
||||
return
|
||||
await next();
|
||||
return;
|
||||
}
|
||||
|
||||
if (email && getSuperAdminEmails().has(email)) {
|
||||
await next()
|
||||
return
|
||||
await next();
|
||||
return;
|
||||
}
|
||||
|
||||
return c.json({ message: 'Este recurso requiere permisos de super admin.' }, 403)
|
||||
}
|
||||
return c.json({ message: 'Este recurso requiere permisos de super admin.' }, 403);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
import { requireAuth } from '@/middlewares/require-auth.middleware';
|
||||
import { cancelRecurringGroupHandler } from '@/modules/admin-booking/handlers/cancel-recurring-group.handler';
|
||||
import { createAdminBookingHandler } from '@/modules/admin-booking/handlers/create-admin-booking.handler';
|
||||
import { createAdminRecurringBookingHandler } from '@/modules/admin-booking/handlers/create-admin-recurring-booking.handler';
|
||||
import { listAdminBookingsHandler } from '@/modules/admin-booking/handlers/list-admin-bookings.handler';
|
||||
import { listRecurringGroupsHandler } from '@/modules/admin-booking/handlers/list-recurring-groups.handler';
|
||||
import { updateAdminBookingStatusHandler } from '@/modules/admin-booking/handlers/update-admin-booking-status.handler';
|
||||
import { updateRecurringGroupHandler } from '@/modules/admin-booking/handlers/update-recurring-group.handler';
|
||||
import type { AppEnv } from '@/types/hono';
|
||||
import { zValidator } from '@hono/zod-validator';
|
||||
import {
|
||||
createAdminBookingSchema,
|
||||
createRecurringBookingSchema,
|
||||
listAdminBookingsQuerySchema,
|
||||
updateAdminBookingStatusSchema,
|
||||
updateRecurringGroupSchema,
|
||||
} from '@repo/api-contract';
|
||||
import { Hono } from 'hono';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const adminBookingRoutes = new Hono<AppEnv>();
|
||||
const complexIdParamsSchema = z.object({ complexId: z.uuid() });
|
||||
const bookingIdParamsSchema = z.object({ id: z.uuid() });
|
||||
const groupIdParamsSchema = z.object({ groupId: z.uuid() });
|
||||
|
||||
adminBookingRoutes.use('*', requireAuth);
|
||||
|
||||
adminBookingRoutes.get(
|
||||
'/complex/:complexId',
|
||||
zValidator('param', complexIdParamsSchema),
|
||||
zValidator('query', listAdminBookingsQuerySchema),
|
||||
listAdminBookingsHandler
|
||||
);
|
||||
|
||||
adminBookingRoutes.post(
|
||||
'/complex/:complexId',
|
||||
zValidator('param', complexIdParamsSchema),
|
||||
zValidator('json', createAdminBookingSchema),
|
||||
createAdminBookingHandler
|
||||
);
|
||||
|
||||
adminBookingRoutes.post(
|
||||
'/complex/:complexId/recurring',
|
||||
zValidator('param', complexIdParamsSchema),
|
||||
zValidator('json', createRecurringBookingSchema),
|
||||
createAdminRecurringBookingHandler
|
||||
);
|
||||
|
||||
adminBookingRoutes.post(
|
||||
'/recurring/:groupId/cancel',
|
||||
zValidator('param', groupIdParamsSchema),
|
||||
cancelRecurringGroupHandler
|
||||
);
|
||||
|
||||
adminBookingRoutes.get(
|
||||
'/complex/:complexId/recurring',
|
||||
zValidator('param', complexIdParamsSchema),
|
||||
listRecurringGroupsHandler
|
||||
);
|
||||
|
||||
adminBookingRoutes.patch(
|
||||
'/recurring/:groupId',
|
||||
zValidator('param', groupIdParamsSchema),
|
||||
zValidator('json', updateRecurringGroupSchema),
|
||||
updateRecurringGroupHandler
|
||||
);
|
||||
|
||||
adminBookingRoutes.patch(
|
||||
'/:id/status',
|
||||
zValidator('param', bookingIdParamsSchema),
|
||||
zValidator('json', updateAdminBookingStatusSchema),
|
||||
updateAdminBookingStatusHandler
|
||||
);
|
||||
@@ -0,0 +1,20 @@
|
||||
import { AdminBookingServiceError } from '@/modules/admin-booking/services/admin-booking.service';
|
||||
import { cancelRecurringGroup } from '@/modules/admin-booking/services/admin-recurring-booking.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
type GroupIdParams = { groupId: string };
|
||||
|
||||
export async function cancelRecurringGroupHandler(c: AppContext) {
|
||||
const { groupId } = c.req.valid('param' as never) as GroupIdParams;
|
||||
const user = c.get('user');
|
||||
|
||||
try {
|
||||
const result = await cancelRecurringGroup(user.id, groupId);
|
||||
return c.json(result);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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';
|
||||
|
||||
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');
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
return c.json(booking, 201);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { AdminBookingServiceError } from '@/modules/admin-booking/services/admin-booking.service';
|
||||
import { createAdminRecurringBooking } from '@/modules/admin-booking/services/admin-recurring-booking.service';
|
||||
import { sendBookingConfirmation } from '@/services/booking-email.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { CreateRecurringBookingInput } from '@repo/api-contract';
|
||||
|
||||
type ComplexIdParams = { complexId: string };
|
||||
|
||||
export async function createAdminRecurringBookingHandler(c: AppContext) {
|
||||
const { complexId } = c.req.valid('param' as never) as ComplexIdParams;
|
||||
const payload = c.req.valid('json' as never) as CreateRecurringBookingInput;
|
||||
const user = c.get('user');
|
||||
|
||||
try {
|
||||
const group = await createAdminRecurringBooking(user.id, complexId, payload);
|
||||
|
||||
const firstBooking = group.bookings[0];
|
||||
if (firstBooking?.customerEmail) {
|
||||
void sendBookingConfirmation({
|
||||
bookingCode: firstBooking.bookingCode,
|
||||
complexName: firstBooking.complexName,
|
||||
date: firstBooking.date,
|
||||
startTime: firstBooking.startTime,
|
||||
endTime: firstBooking.endTime,
|
||||
courtName: firstBooking.courtName,
|
||||
sportName: firstBooking.sport.name,
|
||||
customerName: firstBooking.customerName,
|
||||
customerEmail: firstBooking.customerEmail,
|
||||
price: firstBooking.price,
|
||||
});
|
||||
}
|
||||
|
||||
return c.json(group, 201);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import {
|
||||
AdminBookingServiceError,
|
||||
listAdminBookings,
|
||||
} from '@/modules/admin-booking/services/admin-booking.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { ListAdminBookingsQuery } from '@repo/api-contract';
|
||||
|
||||
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');
|
||||
|
||||
try {
|
||||
const response = await listAdminBookings(user.id, complexId, query);
|
||||
return c.json(response);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { AdminBookingServiceError } from '@/modules/admin-booking/services/admin-booking.service';
|
||||
import { listRecurringGroups } from '@/modules/admin-booking/services/admin-recurring-booking.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
|
||||
type ComplexIdParams = { complexId: string };
|
||||
|
||||
export async function listRecurringGroupsHandler(c: AppContext) {
|
||||
const { complexId } = c.req.valid('param' as never) as ComplexIdParams;
|
||||
|
||||
try {
|
||||
const groups = await listRecurringGroups(complexId);
|
||||
return c.json({ groups });
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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';
|
||||
|
||||
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');
|
||||
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
||||
return c.json(booking);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { AdminBookingServiceError } from '@/modules/admin-booking/services/admin-booking.service';
|
||||
import { updateRecurringGroup } from '@/modules/admin-booking/services/admin-recurring-booking.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import type { UpdateRecurringGroupInput } from '@repo/api-contract';
|
||||
|
||||
type GroupIdParams = { groupId: string };
|
||||
|
||||
export async function updateRecurringGroupHandler(c: AppContext) {
|
||||
const { groupId } = c.req.valid('param' as never) as GroupIdParams;
|
||||
const payload = c.req.valid('json' as never) as UpdateRecurringGroupInput;
|
||||
const user = c.get('user');
|
||||
|
||||
try {
|
||||
const group = await updateRecurringGroup(user.id, groupId, payload);
|
||||
return c.json(group);
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
return c.json({ message: error.message }, error.status);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,600 @@
|
||||
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,
|
||||
ListAdminBookingsQuery,
|
||||
UpdateAdminBookingStatusInput,
|
||||
} from '@repo/api-contract';
|
||||
import { v7 as uuidv7 } from 'uuid';
|
||||
|
||||
type Slot = {
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
};
|
||||
|
||||
const DAY_OF_WEEK_BY_INDEX = [
|
||||
'SUNDAY',
|
||||
'MONDAY',
|
||||
'TUESDAY',
|
||||
'WEDNESDAY',
|
||||
'THURSDAY',
|
||||
'FRIDAY',
|
||||
'SATURDAY',
|
||||
] as const;
|
||||
const BOOKING_CODE_ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
|
||||
const BOOKING_CODE_LENGTH = 6;
|
||||
|
||||
export class AdminBookingServiceError extends Error {
|
||||
status: 400 | 403 | 404 | 409;
|
||||
|
||||
constructor(message: string, status: 400 | 403 | 404 | 409) {
|
||||
super(message);
|
||||
this.name = 'AdminBookingServiceError';
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
||||
function toMinutes(value: string): number {
|
||||
const [hours, minutes] = value.split(':').map((part) => Number(part));
|
||||
return hours * 60 + minutes;
|
||||
}
|
||||
|
||||
function minutesToTime(minutes: number): string {
|
||||
const safeMinutes = Math.max(0, minutes);
|
||||
const hours = Math.floor(safeMinutes / 60);
|
||||
const mins = safeMinutes % 60;
|
||||
return `${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
function parseIsoDate(date: string): Date {
|
||||
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(date);
|
||||
|
||||
if (!match) {
|
||||
throw new AdminBookingServiceError('La fecha debe tener formato YYYY-MM-DD.', 400);
|
||||
}
|
||||
|
||||
const year = Number(match[1]);
|
||||
const month = Number(match[2]);
|
||||
const day = Number(match[3]);
|
||||
|
||||
const bookingDate = new Date(Date.UTC(year, month - 1, day));
|
||||
|
||||
if (
|
||||
Number.isNaN(bookingDate.getTime()) ||
|
||||
bookingDate.getUTCFullYear() !== year ||
|
||||
bookingDate.getUTCMonth() + 1 !== month ||
|
||||
bookingDate.getUTCDate() !== day
|
||||
) {
|
||||
throw new AdminBookingServiceError('La fecha enviada no es valida.', 400);
|
||||
}
|
||||
|
||||
return bookingDate;
|
||||
}
|
||||
|
||||
function getDayOfWeek(date: Date) {
|
||||
const dayOfWeek = DAY_OF_WEEK_BY_INDEX[date.getUTCDay()];
|
||||
|
||||
if (!dayOfWeek) {
|
||||
throw new AdminBookingServiceError('No se pudo resolver el dia de la semana.', 400);
|
||||
}
|
||||
|
||||
return dayOfWeek;
|
||||
}
|
||||
|
||||
function formatIsoDate(date: Date): string {
|
||||
return date.toISOString().slice(0, 10);
|
||||
}
|
||||
|
||||
function generateBookingCode(): string {
|
||||
let code = '';
|
||||
|
||||
for (let index = 0; index < BOOKING_CODE_LENGTH; index += 1) {
|
||||
code += BOOKING_CODE_ALPHABET[randomInt(0, BOOKING_CODE_ALPHABET.length)];
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
function buildSlots(
|
||||
availability: Array<{
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
}>,
|
||||
slotDurationMinutes: number
|
||||
): Slot[] {
|
||||
const slots: Slot[] = [];
|
||||
|
||||
for (const range of availability) {
|
||||
const start = toMinutes(range.startTime);
|
||||
const end = toMinutes(range.endTime);
|
||||
|
||||
for (
|
||||
let current = start;
|
||||
current + slotDurationMinutes <= end;
|
||||
current += slotDurationMinutes
|
||||
) {
|
||||
slots.push({
|
||||
startTime: minutesToTime(current),
|
||||
endTime: minutesToTime(current + slotDurationMinutes),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
async function ensureComplexAccess(complexId: string, userId: string) {
|
||||
const complexUser = await db.complexUser.findUnique({
|
||||
where: {
|
||||
complexId_userId: {
|
||||
complexId,
|
||||
userId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
complexName: true,
|
||||
plan: {
|
||||
select: {
|
||||
rules: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!complexUser) {
|
||||
throw new AdminBookingServiceError('No tienes permisos para administrar este complejo.', 403);
|
||||
}
|
||||
|
||||
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;
|
||||
bookingDate: Date;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
customerName: string;
|
||||
customerPhone: string;
|
||||
customerEmail: string;
|
||||
status: 'CONFIRMED' | 'CANCELLED' | 'COMPLETED' | 'NOSHOW';
|
||||
recurringGroupId: string | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
court: {
|
||||
id: string;
|
||||
name: string;
|
||||
complex: {
|
||||
id: string;
|
||||
complexName: string;
|
||||
};
|
||||
sport: {
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
};
|
||||
};
|
||||
price?: number;
|
||||
}): AdminBooking {
|
||||
return {
|
||||
id: booking.id,
|
||||
bookingCode: booking.bookingCode,
|
||||
complexId: booking.court.complex.id,
|
||||
complexName: booking.court.complex.complexName,
|
||||
courtId: booking.court.id,
|
||||
courtName: booking.court.name,
|
||||
sport: {
|
||||
id: booking.court.sport.id,
|
||||
name: booking.court.sport.name,
|
||||
slug: booking.court.sport.slug,
|
||||
},
|
||||
date: formatIsoDate(booking.bookingDate),
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
customerName: booking.customerName,
|
||||
customerPhone: booking.customerPhone,
|
||||
customerEmail: booking.customerEmail,
|
||||
price: booking.price ?? 0,
|
||||
status: booking.status,
|
||||
recurringGroupId: booking.recurringGroupId,
|
||||
createdAt: booking.createdAt.toISOString(),
|
||||
updatedAt: booking.updatedAt.toISOString(),
|
||||
};
|
||||
}
|
||||
|
||||
export async function listAdminBookings(
|
||||
userId: string,
|
||||
complexId: string,
|
||||
query: ListAdminBookingsQuery
|
||||
) {
|
||||
await ensureComplexAccess(complexId, userId);
|
||||
const fromDate = parseIsoDate(query.fromDate);
|
||||
|
||||
const bookings = await db.courtBooking.findMany({
|
||||
where: {
|
||||
bookingDate: {
|
||||
gte: fromDate,
|
||||
},
|
||||
court: {
|
||||
complexId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
complexName: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: [{ bookingDate: 'asc' }, { startTime: 'asc' }, { createdAt: 'asc' }],
|
||||
});
|
||||
|
||||
const response = bookings.map((booking) => mapBookingResponse(booking));
|
||||
|
||||
return {
|
||||
bookings: response,
|
||||
};
|
||||
}
|
||||
|
||||
export async function createAdminBooking(
|
||||
userId: 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 bookingDate = parseIsoDate(input.date);
|
||||
const dayOfWeek = getDayOfWeek(bookingDate);
|
||||
|
||||
const court = await db.court.findFirst({
|
||||
where: {
|
||||
id: input.courtId,
|
||||
complexId,
|
||||
},
|
||||
include: {
|
||||
availabilities: {
|
||||
where: {
|
||||
dayOfWeek,
|
||||
},
|
||||
orderBy: {
|
||||
startTime: 'asc',
|
||||
},
|
||||
},
|
||||
sport: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
priceRules: {
|
||||
where: { isActive: true },
|
||||
orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!court) {
|
||||
throw new AdminBookingServiceError('La cancha seleccionada no existe en el complejo.', 404);
|
||||
}
|
||||
|
||||
const validSlots = buildSlots(court.availabilities, court.slotDurationMinutes);
|
||||
const selectedStartMinutes = toMinutes(input.startTime);
|
||||
const selectedEndMinutes = selectedStartMinutes + court.slotDurationMinutes;
|
||||
const selectedSlot = {
|
||||
startTime: input.startTime,
|
||||
endTime: minutesToTime(selectedEndMinutes),
|
||||
};
|
||||
|
||||
const slotExists = validSlots.some(
|
||||
(slot) => slot.startTime === selectedSlot.startTime && slot.endTime === selectedSlot.endTime
|
||||
);
|
||||
|
||||
if (!slotExists) {
|
||||
throw new AdminBookingServiceError(
|
||||
'El horario seleccionado no esta disponible para esa cancha.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
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) => {
|
||||
if (complex.plan) {
|
||||
const rules = parsePlanRules(complex.plan.rules);
|
||||
const bookingsForDate = await tx.courtBooking.count({
|
||||
where: {
|
||||
bookingDate,
|
||||
status: 'CONFIRMED',
|
||||
court: {
|
||||
complexId,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const courtsCount = await tx.court.count({
|
||||
where: {
|
||||
complexId,
|
||||
},
|
||||
});
|
||||
|
||||
const violations = evaluatePlanUsage(rules, {
|
||||
courtsCount,
|
||||
bookingsToday: bookingsForDate,
|
||||
});
|
||||
|
||||
const maxBookingsViolation = violations.find(
|
||||
(violation) => violation.code === 'MAX_BOOKINGS_PER_DAY_REACHED'
|
||||
);
|
||||
|
||||
if (maxBookingsViolation) {
|
||||
throw new AdminBookingServiceError(maxBookingsViolation.message, 409);
|
||||
}
|
||||
}
|
||||
|
||||
const overlappingBooking = await tx.courtBooking.findFirst({
|
||||
where: {
|
||||
courtId: court.id,
|
||||
bookingDate,
|
||||
status: 'CONFIRMED',
|
||||
startTime: {
|
||||
lt: selectedSlot.endTime,
|
||||
},
|
||||
endTime: {
|
||||
gt: selectedSlot.startTime,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (overlappingBooking) {
|
||||
throw new AdminBookingServiceError('El horario seleccionado ya fue reservado.', 409);
|
||||
}
|
||||
|
||||
return tx.courtBooking.create({
|
||||
data: {
|
||||
id: uuidv7(),
|
||||
bookingCode: generateBookingCode(),
|
||||
courtId: court.id,
|
||||
bookingDate,
|
||||
startTime: selectedSlot.startTime,
|
||||
endTime: selectedSlot.endTime,
|
||||
customerName: input.customerName.trim(),
|
||||
customerPhone: input.customerPhone.trim(),
|
||||
customerEmail: input.customerEmail?.trim() ?? '',
|
||||
status: 'CONFIRMED',
|
||||
recurringGroupId: null,
|
||||
},
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
complexName: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const price = resolvePrice(court, dayOfWeek, selectedSlot.startTime, selectedSlot.endTime);
|
||||
|
||||
return mapBookingResponse({ ...booking, price });
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
const prismaError = error as {
|
||||
code?: string;
|
||||
meta?: {
|
||||
target?: string[] | string;
|
||||
};
|
||||
};
|
||||
|
||||
if (prismaError.code === 'P2002') {
|
||||
const targets = Array.isArray(prismaError.meta?.target)
|
||||
? prismaError.meta?.target
|
||||
: [prismaError.meta?.target];
|
||||
const isBookingCodeCollision = targets.some((target) =>
|
||||
String(target).includes('booking_code')
|
||||
);
|
||||
|
||||
if (isBookingCodeCollision) {
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new AdminBookingServiceError('El horario seleccionado ya fue reservado.', 409);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
throw new AdminBookingServiceError(
|
||||
'No se pudo generar un codigo de reserva unico. Intenta nuevamente.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
export async function updateAdminBookingStatus(
|
||||
userId: string,
|
||||
bookingId: string,
|
||||
input: UpdateAdminBookingStatusInput
|
||||
) {
|
||||
const booking = await db.courtBooking.findFirst({
|
||||
where: {
|
||||
id: bookingId,
|
||||
court: {
|
||||
complex: {
|
||||
users: {
|
||||
some: {
|
||||
userId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
complexName: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!booking) {
|
||||
throw new AdminBookingServiceError('Reserva no encontrada.', 404);
|
||||
}
|
||||
|
||||
if (input.status === 'CANCELLED' && booking.status !== 'CONFIRMED') {
|
||||
throw new AdminBookingServiceError(
|
||||
'Solo se pueden cancelar reservas en estado confirmada.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
if (input.status === 'COMPLETED' && booking.status !== 'CONFIRMED') {
|
||||
throw new AdminBookingServiceError(
|
||||
'Solo se pueden marcar como cumplidas las reservas confirmadas.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
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({
|
||||
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(),
|
||||
},
|
||||
});
|
||||
|
||||
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 });
|
||||
}
|
||||
@@ -0,0 +1,893 @@
|
||||
import { randomInt } from 'node:crypto';
|
||||
import { DayOfWeek as DayOfWeekEnum } from '@/generated/prisma/enums';
|
||||
import { db } from '@/lib/prisma';
|
||||
import { isSlotInPast } from '@/lib/slot-validator';
|
||||
import {
|
||||
evaluatePlanUsage,
|
||||
isFeatureEnabled,
|
||||
parsePlanRules,
|
||||
} from '@/modules/plan/services/plan-rules.service';
|
||||
import type {
|
||||
CreateRecurringBookingInput,
|
||||
RecurringBookingGroup,
|
||||
UpdateRecurringGroupInput,
|
||||
} from '@repo/api-contract';
|
||||
import { v7 as uuidv7 } from 'uuid';
|
||||
import { AdminBookingServiceError } from './admin-booking.service';
|
||||
|
||||
const BOOKING_CODE_ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
|
||||
const BOOKING_CODE_LENGTH = 6;
|
||||
const MAX_RECURRING_WEEKS = 52;
|
||||
|
||||
const DAY_INDEX_BY_VALUE: Record<string, number> = {
|
||||
SUNDAY: 0,
|
||||
MONDAY: 1,
|
||||
TUESDAY: 2,
|
||||
WEDNESDAY: 3,
|
||||
THURSDAY: 4,
|
||||
FRIDAY: 5,
|
||||
SATURDAY: 6,
|
||||
};
|
||||
|
||||
const DAY_OF_WEEK_BY_INDEX = [
|
||||
DayOfWeekEnum.SUNDAY,
|
||||
DayOfWeekEnum.MONDAY,
|
||||
DayOfWeekEnum.TUESDAY,
|
||||
DayOfWeekEnum.WEDNESDAY,
|
||||
DayOfWeekEnum.THURSDAY,
|
||||
DayOfWeekEnum.FRIDAY,
|
||||
DayOfWeekEnum.SATURDAY,
|
||||
] as const;
|
||||
|
||||
type DayOfWeek = (typeof DAY_OF_WEEK_BY_INDEX)[number];
|
||||
|
||||
function toMinutes(value: string): number {
|
||||
const [hours, minutes] = value.split(':').map((part) => Number(part));
|
||||
return hours * 60 + minutes;
|
||||
}
|
||||
|
||||
function minutesToTime(minutes: number): string {
|
||||
const safeMinutes = Math.max(0, minutes);
|
||||
const hours = Math.floor(safeMinutes / 60);
|
||||
const mins = safeMinutes % 60;
|
||||
return `${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
function parseIsoDate(date: string): Date {
|
||||
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(date);
|
||||
|
||||
if (!match) {
|
||||
throw new AdminBookingServiceError('La fecha debe tener formato YYYY-MM-DD.', 400);
|
||||
}
|
||||
|
||||
const year = Number(match[1]);
|
||||
const month = Number(match[2]);
|
||||
const day = Number(match[3]);
|
||||
|
||||
const parsed = new Date(Date.UTC(year, month - 1, day));
|
||||
|
||||
if (
|
||||
Number.isNaN(parsed.getTime()) ||
|
||||
parsed.getUTCFullYear() !== year ||
|
||||
parsed.getUTCMonth() + 1 !== month ||
|
||||
parsed.getUTCDate() !== day
|
||||
) {
|
||||
throw new AdminBookingServiceError('La fecha enviada no es valida.', 400);
|
||||
}
|
||||
|
||||
return parsed;
|
||||
}
|
||||
|
||||
function formatIsoDate(date: Date): string {
|
||||
return date.toISOString().slice(0, 10);
|
||||
}
|
||||
|
||||
function getDayOfWeekValue(date: Date): DayOfWeek {
|
||||
const dayOfWeek = DAY_OF_WEEK_BY_INDEX[date.getUTCDay()];
|
||||
|
||||
if (!dayOfWeek) {
|
||||
throw new AdminBookingServiceError('No se pudo resolver el dia de la semana.', 400);
|
||||
}
|
||||
|
||||
return dayOfWeek;
|
||||
}
|
||||
|
||||
function generateBookingCode(): string {
|
||||
let code = '';
|
||||
|
||||
for (let index = 0; index < BOOKING_CODE_LENGTH; index += 1) {
|
||||
code += BOOKING_CODE_ALPHABET[randomInt(0, BOOKING_CODE_ALPHABET.length)];
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
function buildSlots(
|
||||
availability: Array<{
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
}>,
|
||||
slotDurationMinutes: number
|
||||
) {
|
||||
const slots: Array<{ startTime: string; endTime: string }> = [];
|
||||
|
||||
for (const range of availability) {
|
||||
const start = toMinutes(range.startTime);
|
||||
const end = toMinutes(range.endTime);
|
||||
|
||||
for (
|
||||
let current = start;
|
||||
current + slotDurationMinutes <= end;
|
||||
current += slotDurationMinutes
|
||||
) {
|
||||
slots.push({
|
||||
startTime: minutesToTime(current),
|
||||
endTime: minutesToTime(current + slotDurationMinutes),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
async function ensureComplexAccess(complexId: string, userId: string) {
|
||||
const complexUser = await db.complexUser.findUnique({
|
||||
where: {
|
||||
complexId_userId: {
|
||||
complexId,
|
||||
userId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
complexName: true,
|
||||
plan: {
|
||||
select: {
|
||||
rules: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!complexUser) {
|
||||
throw new AdminBookingServiceError('No tienes permisos para administrar este complejo.', 403);
|
||||
}
|
||||
|
||||
return complexUser.complex;
|
||||
}
|
||||
|
||||
function* generateRecurringDates(
|
||||
startDate: Date,
|
||||
endDate: Date | null,
|
||||
dayOfWeek: number
|
||||
): Generator<Date> {
|
||||
const current = new Date(startDate);
|
||||
current.setUTCDate(current.getUTCDate() + ((dayOfWeek - current.getUTCDay() + 7) % 7));
|
||||
|
||||
if (current < startDate) {
|
||||
current.setUTCDate(current.getUTCDate() + 7);
|
||||
}
|
||||
|
||||
const maxDate = endDate ?? new Date(startDate);
|
||||
if (!endDate) {
|
||||
maxDate.setUTCDate(maxDate.getUTCDate() + MAX_RECURRING_WEEKS * 7);
|
||||
}
|
||||
|
||||
while (current <= maxDate) {
|
||||
yield new Date(current);
|
||||
current.setUTCDate(current.getUTCDate() + 7);
|
||||
}
|
||||
}
|
||||
|
||||
function mapBookingResponse(booking: {
|
||||
id: string;
|
||||
bookingCode: string;
|
||||
bookingDate: Date;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
customerName: string;
|
||||
customerPhone: string;
|
||||
customerEmail: string;
|
||||
status: 'CONFIRMED' | 'CANCELLED' | 'COMPLETED' | 'NOSHOW';
|
||||
recurringGroupId: string | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
court: {
|
||||
id: string;
|
||||
name: string;
|
||||
complex: {
|
||||
id: string;
|
||||
complexName: string;
|
||||
};
|
||||
sport: {
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
};
|
||||
};
|
||||
price?: number;
|
||||
}) {
|
||||
return {
|
||||
id: booking.id,
|
||||
bookingCode: booking.bookingCode,
|
||||
complexId: booking.court.complex.id,
|
||||
complexName: booking.court.complex.complexName,
|
||||
courtId: booking.court.id,
|
||||
courtName: booking.court.name,
|
||||
sport: {
|
||||
id: booking.court.sport.id,
|
||||
name: booking.court.sport.name,
|
||||
slug: booking.court.sport.slug,
|
||||
},
|
||||
date: formatIsoDate(booking.bookingDate),
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
customerName: booking.customerName,
|
||||
customerPhone: booking.customerPhone,
|
||||
customerEmail: booking.customerEmail,
|
||||
price: booking.price ?? 0,
|
||||
status: booking.status,
|
||||
recurringGroupId: booking.recurringGroupId,
|
||||
createdAt: booking.createdAt.toISOString(),
|
||||
updatedAt: booking.updatedAt.toISOString(),
|
||||
};
|
||||
}
|
||||
|
||||
export async function createAdminRecurringBooking(
|
||||
userId: string,
|
||||
complexId: string,
|
||||
input: CreateRecurringBookingInput
|
||||
): Promise<RecurringBookingGroup> {
|
||||
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);
|
||||
}
|
||||
|
||||
if (!complex.plan) {
|
||||
throw new AdminBookingServiceError('El complejo no tiene un plan asignado.', 403);
|
||||
}
|
||||
|
||||
const rules = parsePlanRules(complex.plan.rules);
|
||||
|
||||
if (!isFeatureEnabled(rules, 'fixedSlots')) {
|
||||
throw new AdminBookingServiceError(
|
||||
'Tu plan no permite la creación de turnos fijos. Comunicate con el administrador.',
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
const startDate = parseIsoDate(input.date);
|
||||
const dayOfWeek = getDayOfWeekValue(startDate);
|
||||
const endDate = input.recurringEndDate ? parseIsoDate(input.recurringEndDate) : null;
|
||||
|
||||
if (endDate && endDate <= startDate) {
|
||||
throw new AdminBookingServiceError(
|
||||
'La fecha de fin debe ser posterior a la fecha de inicio.',
|
||||
400
|
||||
);
|
||||
}
|
||||
|
||||
const court = await db.court.findFirst({
|
||||
where: {
|
||||
id: input.courtId,
|
||||
complexId,
|
||||
},
|
||||
include: {
|
||||
availabilities: {
|
||||
where: {
|
||||
dayOfWeek,
|
||||
},
|
||||
orderBy: {
|
||||
startTime: 'asc',
|
||||
},
|
||||
},
|
||||
sport: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
priceRules: {
|
||||
where: { isActive: true },
|
||||
orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!court) {
|
||||
throw new AdminBookingServiceError('La cancha seleccionada no existe en el complejo.', 404);
|
||||
}
|
||||
|
||||
const validSlots = buildSlots(court.availabilities, court.slotDurationMinutes);
|
||||
const selectedEndMinutes = toMinutes(input.startTime) + court.slotDurationMinutes;
|
||||
const selectedSlot = {
|
||||
startTime: input.startTime,
|
||||
endTime: minutesToTime(selectedEndMinutes),
|
||||
};
|
||||
|
||||
const slotExists = validSlots.some(
|
||||
(slot) => slot.startTime === selectedSlot.startTime && slot.endTime === selectedSlot.endTime
|
||||
);
|
||||
|
||||
if (!slotExists) {
|
||||
throw new AdminBookingServiceError(
|
||||
'El horario seleccionado no esta disponible para esa cancha.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
if (isSlotInPast(startDate, input.startTime, court.slotDurationMinutes)) {
|
||||
throw new AdminBookingServiceError('La fecha de inicio no puede estar en el pasado.', 400);
|
||||
}
|
||||
|
||||
const recurringDates = Array.from(
|
||||
generateRecurringDates(startDate, endDate, startDate.getUTCDay())
|
||||
);
|
||||
|
||||
if (recurringDates.length === 0) {
|
||||
throw new AdminBookingServiceError(
|
||||
'No se generaron fechas para la reserva periódica. Verifica las fechas ingresadas.',
|
||||
400
|
||||
);
|
||||
}
|
||||
|
||||
for (let attempt = 0; attempt < 5; attempt += 1) {
|
||||
try {
|
||||
const result = await db.$transaction(async (tx) => {
|
||||
const groupId = uuidv7();
|
||||
|
||||
const bookingsForDate = await tx.courtBooking.count({
|
||||
where: {
|
||||
startTime: selectedSlot.startTime,
|
||||
bookingDate: startDate,
|
||||
status: 'CONFIRMED',
|
||||
court: {
|
||||
complexId,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const courtsCount = await tx.court.count({
|
||||
where: { complexId },
|
||||
});
|
||||
|
||||
const violations = evaluatePlanUsage(rules, {
|
||||
courtsCount,
|
||||
bookingsToday: bookingsForDate,
|
||||
});
|
||||
|
||||
const maxBookingsViolation = violations.find(
|
||||
(v) => v.code === 'MAX_BOOKINGS_PER_DAY_REACHED'
|
||||
);
|
||||
|
||||
if (maxBookingsViolation) {
|
||||
throw new AdminBookingServiceError(maxBookingsViolation.message, 409);
|
||||
}
|
||||
|
||||
const group = await tx.recurringBookingGroup.create({
|
||||
data: {
|
||||
id: groupId,
|
||||
complexId,
|
||||
courtId: court.id,
|
||||
startTime: selectedSlot.startTime,
|
||||
endTime: selectedSlot.endTime,
|
||||
dayOfWeek,
|
||||
startDate,
|
||||
endDate,
|
||||
status: 'ACTIVE',
|
||||
customerName: input.customerName.trim(),
|
||||
customerPhone: input.customerPhone.trim(),
|
||||
customerEmail: input.customerEmail?.trim() ?? '',
|
||||
},
|
||||
});
|
||||
|
||||
const createdBookings = [];
|
||||
|
||||
for (const date of recurringDates) {
|
||||
if (isSlotInPast(date, input.startTime, court.slotDurationMinutes)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const overlappingBooking = await tx.courtBooking.findFirst({
|
||||
where: {
|
||||
courtId: court.id,
|
||||
bookingDate: date,
|
||||
status: 'CONFIRMED',
|
||||
startTime: {
|
||||
lt: selectedSlot.endTime,
|
||||
},
|
||||
endTime: {
|
||||
gt: selectedSlot.startTime,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (overlappingBooking) {
|
||||
throw new AdminBookingServiceError(
|
||||
`El horario seleccionado ya fue reservado para el dia ${formatIsoDate(date)}.`,
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
const booking = await tx.courtBooking.create({
|
||||
data: {
|
||||
id: uuidv7(),
|
||||
bookingCode: generateBookingCode(),
|
||||
courtId: court.id,
|
||||
bookingDate: date,
|
||||
startTime: selectedSlot.startTime,
|
||||
endTime: selectedSlot.endTime,
|
||||
customerName: input.customerName.trim(),
|
||||
customerPhone: input.customerPhone.trim(),
|
||||
customerEmail: input.customerEmail?.trim() ?? '',
|
||||
status: 'CONFIRMED',
|
||||
recurringGroupId: groupId,
|
||||
},
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
slug: true,
|
||||
},
|
||||
},
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
complexName: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
createdBookings.push(booking);
|
||||
}
|
||||
|
||||
return { group, bookings: createdBookings };
|
||||
});
|
||||
|
||||
return {
|
||||
id: result.group.id,
|
||||
complexId,
|
||||
courtId: court.id,
|
||||
startTime: result.group.startTime,
|
||||
endTime: result.group.endTime,
|
||||
dayOfWeek: result.group.dayOfWeek,
|
||||
startDate: formatIsoDate(result.group.startDate),
|
||||
endDate: result.group.endDate ? formatIsoDate(result.group.endDate) : null,
|
||||
status: 'ACTIVE' as const,
|
||||
customerName: result.group.customerName,
|
||||
customerPhone: result.group.customerPhone,
|
||||
customerEmail: result.group.customerEmail,
|
||||
bookings: result.bookings.map((b) => mapBookingResponse(b)),
|
||||
createdAt: result.group.createdAt.toISOString(),
|
||||
updatedAt: result.group.updatedAt.toISOString(),
|
||||
};
|
||||
} catch (error) {
|
||||
if (error instanceof AdminBookingServiceError) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
const prismaError = error as {
|
||||
code?: string;
|
||||
meta?: {
|
||||
target?: string[] | string;
|
||||
};
|
||||
};
|
||||
|
||||
if (prismaError.code === 'P2002') {
|
||||
const targets = Array.isArray(prismaError.meta?.target)
|
||||
? prismaError.meta?.target
|
||||
: [prismaError.meta?.target];
|
||||
const isBookingCodeCollision = targets.some((target) =>
|
||||
String(target).includes('booking_code')
|
||||
);
|
||||
|
||||
if (isBookingCodeCollision) {
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new AdminBookingServiceError('El horario seleccionado ya fue reservado.', 409);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
throw new AdminBookingServiceError(
|
||||
'No se pudo generar un codigo de reserva unico. Intenta nuevamente.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
export async function cancelRecurringGroup(userId: string, groupId: string) {
|
||||
const group = await db.recurringBookingGroup.findUnique({
|
||||
where: { id: groupId },
|
||||
include: {
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
users: {
|
||||
where: { userId },
|
||||
select: { userId: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!group) {
|
||||
throw new AdminBookingServiceError('Grupo de reservas no encontrado.', 404);
|
||||
}
|
||||
|
||||
if (group.complex.users.length === 0) {
|
||||
throw new AdminBookingServiceError('No tienes permisos para administrar este complejo.', 403);
|
||||
}
|
||||
|
||||
if (group.status === 'CANCELLED') {
|
||||
throw new AdminBookingServiceError('El grupo ya fue cancelado anteriormente.', 409);
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const todayStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()));
|
||||
|
||||
await db.$transaction(async (tx) => {
|
||||
await tx.recurringBookingGroup.update({
|
||||
where: { id: groupId },
|
||||
data: { status: 'CANCELLED' },
|
||||
});
|
||||
|
||||
const futureBookings = await tx.courtBooking.findMany({
|
||||
where: {
|
||||
recurringGroupId: groupId,
|
||||
bookingDate: { gte: todayStart },
|
||||
status: 'CONFIRMED',
|
||||
},
|
||||
});
|
||||
|
||||
for (const booking of futureBookings) {
|
||||
await tx.courtBookingLog.create({
|
||||
data: {
|
||||
id: uuidv7(),
|
||||
bookingCode: booking.bookingCode,
|
||||
courtId: booking.courtId,
|
||||
bookingDate: booking.bookingDate,
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
customerName: booking.customerName,
|
||||
customerPhone: booking.customerPhone,
|
||||
customerEmail: booking.customerEmail,
|
||||
previousStatus: booking.status,
|
||||
newStatus: 'CANCELLED',
|
||||
changedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
await tx.courtBooking.delete({
|
||||
where: { id: booking.id },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
export async function listRecurringGroups(complexId: string): Promise<RecurringBookingGroup[]> {
|
||||
const groups = await db.recurringBookingGroup.findMany({
|
||||
where: { complexId, status: 'ACTIVE' },
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: {
|
||||
select: { id: true, name: true, slug: true },
|
||||
},
|
||||
complex: {
|
||||
select: { id: true, complexName: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
bookings: {
|
||||
orderBy: { bookingDate: 'asc' },
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: {
|
||||
select: { id: true, name: true, slug: true },
|
||||
},
|
||||
complex: {
|
||||
select: { id: true, complexName: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
|
||||
return groups.map((group) => ({
|
||||
id: group.id,
|
||||
complexId: group.complexId,
|
||||
courtId: group.courtId,
|
||||
startTime: group.startTime,
|
||||
endTime: group.endTime,
|
||||
dayOfWeek: group.dayOfWeek,
|
||||
startDate: formatIsoDate(group.startDate),
|
||||
endDate: group.endDate ? formatIsoDate(group.endDate) : null,
|
||||
status: group.status,
|
||||
customerName: group.customerName,
|
||||
customerPhone: group.customerPhone,
|
||||
customerEmail: group.customerEmail,
|
||||
bookings: group.bookings.map(mapBookingResponse),
|
||||
createdAt: group.createdAt.toISOString(),
|
||||
updatedAt: group.updatedAt.toISOString(),
|
||||
}));
|
||||
}
|
||||
|
||||
export async function updateRecurringGroup(
|
||||
userId: string,
|
||||
groupId: string,
|
||||
input: UpdateRecurringGroupInput
|
||||
): Promise<RecurringBookingGroup> {
|
||||
const group = await db.recurringBookingGroup.findUnique({
|
||||
where: { id: groupId },
|
||||
include: {
|
||||
complex: {
|
||||
select: {
|
||||
id: true,
|
||||
users: {
|
||||
where: { userId },
|
||||
select: { userId: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!group) {
|
||||
throw new AdminBookingServiceError('Grupo de turnos fijos no encontrado.', 404);
|
||||
}
|
||||
|
||||
if (group.complex.users.length === 0) {
|
||||
throw new AdminBookingServiceError('No tienes permisos para administrar este complejo.', 403);
|
||||
}
|
||||
|
||||
if (group.status === 'CANCELLED') {
|
||||
throw new AdminBookingServiceError('No se puede editar un grupo cancelado.', 409);
|
||||
}
|
||||
|
||||
const courtId = input.courtId ?? group.courtId;
|
||||
const dayOfWeek = input.dayOfWeek ?? group.dayOfWeek;
|
||||
const startTime = input.startTime ?? group.startTime;
|
||||
|
||||
const scheduleChanged =
|
||||
input.courtId !== undefined || input.dayOfWeek !== undefined || input.startTime !== undefined;
|
||||
|
||||
if (scheduleChanged) {
|
||||
const court = await db.court.findFirst({
|
||||
where: { id: courtId, complexId: group.complexId },
|
||||
include: {
|
||||
availabilities: {
|
||||
where: { dayOfWeek: dayOfWeek as DayOfWeek },
|
||||
orderBy: { startTime: 'asc' },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!court) {
|
||||
throw new AdminBookingServiceError('La cancha seleccionada no existe en el complejo.', 404);
|
||||
}
|
||||
|
||||
const validSlots = buildSlots(court.availabilities, court.slotDurationMinutes);
|
||||
const selectedEndMinutes = toMinutes(startTime) + court.slotDurationMinutes;
|
||||
const endTime = minutesToTime(selectedEndMinutes);
|
||||
|
||||
const slotExists = validSlots.some(
|
||||
(slot) => slot.startTime === startTime && slot.endTime === endTime
|
||||
);
|
||||
|
||||
if (!slotExists) {
|
||||
throw new AdminBookingServiceError(
|
||||
'El horario seleccionado no esta disponible para esa cancha.',
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const todayStart = new Date(
|
||||
Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())
|
||||
);
|
||||
|
||||
await db.$transaction(async (tx) => {
|
||||
await tx.recurringBookingGroup.update({
|
||||
where: { id: groupId },
|
||||
data: {
|
||||
courtId,
|
||||
dayOfWeek: dayOfWeek as DayOfWeek,
|
||||
startTime,
|
||||
endTime,
|
||||
customerName: input.customerName?.trim() ?? group.customerName,
|
||||
customerPhone: input.customerPhone?.trim() ?? group.customerPhone,
|
||||
customerEmail: input.customerEmail?.trim() ?? group.customerEmail,
|
||||
},
|
||||
});
|
||||
|
||||
const futureBookings = await tx.courtBooking.findMany({
|
||||
where: {
|
||||
recurringGroupId: groupId,
|
||||
bookingDate: { gte: todayStart },
|
||||
status: 'CONFIRMED',
|
||||
},
|
||||
});
|
||||
|
||||
for (const booking of futureBookings) {
|
||||
await tx.courtBookingLog.create({
|
||||
data: {
|
||||
id: uuidv7(),
|
||||
bookingCode: booking.bookingCode,
|
||||
courtId: booking.courtId,
|
||||
bookingDate: booking.bookingDate,
|
||||
startTime: booking.startTime,
|
||||
endTime: booking.endTime,
|
||||
customerName: booking.customerName,
|
||||
customerPhone: booking.customerPhone,
|
||||
customerEmail: booking.customerEmail,
|
||||
previousStatus: booking.status,
|
||||
newStatus: 'CANCELLED',
|
||||
changedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
await tx.courtBooking.delete({
|
||||
where: { id: booking.id },
|
||||
});
|
||||
}
|
||||
|
||||
const dayIndex = DAY_INDEX_BY_VALUE[dayOfWeek] ?? 0;
|
||||
const recurringDates = Array.from(
|
||||
generateRecurringDates(todayStart, group.endDate, dayIndex)
|
||||
);
|
||||
|
||||
for (const date of recurringDates) {
|
||||
const overlappingBooking = await tx.courtBooking.findFirst({
|
||||
where: {
|
||||
courtId,
|
||||
bookingDate: date,
|
||||
status: 'CONFIRMED',
|
||||
startTime: { lt: endTime },
|
||||
endTime: { gt: startTime },
|
||||
},
|
||||
});
|
||||
|
||||
if (overlappingBooking) {
|
||||
throw new AdminBookingServiceError(
|
||||
`El horario seleccionado ya fue reservado para el dia ${formatIsoDate(date)}.`,
|
||||
409
|
||||
);
|
||||
}
|
||||
|
||||
await tx.courtBooking.create({
|
||||
data: {
|
||||
id: uuidv7(),
|
||||
bookingCode: generateBookingCode(),
|
||||
courtId,
|
||||
bookingDate: date,
|
||||
startTime,
|
||||
endTime,
|
||||
customerName: input.customerName?.trim() ?? group.customerName,
|
||||
customerPhone: input.customerPhone?.trim() ?? group.customerPhone,
|
||||
customerEmail: input.customerEmail?.trim() ?? group.customerEmail,
|
||||
status: 'CONFIRMED',
|
||||
recurringGroupId: groupId,
|
||||
},
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: { select: { id: true, name: true, slug: true } },
|
||||
complex: { select: { id: true, complexName: true } },
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
await db.recurringBookingGroup.update({
|
||||
where: { id: groupId },
|
||||
data: {
|
||||
...(input.customerName !== undefined && { customerName: input.customerName.trim() }),
|
||||
...(input.customerPhone !== undefined && { customerPhone: input.customerPhone.trim() }),
|
||||
...(input.customerEmail !== undefined && { customerEmail: input.customerEmail.trim() }),
|
||||
},
|
||||
});
|
||||
|
||||
const now = new Date();
|
||||
const todayStart = new Date(
|
||||
Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())
|
||||
);
|
||||
|
||||
const updateData: Record<string, string> = {};
|
||||
if (input.customerName !== undefined) updateData.customerName = input.customerName.trim();
|
||||
if (input.customerPhone !== undefined) updateData.customerPhone = input.customerPhone.trim();
|
||||
if (input.customerEmail !== undefined) updateData.customerEmail = input.customerEmail.trim();
|
||||
|
||||
if (Object.keys(updateData).length > 0) {
|
||||
await db.courtBooking.updateMany({
|
||||
where: { recurringGroupId: groupId, bookingDate: { gte: todayStart } },
|
||||
data: updateData,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const updated = await db.recurringBookingGroup.findUnique({
|
||||
where: { id: groupId },
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: { select: { id: true, name: true, slug: true } },
|
||||
complex: { select: { id: true, complexName: true } },
|
||||
},
|
||||
},
|
||||
bookings: {
|
||||
orderBy: { bookingDate: 'asc' },
|
||||
include: {
|
||||
court: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
sport: { select: { id: true, name: true, slug: true } },
|
||||
complex: { select: { id: true, complexName: true } },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!updated) {
|
||||
throw new AdminBookingServiceError('Error al actualizar el grupo.', 409);
|
||||
}
|
||||
|
||||
return {
|
||||
id: updated.id,
|
||||
complexId: updated.complexId,
|
||||
courtId: updated.courtId,
|
||||
startTime: updated.startTime,
|
||||
endTime: updated.endTime,
|
||||
dayOfWeek: updated.dayOfWeek,
|
||||
startDate: formatIsoDate(updated.startDate),
|
||||
endDate: updated.endDate ? formatIsoDate(updated.endDate) : null,
|
||||
status: updated.status,
|
||||
customerName: updated.customerName,
|
||||
customerPhone: updated.customerPhone,
|
||||
customerEmail: updated.customerEmail,
|
||||
bookings: updated.bookings.map(mapBookingResponse),
|
||||
createdAt: updated.createdAt.toISOString(),
|
||||
updatedAt: updated.updatedAt.toISOString(),
|
||||
};
|
||||
}
|
||||
67
apps/backend/src/modules/admin/admin.routes.ts
Normal file
67
apps/backend/src/modules/admin/admin.routes.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
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
|
||||
);
|
||||
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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.' });
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
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);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
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);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user