Skip to content

Commit c9128e2

Browse files
axshaniilyamerman
andauthored
new transactions (#84)
* new transactions and tags are optional * update tags and few new attributes Co-authored-by: Ilya Merman <[email protected]>
1 parent 8acfb2d commit c9128e2

File tree

1 file changed

+198
-27
lines changed

1 file changed

+198
-27
lines changed

types/transactions.ts

Lines changed: 198 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Address, Coordinates, Counterparty, Relationship } from "./common"
22

33
export type Transaction = OriginatedAchTransaction | ReceivedAchTransaction | ReturnedAchTransaction | ReturnedReceivedAchTransaction | DishonoredAchTransaction |
44
BookTransaction | PurchaseTransaction | AtmTransaction | FeeTransaction | CardReversalTransaction | CardTransaction | WireTransaction |
5-
ReleaseTransaction | AdjustmentTransaction | InterestTransaction | DisputeTransaction
5+
ReleaseTransaction | AdjustmentTransaction | InterestTransaction | DisputeTransaction | CheckDepositTransaction | ReturnedCheckDepositTransaction
66

77
export interface OriginatedAchTransaction {
88
/**
@@ -59,7 +59,7 @@ export interface OriginatedAchTransaction {
5959
* See [Tags](https://developers.unit.co/#tags).
6060
* Inherited from the payment tags (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
6161
*/
62-
tags: object
62+
tags?: object
6363
}
6464

6565
/**
@@ -158,7 +158,7 @@ export interface ReceivedAchTransaction {
158158
* See [Tags](https://developers.unit.co/#tags).
159159
* Inherited from the payment tags (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
160160
*/
161-
tags: object
161+
tags?: object
162162
}
163163

164164
/**
@@ -242,7 +242,7 @@ export interface ReturnedAchTransaction {
242242
* See [Tags](https://developers.unit.co/#tags).
243243
* Inherited from the payment tags (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
244244
*/
245-
tags: object
245+
tags?: object
246246
}
247247

248248
/**
@@ -321,7 +321,7 @@ export interface ReturnedReceivedAchTransaction {
321321
* See [Tags](https://developers.unit.co/#tags).
322322
* Inherited from the payment tags (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
323323
*/
324-
tags: object
324+
tags?: object
325325
}
326326

327327
/**
@@ -420,7 +420,7 @@ export interface DishonoredAchTransaction {
420420
* See [Tags](https://developers.unit.co/#tags).
421421
* Inherited from the payment tags (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
422422
*/
423-
tags: object
423+
tags?: object
424424
}
425425

426426
/**
@@ -481,9 +481,10 @@ export interface BookTransaction {
481481
counterparty: Counterparty
482482

483483
/**
484-
* The ACH Trace Number.
485-
*/
486-
traceNumber: number
484+
* See [Tags](https://developers.unit.co/#tags).
485+
* Inherited from the payment tags (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
486+
*/
487+
tags?: object
487488
}
488489

489490
/**
@@ -496,9 +497,14 @@ export interface BookTransaction {
496497
account: Relationship
497498

498499
/**
499-
* The customer the deposit account belongs to. The customer is either a business or a individual.
500+
* The Customer the deposit account belongs to. This relationship is only available if the account belongs to a single customer, business or individual.
500501
*/
501-
customer: Relationship
502+
customer?: Relationship
503+
504+
/**
505+
* The list of Customers the deposit account belongs to. This relationship is only available if the account belongs to multiple individual customers.
506+
*/
507+
customers?: Relationship[]
502508

503509
/**
504510
* The account of the counterparty.
@@ -509,13 +515,12 @@ export interface BookTransaction {
509515
* The counterparty customer.
510516
*/
511517
counterpartyCustomer: Relationship
512-
}
513518

514-
/**
515-
* See [Tags](https://developers.unit.co/#tags).
516-
* Inherited from the payment tags (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
517-
*/
518-
tags: object
519+
/**
520+
* The payment belonging to this transaction
521+
*/
522+
payment: Relationship
523+
}
519524
}
520525

