Procuret / procuret-swift

Procuret API Swift library
0 stars 1 forks source link

add `Entity` and attendant structs #6

Closed hwjeremy closed 3 years ago

hwjeremy commented 3 years ago

Objective: Add Entity struct to the Swift library. Reference javascript/classes/api/entity/entity.js for an example existing implementation. Do not worry about .setPermissions() and .retrieveList() at this time, just focus on getting the basic struct defined with all properties. You will need to implement EntityIdentifier (reference javascript/classes/api/entity/identifier.js) in order to complete Entity properties.

Note that in JavaScript, the publicId property is annotated as a string. In fact, the Procuret API returns an integer for this property. The reason for this discrepancy is a bit complex, and is to do with the fact that JavaScript does not have a native 64-bit integer type. For now, don't worry too much about it, just be sure to use Int instead of String for the publicId property in Swift.

kaythoyet commented 3 years ago

notes:

added create to Identifier file. added (currently blank) file for EntityIdType, b/c idType inside create is supposed to be an enumeration of EntityIdType.