add configurable appointment slot duration per professional
DB: slot_duration_minutes INT DEFAULT 30 on professionals table Backend DTO: slot_duration_minutes (optional int, 5-480 min) in UpdateProfessionalDto Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
afbf4d537e
commit
c720911172
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "professionals" ADD COLUMN IF NOT EXISTS "slot_duration_minutes" INTEGER NOT NULL DEFAULT 30;
|
||||||
@@ -96,6 +96,7 @@ model professionals {
|
|||||||
latitude Decimal? @db.Decimal(10, 7)
|
latitude Decimal? @db.Decimal(10, 7)
|
||||||
longitude Decimal? @db.Decimal(10, 7)
|
longitude Decimal? @db.Decimal(10, 7)
|
||||||
average_score Decimal? @default(0) @db.Decimal(3, 2)
|
average_score Decimal? @default(0) @db.Decimal(3, 2)
|
||||||
|
slot_duration_minutes Int @default(30)
|
||||||
is_active Boolean? @default(true)
|
is_active Boolean? @default(true)
|
||||||
created_at DateTime @default(now()) @db.Timestamptz(6)
|
created_at DateTime @default(now()) @db.Timestamptz(6)
|
||||||
updated_at DateTime @default(now()) @db.Timestamptz(6)
|
updated_at DateTime @default(now()) @db.Timestamptz(6)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { IsString, IsOptional, IsArray, IsNumber, IsBoolean, MinLength, Matches, IsObject } from 'class-validator';
|
import { IsString, IsOptional, IsArray, IsNumber, IsBoolean, IsInt, Min, Max, MinLength, Matches, IsObject } from 'class-validator';
|
||||||
|
|
||||||
export class CreateProfessionalDto {
|
export class CreateProfessionalDto {
|
||||||
@IsString()
|
@IsString()
|
||||||
@@ -81,6 +81,12 @@ export class UpdateProfessionalDto {
|
|||||||
@IsString()
|
@IsString()
|
||||||
location_preferences?: string;
|
location_preferences?: string;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsInt()
|
||||||
|
@Min(5)
|
||||||
|
@Max(480)
|
||||||
|
slot_duration_minutes?: number;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsObject()
|
@IsObject()
|
||||||
payment_methods?: {
|
payment_methods?: {
|
||||||
|
|||||||
Reference in New Issue
Block a user