update api docs

This commit is contained in:
John Woodlock
2012-05-29 19:21:45 +10:00
parent 2254257320
commit e3dbf561d4
2 changed files with 63 additions and 86 deletions
+46 -49
View File
@@ -2082,7 +2082,7 @@ Request Body:
{ {
"name": "Example New Branch", "name": "Example New Branch",
"dateFormat": "dd MMMM yyyy", "dateFormat": "dd MMMM yyyy",
"openingDateFormatted": "01 July 2007", "openingDate": "01 July 2007",
"parentId": 2 "parentId": 2
} }
</code> </code>
@@ -2097,15 +2097,9 @@ Request Body:
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
<h4>Update Office</h4> <h4>Update Office</h4>
<p>Update office details.</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/offices/1">
https://localhost:8443/mifosng-provider/api/v1/offices/1
</a>
</p>
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">PUT https://thedomainname/api/v1/offices/1</code> <code class="method-declaration">PUT https://thedomainname/api/v1/offices/{officeId}</code>
<code class="method-request">PUT https://localhost:8443/mifosng-provider/api/v1/offices/1 <code class="method-request">PUT https://localhost:8443/mifosng-provider/api/v1/offices/1
Content-Type: application/json Content-Type: application/json
Request Body: Request Body:
@@ -2184,43 +2178,43 @@ Request Body:
"lastModifedOn" : 1334232874000 "lastModifedOn" : 1334232874000
}, { }, {
"id" : 2, "id" : 2,
"name" : "curr loan", "name" : "Brunei Loan",
"description" : "asdff", "description" : null,
"principalMoney" : { "principalMoney" : {
"currencyCode" : "ETB", "currencyCode" : "BND",
"currencyDigitsAfterDecimal" : 2, "currencyDigitsAfterDecimal" : 2,
"amount" : 100000.00, "amount" : 76000.00,
"defaultName" : "Ethiopian Birr", "defaultName" : "Brunei Dollar",
"nameCode" : "currency.ETB", "nameCode" : "currency.BND",
"displaySymbol" : null, "displaySymbol" : "BND",
"zero" : false, "zero" : false,
"greaterThanZero" : true, "greaterThanZero" : true,
"displaySymbolValue" : "100000.00 null" "displaySymbolValue" : "76000.00 BND"
}, },
"interestRatePerPeriod" : 0.000000, "interestRatePerPeriod" : 6.000000,
"interestRatePeriod" : 2, "interestRatePeriod" : 2,
"annualInterestRate" : 0.000000, "annualInterestRate" : 72.000000,
"interestMethod" : 0, "interestMethod" : 0,
"interestRateCalculatedInPeriod" : 1, "interestRateCalculatedInPeriod" : 1,
"numberOfInterestFreePeriods" : 0, "numberOfInterestFreePeriods" : 0,
"repaidEvery" : 1, "repaidEvery" : 1,
"repaymentPeriodFrequency" : 2, "repaymentPeriodFrequency" : 1,
"numberOfRepayments" : 5, "numberOfRepayments" : 10,
"amortizationMethod" : 1, "amortizationMethod" : 1,
"inArrearsTolerance" : { "inArrearsTolerance" : {
"currencyCode" : "ETB", "currencyCode" : "BND",
"currencyDigitsAfterDecimal" : 2, "currencyDigitsAfterDecimal" : 2,
"amount" : 0.00, "amount" : 50.00,
"defaultName" : "Ethiopian Birr", "defaultName" : "Brunei Dollar",
"nameCode" : "currency.ETB", "nameCode" : "currency.BND",
"displaySymbol" : null, "displaySymbol" : "BND",
"zero" : true, "zero" : false,
"greaterThanZero" : false, "greaterThanZero" : true,
"displaySymbolValue" : "0.00 null" "displaySymbolValue" : "50.00 BND"
}, },
"createdOn" : 1334475938000, "createdOn" : 1334513601000,
"lastModifedOn" : 1334475938000 "lastModifedOn" : 1334513601000
} ] }... ]
</code> </code>
</div> </div>
</div> </div>
@@ -2410,28 +2404,29 @@ Request Body:
<br> <br>
<div id=loanproducts_mandatory></div> <div id=loanproducts_mandatory></div>
<br> <br>
<p>Probably need to describe some of the fields here.</p>
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">POST https://thedomainname/api/v1/loanproducts</code> <code class="method-declaration">POST https://thedomainname/api/v1/loanproducts</code>
<code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts <code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts
Content-Type: application/json Content-Type: application/json
Request Body:{ Request Body:
"name": "Newish kind of Loan", {
"description": "A description not exceeding 500 characters.", "name": "A new loan product for me",
"externalId": "1077", "description": "A description not exceeding 500 characters.",
"locale": "en-us", "currencyCode": "USD",
"currencyCode": "XOF", "digitsAfterDecimal": "2",
"digitsAfterDecimal": 0, "locale": "en_GB",
"principalFormatted": "100,000", "principal": "100,000.00",
"inArrearsToleranceAmountFormatted": "1,000", "inArrearsTolerance": "1,000.00",
"repaymentEvery": 1, "numberOfRepayments": "12",
"repaymentFrequency": 2, "repaymentEvery": "1",
"numberOfRepayments": 1, "repaymentFrequencyType": 2,
"interestRatePerPeriodFormatted": "1.75", "interestRatePerPeriod": "1.75",
"interestRateFrequencyMethod": 2, "interestRateFrequencyType": 2,
"amortizationMethod": 1, "amortizationType": 1,
"interestMethod": 0 , "interestCalculationPeriodType": 1,
"interestCalculationPeriodMethod": 1 "interestType": 0
} }
</code> </code>
<code class="method-response">{ <code class="method-response">{
@@ -2452,7 +2447,9 @@ Request Body:{
Content-Type: application/json Content-Type: application/json
Request Body: Request Body:
{ {
"name": "Loan name - updated" "locale": "en_GB",
"principal": "100,000.00",
"inArrearsTolerance": "5,000.00"
} }
</code> </code>
<code class="method-response">{ <code class="method-response">{
+12 -32
View File
@@ -1,47 +1,27 @@
\loan\?\transactions\id get exception if loan doesn't match id.... should loan be taken out here? \loan\?\transactions\id get exception if loan doesn't match id.... should loan be taken out here?
template for waiver/repayment... is it same for both? no type needed? (might have got this wrong) template for waiver/repayment... is it same for both? no type needed? (might have got this wrong)
new loan template ... is it 2 templates... one to pick product... and 2nd to return default properties in selected product or is it meant that if only one product then use that. new loan template ... is it 2 templates... one to pick product... and 2nd to return default properties in selected product or is it meant that if only one product then use that.
-------------------------------------------------------- --------------------------------------------------------
Users Lost permissions again... restore fixed it up... must be some prob with permissions/roles maintenance
template: allowedOffices (only id 1 came back)... does allowedOffices and available Roles depending on requested permissions? also, maybe I should be using a user that has everything but role admin.
Retrieve a user: selectedRoles- possible json prob availablePermissions is blank... is it always?
create new user... didn't check repeatPassword (see example in docs) but does in update
and msg shown on duplicate username isn't useful.
takes 4/5 seconds!
update: give hardtofigureout error msg when using equivalent to create parameters...worked ok with ones in docs tho.
delete: does delete (I delete super1), no 200 ok returned, "org.springframework.dao.InvalidDataAccessApiUsageException: attempt to create merge event with null entity; " if delete a non-existant user
Offices (creates and updates not working with last commit)
When creating new offices.. do i have to supply "dateFormat": & "openingDateFormatted" for openingDate? What is list of dateFormats?
openingDate seems mandatory... but when the 'pair' not supplied I get NullPointerException
could just openingDate be used?
Note that openingData is passed as openingDateFormatted and a dateFormat is provided to convert the date from the way your UI records it to a common format.
hierarchy update results in exception (prob solved by using unrecognized parameter exception)
Loan Product
List - interestRateCalculatedInPeriod is it usefult to show this field...also enums questionsor show only a few cos on loan template
Create - get NullPointerException when creating using values in api doc (? about using principal or principal formatted or the right locale values)
Update - tried to update name (using api docs data) and got a NullPointerException
Clients
List - can't get client other than from office 1
template - only get office 1 in allowed offices
mandatoryfields - if pass {}
dates lose formatted - general docs, money... strings, locale, don't have to put in commas.....but do put in decs.
--------------------------------------------------------
Permissions Permissions
groupType in or out? groupType in or out?
users - delete still falls over if user doesn't exist.
Roles Roles
"id" is a mandatory field (says something about updating in the msg) "id" is a mandatory field (says something about updating in the msg)
Loan Products
List/Retrieve - should show textual values of enums?
Create - currencyDigitsAfterDecimal is it needed? (maybe customising digits after decimal by loan product not just currency)
is locale saved?
principal is later called principalMoney