521526
export interface PurchaseTransaction {
@@ -599,10 +604,25 @@ export interface PurchaseTransaction {
599604
*/
600605
recurring: boolean
601606

607+
/**
608+
* Optional. The interchange share for this transaction. Calculated at the end of each day, see the transaction.updated event.
609+
*/
610+
interchange?: number
611+
612+
/**
613+
* Indicates whether the transaction was created over an electronic network (primarily the internet).
614+
*/
615+
ecommerce: boolean
616+
617+
/**
618+
* Indicates whether the card was present when the transaction was created.
619+
*/
620+
cardPresent: boolean
621+
602622
/**
603623
* See [Tags](https://developers.unit.co/#tags).
604624
*/
605-
tags: object
625+
tags?: object
606626
}
607627

608628
/**
@@ -695,7 +715,7 @@ export interface AtmTransaction {
695715
/**
696716
* See [Tags](https://developers.unit.co/#tags).
697717
*/
698-
tags: object
718+
tags?: object
699719
}
700720

701721
/**
@@ -763,7 +783,7 @@ export interface FeeTransaction {
763783
/**
764784
* See [Tags](https://developers.unit.co/#tags).
765785
*/
766-
tags: object
786+
tags?: object
767787
}
768788

769789
/**
@@ -836,7 +856,7 @@ export interface CardReversalTransaction {
836856
/**
837857
* See [Tags](https://developers.unit.co/#tags).
838858
*/
839-
tags: object
859+
tags?: object
840860
}
841861

842862
/**
@@ -909,7 +929,7 @@ export interface CardTransaction {
909929
/**
910930
* See [Tags](https://developers.unit.co/#tags).
911931
*/
912-
tags: object
932+
tags?: object
913933
}
914934

915935
/**
@@ -992,7 +1012,7 @@ export interface WireTransaction {
9921012
/**
9931013
* See [Tags](https://developers.unit.co/#tags).
9941014
*/
995-
tags: object
1015+
tags?: object
9961016
}
9971017

9981018
/**
@@ -1079,7 +1099,7 @@ export interface ReleaseTransaction {
10791099
/**
10801100
* See [Tags](https://developers.unit.co/#tags).
10811101
*/
1082-
tags: object
1102+
tags?: object
10831103
}
10841104

10851105
/**
@@ -1142,7 +1162,7 @@ export interface AdjustmentTransaction {
11421162
/**
11431163
* See [Tags](https://developers.unit.co/#tags).
11441164
*/
1145-
tags: object
1165+
tags?: object
11461166
}
11471167

11481168
/**
@@ -1200,7 +1220,7 @@ export interface InterestTransaction {
12001220
/**
12011221
* See [Tags](https://developers.unit.co/#tags).
12021222
*/
1203-
tags: object
1223+
tags?: object
12041224
}
12051225

12061226
/**
@@ -1268,7 +1288,7 @@ export interface DisputeTransaction {
12681288
/**
12691289
* See [Tags](https://developers.unit.co/#tags).
12701290
*/
1271-
tags: object
1291+
tags?: object
12721292
}
12731293

