Skip to content

Commit 2c501bf

Browse files
committed
feat: Move Member schema to its own file. Add required changes
1 parent 89cfc2a commit 2c501bf

File tree

2 files changed

+83
-65
lines changed

2 files changed

+83
-65
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
9+
#[OA\Schema(
10+
schema: 'Member',
11+
type: 'object',
12+
properties: [
13+
new OA\Property(property: 'id', type: 'integer', example: 1),
14+
new OA\Property(property: 'created', type: 'integer', example: 1630500518),
15+
new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518),
16+
new OA\Property(property: 'first_name', type: 'string', example: 'John'),
17+
new OA\Property(property: 'last_name', type: 'string', example: 'Doe'),
18+
new OA\Property(property: 'bio', type: 'string'),
19+
new OA\Property(property: 'gender', type: 'string'),
20+
new OA\Property(property: 'github_user', type: 'string'),
21+
new OA\Property(property: 'linked_in', type: 'string'),
22+
new OA\Property(property: 'irc', type: 'string'),
23+
new OA\Property(property: 'twitter', type: 'string'),
24+
new OA\Property(property: 'state', type: 'string'),
25+
new OA\Property(property: 'country', type: 'string'),
26+
new OA\Property(property: 'active', type: 'boolean', example: true),
27+
new OA\Property(property: 'email_verified', type: 'boolean', example: true),
28+
new OA\Property(property: 'pic', type: 'string'),
29+
new OA\Property(property: 'membership_type', type: 'string', example: 'Foundation'),
30+
new OA\Property(property: 'candidate_profile_id', type: 'integer', example: 1465),
31+
new OA\Property(property: 'company', type: 'string'),
32+
new OA\Property(property: 'speaker_id', type: 'integer', example: 187),
33+
new OA\Property(property: 'attendee_id', type: 'integer', example: 1287),
34+
new OA\Property(property: 'groups_events', type: 'array', items: new OA\Items(type: 'object'), description: 'GroupEvent object, only available if ?expand=groups_events is provided'),
35+
new OA\Property(property: 'groups', type: 'array', items: new OA\Items(type: 'integer')),
36+
new OA\Property(property: 'affiliations', type: 'array', items: new OA\Items(ref: '#/components/schemas/Organization'), description: 'Organization object, only available if ?expand=affiliations is provided'),
37+
new OA\Property(property: 'all_affiliations', type: 'array', items: new OA\Items(ref: '#/components/schemas/Affiliation'), description: 'Affiliation object, only available if ?expand=all_affiliations is provided'),
38+
new OA\Property(property: 'ccla_teams', type: 'array', items: new OA\Items(type: 'object'), description: 'CCLA Team object, only available if ?expand=ccla_teams is provided'),
39+
new OA\Property(property: 'election_applications', type: 'array', items: new OA\Items(type: 'object'), description: 'Nomination object, only available if ?expand=election_applications is provided'),
40+
new OA\Property(property: 'election_nominations', type: 'array', items: new OA\Items(type: 'object'), description: 'Nomination object, only available if ?expand=election_nominations is provided'),
41+
new OA\Property(property: 'candidate_profile', type: 'array', items: new OA\Items(type: 'object'), description: 'Candidate object, only available if ?expand=candidate_profile is provided'),
42+
new OA\Property(property: 'team_memberships', type: 'array', items: new OA\Items(type: 'object'), description: 'ChatTeamMember object, only available if ?expand=team_memberships is provided'),
43+
new OA\Property(property: 'sponsor_memberships', type: 'array', items: new OA\Items(type: 'object'), description: 'Sponsor object, only available if ?expand=sponsor_memberships is provided'),
44+
new OA\Property(property: 'favorite_summit_events', type: 'array', items: new OA\Items(type: 'integer')),
45+
new OA\Property(property: 'schedule_summit_events', type: 'array', items: new OA\Items(type: 'integer')),
46+
new OA\Property(property: 'summit_tickets', type: 'array', items: new OA\Items(type: 'object'), description: 'SummitAttendeeTicket object, only available if ?expand=sponsor_memberships is provided'),
47+
new OA\Property(property: 'schedule_shareable_link', type: 'array', items: new OA\Items(type: 'object'), description: 'PersonalCalendarShareInfo object, only available if ?expand=schedule_shareable_link is provided'),
48+
new OA\Property(property: 'legal_agreements', type: 'array', items: new OA\Items(type: 'integer')),
49+
new OA\Property(property: 'track_chairs', type: 'array', items: new OA\Items(type: 'integer')),
50+
new OA\Property(property: 'summit_permission_groups', type: 'array', items: new OA\Items(type: 'integer')),
51+
new OA\Property(property: 'speaker', type: 'array', items: new OA\Items(type: 'object'), description: 'PresentationSpeaker object, only available if ?expand=speaker is provided'),
52+
new OA\Property(property: 'attendee', type: 'array', items: new OA\Items(ref: '#/components/schemas/SummitAttendee'), description: 'only available if ?expand=attendee is provided'),
53+
new OA\Property(property: 'feedback', type: 'array', items: new OA\Items(type: 'object'), description: 'SummitEventFeedback object, only available if ?expand=feedback is provided'),
54+
new OA\Property(property: 'rsvp', type: 'array', items: new OA\Items(ref: '#/components/schemas/RSVP'), description: 'only available if ?expand=rsvp is provided'),
55+
new OA\Property(property: 'rsvp_invitations', type: 'array', items: new OA\Items(ref: '#/components/schemas/RSVPInvitation'), description: 'only available if ?expand=rsvp_invitations is provided'),
56+
new OA\Property(property: 'email', type: 'string', example: 'user@example.com'),
57+
new OA\Property(property: 'second_email', type: 'string', example: 'user@example.com'),
58+
new OA\Property(property: 'third_email', type: 'string', example: 'user@example.com'),
59+
new OA\Property(property: 'user_external_id', type: 'integer'),
60+
]
61+
)]
62+
class MemberSchema {}

