update address
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/// Address Repository Interface
|
||||
///
|
||||
/// Defines contract for address data operations.
|
||||
library;
|
||||
|
||||
import 'package:worker/features/account/domain/entities/address.dart';
|
||||
|
||||
/// Address Repository
|
||||
///
|
||||
/// Repository interface for managing user addresses.
|
||||
/// Online-only approach - all operations go directly to API.
|
||||
abstract class AddressRepository {
|
||||
/// Get list of addresses
|
||||
///
|
||||
/// Fetches all addresses for the authenticated user.
|
||||
/// Optionally filter by default address status.
|
||||
Future<List<Address>> getAddresses({bool? isDefault});
|
||||
|
||||
/// Create new address
|
||||
///
|
||||
/// Creates a new address and returns the created address with ID.
|
||||
Future<Address> createAddress(Address address);
|
||||
|
||||
/// Update existing address
|
||||
///
|
||||
/// Updates an existing address identified by its name (ID).
|
||||
Future<Address> updateAddress(Address address);
|
||||
|
||||
/// Delete address
|
||||
///
|
||||
/// Deletes an address by its name (ID).
|
||||
Future<void> deleteAddress(String name);
|
||||
|
||||
/// Set address as default
|
||||
///
|
||||
/// Marks the specified address as default and unmarks others.
|
||||
Future<void> setDefaultAddress(String name);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/// Location Repository Interface
|
||||
///
|
||||
/// Contract for location (city/ward) data operations.
|
||||
library;
|
||||
|
||||
import 'package:worker/features/account/domain/entities/city.dart';
|
||||
import 'package:worker/features/account/domain/entities/ward.dart';
|
||||
|
||||
/// Location Repository
|
||||
///
|
||||
/// Defines methods for accessing city and ward data.
|
||||
abstract class LocationRepository {
|
||||
/// Get all cities (offline-first: cache → API)
|
||||
Future<List<City>> getCities({bool forceRefresh = false});
|
||||
|
||||
/// Get wards for a specific city code
|
||||
Future<List<Ward>> getWards(String cityCode, {bool forceRefresh = false});
|
||||
|
||||
/// Clear all cached location data
|
||||
Future<void> clearCache();
|
||||
}
|
||||
Reference in New Issue
Block a user