12741294
/**
@@ -1285,4 +1305,155 @@ export interface DisputeTransaction {
12851305
*/
12861306
customer: Relationship
12871307
}
1308+
}
1309+
1310+
export interface CheckDepositTransaction {
1311+
/**
1312+
* Identifier of the transaction resource.
1313+
*/
1314+
id: string
1315+
1316+
/**
1317+
* Type of the transaction resource. The value is always checkDepositTransaction.
1318+
*/
1319+
type: "checkDepositTransaction"
1320+
1321+
/**
1322+
* JSON object representing the transaction data.
1323+
*/
1324+
attributes: {
1325+
/**
1326+
* Date only. The date the resource was created.
1327+
* RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs
1328+
*/
1329+
createdAt: string
1330+
1331+
/**
1332+
* The direction in which the funds flow. Common to all transaction types.
1333+
*/
1334+
direction: "Credit" | "Debit"
1335+
1336+
/**
1337+
* The amount (cents) of the transaction. Common to all transaction types.
1338+
*/
1339+
amount: number
1340+
1341+
/**
1342+
* The account balance (cents) after the transaction. Common to all transaction types.
1343+
*/
1344+
balance: number
1345+
1346+
/**
1347+
* Summary of the transaction. Common to all transaction types.
1348+
*/
1349+
summary: string
1350+
1351+
/**
1352+
* See [Tags](https://developers.unit.co/#tags).
1353+
*/
1354+
tags?: object
1355+
}
1356+
1357+
/**
1358+
* Describes relationships between the transaction resource and other resources (account, customer, checkDeposi).
1359+
*/
1360+
relationships: {
1361+
/**
1362+
* The Deposit Account of the customer.
1363+
*/
1364+
account: Relationship
1365+
1366+
/**
1367+
* The Customer the deposit account belongs to. This relationship is only available if the account belongs to a single customer, business or individual.
1368+
*/
1369+
customer?: Relationship
1370+
1371+
/**
1372+
* The list of Customers the deposit account belongs to. This relationship is only available if the account belongs to multiple individual customers.
1373+
*/
1374+
customers?: Relationship[]
1375+
1376+
/**
1377+
* The Check Deposit the transaction is related to.
1378+
*/
1379+
checkDeposit: Relationship
1380+
}
1381+
}
1382+
1383+
export interface ReturnedCheckDepositTransaction {
1384+
/**
1385+
* Identifier of the transaction resource.
1386+
*/
1387+
id: string
1388+
1389+
/**
1390+
* Type of the transaction resource. The value is always returnedCheckDepositTransaction.
1391+
*/
1392+
type: "returnedCheckDepositTransaction"
1393+
1394+
/**
1395+
* JSON object representing the transaction data.
1396+
*/
1397+
attributes: {
1398+
/**
1399+
* Date only. The date the resource was created.
1400+
* RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs
1401+
*/
1402+
createdAt: string
1403+
1404+
/**
1405+
* The direction in which the funds flow. Common to all transaction types.
1406+
*/
1407+
direction: "Credit" | "Debit"
1408+
1409+
/**
1410+
* The amount (cents) of the transaction. Common to all transaction types.
1411+
*/
1412+
amount: number
1413+
1414+
/**
1415+
* The account balance (cents) after the transaction. Common to all transaction types.
1416+
*/
1417+
balance: number
1418+
1419+
/**
1420+
* Summary of the transaction. Common to all transaction types.
1421+
*/
1422+
summary: string
1423+
1424+
/**
1425+
* The reason for the transaction return.
1426+
*/
1427+
reason: string
1428+
1429+
/**
1430+
* See [Tags](https://developers.unit.co/#tags).
1431+
*/
1432+
tags?: object
1433+
}
1434+
1435+
/**
1436+
* Describes relationships between the transaction resource and other resources (account, customer, checkDeposi).
1437+
*/
1438+
relationships: {
1439+
/**
1440+
* The Deposit Account of the customer.
1441+
*/
1442+
account: Relationship
1443+
1444+
/**
1445+
* The Customer the deposit account belongs to. This relationship is only available if the account belongs to a single customer, business or individual.
1446+
*/
1447+
customer?: Relationship
1448+
1449+
/**
1450+
* The list of Customers the deposit account belongs to. This relationship is only available if the account belongs to multiple individual customers.
1451+
*/
1452+
customers?: Relationship[]
1453+
1454+
/**
1455+
* The Check Deposit the transaction is related to.
1456+
*/
1457+
checkDeposit: Relationship
1458+
}
12881459
}

0 commit comments

Comments
 (0)