Open IkkiOcean opened 2 hours ago
Thank you for creating this issue! 🎉 We'll look into it as soon as possible. In the meantime, please make sure to provide all the necessary details and context. If you have any questions or additional information, feel free to add them here. Your contributions are highly appreciated! 😊
You can also check our CONTRIBUTING.md for guidelines on contributing to this project.
Description:
We need to implement a Return Product feature in the AgroShop platform to allow users to return rented products. This will involve creating a new schema to store information about returns and developing controllers to handle the logic behind returning products.
The following changes are required:
The product return functionality should integrate with the current rental system, and it should allow:
Acceptance Criteria:
Return Product Schema:
rentalProductId
: Reference to the rented product.userId
: Reference to the user who rented the product.returnDate
: Date when the product is returned.condition
: String to indicate the condition of the returned product (e.g., "good", "damaged").status
: Enum field to represent the status of the return (e.g., "pending", "returned", "approved", "rejected").createdAt
: Timestamp of when the return request was created.updatedAt
: Timestamp of when the return status was last updated.Return Product Controllers:
POST /api/returns
):PATCH /api/returns/:id
):GET /api/returns/:id
):Validation: