In PR #28 we introduced a set of breaking changes to the library and I want to address all related issues that were fixed in that PR before we make a new major release of the library.
In response to that I want to make a more coordinated effort to fixing the problems we've talked about which mainly is that some data types are of the wrong type according to the API. In #31 we are still having a discussion about decimal vs float but there are still parts of the SDK that have for example dates and integers set as strings which shouldn't be. In addition to this we have also been using strings instead of enum data types on a lot of places where an enum would be a better fit. This is something we can also look over while working on this.
In order for the enum types to be serialized correctly you have to add the following annotation to the enum property in your model:
/// <summary>
/// Cause code
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public CauseCode CauseCode { get; set; }
Within the CauseCode enum we use the EnumMember annotation to specify the string value according to Fortnox API documentation:
While fixing this I also had the idea that we can add documentation to the models. This is a very easy task as it can be copied from the API documentation while looking over the types for each model.
Right now lets focus on just adding the documentation and fixing the types. I know that in order to prove that this is actually working we need additional tests to be added. And probably also make changes to the services but this can wait for now and lets focus on the models in order to make a new coordinated effort later on.
Here is a list of the remaining Models that needs to be looked over and have documentation added to them (Ones that are checked are finished):
[x] Absence Transactions
[x] Account Charts
[x] Accounts
[x] Archive
[x] Article File Connections
[x] Articles
[x] Asset File Connections
[x] Asset Types
[x] Assets
[x] Attendance Transactions
[x] Company Information
[x] Company Settings
[x] Contracts
[x] Contract Templates
[x] Cost Centers
[x] Currencies
[x] Customers
[x] Employees
[x] Expenses
[x] Finnancial Years
[x] Inbox
[x] Invoice Payments
[x] Invoices
[x] Labels
[x] Locked Period
[x] Modes of Payments
[x] Offers
[x] Orders
[x] Predefined Accounts
[x] Price Lists
[x] Prices
[x] Print Templates
[x] Projects
[x] Salary Transactions
[x] SIE
[x] Supplier Invoice External URL Connections
[x] Supplier Invoice File Connections
[x] Supplier Invoice Payments
[x] Supplier Invoices
[x] Suppliers
[x] Tax Reductions
[x] Terms of Deliveries
[x] Terms of Payments
[x] Trusted Email Domains
[x] Units
[x] Voucher Series
[x] Vouchers
[x] Way of Deliveries
If you are interested in helping with this task please comment which Models you'd like to look over so that others know not the work on the same one!
In PR #28 we introduced a set of breaking changes to the library and I want to address all related issues that were fixed in that PR before we make a new major release of the library.
In response to that I want to make a more coordinated effort to fixing the problems we've talked about which mainly is that some data types are of the wrong type according to the API. In #31 we are still having a discussion about decimal vs float but there are still parts of the SDK that have for example dates and integers set as strings which shouldn't be. In addition to this we have also been using strings instead of enum data types on a lot of places where an enum would be a better fit. This is something we can also look over while working on this.
In order for the enum types to be serialized correctly you have to add the following annotation to the enum property in your model:
Within the CauseCode enum we use the
EnumMember
annotation to specify the string value according to Fortnox API documentation:While fixing this I also had the idea that we can add documentation to the models. This is a very easy task as it can be copied from the API documentation while looking over the types for each model.
Right now lets focus on just adding the documentation and fixing the types. I know that in order to prove that this is actually working we need additional tests to be added. And probably also make changes to the services but this can wait for now and lets focus on the models in order to make a new coordinated effort later on.
Here is a list of the remaining Models that needs to be looked over and have documentation added to them (Ones that are checked are finished):
If you are interested in helping with this task please comment which Models you'd like to look over so that others know not the work on the same one!