From ac1eaabb5d35a16573c424860ed431e772488498 Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Mon, 27 Oct 2025 10:20:56 -0400 Subject: [PATCH] fix(schema): remove commented lines --- docs/swagger/swagger-spec.json | 302 --------------------------------- prisma/schema.prisma | 20 +-- 2 files changed, 10 insertions(+), 312 deletions(-) diff --git a/docs/swagger/swagger-spec.json b/docs/swagger/swagger-spec.json index 85ce3df..5369ee3 100644 --- a/docs/swagger/swagger-spec.json +++ b/docs/swagger/swagger-spec.json @@ -99,200 +99,6 @@ ] } }, - "/oauth-sessions": { - "post": { - "operationId": "OauthSessionsController_create", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOauthSessionDto" - } - } - } - }, - "responses": { - "201": { - "description": "OAuth session created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOauthSessionDto" - } - } - } - }, - "400": { - "description": "Incomplete task or invalid data" - } - }, - "security": [ - { - "sessions": [] - } - ], - "summary": "Create OAuth session", - "tags": [ - "OAuth Sessions" - ] - }, - "get": { - "operationId": "OauthSessionsController_findAll", - "parameters": [], - "responses": { - "201": { - "description": "List of OAuth session found", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CreateOauthSessionDto" - } - } - } - } - }, - "400": { - "description": "List of OAuth session not found" - } - }, - "security": [ - { - "sessions": [] - } - ], - "summary": "Find all OAuth session", - "tags": [ - "OAuth Sessions" - ] - } - }, - "/oauth-sessions/{id}": { - "get": { - "operationId": "OauthSessionsController_findOne", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "201": { - "description": "OAuth session found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOauthSessionDto" - } - } - } - }, - "400": { - "description": "OAuth session not found" - } - }, - "security": [ - { - "sessions": [] - } - ], - "summary": "Find OAuth session", - "tags": [ - "OAuth Sessions" - ] - }, - "patch": { - "operationId": "OauthSessionsController_update", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateOauthSessionDto" - } - } - } - }, - "responses": { - "201": { - "description": "OAuth session updated", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOauthSessionDto" - } - } - } - }, - "400": { - "description": "OAuth session not found" - } - }, - "security": [ - { - "sessions": [] - } - ], - "summary": "Update OAuth session", - "tags": [ - "OAuth Sessions" - ] - }, - "delete": { - "operationId": "OauthSessionsController_remove", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "201": { - "description": "OAuth session deleted", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOauthSessionDto" - } - } - } - }, - "400": { - "description": "OAuth session not found" - } - }, - "security": [ - { - "sessions": [] - } - ], - "summary": "Delete OAuth session", - "tags": [ - "OAuth Sessions" - ] - } - }, "/pay-periods/current-and-all": { "get": { "operationId": "PayPeriodsController_getCurrentAndAll", @@ -887,114 +693,6 @@ } }, "schemas": { - "CreateOauthSessionDto": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "cklwi0vb70000z2z20q6f19qk", - "description": "Unique ID of an OAuth token (auto-generated)" - }, - "user_id": { - "type": "string", - "example": "S7A2U8R7O6N6", - "description": "User`s unique identification number" - }, - "application": { - "type": "string", - "example": "app.targo.ca", - "description": "URL in which the access token is used for" - }, - "access_token": { - "type": "string", - "example": "L5O6R4D3/O6F3#T8H4E3&R6I4N6G4S7 ...", - "description": "Access token" - }, - "refresh_token": { - "type": "string", - "example": "Th3731102h1p07Th3R1n92", - "description": "Refresh token" - }, - "access_token_expiry": { - "format": "date-time", - "type": "string", - "example": "25/12/3018", - "description": "Access token`s expiry date" - }, - "refresh_token_expiry": { - "format": "date-time", - "type": "string", - "example": "26/02/3019", - "description": "Refresh token`s expiry date" - }, - "scopes": { - "example": "access tolkiens, email, etc... ", - "description": "scopes of infos linked to the access token", - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "id", - "user_id", - "application", - "access_token", - "refresh_token", - "access_token_expiry" - ] - }, - "UpdateOauthSessionDto": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "cklwi0vb70000z2z20q6f19qk", - "description": "Unique ID of an OAuth token (auto-generated)" - }, - "user_id": { - "type": "string", - "example": "S7A2U8R7O6N6", - "description": "User`s unique identification number" - }, - "application": { - "type": "string", - "example": "app.targo.ca", - "description": "URL in which the access token is used for" - }, - "access_token": { - "type": "string", - "example": "L5O6R4D3/O6F3#T8H4E3&R6I4N6G4S7 ...", - "description": "Access token" - }, - "refresh_token": { - "type": "string", - "example": "Th3731102h1p07Th3R1n92", - "description": "Refresh token" - }, - "access_token_expiry": { - "format": "date-time", - "type": "string", - "example": "25/12/3018", - "description": "Access token`s expiry date" - }, - "refresh_token_expiry": { - "format": "date-time", - "type": "string", - "example": "26/02/3019", - "description": "Refresh token`s expiry date" - }, - "scopes": { - "example": "access tolkiens, email, etc... ", - "description": "scopes of infos linked to the access token", - "type": "array", - "items": { - "type": "string" - } - } - } - }, "PayPeriodDto": { "type": "object", "properties": { diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f00155e..60503eb 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -24,8 +24,8 @@ model Users { role Roles @default(GUEST) employee Employees? @relation("UserEmployee") - // oauth_sessions OAuthSessions[] @relation("UserOAuthSessions") - // preferences Preferences? @relation("UserPreferences") + oauth_sessions OAuthSessions[] @relation("UserOAuthSessions") + preferences Preferences? @relation("UserPreferences") @@map("users") } @@ -46,16 +46,16 @@ model Employees { crew Employees[] @relation("EmployeeSupervisor") - // timesheet Timesheets[] @relation("TimesheetEmployee") - // leave_request LeaveRequests[] @relation("LeaveRequestEmployee") - // schedule_presets SchedulePresets[] @relation("SchedulePreset") + timesheet Timesheets[] @relation("TimesheetEmployee") + leave_request LeaveRequests[] @relation("LeaveRequestEmployee") + schedule_presets SchedulePresets[] @relation("SchedulePreset") @@map("employees") } model LeaveRequests { id Int @id @default(autoincrement()) - // employee Employees @relation("LeaveRequestEmployee", fields: [employee_id], references: [id]) + employee Employees @relation("LeaveRequestEmployee", fields: [employee_id], references: [id]) employee_id Int bank_code BankCodes @relation("LeaveRequestBankCodes", fields: [bank_code_id], references: [id]) bank_code_id Int @@ -107,7 +107,7 @@ view PayPeriods { model Timesheets { id Int @id @default(autoincrement()) - // employee Employees @relation("TimesheetEmployee", fields: [employee_id], references: [id]) + employee Employees @relation("TimesheetEmployee", fields: [employee_id], references: [id]) employee_id Int start_date DateTime @db.Date @@ -135,7 +135,7 @@ model TimesheetsArchive { model SchedulePresets { id Int @id @default(autoincrement()) - // employee Employees @relation("SchedulePreset", fields: [employee_id], references: [id]) + employee Employees @relation("SchedulePreset", fields: [employee_id], references: [id]) employee_id Int name String @@ -258,7 +258,7 @@ model ExpensesArchive { model OAuthSessions { id String @id @default(cuid()) - // user Users @relation("UserOAuthSessions", fields: [user_id], references: [id]) + user Users @relation("UserOAuthSessions", fields: [user_id], references: [id]) user_id String @db.Uuid application String access_token String @unique @@ -327,7 +327,7 @@ model AttachmentVariants { model Preferences { id Int @id @default(autoincrement()) - // user Users @relation("UserPreferences", fields: [user_id], references: [id]) + user Users @relation("UserPreferences", fields: [user_id], references: [id]) user_id String @unique @db.Uuid notifications Int @default(0)