current outlet
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
part of '../outlet.dart';
|
||||
|
||||
@freezed
|
||||
class Outlet with _$Outlet {
|
||||
const factory Outlet({
|
||||
required String id,
|
||||
required String organizationId,
|
||||
required String name,
|
||||
required String address,
|
||||
required String phoneNumber,
|
||||
required String businessType,
|
||||
required String currency,
|
||||
required double taxRate,
|
||||
required bool isActive,
|
||||
required String createdAt,
|
||||
required String updatedAt,
|
||||
}) = _Outlet;
|
||||
|
||||
factory Outlet.empty() => const Outlet(
|
||||
id: '',
|
||||
organizationId: '',
|
||||
name: '',
|
||||
address: '',
|
||||
phoneNumber: '',
|
||||
businessType: '',
|
||||
currency: '',
|
||||
taxRate: 0.0,
|
||||
isActive: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
part of '../outlet.dart';
|
||||
|
||||
@freezed
|
||||
sealed class OutletFailure with _$OutletFailure {
|
||||
const factory OutletFailure.serverError(ApiFailure failure) = _ServerError;
|
||||
const factory OutletFailure.unexpectedError() = _UnexpectedError;
|
||||
const factory OutletFailure.empty() = _Empty;
|
||||
const factory OutletFailure.dynamicErrorMessage(String erroMessage) =
|
||||
_DynamicErrorMessage;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../../common/api/api_failure.dart';
|
||||
|
||||
part 'outlet.freezed.dart';
|
||||
|
||||
part 'failures/outlet_failure.dart';
|
||||
part 'entities/outlet_entity.dart';
|
||||
part 'repositories/i_outlet_repository.dart';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
part of '../outlet.dart';
|
||||
|
||||
abstract class IOutletRepository {
|
||||
Future<Either<OutletFailure, List<Outlet>>> getOutlets({
|
||||
int page = 1,
|
||||
int limit = 10,
|
||||
});
|
||||
|
||||
Future<Either<OutletFailure, Outlet>> getOutletById(String id);
|
||||
}
|
||||
Reference in New Issue
Block a user