Add isActive column to companies table and update service

This commit is contained in:
richardtekula
2025-11-25 10:01:04 +01:00
parent 043eeccb77
commit 9d5d42ee9f
7 changed files with 258 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import express from 'express';
import * as companyController from '../controllers/company.controller.js';
import { authenticate } from '../middlewares/auth/authMiddleware.js';
import { validateBody, validateParams } from '../middlewares/security/validateInput.js';
import { createCompanySchema, updateCompanySchema } from '../validators/crm.validators.js';
import { createCompanySchema, updateCompanySchema, createCompanyReminderSchema, updateCompanyReminderSchema } from '../validators/crm.validators.js';
import { z } from 'zod';
const router = express.Router();
@@ -85,4 +85,37 @@ router.delete(
companyController.deleteCompanyNote
);
// Company reminders
router.get(
'/:companyId/reminders',
validateParams(z.object({ companyId: z.string().uuid() })),
companyController.getCompanyReminders
);
router.post(
'/:companyId/reminders',
validateParams(z.object({ companyId: z.string().uuid() })),
validateBody(createCompanyReminderSchema),
companyController.createCompanyReminder
);
router.patch(
'/:companyId/reminders/:reminderId',
validateParams(z.object({
companyId: z.string().uuid(),
reminderId: z.string().uuid()
})),
validateBody(updateCompanyReminderSchema),
companyController.updateCompanyReminder
);
router.delete(
'/:companyId/reminders/:reminderId',
validateParams(z.object({
companyId: z.string().uuid(),
reminderId: z.string().uuid()
})),
companyController.deleteCompanyReminder
);
export default router;