unee-t / frontend

Meteor front end
https://case.dev.unee-t.com/
GNU Affero General Public License v3.0
9 stars 17 forks source link

API to create a case #848

Open franck-boullier opened 5 years ago

franck-boullier commented 5 years ago

How it should work:

Input:

Response:

Success:

Error:

Meaningful error message.

nbiton commented 5 years ago

The API in its final form will work as follows:

Request

{
    "apiKey": String, // API key for the user who's reporting the case, or for the creator of the user specified by 'reporterId'
        "reporterId": String, // (Optional) The MEFE ID of the user who is assumed as the reporter of this case. The user specified by this attribute must have been created by the user associated with 'apiKey'. This should be used in conjunction with 'reporterAliasId'
        "reporterAliasId": String, // (Optional) The alias ID in the context of the user specified by 'apiKey', of the user assumed as the reporter of this case. Works the same way as 'reporterId' in any other aspect.
    "unitId": String, // (Optional) The MEFE ID of the unit. If this is not provided, 'unitAliasId' is mandatory
        "unitAliasId": String, // (Optional) The alias ID of the unit in the context associated with the user specified by 'apiKey'. If this is not provided, 'unitId' is mandatory
    "title": String, // The title for the case
    "details": String, // (Optional) The details of the case. This shows up as the first comment of the case. If not provided, 'title' is shown as the first comment of the case.
    "assignedRole": String, // Enum of "Tenant", "Owner/Landlord", "Agent", "Management Company" (The "Contractor" role is excluded)
    "category": String, // (Optional) Enum of category types
    "subCategory": String, // (Optional) Enum of sub category types. Each 'category' has its own set of sub category types.
    "assigneeId": String, // (Optional) The MEFE ID of the user who should be the assignee of the case. This should only be used if the desired assignee is not the default assignee for the role specified under 'assignedRole', but one the same roles other members.
        "assigneeAliasId": String // (Optional) The alias ID of the user who'll be assigned to this case, in the context of the user specified by 'apiKey'. Works the same as 'assigneeId' in any other aspect.
}

Response:

{
        "id": Number // The ID of the newly created case
}