pos changes
This commit is contained in:
@@ -17,9 +17,7 @@ import '../data/remote/simulated_order_transport.dart';
|
||||
import '../data/repositories/store_repository_impl.dart';
|
||||
import '../data/repositories/sync_repository_impl.dart';
|
||||
import '../data/repositories/transaction_repository_impl.dart';
|
||||
import '../data/local/session_store.dart';
|
||||
import '../data/local/terminal_identity.dart';
|
||||
import '../data/remote/pos_auth_api.dart';
|
||||
import '../data/sync/sync_engine.dart';
|
||||
import '../domain/repositories/customer_repository.dart';
|
||||
import '../domain/repositories/product_repository.dart';
|
||||
@@ -163,28 +161,10 @@ final storeRepositoryProvider = Provider<StoreRepositoryImpl>(
|
||||
(ref) => StoreRepositoryImpl(ref.watch(localStoreProvider)),
|
||||
);
|
||||
|
||||
/// Signs a terminal in against the back office.
|
||||
///
|
||||
/// Points at the same base URL the uplinks use, so re-pointing a terminal in
|
||||
/// Settings moves its sign-in with it rather than leaving it authenticating
|
||||
/// against the endpoint it used to belong to.
|
||||
final posAuthApiProvider = Provider<PosAuthApi>((ref) {
|
||||
final api = PosAuthApi(baseUrl: ref.watch(syncConfigProvider).httpBaseUrl);
|
||||
ref.onDispose(api.dispose);
|
||||
return api;
|
||||
});
|
||||
|
||||
/// Where the signed session survives a restart.
|
||||
final sessionStoreProvider = Provider<SessionStore>((ref) => SessionStore());
|
||||
|
||||
/// The outlet, refreshed whenever staff or details change.
|
||||
///
|
||||
/// The email is the signed-in account's, not a constant. It used to be
|
||||
/// `DemoCredentials.email` — the same address on every install of a build,
|
||||
/// which is what made the store login decorative.
|
||||
final storeAccountProvider = FutureProvider<StoreAccount>(
|
||||
(ref) => ref.watch(storeRepositoryProvider).load(
|
||||
email: ref.watch(authControllerProvider.notifier).session?.email ?? '',
|
||||
email: DemoCredentials.email,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user