53 lines
1.8 KiB
Dart
53 lines
1.8 KiB
Dart
// lib/core/config/api_config.dart
|
|
|
|
class ApiConfig {
|
|
// Private constructor to prevent instantiation
|
|
ApiConfig._();
|
|
|
|
// Base URL for the API
|
|
static const String baseUrl = 'https://fartak.liara.run';
|
|
|
|
// ========== Auth Endpoints ==========
|
|
/// Endpoint to send OTP code to the user.
|
|
/// Method: POST
|
|
/// Body: {'Phone': phoneNumber, 'Code': countryCode}
|
|
static const String sendOtp = '$baseUrl/login/sendcode';
|
|
|
|
/// Endpoint to verify the OTP code.
|
|
/// Method: POST
|
|
/// Body: {'Phone': phoneNumber, 'Code': countryCode, 'OTP': otp}
|
|
static const String verifyOtp = '$baseUrl/login/getcode';
|
|
|
|
/// Endpoint to check if the user has a registered shop.
|
|
/// Method: GET
|
|
/// Headers: {'Authorization': 'Bearer <token>'}
|
|
static const String checkShopStatus = '$baseUrl/shop/get';
|
|
|
|
// ========== Store Endpoints ==========
|
|
/// Endpoint to add a new store.
|
|
/// Method: POST
|
|
/// Body: FormData
|
|
/// Headers: {'Authorization': 'Bearer <token>'}
|
|
static const String addStore = '$baseUrl/shop/add';
|
|
|
|
// ========== Discount Endpoints ==========
|
|
/// Endpoint to add a new discount.
|
|
/// Method: POST
|
|
/// Body: FormData
|
|
/// Headers: {'Authorization': 'Bearer <token>'}
|
|
static const String addDiscount = '$baseUrl/discount/add';
|
|
static const String getDiscounts = '$baseUrl/discount/get';
|
|
static const String getActiveDiscounts = '$baseUrl/discount/get?status=1';
|
|
|
|
/// Endpoint to get a single discount by its ID.
|
|
/// Method: GET
|
|
/// Headers: {'Authorization': 'Bearer <token>'}
|
|
static String getDiscountById(String id) => '$baseUrl/discount/get/$id';
|
|
|
|
/// Endpoint to edit an existing discount.
|
|
/// Method: POST
|
|
/// Body: FormData
|
|
/// Headers: {'Authorization': 'Bearer <token>'}
|
|
static String editDiscount(String id) => '$baseUrl/discount/edit/$id';
|
|
static String deleteDiscount(String id) => '$baseUrl/discount/delete/$id';
|
|
} |