<div style="text-align: center;height: 150px;">
<img
style="height: 150px;"
src="https://res.cloudinary.com/gutierry/image/upload/v1632740045/TIS%20Tech/logoTis.png">
</div>
<br/><br/>
# <div style="text-align: center"><span style="font-size:60px">Documentação</span><br><span style="font-size:60px">AGT Mobile</span></div>
<br/><br/>
18 de Setembro de 2021
<br/>
| Ver. | Data | Resp. |Descrição|
| -------- | -------- | -------- | -------- |
| Ver. 0.01 | 18/09/2021 | Gutierry Antonio | Documentação inicial|
| Ver. 0.02 | 06/10/2021 | Diego Barbosa| Configuração do ambiente|
| Ver. 0.03 | 08/10/2021 | Gutierry Pereira| Detalhamento de rotas|
###### tags: `Documentação SIGT`
<br/><br/>
[TOC]
<br><br/>
# Overview
O SIGT Mobile é uma aplicação do SIGT para o telemóvel, tem como principal objetivo disponibilizar aos contribuintes uma plataforma moderna, simples e rápida de interacção com a Administração Geral Tributária, em qualquer parte do mundo, e assim facilitar o cumprimento das suas obrigações fiscais e demais interações com a AGT.
Sendo uma plataforma de acesso móvel ao SIGT, o SIGT Mobile traduz-se no acesso através de um
telemóvel ou tablet em ambiente android (sendo no futuro escalável a outros), a funcionalidades do SIGT, ou seja, possibilitar que diretamente e em qualquer local e hora, o contribuinte consulte e execute por si só um conjunto de acções relativamente às suas obrigações tributárias.
<br><br/>
# O que é o AGT Mobile
o SIGT Mobile, sistema do SIGT para o telemóvel, tem como principal objetivo disponibilizar aos contribuintes uma plataforma moderna, simples e rápida de interacção com a Administração Geral Tributária, em qualquer parte do mundo, e assim facilitar o cumprimento das suas obrigações fiscais e demais interações com a AGT.
Sendo uma plataforma de acesso móvel ao SIGT, o SIGT Mobile traduz-se no acesso através de um telemóvel ou tablet em ambiente android (sendo no futuro escalável a outros), as funcionalidades do SIGT, ou seja, possibilitar que diretamente e em qualquer local e hora, o contribuinte consulte e execute por si só um conjunto de acções relativamente às suas obrigações tributárias.
A implementação do SIGT Mobile está particularmente alinhada com 4 dos objectivos gerais da AGT para o SIGT, nomeadamente:
* Melhorar a comunicação e interacção com o contribuinte;
* Disponibilizar processos declarativos e pagamentos mais fáceis e mais simples;
* Maior celeridade dos processos fiscais;
* Focar nas actividades de maior valor acrescentado.
Adicionalmente, são também benefícios do SIGT Mobile a promoção de uma imagem de modernidade e eficiência da AGT, reduzir a sobrecarga das Repartições Fiscais nomeadamente em períodos de maior fluxo e facilitar a libertação de recursos internos para tarefas de maior valor acrescentado associadas ao aumento da receita.
O presente documento tem como objectivo especificar o funcionamento do SIGT Mobile. O SIGT Mobile será a ferramenta do SIGT disponível para os contribuintes via smartphone ou tablet
<br><br/>
# Arquitetura
Seu desenvolvimento esta baseado em Xamarin para as intefaces e integrações via REST com servidores Java e PSRM da AGT.
Abaixo **FIG.1** esta apresentado o fluxo de funcioanamento do app de foma macro.
<div style="text-align: center">
<img src="https://res.cloudinary.com/gutierry/image/upload/v1632740373/TIS%20Tech/FluxoAGTMobile.png"/>
</div>
<br>
### Mobile
Aplicação Cross-plataform desenvolvida sobre Xamarin. O mobile é aplicação que será destribuida para os usuários aonde as operações estão descriminadas no documento de Blueprint AGT Mobile
### PSRM
Aplicação resposavél por fornececer dados ao mobile através de integração via API. O PSRM é o modulo responsável por calculo de impostos e rotinas fiscais da AGT
### Portal do contribuinte
Aplicação resposavél entre a interação entre o contribuinte e a AGT. O POrtal do contribuinte é a aplicação aonde o contribuinte acessa para fazer cadastro e consultas referentes aos seus tributos.
## Estrutura de diretórios e subdiretórios
<div style="text-align: center">
<img src="https://res.cloudinary.com/gutierry/image/upload/v1632756483/TIS%20Tech/estruturadiretorios1.png"/>
</div>
<br>
### Controls
Diretório contendo as classes de controles para os formulários
### Helpers
Diretório contendo as classes de ajuda como utils e funções.
### Img
Diretório contendo os assets do sistema, imagens como logo, icones e botões.
### Interfaces
Diretório das interfaces das classes e contratos entre integrações.
### Model
Diretório contendo os mapeamento dos objetos utilizados no sistema.
> Esta pasta representa uma coleção de DTO e não model no conceito de acesso a banco de dados.
### obj
Diretório contendo configurações da aplicação, bem como: configurações de debug e pacotes do nuget
### Render
Diretório contendo classes de renderização de componentes genericos e reutilizados bem como botões, labels entre outros.
### Services
Diretorio contendo as classe para comunicação com o servidor.
### Views
Diretorio contendo todas as classes e representações visuais das telas do sistema.
<br><br/>
# Serviços
## Login
<div style="text-align: center">
<img src="https://res.cloudinary.com/gutierry/image/upload/v1632746471/TIS%20Tech/loginAGTMobile.png"/>
</div>
<br>
## Integração
A integração entre a aplicação mobile e o sistema de forncecimento de serviços do SIGT é feito via barramento com uso do WSO2, conforme diagrama a baixo:
```mermaid
sequenceDiagram
AGT Mobile ->> WSO2: Http Rest
WSO2->>SIGT API: SOAP
WSO2-->>AGT Mobile: Http Rest
SIGT API-->>WSO2: SOAP
```
### WSO2
O WSO2 é um provedor de tecnologia de código aberto fundado em 2005. Ele oferece uma plataforma empresarial para integração de interfaces de programação de aplicativos e serviços da Web localmente e pela Internet.
https://en.wikipedia.org/wiki/WSO2
### Acessos ao WSO2
| Ambiente| URL|Token| Usuário| Senha|
|--|--|--|--|--|
|**PreProd**| https://10.129.106.183:9443/store/|5944b00d-acf0-3eda-885b-a951fffb1727|api_subscriber_agt_mobile|mobile_agt|
|**Prod**|https://10.192.130.10:9443/store/|c88427a3-d079-3aee-86cd-5bf029dd2ffd|api_subscriber_agt_mobile|mobile_agt|
## Endpoints
**Headers**
As requisições abaixo devem ser feitas usando os seguintes parametros no header:
| Parametro | Valor |
| -------- | -------- |
| Authorization | Bearer <Token de acesso a aplicação> |
<br>
### user-portal-api
**API:** https://sigtweb.minfin.gov.ao/sigt-api-user-portal/v1.0.0/
:::success
**POST:** /auth/authenticate
:information_source: Endpoint utilizado para autenticação
<br>
```json
{
"username": "2000000043",
"password": "gfqm8OxcNG"
}
**Request:**
```json
{
"username": "2000000043",
"password": "gfqm8OxcNG"
}
```
**Response:**
```json
{
"code": 200,
"status": "OK",
"result": {
"username": "2000000043",
"password": "$2a$10$GYofqa1ezyqq43cJr9fnyOUvlEEEqQs235LX8BKWtfniBnrZsq64y",
"email": "celso.martins@sigt.co.ao",
"firstName": "MARIA MANGA",
"lastName": null,
"authorities": [{
"name": "ROLE_TAXPAYERS",
"privileges": null,
"authority": "ROLE_TAXPAYERS"
}],
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true
}
}
```
:::
:::success
**GET:** /api/restart/password?nif=<span style="color:red">{valor_nif}</span>
:information_source: Endpoint para resetar a senha de um usuário
recebe como parametro o nif do usuário para que deseja fazer o reset.
<br>
**Response:**
```json
{
"code" : 200,
"status" : "OK",
"result" : {
"cdMsg" : "<Código de retorno da requisição>",
"descMsg" : "<Descrição de retorno da requisição>"
}
}
```
:::
:::success
**GET:** /api/filter/user?nif=<span style="color:red">{valor_nif}</span>
:information_source: Retorna detalhes do contribuinte a partir do NIF
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"user": {
"cdMsg": "<Código do retorno da requisição>",
"descMsg": "<Descrição>",
"idUser": "000001",
"nifUser": "000001",
"nameUser": "Fulano",
"personIdType": "xxx",
"numberDoc": "000.000.00",
"situation": "regular",
"emailPri": "fulano@seuemail.com",
"emailSec": "email2@seuemail.com",
"numberTel": "909 070 001",
"validate": "2021/12/31",
"documentIdentificationUser": null,
"documentNifUser": null,
"nameImagedocumentIdentificationUser": null,
"nameImagedocumentNifUser": null,
"statusUtilizador": "regular",
"blockingJustification": null
},
"listRepresentationResponse": {
"representationType": [{
"nif": "00002",
"nameRepresentation": "fulano de tal",
"representationIdType": "pai/mãe",
"typeDoc": "nif",
"authorities": [{
"authority": "autorização 1"
}],
"imgRepresentacaoLetterRepresentation": null,
"nameImageLetterRepresentation": null,
"imgRepresentacaoNifContribuinte": null,
"nameImageNifContribuinte": null,
"imgRepresentacaoNifRepresentante": null,
"nameImageNifRepresentante": null,
"statusUtilizadorRepresentacao": "status...",
"blockingJustification": null
}]
}
}
}
```
:::
:::success
**GET:** /api/filter/representation?nif=<span style="color:red">{valor_nif}</span>
:information_source: Verifica se o usuário possue representações
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"cdMsg": "<Código referente ao retorno da requisição>",
"descMsg": "<Descrição referente ao retorno da requisição>",
"nif": "00001",
"nameRepresentation": "fulano xpto",
"representationIdType": "pai/mãe/...",
"typeDoc": "nif",
"idUser": "00001"
}
}
```
:::
:::success
**POST:** /api/add/representation
:information_source: Adiciona uma representação
<br>
Request:
```json
{
"blockingJustification": "String",
"channel": "String",
"ficheiroLetterRepresentation": null,
"ficheiroNifRepresentation": ["00001", "000002"],
"ficheiroNifUser": ["user1", "user2"],
"idUser": "String",
"nameImageFicheiroLetterRepresentation": "String",
"nameImageFicheiroNifRepresentation": "String",
"nameImageFicheiroNifUser": "String",
"nameRepresentation": "String",
"nif": "String",
"representationIdType": "String",
"statusRepresentacao": "String",
"typeDoc": "String",
"usrUtilizadorCadastro": "String"
}
```
Response:
```json
{
"code" : 200,
"status" : "OK",
"result" : {
"cdMsg" : "<Código de retorno da requisição>",
"descMsg" : "<Descrição de retorno da requisição>"
}
}
```
:::
:::success
**POST:** /api/add/user
:information_source: Adiciona um usuário
<br>
Request:
```json
{
"blockingJustification": "valor de justificativa",
"channel": "<channel>",
"documentIdentificationUser": null,
"documentNifUser": ["documento_1", "documento_2"],
"emailPri": "fulano@xpto.com",
"emailSec": "fulano2@xpto.com",
"nameImagedocumentIdentificationUser": "imagem_id.png",
"nameImagedocumentNifUser": "imagem_nif.png",
"nameUser": "fulano xpto",
"nif": "00001",
"numberDoc": "00001",
"numberTel": "999 999 999",
"personIdType": "XXX",
"situation": "XXX",
"statusUtilizador": "XXX",
"usrUtilizadorCadastro": "XXX",
"validate": "2050.12.31"
}
```
Response:
```json
{
"code" : 200,
"status" : "OK",
"result" : {
"cdMsg" : "<Código de retorno da requisição>",
"descMsg" : "<Descrição de retorno da requisição>"
}
}
```
:::
### psrm-resource-api
**API:** https://sigtweb.minfin.gov.ao/sigt-api-psrm/1.0.0/api
#### DAR Document
:::success
**GET:** /dar/find/DLI/<span style="color:red">{dli}</span>
:information_source: Consulta de DC
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"paymentDate": "2021.01.01",
"name": "name",
"recipientName": "recipientName",
"provinceName": "provinceName",
"nif": "00001",
"taxOffice": "00001",
"address": "xpto",
"paymentStatusCode": "cd0001",
"paymentStatusDescription": "paymentStatusDescription",
"dlis": [{
"paymentYear": "2021",
"taxCode": "taxCode",
"assessmentType": "assessmentType",
"taxDescription": "taxDescription",
"budgetCode": "budgetCode",
"period": "period",
"liquidationType": "liquidationType",
"paymentType": "paymentType",
"dlinumber": "dlinumber",
"dlivalue": "dlivalue"
}],
"beneficiaryID": "beneficiaryID",
"darnumber": "darnumber",
"darvalue": "darvalue"
}
}
```
:::
:::success
**GET:** /dar/find/DAR/<span style="color:red">{dar}</span>
:information_source: Consulta de DC
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"paymentDate": "2021.01.01",
"name": "name",
"recipientName": "recipientName",
"provinceName": "provinceName",
"nif": "00001",
"taxOffice": "00001",
"address": "xpto",
"paymentStatusCode": "cd0001",
"paymentStatusDescription": "paymentStatusDescription",
"dlis": [{
"paymentYear": "2021",
"taxCode": "taxCode",
"assessmentType": "assessmentType",
"taxDescription": "taxDescription",
"budgetCode": "budgetCode",
"period": "period",
"liquidationType": "liquidationType",
"paymentType": "paymentType",
"dlinumber": "dlinumber",
"dlivalue": "dlivalue"
}],
"beneficiaryID": "beneficiaryID",
"darnumber": "darnumber",
"darvalue": "darvalue"
}
}
```
:::
:::success
**GET:** /dar/searchDLIsUsingDAR/<span style="color:red">{dar}</span>
:information_source: Retorna DLI
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": [
"result-1",
"result-2"
]
}
```
:::
#### Payment
:::success
**GET:** /payment/getFinancialHistorySummary/<span style="color:red">{startDate}</span>/<span style="color:red">{endDate}</span>/<span style="color:red">{accountId}</span>
:information_source: Consulta do histórico de pagamentos
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": [
"result-1",
"result-2"
]
}
```
:::
#### Person
:::success
**GET:** /person/find?personType=ALL&name=null&personIdentifierValue=<span style="color:red">{nº do nif}</span>&identifierType=nif&accountId=null)
:information_source: Retorna os dados do usuário
Request:
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": [
{
"name": "FULANO XPTO",
"legacyNIF": "0000000001",
"personType": "SINGULAR",
"personId": "000000001",
"accountId": "000000001",
"accountInfo": "TIPOSS",
"oldNIFs": null
}
]
}
```
:::
#### Registration Form
:::success
**GET:** /registrationform/find_by_nif?nif=<span style="color:red">{nº do NIF}</span>
:information_source: Retorna os dados completos do usuário a partir de um NIF informado
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"message": "Consulta realizada com sucesso.",
"registrationForm": {
"documentLocator": "XPTO",
"receiveDate": "2021-04-20",
"formStatus": "Publicado",
"systemInformation": null,
"registrationFormType": "NEW",
"registrationDetails": {
"originOfTheRegistration": "NRM",
"motivesForOffRegistrationGroup": null,
"taxpayerLegacyNIF": "0000000001",
"taxpayerNIF": "",
"taxpayerType": "SINGULAR",
"collectiveTaxPayerType": "",
"taxCategory": "",
"comments": "",
"singularSimple": "true",
"singularOwnAccount": "false",
"singularOtherAccount": "false",
"singularPensioner": "false",
"nonResidentInfo": "RESD",
"absentResident": "false",
"exchangeResidence": "",
"cadastroActivitiesCess": "",
"vatRegimeStart": "false",
"vatRegimeEnd": "false",
"regimeII": "",
"irtGroup": ""
},
"nonResidentDetails": {
"establishment": "COM",
"propertyOwner": "false",
"businessRepresentation": "false",
"heritageAutonomous": "false",
"directInvestor": "false",
"indirectInvestor": "false",
"salariedServiceProvider": "false",
"tourist": "false",
"serviceProvider": "false",
"diplomatConsularRep": "false",
"others": "false",
"description": "",
"irtRepName": "",
"irtRepCountry": "",
"irtRepIdNumber": "",
"vatRepName": "",
"vatRepCountry": "",
"vatRepIdNumber": ""
},
"legalRepresentation": {
"legalRepresentationIndicator": "LRFS",
"legalRepresentationNif": "",
"legalRepresentativePerId": "",
"legalRepresentativeAccount": null
},
"singularTaxpayerIdDetails": {
"idType": "PASS",
"idDocumentNumber": "GPXPTO",
"passportCountry": "BR",
"otherTypeDescription": "",
"passportExpiryDate": "2030-03-11",
"emissionDate": ""
},
"singularTaxpayerDetails": {
"firstName": "FULANO",
"middleName": "",
"lastName": "XPTO",
"gender": "M",
"dateOfBirth": "1972-09-03",
"countryOfBirth": "BR",
"country": "BR",
"province": "",
"municipality": "",
"mothersName": "",
"fathersName": "",
"origemCountryNif": ""
},
"otherSingularTaxpayerDetails": {
"civilStatus": "SIN",
"idNumberOfSpouse": "",
"idNumberOfSpousePerId": "",
"numberOfBankIdentifierIBAN": "",
"legalRepresentative": "",
"legalRepresentativePerId": "",
"degreeOfInvalidity": ""
},
"contactInformation": {
"primaryContactType": "MOBILE",
"contactNumber": "999 999 987",
"phoneDetailsGroup": null,
"emailGroup": null,
"countryCode": ""
},
"addressInformation": {
"addressProvince": "LA",
"addressMunicipality": "TALATONA",
"addressCommune": "TALATONA",
"addressNeighbourhood": "TALATONA",
"addressPhysicalAddress": "MORADA DOS REIS",
"addressPlaceOfReference": "ESQUADRA DA POLICIA",
"addressTaxOfficeOfDomicile": "04.20",
"autarchy": "",
"locality": "",
"block": "",
"condominium": "",
"building": "",
"street": null,
"house": "",
"floor": "",
"postalCode": "",
"latitude": "",
"longitude": ""
},
"alternativeAddressInformation": null,
"secondaryAddressInformation": null,
"collectiveTaxpayerIdDetails": null,
"otherCollectiveDetails": null,
"partners": null,
"subsidiaries": null,
"activityData": null,
"ivaInformation": {
"deduction": "false",
"withoutRepayment": "false",
"jointOperations": "false",
"thanksToCaptivateVAT": "false",
"sector": "",
"captivationRate": "",
"makesExports": "",
"makesImports": "",
"regime": "",
"startDate": "",
"renunciaType": "",
"regimeType": "",
"accountingType": "",
"accountingOptions": "",
"accountingLocalization": "",
"confereContalPower": "false",
"nif": "",
"primaryContactType": "",
"countryCode": "",
"contactNumber": "",
"accounterNumber": null,
"opcaNumber": "",
"emailGroup": null,
"activitiesPlacesGroup": null,
"suspensionReason": "",
"nifCessionario": "",
"nifCessionarioName": null,
"dateOfCessation": "",
"vatInfoAdded": "false",
"vatAccount": ""
},
"otherInformation": null,
"institutionalTaxpayerDetails": null,
"attachedDocuments": null,
"activityDataActivities": null,
"otherCollSubsidiaryDetailGroup": null
}
}
}
```
:::
:::success
**GET:** /registrationform/print_proof_registration_pdf/null/LNIF/<span style="color:red">{nº do NIF}</span>
:information_source: Impressão de comprovativo
Retorna o arquivo para donwload
<br>
:::
#### Tax Form
:::success
**POST:** /taxform/add
:information_source: Salvar liquidação
<br>
Request:
```json
{
"amountPayable": {
"busDays": "busDays",
"endDate": "endDate",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"manualCalculation": "manualCalculation",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"province": "province",
"startDate": "startDate",
"taxOffice": "taxOffice",
"taxToPay": "taxToPay",
"taxableRate": "taxableRate",
"taxableValue": "taxableValue",
"totalAmountPayable": "totalAmountPayable"
},
"automaticPosting": "automaticPosting",
"customersRegularization": {
"customerRegularization": [{
"documentDateCurrent": "documentDateCurrent",
"documentDateReported": "documentDateReported",
"documentNumberCurrent": "documentNumberCurrent",
"documentNumberReported": "documentNumberReported",
"documentTypeCurrent": "documentTypeCurrent",
"documentTypeReported": "documentTypeReported",
"invoiceValueCurrent": "invoiceValueCurrent",
"invoiceValueReported": "invoiceValueReported",
"liquidatedVatCurrent": "liquidatedVatCurrent",
"liquidatedVatReported": "liquidatedVatReported",
"nameCurrent": "nameCurrent",
"nameReported": "nameReported",
"nifCurrent": "nifCurrent",
"nifReported": "nifReported",
"orderNumberCurrent": "orderNumberCurrent",
"orderNumberReported": "orderNumberReported",
"refPeriodCurrent": "refPeriodCurrent",
"refPeriodReported": "refPeriodReported",
"targetLineCurrent": "targetLineCurrent",
"targetLineReported": "targetLineReported",
"taxableValueCurrent": "taxableValueCurrent",
"taxableValueReported": "taxableValueReported"
}],
"excpFileURL": "excpFileURL",
"fileName": null,
"filePath": "filePath",
"url": "url"
},
"declarationInfoDP": {
"customerRegAnnexure": "customerRegAnnexure",
"declarationType": "declarationType",
"filingMonth": "filingMonth",
"filingQuarter": "filingQuarter",
"filingYear": "filingYear",
"nif": "nif",
"receiveDate": "receiveDate",
"supplierAnnexure": "supplierAnnexure",
"supplierRegAnnexure": "supplierRegAnnexure",
"transactionExists": "transactionExists",
"vatRegime": "vatRegime"
},
"declarationInfoDRT": {
"filingQuarter": "filingQuarter",
"filingStatus": "filingStatus",
"filingYear": "filingYear",
"nif": "nif",
"receiveDate": "receiveDate",
"taxOffice": "taxOffice"
},
"deliveredDeclarationQuality": {
"deliveredDeclarationQuality": "deliveredDeclarationQuality"
},
"documentLocator": "String",
"fileUpload": {
"exceptionFileURL": "exceptionFileURL",
"fileName": "fileName",
"filePath": "filePath",
"url": "url"
},
"formStatus": "formStatus",
"formType": "formType",
"generalInformation": {
"accountId": "accountId",
"name": "name",
"nif": "nif",
"periodMonth": "periodMonth",
"periodYear": "periodYear",
"personId": "personId",
"taxOffice": "taxOffice"
},
"originOfTaxes": {
"municipality": "municipality",
"province ": "province"
},
"otherRevenues": {
"nameOfInstitution": "nameOfInstitution",
"otherRevenuesNIF": "otherRevenuesNIF"
},
"realEstateIncomeTax": {
"nameDesignationLessee": "nameDesignationLessee",
"propertyNumber": "propertyNumber",
"realEstateIncomeNIF": "v"
},
"receiveDate": "receiveDate",
"suppliersMap": {
"excpFileURL": "excpFileURL",
"fileName": "fileName",
"filePath": "filePath",
"supplierAnnexure": [{
"captiveVatPercent": "captiveVatPercent",
"captiveVatValue": "captiveVatValue",
"deductVatPercent": "deductVatPercent",
"deductVatValue": "deductVatValue",
"documentDate": "documentDate",
"documentNumber": "documentNumber",
"documentType": "documentType",
"invoiceValue": "invoiceValue",
"name": "name",
"nif": "nif",
"orderNumber": "orderNumber",
"targetLine": "targetLine",
"taxableValue": "taxableValue",
"typology": "typology",
"vatPaid": "vatPaid"
}],
"url": "url"
},
"taxDetails": {
"assessmentForm": "assessmentForm",
"assessmentType": "assessmentType",
"busDays": "busDays",
"collection": "collection",
"dueDate": "dueDate",
"endDate": "endDate",
"exemptionReason": "exemptionReason",
"frequency": "frequency",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"issueDate": "issueDate",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"period": "period",
"propertyNumber": "propertyNumber",
"receiveDate": "receiveDate",
"startDate": "startDate",
"taxCategory": "taxCategory",
"taxType": "taxType",
"year": "year"
},
"taxOfficeDescription": "taxOfficeDescription",
"taxpayerAuthentication": {
"accountantAccountNumber": "accountantAccountNumber",
"accountantName": "accountantName",
"accountantNif": "accountantNif",
"accountingDate": "accountingDate",
"declarationDate": "declarationDate",
"declarationLocal": "declarationLocal",
"submissionBy": "submissionBy",
"submissionName": "submissionName",
"submissionNif": "submissionNif"
},
"taxpayerDetails": {
"account": "account",
"isTrnsOfOwnrForDC": "isTrnsOfOwnrForDC",
"name": "name",
"nif": "nif",
"personId": "personId",
"taxOffice": "taxOffice"
},
"totalTaxDetails": {
"amtToPay": "amtToPay",
"futPrdExcCr": "futPrdExcCr",
"prvPrdExcCr": "prvPrdExcCr",
"totTaxDue": "totTaxDue",
"vatSuppDeduction": "vatSuppDeduction"
},
"typeOfDeclaration": {
"declarationType": "declarationType",
"settlementType": "settlementType"
},
"documentAssociated": {
"document": "document"
}
}
```
Response:
```json
{
"documentLocator": "documentLocator",
"exceptions": [{
"fieldReference": "",
"message": ""
}]
}
```
:::
:::success
**GET:** /taxform/cancel/<span style="color:red">{id_document}</span>
:information_source: Cancelar liquidação
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"reverseReason": "reverseReason",
"documentLocator": "documentLocator",
"result": "result"
}
}
```
:::
:::success
**POST:** /taxform/edit
:information_source: Editar liquidação
<br>
Request:
```json
{
"amountPayable": {
"busDays": "busDays",
"endDate": "endDate",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"manualCalculation": "manualCalculation",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"province": "province",
"startDate": "startDate",
"taxOffice": "taxOffice",
"taxToPay": "taxToPay",
"taxableRate": "taxableRate",
"taxableValue": "taxableValue",
"totalAmountPayable": "totalAmountPayable"
},
"automaticPosting": "automaticPosting",
"customersRegularization": {
"customerRegularization": [{
"documentDateCurrent": "documentDateCurrent",
"documentDateReported": "documentDateReported",
"documentNumberCurrent": "documentNumberCurrent",
"documentNumberReported": "documentNumberReported",
"documentTypeCurrent": "documentTypeCurrent",
"documentTypeReported": "documentTypeReported",
"invoiceValueCurrent": "invoiceValueCurrent",
"invoiceValueReported": "invoiceValueReported",
"liquidatedVatCurrent": "liquidatedVatCurrent",
"liquidatedVatReported": "liquidatedVatReported",
"nameCurrent": "nameCurrent",
"nameReported": "nameReported",
"nifCurrent": "nifCurrent",
"nifReported": "nifReported",
"orderNumberCurrent": "orderNumberCurrent",
"orderNumberReported": "orderNumberReported",
"refPeriodCurrent": "refPeriodCurrent",
"refPeriodReported": "refPeriodReported",
"targetLineCurrent": "targetLineCurrent",
"targetLineReported": "targetLineReported",
"taxableValueCurrent": "taxableValueCurrent",
"taxableValueReported": "taxableValueReported"
}],
"excpFileURL": "excpFileURL",
"fileName": null,
"filePath": "filePath",
"url": "url"
},
"declarationInfoDP": {
"customerRegAnnexure": "customerRegAnnexure",
"declarationType": "declarationType",
"filingMonth": "filingMonth",
"filingQuarter": "filingQuarter",
"filingYear": "filingYear",
"nif": "nif",
"receiveDate": "receiveDate",
"supplierAnnexure": "supplierAnnexure",
"supplierRegAnnexure": "supplierRegAnnexure",
"transactionExists": "transactionExists",
"vatRegime": "vatRegime"
},
"declarationInfoDRT": {
"filingQuarter": "filingQuarter",
"filingStatus": "filingStatus",
"filingYear": "filingYear",
"nif": "nif",
"receiveDate": "receiveDate",
"taxOffice": "taxOffice"
},
"deliveredDeclarationQuality": {
"deliveredDeclarationQuality": "deliveredDeclarationQuality"
},
"documentLocator": "String",
"fileUpload": {
"exceptionFileURL": "exceptionFileURL",
"fileName": "fileName",
"filePath": "filePath",
"url": "url"
},
"formStatus": "formStatus",
"formType": "formType",
"generalInformation": {
"accountId": "accountId",
"name": "name",
"nif": "nif",
"periodMonth": "periodMonth",
"periodYear": "periodYear",
"personId": "personId",
"taxOffice": "taxOffice"
},
"originOfTaxes": {
"municipality": "municipality",
"province ": "province"
},
"otherRevenues": {
"nameOfInstitution": "nameOfInstitution",
"otherRevenuesNIF": "otherRevenuesNIF"
},
"realEstateIncomeTax": {
"nameDesignationLessee": "nameDesignationLessee",
"propertyNumber": "propertyNumber",
"realEstateIncomeNIF": "v"
},
"receiveDate": "receiveDate",
"suppliersMap": {
"excpFileURL": "excpFileURL",
"fileName": "fileName",
"filePath": "filePath",
"supplierAnnexure": [{
"captiveVatPercent": "captiveVatPercent",
"captiveVatValue": "captiveVatValue",
"deductVatPercent": "deductVatPercent",
"deductVatValue": "deductVatValue",
"documentDate": "documentDate",
"documentNumber": "documentNumber",
"documentType": "documentType",
"invoiceValue": "invoiceValue",
"name": "name",
"nif": "nif",
"orderNumber": "orderNumber",
"targetLine": "targetLine",
"taxableValue": "taxableValue",
"typology": "typology",
"vatPaid": "vatPaid"
}],
"url": "url"
},
"taxDetails": {
"assessmentForm": "assessmentForm",
"assessmentType": "assessmentType",
"busDays": "busDays",
"collection": "collection",
"dueDate": "dueDate",
"endDate": "endDate",
"exemptionReason": "exemptionReason",
"frequency": "frequency",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"issueDate": "issueDate",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"period": "period",
"propertyNumber": "propertyNumber",
"receiveDate": "receiveDate",
"startDate": "startDate",
"taxCategory": "taxCategory",
"taxType": "taxType",
"year": "year"
},
"taxOfficeDescription": "taxOfficeDescription",
"taxpayerAuthentication": {
"accountantAccountNumber": "accountantAccountNumber",
"accountantName": "accountantName",
"accountantNif": "accountantNif",
"accountingDate": "accountingDate",
"declarationDate": "declarationDate",
"declarationLocal": "declarationLocal",
"submissionBy": "submissionBy",
"submissionName": "submissionName",
"submissionNif": "submissionNif"
},
"taxpayerDetails": {
"account": "account",
"isTrnsOfOwnrForDC": "isTrnsOfOwnrForDC",
"name": "name",
"nif": "nif",
"personId": "personId",
"taxOffice": "taxOffice"
},
"totalTaxDetails": {
"amtToPay": "amtToPay",
"futPrdExcCr": "futPrdExcCr",
"prvPrdExcCr": "prvPrdExcCr",
"totTaxDue": "totTaxDue",
"vatSuppDeduction": "vatSuppDeduction"
},
"typeOfDeclaration": {
"declarationType": "declarationType",
"settlementType": "settlementType"
},
"documentAssociated": {
"document": "document"
}
}
```
Response:
```json
{
"documentLocator": "documentLocator",
"exceptions": [{
"fieldReference": "",
"message": ""
}]
}
```
:::
:::success
**POST:** /taxform/post
:information_source: Gerar DC
<br>
Request:
```json
{
"amountPayable": {
"busDays": "busDays",
"endDate": "endDate",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"manualCalculation": "manualCalculation",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"province": "province",
"startDate": "startDate",
"taxOffice": "taxOffice",
"taxToPay": "taxToPay",
"taxableRate": "taxableRate",
"taxableValue": "taxableValue",
"totalAmountPayable": "totalAmountPayable"
},
"automaticPosting": "automaticPosting",
"customersRegularization": {
"customerRegularization": [{
"documentDateCurrent": "documentDateCurrent",
"documentDateReported": "documentDateReported",
"documentNumberCurrent": "documentNumberCurrent",
"documentNumberReported": "documentNumberReported",
"documentTypeCurrent": "documentTypeCurrent",
"documentTypeReported": "documentTypeReported",
"invoiceValueCurrent": "invoiceValueCurrent",
"invoiceValueReported": "invoiceValueReported",
"liquidatedVatCurrent": "liquidatedVatCurrent",
"liquidatedVatReported": "liquidatedVatReported",
"nameCurrent": "nameCurrent",
"nameReported": "nameReported",
"nifCurrent": "nifCurrent",
"nifReported": "nifReported",
"orderNumberCurrent": "orderNumberCurrent",
"orderNumberReported": "orderNumberReported",
"refPeriodCurrent": "refPeriodCurrent",
"refPeriodReported": "refPeriodReported",
"targetLineCurrent": "targetLineCurrent",
"targetLineReported": "targetLineReported",
"taxableValueCurrent": "taxableValueCurrent",
"taxableValueReported": "taxableValueReported"
}],
"excpFileURL": "excpFileURL",
"fileName": null,
"filePath": "filePath",
"url": "url"
},
"declarationInfoDP": {
"customerRegAnnexure": "customerRegAnnexure",
"declarationType": "declarationType",
"filingMonth": "filingMonth",
"filingQuarter": "filingQuarter",
"filingYear": "filingYear",
"nif": "nif",
"receiveDate": "receiveDate",
"supplierAnnexure": "supplierAnnexure",
"supplierRegAnnexure": "supplierRegAnnexure",
"transactionExists": "transactionExists",
"vatRegime": "vatRegime"
},
"declarationInfoDRT": {
"filingQuarter": "filingQuarter",
"filingStatus": "filingStatus",
"filingYear": "filingYear",
"nif": "nif",
"receiveDate": "receiveDate",
"taxOffice": "taxOffice"
},
"deliveredDeclarationQuality": {
"deliveredDeclarationQuality": "deliveredDeclarationQuality"
},
"documentLocator": "String",
"fileUpload": {
"exceptionFileURL": "exceptionFileURL",
"fileName": "fileName",
"filePath": "filePath",
"url": "url"
},
"formStatus": "formStatus",
"formType": "formType",
"generalInformation": {
"accountId": "accountId",
"name": "name",
"nif": "nif",
"periodMonth": "periodMonth",
"periodYear": "periodYear",
"personId": "personId",
"taxOffice": "taxOffice"
},
"originOfTaxes": {
"municipality": "municipality",
"province ": "province"
},
"otherRevenues": {
"nameOfInstitution": "nameOfInstitution",
"otherRevenuesNIF": "otherRevenuesNIF"
},
"realEstateIncomeTax": {
"nameDesignationLessee": "nameDesignationLessee",
"propertyNumber": "propertyNumber",
"realEstateIncomeNIF": "v"
},
"receiveDate": "receiveDate",
"suppliersMap": {
"excpFileURL": "excpFileURL",
"fileName": "fileName",
"filePath": "filePath",
"supplierAnnexure": [{
"captiveVatPercent": "captiveVatPercent",
"captiveVatValue": "captiveVatValue",
"deductVatPercent": "deductVatPercent",
"deductVatValue": "deductVatValue",
"documentDate": "documentDate",
"documentNumber": "documentNumber",
"documentType": "documentType",
"invoiceValue": "invoiceValue",
"name": "name",
"nif": "nif",
"orderNumber": "orderNumber",
"targetLine": "targetLine",
"taxableValue": "taxableValue",
"typology": "typology",
"vatPaid": "vatPaid"
}],
"url": "url"
},
"taxDetails": {
"assessmentForm": "assessmentForm",
"assessmentType": "assessmentType",
"busDays": "busDays",
"collection": "collection",
"dueDate": "dueDate",
"endDate": "endDate",
"exemptionReason": "exemptionReason",
"frequency": "frequency",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"issueDate": "issueDate",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"period": "period",
"propertyNumber": "propertyNumber",
"receiveDate": "receiveDate",
"startDate": "startDate",
"taxCategory": "taxCategory",
"taxType": "taxType",
"year": "year"
},
"taxOfficeDescription": "taxOfficeDescription",
"taxpayerAuthentication": {
"accountantAccountNumber": "accountantAccountNumber",
"accountantName": "accountantName",
"accountantNif": "accountantNif",
"accountingDate": "accountingDate",
"declarationDate": "declarationDate",
"declarationLocal": "declarationLocal",
"submissionBy": "submissionBy",
"submissionName": "submissionName",
"submissionNif": "submissionNif"
},
"taxpayerDetails": {
"account": "account",
"isTrnsOfOwnrForDC": "isTrnsOfOwnrForDC",
"name": "name",
"nif": "nif",
"personId": "personId",
"taxOffice": "taxOffice"
},
"totalTaxDetails": {
"amtToPay": "amtToPay",
"futPrdExcCr": "futPrdExcCr",
"prvPrdExcCr": "prvPrdExcCr",
"totTaxDue": "totTaxDue",
"vatSuppDeduction": "vatSuppDeduction"
},
"typeOfDeclaration": {
"declarationType": "declarationType",
"settlementType": "settlementType"
},
"documentAssociated": {
"document": "document"
}
}
```
Response:
```json
{
"documentLocator": "documentLocator",
"exceptions": [{
"fieldReference": "",
"message": ""
}]
}
```
:::
:::success
**GET:** /taxform/searchByDates/<span style="color:red">{data-inicial}</span>/<span style="color:red">{data-final}</span>/<span style="color:red">{personalInfo-legacyNIF}</span>/<span style="color:red">{personalInfo-accountId}</span>
:information_source: Consulta liquidação
<br>
Response:
```json
{
"recievedDate": "2021-01-01",
"entityName": "entityName",
"status": "status",
"documentLocator": "documentLocator",
"description": "description",
"amount": "amount",
"taxCode": "taxCode",
"taxpayerLegacyNIF": "taxpayerLegacyNIF",
"paymentStatus": "paymentStatus",
"isVisible": false,
"mostrar": false,
"cor": "Color",
"statusLabe": "statusLabel",
"isVisibleEliminar": false,
"isVisibleImprimir": false
}
```
:::
:::success
**GET:** /taxform/find/<span style="color:red">{documet}</span>/<span style="color:red">{tipoDoc}</span>
:information_source: Carrega liquidação
<br>
Request:
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"formType": "formType",
"documentLocator": "documentLocator",
"receiveDate": "receiveDate",
"taxOfficeDescription": "taxOfficeDescription",
"formStatus": "formStatus",
"taxpayerDetails": {
"account": "account",
"isTrnsOfOwnrForDC": "isTrnsOfOwnrForDC",
"name": "name",
"nif": "nif",
"personId": "personId",
"taxOffice": "taxOffice"
},
"taxDetails": {
"assessmentForm": "assessmentForm",
"assessmentType": "assessmentType",
"busDays": "busDays",
"collection": "collection",
"dueDate": "dueDate",
"endDate": "endDate",
"exemptionReason": "exemptionReason",
"frequency": "frequency",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"issueDate": "issueDate",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"period": "period",
"propertyNumber": "propertyNumber",
"receiveDate": "receiveDate",
"startDate": "startDate",
"taxCategory": "taxCategory",
"taxType": "taxType",
"year": "year"
},
"amountPayable": {
"busDays": "busDays",
"endDate": "endDate",
"interestPayable": "interestPayable",
"interestRate": "interestRate",
"manualCalculation": "manualCalculation",
"manualInterestCalculation": "manualInterestCalculation",
"manualOverride": "manualOverride",
"manualRate": "manualRate",
"penaltiesAmountPayable": "penaltiesAmountPayable",
"penaltiesRate": "penaltiesRate",
"penaltiesType": "penaltiesType",
"penaltyDescription": "penaltyDescription",
"province": "province",
"startDate": "startDate",
"taxOffice": "taxOffice",
"taxToPay": "taxToPay",
"taxableRate": "taxableRate",
"taxableValue": "taxableValue",
"totalAmountPayable": "totalAmountPayable"
},
"realEstateIncomeTax": {
"nameDesignationLessee": "nameDesignationLessee",
"propertyNumber": "propertyNumber",
"realEstateIncomeNIF": "realEstateIncomeNIF"
},
"otherRevenues": {
"nameOfInstitution": "String",
"otherRevenuesNIF": "String"
},
"originOfTaxes": {
"municipality": "municipality ",
"province": "province "
},
"documentAssociated": {
"document": "document"
}
}
}
```
:::
:::success
**GET:** /taxform/print/darPdf/<span style="color:red">{paymentNumber}</span>/<span style="color:red">{dli}</span>
:information_source: Retorna o documento em formato PDF da Dar
<br>
:::
:::success
**GET:** /api/taxpayer_data/address/TAX_OFFICE/<span style="color:red">{provinceCode}</span>/null/null
:information_source: Retorna lista de repartição fiscal da província
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": [
{
"code": "04.10",
"description": "RF GRANDES CONTRIBUINTES"
},
{
"code": "19.01",
"description": "RF CAXITO"
},
{
"code": "19.03",
"description": "RF AMBRIZ"
}
]
}
```
:::
:::success
**GET:** /taxform/print/darPdf/<span style="color:red">{paymentNumber}</span>/<span style="color:red">{dli}</span>
:information_source: Retorna o documento em formato PDF da Dar
<br>
:::
:::success
**GET:** /api/taxpayer_data/address/MUNICIPALITY/<span style="color:red">{provinceCode}</span>/null/null
:information_source: Retorna a lista de províncias
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": [
{
"code": "AMBRIZ",
"description": "AMBRIZ"
},
{
"code": "BULA ATUMBA",
"description": "BULA ATUMBA"
},
{
"code": "DANDE",
"description": "DANDE"
},
{
"code": "DEMBOS",
"description": "DEMBOS"
},
{
"code": "NAMBUANGONGO",
"description": "NAMBUANGONGO"
},
{
"code": "PANGO ALUQUÉM",
"description": "PANGO ALUQUÉM"
}
]
}
```
:::
:::success
**GET:** /taxpayer_data/taxOffice/<span style="color:red">{office-code}</span>
:information_source: Retorna coordenadas geograficas da repartição
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": {
"isValidTaxOffice": "true",
"descr": "RF GRANDES CONTRIBUINTES",
"latitude": "-8.822522",
"longitude": "13.239645",
"taxRegion": null,
"taxRegionDescr": null
}
}
```
:::
:::success
**GET:** /tax/find/<span style="color:red">{tax-code}</span>
:information_source: Retorna tipos de imposto
<br>
Response:
```json
{
"code": 200,
"status": "OK",
"result": [{
"adjustmentType": "adjustmentType",
"description": "description",
"debtCategory": "debtCategory",
"adjustmentTypeCategory": "adjustmentTypeCategory",
"taxType": "String",
"action": null
}
]
}
```
:::
<br><br/>
# Ambiente de desenvolvimento
## Dependências
Para configurar o ambiente Android no Windows é preciso dos seguintes recursos:
* Chocolatey
* Node.js
* JDK
* Yarn
* Android Studio e dependências
## Instalando Chocolatey
Para instalar as libs no Windows, vamos utilizar um gerenciador de pacotes do Windows chamado Chocolatey. Esse gerenciador nos possibilita instalar dependências e ferramentas no sistema com poucos comandos e tudo pelo terminal. Execute o powershell como administrador utilizando a tecla Windows + X ou clicando com o botão direito sobre o botão “Iniciar”:
<div style="text-align: center">
<img src="https://i.imgur.com/RIlSbqj.png"/>
</div>
<br>
Execute o comando abaixo para verificar se você possui permissões para instalar dependências com o terminal:
```shell=
Get-ExecutionPolicy
```
Caso o retorno for “Restricted”, execute o seguinte comando em seu terminal:
```shell=
Set-ExecutionPolicy AllSigned
```
Agora, execute o seguinte comando para instalar o Chocolatey:
```shell=
Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```
Agora, teste se a instalação ocorreu corretamente executando o seguinte comando no seu terminal (nada irá acontecer, mas não deve retornar erros)
```shell=
choco
```
## Instalando o Node.js e JDK
Agora vamos instalar o Node.js e a JDK 8, execute o seguinte comando no seu terminal.
```shell=
choco install -y nodejs-lts openjdk11
```
Agora reinicie o Powershell e execute, um de cada vez, os seguintes comandos para verificar se instalou corretamente, caso não funcione teste pelo Prompt de Comando (cmd):
```shell=
node -v
npm -v
java -version
```
Se todas apresentaram os valores das suas versões, a instalação foi um sucesso.
## Instalando o Yarn
Execute o comando para instalar o Yarn:
```shell=
npm install --global yarn
```
Após a instalação, verifique se ela foi realizada com sucesso com o comando:
```shell=
yarn -v
```
Para que as instalações globais do Yarn funcionem, vamos ter que fazer mais um passo. Execute o comando:
```shell=
yarn global bin
```
> E anote o caminho retornado pois vamos precisar dele nas configurações das variáveis ambiente.
## Android Studio
Antes de iniciarmos a instalçao propriamente dia do Android Studio temos que preparar o ambiente para sua instalação.
### Preparativos para o Android Studio
Crie uma pasta em um local desejado para instalação da SDK (Ex.: C:\Android\Sdk). É muito importante que esse caminho não possua espaços ou caracteres especiais pois irá causar erros.
Anote esse caminho para ser utilizado posteriormente
Agora no iniciar pesquise por “Editar variáveis de ambiente do sistema”:
<div style="text-align: center">
<img src="https://i.imgur.com/GjECD1x.png"/>
</div>
<br>
Na janela que abrir clique na opção “variáveis de ambiente”:
<div style="text-align: center">
<img src="https://i.imgur.com/5DAq3ef.png"/>
</div>
<br>
Nesta janela vai ter 2 opções de variáveis de ambiente, uma para o usuário e outra global. Iremos criar as variáveis na global.
Clique em “Novo“ e indique o nome da variável como ANDROID_HOME e adicione o caminho utilizado acima (Ex.: C:\Android\Sdk) como valor da variável e clique com OK.
<div style="text-align: center">
<img src="https://i.imgur.com/c9GeWoY.png"/>
</div>
<br>
Faça o mesmo processo para criar a variável JAVA_HOME. Mas primeiramente temos que obter o caminho de instalação. O caminho padrão é:
```shell=
C:\Program Files\OpenJDK\openjdk-8.[SUA_VERSÃO]
```
<div style="text-align: center">
<img src="https://i.imgur.com/695hnVo.png"/>
</div>
<br>
Na mesma janela de "Variáveis de ambiente" no Windows, clique na variável PATH e então em "Editar". Haverá uma lista de caminhos e você deve adicionar esses quatro novos caminhos no fim da lista:
```shell=
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools
%ANDROID_HOME%\tools\bin
%ANDROID_HOME%\platform-tools
[SEU_CAMINHO_YARN]
```
Onde o *[SEUCAMINHOYARN]* representa o caminho que você anotou no comando “yarn global bin”
### Instalando o Android Studio
Acesse a página do [Android Studio](https://developer.android.com/studio) e clique no botão **Download Android Studio**. Após baixar, execute o instalador.
A primeira janela que deve aparecer é para escolher o que vai ser instalado. Por padrão, a opção **Android Studio** já vem selecionada. Selecione também a opção **Android Virtual Device** e clique em Next.
<div style="text-align: center">
<img src="https://i.imgur.com/srmusEi.png"/>
</div>
<br>
Na sequência, será perguntado sobre o local de instalação do Android Studio. Pode deixar o caminho padrão e clicar em Next.
Em seguida, será perguntado sobre a pasta no menu Iniciar. Deixe o padrão e clique em Install.
Nessa etapa será realizada instalação. Quando terminar, clique em Next.
Por fim, será apresentada a janela de fim da instalação. Deixe a opção Start Android Studio marcada e clique em Finish.
### Configurando o Android Studio
Com o Android Studio instalado, chegou a hora de fazer a configuração inicial do programa.
A primeira janela a ser apresentada deve ser perguntando sobre a importação de configurações de outro Android Studio. Selecione a opção **Do not import settings** e clique em **OK**.
Em seguida, o Android Studio começará a carregar. Em algum ponto do carregamento, será apresentada uma janela sobre compartilhamento de dados anônimos com a Google. Essa opção é pessoal, escolha o que preferir.
Após o carregamento terminar, deve aparecer uma página de Welcome. Clique em **Next**.
Na sequência, será pedido o tipo de instalação. Escolha a opção **Custom** e clique em **Next**.
Na janela **Select default JDK locatio**n devemos informar o caminho do pacote JDK instalado, o mesmo que informamos na variável **JAVA_HOME**.
Em seguida, será perguntado sobre qual tema será utilizado. Escolha o que preferir e clique em **Next**
Chegamos na etapa mais importante do processo, a instalação da SDK. A janela apresentará algumas opções, marque todas.
<div style="text-align: center">
<img src="https://i.imgur.com/piPykRM.png"/>
</div>
<br>
* A **SDK** é o pacote que vai possibilitar que sua aplicação React Native faça o build. Por padrão, ele instala a última SDK estável;
* O **Intel HAXM** é para melhorar a performance da emulação (Se você for utilizar o Hyper-V ou possuir um processador AMD, não marque essa opção. Siga esse guia ao final da instalação do Android Studio);
* O **Android Virtual Device** vai criar um emulador padrão pronto para execução.
Um fator essencial nessa etapa é o caminho de instalação da SDK. Utilize a pasta que você criou na seção **Preparativos para o Android Studio** (Ex.: C:\Android\Sdk). Não utilize espaços ou caracteres especiais pois causará erros mais para frente e o próprio Android Studio alerta se o seu caminho não está bom.
Se tudo estiver correto, clique em **Next**.
Na sequência, temos uma janela perguntando sobre a quantidade de RAM que será disponibilizada para que o HAXM utilize. Essa etapa não irá aparecer para todos pois nem todo computador é compatível com esse recurso. Deixe o recomendado pelo programa e clique em **Next**.
Em seguida, será apresentada uma janela com um resumo de todas as opções escolhidas até aqui. Verifique se está tudo certo, principalmente os caminhos da SDK e do JDK. Clique em **Finish**.
Por fim, será realizada a instalação das configurações selecionadas. Quando o programa terminar, clique em **Finish**.
Criando um emulador Android
Abra o Android Studio e acesse a opção **AVD Manager** no menu **Tools**.
<div style="text-align: center">
<img src="https://i.imgur.com/fsxuF2X.png"/>
</div>
<br>
Na sequência, será apresentada uma tela com os emuladores instalados. Para criar o seu emulador, selecione a opção **Create Virtual Device** no canto inferior esquerdo.
<div style="text-align: center">
<img src="https://i.imgur.com/uCW9BIQ.png" />
</div>
<br>
Nessa etapa, será perguntado qual Hardware você quer selecionar. Como exemplo, escolhi na aba **Phone** o **Pixel 3a** (perceba que ele e apenas alguns outros tem acesso a Play Store, caso esse seja um fator importante na sua decisão). Após escolher, clique em **Next**.
<div style="text-align: center">
<img src="https://i.imgur.com/ktCZBs2.png" />
</div>
<br>
Em seguida, você deverá escolher a imagem do sistema (API) do emulador a partir de uma das três listas: **Recommended, x86 Imagese Other Images**. Se essa é sua primeira vez, provavelmente nenhuma imagem estará baixada. Clique no link de Download na frente do nome da imagem, aceite as licenças e aguarde a instalação. Como exemplo, escolhi da lista **Recommended** a opção **Pie (API 28)** que é compatível com o Google Play.
<div style="text-align: center">
<img src="https://i.imgur.com/V2w1Ikh.png" />
</div>
<br>
Por fim, será apresentado algumas configurações do seu emulador (Android Virtual Device - AVD). No campo **AVD Name** escolha um nome para o seu emulador e clique em **Finish**.
<div style="text-align: center">
<img src="https://i.imgur.com/BbBKfp4.png" />
</div>
<br>
Agora, o seu emulador deve estar aparecendo na lista.
Com o emulador pronto, basta clicar no botão **Play** e aguardar o AVD iniciar. Esse processo pode demorar, principalmente na primeira execução. Quando ele terminar, deve aparecer um resultado parecido com esse.
<div style="text-align: center">
<img src="https://i.imgur.com/aGDyctx.png" />
</div>
<br>
### Instalação do Visual Studio 2019
Acesso o site do [Visual Studio](https://visualstudio.microsoft.com/pt-br/vs/community/) e clique no botão Baixar o Visual Studio. Após baixar, execute o instalador.
Na primeira janela apenas clique em **continuar**, logo após irá baixar visual studio instaler.
Na janela a seguir iremos marcas as opções **Desenvolvimento para desktop com .NET** e **Desenvolvimento mobile com .NET** e clique em **Instalar**.
<div style="text-align: center">
<img src="https://i.imgur.com/iGZLk6x.png" />
</div>
<br>
Agora é só aguar o termino da instalação do Visual Studio Community 2019.
Abra o projeto AGT Mobile, mas primeiro vamos conferir o pacote NuGet. Acesse o menu **Opções** em **Ferramentas**.
<div style="text-align: center">
<img src="https://i.imgur.com/IPvJpdi.png" />
</div>
<br>
Na janela que abriu pesquise por **NuGet** na barra de pesquisa no canto superior esquerdo e acesse a opção **Origens do Pacote** no menu **Gerenciador de Pacotes do NuGet**. Na direta clique no botão **adicionar** no canto superior esquerdo e informe “nuget.org” no campo **Nome** e “https://api.nuget.org/v3/index.json” no campo **Origem**, conforme imagem abaixo, e depois cliquem em **OK**.
<div style="text-align: center">
<img src="https://i.imgur.com/8kDoyYZ.png" />
</div>
<br>
Agora vamos iniciar o projeto AGT Mobile, no menu superior definir as configurações da compilação do projeto, como debug ou release, Android ou iOS e o emulador a ser utilizado
<div style="text-align: center">
<img src="https://i.imgur.com/Txeyggm.png" />
</div>
<br>
Após escolher as configurações basta clicar no botão play e aguardar a compilação do projeto e inicialização do apk do emulador android, será apresentado a tela de login do AGT Mobile igual a imagem seguir:
<div style="text-align: center">
<img src="https://i.imgur.com/FRaQpRA.png" />
</div>
<br><br/>
# Deploy
O processo é automatizado, onde a partir do push na IDE do Visual Studio, utilizamos o Azure DevOps para fomentar a integração contínua e, controle de versionamento. Pipelines para distribuição contínua, com o App Center, distribuindo as novas versões do app.
<br><br/>

<br/><br/>
|Contas|Usuário|
|--|--|
|https://dev.azure.com/tistechfabrica/AGTmobile|developer@tistech.co.ao|
|https://appcenter.ms/orgs/AGTMobile/applications|developer@tistech.co.ao|