started backend conversion to typescript
This commit is contained in:
36
api/src/services/calendarService.ts
Normal file
36
api/src/services/calendarService.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
// const pool = require('../db');
|
||||
import pool from '../db';
|
||||
|
||||
export interface CalendarEvent {
|
||||
id: number;
|
||||
name: string;
|
||||
start: Date; // DATETIME → Date
|
||||
end: Date; // DATETIME → Date
|
||||
location: string;
|
||||
color: string; // CHAR(7) like "#3b82f6"
|
||||
description?: string | null;
|
||||
creator?: number | null; // foreign key to members.id, nullable
|
||||
cancelled: boolean; // TINYINT(1) → boolean
|
||||
created_at: Date; // TIMESTAMP → Date
|
||||
updated_at: Date; // TIMESTAMP → Date
|
||||
}
|
||||
|
||||
export async function createEvent(eventObject) {
|
||||
|
||||
}
|
||||
|
||||
export async function updateEvent(eventObject) {
|
||||
|
||||
}
|
||||
|
||||
export async function cancelEvent(eventID) {
|
||||
|
||||
}
|
||||
|
||||
export async function getShortEventsInRange(startDate, endDate) {
|
||||
|
||||
}
|
||||
|
||||
export async function getEventDetailed(eventID) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user