findRutDian method

  1. @override
Future<Map> findRutDian(
  1. String? idToken,
  2. String identificationNumber,
  3. String identificationTypeId
)
override

Implementation

@override
Future<Map> findRutDian(String? idToken, String identificationNumber, String identificationTypeId) async {
  Map response = await apiController.post(idToken, '/api/ubl2.1/rut-rues', {
    "type_document_identification_id": identificationTypeId,
    "identification_number": identificationNumber,
    "rues": true
  });
  if(response['success'] == true) {
    Map data = response['data'] ?? {};
    return Person(
      identificationTypeId: identificationTypeId,
      identificationNumber: data['identification_number']?.toString(),
      dv: data['dv']?.toString(),
      name: data['bussinnes_name'],
      legalRepresentative: data['legal_representative'],
      address: data['address'],
      phone: data['phone'],
      email: data['email'],
      organizationTypeId: data['type_organization_id']?.toString(),
      municipalityId: data['municipality_id']?.toString(),
      state: data['state'],
    ).toMap();
  }
  return response;
}