Skip to content

Commit

Permalink
Merge pull request #114 from nginformatica/fix/importer-tests
Browse files Browse the repository at this point in the history
Fix/importer tests
  • Loading branch information
danielamarioti authored Jul 25, 2024
2 parents 6267150 + 9a08896 commit e1c5425
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 13 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "quirons-broker",
"version": "0.0.1-alpha.129",
"version": "0.0.1-alpha.130",
"description": "A small library to expose the broker types",
"main": "index.ts",
"typings": "index.d.ts",
"types": "index.d.ts",
"typescript": {
Expand Down
4 changes: 2 additions & 2 deletions src/ttalk/schemas/Accredited.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export const AccreditedInfo = t.intersection([
erpId: t.string,
/** Nome do Credenciado */
name: t.string,
/** CNPJ do Credenciado */
documentNumber: t.string,
/** Data de Início do Contrato */
contractStart: datetime
}),
t.partial({
/** Exames */
exams: t.array(ExamInfo),
/** CNPJ do Credenciado */
documentNumber: t.string,
})
])
export type AccreditedInfo = t.TypeOf<typeof AccreditedInfo>
Expand Down
2 changes: 1 addition & 1 deletion src/ttalk/schemas/ClinicalQuiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ClinicalQuizInfo = t.intersection([
realizationDate: datetime,
/** Descrição do Questionário */
quiz: t.string,
/** Tipo de Deficiência */
/** Respostas */
response: t.array(Response),
}),
t.partial({
Expand Down
21 changes: 17 additions & 4 deletions src/ttalk/schemas/MedicalConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ export const MedicalConsultationInfo = t.intersection([
/** Matricula */
employeeId: t.string,
/** Natureza do ASO */
type: t.string,
type: t.union([
t.literal(0),
t.literal(1),
t.literal(2),
t.literal(3),
t.literal(4),
t.literal(5),
]),
/** Data Prevista da Consulta */
expectedDate: datetime,
/** Nome do Médico */
Expand All @@ -53,16 +60,20 @@ export const MedicalConsultationInfo = t.intersection([
crm: t.string,
/** Estado do CRM */
state: t.string,
/** Motivo da Consulta */
reason: t.string,
}),
t.partial({
/** ID interno */
id: t.string,
/** Data de Cancelamento */
cancelDate: datetime,
/** Data de Emissão */
issueDate: datetime,
/** Parecer do ASO */
situation: t.string,
situation: t.union([
t.literal(0),
t.literal(1),
t.literal(2),
]),
/** Observações */
observation: t.string,
/** Lista de Exames */
Expand All @@ -71,6 +82,8 @@ export const MedicalConsultationInfo = t.intersection([
erpId: t.string,
/** Credenciado */
accredited: t.string,
/** Motivo da Consulta */
reason: t.string
})
])
export type MedicalConsultationInfo = t.TypeOf<typeof MedicalConsultationInfo>
Expand Down
15 changes: 12 additions & 3 deletions src/ttalk/schemas/Occupation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@
import * as t from 'io-ts'
import { Paging } from '../apis/types/totvsApiTypesBase'

const Periodicity = t.type({
description: t.string,
const Periodicity = t.intersection([
t.type({
gender: t.union([
t.literal(1),
t.literal(2),
t.literal(3),
]),
fromAge: t.number,
toAge: t.number,
periodicity: t.number,
postAdmission: t.number,
})
}),
t.partial({
description: t.string,
})
])

const Exam = t.intersection([
t.type({
Expand Down
2 changes: 1 addition & 1 deletion src/ttalk/schemas/Quiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const QuizInfo = t.intersection([
erpId: t.string,
/** Descrição */
description: t.string,
/** Tipo de Deficiência */
/** Grupo da questão */
questionsGroup: t.array(Group),
}),
t.partial({
Expand Down

0 comments on commit e1c5425

Please sign in to comment.