Skip to content

Commit

Permalink
fix: bulk anticipations (#114)
Browse files Browse the repository at this point in the history
* chore: update main (#98)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

* fix: update TransactionCreateOptionsBase split_rules type (#97)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* fix: update TransactionCreateOptionsBase split_rules type

* fix: update TransactionCreateOptionsBase split_rules type

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

* fix: remove 'opts' argument from cards functions (#95)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* remove 'opts' argument from cards functions

* fix: remove 'opts' argument from cards functions

* fix: remove 'opts' argument from cards functions

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

* fix: change type of customer.id from string to number (#96)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* fix: change type of customer.id from string to number

* fix customer field of TransactionCreateOptionsBase

* fix: change type of customer.id from string to number

* fix customer field of TransactionCreateOptionsBase

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* ci: update ci to trigger in next version

* chore: update master (#100)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

* fix: update TransactionCreateOptionsBase split_rules type (#97)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* fix: update TransactionCreateOptionsBase split_rules type

* fix: update TransactionCreateOptionsBase split_rules type

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

* fix: remove 'opts' argument from cards functions (#95)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* remove 'opts' argument from cards functions

* fix: remove 'opts' argument from cards functions

* fix: remove 'opts' argument from cards functions

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

* fix: change type of customer.id from string to number (#96)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* fix: change type of customer.id from string to number

* fix customer field of TransactionCreateOptionsBase

* fix: change type of customer.id from string to number

* fix customer field of TransactionCreateOptionsBase

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

* chore: update next (#99)

* chore: update main (#98)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

* fix: update TransactionCreateOptionsBase split_rules type (#97)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* fix: update TransactionCreateOptionsBase split_rules type

* fix: update TransactionCreateOptionsBase split_rules type

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

* fix: remove 'opts' argument from cards functions (#95)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* remove 'opts' argument from cards functions

* fix: remove 'opts' argument from cards functions

* fix: remove 'opts' argument from cards functions

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

* fix: change type of customer.id from string to number (#96)

* Update package.json (#93)

* Release Next Version (#94)

* Update package.json

* fix: add comment to external_id field (#91)

* fix: add percentage field to SplitRuleArg and add comments (#90)

* fix: Customer interface (#92)

* fix: add missing fields to Customer and fix birthday in CustomerCreateOptiosn

* fix: add comments to Document's new fields

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* fix: change type of customer.id from string to number

* fix customer field of TransactionCreateOptionsBase

* fix: change type of customer.id from string to number

* fix customer field of TransactionCreateOptionsBase

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* ci: update ci to trigger in next version

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* chore: update package.json

Co-authored-by: Arthur Abrantes <aabrantes@college.harvard.edu>

* fix: create BulkAnticipationsCreateOptions and BulkAnticipation interfaces

* fix: bulkAnticipations.create's return type

* fix: recipientId property

* fix: write interfaces for bulkAnticipations.confirm method

Co-authored-by: Jonathan Célio <jonathan.clio@hotmail.com>
Co-authored-by: arthur_abrantes <arthur@venni.app>
  • Loading branch information
3 people authored Jul 6, 2021
1 parent 0625d92 commit a832f20
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/client/bulkAnticipations/namespace.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import {BulkAnticipationsConfirmOptions, BulkAnticipationsCreateOptions} from "./options";
import {BulkAnticipation} from "./responses";

declare module 'pagarme' {
export namespace client {
export namespace bulkAnticipations {
function all(opts: any, body: any): any;

function cancel(opts: any, body: any): any;

function confirm(opts: any, body: any): any;
function confirm(opts: BulkAnticipationsConfirmOptions): Promise<BulkAnticipation>;

function create(opts: any, body: any): any;
function create(opts: BulkAnticipationsCreateOptions): Promise<BulkAnticipation>;

function days(opts: any, body: any): any;

Expand Down
21 changes: 21 additions & 0 deletions src/client/bulkAnticipations/options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export interface BulkAnticipationsCreateOptions {
/** ID do recebedor para o qual criar a antecipação */
recipientId: string;
/** Data que você deseja receber a antecipação em sua conta Pagar.me */
payment_date: string;
/** Define o período de onde os recebíveis serão escolhidos. start define recebíveis próximos, perto de serem pagos, e end define recebíveis longes, no final de todos recebíveis que você possui para receber */
timeframe: "start" | "end";
/** Valor líquido, em centavos, que você deseja receber de antecipação */
requested_amount: number;
/** Define se a antecipação deve retornar status 'building' */
build?: boolean;
/** Define se o valor da antecipação será transferido automaticamente para a conta bancária do recebedor */
automatic_transfer?: boolean;
}

export interface BulkAnticipationsConfirmOptions {
/** ID de recebedor desejado */
recipientId: string;
/** ID da antecipação desejada */
id: string;
}
18 changes: 18 additions & 0 deletions src/client/bulkAnticipations/responses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export interface BulkAnticipation {
/** Nome do tipo do objeto criado/modificado */
object: "bulk_anticipation";
/** Status atual da antecipação */
status: "building" | "pending" | "approved" | "refused" | "canceled";
/** período do qual os recebíveis irão vir, */
timeframe: "start" | "end";
/** Data de pagamento da antecipação. */
payment_date: string;
/** valor bruto, em centavos, da antecipação criada. */
amount: number;
/** Taxa de adquirência relacionada aos recebíveis antecipados. */
fee: number;
/** Taxa de antecipação relacionada aos recebíveis antecipados. */
anticipation_fee: number;
/** Identificador da antecipação */
id: string;
}

0 comments on commit a832f20

Please sign in to comment.