softwerkab / fortnox-csharp-api-sdk

.NET SDK for Fortnox API.
MIT License
52 stars 64 forks source link

Missing HouseWorkTypes enum value #142

Closed therealjawss closed 3 years ago

therealjawss commented 3 years ago

https://developer.fortnox.se/blog/best-practise-new-housework-invoice/

The blog details a new housework type that is supposed to be used for invoice rows with negative values. Currently, HouseWorkTypes.Empty resolves to the API_BLANK which is also being used for when TaxReductionType is none. We need an additonal one that would actually map to the string "EMPTYHOUSEWORK"

image

richardrandak commented 3 years ago

I must admit, the Hoursework types are not super clear to me. So, according to the new rules, house work invoices force all its rows to have a houseworktype defined. So, this value "EMPTYHOUSEWORK" is some kind of workaround to not define any type?

I guess, I could change HouseWorkTypes.Empty to EMPTYHOUSEWORK and add HouseWorkType.None to API_BLANK But I feel it would be confusing.

What is your idea?

therealjawss commented 3 years ago

Its confusing that the api uses terms "emptyxxx" but then also have a scenario where it is actually empty. I would almost just do a direct mapping with API_BLANK and EMPTYHOUSEWORK so it breaks for people who are already using empty and they actively fix it. As there might already be people using empty for the api blank scenario and they might not catch the change?

richardrandak commented 3 years ago

Seems like the EMPTYHOUSEWORKis equal to "Ej husarbete" label in the Fortnox web portal. Still not sure what is the functional difference between this and empty/undefined value.

Please, check new version v4.0.5 with new enum values. HouseworkType.Blank for API_BLANK and EmptyHousework for EMPTYHOUSEWORK