app/Swagger/schemas.php

Lines changed: 21 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -299,64 +299,6 @@ class RSVPInvitationsAuthSchema
299299
{
300300
}
301301

302-
#[OA\Schema(
303-
schema: 'Member',
304-
type: 'object',
305-
required: ['id', 'created', 'last_edited', 'first_name', 'last_name', 'bio', 'gender', 'github_user', 'linked_in', 'irc', 'twitter', 'state', 'country', 'active', 'email_verified', 'pic', 'membership_type', 'candidate_profile_id', 'company', ],
306-
properties: [
307-
new OA\Property(property: 'id', type: 'integer', example: 1),
308-
new OA\Property(property: 'created', type: 'integer', example: 1630500518),
309-
new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518),
310-
new OA\Property(property: 'first_name', type: 'string', example: 'John'),
311-
new OA\Property(property: 'last_name', type: 'string', example: 'Doe'),
312-
new OA\Property(property: 'bio', type: 'string'),
313-
new OA\Property(property: 'gender', type: 'string'),
314-
new OA\Property(property: 'github_user', type: 'string'),
315-
new OA\Property(property: 'linked_in', type: 'string'),
316-
new OA\Property(property: 'irc', type: 'string'),
317-
new OA\Property(property: 'twitter', type: 'string'),
318-
new OA\Property(property: 'state', type: 'string'),
319-
new OA\Property(property: 'country', type: 'string'),
320-
new OA\Property(property: 'active', type: 'boolean', example: true),
321-
new OA\Property(property: 'email_verified', type: 'boolean', example: true),
322-
new OA\Property(property: 'pic', type: 'string'),
323-
new OA\Property(property: 'membership_type', type: 'string', example: 'Foundation'),
324-
new OA\Property(property: 'candidate_profile_id', type: 'integer', example: 1465),
325-
new OA\Property(property: 'company', type: 'string'),
326-
new OA\Property(property: 'speaker_id', type: 'integer', example: 187),
327-
new OA\Property(property: 'attendee_id', type: 'integer', example: 1287),
328-
new OA\Property(property: 'groups_events', type: 'array', items: new OA\Items(type: 'GroupEvent')),
329-
new OA\Property(property: 'groups', type: 'array', items: new OA\Items(type: 'integer')),
330-
new OA\Property(property: 'affiliations', type: 'array', items: new OA\Items(type: 'Organization')),
331-
new OA\Property(property: 'all_affiliations', type: 'array', items: new OA\Items(type: 'Affiliation')),
332-
new OA\Property(property: 'ccla_teams', type: 'array', items: new OA\Items(type: 'Team')),
333-
new OA\Property(property: 'election_applications', type: 'array', items: new OA\Items(type: 'Nomination')),
334-
new OA\Property(property: 'candidate_profile', type: 'array', items: new OA\Items(type: 'Candidate')),
335-
new OA\Property(property: 'election_nominations', type: 'array', items: new OA\Items(type: 'Nomination')),
336-
new OA\Property(property: 'team_memberships', type: 'array', items: new OA\Items(type: 'ChatTeamMember')),
337-
new OA\Property(property: 'sponsor_memberships', type: 'array', items: new OA\Items(type: 'Sponsor')),
338-
new OA\Property(property: 'favorite_summit_events', type: 'array', items: new OA\Items(type: 'integer')),
339-
new OA\Property(property: 'schedule_summit_events', type: 'array', items: new OA\Items(type: 'integer')),
340-
new OA\Property(property: 'summit_tickets', type: 'array', items: new OA\Items(type: 'SummitAttendeeTicket')),
341-
new OA\Property(property: 'schedule_shareable_link', type: 'array', items: new OA\Items(type: 'PersonalCalendarShareInfo')),
342-
new OA\Property(property: 'legal_agreements', type: 'array', items: new OA\Items(type: 'integer')),
343-
new OA\Property(property: 'track_chairs', type: 'array', items: new OA\Items(type: 'integer')),
344-
new OA\Property(property: 'summit_permission_groups', type: 'array', items: new OA\Items(type: 'integer')),
345-
new OA\Property(property: 'speaker', type: 'array', items: new OA\Items(type: 'PresentationSpeaker')),
346-
new OA\Property(property: 'attendee', type: 'array', items: new OA\Items(type: 'SummitAttendee')),
347-
new OA\Property(property: 'feedback', type: 'array', items: new OA\Items(type: 'SummitEventFeedback')),
348-
new OA\Property(property: 'rsvp', type: 'array', items: new OA\Items(type: 'RSVP')),
349-
new OA\Property(property: 'rsvp_invitations', type: 'array', items: new OA\Items(type: 'RSVPInvitation')),
350-
new OA\Property(property: 'email', type: 'string', example: 'user@example.com'),
351-
new OA\Property(property: 'second_email', type: 'string', example: 'user@example.com'),
352-
new OA\Property(property: 'third_email', type: 'string', example: 'user@example.com'),
353-
new OA\Property(property: 'user_external_id', type: 'integer'),
354-
]
355-
)]
356-
class MemberSchema
357-
{
358-
}
359-
360302
#[OA\Schema(
361303
schema: 'RSVP',
362304
type: 'object',
@@ -391,7 +333,9 @@ class RSVPSchema
391333
)
392334
]
393335
)]
394-
class PaginatedMembersResponseSchema {}
336+
class PaginatedMembersResponseSchema
337+
{
338+
}
395339

