-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI_DOCUMENTATION.json
More file actions
990 lines (990 loc) · 32.8 KB
/
API_DOCUMENTATION.json
File metadata and controls
990 lines (990 loc) · 32.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
{
"api": {
"name": "Smart Campus Management System API",
"version": "1.0.0",
"baseUrl": "http://localhost:5000/api/v1",
"description": "Akıllı Kampüs Yönetim Sistemi Backend API Dokümantasyonu",
"authentication": {
"type": "Bearer Token (JWT)",
"description": "Çoğu endpoint için JWT token gereklidir. Token'ı Authorization header'ında 'Bearer {token}' formatında gönderin.",
"tokenExpiration": {
"accessToken": "15 dakika",
"refreshToken": "7 gün"
}
},
"commonHeaders": {
"Content-Type": "application/json",
"Authorization": "Bearer {accessToken}"
},
"commonResponses": {
"success": {
"status": 200,
"structure": {
"success": true,
"message": "İşlem başarılı",
"data": {}
}
},
"error": {
"status": 400,
"structure": {
"success": false,
"message": "Hata mesajı",
"error": "Detaylı hata bilgisi"
}
},
"unauthorized": {
"status": 401,
"message": "Yetkilendirme hatası - Token geçersiz veya eksik"
},
"forbidden": {
"status": 403,
"message": "Bu işlem için yetkiniz yok"
},
"notFound": {
"status": 404,
"message": "Kayıt bulunamadı"
}
}
},
"endpoints": {
"authentication": {
"group": "Kimlik Doğrulama",
"basePath": "/auth",
"endpoints": [
{
"method": "POST",
"path": "/api/v1/auth/register",
"name": "Kullanıcı Kaydı",
"description": "Yeni kullanıcı kaydı oluşturur. Öğrenci veya öğretim üyesi olarak kayıt yapılabilir.",
"authenticationRequired": false,
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"email": {
"type": "string",
"format": "email",
"required": true,
"description": "Kullanıcı e-posta adresi"
},
"password": {
"type": "string",
"required": true,
"minLength": 8,
"pattern": "En az 1 büyük harf, 1 küçük harf ve 1 rakam içermeli",
"description": "Kullanıcı şifresi"
},
"role": {
"type": "string",
"required": true,
"enum": ["student", "faculty"],
"description": "Kullanıcı rolü"
},
"student_number": {
"type": "string",
"required": false,
"description": "Öğrenci numarası (role='student' ise)"
},
"department_id": {
"type": "number",
"required": false,
"description": "Bölüm ID'si"
},
"employee_number": {
"type": "string",
"required": false,
"description": "Personel numarası (role='faculty' ise)"
},
"title": {
"type": "string",
"required": false,
"description": "Ünvan (Dr., Prof., Arş. Gör. vb.) (role='faculty' ise)"
},
"name": {
"type": "string",
"required": false,
"description": "Kullanıcı adı"
}
},
"example": {
"email": "ogrenci@example.com",
"password": "Sifre123",
"role": "student",
"student_number": "2024001",
"department_id": 1
}
},
"responses": {
"201": {
"description": "Kayıt başarılı",
"body": {
"success": true,
"message": "Kayıt başarılı. Lütfen e-postanızı kontrol edin."
}
},
"400": {
"description": "Geçersiz istek veya e-posta zaten kayıtlı",
"body": {
"success": false,
"message": "Bu e-posta veya numara zaten kayıtlı."
}
}
}
},
{
"method": "POST",
"path": "/api/v1/auth/login",
"name": "Kullanıcı Girişi",
"description": "Kullanıcı girişi yapar ve access token ile refresh token döner.",
"authenticationRequired": false,
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"email": {
"type": "string",
"format": "email",
"required": true,
"description": "Kullanıcı e-posta adresi"
},
"password": {
"type": "string",
"required": true,
"description": "Kullanıcı şifresi"
}
},
"example": {
"email": "ogrenci@example.com",
"password": "Sifre123"
}
},
"responses": {
"200": {
"description": "Giriş başarılı",
"body": {
"success": true,
"data": {
"user": {
"id": "uuid",
"email": "ogrenci@example.com",
"role": "student"
},
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
},
"401": {
"description": "Geçersiz kimlik bilgileri veya e-posta doğrulanmamış",
"body": {
"success": false,
"message": "Geçersiz kimlik bilgileri. (veya) Lütfen önce e-posta adresinizi doğrulayın."
},
"possibleMessages": [
"Geçersiz kimlik bilgileri.",
"Lütfen önce e-posta adresinizi doğrulayın."
]
}
}
},
{
"method": "POST",
"path": "/api/v1/auth/verify-email",
"name": "E-posta Doğrulama",
"description": "Kayıt sırasında gönderilen e-posta doğrulama token'ı ile hesabı aktifleştirir.",
"authenticationRequired": false,
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"token": {
"type": "string",
"required": true,
"description": "E-posta doğrulama token'ı"
}
},
"example": {
"token": "abc123def456..."
}
},
"responses": {
"200": {
"description": "E-posta başarıyla doğrulandı",
"body": {
"success": true,
"message": "E-posta başarıyla doğrulandı. Giriş yapabilirsiniz.",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
},
"400": {
"description": "Geçersiz veya kullanılmış token",
"body": {
"success": false,
"message": "Geçersiz veya zaten kullanılmış doğrulama tokenı."
}
}
}
},
{
"method": "POST",
"path": "/api/v1/auth/refresh",
"name": "Token Yenileme",
"description": "Refresh token kullanarak yeni access token alır.",
"authenticationRequired": false,
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"refreshToken": {
"type": "string",
"required": true,
"description": "Refresh token"
}
},
"example": {
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
},
"responses": {
"200": {
"description": "Token başarıyla yenilendi",
"body": {
"success": true,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
},
"401": {
"description": "Geçersiz veya süresi dolmuş refresh token",
"body": {
"success": false,
"message": "Geçersiz veya süresi dolmuş refresh token."
}
}
}
},
{
"method": "POST",
"path": "/api/v1/auth/logout",
"name": "Çıkış Yapma",
"description": "Kullanıcı çıkışı yapar. (Not: Token'lar client-side'da silinmelidir)",
"authenticationRequired": false,
"requestBody": {
"required": false
},
"responses": {
"200": {
"description": "Çıkış başarılı",
"body": {
"success": true,
"message": "Başarıyla çıkış yapıldı."
}
}
}
},
{
"method": "POST",
"path": "/api/v1/auth/forgot-password",
"name": "Şifre Sıfırlama İsteği",
"description": "Şifre sıfırlama e-postası gönderir.",
"authenticationRequired": false,
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"email": {
"type": "string",
"format": "email",
"required": true,
"description": "Kullanıcı e-posta adresi"
}
},
"example": {
"email": "ogrenci@example.com"
}
},
"responses": {
"200": {
"description": "E-posta gönderildi",
"body": {
"success": true,
"message": "E-posta gönderildi."
}
},
"404": {
"description": "E-posta ile kayıtlı kullanıcı bulunamadı",
"body": {
"success": false,
"message": "Bu email ile kayıtlı kullanıcı yok."
}
}
}
},
{
"method": "PUT",
"path": "/api/v1/auth/reset-password/:resettoken",
"name": "Şifre Sıfırlama",
"description": "Şifre sıfırlama token'ı ile yeni şifre belirler.",
"authenticationRequired": false,
"pathParameters": {
"resettoken": {
"type": "string",
"required": true,
"description": "Şifre sıfırlama token'ı (URL parametresi)"
}
},
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"password": {
"type": "string",
"required": true,
"minLength": 8,
"pattern": "En az 1 büyük harf, 1 küçük harf ve 1 rakam içermeli",
"description": "Yeni şifre"
}
},
"example": {
"password": "YeniSifre123"
}
},
"responses": {
"200": {
"description": "Şifre başarıyla güncellendi",
"body": {
"success": true,
"message": "Şifre başarıyla güncellendi. Giriş yapabilirsiniz."
}
},
"400": {
"description": "Geçersiz veya süresi dolmuş token",
"body": {
"success": false,
"message": "Geçersiz veya süresi dolmuş token."
}
}
}
}
]
},
"users": {
"group": "Kullanıcı İşlemleri",
"basePath": "/users",
"description": "Tüm endpoint'ler authentication gerektirir (Bearer Token)",
"endpoints": [
{
"method": "GET",
"path": "/api/v1/users/me",
"name": "Profil Bilgilerini Getir",
"description": "Giriş yapmış kullanıcının kendi profil bilgilerini getirir.",
"authenticationRequired": true,
"requestBody": {
"required": false
},
"responses": {
"200": {
"description": "Profil bilgileri başarıyla getirildi",
"body": {
"success": true,
"data": {
"id": "uuid",
"email": "ogrenci@example.com",
"phone_number": "5551234567",
"address": "İstanbul, Türkiye",
"bio": "Kullanıcı hakkında bilgi",
"role": "student",
"is_verified": true,
"profile_picture_url": "/uploads/profile_images/filename.jpg",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z",
"studentProfile": {
"student_number": "2024001",
"gpa": 3.5,
"cgpa": 3.4,
"current_semester": 3,
"department": {
"id": 1,
"name": "Bilgisayar Mühendisliği",
"code": "CSE"
}
},
"facultyProfile": null
}
}
},
"404": {
"description": "Kullanıcı bulunamadı",
"body": {
"success": false,
"message": "Kullanıcı bulunamadı."
}
}
}
},
{
"method": "PUT",
"path": "/api/v1/users/me",
"name": "Profil Güncelle",
"description": "Giriş yapmış kullanıcının kendi profil bilgilerini günceller.",
"authenticationRequired": true,
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"phone_number": {
"type": "string",
"required": false,
"description": "Telefon numarası"
},
"address": {
"type": "string",
"required": false,
"description": "Adres"
},
"bio": {
"type": "string",
"required": false,
"description": "Kullanıcı hakkında bilgi"
},
"department_id": {
"type": "number",
"required": false,
"description": "Bölüm ID'si"
},
"student_number": {
"type": "string",
"required": false,
"description": "Öğrenci numarası (sadece student rolü için)"
},
"office_location": {
"type": "string",
"required": false,
"description": "Ofis konumu (sadece faculty rolü için)"
}
},
"example": {
"phone_number": "5551234567",
"address": "İstanbul, Türkiye",
"bio": "Yeni bio bilgisi",
"department_id": 1
}
},
"responses": {
"200": {
"description": "Profil başarıyla güncellendi",
"body": {
"success": true,
"message": "Profil başarıyla güncellendi.",
"data": {
"id": "uuid",
"email": "ogrenci@example.com",
"phone_number": "5551234567",
"address": "İstanbul, Türkiye",
"bio": "Yeni bio bilgisi",
"role": "student",
"studentProfile": {
"student_number": "2024001",
"department": {
"id": 1,
"name": "Bilgisayar Mühendisliği",
"code": "CSE"
}
}
}
}
},
"404": {
"description": "Kullanıcı bulunamadı",
"body": {
"success": false,
"message": "Kullanıcı bulunamadı."
}
}
}
},
{
"method": "POST",
"path": "/api/v1/users/me/profile-picture",
"name": "Profil Fotoğrafı Yükle",
"description": "Giriş yapmış kullanıcının profil fotoğrafını yükler.",
"authenticationRequired": true,
"requestBody": {
"required": true,
"contentType": "multipart/form-data",
"schema": {
"profile_image": {
"type": "file",
"required": true,
"description": "Profil fotoğrafı dosyası (resim formatı)"
}
}
},
"responses": {
"200": {
"description": "Profil fotoğrafı başarıyla yüklendi",
"body": {
"success": true,
"message": "Profil fotoğrafı güncellendi.",
"data": {
"profilePictureUrl": "/uploads/profile_images/filename.jpg"
}
}
},
"400": {
"description": "Dosya yüklenmedi",
"body": {
"success": false,
"message": "Lütfen bir resim dosyası yükleyin."
}
}
}
},
{
"method": "PUT",
"path": "/api/v1/users/change-password",
"name": "Şifre Değiştir",
"description": "Giriş yapmış kullanıcının şifresini değiştirir.",
"authenticationRequired": true,
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"currentPassword": {
"type": "string",
"required": true,
"description": "Mevcut şifre"
},
"newPassword": {
"type": "string",
"required": true,
"minLength": 8,
"pattern": "En az 1 büyük harf, 1 küçük harf ve 1 rakam içermeli",
"description": "Yeni şifre"
}
},
"example": {
"currentPassword": "EskiSifre123",
"newPassword": "YeniSifre123"
}
},
"responses": {
"200": {
"description": "Şifre başarıyla değiştirildi",
"body": {
"success": true,
"message": "Şifreniz başarıyla değiştirildi."
}
},
"400": {
"description": "Mevcut şifre hatalı",
"body": {
"success": false,
"message": "Mevcut şifreniz hatalı."
}
}
}
},
{
"method": "GET",
"path": "/api/v1/users",
"name": "Tüm Kullanıcıları Listele (Admin)",
"description": "Tüm kullanıcıları listeler. Sadece admin rolüne sahip kullanıcılar erişebilir.",
"authenticationRequired": true,
"authorization": {
"requiredRole": "admin"
},
"queryParameters": {
"page": {
"type": "number",
"required": false,
"default": 1,
"description": "Sayfa numarası"
},
"limit": {
"type": "number",
"required": false,
"default": 10,
"description": "Sayfa başına kayıt sayısı"
},
"search": {
"type": "string",
"required": false,
"description": "E-posta adresine göre arama"
},
"role": {
"type": "string",
"required": false,
"enum": ["student", "faculty", "admin", "staff"],
"description": "Rol filtresi"
}
},
"requestBody": {
"required": false
},
"responses": {
"200": {
"description": "Kullanıcı listesi başarıyla getirildi",
"body": {
"success": true,
"data": [
{
"id": "uuid",
"email": "ogrenci@example.com",
"role": "student",
"is_verified": true,
"studentProfile": {
"student_number": "2024001",
"department": {
"id": 1,
"name": "Bilgisayar Mühendisliği",
"code": "CSE"
}
}
}
],
"pagination": {
"total": 100,
"page": 1,
"totalPages": 10
}
}
},
"403": {
"description": "Yetkisiz erişim",
"body": {
"success": false,
"message": "Bu işlem için yetkiniz yok."
}
}
}
}
]
},
"scheduling": {
"group": "Ders Programı Yönetimi",
"basePath": "/scheduling",
"description": "Otomatik ders programı oluşturma ve onay sistemi",
"endpoints": [
{
"method": "POST",
"path": "/api/v1/scheduling/generate",
"name": "Otomatik Program Oluştur",
"description": "CSP algoritması ile otomatik ders programı oluşturur. Program 'draft' (taslak) durumunda kaydedilir.",
"authenticationRequired": true,
"authorization": {
"requiredRole": "admin"
},
"requestBody": {
"required": true,
"contentType": "application/json",
"schema": {
"semester": {
"type": "string",
"required": true,
"enum": ["Fall", "Spring", "Summer"],
"description": "Dönem"
},
"year": {
"type": "number",
"required": true,
"description": "Yıl"
},
"clearExisting": {
"type": "boolean",
"required": false,
"default": false,
"description": "Mevcut programları temizle"
}
},
"example": {
"semester": "Fall",
"year": 2025,
"clearExisting": false
}
},
"responses": {
"200": {
"description": "Program taslak olarak oluşturuldu",
"body": {
"success": true,
"message": "X ders başarıyla programlandı (TASLAK olarak).",
"batchId": "uuid",
"status": "draft",
"data": [],
"stats": {
"totalSections": 10,
"scheduledSections": 10,
"totalClassrooms": 5,
"totalEnrollments": 100
}
}
},
"400": {
"description": "Programlanacak ders veya derslik bulunamadı",
"body": {
"success": false,
"message": "Seçilen dönem için hiç ders bulunamadı."
}
}
}
},
{
"method": "GET",
"path": "/api/v1/scheduling/drafts",
"name": "Taslak Programları Listele",
"description": "Onay bekleyen taslak (draft) ders programlarını listeler.",
"authenticationRequired": true,
"authorization": {
"requiredRole": "admin"
},
"queryParameters": {
"semester": {
"type": "string",
"required": false,
"enum": ["Fall", "Spring", "Summer"],
"description": "Dönem filtresi"
},
"year": {
"type": "number",
"required": false,
"description": "Yıl filtresi"
}
},
"responses": {
"200": {
"description": "Taslak programlar listelendi",
"body": {
"success": true,
"data": [
{
"batchId": "uuid",
"createdAt": "2025-01-01T00:00:00.000Z",
"schedules": [],
"stats": {
"totalCourses": 10,
"departmentCount": 3
}
}
],
"totalDrafts": 10
}
}
}
},
{
"method": "GET",
"path": "/api/v1/scheduling/active",
"name": "Aktif Programları Getir",
"description": "Onaylanmış ve aktif olan ders programlarını getirir.",
"authenticationRequired": true,
"queryParameters": {
"semester": {
"type": "string",
"required": false,
"description": "Dönem filtresi"
},
"year": {
"type": "number",
"required": false,
"description": "Yıl filtresi"
},
"departmentId": {
"type": "string",
"required": false,
"description": "Bölüm ID filtresi"
}
},
"responses": {
"200": {
"description": "Aktif programlar listelendi",
"body": {
"success": true,
"data": [],
"count": 0
}
}
}
},
{
"method": "POST",
"path": "/api/v1/scheduling/approve/:batchId",
"name": "Taslağı Onayla",
"description": "Taslak ders programını onaylar ve aktifleştirir. Mevcut aktif programlar isteğe bağlı olarak arşivlenir.",
"authenticationRequired": true,
"authorization": {
"requiredRole": "admin"
},
"pathParameters": {
"batchId": {
"type": "string",
"required": true,
"description": "Onaylanacak taslak batch ID'si"
}
},
"requestBody": {
"required": false,
"contentType": "application/json",
"schema": {
"archiveExisting": {
"type": "boolean",
"required": false,
"default": true,
"description": "Mevcut aktif programları arşivle"
}
},
"example": {
"archiveExisting": true
}
},
"responses": {
"200": {
"description": "Program başarıyla onaylandı",
"body": {
"success": true,
"message": "X ders programı başarıyla onaylandı ve aktifleştirildi.",
"data": []
}
},
"404": {
"description": "Taslak bulunamadı",
"body": {
"success": false,
"message": "Onaylanacak taslak program bulunamadı."
}
}
}
},
{
"method": "DELETE",
"path": "/api/v1/scheduling/reject/:batchId",
"name": "Taslağı Reddet",
"description": "Taslak ders programını reddeder ve siler.",
"authenticationRequired": true,
"authorization": {
"requiredRole": "admin"
},
"pathParameters": {
"batchId": {
"type": "string",
"required": true,
"description": "Reddedilecek taslak batch ID'si"
}
},
"responses": {
"200": {
"description": "Taslak başarıyla reddedildi",
"body": {
"success": true,
"message": "X ders programı taslağı reddedildi ve silindi."
}
},
"404": {
"description": "Taslak bulunamadı",
"body": {
"success": false,
"message": "Reddedilecek taslak program bulunamadı."
}
}
}
},
{
"method": "GET",
"path": "/api/v1/scheduling/my-schedule",
"name": "Kendi Programımı Getir",
"description": "Giriş yapmış kullanıcının (öğrenci veya öğretim üyesi) ders programını getirir.",
"authenticationRequired": true,
"responses": {
"200": {
"description": "Program getirildi",
"body": {
"success": true,
"data": []
}
}
}
},
{
"method": "GET",
"path": "/api/v1/scheduling/my-schedule/ical",
"name": "Program iCal Export",
"description": "Ders programını iCal (.ics) formatında indirir.",
"authenticationRequired": true,
"responses": {
"200": {
"description": "iCal dosyası",
"contentType": "text/calendar",
"headers": {
"Content-Disposition": "attachment; filename=my-schedule.ics"
}
}
}
}
]
}
},
"dataModels": {
"User": {
"id": "UUID (string)",
"email": "string (unique, email format)",
"phone_number": "string (optional)",
"address": "string (optional)",
"bio": "string (optional)",
"role": "enum: 'student' | 'faculty' | 'admin' | 'staff'",
"is_verified": "boolean",
"profile_picture_url": "string (optional)",
"created_at": "datetime",
"updated_at": "datetime"
},
"Student": {
"student_number": "string (unique)",
"gpa": "float (default: 0.0)",
"cgpa": "float (default: 0.0)",
"current_semester": "integer (default: 1)",
"departmentId": "number (foreign key)"
},
"Faculty": {
"employee_number": "string (unique)",
"title": "string (e.g., 'Dr.', 'Prof.', 'Arş. Gör.')",
"office_location": "string (optional)",
"departmentId": "number (foreign key)"
},
"Department": {
"id": "number",
"name": "string",
"code": "string"
},
"Schedule": {
"id": "UUID (string)",
"section_id": "UUID (foreign key to CourseSection)",
"classroom_id": "UUID (foreign key to Classroom)",
"day_of_week": "enum: 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday'",
"start_time": "time (HH:mm)",
"end_time": "time (HH:mm)",
"status": "enum: 'draft' | 'approved' | 'rejected' | 'archived' (default: 'draft')",
"batch_id": "UUID (optional) - Aynı generate işleminde oluşturulan schedule'ları gruplar",
"approved_by": "UUID (optional) - Onaylayan admin kullanıcı ID",
"approved_at": "datetime (optional)"
}
},
"errorCodes": {
"400": "Bad Request - Geçersiz istek",
"401": "Unauthorized - Yetkilendirme hatası",
"403": "Forbidden - Bu işlem için yetkiniz yok",
"404": "Not Found - Kayıt bulunamadı",
"500": "Internal Server Error - Sunucu hatası"
},
"notes": {
"authentication": "Çoğu endpoint için Authorization header'ında Bearer token gönderilmelidir. Token formatı: 'Bearer {accessToken}'",
"tokenRefresh": "Access token süresi dolduğunda refresh token kullanarak yeni access token alınabilir.",
"emailVerification": "Kayıt sonrası kullanıcıya e-posta doğrulama linki gönderilir. Hesap doğrulanmadan giriş yapılamaz.",
"passwordReset": "Şifre sıfırlama token'ı 10 dakika geçerlidir.",
"fileUpload": "Profil fotoğrafı yükleme için multipart/form-data kullanılmalıdır.",
"pagination": "Listeleme endpoint'lerinde sayfalama için 'page' ve 'limit' query parametreleri kullanılabilir.",
"rateLimiting": "API'ye 15 dakikada maksimum 100 istek gönderilebilir.",
"scheduleApproval": "Otomatik oluşturulan ders programları 'draft' durumunda kaydedilir. Admin onayı sonrası 'approved' olarak aktifleşir."
}
}