refactor: Repository 패턴 적용 및 Clean Architecture 완성
## 주요 변경사항 ### 🏗️ Architecture - Repository 패턴 전면 도입 (인터페이스/구현체 분리) - Domain Layer에 Repository 인터페이스 정의 - Data Layer에 Repository 구현체 배치 - UseCase 의존성을 Service에서 Repository로 전환 ### 📦 Dependency Injection - GetIt 기반 DI Container 재구성 (lib/injection_container.dart) - Repository 인터페이스와 구현체 등록 - Service와 Repository 공존 (마이그레이션 기간) ### 🔄 Migration Status 완료: - License 모듈 (6개 UseCase) - Warehouse Location 모듈 (5개 UseCase) 진행중: - Auth 모듈 (2/5 UseCase) - Company 모듈 (1/6 UseCase) 대기: - User 모듈 (7개 UseCase) - Equipment 모듈 (4개 UseCase) ### 🎯 Controller 통합 - 중복 Controller 제거 (with_usecase 버전) - 단일 Controller로 통합 - UseCase 패턴 직접 적용 ### 🧹 코드 정리 - 임시 파일 제거 (test_*.md, task.md) - Node.js 아티팩트 제거 (package.json) - 불필요한 테스트 파일 정리 ### ✅ 테스트 개선 - Real API 중심 테스트 구조 - Mock 제거, 실제 API 엔드포인트 사용 - 통합 테스트 프레임워크 강화 ## 기술적 영향 - 의존성 역전 원칙 적용 - 레이어 간 결합도 감소 - 테스트 용이성 향상 - 확장성 및 유지보수성 개선 ## 다음 단계 1. User/Equipment 모듈 Repository 마이그레이션 2. Service Layer 점진적 제거 3. 캐싱 전략 구현 4. 성능 최적화
This commit is contained in:
@@ -2,8 +2,8 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:superport/data/models/license/license_dto.dart';
|
||||
import 'package:superport/data/repositories/license_repository.dart';
|
||||
import 'package:superport/models/license_model.dart';
|
||||
import 'package:superport/domain/repositories/license_repository.dart';
|
||||
import 'package:superport/domain/usecases/base_usecase.dart';
|
||||
import 'package:superport/domain/usecases/license/create_license_usecase.dart';
|
||||
import 'package:superport/core/errors/failures.dart';
|
||||
@@ -22,16 +22,20 @@ void main() {
|
||||
|
||||
group('CreateLicenseUseCase', () {
|
||||
final validParams = CreateLicenseParams(
|
||||
equipmentId: 1,
|
||||
companyId: 1,
|
||||
licenseKey: 'TEST-KEY-001',
|
||||
productName: 'Test Product',
|
||||
vendor: 'Test Vendor',
|
||||
licenseType: 'maintenance',
|
||||
startDate: DateTime(2025, 1, 1),
|
||||
userCount: 10,
|
||||
purchaseDate: DateTime(2025, 1, 1),
|
||||
expiryDate: DateTime(2025, 12, 31),
|
||||
description: 'Test license',
|
||||
cost: 1000.0,
|
||||
purchasePrice: 1000.0,
|
||||
companyId: 1,
|
||||
branchId: 1,
|
||||
remark: 'Test license',
|
||||
);
|
||||
|
||||
final mockLicense = LicenseDto(
|
||||
final mockLicense = License(
|
||||
id: 1,
|
||||
licenseKey: 'TEST-LICENSE-KEY',
|
||||
productName: 'Test Product',
|
||||
@@ -53,7 +57,7 @@ void main() {
|
||||
test('라이선스 생성 성공', () async {
|
||||
// arrange
|
||||
when(mockRepository.createLicense(any))
|
||||
.thenAnswer((_) async => mockLicense);
|
||||
.thenAnswer((_) async => Right(mockLicense));
|
||||
|
||||
// act
|
||||
final result = await useCase(validParams);
|
||||
@@ -62,21 +66,21 @@ void main() {
|
||||
expect(result.isRight(), true);
|
||||
result.fold(
|
||||
(failure) => fail('Should not return failure'),
|
||||
(license) => expect(license, equals(mockLicense)),
|
||||
(license) => expect(license.id, equals(mockLicense.id)),
|
||||
);
|
||||
verify(mockRepository.createLicense(validParams.toMap())).called(1);
|
||||
verify(mockRepository.createLicense(any)).called(1);
|
||||
});
|
||||
|
||||
test('만료일이 시작일보다 이전인 경우 검증 실패', () async {
|
||||
test('만료일이 구매일보다 이전인 경우 검증 실패', () async {
|
||||
// arrange
|
||||
final invalidParams = CreateLicenseParams(
|
||||
equipmentId: 1,
|
||||
licenseKey: 'TEST-KEY-002',
|
||||
productName: 'Test Product',
|
||||
companyId: 1,
|
||||
licenseType: 'maintenance',
|
||||
startDate: DateTime(2025, 12, 31),
|
||||
expiryDate: DateTime(2025, 1, 1), // 시작일보다 이전
|
||||
description: 'Test license',
|
||||
cost: 1000.0,
|
||||
purchaseDate: DateTime(2025, 12, 31),
|
||||
expiryDate: DateTime(2025, 1, 1), // 구매일보다 이전
|
||||
remark: 'Test license',
|
||||
);
|
||||
|
||||
// act
|
||||
@@ -87,7 +91,7 @@ void main() {
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<ValidationFailure>());
|
||||
expect(failure.message, contains('만료일은 시작일 이후여야 합니다'));
|
||||
expect(failure.message, contains('만료일은 구매일 이후여야 합니다'));
|
||||
},
|
||||
(license) => fail('Should not return license'),
|
||||
);
|
||||
@@ -97,13 +101,13 @@ void main() {
|
||||
test('라이선스 기간이 30일 미만인 경우 검증 실패', () async {
|
||||
// arrange
|
||||
final invalidParams = CreateLicenseParams(
|
||||
equipmentId: 1,
|
||||
licenseKey: 'TEST-KEY-003',
|
||||
productName: 'Test Product',
|
||||
companyId: 1,
|
||||
licenseType: 'maintenance',
|
||||
startDate: DateTime(2025, 1, 1),
|
||||
purchaseDate: DateTime(2025, 1, 1),
|
||||
expiryDate: DateTime(2025, 1, 15), // 15일 기간
|
||||
description: 'Test license',
|
||||
cost: 1000.0,
|
||||
remark: 'Test license',
|
||||
);
|
||||
|
||||
// act
|
||||
@@ -124,7 +128,7 @@ void main() {
|
||||
test('Repository에서 예외 발생 시 ServerFailure 반환', () async {
|
||||
// arrange
|
||||
when(mockRepository.createLicense(any))
|
||||
.thenThrow(Exception('Server error'));
|
||||
.thenAnswer((_) async => Left(ServerFailure(message: 'Server error')));
|
||||
|
||||
// act
|
||||
final result = await useCase(validParams);
|
||||
@@ -138,58 +142,34 @@ void main() {
|
||||
},
|
||||
(license) => fail('Should not return license'),
|
||||
);
|
||||
verify(mockRepository.createLicense(validParams.toMap())).called(1);
|
||||
});
|
||||
|
||||
test('파라미터를 올바른 Map으로 변환', () {
|
||||
// arrange
|
||||
final params = CreateLicenseParams(
|
||||
equipmentId: 1,
|
||||
companyId: 2,
|
||||
licenseType: 'maintenance',
|
||||
startDate: DateTime(2025, 1, 1),
|
||||
expiryDate: DateTime(2025, 12, 31),
|
||||
description: 'Test description',
|
||||
cost: 5000.0,
|
||||
);
|
||||
|
||||
// act
|
||||
final map = params.toMap();
|
||||
|
||||
// assert
|
||||
expect(map['equipment_id'], equals(1));
|
||||
expect(map['company_id'], equals(2));
|
||||
expect(map['license_type'], equals('maintenance'));
|
||||
expect(map['start_date'], equals(DateTime(2025, 1, 1).toIso8601String()));
|
||||
expect(map['expiry_date'], equals(DateTime(2025, 12, 31).toIso8601String()));
|
||||
expect(map['description'], equals('Test description'));
|
||||
expect(map['cost'], equals(5000.0));
|
||||
verify(mockRepository.createLicense(any)).called(1);
|
||||
});
|
||||
|
||||
test('옵셔널 파라미터가 null인 경우에도 정상 처리', () async {
|
||||
// arrange
|
||||
final paramsWithNulls = CreateLicenseParams(
|
||||
equipmentId: 1,
|
||||
licenseKey: 'TEST-KEY-004',
|
||||
productName: 'Test Product',
|
||||
companyId: 1,
|
||||
licenseType: 'maintenance',
|
||||
startDate: DateTime(2025, 1, 1),
|
||||
purchaseDate: DateTime(2025, 1, 1),
|
||||
expiryDate: DateTime(2025, 12, 31),
|
||||
description: null,
|
||||
cost: null,
|
||||
vendor: null,
|
||||
licenseType: null,
|
||||
userCount: null,
|
||||
purchasePrice: null,
|
||||
branchId: null,
|
||||
remark: null,
|
||||
);
|
||||
|
||||
when(mockRepository.createLicense(any))
|
||||
.thenAnswer((_) async => mockLicense);
|
||||
.thenAnswer((_) async => Right(mockLicense));
|
||||
|
||||
// act
|
||||
final result = await useCase(paramsWithNulls);
|
||||
|
||||
// assert
|
||||
expect(result.isRight(), true);
|
||||
|
||||
final map = paramsWithNulls.toMap();
|
||||
expect(map['description'], isNull);
|
||||
expect(map['cost'], isNull);
|
||||
verify(mockRepository.createLicense(any)).called(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -5,9 +5,14 @@
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i4;
|
||||
|
||||
import 'package:dartz/dartz.dart' as _i2;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:superport/data/models/license/license_dto.dart' as _i2;
|
||||
import 'package:superport/data/repositories/license_repository.dart' as _i3;
|
||||
import 'package:superport/core/errors/failures.dart' as _i5;
|
||||
import 'package:superport/data/models/common/paginated_response.dart' as _i6;
|
||||
import 'package:superport/data/models/dashboard/license_expiry_summary.dart'
|
||||
as _i8;
|
||||
import 'package:superport/domain/repositories/license_repository.dart' as _i3;
|
||||
import 'package:superport/models/license_model.dart' as _i7;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
@@ -23,19 +28,8 @@ import 'package:superport/data/repositories/license_repository.dart' as _i3;
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeLicenseListResponseDto_0 extends _i1.SmartFake
|
||||
implements _i2.LicenseListResponseDto {
|
||||
_FakeLicenseListResponseDto_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeLicenseDto_1 extends _i1.SmartFake implements _i2.LicenseDto {
|
||||
_FakeLicenseDto_1(
|
||||
class _FakeEither_0<L, R> extends _i1.SmartFake implements _i2.Either<L, R> {
|
||||
_FakeEither_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -53,11 +47,16 @@ class MockLicenseRepository extends _i1.Mock implements _i3.LicenseRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.LicenseListResponseDto> getLicenses({
|
||||
int? page = 1,
|
||||
int? perPage = 20,
|
||||
_i4.Future<
|
||||
_i2.Either<_i5.Failure, _i6.PaginatedResponse<_i7.License>>> getLicenses({
|
||||
int? page,
|
||||
int? limit,
|
||||
String? search,
|
||||
Map<String, dynamic>? filters,
|
||||
int? companyId,
|
||||
String? equipmentType,
|
||||
String? expiryStatus,
|
||||
String? sortBy,
|
||||
String? sortOrder,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@@ -65,90 +64,305 @@ class MockLicenseRepository extends _i1.Mock implements _i3.LicenseRepository {
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#perPage: perPage,
|
||||
#limit: limit,
|
||||
#search: search,
|
||||
#filters: filters,
|
||||
#companyId: companyId,
|
||||
#equipmentType: equipmentType,
|
||||
#expiryStatus: expiryStatus,
|
||||
#sortBy: sortBy,
|
||||
#sortOrder: sortOrder,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<_i2.LicenseListResponseDto>.value(
|
||||
_FakeLicenseListResponseDto_0(
|
||||
returnValue: _i4.Future<
|
||||
_i2
|
||||
.Either<_i5.Failure, _i6.PaginatedResponse<_i7.License>>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i6.PaginatedResponse<_i7.License>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getLicenses,
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#perPage: perPage,
|
||||
#limit: limit,
|
||||
#search: search,
|
||||
#filters: filters,
|
||||
#companyId: companyId,
|
||||
#equipmentType: equipmentType,
|
||||
#expiryStatus: expiryStatus,
|
||||
#sortBy: sortBy,
|
||||
#sortOrder: sortOrder,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.LicenseListResponseDto>);
|
||||
) as _i4
|
||||
.Future<_i2.Either<_i5.Failure, _i6.PaginatedResponse<_i7.License>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.LicenseDto> getLicenseDetail(int? id) => (super.noSuchMethod(
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.License>> getLicenseById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getLicenseDetail,
|
||||
#getLicenseById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4.Future<_i2.LicenseDto>.value(_FakeLicenseDto_1(
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, _i7.License>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.License>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getLicenseDetail,
|
||||
#getLicenseById,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.LicenseDto>);
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.License>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.LicenseDto> createLicense(Map<String, dynamic>? data) =>
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.License>> createLicense(
|
||||
_i7.License? license) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#createLicense,
|
||||
[data],
|
||||
[license],
|
||||
),
|
||||
returnValue: _i4.Future<_i2.LicenseDto>.value(_FakeLicenseDto_1(
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, _i7.License>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.License>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#createLicense,
|
||||
[data],
|
||||
[license],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.LicenseDto>);
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.License>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.LicenseDto> updateLicense(
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.License>> updateLicense(
|
||||
int? id,
|
||||
Map<String, dynamic>? data,
|
||||
_i7.License? license,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateLicense,
|
||||
[
|
||||
id,
|
||||
data,
|
||||
license,
|
||||
],
|
||||
),
|
||||
returnValue: _i4.Future<_i2.LicenseDto>.value(_FakeLicenseDto_1(
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, _i7.License>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.License>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#updateLicense,
|
||||
[
|
||||
id,
|
||||
data,
|
||||
license,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.LicenseDto>);
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.License>>);
|
||||
|
||||
@override
|
||||
_i4.Future<void> deleteLicense(int? id) => (super.noSuchMethod(
|
||||
_i4.Future<_i2.Either<_i5.Failure, void>> deleteLicense(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteLicense,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, void>>.value(
|
||||
_FakeEither_0<_i5.Failure, void>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#deleteLicense,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, void>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>> getExpiringLicenses({
|
||||
int? days = 30,
|
||||
int? companyId,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getExpiringLicenses,
|
||||
[],
|
||||
{
|
||||
#days: days,
|
||||
#companyId: companyId,
|
||||
},
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>>.value(
|
||||
_FakeEither_0<_i5.Failure, List<_i7.License>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getExpiringLicenses,
|
||||
[],
|
||||
{
|
||||
#days: days,
|
||||
#companyId: companyId,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>> getExpiredLicenses(
|
||||
{int? companyId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getExpiredLicenses,
|
||||
[],
|
||||
{#companyId: companyId},
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>>.value(
|
||||
_FakeEither_0<_i5.Failure, List<_i7.License>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getExpiredLicenses,
|
||||
[],
|
||||
{#companyId: companyId},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i8.LicenseExpirySummary>>
|
||||
getLicenseExpirySummary() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getLicenseExpirySummary,
|
||||
[],
|
||||
),
|
||||
returnValue: _i4.Future<
|
||||
_i2.Either<_i5.Failure, _i8.LicenseExpirySummary>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i8.LicenseExpirySummary>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getLicenseExpirySummary,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i8.LicenseExpirySummary>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.License>> renewLicense(
|
||||
int? id,
|
||||
DateTime? newExpiryDate, {
|
||||
double? renewalCost,
|
||||
String? renewalNote,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#renewLicense,
|
||||
[
|
||||
id,
|
||||
newExpiryDate,
|
||||
],
|
||||
{
|
||||
#renewalCost: renewalCost,
|
||||
#renewalNote: renewalNote,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, _i7.License>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.License>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#renewLicense,
|
||||
[
|
||||
id,
|
||||
newExpiryDate,
|
||||
],
|
||||
{
|
||||
#renewalCost: renewalCost,
|
||||
#renewalNote: renewalNote,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.License>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>
|
||||
getLicenseStatsByCompany(int? companyId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getLicenseStatsByCompany,
|
||||
[companyId],
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>.value(
|
||||
_FakeEither_0<_i5.Failure, Map<String, int>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getLicenseStatsByCompany,
|
||||
[companyId],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>
|
||||
getLicenseCountByType() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getLicenseCountByType,
|
||||
[],
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>.value(
|
||||
_FakeEither_0<_i5.Failure, Map<String, int>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getLicenseCountByType,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, void>> setExpiryNotification(
|
||||
int? licenseId, {
|
||||
int? notifyDays = 30,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#setExpiryNotification,
|
||||
[licenseId],
|
||||
{#notifyDays: notifyDays},
|
||||
),
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, void>>.value(
|
||||
_FakeEither_0<_i5.Failure, void>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#setExpiryNotification,
|
||||
[licenseId],
|
||||
{#notifyDays: notifyDays},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, void>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>> searchLicenses(
|
||||
String? query, {
|
||||
int? companyId,
|
||||
int? limit,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchLicenses,
|
||||
[query],
|
||||
{
|
||||
#companyId: companyId,
|
||||
#limit: limit,
|
||||
},
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>>.value(
|
||||
_FakeEither_0<_i5.Failure, List<_i7.License>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#searchLicenses,
|
||||
[query],
|
||||
{
|
||||
#companyId: companyId,
|
||||
#limit: limit,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, List<_i7.License>>>);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:superport/data/models/warehouse/warehouse_dto.dart';
|
||||
import 'package:superport/data/repositories/warehouse_location_repository.dart';
|
||||
import 'package:superport/models/warehouse_location_model.dart';
|
||||
import 'package:superport/domain/repositories/warehouse_location_repository.dart';
|
||||
import 'package:superport/domain/usecases/base_usecase.dart';
|
||||
import 'package:superport/domain/usecases/warehouse_location/create_warehouse_location_usecase.dart';
|
||||
import 'package:superport/core/errors/failures.dart';
|
||||
@@ -32,20 +32,17 @@ void main() {
|
||||
longitude: 126.9780,
|
||||
);
|
||||
|
||||
final mockLocation = WarehouseLocationDto(
|
||||
final mockLocation = WarehouseLocation(
|
||||
id: 1,
|
||||
name: 'Main Warehouse',
|
||||
address: '123 Storage Street',
|
||||
managerName: 'John Doe',
|
||||
managerPhone: '010-1234-5678',
|
||||
isActive: true,
|
||||
createdAt: DateTime.now(),
|
||||
address: Address.fromFullAddress('123 Storage Street'),
|
||||
remark: 'Primary storage location',
|
||||
);
|
||||
|
||||
test('창고 위치 생성 성공', () async {
|
||||
// arrange
|
||||
when(mockRepository.createWarehouseLocation(any))
|
||||
.thenAnswer((_) async => mockLocation);
|
||||
.thenAnswer((_) async => Right(mockLocation));
|
||||
|
||||
// act
|
||||
final result = await useCase(validParams);
|
||||
@@ -54,9 +51,9 @@ void main() {
|
||||
expect(result.isRight(), true);
|
||||
result.fold(
|
||||
(failure) => fail('Should not return failure'),
|
||||
(location) => expect(location, equals(mockLocation)),
|
||||
(location) => expect(location.id, equals(mockLocation.id)),
|
||||
);
|
||||
verify(mockRepository.createWarehouseLocation(validParams.toMap())).called(1);
|
||||
verify(mockRepository.createWarehouseLocation(any)).called(1);
|
||||
});
|
||||
|
||||
test('창고 이름이 비어있는 경우 검증 실패', () async {
|
||||
@@ -137,7 +134,7 @@ void main() {
|
||||
];
|
||||
|
||||
when(mockRepository.createWarehouseLocation(any))
|
||||
.thenAnswer((_) async => mockLocation);
|
||||
.thenAnswer((_) async => Right(mockLocation));
|
||||
|
||||
// act & assert
|
||||
for (final phone in validPhoneNumbers) {
|
||||
@@ -155,7 +152,7 @@ void main() {
|
||||
test('Repository에서 예외 발생 시 ServerFailure 반환', () async {
|
||||
// arrange
|
||||
when(mockRepository.createWarehouseLocation(any))
|
||||
.thenThrow(Exception('Server error'));
|
||||
.thenAnswer((_) async => Left(ServerFailure(message: 'Server error')));
|
||||
|
||||
// act
|
||||
final result = await useCase(validParams);
|
||||
@@ -169,32 +166,7 @@ void main() {
|
||||
},
|
||||
(location) => fail('Should not return location'),
|
||||
);
|
||||
verify(mockRepository.createWarehouseLocation(validParams.toMap())).called(1);
|
||||
});
|
||||
|
||||
test('파라미터를 올바른 Map으로 변환', () {
|
||||
// arrange
|
||||
final params = CreateWarehouseLocationParams(
|
||||
name: 'Test Warehouse',
|
||||
address: '456 Test Avenue',
|
||||
description: 'Test description',
|
||||
contactNumber: '010-9876-5432',
|
||||
manager: 'Jane Smith',
|
||||
latitude: 35.1796,
|
||||
longitude: 129.0756,
|
||||
);
|
||||
|
||||
// act
|
||||
final map = params.toMap();
|
||||
|
||||
// assert
|
||||
expect(map['name'], equals('Test Warehouse'));
|
||||
expect(map['address'], equals('456 Test Avenue'));
|
||||
expect(map['description'], equals('Test description'));
|
||||
expect(map['contact_number'], equals('010-9876-5432'));
|
||||
expect(map['manager'], equals('Jane Smith'));
|
||||
expect(map['latitude'], equals(35.1796));
|
||||
expect(map['longitude'], equals(129.0756));
|
||||
verify(mockRepository.createWarehouseLocation(any)).called(1);
|
||||
});
|
||||
|
||||
test('옵셔널 파라미터가 null인 경우에도 정상 처리', () async {
|
||||
@@ -210,20 +182,14 @@ void main() {
|
||||
);
|
||||
|
||||
when(mockRepository.createWarehouseLocation(any))
|
||||
.thenAnswer((_) async => mockLocation);
|
||||
.thenAnswer((_) async => Right(mockLocation));
|
||||
|
||||
// act
|
||||
final result = await useCase(paramsWithNulls);
|
||||
|
||||
// assert
|
||||
expect(result.isRight(), true);
|
||||
|
||||
final map = paramsWithNulls.toMap();
|
||||
expect(map['description'], isNull);
|
||||
expect(map['contact_number'], isNull);
|
||||
expect(map['manager'], isNull);
|
||||
expect(map['latitude'], isNull);
|
||||
expect(map['longitude'], isNull);
|
||||
verify(mockRepository.createWarehouseLocation(any)).called(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -5,10 +5,13 @@
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i4;
|
||||
|
||||
import 'package:dartz/dartz.dart' as _i2;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:superport/data/models/warehouse/warehouse_dto.dart' as _i2;
|
||||
import 'package:superport/data/repositories/warehouse_location_repository.dart'
|
||||
import 'package:superport/core/errors/failures.dart' as _i5;
|
||||
import 'package:superport/data/models/common/paginated_response.dart' as _i6;
|
||||
import 'package:superport/domain/repositories/warehouse_location_repository.dart'
|
||||
as _i3;
|
||||
import 'package:superport/models/warehouse_location_model.dart' as _i7;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
@@ -24,20 +27,8 @@ import 'package:superport/data/repositories/warehouse_location_repository.dart'
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeWarehouseLocationListDto_0 extends _i1.SmartFake
|
||||
implements _i2.WarehouseLocationListDto {
|
||||
_FakeWarehouseLocationListDto_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeWarehouseLocationDto_1 extends _i1.SmartFake
|
||||
implements _i2.WarehouseLocationDto {
|
||||
_FakeWarehouseLocationDto_1(
|
||||
class _FakeEither_0<L, R> extends _i1.SmartFake implements _i2.Either<L, R> {
|
||||
_FakeEither_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
@@ -56,116 +47,356 @@ class MockWarehouseLocationRepository extends _i1.Mock
|
||||
}
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.WarehouseLocationListDto> getWarehouseLocations({
|
||||
int? page = 1,
|
||||
int? perPage = 20,
|
||||
_i4.Future<
|
||||
_i2.Either<_i5.Failure, _i6.PaginatedResponse<_i7.WarehouseLocation>>>
|
||||
getWarehouseLocations({
|
||||
int? page,
|
||||
int? limit,
|
||||
String? search,
|
||||
Map<String, dynamic>? filters,
|
||||
String? locationType,
|
||||
bool? isActive,
|
||||
bool? hasEquipment,
|
||||
String? sortBy,
|
||||
String? sortOrder,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getWarehouseLocations,
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#perPage: perPage,
|
||||
#search: search,
|
||||
#filters: filters,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<_i2.WarehouseLocationListDto>.value(
|
||||
_FakeWarehouseLocationListDto_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getWarehouseLocations,
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#perPage: perPage,
|
||||
#search: search,
|
||||
#filters: filters,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.WarehouseLocationListDto>);
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getWarehouseLocations,
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#limit: limit,
|
||||
#search: search,
|
||||
#locationType: locationType,
|
||||
#isActive: isActive,
|
||||
#hasEquipment: hasEquipment,
|
||||
#sortBy: sortBy,
|
||||
#sortOrder: sortOrder,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<
|
||||
_i2.Either<_i5.Failure,
|
||||
_i6.PaginatedResponse<_i7.WarehouseLocation>>>.value(
|
||||
_FakeEither_0<_i5.Failure,
|
||||
_i6.PaginatedResponse<_i7.WarehouseLocation>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getWarehouseLocations,
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#limit: limit,
|
||||
#search: search,
|
||||
#locationType: locationType,
|
||||
#isActive: isActive,
|
||||
#hasEquipment: hasEquipment,
|
||||
#sortBy: sortBy,
|
||||
#sortOrder: sortOrder,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<
|
||||
_i2.Either<_i5.Failure,
|
||||
_i6.PaginatedResponse<_i7.WarehouseLocation>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.WarehouseLocationDto> getWarehouseLocationDetail(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getWarehouseLocationDetail,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4.Future<_i2.WarehouseLocationDto>.value(
|
||||
_FakeWarehouseLocationDto_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getWarehouseLocationDetail,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.WarehouseLocationDto>);
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>
|
||||
getWarehouseLocationById(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getWarehouseLocationById,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4
|
||||
.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.WarehouseLocation>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getWarehouseLocationById,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.WarehouseLocationDto> createWarehouseLocation(
|
||||
Map<String, dynamic>? data) =>
|
||||
_i4.Future<
|
||||
_i2.Either<_i5.Failure, _i7.WarehouseLocation>> createWarehouseLocation(
|
||||
_i7.WarehouseLocation? warehouseLocation) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#createWarehouseLocation,
|
||||
[data],
|
||||
[warehouseLocation],
|
||||
),
|
||||
returnValue: _i4.Future<_i2.WarehouseLocationDto>.value(
|
||||
_FakeWarehouseLocationDto_1(
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.WarehouseLocation>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#createWarehouseLocation,
|
||||
[data],
|
||||
[warehouseLocation],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.WarehouseLocationDto>);
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.WarehouseLocationDto> updateWarehouseLocation(
|
||||
_i4.Future<
|
||||
_i2.Either<_i5.Failure, _i7.WarehouseLocation>> updateWarehouseLocation(
|
||||
int? id,
|
||||
Map<String, dynamic>? data,
|
||||
_i7.WarehouseLocation? warehouseLocation,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateWarehouseLocation,
|
||||
[
|
||||
id,
|
||||
data,
|
||||
warehouseLocation,
|
||||
],
|
||||
),
|
||||
returnValue: _i4.Future<_i2.WarehouseLocationDto>.value(
|
||||
_FakeWarehouseLocationDto_1(
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.WarehouseLocation>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#updateWarehouseLocation,
|
||||
[
|
||||
id,
|
||||
data,
|
||||
warehouseLocation,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.WarehouseLocationDto>);
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>);
|
||||
|
||||
@override
|
||||
_i4.Future<void> deleteWarehouseLocation(int? id) => (super.noSuchMethod(
|
||||
_i4.Future<_i2.Either<_i5.Failure, void>> deleteWarehouseLocation(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteWarehouseLocation,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, void>>.value(
|
||||
_FakeEither_0<_i5.Failure, void>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#deleteWarehouseLocation,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, void>>);
|
||||
|
||||
@override
|
||||
_i4.Future<bool> checkWarehouseHasEquipment(int? id) => (super.noSuchMethod(
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>
|
||||
toggleWarehouseLocationStatus(int? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#toggleWarehouseLocationStatus,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4
|
||||
.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.WarehouseLocation>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#toggleWarehouseLocationStatus,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, bool>> hasEquipment(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#checkWarehouseHasEquipment,
|
||||
#hasEquipment,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4.Future<bool>.value(false),
|
||||
) as _i4.Future<bool>);
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, bool>>.value(
|
||||
_FakeEither_0<_i5.Failure, bool>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#hasEquipment,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, bool>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, int>> getEquipmentCount(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getEquipmentCount,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, int>>.value(
|
||||
_FakeEither_0<_i5.Failure, int>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getEquipmentCount,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, int>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i6.PaginatedResponse<dynamic>>>
|
||||
getEquipmentByWarehouse(
|
||||
int? warehouseId, {
|
||||
int? page,
|
||||
int? limit,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getEquipmentByWarehouse,
|
||||
[warehouseId],
|
||||
{
|
||||
#page: page,
|
||||
#limit: limit,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<
|
||||
_i2
|
||||
.Either<_i5.Failure, _i6.PaginatedResponse<dynamic>>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i6.PaginatedResponse<dynamic>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getEquipmentByWarehouse,
|
||||
[warehouseId],
|
||||
{
|
||||
#page: page,
|
||||
#limit: limit,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i4
|
||||
.Future<_i2.Either<_i5.Failure, _i6.PaginatedResponse<dynamic>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<int, double>>>
|
||||
getWarehouseUtilization() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getWarehouseUtilization,
|
||||
[],
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<int, double>>>.value(
|
||||
_FakeEither_0<_i5.Failure, Map<int, double>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getWarehouseUtilization,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, Map<int, double>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>
|
||||
getWarehouseCountByType() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getWarehouseCountByType,
|
||||
[],
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>.value(
|
||||
_FakeEither_0<_i5.Failure, Map<String, int>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getWarehouseCountByType,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, Map<String, int>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, bool>> isDuplicateWarehouseName(
|
||||
String? name, {
|
||||
int? excludeId,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isDuplicateWarehouseName,
|
||||
[name],
|
||||
{#excludeId: excludeId},
|
||||
),
|
||||
returnValue: _i4.Future<_i2.Either<_i5.Failure, bool>>.value(
|
||||
_FakeEither_0<_i5.Failure, bool>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#isDuplicateWarehouseName,
|
||||
[name],
|
||||
{#excludeId: excludeId},
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, bool>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.WarehouseLocation>>>
|
||||
searchWarehouseLocations(
|
||||
String? query, {
|
||||
int? limit,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchWarehouseLocations,
|
||||
[query],
|
||||
{#limit: limit},
|
||||
),
|
||||
returnValue: _i4.Future<
|
||||
_i2.Either<_i5.Failure, List<_i7.WarehouseLocation>>>.value(
|
||||
_FakeEither_0<_i5.Failure, List<_i7.WarehouseLocation>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#searchWarehouseLocations,
|
||||
[query],
|
||||
{#limit: limit},
|
||||
),
|
||||
)),
|
||||
) as _i4
|
||||
.Future<_i2.Either<_i5.Failure, List<_i7.WarehouseLocation>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<_i2.Either<_i5.Failure, List<_i7.WarehouseLocation>>>
|
||||
getActiveWarehouseLocations() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getActiveWarehouseLocations,
|
||||
[],
|
||||
),
|
||||
returnValue: _i4.Future<
|
||||
_i2.Either<_i5.Failure, List<_i7.WarehouseLocation>>>.value(
|
||||
_FakeEither_0<_i5.Failure, List<_i7.WarehouseLocation>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getActiveWarehouseLocations,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i4
|
||||
.Future<_i2.Either<_i5.Failure, List<_i7.WarehouseLocation>>>);
|
||||
|
||||
@override
|
||||
_i4.Future<
|
||||
_i2.Either<_i5.Failure, _i7.WarehouseLocation>> updateWarehouseCapacity(
|
||||
int? id,
|
||||
int? totalCapacity,
|
||||
int? usedCapacity,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateWarehouseCapacity,
|
||||
[
|
||||
id,
|
||||
totalCapacity,
|
||||
usedCapacity,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>.value(
|
||||
_FakeEither_0<_i5.Failure, _i7.WarehouseLocation>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#updateWarehouseCapacity,
|
||||
[
|
||||
id,
|
||||
totalCapacity,
|
||||
usedCapacity,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i4.Future<_i2.Either<_i5.Failure, _i7.WarehouseLocation>>);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user