Skip to content

Commit

Permalink
[BillingRP] Added rebill details for invoice (#10580)
Browse files Browse the repository at this point in the history
* Added rebill details for invoice

Added rebill details for invoice

* Fixed Prettier Check failures

Fixed Prettier Check failures

* Fixed model validation errors

Fixed model validation errors

* Fixed model validation error

Fixed model validation error

* Added readonly property to document type and rebill details

Added readonly property to document type and rebill details

* Updated examples

Updated examples

* Setting readonly property on rebillDetails

Setting readonly property on rebillDetails

* Fixed prettier-check error

Fixed prettier-check error

Co-authored-by: Anirban Sarkar <[email protected]>
  • Loading branch information
asarkar84 and Anirban Sarkar authored Aug 31, 2020
1 parent 72c897e commit 05465c3
Show file tree
Hide file tree
Showing 9 changed files with 675 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,9 @@
"x-ms-examples": {
"BillingAccountInvoicesList": {
"$ref": "./examples/BillingAccountInvoicesList.json"
},
"BillingAccountInvoicesListWithRebillDetails": {
"$ref": "./examples/BillingAccountInvoicesListWithRebillDetails.json"
}
},
"operationId": "Invoices_ListByBillingAccount",
Expand Down Expand Up @@ -1120,6 +1123,9 @@
"x-ms-examples": {
"InvoicesListByBillingProfile": {
"$ref": "./examples/InvoicesListByBillingProfile.json"
},
"InvoicesListByBillingProfileWithRebillDetails": {
"$ref": "./examples/InvoicesListByBillingProfileWithRebillDetails.json"
}
},
"operationId": "Invoices_ListByBillingProfile",
Expand Down Expand Up @@ -1179,6 +1185,15 @@
"x-ms-examples": {
"Invoice": {
"$ref": "./examples/Invoice.json"
},
"InvoiceWithRebillDetails": {
"$ref": "./examples/InvoiceWithRebillDetails.json"
},
"VoidInvoice": {
"$ref": "./examples/VoidInvoice.json"
},
"CreditNote": {
"$ref": "./examples/CreditNote.json"
}
},
"operationId": "Invoices_Get",
Expand Down Expand Up @@ -4704,7 +4719,8 @@
"enum": [
"Due",
"OverDue",
"Paid"
"Paid",
"Void"
],
"readOnly": true,
"x-ms-enum": {
Expand Down Expand Up @@ -4814,6 +4830,38 @@
"$ref": "#/definitions/PaymentProperties"
}
},
"rebillDetails": {
"description": "Rebill details for an invoice.",
"type": "object",
"readOnly": true,
"additionalProperties": {
"type": "object",
"$ref": "#/definitions/RebillDetails"
}
},
"documentType": {
"description": "The type of the document.",
"type": "string",
"enum": [
"Invoice",
"CreditNote"
],
"readOnly": true,
"x-ms-enum": {
"name": "InvoiceDocumentType",
"modelAsString": true
}
},
"billedDocumentId": {
"description": "The Id of the active invoice which is originally billed after this invoice was voided. This field is applicable to the void invoices only.",
"type": "string",
"readOnly": true
},
"creditForDocumentId": {
"description": "The Id of the invoice which got voided and this credit note was issued as a result. This field is applicable to the credit notes only.",
"type": "string",
"readOnly": true
},
"subscriptionId": {
"description": "The ID of the subscription for which the invoice is generated.",
"type": "string",
Expand Down Expand Up @@ -4861,6 +4909,30 @@
}
}
},
"RebillDetails": {
"description": "The rebill details of an invoice.",
"properties": {
"creditNoteDocumentId": {
"description": "The ID of credit note.",
"type": "string",
"readOnly": true
},
"invoiceDocumentId": {
"description": "The ID of invoice.",
"type": "string",
"readOnly": true
},
"rebillDetails": {
"description": "Rebill details for an invoice.",
"type": "object",
"readOnly": true,
"additionalProperties": {
"type": "object",
"$ref": "#/definitions/RebillDetails"
}
}
}
},
"Document": {
"description": "The properties of a document.",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000",
"billingProfileDisplayName": "Contoso Operations Billing",
"purchaseOrderNumber": "123456",
"documentType": "Invoice",
"documents": [
{
"kind": "Invoice",
Expand Down Expand Up @@ -122,6 +123,7 @@
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000",
"billingProfileDisplayName": "Contoso Operations Billing",
"purchaseOrderNumber": "123456",
"documentType": "Invoice",
"documents": [
{
"kind": "TaxReceipt",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"parameters": {
"api-version": "2020-05-01",
"billingAccountName": "{billingAccountName}",
"periodStartDate": "2018-01-01",
"periodEndDate": "2018-06-30"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000003",
"name": "I000003",
"type": "Microsoft.Billing/billingAccounts/invoices",
"properties": {
"dueDate": "2018-01-16T17:32:28Z",
"invoiceDate": "2018-01-01T17:32:28Z",
"status": "Due",
"amountDue": {
"currency": "USD",
"value": 8.53
},
"billedAmount": {
"currency": "USD",
"value": 33.99
},
"azurePrepaymentApplied": {
"currency": "USD",
"value": 25.46
},
"creditAmount": {
"currency": "USD",
"value": 1.00
},
"freeAzureCreditApplied": {
"currency": "USD",
"value": 0.00
},
"subTotal": {
"currency": "USD",
"value": 33.99
},
"taxAmount": {
"currency": "USD",
"value": 0.00
},
"totalAmount": {
"currency": "USD",
"value": 7.53
},
"invoicePeriodStartDate": "2018-01-01T17:32:28Z",
"invoicePeriodEndDate": "2018-01-15T17:32:28Z",
"isMonthlyInvoice": false,
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000",
"billingProfileDisplayName": "Contoso Operations Billing",
"purchaseOrderNumber": "123456",
"documentType": "Invoice",
"documents": [
{
"kind": "Invoice",
"url": "https://microsoft.com/invoice.pdf",
"source": "DRS"
}
],
"payments": [
{
"date": "2018-01-14T17:32:28Z",
"paymentType": "credited",
"amount": {
"currency": "USD",
"value": 1.00
},
"paymentMethodFamily": "CreditCard",
"paymentMethodType": "visa"
}
],
"rebillDetails": {
"creditNoteDocumentId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/CreditNote2",
"invoiceDocumentId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000002",
"rebillDetails": {
"creditNoteDocumentId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/CreditNote1",
"invoiceDocumentId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000001",
"rebillDetails": null
}
}
}
},
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724",
"name": "1383724",
"type": "Microsoft.Billing/billingAccounts/invoices",
"properties": {
"dueDate": "2018-03-01T17:32:28Z",
"invoiceDate": "2018-02-01T17:32:28Z",
"status": "PastDue",
"amountDue": {
"currency": "USD",
"value": 16.53
},
"billedAmount": {
"currency": "USD",
"value": 33.99
},
"azurePrepaymentApplied": {
"currency": "USD",
"value": 15.46
},
"creditAmount": {
"currency": "USD",
"value": 2.00
},
"freeAzureCreditApplied": {
"currency": "USD",
"value": 0.00
},
"subTotal": {
"currency": "USD",
"value": 33.99
},
"taxAmount": {
"currency": "USD",
"value": 0.00
},
"totalAmount": {
"currency": "USD",
"value": 16.53
},
"invoicePeriodStartDate": "2018-02-01T17:32:28Z",
"invoicePeriodEndDate": "2018-02-28T17:32:28Z",
"isMonthlyInvoice": true,
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000",
"billingProfileDisplayName": "Contoso Operations Billing",
"purchaseOrderNumber": "123456",
"documentType": "Invoice",
"documents": [
{
"kind": "TaxReceipt",
"url": "https://microsoft.com/taxreceipt.pdf",
"source": "DRS"
}
],
"payments": [
{
"date": "2018-01-14T17:32:28Z",
"paymentType": "credited",
"amount": {
"currency": "USD",
"value": 2.00
},
"paymentMethodFamily": "CreditCard",
"paymentMethodType": "visa"
}
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parameters": {
"api-version": "2020-05-01",
"billingAccountName": "{billingAccountName}",
"invoiceName": "{invoiceName}"
},
"responses": {
"200": {
"body": {
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}",
"name": "{invoiceName}",
"type": "Microsoft.Billing/billingAccounts/invoices",
"properties": {
"dueDate": "2018-01-16T17:32:28Z",
"invoiceDate": "2018-01-01T17:32:28Z",
"status": "Paid",
"amountDue": {
"currency": "USD",
"value": 16.53
},
"billedAmount": {
"currency": "USD",
"value": 33.99
},
"azurePrepaymentApplied": {
"currency": "USD",
"value": 15.46
},
"creditAmount": {
"currency": "USD",
"value": 2.00
},
"freeAzureCreditApplied": {
"currency": "USD",
"value": 0.00
},
"subTotal": {
"currency": "USD",
"value": 33.99
},
"taxAmount": {
"currency": "USD",
"value": 0.00
},
"totalAmount": {
"currency": "USD",
"value": 16.53
},
"invoicePeriodStartDate": "2018-01-01T17:32:28Z",
"invoicePeriodEndDate": "2018-01-15T17:32:28Z",
"isMonthlyInvoice": false,
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}",
"billingProfileDisplayName": "Contoso Operations Billing",
"purchaseOrderNumber": "123456",
"documentType": "CreditNote",
"creditForDocumentId": "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000001",
"documents": [
{
"kind": "Invoice",
"url": "https://microsoft.com/invoice.pdf",
"source": "DRS"
},
{
"kind": "TaxReceipt",
"url": "https://microsoft.com/taxDoc.pdf",
"source": "DRS"
}
],
"payments": [
{
"date": "2018-01-14T17:32:28Z",
"paymentType": "credited",
"amount": {
"currency": "USD",
"value": 2.00
},
"paymentMethodFamily": "CreditCard",
"paymentMethodType": "visa"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"responses": {
"200": {
"body": {
"id": "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}",
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}",
"name": "{invoiceName}",
"type": "Microsoft.Billing/billingAccounts/invoices",
"properties": {
Expand Down Expand Up @@ -52,6 +52,7 @@
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}",
"billingProfileDisplayName": "Contoso Operations Billing",
"purchaseOrderNumber": "123456",
"documentType": "Invoice",
"documents": [
{
"kind": "Invoice",
Expand Down
Loading

0 comments on commit 05465c3

Please sign in to comment.