|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace App\Swagger\schemas; |
| 4 | + |
| 5 | +use OpenApi\Attributes as OA; |
| 6 | + |
| 7 | +#[OA\Schema( |
| 8 | + schema: 'CreateUser', |
| 9 | + title: 'Create User', |
| 10 | + description: 'Request body for creating a new user', |
| 11 | + required: ['email'], |
| 12 | + type: 'object', |
| 13 | + properties: [ |
| 14 | + new OA\Property(property: 'first_name', type: 'string', description: 'First name'), |
| 15 | + new OA\Property(property: 'last_name', type: 'string', description: 'Last name'), |
| 16 | + new OA\Property(property: 'email', type: 'string', format: 'email', description: 'Primary email address'), |
| 17 | + new OA\Property(property: 'identifier', type: 'string', description: 'User unique identifier string'), |
| 18 | + new OA\Property(property: 'bio', type: 'string', nullable: true, description: 'User biography'), |
| 19 | + new OA\Property(property: 'address1', type: 'string', nullable: true, description: 'Address line 1'), |
| 20 | + new OA\Property(property: 'address2', type: 'string', nullable: true, description: 'Address line 2'), |
| 21 | + new OA\Property(property: 'city', type: 'string', nullable: true, description: 'City'), |
| 22 | + new OA\Property(property: 'state', type: 'string', nullable: true, description: 'State or province'), |
| 23 | + new OA\Property(property: 'post_code', type: 'string', nullable: true, description: 'Postal code'), |
| 24 | + new OA\Property(property: 'country_iso_code', type: 'string', nullable: true, description: 'ISO 3166-1 alpha-2 country code'), |
| 25 | + new OA\Property(property: 'second_email', type: 'string', format: 'email', nullable: true, description: 'Secondary email address'), |
| 26 | + new OA\Property(property: 'third_email', type: 'string', format: 'email', nullable: true, description: 'Tertiary email address'), |
| 27 | + new OA\Property(property: 'gender', type: 'string', nullable: true, description: 'Gender'), |
| 28 | + new OA\Property(property: 'statement_of_interest', type: 'string', nullable: true, description: 'Statement of interest'), |
| 29 | + new OA\Property(property: 'irc', type: 'string', nullable: true, description: 'IRC handle'), |
| 30 | + new OA\Property(property: 'linked_in_profile', type: 'string', nullable: true, description: 'LinkedIn profile URL'), |
| 31 | + new OA\Property(property: 'github_user', type: 'string', nullable: true, description: 'GitHub username'), |
| 32 | + new OA\Property(property: 'wechat_user', type: 'string', nullable: true, description: 'WeChat username'), |
| 33 | + new OA\Property(property: 'twitter_name', type: 'string', nullable: true, description: 'Twitter handle'), |
| 34 | + new OA\Property(property: 'language', type: 'string', nullable: true, description: 'Preferred language'), |
| 35 | + new OA\Property(property: 'birthday', type: 'integer', nullable: true, description: 'Date of birth (epoch)'), |
| 36 | + new OA\Property(property: 'password', type: 'string', format: 'password', description: 'Password'), |
| 37 | + new OA\Property(property: 'password_confirmation', type: 'string', format: 'password', description: 'Password confirmation (required when password is provided)'), |
| 38 | + new OA\Property(property: 'phone_number', type: 'string', nullable: true, description: 'Phone number'), |
| 39 | + new OA\Property(property: 'company', type: 'string', nullable: true, description: 'Company name'), |
| 40 | + new OA\Property(property: 'job_title', type: 'string', nullable: true, maxLength: 200, description: 'Job title'), |
| 41 | + new OA\Property(property: 'email_verified', type: 'boolean', nullable: true, description: 'Whether the primary email is verified (admin only)'), |
| 42 | + new OA\Property(property: 'active', type: 'boolean', nullable: true, description: 'Whether the user account is active (admin only)'), |
| 43 | + new OA\Property(property: 'groups', type: 'array', items: new OA\Items(type: 'integer'), description: 'Group IDs to assign (admin only)'), |
| 44 | + new OA\Property(property: 'public_profile_show_photo', type: 'boolean', description: 'Show photo in public profile'), |
| 45 | + new OA\Property(property: 'public_profile_show_fullname', type: 'boolean', description: 'Show full name in public profile'), |
| 46 | + new OA\Property(property: 'public_profile_show_email', type: 'boolean', description: 'Show email in public profile'), |
| 47 | + new OA\Property(property: 'public_profile_show_social_media_info', type: 'boolean', description: 'Show social media info in public profile'), |
| 48 | + new OA\Property(property: 'public_profile_show_bio', type: 'boolean', description: 'Show bio in public profile'), |
| 49 | + new OA\Property(property: 'public_profile_allow_chat_with_me', type: 'boolean', description: 'Allow chat in public profile'), |
| 50 | + new OA\Property(property: 'public_profile_show_telephone_number', type: 'boolean', description: 'Show telephone in public profile'), |
| 51 | + ] |
| 52 | +)] |
| 53 | +class CreateUserSchema |
| 54 | +{ |
| 55 | +} |
| 56 | + |
| 57 | +#[OA\Schema( |
| 58 | + schema: 'UpdateUser', |
| 59 | + title: 'Update User', |
| 60 | + description: 'Request body for updating a user', |
| 61 | + type: 'object', |
| 62 | + properties: [ |
| 63 | + new OA\Property(property: 'first_name', type: 'string', description: 'First name'), |
| 64 | + new OA\Property(property: 'last_name', type: 'string', description: 'Last name'), |
| 65 | + new OA\Property(property: 'email', type: 'string', format: 'email', description: 'Primary email address'), |
| 66 | + new OA\Property(property: 'identifier', type: 'string', description: 'User unique identifier string'), |
| 67 | + new OA\Property(property: 'bio', type: 'string', nullable: true, description: 'User biography'), |
| 68 | + new OA\Property(property: 'address1', type: 'string', nullable: true, description: 'Address line 1'), |
| 69 | + new OA\Property(property: 'address2', type: 'string', nullable: true, description: 'Address line 2'), |
| 70 | + new OA\Property(property: 'city', type: 'string', nullable: true, description: 'City'), |
| 71 | + new OA\Property(property: 'state', type: 'string', nullable: true, description: 'State or province'), |
| 72 | + new OA\Property(property: 'post_code', type: 'string', nullable: true, description: 'Postal code'), |
| 73 | + new OA\Property(property: 'country_iso_code', type: 'string', nullable: true, description: 'ISO 3166-1 alpha-2 country code'), |
| 74 | + new OA\Property(property: 'second_email', type: 'string', format: 'email', nullable: true, description: 'Secondary email address'), |
| 75 | + new OA\Property(property: 'third_email', type: 'string', format: 'email', nullable: true, description: 'Tertiary email address'), |
| 76 | + new OA\Property(property: 'gender', type: 'string', nullable: true, description: 'Gender'), |
| 77 | + new OA\Property(property: 'gender_specify', type: 'string', nullable: true, description: 'Gender specification'), |
| 78 | + new OA\Property(property: 'statement_of_interest', type: 'string', nullable: true, description: 'Statement of interest'), |
| 79 | + new OA\Property(property: 'irc', type: 'string', nullable: true, description: 'IRC handle'), |
| 80 | + new OA\Property(property: 'linked_in_profile', type: 'string', nullable: true, description: 'LinkedIn profile URL'), |
| 81 | + new OA\Property(property: 'github_user', type: 'string', nullable: true, description: 'GitHub username'), |
| 82 | + new OA\Property(property: 'wechat_user', type: 'string', nullable: true, description: 'WeChat username'), |
| 83 | + new OA\Property(property: 'twitter_name', type: 'string', nullable: true, description: 'Twitter handle'), |
| 84 | + new OA\Property(property: 'language', type: 'string', nullable: true, description: 'Preferred language'), |
| 85 | + new OA\Property(property: 'birthday', type: 'integer', nullable: true, description: 'Date of birth (epoch)'), |
| 86 | + new OA\Property(property: 'password', type: 'string', format: 'password', description: 'New password'), |
| 87 | + new OA\Property(property: 'password_confirmation', type: 'string', format: 'password', description: 'Password confirmation (required when password is provided)'), |
| 88 | + new OA\Property(property: 'current_password', type: 'string', format: 'password', description: 'Current password (required when changing password for non-admin users)'), |
| 89 | + new OA\Property(property: 'phone_number', type: 'string', nullable: true, description: 'Phone number'), |
| 90 | + new OA\Property(property: 'company', type: 'string', nullable: true, description: 'Company name'), |
| 91 | + new OA\Property(property: 'job_title', type: 'string', nullable: true, maxLength: 200, description: 'Job title'), |
| 92 | + new OA\Property(property: 'email_verified', type: 'boolean', nullable: true, description: 'Whether the primary email is verified (admin only)'), |
| 93 | + new OA\Property(property: 'active', type: 'boolean', nullable: true, description: 'Whether the user account is active (admin only)'), |
| 94 | + new OA\Property(property: 'groups', type: 'array', items: new OA\Items(type: 'integer'), description: 'Group IDs to assign (admin only)'), |
| 95 | + new OA\Property(property: 'public_profile_show_photo', type: 'boolean', description: 'Show photo in public profile'), |
| 96 | + new OA\Property(property: 'public_profile_show_fullname', type: 'boolean', description: 'Show full name in public profile'), |
| 97 | + new OA\Property(property: 'public_profile_show_email', type: 'boolean', description: 'Show email in public profile'), |
| 98 | + new OA\Property(property: 'public_profile_show_social_media_info', type: 'boolean', description: 'Show social media info in public profile'), |
| 99 | + new OA\Property(property: 'public_profile_show_bio', type: 'boolean', description: 'Show bio in public profile'), |
| 100 | + new OA\Property(property: 'public_profile_allow_chat_with_me', type: 'boolean', description: 'Allow chat in public profile'), |
| 101 | + new OA\Property(property: 'public_profile_show_telephone_number', type: 'boolean', description: 'Show telephone in public profile'), |
| 102 | + ] |
| 103 | +)] |
| 104 | +class UpdateUserSchema |
| 105 | +{ |
| 106 | +} |
| 107 | + |
| 108 | +#[OA\Schema( |
| 109 | + schema: 'UpdateUserPic', |
| 110 | + title: 'Update User Profile Picture', |
| 111 | + description: 'Request body for updating user profile picture', |
| 112 | + required: ['file'], |
| 113 | + type: 'object', |
| 114 | + properties: [ |
| 115 | + new OA\Property( |
| 116 | + property: 'file', |
| 117 | + type: 'string', |
| 118 | + format: 'binary', |
| 119 | + description: 'Profile picture file' |
| 120 | + ), |
| 121 | + ] |
| 122 | +)] |
| 123 | +class UpdateUserPicSchema |
| 124 | +{ |
| 125 | +} |
| 126 | + |
| 127 | +#[OA\Schema( |
| 128 | + schema: 'UpdateUserGroups', |
| 129 | + title: 'Update User Groups', |
| 130 | + description: 'Request body for updating user group assignments', |
| 131 | + required: ['groups'], |
| 132 | + type: 'object', |
| 133 | + properties: [ |
| 134 | + new OA\Property( |
| 135 | + property: 'groups', |
| 136 | + type: 'array', |
| 137 | + items: new OA\Items(type: 'integer'), |
| 138 | + description: 'Array of group IDs to assign to the user' |
| 139 | + ), |
| 140 | + ] |
| 141 | +)] |
| 142 | +class UpdateUserGroupsSchema |
| 143 | +{ |
| 144 | +} |
0 commit comments