Project

General

Profile

Actions

dev #2346

open

dev #2293: [Module] Sprint - 03

dev #2294: [BE]

dev #2298: [BE] Sprint 02 uncompleted tasks

[BE] Fix Pricing, Add Slug, Update Tools Route

Added by Ayat Rahman 12 months ago. Updated 12 months ago.

Status:
Complete
Priority:
High
Assignee:
Target version:
-
Start date:
04/23/2025
Due date:
% Done:

100%

Estimated time:
3:00 h
Spent time:

Description

Fixed Pricing Issue:

Updated createToolStepOne to handle pricingPlans as an array and insert into pricingPlans table.
File: src/api/tools/createToolStepOne.ts

Added Slug Field:

Added slug (varchar, 255, not null, unique) to aiTools.
Implemented generateUniqueSlug using slugify and added to createToolStepOne.
Files: src/db/schema.ts, src/api/tools/createToolStepOne.ts
Migration: Added slug column and populated existing records.

Updated Get All Tools Route:

Added slug to response and slug query parameter for filtering.
File: src/api/tools/getAllTools.ts
Endpoint: GET /api/tools?slug=

Acceptance Criteria

Pricing:

Step 1 form saves pricingPlans to pricingPlans table.
Verify: SELECT * FROM pricingPlans WHERE toolId = <newTool.id>.

Slug:

aiTools table has slug column, populated on tool creation.
Verify: SELECT slug FROM aiTools WHERE id = <newTool.id>.

Get All Tools:

Response includes slug for each tool.
?slug= returns single tool or empty result.
Verify: GET /api/tools and GET /api/tools?slug=imageai-creator.

Actions

Also available in: Atom PDF