curl -X GET https://api-verifier-2.onrender.com/api/test/full-test
{
"message": "Full model test successful",
"created": {
"user": "507f1f77bcf86cd799439011",
"category": "507f1f77bcf86cd799439012",
"product": "507f1f77bcf86cd799439013",
"promotion": "507f1f77bcf86cd799439014",
"file": "507f1f77bcf86cd799439015",
"blog": "507f1f77bcf86cd799439016",
"editHistory": "507f1f77bcf86cd799439017",
"cart": "507f1f77bcf86cd799439018",
"order": "507f1f77bcf86cd799439019",
"orderItem": "507f1f77bcf86cd79943901a",
"transaction": "507f1f77bcf86cd79943901b",
"subscription": "507f1f77bcf86cd79943901c",
"review": "507f1f77bcf86cd79943901d",
"notification": "507f1f77bcf86cd79943901e",
"supportTicket": "507f1f77bcf86cd79943901f"
}
}
{
"error": "Transaction failed: validation error message"
}
Testing
Full model test
Test all database models by creating dummy data in a transaction
GET
/
api
/
test
/
full-test
curl -X GET https://api-verifier-2.onrender.com/api/test/full-test
{
"message": "Full model test successful",
"created": {
"user": "507f1f77bcf86cd799439011",
"category": "507f1f77bcf86cd799439012",
"product": "507f1f77bcf86cd799439013",
"promotion": "507f1f77bcf86cd799439014",
"file": "507f1f77bcf86cd799439015",
"blog": "507f1f77bcf86cd799439016",
"editHistory": "507f1f77bcf86cd799439017",
"cart": "507f1f77bcf86cd799439018",
"order": "507f1f77bcf86cd799439019",
"orderItem": "507f1f77bcf86cd79943901a",
"transaction": "507f1f77bcf86cd79943901b",
"subscription": "507f1f77bcf86cd79943901c",
"review": "507f1f77bcf86cd79943901d",
"notification": "507f1f77bcf86cd79943901e",
"supportTicket": "507f1f77bcf86cd79943901f"
}
}
{
"error": "Transaction failed: validation error message"
}
This endpoint is for testing purposes only. It creates dummy data across all models using a database transaction.
Overview
This endpoint tests all Shop models by creating interconnected dummy data within a single MongoDB transaction. If any creation fails, the entire transaction is rolled back.Models tested
The endpoint creates test records for the following models:- User - Test user account
- Category - Product category
- Product - Shop product
- Promotion - Product promotion/discount
- File - Product file attachment
- BlogPost - Blog post content
- EditHistory - Blog edit tracking
- Cart - Shopping cart
- Order - Customer order
- OrderItem - Order line items
- Transaction - Payment transaction
- Subscription - User subscription
- Review - Product review
- Notification - User notification
- SupportTicket - Customer support ticket
Response
string
Success message confirming test completion
object
Object containing IDs of all created records
Show properties
Show properties
string
Created user ID
string
Created category ID
string
Created product ID
string
Created promotion ID
string
Created file ID
string
Created blog post ID
string
Created edit history ID
string
Created cart ID
string
Created order ID
string
Created order item ID
string
Created transaction ID
string
Created subscription ID
string
Created review ID
string
Created notification ID
string
Created support ticket ID
curl -X GET https://api-verifier-2.onrender.com/api/test/full-test
{
"message": "Full model test successful",
"created": {
"user": "507f1f77bcf86cd799439011",
"category": "507f1f77bcf86cd799439012",
"product": "507f1f77bcf86cd799439013",
"promotion": "507f1f77bcf86cd799439014",
"file": "507f1f77bcf86cd799439015",
"blog": "507f1f77bcf86cd799439016",
"editHistory": "507f1f77bcf86cd799439017",
"cart": "507f1f77bcf86cd799439018",
"order": "507f1f77bcf86cd799439019",
"orderItem": "507f1f77bcf86cd79943901a",
"transaction": "507f1f77bcf86cd79943901b",
"subscription": "507f1f77bcf86cd79943901c",
"review": "507f1f77bcf86cd79943901d",
"notification": "507f1f77bcf86cd79943901e",
"supportTicket": "507f1f77bcf86cd79943901f"
}
}
{
"error": "Transaction failed: validation error message"
}