add auth register
This commit is contained in:
60
lib/features/auth/domain/entities/city.dart
Normal file
60
lib/features/auth/domain/entities/city.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
/// Domain Entity: City
|
||||
///
|
||||
/// Represents a city/province for address selection.
|
||||
library;
|
||||
|
||||
/// City Entity
|
||||
class City {
|
||||
/// Unique city identifier
|
||||
final String name;
|
||||
|
||||
/// City code (e.g., "01", "02")
|
||||
final String code;
|
||||
|
||||
/// Display name
|
||||
final String cityName;
|
||||
|
||||
const City({
|
||||
required this.name,
|
||||
required this.code,
|
||||
required this.cityName,
|
||||
});
|
||||
|
||||
/// Create from JSON map
|
||||
factory City.fromJson(Map<String, dynamic> json) {
|
||||
return City(
|
||||
name: json['name'] as String,
|
||||
code: json['code'] as String,
|
||||
cityName: json['city_name'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
/// Convert to JSON map
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'name': name,
|
||||
'code': code,
|
||||
'city_name': cityName,
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is City &&
|
||||
other.name == name &&
|
||||
other.code == code &&
|
||||
other.cityName == cityName;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return Object.hash(name, code, cityName);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'City(name: $name, code: $code, cityName: $cityName)';
|
||||
}
|
||||
}
|
||||
60
lib/features/auth/domain/entities/customer_group.dart
Normal file
60
lib/features/auth/domain/entities/customer_group.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
/// Domain Entity: Customer Group (Role)
|
||||
///
|
||||
/// Represents a customer group/role for user registration.
|
||||
library;
|
||||
|
||||
/// Customer Group Entity
|
||||
class CustomerGroup {
|
||||
/// Unique identifier
|
||||
final String name;
|
||||
|
||||
/// Display name
|
||||
final String customerGroupName;
|
||||
|
||||
/// Group value/code
|
||||
final String? value;
|
||||
|
||||
const CustomerGroup({
|
||||
required this.name,
|
||||
required this.customerGroupName,
|
||||
this.value,
|
||||
});
|
||||
|
||||
/// Create from JSON map
|
||||
factory CustomerGroup.fromJson(Map<String, dynamic> json) {
|
||||
return CustomerGroup(
|
||||
name: json['name'] as String,
|
||||
customerGroupName: json['customer_group_name'] as String,
|
||||
value: json['value'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
/// Convert to JSON map
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'name': name,
|
||||
'customer_group_name': customerGroupName,
|
||||
if (value != null) 'value': value,
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is CustomerGroup &&
|
||||
other.name == name &&
|
||||
other.customerGroupName == customerGroupName &&
|
||||
other.value == value;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return Object.hash(name, customerGroupName, value);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CustomerGroup(name: $name, customerGroupName: $customerGroupName, value: $value)';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user