## 주요 변경사항 ### 🏗️ 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. 성능 최적화
369 lines
11 KiB
Dart
369 lines
11 KiB
Dart
// Mocks generated by Mockito 5.4.5 from annotations
|
|
// in superport/test/domain/usecases/license/create_license_usecase_test.dart.
|
|
// Do not manually edit this file.
|
|
|
|
// 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/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
|
|
// ignore_for_file: avoid_setters_without_getters
|
|
// ignore_for_file: comment_references
|
|
// ignore_for_file: deprecated_member_use
|
|
// ignore_for_file: deprecated_member_use_from_same_package
|
|
// ignore_for_file: implementation_imports
|
|
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
|
// ignore_for_file: must_be_immutable
|
|
// ignore_for_file: prefer_const_constructors
|
|
// ignore_for_file: unnecessary_parenthesis
|
|
// ignore_for_file: camel_case_types
|
|
// ignore_for_file: subtype_of_sealed_class
|
|
|
|
class _FakeEither_0<L, R> extends _i1.SmartFake implements _i2.Either<L, R> {
|
|
_FakeEither_0(
|
|
Object parent,
|
|
Invocation parentInvocation,
|
|
) : super(
|
|
parent,
|
|
parentInvocation,
|
|
);
|
|
}
|
|
|
|
/// A class which mocks [LicenseRepository].
|
|
///
|
|
/// See the documentation for Mockito's code generation for more information.
|
|
class MockLicenseRepository extends _i1.Mock implements _i3.LicenseRepository {
|
|
MockLicenseRepository() {
|
|
_i1.throwOnMissingStub(this);
|
|
}
|
|
|
|
@override
|
|
_i4.Future<
|
|
_i2.Either<_i5.Failure, _i6.PaginatedResponse<_i7.License>>> getLicenses({
|
|
int? page,
|
|
int? limit,
|
|
String? search,
|
|
int? companyId,
|
|
String? equipmentType,
|
|
String? expiryStatus,
|
|
String? sortBy,
|
|
String? sortOrder,
|
|
}) =>
|
|
(super.noSuchMethod(
|
|
Invocation.method(
|
|
#getLicenses,
|
|
[],
|
|
{
|
|
#page: page,
|
|
#limit: limit,
|
|
#search: search,
|
|
#companyId: companyId,
|
|
#equipmentType: equipmentType,
|
|
#expiryStatus: expiryStatus,
|
|
#sortBy: sortBy,
|
|
#sortOrder: sortOrder,
|
|
},
|
|
),
|
|
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,
|
|
#limit: limit,
|
|
#search: search,
|
|
#companyId: companyId,
|
|
#equipmentType: equipmentType,
|
|
#expiryStatus: expiryStatus,
|
|
#sortBy: sortBy,
|
|
#sortOrder: sortOrder,
|
|
},
|
|
),
|
|
)),
|
|
) as _i4
|
|
.Future<_i2.Either<_i5.Failure, _i6.PaginatedResponse<_i7.License>>>);
|
|
|
|
@override
|
|
_i4.Future<_i2.Either<_i5.Failure, _i7.License>> getLicenseById(int? id) =>
|
|
(super.noSuchMethod(
|
|
Invocation.method(
|
|
#getLicenseById,
|
|
[id],
|
|
),
|
|
returnValue: _i4.Future<_i2.Either<_i5.Failure, _i7.License>>.value(
|
|
_FakeEither_0<_i5.Failure, _i7.License>(
|
|
this,
|
|
Invocation.method(
|
|
#getLicenseById,
|
|
[id],
|
|
),
|
|
)),
|
|
) as _i4.Future<_i2.Either<_i5.Failure, _i7.License>>);
|
|
|
|
@override
|
|
_i4.Future<_i2.Either<_i5.Failure, _i7.License>> createLicense(
|
|
_i7.License? license) =>
|
|
(super.noSuchMethod(
|
|
Invocation.method(
|
|
#createLicense,
|
|
[license],
|
|
),
|
|
returnValue: _i4.Future<_i2.Either<_i5.Failure, _i7.License>>.value(
|
|
_FakeEither_0<_i5.Failure, _i7.License>(
|
|
this,
|
|
Invocation.method(
|
|
#createLicense,
|
|
[license],
|
|
),
|
|
)),
|
|
) as _i4.Future<_i2.Either<_i5.Failure, _i7.License>>);
|
|
|
|
@override
|
|
_i4.Future<_i2.Either<_i5.Failure, _i7.License>> updateLicense(
|
|
int? id,
|
|
_i7.License? license,
|
|
) =>
|
|
(super.noSuchMethod(
|
|
Invocation.method(
|
|
#updateLicense,
|
|
[
|
|
id,
|
|
license,
|
|
],
|
|
),
|
|
returnValue: _i4.Future<_i2.Either<_i5.Failure, _i7.License>>.value(
|
|
_FakeEither_0<_i5.Failure, _i7.License>(
|
|
this,
|
|
Invocation.method(
|
|
#updateLicense,
|
|
[
|
|
id,
|
|
license,
|
|
],
|
|
),
|
|
)),
|
|
) as _i4.Future<_i2.Either<_i5.Failure, _i7.License>>);
|
|
|
|
@override
|
|
_i4.Future<_i2.Either<_i5.Failure, void>> deleteLicense(int? id) =>
|
|
(super.noSuchMethod(
|
|
Invocation.method(
|
|
#deleteLicense,
|
|
[id],
|
|
),
|
|
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>>>);
|
|
}
|