μΊλ¦°λ μΌμ (CalendarEvent)κ³Ό μ¬μ©μ μΊλ¦°λ(UserCalendar) APIμ
λλ€. μΌμ μ μμ±/μ‘°ν/μμ /μμ , λ°λ³΅ μΌμ νμ₯, μμ
λκΈ°ν, μ¬μ©μ μΊλ¦°λ κ΄λ¦¬ κΈ°λ₯μ μ 곡ν©λλ€.
λΌμ°νΈ νμΌ : backend/src/routes/calendarEvents.js, backend/src/routes/userCalendars.js, backend/src/routes/memos.js
컨νΈλ‘€λ¬ νμΌ : backend/src/controllers/calendarEvents.js, backend/src/controllers/userCalendars.js, backend/src/controllers/memos.js
λͺ¨λΈ νμΌ : backend/src/models/CalendarEvent.js, backend/src/models/UserCalendar.js (λ©λͺ¨λ Registration.memos)
λ©μλ
κ²½λ‘
μ€λͺ
κΆν
POST
/api/calendar-events
μΌμ μμ±
isLoggedIn (admin|manager - νκ΅ λ²μ)
GET
/api/calendar-events
μΌμ λͺ©λ‘ μ‘°ν
isLoggedIn
PUT
/api/calendar-events/:_id
μΌμ μμ
isLoggedIn (μμ μ λλ admin|manager)
DELETE
/api/calendar-events/:_id
μΌμ μμ
isLoggedIn (μμ μ λλ admin|manager)
POST
/api/calendar-events/sync
μμ
μΌμ λκΈ°ν
isLoggedIn
λ©μλ
κ²½λ‘
μ€λͺ
κΆν
POST
/api/user-calendars
μ¬μ©μ μΊλ¦°λ μμ±
isLoggedIn (admin|manager - νκ΅ λ²μ)
GET
/api/user-calendars
μ¬μ©μ μΊλ¦°λ λͺ©λ‘ μ‘°ν
isLoggedIn
PUT
/api/user-calendars/:_id
μ¬μ©μ μΊλ¦°λ μμ
isLoggedIn (μμ μ λλ admin|manager)
DELETE
/api/user-calendars/:_id
μ¬μ©μ μΊλ¦°λ μμ
isLoggedIn (μμ μ λλ admin|manager)
Registration Memo (/api/memos)
λ±λ‘(registration)μ λΆλ κ°μΈ μκ°ν λ©λͺ¨μ
λλ€. μκ° enrollmentμ memo νλμλ λ³κ°μ΄λ©°, μΊλ¦°λ syncμ sourceType: "memo" μμ²μ΄ λ©λλ€.
λ©μλ
κ²½λ‘
μ€λͺ
κΆν
POST
/api/memos
λ©λͺ¨ μΆκ°
isLoggedIn (λ³ΈμΈ registration)
PUT
/api/memos/:_id
λ©λͺ¨ μμ
isLoggedIn (λ³ΈμΈ registration)
DELETE
/api/memos/:_id
λ©λͺ¨ μμ
isLoggedIn (λ³ΈμΈ registration)
μΊλ¦°λ μΌμ μ μμ±ν©λλ€. scopeκ° "school"μΈ κ²½μ° admin λλ manager κΆνμ΄ νμνλ©°, school νλκ° νμμ
λλ€.
POST /api/calendar-events
κΆν : isLoggedIn (νκ΅ λ²μ μΌμ μμ± μ admin λλ manager)
νλ
νμ
νμ
μ€λͺ
title
string
O
μΌμ μ λͺ©
start
string (ISO 8601)
O
μμ μΌμ
end
string (ISO 8601)
O
μ’
λ£ μΌμ
scope
string
O
"school" λλ "personal"
description
string
X
μΌμ μ€λͺ
(κΈ°λ³Έκ°: "")
isAllDay
boolean
X
μ’
μΌ μΌμ μ¬λΆ (κΈ°λ³Έκ°: false)
school
ObjectId
쑰건λΆ
νκ΅ ID (scopeκ° "school"μΌ λ νμ)
recurrence
object
X
λ°λ³΅ μ€μ
recurrence.type
string
X
"none" | "daily" | "weekly" | "monthly" (κΈ°λ³Έκ°: "none")
recurrence.endDate
string (ISO 8601)
X
λ°λ³΅ μ’
λ£μΌ
recurrence.days
number[]
X
λ°λ³΅ μμΌ (0=μΌ, 1=μ, ..., 6=ν ). weekly νμ
μμ μ¬μ©
color
string
X
μΌμ μμ (κΈ°λ³Έκ°: "#4285f4")
calendarId
ObjectId
X
μμ μ¬μ©μ μΊλ¦°λ ID
reminder
object
X
μλ¦Ό μ€μ
reminder.enabled
boolean
X
μλ¦Ό νμ±ν μ¬λΆ (κΈ°λ³Έκ°: false)
reminder.minutesBefore
number
X
μλ¦Ό μκ° (λΆ λ¨μ)
reminder.useDefault
boolean
X
κΈ°λ³Έ μλ¦Ό μ¬μ© μ¬λΆ (κΈ°λ³Έκ°: true)
{
"title" : " ν λ―Έν
" ,
"start" : " 2024-03-15T10:00:00.000Z" ,
"end" : " 2024-03-15T11:00:00.000Z" ,
"scope" : " personal" ,
"description" : " μ£Όκ° ν λ―Έν
" ,
"isAllDay" : false ,
"recurrence" : {
"type" : " weekly" ,
"endDate" : " 2024-06-30T23:59:59.000Z" ,
"days" : [1 , 3 , 5 ]
},
"color" : " #34a853" ,
"reminder" : {
"enabled" : true ,
"minutesBefore" : 10 ,
"useDefault" : false
}
}
{
"calendarEvent" : {
"_id" : " 507f1f77bcf86cd799439011" ,
"title" : " ν λ―Έν
" ,
"description" : " μ£Όκ° ν λ―Έν
" ,
"start" : " 2024-03-15T10:00:00.000Z" ,
"end" : " 2024-03-15T11:00:00.000Z" ,
"isAllDay" : false ,
"scope" : " personal" ,
"user" : " 507f1f77bcf86cd799439022" ,
"recurrence" : {
"type" : " weekly" ,
"endDate" : " 2024-06-30T23:59:59.000Z" ,
"days" : [1 , 3 , 5 ]
},
"color" : " #34a853" ,
"reminder" : {
"enabled" : true ,
"minutesBefore" : 10 ,
"useDefault" : false
},
"sourceType" : " manual" ,
"createdAt" : " 2024-03-10T09:00:00.000Z" ,
"updatedAt" : " 2024-03-10T09:00:00.000Z"
}
}
μν μ½λ
λ©μμ§
μ€λͺ
400
FIELD_REQUIRED({νλλͺ
})
νμ νλ λλ½ (title, start, end, scope, school)
400
FIELD_INVALID(scope)
scope κ°μ΄ "school" λλ "personal"μ΄ μλ
403
PERMISSION_DENIED
νκ΅ λ²μ μΌμ μμ± μ κΆν λΆμ‘±
μ§μ λ λ μ§ λ²μ λ΄μ μΌμ μ μ‘°νν©λλ€. λ°λ³΅ μΌμ μ μλμΌλ‘ κ°λ³ μΈμ€ν΄μ€λ‘ νμ₯λ©λλ€. scopeλ₯Ό μ§μ νμ§ μμΌλ©΄ κ°μΈ μΌμ κ³Ό νκ΅ μΌμ μ λͺ¨λ μ‘°νν©λλ€.
κΆν : isLoggedIn
νλΌλ―Έν°
νμ
νμ
μ€λͺ
startDate
string (ISO 8601)
O
μ‘°ν μμμΌ
endDate
string (ISO 8601)
O
μ‘°ν μ’
λ£μΌ
scope
string
X
"school" λλ "personal". λ―Έμ§μ μ μ 체
school
ObjectId
X
νκ΅ ID νν°
user
ObjectId
X
λμ μ¬μ©μ ID (λ―Έμ§μ μ λ‘κ·ΈμΈ μ¬μ©μ)
GET /api/calendar-events?startDate=2024-03-01T00:00:00.000Z&endDate=2024-03-31T23:59:59.000Z&school=507f1f77bcf86cd799439033
λ°λ³΅ μΌμ μ μ‘°ν λ²μ λ΄μμ κ°λ³ μΈμ€ν΄μ€λ‘ νμ₯λμ΄ λ°νλ©λλ€. νμ₯λ μΈμ€ν΄μ€μλ isRecurrenceInstance: trueμ recurrenceParentId νλκ° μΆκ°λ©λλ€.
{
"calendarEvents" : [
{
"_id" : " 507f1f77bcf86cd799439011" ,
"title" : " κΈ°λ§κ³ μ¬" ,
"description" : " 1νκΈ° κΈ°λ§κ³ μ¬" ,
"start" : " 2024-03-20T09:00:00.000Z" ,
"end" : " 2024-03-22T18:00:00.000Z" ,
"isAllDay" : true ,
"scope" : " school" ,
"school" : " 507f1f77bcf86cd799439033" ,
"user" : " 507f1f77bcf86cd799439022" ,
"recurrence" : { "type" : " none" },
"color" : " #4285f4" ,
"sourceType" : " manual" ,
"createdAt" : " 2024-03-01T09:00:00.000Z" ,
"updatedAt" : " 2024-03-01T09:00:00.000Z"
},
{
"_id" : " 507f1f77bcf86cd799439012" ,
"title" : " ν λ―Έν
" ,
"start" : " 2024-03-18T10:00:00.000Z" ,
"end" : " 2024-03-18T11:00:00.000Z" ,
"isAllDay" : false ,
"scope" : " personal" ,
"user" : " 507f1f77bcf86cd799439022" ,
"recurrence" : {
"type" : " weekly" ,
"endDate" : " 2024-06-30T23:59:59.000Z" ,
"days" : [1 , 3 , 5 ]
},
"color" : " #34a853" ,
"sourceType" : " manual" ,
"isRecurrenceInstance" : true ,
"recurrenceParentId" : " 507f1f77bcf86cd799439012" ,
"createdAt" : " 2024-03-10T09:00:00.000Z" ,
"updatedAt" : " 2024-03-10T09:00:00.000Z"
}
]
}
μν μ½λ
λ©μμ§
μ€λͺ
400
FIELD_REQUIRED(startDate)
startDate λλ endDate λλ½
κΈ°μ‘΄ μΊλ¦°λ μΌμ μ μμ ν©λλ€. κ°μΈ μΌμ μ μμ μλ§, νκ΅ μΌμ μ admin λλ managerλ§ μμ ν μ μμ΅λλ€.
PUT /api/calendar-events/:_id
κΆν : isLoggedIn (κ°μΈ μΌμ : μμ μ, νκ΅ μΌμ : admin λλ manager)
νλΌλ―Έν°
νμ
μ€λͺ
_id
ObjectId
μΌμ ID
νλ
νμ
νμ
μ€λͺ
title
string
X
μΌμ μ λͺ©
description
string
X
μΌμ μ€λͺ
start
string (ISO 8601)
X
μμ μΌμ
end
string (ISO 8601)
X
μ’
λ£ μΌμ
isAllDay
boolean
X
μ’
μΌ μΌμ μ¬λΆ
recurrence
object
X
λ°λ³΅ μ€μ
recurrence.type
string
X
"none" | "daily" | "weekly" | "monthly"
recurrence.endDate
string (ISO 8601)
X
λ°λ³΅ μ’
λ£μΌ
recurrence.days
number[]
X
λ°λ³΅ μμΌ (0-6)
color
string
X
μΌμ μμ
calendarId
ObjectId
X
μμ μ¬μ©μ μΊλ¦°λ ID
reminder
object
X
μλ¦Ό μ€μ
reminder.enabled
boolean
X
μλ¦Ό νμ±ν μ¬λΆ
reminder.minutesBefore
number
X
μλ¦Ό μκ° (λΆ λ¨μ)
reminder.useDefault
boolean
X
κΈ°λ³Έ μλ¦Ό μ¬μ© μ¬λΆ
{
"title" : " ν λ―Έν
(λ³κ²½)" ,
"start" : " 2024-03-15T14:00:00.000Z" ,
"end" : " 2024-03-15T15:30:00.000Z" ,
"color" : " #ff9800"
}
{
"calendarEvent" : {
"_id" : " 507f1f77bcf86cd799439011" ,
"title" : " ν λ―Έν
(λ³κ²½)" ,
"description" : " μ£Όκ° ν λ―Έν
" ,
"start" : " 2024-03-15T14:00:00.000Z" ,
"end" : " 2024-03-15T15:30:00.000Z" ,
"isAllDay" : false ,
"scope" : " personal" ,
"user" : " 507f1f77bcf86cd799439022" ,
"recurrence" : {
"type" : " weekly" ,
"endDate" : " 2024-06-30T23:59:59.000Z" ,
"days" : [1 , 3 , 5 ]
},
"color" : " #ff9800" ,
"sourceType" : " manual" ,
"createdAt" : " 2024-03-10T09:00:00.000Z" ,
"updatedAt" : " 2024-03-15T12:00:00.000Z"
}
}
μν μ½λ
λ©μμ§
μ€λͺ
403
PERMISSION_DENIED
μμ κΆν μμ
404
calendarEvent_NOT_FOUND
μΌμ μ μ°Ύμ μ μμ
μΊλ¦°λ μΌμ μ μμ ν©λλ€. κ°μΈ μΌμ μ μμ μλ§, νκ΅ μΌμ μ admin λλ managerλ§ μμ ν μ μμ΅λλ€.
DELETE /api/calendar-events/:_id
κΆν : isLoggedIn (κ°μΈ μΌμ : μμ μ, νκ΅ μΌμ : admin λλ manager)
νλΌλ―Έν°
νμ
μ€λͺ
_id
ObjectId
μΌμ ID
μν μ½λ
λ©μμ§
μ€λͺ
403
PERMISSION_DENIED
μμ κΆν μμ
404
calendarEvent_NOT_FOUND
μΌμ μ μ°Ύμ μ μμ
μκ° μ 보(enrollment), κ°μ μ 보(syllabus), λ©λͺ¨(memo)λ₯Ό μΊλ¦°λ μΌμ μΌλ‘ λκΈ°νν©λλ€. λ±λ‘(registration)μ κΈ°κ° μ 보λ₯Ό κΈ°λ°μΌλ‘ λ§€μ£Ό λ°λ³΅ μΌμ μ μμ±νλ©°, sourceType/sourceIdλ₯Ό μ¬μ©ν upsert μ λ΅μΌλ‘ μ€λ³΅μ λ°©μ§ν©λλ€.
POST /api/calendar-events/sync
κΆν : isLoggedIn (λ€λ₯Έ μ¬μ©μ λμ λκΈ°ν μ admin, manager λλ teacher)
νλ
νμ
νμ
μ€λͺ
season
ObjectId
O
νκΈ° ID
targetUser
ObjectId
X
λκΈ°ν λμ μ¬μ©μ ID (λ―Έμ§μ μ λ‘κ·ΈμΈ μ¬μ©μ)
{
"season" : " 507f1f77bcf86cd799439044"
}
λκΈ°ν μ λ€μ μΈ κ°μ§ μμ€μμ μΌμ μ΄ μμ±λ©λλ€:
μμ€
sourceType
μμ
μ€λͺ
μκ° μ 보
"enrollment"
#4285f4 (νλ)
νμμ μκ° μκ°ν
κ°μ μ 보
"syllabus"
#34a853 (μ΄λ‘)
κ΅μ¬μ κ°μ μκ°ν
λ©λͺ¨
"memo"
#ff9800 (μ£Όν©)
λ±λ‘ λ©λͺ¨μ μκ°ν
λκΈ°ν κ³Όμ :
λ±λ‘(registration)μ κΈ°κ°(period) μ 보 μ‘°ν
μκ°/κ°μ/λ©λͺ¨μ μκ° μ 보λ₯Ό κΈ°λ°μΌλ‘ λ§€μ£Ό λ°λ³΅ μΌμ λ°μ΄ν° μμ±
sourceIdλ₯Ό ν€λ‘ upsert μ€ν (enrollment/syllabusλ $set, memoλ $setOnInsert)
λ μ΄μ μ ν¨νμ§ μμ κ³ μ μ΄λ²€νΈ μμ
λμΌ sourceIdμ μ€λ³΅ μ΄λ²€νΈ μ 리 (μ΅μ 1κ±΄λ§ μ μ§)
μ°Έκ³ : sourceId νμμ {sourceType}_{documentId}_{timeIndex} μ
λλ€ (μ: enrollment_507f1f77_0).
{
"synced" : 5 ,
"removed" : 2 ,
"total" : 8
}
νλ
νμ
μ€λͺ
synced
number
μλ‘ μμ±λ μΌμ μ
removed
number
μμ λ κ³ μ/μ€λ³΅ μΌμ μ
total
number
λκΈ°ν λμ μ 체 μΌμ μ
μν μ½λ
λ©μμ§
μ€λͺ
400
FIELD_REQUIRED(season)
season νλ λλ½
403
PERMISSION_DENIED
λ€λ₯Έ μ¬μ©μ λμ λκΈ°ν μ κΆν λΆμ‘±
404
registration_NOT_FOUND
ν΄λΉ νκΈ°/μ¬μ©μμ λ±λ‘ μ 보λ₯Ό μ°Ύμ μ μμ
μ¬μ©μ μΊλ¦°λ μμ±
μ¬μ©μ μΊλ¦°λ(μΊλ¦°λ κ·Έλ£Ή)λ₯Ό μμ±ν©λλ€. μΌμ μ μΊλ¦°λλ³λ‘ λΆλ₯νλ λ° μ¬μ©λ©λλ€.
κΆν : isLoggedIn (νκ΅ λ²μ μΊλ¦°λ μμ± μ admin λλ manager)
νλ
νμ
νμ
μ€λͺ
name
string
O
μΊλ¦°λ μ΄λ¦
color
string
X
μΊλ¦°λ μμ (κΈ°λ³Έκ°: "#4285f4")
scope
string
X
"school" λλ "personal" (κΈ°λ³Έκ°: "personal")
school
ObjectId
쑰건λΆ
νκ΅ ID (scopeκ° "school"μΌ λ νμ)
{
"name" : " κ°μΈ νμ΅" ,
"color" : " #e91e63"
}
{
"userCalendar" : {
"_id" : " 507f1f77bcf86cd799439055" ,
"user" : " 507f1f77bcf86cd799439022" ,
"name" : " κ°μΈ νμ΅" ,
"color" : " #e91e63" ,
"scope" : " personal" ,
"isDefault" : false ,
"createdAt" : " 2024-03-10T09:00:00.000Z" ,
"updatedAt" : " 2024-03-10T09:00:00.000Z"
}
}
μν μ½λ
λ©μμ§
μ€λͺ
400
FIELD_REQUIRED(name)
name νλ λλ½
400
FIELD_REQUIRED(school)
νκ΅ λ²μμμ school νλ λλ½
403
PERMISSION_DENIED
νκ΅ λ²μ μΊλ¦°λ μμ± μ κΆν λΆμ‘±
μ¬μ©μ μΊλ¦°λ λͺ©λ‘ μ‘°ν
λ‘κ·ΈμΈ μ¬μ©μμ κ°μΈ μΊλ¦°λμ νκ΅ μΊλ¦°λλ₯Ό μ‘°νν©λλ€. κΈ°λ³Έ μΊλ¦°λ(isDefault)κ° λ¨Όμ μ λ ¬λλ©°, μ΄ν μμ±μΌμ μμΌλ‘ μ λ ¬λ©λλ€.
κΆν : isLoggedIn
νλΌλ―Έν°
νμ
νμ
μ€λͺ
school
ObjectId
X
νκ΅ ID (νκ΅ λ²μ μΊλ¦°λ νν°)
GET /api/user-calendars?school=507f1f77bcf86cd799439033
{
"userCalendars" : [
{
"_id" : " 507f1f77bcf86cd799439055" ,
"user" : " 507f1f77bcf86cd799439022" ,
"name" : " κΈ°λ³Έ μΊλ¦°λ" ,
"color" : " #4285f4" ,
"scope" : " personal" ,
"isDefault" : true ,
"createdAt" : " 2024-01-01T00:00:00.000Z" ,
"updatedAt" : " 2024-01-01T00:00:00.000Z"
},
{
"_id" : " 507f1f77bcf86cd799439056" ,
"user" : " 507f1f77bcf86cd799439022" ,
"name" : " κ°μΈ νμ΅" ,
"color" : " #e91e63" ,
"scope" : " personal" ,
"isDefault" : false ,
"createdAt" : " 2024-03-10T09:00:00.000Z" ,
"updatedAt" : " 2024-03-10T09:00:00.000Z"
},
{
"_id" : " 507f1f77bcf86cd799439057" ,
"user" : " 507f1f77bcf86cd799439030" ,
"school" : " 507f1f77bcf86cd799439033" ,
"name" : " νκ΅ νμ¬" ,
"color" : " #ff5722" ,
"scope" : " school" ,
"isDefault" : false ,
"createdAt" : " 2024-02-01T09:00:00.000Z" ,
"updatedAt" : " 2024-02-01T09:00:00.000Z"
}
]
}
μ¬μ©μ μΊλ¦°λ μμ
μ¬μ©μ μΊλ¦°λμ μ΄λ¦κ³Ό μμμ μμ ν©λλ€.
PUT /api/user-calendars/:_id
κΆν : isLoggedIn (μμ μ λλ admin/manager)
νλΌλ―Έν°
νμ
μ€λͺ
_id
ObjectId
μ¬μ©μ μΊλ¦°λ ID
νλ
νμ
νμ
μ€λͺ
name
string
X
μΊλ¦°λ μ΄λ¦
color
string
X
μΊλ¦°λ μμ
{
"name" : " κ°μΈ νμ΅ (μμ )" ,
"color" : " #9c27b0"
}
{
"userCalendar" : {
"_id" : " 507f1f77bcf86cd799439055" ,
"user" : " 507f1f77bcf86cd799439022" ,
"name" : " κ°μΈ νμ΅ (μμ )" ,
"color" : " #9c27b0" ,
"scope" : " personal" ,
"isDefault" : false ,
"createdAt" : " 2024-03-10T09:00:00.000Z" ,
"updatedAt" : " 2024-03-15T12:00:00.000Z"
}
}
μν μ½λ
λ©μμ§
μ€λͺ
403
PERMISSION_DENIED
μμ κΆν μμ
404
userCalendar_NOT_FOUND
μΊλ¦°λλ₯Ό μ°Ύμ μ μμ
μ¬μ©μ μΊλ¦°λ μμ
μ¬μ©μ μΊλ¦°λλ₯Ό μμ ν©λλ€. κΈ°λ³Έ μΊλ¦°λ(isDefault: true)λ μμ ν μ μμ΅λλ€.
DELETE /api/user-calendars/:_id
κΆν : isLoggedIn (μμ μ λλ admin/manager)
νλΌλ―Έν°
νμ
μ€λͺ
_id
ObjectId
μ¬μ©μ μΊλ¦°λ ID
μν μ½λ
λ©μμ§
μ€λͺ
400
κΈ°λ³Έ μΊλ¦°λλ μμ ν μ μμ΅λλ€.
κΈ°λ³Έ μΊλ¦°λ μμ μλ
403
PERMISSION_DENIED
μμ κΆν μμ
404
userCalendar_NOT_FOUND
μΊλ¦°λλ₯Ό μ°Ύμ μ μμ
νλ
νμ
νμ
κΈ°λ³Έκ°
μ€λͺ
_id
ObjectId
μλ
-
κ³ μ ID
title
string
O
-
μΌμ μ λͺ©
description
string
X
""
μΌμ μ€λͺ
start
Date
O
-
μμ μΌμ
end
Date
O
-
μ’
λ£ μΌμ
isAllDay
boolean
X
false
μ’
μΌ μΌμ μ¬λΆ
scope
string
O
-
"school" | "personal"
school
ObjectId
X
-
νκ΅ ID
user
ObjectId
O
-
μμ±μ ID
recurrence.type
string
X
"none"
"none" | "daily" | "weekly" | "monthly"
recurrence.endDate
Date
X
-
λ°λ³΅ μ’
λ£μΌ
recurrence.days
number[]
X
[]
λ°λ³΅ μμΌ (0-6)
color
string
X
"#4285f4"
μΌμ μμ
reminder.enabled
boolean
X
false
μλ¦Ό νμ±ν
reminder.minutesBefore
number
X
-
μλ¦Ό μκ° (λΆ)
reminder.useDefault
boolean
X
true
κΈ°λ³Έ μλ¦Ό μ¬μ©
sourceType
string
X
"manual"
"manual" | "enrollment" | "syllabus" | "memo"
sourceId
string
X
-
λκΈ°ν μΆμ² ID
syllabusId
ObjectId
X
-
μ°κ²°λ κ°μ κ³ν ID
calendarId
ObjectId
X
-
μμ μ¬μ©μ μΊλ¦°λ ID
createdAt
Date
μλ
-
μμ± μΌμ
updatedAt
Date
μλ
-
μμ μΌμ
μΈλ±μ€ :
μΈλ±μ€
νλ
school_1_scope_1
{ school: 1, scope: 1 }
user_1_scope_1
{ user: 1, scope: 1 }
user_1_sourceType_1_sourceId_1
{ user: 1, sourceType: 1, sourceId: 1 }
user_1_recurrence.type_1_start_1_end_1
{ user: 1, "recurrence.type": 1, start: 1, end: 1 }
school_1_recurrence.type_1_start_1_end_1
{ school: 1, "recurrence.type": 1, start: 1, end: 1 }
νλ
νμ
νμ
κΈ°λ³Έκ°
μ€λͺ
_id
ObjectId
μλ
-
κ³ μ ID
user
ObjectId
O
-
μμ μ ID
school
ObjectId
X
-
νκ΅ ID
name
string
O
-
μΊλ¦°λ μ΄λ¦
color
string
X
"#4285f4"
μΊλ¦°λ μμ
scope
string
X
"personal"
"school" | "personal"
isDefault
boolean
X
false
κΈ°λ³Έ μΊλ¦°λ μ¬λΆ (μμ λΆκ°)
createdAt
Date
μλ
-
μμ± μΌμ
updatedAt
Date
μλ
-
μμ μΌμ
μΈλ±μ€ :
μΈλ±μ€
νλ
user_1
{ user: 1 }
user_1_school_1
{ user: 1, school: 1 }
μκ°νμ© κ°μΈ λ©λͺ¨λ₯Ό Registration.memos λ°°μ΄μ μΆκ°Β·μμ Β·μμ ν©λλ€. λ³ΈμΈ λ±λ‘λ§ μμ ν μ μμ΅λλ€.
νλ
νμ
νμ
μ€λͺ
registration
string
O
λ±λ‘ ObjectId
title
string
X
μ λͺ©
day
number/string
X
μμΌ
start
string
X
μμ μκ°
end
string
X
μ’
λ£ μκ°
classroom
string
X
κ°μμ€
memo
string
X
λ©λͺ¨ λ³Έλ¬Έ
{ "memos" : [ { "_id" : " β¦" , "title" : " μμ¨νμ΅" , "day" : 1 , "start" : " 14:00" , "end" : " 15:00" , "memo" : " " } ] }
PUT /api/memos/:_id // bodyμ registration + νλ
DELETE /api/memos/:_id?registration=
λ±λ‘μ΄ μκ±°λ λ³ΈμΈ κ²μ΄ μλλ©΄ 401/404μ
λλ€.
νλ‘ νΈμλ API ν¨μ (useAPIv2)
ν¨μλͺ
λ©μλ
κ²½λ‘
μ€λͺ
CCalendarEvent
POST
/api/calendar-events
μΌμ μμ±
RCalendarEvents
GET
/api/calendar-events
μΌμ λͺ©λ‘ μ‘°ν
UCalendarEvent
PUT
/api/calendar-events/:_id
μΌμ μμ
DCalendarEvent
DELETE
/api/calendar-events/:_id
μΌμ μμ
SyncCalendarEvents
POST
/api/calendar-events/sync
μμ
μΌμ λκΈ°ν
ν¨μλͺ
λ©μλ
κ²½λ‘
μ€λͺ
CUserCalendar
POST
/api/user-calendars
μ¬μ©μ μΊλ¦°λ μμ±
RUserCalendars
GET
/api/user-calendars
μ¬μ©μ μΊλ¦°λ λͺ©λ‘ μ‘°ν
UUserCalendar
PUT
/api/user-calendars/:_id
μ¬μ©μ μΊλ¦°λ μμ
DUserCalendar
DELETE
/api/user-calendars/:_id
μ¬μ©μ μΊλ¦°λ μμ