We need to implement CRUD (Create, Read, Update, Delete) operations for two new entities: Promotion and Statistics. These operations will allow us to manage promotions and statistics data efficiently within our application.
Tasks:
1.Create Promotion Entity:
Define the Promotion entity with the following fields:
PromotionID: Int, Primary Key, Auto Increment
PromotionDescription: String, Not Null
StartDate: DateTime, Not Null
EndDate: DateTime, Not Null
DiscountPercentage: Decimal(5, 2), Not Null
createdAt: DateTime, Default: now(), Not Null
updatedAt: DateTime, Not Null
Implement CRUD operations for the Promotion entity.
Create endpoints for creating, reading, updating, and deleting promotions.
2.Create Statistics Entity:
Define the Statistics entity with the following fields:
StatisticID: Int, Primary Key, Auto Increment
ReportType: String, Not Null
ReportDate: DateTime, Not Null
Data: String, Not Null
createdAt: DateTime, Default: now(), Not Null
updatedAt: DateTime, Not Null
Implement CRUD operations for the Statistics entity.
Create endpoints for creating, reading, updating, and deleting statistics.
3.Database Schema:
Update the database schema to include tables for Promotion and Statistics.
Ensure proper relationships and constraints are defined as specified.
Acceptance Criteria:
CRUD operations for both Promotion and Statistics should be fully functional.
Endpoints should handle typical operations and edge cases.
All tests should pass successfully.
Additional Information:
Make sure to follow the existing code conventions and practices.
Documentation should be updated to reflect the new entities and their usage.
Description:
We need to implement CRUD (Create, Read, Update, Delete) operations for two new entities: Promotion and Statistics. These operations will allow us to manage promotions and statistics data efficiently within our application.
Tasks:
1.Create Promotion Entity:
Define the Promotion entity with the following fields:
PromotionID: Int, Primary Key, Auto Increment
PromotionDescription: String, Not Null
StartDate: DateTime, Not Null
EndDate: DateTime, Not Null
DiscountPercentage: Decimal(5, 2), Not Null
createdAt: DateTime, Default: now(), Not Null
updatedAt: DateTime, Not Null
Implement CRUD operations for the Promotion entity.
Create endpoints for creating, reading, updating, and deleting promotions.
2.Create Statistics Entity:
Define the Statistics entity with the following fields:
StatisticID: Int, Primary Key, Auto Increment
ReportType: String, Not Null
ReportDate: DateTime, Not Null
Data: String, Not Null
createdAt: DateTime, Default: now(), Not Null
updatedAt: DateTime, Not Null
Implement CRUD operations for the Statistics entity.
Create endpoints for creating, reading, updating, and deleting statistics.
3.Database Schema:
Update the database schema to include tables for Promotion and Statistics. Ensure proper relationships and constraints are defined as specified.
Acceptance Criteria:
CRUD operations for both Promotion and Statistics should be fully functional. Endpoints should handle typical operations and edge cases. All tests should pass successfully. Additional Information:
Make sure to follow the existing code conventions and practices. Documentation should be updated to reflect the new entities and their usage.