396340
#[OA\Schema(
397341
schema: 'PaginatedMemberCompaniesResponse',
@@ -414,7 +358,9 @@ class PaginatedMembersResponseSchema {}
414358
)
415359
]
416360
)]
417-
class PaginatedMemberCompaniesResponseSchema {}
361+
class PaginatedMemberCompaniesResponseSchema
362+
{
363+
}
418364

419365
#[OA\Schema(
420366
schema: 'PaginatedAffiliationsResponse',
@@ -432,7 +378,9 @@ class PaginatedMemberCompaniesResponseSchema {}
432378
)
433379
]
434380
)]
435-
class PaginatedAffiliationsResponseSchema {}
381+
class PaginatedAffiliationsResponseSchema
382+
{
383+
}
436384

437385
#[OA\Schema(
438386
schema: 'Affiliation',
@@ -450,7 +398,9 @@ class PaginatedAffiliationsResponseSchema {}
450398
new OA\Property(property: 'organization_id', type: 'integer', example: 1),
451399
]
452400
)]
453-
class AffiliationSchema {}
401+
class AffiliationSchema
402+
{
403+
}
454404

455405
#[OA\Schema(
456406
schema: 'MemberUpdateRequest',
@@ -465,7 +415,9 @@ class AffiliationSchema {}
465415
new OA\Property(property: 'other_food_preference', type: 'string', maxLength: 100),
466416
]
467417
)]
468-
class MemberUpdateRequestSchema {}
418+
class MemberUpdateRequestSchema
419+
{
420+
}
469421

470422
#[OA\Schema(
471423
schema: 'AffiliationRequest',
@@ -480,7 +432,9 @@ class MemberUpdateRequestSchema {}
480432
new OA\Property(property: 'job_title', type: 'string', maxLength: 255),
481433
]
482434
)]
483-
class AffiliationRequestSchema {}
435+
class AffiliationRequestSchema
436+
{
437+
}
484438

485439
#[OA\Schema(
486440
schema: 'PaginatedRSVPsResponse',
@@ -668,4 +622,6 @@ class OrganizationCreateRequestSchema
668622
)
669623
]
670624
)]
671-
class PaginatedUserStoriesResponseSchema {}
625+
class PaginatedUserStoriesResponseSchema
626+
{
627+
}

0 commit comments

Comments
 (0)