ProductService
Source:lib/service/product.dart
fetchProductList
Retrieves all products from the database.addProduct
Creates a new product with image upload.name- Product namedescripcion- Product descriptionprecio- Product price (as string)stock- Initial stock quantitycategoria- Product categoryimagen- Image file to upload
lib/service/product.dart:21
updateProduct
Updates an existing product’s details.id- Product ID to updatename- New product name (optional)descripcion- New description (optional)precio- New price (optional)valoracionTotal- New rating (optional)stock- New stock quantity (optional)categoria- New category (optional)imagen- New image file (optional, deletes old image)
lib/service/product.dart:48
deleteProduct
Deletes a product and its associated image.id- Product ID to delete
lib/service/product.dart:90
RoleplayEventService
Source:lib/service/roleplay_event.dart
fetchEventList
Retrieves all events, optionally marking which ones a user is registered for.userId- If provided, marks events with user’s registration status
lib/service/roleplay_event.dart:5
addEvent
Creates a new roleplay event.name- Event namedescription- Event descriptionfechaInicio- Start date/time (ISO 8601)fechaFin- End date/time (ISO 8601)
lib/service/roleplay_event.dart:26
updateEvent
Updates an existing event’s details.lib/service/roleplay_event.dart:47
deleteEvent
Deletes an event and all associated registrations.lib/service/roleplay_event.dart:65
fetchRegisteredEventIds
Gets the IDs of events a user is registered for.lib/service/roleplay_event.dart:78
fetchRegisteredEventsForUser
Retrieves full event details for a user’s registrations, sorted by start date.lib/service/roleplay_event.dart:89
registerUserInEvent
Registers a user for an event.lib/service/roleplay_event.dart:103
cancelUserEventRegistration
Cancels a user’s event registration.lib/service/roleplay_event.dart:118
OrderService
Source:lib/service/order.dart
createUserOrder
Creates a new order from shopping cart items.userId- ID of the user placing the ordercartItems- List of products in the cartsubtotalAmount- Subtotal before shippingshippingAmount- Shipping costtotalAmount- Total order amountstatus- Order status (default: “completed”)paymentMethod- Payment method used (optional)deliveryMethod- Delivery method (optional)customerName- Customer name (optional)customerPhone- Customer phone (optional)notes- Order notes (optional)shippingAddress- Shipping address details (optional)
AppError if cart is empty
Source: lib/service/order.dart:10
fetchUserOrders
Retrieves all orders for a specific user, sorted by creation date (newest first).lib/service/order.dart:80
fetchAllOrders
Retrieves all orders in the system, sorted by creation date (newest first).lib/service/order.dart:101
updateOrderStatus
Updates an order’s status.lib/service/order.dart:118
UserReviewService
Source:lib/service/user_review.dart
fetchProductReviews
Retrieves all product reviews in the system.lib/service/user_review.dart:5
addProductReview
Creates a new product review.userId- ID of the user writing the reviewproductId- ID of the product being reviewedcomment- Review textrating- Star rating
lib/service/user_review.dart:11
fetchProductReviewsById
Retrieves reviews for a specific product, sorted by creation date (newest first).lib/service/user_review.dart:30
LoginService
Source:lib/service/login.dart
login
Authenticates a user with email and password.email- User’s email addresspassword- User’s password
AppError on authentication failure
Source: lib/service/login.dart:7
This method also binds the authentication session using
AuthSession.bind().RegisterService
Source:lib/service/register.dart
register
Registers a new user account.name- User’s display nameemail- User’s email addresspassword- User’s password
AppError on registration failure (e.g., email already exists)
Source: lib/service/register.dart:6
This method signs out automatically after creating the account to prevent unwanted auto-login.
UserService
Source:lib/service/user.dart
fetchUserList
Retrieves all users in the system.lib/service/user.dart:8
showUser
Retrieves a specific user by ID.AppError if user not found
Source: lib/service/user.dart:17
updateCurrentUserProfile
Updates the currently logged-in user’s profile.userId- Current user’s IDname- New display nameemail- New email address
AppError if validation fails or no active session
Source: lib/service/user.dart:23