add auth register

This commit is contained in:
Phuoc Nguyen
2025-11-07 15:55:02 +07:00
parent ce7396f729
commit 9e55983d82
16 changed files with 2376 additions and 110 deletions

View 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)';
}
}

View 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)';
}
}