Skip to content

Commit

Permalink
fix: Customer interface (#92)
Browse files Browse the repository at this point in the history
* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields
  • Loading branch information
Arthur Abrantes authored May 6, 2021
1 parent 4f387c4 commit e25d601
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/customers/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
12 changes: 12 additions & 0 deletions src/client/customers/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 4 additions & 0 deletions src/common/Document.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export interface Document {
/** tipo do objeto */
object?: "document",
/** id relacionada ao documento */
id?: "string",
/**
* Tipo de documento.
*
Expand Down

0 comments on commit e25d601

Please sign in to comment.