point record
This commit is contained in:
@@ -18,11 +18,11 @@ enum PointsStatus {
|
||||
String get displayName {
|
||||
switch (this) {
|
||||
case PointsStatus.pending:
|
||||
return 'Pending';
|
||||
return 'Chờ duyệt';
|
||||
case PointsStatus.approved:
|
||||
return 'Approved';
|
||||
return 'Đã duyệt';
|
||||
case PointsStatus.rejected:
|
||||
return 'Rejected';
|
||||
return 'Bị từ chối';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/// Repository Interface: Points Record
|
||||
///
|
||||
/// Defines contract for points record operations.
|
||||
library;
|
||||
|
||||
import 'package:worker/features/loyalty/domain/entities/points_record.dart';
|
||||
|
||||
/// Points Record Repository Interface
|
||||
abstract class PointsRecordRepository {
|
||||
/// Get all points records for current user
|
||||
Future<List<PointsRecord>> getPointsRecords();
|
||||
|
||||
/// Get single points record by ID
|
||||
Future<PointsRecord> getPointsRecordById(String recordId);
|
||||
|
||||
/// Submit new points record
|
||||
Future<PointsRecord> submitPointsRecord(PointsRecord record);
|
||||
}
|
||||
19
lib/features/loyalty/domain/usecases/get_points_records.dart
Normal file
19
lib/features/loyalty/domain/usecases/get_points_records.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
/// Use Case: Get Points Records
|
||||
///
|
||||
/// Retrieves all points records for the current user.
|
||||
library;
|
||||
|
||||
import 'package:worker/features/loyalty/domain/entities/points_record.dart';
|
||||
import 'package:worker/features/loyalty/domain/repositories/points_record_repository.dart';
|
||||
|
||||
/// Get Points Records Use Case
|
||||
class GetPointsRecords {
|
||||
const GetPointsRecords(this._repository);
|
||||
|
||||
final PointsRecordRepository _repository;
|
||||
|
||||
/// Execute use case
|
||||
Future<List<PointsRecord>> call() async {
|
||||
return await _repository.getPointsRecords();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user