import 'package:json_annotation/json_annotation.dart'; part 'auth_model.g.dart'; @JsonSerializable() class LoginResponse { @JsonKey(name: 'access_token') final String accessToken; @JsonKey(name: 'customer') final CustomerResponse customer; const LoginResponse({required this.accessToken, required this.customer}); factory LoginResponse.fromJson(Map json) => _$LoginResponseFromJson(json); Map toJson() => _$LoginResponseToJson(this); } @JsonSerializable() class CustomerResponse { final String uuid; final String name; final String? email; @JsonKey(name: 'phone_number') final String phoneNumber; const CustomerResponse({ required this.uuid, required this.name, this.email, required this.phoneNumber, }); factory CustomerResponse.fromJson(Map json) => _$CustomerResponseFromJson(json); Map toJson() => _$CustomerResponseToJson(this); } @JsonSerializable() class RegisterRequest { final String name; final String? email; @JsonKey(name: 'phone_number') final String phoneNumber; final String password; const RegisterRequest({ required this.name, this.email, required this.phoneNumber, required this.password, }); factory RegisterRequest.fromJson(Map json) => _$RegisterRequestFromJson(json); Map toJson() => _$RegisterRequestToJson(this); }