{"swagger":"2.0","info":{"version":"2.0.0","title":"Activity and Expense Entry API","license":{"name":"proprietary"}},"servers":[{"url":"http://localhost:40000/api/clik/v2/"}],"security":[{"oauth2":["abacus.client.7777","offline_access"]}],"paths":{"/mandants/{mandant}/enumerators/{type}":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","description":"The enumerator type","required":true,"schema":{"$ref":"#/components/schemas/EnumerationType"}}],"get":{"operationId":"listEnumerators","summary":"List enumerators","tags":["clik"],"parameters":[{"name":"parentProject","in":"query","description":"The parent project to filter by","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"A paged array containing a whole enumeration","headers":{"x-next-page":{"description":"A reference to the next page","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Enumerator"}}}}},"404":{"description":"Enumeration does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/enumerators/{type}/{id}":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","description":"The enumerator type","required":true,"schema":{"$ref":"#/components/schemas/EnumerationType"}},{"name":"id","in":"path","required":true,"description":"The id of the enumerator to retrieve","schema":{"type":"string"}}],"get":{"operationId":"readEnumeratorById","summary":"Read a specific enumerator","tags":["clik"],"responses":{"200":{"description":"Enumerator","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Enumerator"}}}},"404":{"description":"Enumerator does not exist"},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/entryConstraints/":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}}],"get":{"operationId":"listEntryConstraints","summary":"List the constraints for all entry types","tags":["clik"],"responses":{"200":{"description":"Constraints for all entries of the specified type","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryConstraints"}}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/enumeratorConstraints/{enumeratorType}/":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}},{"name":"enumeratorType","in":"path","description":"The enumerator type to retrieve restrictions for","required":true,"schema":{"$ref":"#/components/schemas/EnumerationType"}}],"get":{"operationId":"getEnumerationConstraints","summary":"List constraints for all enmerators of the specified type","tags":["clik"],"parameters":[{"name":"combinationConstraints","in":"query","description":"Includes/excludes the property combinationConstraints.\nMust be set explicitly to false for performance reasons.\n","required":true,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Constraints for a whole enumeration","headers":{"x-next-page":{"description":"A reference to the next page","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EnumeratorConstraints"}}}}},"404":{"description":"Enumeration does not exist"},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/enumeratorConstraints/{enumeratorType}/{enumeratorId}":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}},{"name":"enumeratorType","in":"path","description":"The enumerator type to retrieve restrictions for","required":true,"schema":{"$ref":"#/components/schemas/EnumerationType"}},{"name":"enumeratorId","in":"path","required":true,"description":"The id of the enumerator to retrieve restrictions for","schema":{"type":"string"}}],"get":{"operationId":"readEnumeratorConstraintsByEnumeratorId","summary":"Read constraints for a single enumerator","tags":["clik"],"parameters":[{"name":"combinationConstraints","in":"query","description":"Includes/excludes the property combinationConstraints","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"Enumerator constraints","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnumeratorConstraints"}}}},"404":{"description":"The enumeration or enumerator does not exist"},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/entries":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}}],"get":{"operationId":"listEntries","summary":"List entries","tags":["clik"],"parameters":[{"name":"collectionId","in":"query","description":"id of an entry collection","required":false,"schema":{"$ref":"#/components/schemas/UUID"}},{"name":"type","in":"query","description":"One or more types(disjunctive)","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryType"}}},{"name":"status","in":"query","description":"One or more statuses (disjunctive)","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryStatus"}}},{"name":"startDate","in":"query","description":"The minimum date of entries","required":false,"schema":{"$ref":"#/components/schemas/DateTime"}}],"responses":{"200":{"description":"A paged array of entries","headers":{"x-next-page":{"description":"A reference to the next page","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Entry"}}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"createOrUpdateEntries","summary":"Create or update one or multiple entries independently","tags":["clik"],"requestBody":{"content":{"application/json":{"schema":{"type":"array","minLength":1,"items":{"$ref":"#/components/schemas/Entry"}}}}},"responses":{"200":{"description":"Entry creation/update successful:\nAll request entries are returned as persisted, including updated status and error information\n","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Entry"}}}}},"400":{"description":"Malformed or invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/entries/{id}":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The id of the entry to retrieve","schema":{"type":"string"}}],"get":{"operationId":"readEntry","summary":"Read an entry by its id","tags":["clik"],"responses":{"200":{"description":"Entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}},"404":{"description":"Entry not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"put":{"operationId":"updateOrCreateEntryById","summary":"Create or update an entry by id","tags":["clik"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}},"responses":{"200":{"description":"Entry creation/update successful:\nThe request entry is returned as persisted, including updated status and error information\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}},"400":{"description":"Malformed or invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"deleteEntryById","summary":"Delete a an entry by id","tags":["clik"],"responses":{"200":{"description":"Entry has been deleted"},"404":{"description":"Entry not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/entry-collections/":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}}],"get":{"operationId":"listEntryCollections","summary":"List entry collections","tags":["clik"],"parameters":[{"name":"type","in":"query","description":"One or more types(disjunctive)","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryCollectionType"}}},{"name":"status","in":"query","description":"One or more statuses (disjunctive)","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryCollectionStatus"}}}],"responses":{"200":{"description":"A paged array of entries","headers":{"x-next-page":{"description":"A reference to the next page","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryCollection"}}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"createOrUpdateEntryCollections","summary":"Create or update one or multiple entry collections independently","tags":["clik"],"requestBody":{"content":{"application/json":{"schema":{"type":"array","minLength":1,"items":{"$ref":"#/components/schemas/EntryCollection"}}}}},"responses":{"200":{"description":"Entry creation/update successful:\nAll request entry collections are being returned as persisted\n","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryCollection"}}}}},"400":{"description":"Malformed or invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/mandants/{mandant}/entry-collections/{id}":{"parameters":[{"name":"mandant","in":"path","description":"The mandant to operate on","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The id of the entry collection","schema":{"type":"string"}}],"get":{"operationId":"readEntryCollection","summary":"Read an entry collection by its id","tags":["clik"],"responses":{"200":{"description":"Entry collection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryCollection"}}}},"404":{"description":"Entry collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"put":{"operationId":"updateOrCreateEntryCollectionById","summary":"Create or update an entry collection by id","tags":["clik"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryCollection"}}}},"responses":{"200":{"description":"Entry collection creation/update successful:\nThe entry collection in the request is returned as persisted, including updated status and error information\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryCollection"}}}},"400":{"description":"Malformed or invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"deleteEntryCollectionById","summary":"Delete a an entry collection by id","tags":["clik"],"responses":{"200":{"description":"Entry collection has been deleted"},"404":{"description":"Entry collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"securitySchemes":{"openId":{"type":"openIdConnect","openIdConnectUrl":"http://abacus.local:40000/.well-known/openid-configuration"},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"http://abacus.local:40000/oauth/oauth2/v1/auth","tokenUrl":"http://abacus.local:40000/oauth/oauth2/v1/token","scopes":{"abacus.pad":"Access to the Pad API (AbaClik 1)","abacus.client.7777":"Mandant 7777 (AbaClik 2)","offline_access":"unattended access"}}}}},"schemas":{"Unit":{"type":"object","description":"A subset of UCUM codes with a descriptive name.\n\nUCUM Specification: http://unitsofmeasure.org/ucum.html\n","properties":{"code":{"type":"string","description":"The ucum code.\nSee following sections in the UCUM specification:\n* TABLES OF TERMINAL SYMBOLS / PREFIXES\n* TABLES OF TERMINAL SYMBOLS / BASE UNITS\n* EXAMPLES FOR SOME NON-UNITS\n","pattern":"^[a-zA-Z0-9 +\\-*\\/^_()]+$","enum":["d","h","min","km","1"]},"descriptiveName":{"type":"string"}},"required":["code"]},"URI":{"type":"string"},"UUID":{"type":"string","description":"lower case UUID without braces","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},"DateTime":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?([+-]\\d{2}:\\d{2}|Z)$","description":"ISO 8601:2004 date and time in UTC or with a specific offset","example":"2018-02-20T18:58:20+00:00"},"Date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO 8601:2004 date","example":"2018-02-20"},"Time":{"type":"string","pattern":"^\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?([+-]\\d{2}:\\d{2}|Z)$","description":"ISO 8601:2004 time with a time offset","example":"18:58:20+00:00"},"InputFormat":{"description":"input format specifier","type":"string","enum":["SCALAR","RANGE"]},"FormattedString":{"type":"object","properties":{"formatStringId":{"description":"global identifier for a translatable format string","type":"integer"},"defaultFormatString":{"description":"untranslated default format string, which must take all arguments provided in formatStringArgs, if any","type":"string"},"formatStringArgs":{"description":"format string args for defaultFormatString or the format string identified by formatStringId","type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]}}},"required":["defaultFormatString"]},"EnumerationType":{"type":"string","enum":["project","work_package","service_code","absence_type","expense_type","userfield_definition","currency","trip_expense_type","allowance","country","credit_card"]},"Enumerator":{"required":["id","type","label"],"discriminator":{"propertyName":"type","mapping":{"project":"#/components/schemas/Project","work_package":"#/components/schemas/WorkPackage","service_code":"#/components/schemas/ActivityType","absence_type":"#/components/schemas/AbsenceType","expense_type":"#/components/schemas/ExpenseType","userfield_definition":"#/components/schemas/UserFieldDefinition","currency":"#/components/schemas/Currency","trip_expense_type":"#/components/schemas/TripExpenseType","allowance":"#/components/schemas/Allowance","country":"#/components/schemas/Country","credit_card":"#/components/schemas/CreditCard"}},"properties":{"id":{"type":"string"},"customId":{"description":"An alternative identifier that is used instead of the 'id' property when displaying or searching for enumerators (e.g. the secondary number of a project).","type":"string"},"type":{"$ref":"#/components/schemas/EnumerationType"},"label":{"description":"The display name of the enumerator (e.g. expense type name, project name, etc).","type":"string"},"categoryLabel":{"description":"The display name for groups, when an enumeration is displayed as a grouped list (e.g. expense types grouped by category).","type":"string"}}},"Project":{"allOf":[{"$ref":"#/components/schemas/Enumerator"}]},"WorkPackage":{"allOf":[{"$ref":"#/components/schemas/Enumerator"}],"properties":{"project":{"type":"string"}},"required":["project"]},"ActivityType":{"allOf":[{"$ref":"#/components/schemas/Enumerator"}],"properties":{"unit":{"$ref":"#/components/schemas/Unit"},"inputFormat":{"$ref":"#/components/schemas/InputFormat"},"billable":{"type":"boolean"}}},"AbsenceType":{"allOf":[{"$ref":"#/components/schemas/Enumerator"}],"properties":{"unit":{"$ref":"#/components/schemas/Unit"},"inputFormat":{"$ref":"#/components/schemas/InputFormat"},"subType":{"type":"string","enum":["vacation","sickness","military","accident","education","other"],"default":"other"},"billable":{"type":"boolean"}}},"ExpenseType":{"allOf":[{"$ref":"#/components/schemas/Enumerator"}],"properties":{"unit":{"$ref":"#/components/schemas/Unit"}}},"TripExpenseType":{"description":"If one of the values breakfast, lunch, dinner or lodging are set to true, the meals or the lodging\non the TripDays should either be deducted or set to null according to the german travel expense law. It's not\nnecessary to enforce this rule but it's nice to show a information or warning to the user.\n\nIf the value entertainment is set to true, then the entertainment fields on the trip expense can be edited.\n","allOf":[{"$ref":"#/components/schemas/Enumerator"}],"properties":{"unit":{"$ref":"#/components/schemas/Unit"},"categories":{"type":"array","description":"Restricts the assignability to trip expenses with one of the specified categories.\nThis property can be absent to allow assignment to trip expenses of all categories.\n","items":{"$ref":"#/components/schemas/TripExpenseCategory"}}}},"Allowance":{"description":"id -> the unique id (long as string) of the allowance\n\nlabel -> the country of the allowance\n\ncategoryLabel -> the region of the allowance (not required)\n","allOf":[{"$ref":"#/components/schemas/Enumerator"}]},"Country":{"description":"id -> the unique id (String) of the country\n\nlabel -> the name of the country\n","allOf":[{"$ref":"#/components/schemas/Enumerator"}]},"CreditCard":{"description":"id -> the unique id (GUID as String) of the creditcard\n\nlabel -> the name of the creditcard\n","allOf":[{"$ref":"#/components/schemas/Enumerator"}],"properties":{"cardType":{"type":"string","enum":["mastercard","visa","diner","americanExpress"]},"cardNumber":{"description":"The last 4 digits of the cardnumber - attention, will turn to full number on api v3\n","type":"string"},"currency":{"type":"string"}}},"UserFieldDefinition":{"description":"Dynamic field definition (user fields : https://wiki.abacus.ch/x/-g9AAw).\n","allOf":[{"$ref":"#/components/schemas/Enumerator"}],"type":"object","properties":{"index":{"description":"an index used for ordering UI components","type":"integer"},"enumLabels":{"description":"a list of labels, corresponding to an enum defined in 'schema'","type":"array","items":{"type":"string","minLength":1}},"schema":{"$ref":"#/components/schemas/JSONSchema"}}},"Currency":{"allOf":[{"$ref":"#/components/schemas/Enumerator"}],"type":"object"},"Address":{"type":"object","properties":{"name":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"street":{"type":"string"},"crossStreet":{"type":"string"},"houseNumber":{"type":"string"},"floor":{"type":"string"},"district":{"type":"string"},"postcode":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"}}},"Location":{"type":"object","description":"A collection of optional properties, which shall be adequate to hold information from various data sources.\n\nSee:\n* https://developers.google.com/maps/documentation/geocoding/intro\n* https://wiki.openstreetmap.org/wiki/Nominatim\n","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"},"name":{"type":"string"},"premise":{"type":"string"},"subpremise":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"}}},"SparseIdArray":{"type":"array","items":{"nullable":false,"oneOf":[{"type":"string"},{"type":"array","description":"an array with two elements, describing an unsigned integral interval with inclusive boundaries [from, to]\n","minLength":2,"maxLength":2,"items":{"nullable":false,"type":"integer"}}]}},"CombinationConstraintEntry":{"type":"object","properties":{"allow":{"description":"base rule","type":"string","enum":["none","all"]},"except":{"description":"exceptions to the base rule","$ref":"#/components/schemas/SparseIdArray"}}},"EntryConstraints":{"type":"object","description":"additional entry constraints","properties":{"entryType":{"$ref":"#/components/schemas/EntryType"},"entrySchema":{"$ref":"#/components/schemas/JSONSchema"}},"required":["entryType"]},"EnumeratorConstraints":{"type":"object","description":"additional enumerator constraints","properties":{"enumeratorType":{"$ref":"#/components/schemas/EnumerationType"},"enumeratorId":{"type":"string"},"entrySchema":{"$ref":"#/components/schemas/JSONSchema"},"collectionSchemas":{"type":"object","description":"maps schemas for individual EntryCollection types (EntryCollectionType)","additionalProperties":{"$ref":"#/components/schemas/JSONSchema"}},"combinationConstraints":{"type":"object","description":"maps another EnumerationType to a restriction rule","additionalProperties":{"$ref":"#/components/schemas/CombinationConstraintEntry"}}},"required":["enumeratorType","enumeratorId"]},"EntryStatus":{"type":"string","enum":["draft","synchronizing","processing","processed","failed"]},"EntryType":{"type":"string","enum":["activity","expense","trip_expense"]},"Entry":{"description":"allowed client-side state transitions:\n\n  failed          -->   draft, synchronizing\n\n  draft           -->   synchronizing, draft\n\nallowed server-side state transitions:\n\n  synchronizing   -->   processing, processed, failed\n\n  processing      -->   processed, failed\n\nThe current status restricts modifications of all other properties.\nThe client may modify properties, when the status is \"draft\".\nThe serer may modify properties, when the status is \"processing\".\n","discriminator":{"propertyName":"type","mapping":{"activity":"#/components/schemas/Activity","expense":"#/components/schemas/Expense","trip_expense":"#/components/schemas/TripExpense"}},"properties":{"id":{"$ref":"#/components/schemas/UUID"},"type":{"$ref":"#/components/schemas/EntryType"},"collectionId":{"$ref":"#/components/schemas/UUID"},"creationDate":{"$ref":"#/components/schemas/DateTime"},"modificationDate":{"$ref":"#/components/schemas/DateTime"},"status":{"$ref":"#/components/schemas/EntryStatus"},"statusText":{"$ref":"#/components/schemas/FormattedString"},"validationError":{"$ref":"#/components/schemas/ConstraintViolation"},"userFields":{"type":"object","default":{},"additionalProperties":{"description":"A user field value mapped by the corresponding UserFieldDefinition.id.\n"}}},"required":["id","type"]},"Activity":{"type":"object","allOf":[{"$ref":"#/components/schemas/Entry"}],"description":"must contain either\n  start, end (for activityType.inputFormat=RANGE)\nor\n  date, quantity, unit\n","oneOf":[{"required":["start","end"]},{"required":["date","quantity","unit"]}],"properties":{"start":{"$ref":"#/components/schemas/DateTime"},"end":{"$ref":"#/components/schemas/DateTime"},"date":{"$ref":"#/components/schemas/Date"},"quantity":{"type":"number","minimum":0.0},"unit":{"$ref":"#/components/schemas/Unit"},"project":{"type":"string"},"workPackage":{"type":"string"},"activityType":{"type":"string"},"location":{"$ref":"#/components/schemas/Location"},"comment":{"type":"string"},"internalComment":{"description":"TODO move to properties (user fields)","type":"string"},"externalComment":{"description":"TODO move to properties (user fields)","type":"string"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}}},"required":["activityType"]},"Expense":{"type":"object","allOf":[{"$ref":"#/components/schemas/Entry"}],"properties":{"date":{"$ref":"#/components/schemas/DateTime"},"quantity":{"type":"number","minimum":0.0},"unit":{"$ref":"#/components/schemas/Unit"},"amount":{"type":"number","minimum":0.0},"currency":{"type":"string"},"creditCard":{"type":"string"},"project":{"type":"string"},"workPackage":{"type":"string"},"expenseType":{"type":"string"},"location":{"$ref":"#/components/schemas/Location"},"comment":{"type":"string"},"internalComment":{"type":"string"},"externalComment":{"type":"string"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}}},"required":["expenseType"]},"TripExpenseCategory":{"type":"string","enum":["breakfast","lunch","dinner","lodging","entertainment"]},"TripExpense":{"description":"An expense that can be attached to a trip. The expense must contain either a pair of amount and currency or a pair of quantity and unit.","type":"object","allOf":[{"$ref":"#/components/schemas/Entry"}],"properties":{"date":{"$ref":"#/components/schemas/DateTime"},"quantity":{"type":"number","minimum":0.0},"unit":{"$ref":"#/components/schemas/Unit"},"amount":{"type":"number","minimum":0.0},"currency":{"type":"string"},"creditCard":{"type":"string"},"project":{"type":"string"},"workPackage":{"type":"string"},"expenseType":{"type":"string"},"location":{"$ref":"#/components/schemas/Location"},"comment":{"type":"string"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"entertainment":{"$ref":"#/components/schemas/TripEntertainment"}},"required":["expenseType"]},"EntryCollectionType":{"type":"string","enum":["trip"]},"EntryCollectionStatus":{"description":"The client-side states of a trip can be:\n\nnone: the collection was not yet sent to the server\n\napproval_pending: the collection needs an approval, which is currently pending\n\napproved: the collection is approved, the collection and its entries can be accounted\n\nrejected: the collection was not approved\n\nclosing: mark collection as completed, ready to send trip to the server\n\nclosed: the collection is finalized and cannot be modified anymore\n\nfailed: error occured\n","type":"string","enum":["none","approval_pending","approved","rejected","closing","closed","failed"]},"EntryCollection":{"description":"A collection of Entry objects\n","discriminator":{"propertyName":"type","mapping":{"trip":"#/components/schemas/Trip"}},"properties":{"id":{"$ref":"#/components/schemas/UUID"},"type":{"$ref":"#/components/schemas/EntryCollectionType"},"status":{"$ref":"#/components/schemas/EntryCollectionStatus"},"validationError":{"$ref":"#/components/schemas/ConstraintViolation"}}},"Trip":{"description":"Each trip can be sent to the server twice. The first time when it's created and the second time when it's closed.\nThe only exception is when the trip was created on the server. In this case it can be only uploaded once (when it's\nbeing closed).\n\nAfter a successful creation the EntryStatus will be set to 'draft' and after closing it will be set to 'processed'.\nAs soon as it's processed, its trip days cannot be edited anymore and no further expenses can be attached.\n\nOn creation there are two different behaviours on the server: Either the trip will be approved immediately or\nan approval process will be started on the server and the trip will not be ready for having trip days edited or\nexpenses attached until the trip is approved.\n\nIn order to figure out the state of the approval there is an additional field 'status'. TripDays and\nexpenses can be edited respectively attached to the trip only with the combination of EntryStatus 'draft' and\nstatus 'approved'\n\nCreate trip: On creation the trip will be sent to the server without any TripDays.\n  EntryStatus: synchronizing -> draft, failed\n  status: none -> approval_pending, approved\n\nClose trip:  On closing all positions have to be uploaded already and the TripDays need to be attached to the trip.\n  EntryStatus: synchronizing -> processed, failed\n  status: approved -> closing -> closed\n\nstatus:\n  The client-side states of a trip can be:\n\n  none --> the trip head was not yet sent to the server\n\n  approval_pending --> the trip head is created on the server but it's waiting for an approval\n\n  approved --> the trip is created on the server and approved -> it's ready to receive expenses\n\n  rejected --> the trip is created on the server and rejected -> no positions can be added\n\n  closing --> the trip is marked as completed on the client and ready to send to the server\n\n  closed --> the trip is finalized and no more positions can be added\n","type":"object","allOf":[{"$ref":"#/components/schemas/EntryCollection"}],"properties":{"start":{"$ref":"#/components/schemas/DateTime"},"end":{"$ref":"#/components/schemas/DateTime"},"allowanceId":{"type":"string"},"project":{"type":"string"},"workPackage":{"type":"string"},"comment":{"type":"string"},"location":{"$ref":"#/components/schemas/Location"},"tripDays":{"type":"array","items":{"$ref":"#/components/schemas/TripDay"}}},"required":["start","end","project","allowanceId"]},"TripDay":{"type":"object","properties":{"date":{"$ref":"#/components/schemas/Date"},"breakfastAllowanceId":{"type":"string"},"lunchAllowanceId":{"type":"string"},"dinnerAllowanceId":{"type":"string"},"lodgingAllowanceId":{"type":"string"},"breakfastDeduction":{"type":"boolean"},"lunchDeduction":{"type":"boolean"},"dinnerDeduction":{"type":"boolean"},"lodgingDeduction":{"type":"boolean"}},"required":["date","breakfastDeduction","lunchDeduction","dinnerDeduction","lodgingDeduction"]},"TripEntertainment":{"type":"object","properties":{"occasion":{"type":"string"},"attendees":{"type":"string"}},"required":["occasion","attendees"]},"Attachment":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/UUID"},"uri":{"$ref":"#/components/schemas/URI"}},"required":["id"]},"ProblemDetails":{"description":"https://tools.ietf.org/html/draft-nottingham-http-problem-06#section-3","properties":{"type":{"type":"string","description":"An absolute URI [RFC3986] that identifies the\nproblem type. When dereferenced, it SHOULD provide human-readable\ndocumentation for the problem type (e.g., using HTML\n[W3C.REC-html401-19991224]). When this member is not present, its\nvalue is assumed to be \"about:blank\".\n"},"title":{"type":"string","description":"A short, human-readable summary of the problem\ntype. It SHOULD NOT change from occurrence to occurrence of the\nproblem, except for purposes of localisation.\n"},"status":{"type":"integer","description":"The HTTP status code ([RFC2616], Section 6)\ngenerated by the origin server for this occurrence of the problem.\n"},"detail":{"type":"string","description":"An human readable explanation specific to this\noccurrence of the problem.\n"},"instance":{"type":"string","description":"An absolute URI that identifies the specific\noccurrence of the problem. It may or may not yield further\ninformation if dereferenced.\n"}}},"JSONSchema":{"type":"object","description":"A subset of a draft-07 JSON schema.\nSee: http://json-schema.org/latest/json-schema-validation.html\n\nDate and time format names are derived from RFC 3339, section 5.6 => ISO 8601.\n\nFraction digits and integer digits may be specified with \"multipleOf\", \"maximum\" and \"minimum\".\nThe actual number of digits cannot be specified as with number formats, where leading trailing zeros may be appended.\n\nExample cases:\n\nNONE:       not listed in \"required\",   \"type\": \"null\"                              => a null value or an absent property\n\nOPTIONAL:   not listed in \"required\",   \"type\": \"a type != null\"                    => an optional non-null property\n\nREQUIRED:   listed in \"required\",       \"type\": \"a type != null\"                    => a required non-null property\n\nPREDEFINED: listed in \"required\",       \"type\": \"any type\", \"const\": \"predefinedValue\" => a predefined property (null or non-null)\n","properties":{"type":{"type":"string","enum":["object","array","string","number","integer","boolean","null"]},"description":{"type":"string"},"enum":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]}},"const":{},"default":{},"format":{"type":"string","enum":["date-time","date","time"]},"minLength":{"type":"integer"},"maxLength":{"type":"integer"},"pattern":{"type":"string"},"minimum":{"type":"number","description":"used for numbers and formatted values (e.g. for date-time values)"},"maximum":{"type":"number","description":"used for numbers and formatted values (e.g. for date-time values)"},"multipleOf":{"type":"number"},"items":{"$ref":"#/components/schemas/JSONSchema"},"minItems":{"type":"integer"},"maxItems":{"type":"integer"},"properties":{"type":"object","description":"schemes for individual properties","additionalProperties":{"$ref":"#/components/schemas/JSONSchema"}},"required":{"type":"array","description":"A listing of all properties which must be present (does not determine nullability)\n","items":{"type":"string","nullable":false}},"if":{"$ref":"#/components/schemas/JSONSchema"},"then":{"$ref":"#/components/schemas/JSONSchema"},"else":{"$ref":"#/components/schemas/JSONSchema"},"oneOf":{"type":"array","items":{"$ref":"#/components/schemas/JSONSchema"}},"anyOf":{"type":"array","items":{"$ref":"#/components/schemas/JSONSchema"}},"allOf":{"type":"array","items":{"$ref":"#/components/schemas/JSONSchema"}},"not":{"$ref":"#/components/schemas/JSONSchema"}}},"ConstraintViolation":{"type":"object","properties":{"property":{"description":"Property name or an array index","oneOf":[{"type":"string"},{"type":"integer"}]},"type":{"description":"The error type","type":"string","pattern":"^[a-z_][a-z0-9_]*$"},"rule":{"description":"The failed schema rule","type":"string","pattern":"^[a-z_][a-z0-9_]*$"},"ruleArgs":{"description":"Named schema rule arguments","type":"object"},"severity":{"type":"string","enum":["INFO","WARNING","ERROR"],"default":"ERROR"},"message":{"$ref":"#/components/schemas/FormattedString"},"violations":{"type":"array","description":"a list of nested violations, relative to the specified property","items":{"$ref":"#/components/schemas/ConstraintViolation"}}}}}}}