From e25d601f496f41ae2096059216aa2efbe3934a2d Mon Sep 17 00:00:00 2001 From: Arthur Abrantes Date: Thu, 6 May 2021 16:21:13 -0300 Subject: [PATCH] fix: Customer interface (#92) * fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn * fix: add comments to Document's new fields --- src/client/customers/options.ts | 4 ++-- src/client/customers/responses.ts | 12 ++++++++++++ src/common/Document.ts | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/client/customers/options.ts b/src/client/customers/options.ts index 3abfa5b..39cd334 100644 --- a/src/client/customers/options.ts +++ b/src/client/customers/options.ts @@ -17,6 +17,6 @@ export interface CustomerCreateOptions { documents: Document[]; /** Números de telefone. Requer ao menos um valor. Deve seguir o padrão *E.164* */ phone_numbers: string[]; - /** Data de nascimento */ - birthday?: string; + /** Data de nascimento. */ + birthday?: string | null; } diff --git a/src/client/customers/responses.ts b/src/client/customers/responses.ts index 68054e4..8f1f5ff 100644 --- a/src/client/customers/responses.ts +++ b/src/client/customers/responses.ts @@ -2,8 +2,20 @@ import { CustomerCreateOptions } from './options'; import { Address } from '../../common/Address'; export interface Customer extends CustomerCreateOptions { + /** Tipo do objeto */ + object: "customer", /** Identificador do cliente na loja */ id: string; + /** Número do documento. */ + document_number: number | null; + /** Tipo do documento. */ + document_type: 'cpf' | 'cnpj' | 'passaport' | 'other' ; + /** Local de nascimento. */ + born_at: string | null; + /** Gênero */ + gender: string | null; + /** Quando o customer foi criado */ + date_created: string; /** Lista dos telefones relacionados ao cliente */ phones: string[]; /** Lista de endereços relacionados ao cliente */ diff --git a/src/common/Document.ts b/src/common/Document.ts index 339351e..17ec37b 100644 --- a/src/common/Document.ts +++ b/src/common/Document.ts @@ -1,4 +1,8 @@ export interface Document { + /** tipo do objeto */ + object?: "document", + /** id relacionada ao documento */ + id?: "string", /** * Tipo de documento. *