feat(api): test /invoice/send
This commit is contained in:
46
README.md
46
README.md
@@ -63,3 +63,49 @@ curl -X POST -H "Content-Type: application/json" -d '{
|
|||||||
]
|
]
|
||||||
}' http://localhost:8080/invoice
|
}' http://localhost:8080/invoice
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### POST /invoice/send
|
||||||
|
|
||||||
|
Creates a new invoice and sends it by email.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST -H "Content-Type: application/json" -d '{
|
||||||
|
"to": ["john.doe@example.com"],
|
||||||
|
"subject": "Invoice for project lou-taylor/accounting",
|
||||||
|
"body": "Hi John,\n\nPlease find attached the invoice for the project lou-taylor/accounting.\n\nBest regards,\nJane Doe",
|
||||||
|
"invoice": {
|
||||||
|
"debtor": {
|
||||||
|
"name": "John Doe",
|
||||||
|
"Address": {
|
||||||
|
"street": "Musterstrasse",
|
||||||
|
"number": "1",
|
||||||
|
"zipCode": "1234",
|
||||||
|
"place": "Musterstadt",
|
||||||
|
"country": "CH"
|
||||||
|
},
|
||||||
|
"contact": "john.doe@example.com"
|
||||||
|
},
|
||||||
|
"creditor": {
|
||||||
|
"name": "Jane Doe",
|
||||||
|
"Address": {
|
||||||
|
"street": "Beispielweg",
|
||||||
|
"number": "2",
|
||||||
|
"zipCode": "5678",
|
||||||
|
"place": "Beispielhausen",
|
||||||
|
"country": "CH"
|
||||||
|
},
|
||||||
|
"contact": "jane.doe@example.com",
|
||||||
|
"iban": "CH1234567890123456789"
|
||||||
|
},
|
||||||
|
"durationThreshold": "1h",
|
||||||
|
"hourlyRate": 100,
|
||||||
|
"repositories": [
|
||||||
|
"lou-taylor/accounting"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}' http://localhost:8080/invoice/send
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ type sendReq struct {
|
|||||||
To []string `json:"to"`
|
To []string `json:"to"`
|
||||||
Cc []string `json:"cc"`
|
Cc []string `json:"cc"`
|
||||||
Bcc []string `json:"bcc"`
|
Bcc []string `json:"bcc"`
|
||||||
Subject string `json:"subjec"`
|
Subject string `json:"subject"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
Invoice invoiceReq `json:"invoice"`
|
Invoice invoiceReq `json:"invoice"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user