refactor: 프로젝트 구조 개선 및 테스트 시스템 강화
주요 변경사항: - CLAUDE.md: 프로젝트 규칙 v2.0으로 업데이트, 아키텍처 명확화 - 불필요한 문서 제거: NEXT_TASKS.md, TEST_PROGRESS.md, test_results 파일들 - 테스트 시스템 개선: 실제 API 테스트 스위트 추가 (15개 새 테스트 파일) - License 관리: DTO 모델 개선, API 응답 처리 최적화 - 에러 처리: Interceptor 로직 강화, 상세 로깅 추가 - Company/User/Warehouse 테스트: 자동화 테스트 안정성 향상 - Phone Utils: 전화번호 포맷팅 로직 개선 - Overview Controller: 대시보드 데이터 로딩 최적화 - Analysis Options: Flutter 린트 규칙 추가 테스트 개선: - company_real_api_test.dart: 실제 API 회사 관리 테스트 - equipment_in/out_real_api_test.dart: 장비 입출고 API 테스트 - license_real_api_test.dart: 라이선스 관리 API 테스트 - user_real_api_test.dart: 사용자 관리 API 테스트 - warehouse_location_real_api_test.dart: 창고 위치 API 테스트 - filter_sort_test.dart: 필터링/정렬 기능 테스트 - pagination_test.dart: 페이지네이션 테스트 - interactive_search_test.dart: 검색 기능 테스트 - overview_dashboard_test.dart: 대시보드 통합 테스트 코드 품질: - 모든 서비스에 에러 처리 강화 - DTO 모델 null safety 개선 - 테스트 커버리지 확대 - 불필요한 로그 파일 제거로 리포지토리 정리 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -11,8 +11,8 @@ class CompanyListDto with _$CompanyListDto {
|
||||
required int id,
|
||||
required String name,
|
||||
required String address,
|
||||
@JsonKey(name: 'contact_name') required String contactName,
|
||||
@JsonKey(name: 'contact_phone') required String contactPhone,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'is_active') required bool isActive,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
|
||||
@@ -24,9 +24,9 @@ mixin _$CompanyListDto {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get address => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_name')
|
||||
String get contactName => throw _privateConstructorUsedError;
|
||||
String? get contactName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_phone')
|
||||
String get contactPhone => throw _privateConstructorUsedError;
|
||||
String? get contactPhone => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_email')
|
||||
String? get contactEmail => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_active')
|
||||
@@ -56,8 +56,8 @@ abstract class $CompanyListDtoCopyWith<$Res> {
|
||||
{int id,
|
||||
String name,
|
||||
String address,
|
||||
@JsonKey(name: 'contact_name') String contactName,
|
||||
@JsonKey(name: 'contact_phone') String contactPhone,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@@ -82,8 +82,8 @@ class _$CompanyListDtoCopyWithImpl<$Res, $Val extends CompanyListDto>
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? contactName = null,
|
||||
Object? contactPhone = null,
|
||||
Object? contactName = freezed,
|
||||
Object? contactPhone = freezed,
|
||||
Object? contactEmail = freezed,
|
||||
Object? isActive = null,
|
||||
Object? createdAt = freezed,
|
||||
@@ -102,14 +102,14 @@ class _$CompanyListDtoCopyWithImpl<$Res, $Val extends CompanyListDto>
|
||||
? _value.address
|
||||
: address // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
contactName: null == contactName
|
||||
contactName: freezed == contactName
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
contactPhone: null == contactPhone
|
||||
as String?,
|
||||
contactPhone: freezed == contactPhone
|
||||
? _value.contactPhone
|
||||
: contactPhone // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
contactEmail: freezed == contactEmail
|
||||
? _value.contactEmail
|
||||
: contactEmail // ignore: cast_nullable_to_non_nullable
|
||||
@@ -142,8 +142,8 @@ abstract class _$$CompanyListDtoImplCopyWith<$Res>
|
||||
{int id,
|
||||
String name,
|
||||
String address,
|
||||
@JsonKey(name: 'contact_name') String contactName,
|
||||
@JsonKey(name: 'contact_phone') String contactPhone,
|
||||
@JsonKey(name: 'contact_name') String? contactName,
|
||||
@JsonKey(name: 'contact_phone') String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') String? contactEmail,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'created_at') DateTime? createdAt,
|
||||
@@ -166,8 +166,8 @@ class __$$CompanyListDtoImplCopyWithImpl<$Res>
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? contactName = null,
|
||||
Object? contactPhone = null,
|
||||
Object? contactName = freezed,
|
||||
Object? contactPhone = freezed,
|
||||
Object? contactEmail = freezed,
|
||||
Object? isActive = null,
|
||||
Object? createdAt = freezed,
|
||||
@@ -186,14 +186,14 @@ class __$$CompanyListDtoImplCopyWithImpl<$Res>
|
||||
? _value.address
|
||||
: address // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
contactName: null == contactName
|
||||
contactName: freezed == contactName
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
contactPhone: null == contactPhone
|
||||
as String?,
|
||||
contactPhone: freezed == contactPhone
|
||||
? _value.contactPhone
|
||||
: contactPhone // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
contactEmail: freezed == contactEmail
|
||||
? _value.contactEmail
|
||||
: contactEmail // ignore: cast_nullable_to_non_nullable
|
||||
@@ -221,8 +221,8 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.address,
|
||||
@JsonKey(name: 'contact_name') required this.contactName,
|
||||
@JsonKey(name: 'contact_phone') required this.contactPhone,
|
||||
@JsonKey(name: 'contact_name') this.contactName,
|
||||
@JsonKey(name: 'contact_phone') this.contactPhone,
|
||||
@JsonKey(name: 'contact_email') this.contactEmail,
|
||||
@JsonKey(name: 'is_active') required this.isActive,
|
||||
@JsonKey(name: 'created_at') this.createdAt,
|
||||
@@ -239,10 +239,10 @@ class _$CompanyListDtoImpl implements _CompanyListDto {
|
||||
final String address;
|
||||
@override
|
||||
@JsonKey(name: 'contact_name')
|
||||
final String contactName;
|
||||
final String? contactName;
|
||||
@override
|
||||
@JsonKey(name: 'contact_phone')
|
||||
final String contactPhone;
|
||||
final String? contactPhone;
|
||||
@override
|
||||
@JsonKey(name: 'contact_email')
|
||||
final String? contactEmail;
|
||||
@@ -310,8 +310,8 @@ abstract class _CompanyListDto implements CompanyListDto {
|
||||
{required final int id,
|
||||
required final String name,
|
||||
required final String address,
|
||||
@JsonKey(name: 'contact_name') required final String contactName,
|
||||
@JsonKey(name: 'contact_phone') required final String contactPhone,
|
||||
@JsonKey(name: 'contact_name') final String? contactName,
|
||||
@JsonKey(name: 'contact_phone') final String? contactPhone,
|
||||
@JsonKey(name: 'contact_email') final String? contactEmail,
|
||||
@JsonKey(name: 'is_active') required final bool isActive,
|
||||
@JsonKey(name: 'created_at') final DateTime? createdAt,
|
||||
@@ -329,10 +329,10 @@ abstract class _CompanyListDto implements CompanyListDto {
|
||||
String get address;
|
||||
@override
|
||||
@JsonKey(name: 'contact_name')
|
||||
String get contactName;
|
||||
String? get contactName;
|
||||
@override
|
||||
@JsonKey(name: 'contact_phone')
|
||||
String get contactPhone;
|
||||
String? get contactPhone;
|
||||
@override
|
||||
@JsonKey(name: 'contact_email')
|
||||
String? get contactEmail;
|
||||
|
||||
@@ -11,8 +11,8 @@ _$CompanyListDtoImpl _$$CompanyListDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
address: json['address'] as String,
|
||||
contactName: json['contact_name'] as String,
|
||||
contactPhone: json['contact_phone'] as String,
|
||||
contactName: json['contact_name'] as String?,
|
||||
contactPhone: json['contact_phone'] as String?,
|
||||
contactEmail: json['contact_email'] as String?,
|
||||
isActive: json['is_active'] as bool,
|
||||
createdAt: json['created_at'] == null
|
||||
|
||||
@@ -3,6 +3,44 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'license_dto.freezed.dart';
|
||||
part 'license_dto.g.dart';
|
||||
|
||||
// 날짜를 YYYY-MM-DD 형식으로 변환하는 헬퍼 함수
|
||||
String? _dateToJson(DateTime? date) {
|
||||
if (date == null) return null;
|
||||
return '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
// YYYY-MM-DD 형식 문자열을 DateTime으로 변환하는 헬퍼 함수
|
||||
DateTime? _dateFromJson(String? dateStr) {
|
||||
if (dateStr == null || dateStr.isEmpty) return null;
|
||||
try {
|
||||
// YYYY-MM-DD 형식 파싱
|
||||
if (dateStr.contains('-') && dateStr.length == 10) {
|
||||
final parts = dateStr.split('-');
|
||||
return DateTime(int.parse(parts[0]), int.parse(parts[1]), int.parse(parts[2]));
|
||||
}
|
||||
// ISO 8601 형식도 지원
|
||||
return DateTime.parse(dateStr);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// 필수 날짜 필드용 헬퍼 함수 (항상 non-null DateTime 반환)
|
||||
DateTime _requiredDateFromJson(String? dateStr) {
|
||||
if (dateStr == null || dateStr.isEmpty) return DateTime.now();
|
||||
try {
|
||||
// YYYY-MM-DD 형식 파싱
|
||||
if (dateStr.contains('-') && dateStr.length == 10) {
|
||||
final parts = dateStr.split('-');
|
||||
return DateTime(int.parse(parts[0]), int.parse(parts[1]), int.parse(parts[2]));
|
||||
}
|
||||
// ISO 8601 형식도 지원
|
||||
return DateTime.parse(dateStr);
|
||||
} catch (e) {
|
||||
return DateTime.now();
|
||||
}
|
||||
}
|
||||
|
||||
/// 라이선스 전체 정보 DTO
|
||||
@freezed
|
||||
class LicenseDto with _$LicenseDto {
|
||||
@@ -13,8 +51,8 @@ class LicenseDto with _$LicenseDto {
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson) DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson) DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@@ -54,10 +92,14 @@ class ExpiringLicenseDto with _$ExpiringLicenseDto {
|
||||
required int id,
|
||||
@JsonKey(name: 'license_key') required String licenseKey,
|
||||
@JsonKey(name: 'product_name') String? productName,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'expiry_date') required DateTime expiryDate,
|
||||
String? vendor,
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson) required DateTime expiryDate,
|
||||
@JsonKey(name: 'days_until_expiry') required int daysUntilExpiry,
|
||||
@JsonKey(name: 'is_active') required bool isActive,
|
||||
@JsonKey(name: 'assigned_user_id') int? assignedUserId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'assigned_user_name') String? assignedUserName,
|
||||
@JsonKey(name: 'is_active', defaultValue: true) bool? isActive,
|
||||
}) = _ExpiringLicenseDto;
|
||||
|
||||
factory ExpiringLicenseDto.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -30,9 +30,9 @@ mixin _$LicenseDto {
|
||||
String? get licenseType => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'user_count')
|
||||
int? get userCount => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get expiryDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_price')
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@@ -80,8 +80,12 @@ abstract class $LicenseDtoCopyWith<$Res> {
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@@ -226,8 +230,12 @@ abstract class _$$LicenseDtoImplCopyWith<$Res>
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@@ -365,8 +373,12 @@ class _$LicenseDtoImpl implements _LicenseDto {
|
||||
this.vendor,
|
||||
@JsonKey(name: 'license_type') this.licenseType,
|
||||
@JsonKey(name: 'user_count') this.userCount,
|
||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') this.expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
this.purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
this.expiryDate,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
@JsonKey(name: 'company_id') this.companyId,
|
||||
@JsonKey(name: 'branch_id') this.branchId,
|
||||
@@ -399,10 +411,10 @@ class _$LicenseDtoImpl implements _LicenseDto {
|
||||
@JsonKey(name: 'user_count')
|
||||
final int? userCount;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@@ -534,8 +546,12 @@ abstract class _LicenseDto implements LicenseDto {
|
||||
final String? vendor,
|
||||
@JsonKey(name: 'license_type') final String? licenseType,
|
||||
@JsonKey(name: 'user_count') final int? userCount,
|
||||
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') final DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') final double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') final int? companyId,
|
||||
@JsonKey(name: 'branch_id') final int? branchId,
|
||||
@@ -569,10 +585,10 @@ abstract class _LicenseDto implements LicenseDto {
|
||||
@JsonKey(name: 'user_count')
|
||||
int? get userCount;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@@ -886,14 +902,21 @@ mixin _$ExpiringLicenseDto {
|
||||
String get licenseKey => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'product_name')
|
||||
String? get productName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiry_date')
|
||||
String? get vendor => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson)
|
||||
DateTime get expiryDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'days_until_expiry')
|
||||
int get daysUntilExpiry => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_active')
|
||||
bool get isActive => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'assigned_user_id')
|
||||
int? get assignedUserId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'assigned_user_name')
|
||||
String? get assignedUserName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_active', defaultValue: true)
|
||||
bool? get isActive => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ExpiringLicenseDto to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -915,10 +938,15 @@ abstract class $ExpiringLicenseDtoCopyWith<$Res> {
|
||||
{int id,
|
||||
@JsonKey(name: 'license_key') String licenseKey,
|
||||
@JsonKey(name: 'product_name') String? productName,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'expiry_date') DateTime expiryDate,
|
||||
String? vendor,
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson)
|
||||
DateTime expiryDate,
|
||||
@JsonKey(name: 'days_until_expiry') int daysUntilExpiry,
|
||||
@JsonKey(name: 'is_active') bool isActive});
|
||||
@JsonKey(name: 'assigned_user_id') int? assignedUserId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'assigned_user_name') String? assignedUserName,
|
||||
@JsonKey(name: 'is_active', defaultValue: true) bool? isActive});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -939,10 +967,14 @@ class _$ExpiringLicenseDtoCopyWithImpl<$Res, $Val extends ExpiringLicenseDto>
|
||||
Object? id = null,
|
||||
Object? licenseKey = null,
|
||||
Object? productName = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? vendor = freezed,
|
||||
Object? expiryDate = null,
|
||||
Object? daysUntilExpiry = null,
|
||||
Object? isActive = null,
|
||||
Object? assignedUserId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? assignedUserName = freezed,
|
||||
Object? isActive = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
@@ -957,9 +989,9 @@ class _$ExpiringLicenseDtoCopyWithImpl<$Res, $Val extends ExpiringLicenseDto>
|
||||
? _value.productName
|
||||
: productName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
vendor: freezed == vendor
|
||||
? _value.vendor
|
||||
: vendor // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
expiryDate: null == expiryDate
|
||||
? _value.expiryDate
|
||||
@@ -969,10 +1001,26 @@ class _$ExpiringLicenseDtoCopyWithImpl<$Res, $Val extends ExpiringLicenseDto>
|
||||
? _value.daysUntilExpiry
|
||||
: daysUntilExpiry // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
isActive: null == isActive
|
||||
assignedUserId: freezed == assignedUserId
|
||||
? _value.assignedUserId
|
||||
: assignedUserId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
assignedUserName: freezed == assignedUserName
|
||||
? _value.assignedUserName
|
||||
: assignedUserName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
isActive: freezed == isActive
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
as bool?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -989,10 +1037,15 @@ abstract class _$$ExpiringLicenseDtoImplCopyWith<$Res>
|
||||
{int id,
|
||||
@JsonKey(name: 'license_key') String licenseKey,
|
||||
@JsonKey(name: 'product_name') String? productName,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'expiry_date') DateTime expiryDate,
|
||||
String? vendor,
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson)
|
||||
DateTime expiryDate,
|
||||
@JsonKey(name: 'days_until_expiry') int daysUntilExpiry,
|
||||
@JsonKey(name: 'is_active') bool isActive});
|
||||
@JsonKey(name: 'assigned_user_id') int? assignedUserId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'company_name') String? companyName,
|
||||
@JsonKey(name: 'assigned_user_name') String? assignedUserName,
|
||||
@JsonKey(name: 'is_active', defaultValue: true) bool? isActive});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1011,10 +1064,14 @@ class __$$ExpiringLicenseDtoImplCopyWithImpl<$Res>
|
||||
Object? id = null,
|
||||
Object? licenseKey = null,
|
||||
Object? productName = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? vendor = freezed,
|
||||
Object? expiryDate = null,
|
||||
Object? daysUntilExpiry = null,
|
||||
Object? isActive = null,
|
||||
Object? assignedUserId = freezed,
|
||||
Object? companyId = freezed,
|
||||
Object? companyName = freezed,
|
||||
Object? assignedUserName = freezed,
|
||||
Object? isActive = freezed,
|
||||
}) {
|
||||
return _then(_$ExpiringLicenseDtoImpl(
|
||||
id: null == id
|
||||
@@ -1029,9 +1086,9 @@ class __$$ExpiringLicenseDtoImplCopyWithImpl<$Res>
|
||||
? _value.productName
|
||||
: productName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
vendor: freezed == vendor
|
||||
? _value.vendor
|
||||
: vendor // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
expiryDate: null == expiryDate
|
||||
? _value.expiryDate
|
||||
@@ -1041,10 +1098,26 @@ class __$$ExpiringLicenseDtoImplCopyWithImpl<$Res>
|
||||
? _value.daysUntilExpiry
|
||||
: daysUntilExpiry // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
isActive: null == isActive
|
||||
assignedUserId: freezed == assignedUserId
|
||||
? _value.assignedUserId
|
||||
: assignedUserId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
companyId: freezed == companyId
|
||||
? _value.companyId
|
||||
: companyId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
companyName: freezed == companyName
|
||||
? _value.companyName
|
||||
: companyName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
assignedUserName: freezed == assignedUserName
|
||||
? _value.assignedUserName
|
||||
: assignedUserName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
isActive: freezed == isActive
|
||||
? _value.isActive
|
||||
: isActive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1056,10 +1129,15 @@ class _$ExpiringLicenseDtoImpl implements _ExpiringLicenseDto {
|
||||
{required this.id,
|
||||
@JsonKey(name: 'license_key') required this.licenseKey,
|
||||
@JsonKey(name: 'product_name') this.productName,
|
||||
@JsonKey(name: 'company_name') this.companyName,
|
||||
@JsonKey(name: 'expiry_date') required this.expiryDate,
|
||||
this.vendor,
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson)
|
||||
required this.expiryDate,
|
||||
@JsonKey(name: 'days_until_expiry') required this.daysUntilExpiry,
|
||||
@JsonKey(name: 'is_active') required this.isActive});
|
||||
@JsonKey(name: 'assigned_user_id') this.assignedUserId,
|
||||
@JsonKey(name: 'company_id') this.companyId,
|
||||
@JsonKey(name: 'company_name') this.companyName,
|
||||
@JsonKey(name: 'assigned_user_name') this.assignedUserName,
|
||||
@JsonKey(name: 'is_active', defaultValue: true) this.isActive});
|
||||
|
||||
factory _$ExpiringLicenseDtoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ExpiringLicenseDtoImplFromJson(json);
|
||||
@@ -1073,21 +1151,32 @@ class _$ExpiringLicenseDtoImpl implements _ExpiringLicenseDto {
|
||||
@JsonKey(name: 'product_name')
|
||||
final String? productName;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
final String? companyName;
|
||||
final String? vendor;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson)
|
||||
final DateTime expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'days_until_expiry')
|
||||
final int daysUntilExpiry;
|
||||
@override
|
||||
@JsonKey(name: 'is_active')
|
||||
final bool isActive;
|
||||
@JsonKey(name: 'assigned_user_id')
|
||||
final int? assignedUserId;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
final int? companyId;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
final String? companyName;
|
||||
@override
|
||||
@JsonKey(name: 'assigned_user_name')
|
||||
final String? assignedUserName;
|
||||
@override
|
||||
@JsonKey(name: 'is_active', defaultValue: true)
|
||||
final bool? isActive;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ExpiringLicenseDto(id: $id, licenseKey: $licenseKey, productName: $productName, companyName: $companyName, expiryDate: $expiryDate, daysUntilExpiry: $daysUntilExpiry, isActive: $isActive)';
|
||||
return 'ExpiringLicenseDto(id: $id, licenseKey: $licenseKey, productName: $productName, vendor: $vendor, expiryDate: $expiryDate, daysUntilExpiry: $daysUntilExpiry, assignedUserId: $assignedUserId, companyId: $companyId, companyName: $companyName, assignedUserName: $assignedUserName, isActive: $isActive)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1100,20 +1189,38 @@ class _$ExpiringLicenseDtoImpl implements _ExpiringLicenseDto {
|
||||
other.licenseKey == licenseKey) &&
|
||||
(identical(other.productName, productName) ||
|
||||
other.productName == productName) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.vendor, vendor) || other.vendor == vendor) &&
|
||||
(identical(other.expiryDate, expiryDate) ||
|
||||
other.expiryDate == expiryDate) &&
|
||||
(identical(other.daysUntilExpiry, daysUntilExpiry) ||
|
||||
other.daysUntilExpiry == daysUntilExpiry) &&
|
||||
(identical(other.assignedUserId, assignedUserId) ||
|
||||
other.assignedUserId == assignedUserId) &&
|
||||
(identical(other.companyId, companyId) ||
|
||||
other.companyId == companyId) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.assignedUserName, assignedUserName) ||
|
||||
other.assignedUserName == assignedUserName) &&
|
||||
(identical(other.isActive, isActive) ||
|
||||
other.isActive == isActive));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, licenseKey, productName,
|
||||
companyName, expiryDate, daysUntilExpiry, isActive);
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
licenseKey,
|
||||
productName,
|
||||
vendor,
|
||||
expiryDate,
|
||||
daysUntilExpiry,
|
||||
assignedUserId,
|
||||
companyId,
|
||||
companyName,
|
||||
assignedUserName,
|
||||
isActive);
|
||||
|
||||
/// Create a copy of ExpiringLicenseDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1137,11 +1244,16 @@ abstract class _ExpiringLicenseDto implements ExpiringLicenseDto {
|
||||
{required final int id,
|
||||
@JsonKey(name: 'license_key') required final String licenseKey,
|
||||
@JsonKey(name: 'product_name') final String? productName,
|
||||
@JsonKey(name: 'company_name') final String? companyName,
|
||||
@JsonKey(name: 'expiry_date') required final DateTime expiryDate,
|
||||
final String? vendor,
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson)
|
||||
required final DateTime expiryDate,
|
||||
@JsonKey(name: 'days_until_expiry') required final int daysUntilExpiry,
|
||||
@JsonKey(name: 'is_active')
|
||||
required final bool isActive}) = _$ExpiringLicenseDtoImpl;
|
||||
@JsonKey(name: 'assigned_user_id') final int? assignedUserId,
|
||||
@JsonKey(name: 'company_id') final int? companyId,
|
||||
@JsonKey(name: 'company_name') final String? companyName,
|
||||
@JsonKey(name: 'assigned_user_name') final String? assignedUserName,
|
||||
@JsonKey(name: 'is_active', defaultValue: true)
|
||||
final bool? isActive}) = _$ExpiringLicenseDtoImpl;
|
||||
|
||||
factory _ExpiringLicenseDto.fromJson(Map<String, dynamic> json) =
|
||||
_$ExpiringLicenseDtoImpl.fromJson;
|
||||
@@ -1155,17 +1267,28 @@ abstract class _ExpiringLicenseDto implements ExpiringLicenseDto {
|
||||
@JsonKey(name: 'product_name')
|
||||
String? get productName;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName;
|
||||
String? get vendor;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', fromJson: _requiredDateFromJson)
|
||||
DateTime get expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'days_until_expiry')
|
||||
int get daysUntilExpiry;
|
||||
@override
|
||||
@JsonKey(name: 'is_active')
|
||||
bool get isActive;
|
||||
@JsonKey(name: 'assigned_user_id')
|
||||
int? get assignedUserId;
|
||||
@override
|
||||
@JsonKey(name: 'company_id')
|
||||
int? get companyId;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
String? get companyName;
|
||||
@override
|
||||
@JsonKey(name: 'assigned_user_name')
|
||||
String? get assignedUserName;
|
||||
@override
|
||||
@JsonKey(name: 'is_active', defaultValue: true)
|
||||
bool? get isActive;
|
||||
|
||||
/// Create a copy of ExpiringLicenseDto
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -14,12 +14,8 @@ _$LicenseDtoImpl _$$LicenseDtoImplFromJson(Map<String, dynamic> json) =>
|
||||
vendor: json['vendor'] as String?,
|
||||
licenseType: json['license_type'] as String?,
|
||||
userCount: (json['user_count'] as num?)?.toInt(),
|
||||
purchaseDate: json['purchase_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchase_date'] as String),
|
||||
expiryDate: json['expiry_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['expiry_date'] as String),
|
||||
purchaseDate: _dateFromJson(json['purchase_date'] as String?),
|
||||
expiryDate: _dateFromJson(json['expiry_date'] as String?),
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toDouble(),
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
branchId: (json['branch_id'] as num?)?.toInt(),
|
||||
@@ -41,8 +37,8 @@ Map<String, dynamic> _$$LicenseDtoImplToJson(_$LicenseDtoImpl instance) =>
|
||||
'vendor': instance.vendor,
|
||||
'license_type': instance.licenseType,
|
||||
'user_count': instance.userCount,
|
||||
'purchase_date': instance.purchaseDate?.toIso8601String(),
|
||||
'expiry_date': instance.expiryDate?.toIso8601String(),
|
||||
'purchase_date': _dateToJson(instance.purchaseDate),
|
||||
'expiry_date': _dateToJson(instance.expiryDate),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'company_id': instance.companyId,
|
||||
'branch_id': instance.branchId,
|
||||
@@ -84,10 +80,14 @@ _$ExpiringLicenseDtoImpl _$$ExpiringLicenseDtoImplFromJson(
|
||||
id: (json['id'] as num).toInt(),
|
||||
licenseKey: json['license_key'] as String,
|
||||
productName: json['product_name'] as String?,
|
||||
companyName: json['company_name'] as String?,
|
||||
expiryDate: DateTime.parse(json['expiry_date'] as String),
|
||||
vendor: json['vendor'] as String?,
|
||||
expiryDate: _requiredDateFromJson(json['expiry_date'] as String?),
|
||||
daysUntilExpiry: (json['days_until_expiry'] as num).toInt(),
|
||||
isActive: json['is_active'] as bool,
|
||||
assignedUserId: (json['assigned_user_id'] as num?)?.toInt(),
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
companyName: json['company_name'] as String?,
|
||||
assignedUserName: json['assigned_user_name'] as String?,
|
||||
isActive: json['is_active'] as bool? ?? true,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ExpiringLicenseDtoImplToJson(
|
||||
@@ -96,9 +96,13 @@ Map<String, dynamic> _$$ExpiringLicenseDtoImplToJson(
|
||||
'id': instance.id,
|
||||
'license_key': instance.licenseKey,
|
||||
'product_name': instance.productName,
|
||||
'company_name': instance.companyName,
|
||||
'vendor': instance.vendor,
|
||||
'expiry_date': instance.expiryDate.toIso8601String(),
|
||||
'days_until_expiry': instance.daysUntilExpiry,
|
||||
'assigned_user_id': instance.assignedUserId,
|
||||
'company_id': instance.companyId,
|
||||
'company_name': instance.companyName,
|
||||
'assigned_user_name': instance.assignedUserName,
|
||||
'is_active': instance.isActive,
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,28 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'license_request_dto.freezed.dart';
|
||||
part 'license_request_dto.g.dart';
|
||||
|
||||
// 날짜를 YYYY-MM-DD 형식으로 변환하는 헬퍼 함수
|
||||
String? _dateToJson(DateTime? date) {
|
||||
if (date == null) return null;
|
||||
return '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
// YYYY-MM-DD 형식 문자열을 DateTime으로 변환하는 헬퍼 함수
|
||||
DateTime? _dateFromJson(String? dateStr) {
|
||||
if (dateStr == null || dateStr.isEmpty) return null;
|
||||
try {
|
||||
// YYYY-MM-DD 형식 파싱
|
||||
if (dateStr.contains('-') && dateStr.length == 10) {
|
||||
final parts = dateStr.split('-');
|
||||
return DateTime(int.parse(parts[0]), int.parse(parts[1]), int.parse(parts[2]));
|
||||
}
|
||||
// ISO 8601 형식도 지원
|
||||
return DateTime.parse(dateStr);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// 라이선스 생성 요청 DTO
|
||||
@freezed
|
||||
class CreateLicenseRequest with _$CreateLicenseRequest {
|
||||
@@ -12,8 +34,8 @@ class CreateLicenseRequest with _$CreateLicenseRequest {
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson) DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson) DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@@ -32,8 +54,8 @@ class UpdateLicenseRequest with _$UpdateLicenseRequest {
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson) DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson) DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
|
||||
@@ -29,9 +29,9 @@ mixin _$CreateLicenseRequest {
|
||||
String? get licenseType => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'user_count')
|
||||
int? get userCount => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get expiryDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_price')
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@@ -63,8 +63,12 @@ abstract class $CreateLicenseRequestCopyWith<$Res> {
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@@ -162,8 +166,12 @@ abstract class _$$CreateLicenseRequestImplCopyWith<$Res>
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
@JsonKey(name: 'branch_id') int? branchId,
|
||||
@@ -253,8 +261,12 @@ class _$CreateLicenseRequestImpl implements _CreateLicenseRequest {
|
||||
this.vendor,
|
||||
@JsonKey(name: 'license_type') this.licenseType,
|
||||
@JsonKey(name: 'user_count') this.userCount,
|
||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') this.expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
this.purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
this.expiryDate,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
@JsonKey(name: 'company_id') this.companyId,
|
||||
@JsonKey(name: 'branch_id') this.branchId,
|
||||
@@ -278,10 +290,10 @@ class _$CreateLicenseRequestImpl implements _CreateLicenseRequest {
|
||||
@JsonKey(name: 'user_count')
|
||||
final int? userCount;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@@ -368,8 +380,12 @@ abstract class _CreateLicenseRequest implements CreateLicenseRequest {
|
||||
final String? vendor,
|
||||
@JsonKey(name: 'license_type') final String? licenseType,
|
||||
@JsonKey(name: 'user_count') final int? userCount,
|
||||
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') final DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') final double? purchasePrice,
|
||||
@JsonKey(name: 'company_id') final int? companyId,
|
||||
@JsonKey(name: 'branch_id') final int? branchId,
|
||||
@@ -393,10 +409,10 @@ abstract class _CreateLicenseRequest implements CreateLicenseRequest {
|
||||
@JsonKey(name: 'user_count')
|
||||
int? get userCount;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@@ -433,9 +449,9 @@ mixin _$UpdateLicenseRequest {
|
||||
String? get licenseType => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'user_count')
|
||||
int? get userCount => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get purchaseDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get expiryDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'purchase_price')
|
||||
double? get purchasePrice => throw _privateConstructorUsedError;
|
||||
@@ -465,8 +481,12 @@ abstract class $UpdateLicenseRequestCopyWith<$Res> {
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool? isActive});
|
||||
@@ -558,8 +578,12 @@ abstract class _$$UpdateLicenseRequestImplCopyWith<$Res>
|
||||
String? vendor,
|
||||
@JsonKey(name: 'license_type') String? licenseType,
|
||||
@JsonKey(name: 'user_count') int? userCount,
|
||||
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') DateTime? expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') double? purchasePrice,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool? isActive});
|
||||
@@ -643,8 +667,12 @@ class _$UpdateLicenseRequestImpl implements _UpdateLicenseRequest {
|
||||
this.vendor,
|
||||
@JsonKey(name: 'license_type') this.licenseType,
|
||||
@JsonKey(name: 'user_count') this.userCount,
|
||||
@JsonKey(name: 'purchase_date') this.purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') this.expiryDate,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
this.purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
this.expiryDate,
|
||||
@JsonKey(name: 'purchase_price') this.purchasePrice,
|
||||
this.remark,
|
||||
@JsonKey(name: 'is_active') this.isActive});
|
||||
@@ -667,10 +695,10 @@ class _$UpdateLicenseRequestImpl implements _UpdateLicenseRequest {
|
||||
@JsonKey(name: 'user_count')
|
||||
final int? userCount;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
@@ -746,17 +774,21 @@ class _$UpdateLicenseRequestImpl implements _UpdateLicenseRequest {
|
||||
|
||||
abstract class _UpdateLicenseRequest implements UpdateLicenseRequest {
|
||||
const factory _UpdateLicenseRequest(
|
||||
{@JsonKey(name: 'license_key') final String? licenseKey,
|
||||
@JsonKey(name: 'product_name') final String? productName,
|
||||
final String? vendor,
|
||||
@JsonKey(name: 'license_type') final String? licenseType,
|
||||
@JsonKey(name: 'user_count') final int? userCount,
|
||||
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
|
||||
@JsonKey(name: 'expiry_date') final DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') final double? purchasePrice,
|
||||
final String? remark,
|
||||
@JsonKey(name: 'is_active') final bool? isActive}) =
|
||||
_$UpdateLicenseRequestImpl;
|
||||
{@JsonKey(name: 'license_key') final String? licenseKey,
|
||||
@JsonKey(name: 'product_name') final String? productName,
|
||||
final String? vendor,
|
||||
@JsonKey(name: 'license_type') final String? licenseType,
|
||||
@JsonKey(name: 'user_count') final int? userCount,
|
||||
@JsonKey(
|
||||
name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? purchaseDate,
|
||||
@JsonKey(
|
||||
name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
final DateTime? expiryDate,
|
||||
@JsonKey(name: 'purchase_price') final double? purchasePrice,
|
||||
final String? remark,
|
||||
@JsonKey(name: 'is_active')
|
||||
final bool? isActive}) = _$UpdateLicenseRequestImpl;
|
||||
|
||||
factory _UpdateLicenseRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$UpdateLicenseRequestImpl.fromJson;
|
||||
@@ -776,10 +808,10 @@ abstract class _UpdateLicenseRequest implements UpdateLicenseRequest {
|
||||
@JsonKey(name: 'user_count')
|
||||
int? get userCount;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_date')
|
||||
@JsonKey(name: 'purchase_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get purchaseDate;
|
||||
@override
|
||||
@JsonKey(name: 'expiry_date')
|
||||
@JsonKey(name: 'expiry_date', toJson: _dateToJson, fromJson: _dateFromJson)
|
||||
DateTime? get expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'purchase_price')
|
||||
|
||||
@@ -14,12 +14,8 @@ _$CreateLicenseRequestImpl _$$CreateLicenseRequestImplFromJson(
|
||||
vendor: json['vendor'] as String?,
|
||||
licenseType: json['license_type'] as String?,
|
||||
userCount: (json['user_count'] as num?)?.toInt(),
|
||||
purchaseDate: json['purchase_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchase_date'] as String),
|
||||
expiryDate: json['expiry_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['expiry_date'] as String),
|
||||
purchaseDate: _dateFromJson(json['purchase_date'] as String?),
|
||||
expiryDate: _dateFromJson(json['expiry_date'] as String?),
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toDouble(),
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
branchId: (json['branch_id'] as num?)?.toInt(),
|
||||
@@ -34,8 +30,8 @@ Map<String, dynamic> _$$CreateLicenseRequestImplToJson(
|
||||
'vendor': instance.vendor,
|
||||
'license_type': instance.licenseType,
|
||||
'user_count': instance.userCount,
|
||||
'purchase_date': instance.purchaseDate?.toIso8601String(),
|
||||
'expiry_date': instance.expiryDate?.toIso8601String(),
|
||||
'purchase_date': _dateToJson(instance.purchaseDate),
|
||||
'expiry_date': _dateToJson(instance.expiryDate),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'company_id': instance.companyId,
|
||||
'branch_id': instance.branchId,
|
||||
@@ -50,12 +46,8 @@ _$UpdateLicenseRequestImpl _$$UpdateLicenseRequestImplFromJson(
|
||||
vendor: json['vendor'] as String?,
|
||||
licenseType: json['license_type'] as String?,
|
||||
userCount: (json['user_count'] as num?)?.toInt(),
|
||||
purchaseDate: json['purchase_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['purchase_date'] as String),
|
||||
expiryDate: json['expiry_date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['expiry_date'] as String),
|
||||
purchaseDate: _dateFromJson(json['purchase_date'] as String?),
|
||||
expiryDate: _dateFromJson(json['expiry_date'] as String?),
|
||||
purchasePrice: (json['purchase_price'] as num?)?.toDouble(),
|
||||
remark: json['remark'] as String?,
|
||||
isActive: json['is_active'] as bool?,
|
||||
@@ -69,8 +61,8 @@ Map<String, dynamic> _$$UpdateLicenseRequestImplToJson(
|
||||
'vendor': instance.vendor,
|
||||
'license_type': instance.licenseType,
|
||||
'user_count': instance.userCount,
|
||||
'purchase_date': instance.purchaseDate?.toIso8601String(),
|
||||
'expiry_date': instance.expiryDate?.toIso8601String(),
|
||||
'purchase_date': _dateToJson(instance.purchaseDate),
|
||||
'expiry_date': _dateToJson(instance.expiryDate),
|
||||
'purchase_price': instance.purchasePrice,
|
||||
'remark': instance.remark,
|
||||
'is_active': instance.isActive,
|
||||
|
||||
Reference in New Issue
Block a user