diff --git a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php index ac884c672..22430bd64 100644 --- a/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php +++ b/app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitScheduleSettingsApiController.php @@ -1,4 +1,7 @@ - [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer', default: 1), + description: 'Page number' + ), + new OA\Parameter( + name: 'per_page', + in: 'query', + required: false, + schema: new OA\Schema(type: 'integer', default: 10), + description: 'Items per page' + ), + new OA\Parameter( + name: 'filter', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Filter expression (e.g., key=@schedule,is_enabled==true)' + ), + new OA\Parameter( + name: 'order', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Order by field (e.g., +id, -key)' + ), + new OA\Parameter( + name: 'expand', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Expand relationships (filters,pre_filters)' + ), + new OA\Parameter( + name: 'relations', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Relations to include (filters,pre_filters)' + ) + ], + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedSummitScheduleConfigsResponse') + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] + public function getAllBySummit($summit_id) + { + return $this->traitGetAllBySummit($summit_id); + } + + #[OA\Get( + path: "/api/v1/summits/{id}/schedule-settings/{config_id}", + description: "Get a specific schedule setting by id", + summary: "Get schedule setting", + operationId: "getSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ), + new OA\Parameter( + name: 'expand', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Expand relationships (filters,pre_filters)' + ), + new OA\Parameter( + name: 'relations', + in: 'query', + required: false, + schema: new OA\Schema(type: 'string'), + description: 'Relations to include (filters,pre_filters)' + ) + ], + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfig') + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] + public function get($summit_id, $config_id) + { + return $this->traitGet($summit_id, $config_id); + } + + #[OA\Post( + path: "/api/v1/summits/{id}/schedule-settings", + description: "Create a new schedule setting for a summit", + summary: "Create schedule setting", + operationId: "createSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfigCreateRequest') + ), + responses: [ + new OA\Response( + response: 201, + description: 'Created', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfig') + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] + public function add($summit_id) + { + return $this->traitAdd($summit_id); + } + + #[OA\Put( + path: "/api/v1/summits/{id}/schedule-settings/{config_id}", + description: "Update an existing schedule setting", + summary: "Update schedule setting", + operationId: "updateSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfigUpdateRequest') + ), + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleConfig') + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] + public function update($summit_id, $config_id) + { + return $this->traitUpdate($summit_id, $config_id); + } + + #[OA\Delete( + path: "/api/v1/summits/{id}/schedule-settings/{config_id}", + description: "Delete a schedule setting", + summary: "Delete schedule setting", + operationId: "deleteSummitScheduleSetting", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ) + ], + responses: [ + new OA\Response(response: Response::HTTP_NO_CONTENT, description: 'No Content'), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] + public function delete($summit_id, $config_id) + { + return $this->traitDelete($summit_id, $config_id); + } + + #[OA\Get( + path: "/api/v1/summits/{id}/schedule-settings/metadata", + description: "Get metadata for schedule settings", + summary: "Get schedule settings metadata", + operationId: "getSummitScheduleSettingsMetadata", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::ReadSummitData, + SummitScopes::ReadAllSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ) + ], + responses: [ + new OA\Response(response: 200, description: 'Success with an empty response body'), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + ] + )] public function getMetadata($summit_id){ } + #[OA\Post( + path: "/api/v1/summits/{id}/schedule-settings/{config_id}/filters", + description: "Add a filter to a schedule setting", + summary: "Add schedule setting filter", + operationId: "addSummitScheduleSettingFilter", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent( + type: 'object', + required: ['type'], + properties: [ + new OA\Property( + property: 'type', + type: 'string', + enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'] + ), + new OA\Property(property: 'is_enabled', type: 'boolean'), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ) + ), + responses: [ + new OA\Response( + response: 201, + description: 'Created', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleFilterElementConfig') + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function addFilter($summit_id, $config_id){ $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); @@ -212,6 +611,75 @@ function ($payload, $summit, $id){ ); } + #[OA\Put( + path: "/api/v1/summits/{id}/schedule-settings/{config_id}/filters/{filter_id}", + description: "Update a filter of a schedule setting", + summary: "Update schedule setting filter", + operationId: "updateSummitScheduleSettingFilter", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ), + new OA\Parameter( + name: 'config_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The schedule config id' + ), + new OA\Parameter( + name: 'filter_id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The filter id' + ) + ], + requestBody: new OA\RequestBody( + required: true, + content: new OA\JsonContent( + type: 'object', + properties: [ + new OA\Property( + property: 'type', + type: 'string', + enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'], + nullable: true + ), + new OA\Property(property: 'is_enabled', type: 'boolean', nullable: true), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ) + ), + responses: [ + new OA\Response( + response: 200, + description: 'Success', + content: new OA\JsonContent(ref: '#/components/schemas/SummitScheduleFilterElementConfig') + ), + new OA\Response(response: Response::HTTP_BAD_REQUEST, description: "Bad Request"), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function updateFilter($summit_id, $config_id, $filter_id){ $summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id); if (is_null($summit)) return $this->error404(); @@ -232,11 +700,44 @@ function($filter_id, $payload, $summit, $config_id){ }, ...$args); } - /** - * @param $summit_id - * @return \Illuminate\Http\JsonResponse|mixed - * @throws \Exception - */ + #[OA\Post( + path: "/api/v1/summits/{id}/schedule-settings/seed", + description: "Seed default schedule settings for a summit", + summary: "Seed default schedule settings", + operationId: "seedDefaultSummitScheduleSettings", + tags: ['Summit Schedule Settings'], + security: [['summit_schedule_settings_oauth2' => [ + SummitScopes::WriteSummitData, + ]]], + x: [ + 'required-groups' => [ + IGroup::SuperAdmins, + IGroup::Administrators, + IGroup::SummitAdministrators, + ] + ], + parameters: [ + new OA\Parameter( + name: 'id', + in: 'path', + required: true, + schema: new OA\Schema(type: 'integer'), + description: 'The summit id' + ) + ], + responses: [ + new OA\Response( + response: 201, + description: 'Created', + content: new OA\JsonContent(ref: '#/components/schemas/PaginatedSummitScheduleConfigsResponse') + ), + new OA\Response(response: Response::HTTP_UNAUTHORIZED, description: "Unauthorized"), + new OA\Response(response: Response::HTTP_FORBIDDEN, description: "Forbidden"), + new OA\Response(response: Response::HTTP_NOT_FOUND, description: "Not Found"), + new OA\Response(response: Response::HTTP_PRECONDITION_FAILED, description: "Validation Error"), + new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: "Server Error") + ] + )] public function seedDefaults($summit_id){ try { $summit = SummitFinderStrategyFactory::build($this->getSummitRepository(), $this->getResourceServerContext())->find($summit_id); @@ -281,4 +782,4 @@ public function seedDefaults($summit_id){ return $this->error500($ex); } } -} \ No newline at end of file +} diff --git a/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php b/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php new file mode 100644 index 000000000..6e7e9837a --- /dev/null +++ b/app/Swagger/Security/SummitScheduleSettingsAuthSchema.php @@ -0,0 +1,28 @@ + 'Read Summit Data', + SummitScopes::ReadAllSummitData => 'Read All Summit Data', + SummitScopes::WriteSummitData => 'Write Summit Data', + ], + ), + ], + ) +] +class SummitScheduleSettingsAuthSchema +{ +} diff --git a/app/Swagger/SummitSchemas.php b/app/Swagger/SummitSchemas.php index 489d39517..5f83d1c19 100644 --- a/app/Swagger/SummitSchemas.php +++ b/app/Swagger/SummitSchemas.php @@ -3,6 +3,294 @@ namespace App\Swagger\schemas; use OpenApi\Attributes as OA; +#[OA\Schema( + schema: 'SummitScheduleConfigContent', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'key', type: 'string', example: 'schedule-main'), + new OA\Property(property: 'summit_id', type: 'integer', example: 1), + new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false), + new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false), + new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES'), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true), + new OA\Property(property: 'is_default', type: 'boolean', example: true), + new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false), + new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h'), + new OA\Property( + property: 'filters', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SummitScheduleFilterElementConfig') + ), + new OA\Property( + property: 'pre_filters', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SummitSchedulePreFilterElementConfig') + ) + ] +)] +class SummitScheduleConfigContentSchema {} + + +#[OA\Schema( + schema: 'SummitScheduleConfig', + type: 'object', + properties: [ + new OA\Property( + property: '', + description: 'Dynamic property name with SummitScheduleFilterElementConfig->type as key', + type: 'object', + allOf: [ + new OA\Schema(ref: '#/components/schemas/SummitScheduleConfigContent') + ] + ) + ] +)] +class SummitScheduleConfigSchema {} + +#[OA\Schema( + schema: 'PaginatedSummitScheduleConfigsResponse', + allOf: [ + new OA\Schema(ref: '#/components/schemas/PaginateDataSchemaResponse'), + new OA\Schema( + type: 'object', + properties: [ + new OA\Property( + property: 'data', + type: 'array', + items: new OA\Items(ref: '#/components/schemas/SummitScheduleConfig') + ) + ] + ) + ] +)] +class PaginatedSummitScheduleConfigsResponseSchema {} + +#[OA\Schema( + schema: 'SummitScheduleFilterElementConfig', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'label', type: 'string', example: 'Date'), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true), + new OA\Property(property: 'order', type: 'integer', example: 1), + new OA\Property( + property: 'type', + type: 'string', + enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'], + example: 'DATE' + ), + ] +)] +class SummitScheduleFilterElementConfigSchema {} + +#[OA\Schema( + schema: 'SummitSchedulePreFilterElementConfig', + type: 'object', + properties: [ + new OA\Property(property: 'id', type: 'integer', example: 1), + new OA\Property(property: 'created', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property(property: 'last_edited', type: 'integer', description: 'Unix timestamp', example: 1640995200), + new OA\Property( + property: 'type', + type: 'string', + enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS'], + example: 'TAGS' + ), + new OA\Property( + property: 'values', + type: 'array', + items: new OA\Items(type: 'string'), + example: ['tag1', 'tag2'] + ) + ] +)] +class SummitSchedulePreFilterElementConfigSchema {} + +#[OA\Schema( + schema: 'SummitScheduleConfigCreateRequest', + type: 'object', + required: ['key'], + properties: [ + new OA\Property(property: 'key', type: 'string', example: 'schedule-main'), + new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false), + new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false), + new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES'), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true), + new OA\Property(property: 'is_default', type: 'boolean', example: true), + new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false), + new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h'), + new OA\Property( + property: 'filters', + type: 'array', + items: new OA\Items( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'is_enabled', type: 'boolean'), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ), + nullable: true + ), + new OA\Property( + property: 'pre_filters', + type: 'array', + items: new OA\Items( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'values', type: 'array', items: new OA\Items(type: 'string')) + ] + ), + nullable: true + ) + ] +)] +class SummitScheduleConfigCreateRequestSchema {} + +#[OA\Schema( + schema: 'SummitScheduleConfigUpdateRequest', + type: 'object', + properties: [ + new OA\Property(property: 'key', type: 'string', example: 'schedule-main', nullable: true), + new OA\Property(property: 'is_my_schedule', type: 'boolean', example: false, nullable: true), + new OA\Property(property: 'only_events_with_attendee_access', type: 'boolean', example: false, nullable: true), + new OA\Property(property: 'color_source', type: 'string', enum: ['EVENT_TYPES', 'TRACK', 'TRACK_GROUP'], example: 'EVENT_TYPES', nullable: true), + new OA\Property(property: 'is_enabled', type: 'boolean', example: true, nullable: true), + new OA\Property(property: 'is_default', type: 'boolean', example: true, nullable: true), + new OA\Property(property: 'hide_past_events_with_show_always_on_schedule', type: 'boolean', example: false, nullable: true), + new OA\Property(property: 'time_format', type: 'string', enum: ['12h', '24h'], example: '12h', nullable: true), + new OA\Property( + property: 'filters', + type: 'array', + items: new OA\Items( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'is_enabled', type: 'boolean'), + new OA\Property(property: 'label', type: 'string', nullable: true) + ] + ), + nullable: true + ), + new OA\Property( + property: 'pre_filters', + type: 'array', + items: new OA\Items( + type: 'object', + properties: [ + new OA\Property(property: 'type', type: 'string', enum: ['DATE', 'TRACK', 'TRACK_GROUPS', 'COMPANY', 'LEVEL', 'SPEAKERS', 'VENUES', 'EVENT_TYPES', 'TITLE', 'CUSTOM_ORDER', 'ABSTRACT', 'TAGS']), + new OA\Property(property: 'values', type: 'array', items: new OA\Items(type: 'string')) + ] + ), + nullable: true + ) + ] +)] +class SummitScheduleConfigUpdateRequestSchema {} + +// Summit Documents + +#[OA\Schema( + schema: "SummitDocument", + description: "Summit document", + type: "object", + properties: [ + new OA\Property(property: "id", type: "integer", example: 1), + new OA\Property(property: "created", type: "integer", description: "Unix timestamp", example: 1640995200), + new OA\Property(property: "last_edited", type: "integer", description: "Unix timestamp", example: 1640995200), + new OA\Property(property: "name", type: "string", example: "Code of Conduct"), + new OA\Property(property: "description", type: "string", example: "Summit code of conduct document"), + new OA\Property(property: "show_always", type: "boolean", example: true), + new OA\Property(property: "label", type: "string", example: "Code of Conduct"), + new OA\Property(property: "file", type: "string", format: "uri", nullable: true, example: "https://example.com/document.pdf"), + new OA\Property(property: "web_link", type: "string", format: "uri", nullable: true, example: "https://example.com/page"), + new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, description: "SelectionPlan ID, full object description when ?expand=summit (summit)"), + new OA\Property( + property: "event_types", + type: "array", + items: new OA\Items(type: "integer"), + description: "Array of SummitEventType: objects when expanded, ids otherwise", + ), + new OA\Property(property: "summit_id", type: "integer", description: "Summit ID, full object description when ?expand=summit (summit)"), + ] +)] +class SummitDocumentSchema {} + +#[OA\Schema( + schema: "PaginatedSummitDocumentsResponse", + description: "Paginated list of summit documents", + allOf: [ + new OA\Schema(ref: "#/components/schemas/PaginateDataSchemaResponse"), + new OA\Schema( + properties: [ + new OA\Property( + property: "data", + type: "array", + items: new OA\Items(ref: "#/components/schemas/SummitDocument") + ) + ] + ) + ] +)] +class PaginatedSummitDocumentsResponseSchema {} + +#[OA\Schema( + schema: "SummitDocumentCreateRequest", + description: "Request to create a summit document", + required: ["name", "label"], + type: "object", + properties: [ + new OA\Property(property: "name", type: "string", example: "Code of Conduct"), + new OA\Property(property: "label", type: "string", example: "Code of Conduct"), + new OA\Property(property: "description", type: "string", nullable: true, example: "Summit code of conduct document"), + new OA\Property(property: "show_always", type: "boolean", nullable: true, example: true), + new OA\Property(property: "web_link", type: "string", format: "uri", nullable: true, example: "https://example.com/page"), + new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, example: 1), + new OA\Property( + property: "event_types", + type: "array", + nullable: true, + items: new OA\Items(type: "integer"), + example: [1, 2, 3] + ), + new OA\Property( + property: "file", + type: "string", + format: "binary", + nullable: true, + description: "Document file upload (required if web_link not provided)" + ), + ] +)] +class SummitDocumentCreateRequest {} + +#[OA\Schema( + schema: "SummitDocumentUpdateRequest", + description: "Request to update a summit document", + type: "object", + properties: [ + new OA\Property(property: "name", type: "string", nullable: true, example: "Code of Conduct"), + new OA\Property(property: "label", type: "string", nullable: true, example: "Code of Conduct"), + new OA\Property(property: "description", type: "string", nullable: true, example: "Summit code of conduct document"), + new OA\Property(property: "show_always", type: "boolean", nullable: true, example: true), + new OA\Property(property: "web_link", type: "string", format: "uri", nullable: true, example: "https://example.com/page"), + new OA\Property(property: "selection_plan_id", type: "integer", nullable: true, example: 1), + new OA\Property( + property: "event_types", + type: "array", + nullable: true, + items: new OA\Items(type: "integer"), + example: [1, 2, 3] + ), + ] +)] +class SummitDocumentUpdateRequest {} // Summit Attendee Badges