Edit #174
ProjectCBTS - Dev - obsoleted
Opened by Steven Loh
On2017-03-09
StatusClosed
Labels
Task

Priority 
Assigned ToTerence Goh
External ID
Open in release
Fixed/Target in release



[Billing -Internal Billing - Invoice] : Web API

Created 9 Mar 2017, by Steven Loh

Objective

Provide a set of web API for Internal Invoice module.

API list and endpoints

GET invoice/internal/globals/index

  1. Returns the global data required by the internal invoice listing page.
  2. Focus on returning data for web controls inside Advanced Search panel.

GET invoice/internal/globals/edit

  1. Returns the global data required by the add/edit pop-up for internal invoice module.
  2. Focus on returning data for web controls for data selection, e.g. dropdown boxes. Do not return data that are invoice specific.

GET invoice/internal/?[get-params]

  1. Returns list of internal invoice available on the system.
  2. GET params shall accomodate requirements by listing page advanced search, and standard q, p, n and o params.
  3. Every element in the data array shall only return internal invoice details required by the listing table.

GET invoice/internal/{id}

  1. Returns an object representing one internal invoice record containing only the required data to be used by the view and add/edit pop-up.
  2. Returns invoice view model with dummy data if {id} is -1, and empty view model with default values if {id} is 0.
  3. Returns 404 if the invoice does not belong to internal invoice type.
  4. Returns the printable format of the invoice when request specifies request header "Accept". Support MIME type of application/pdf and use GET params to determine A4 or dot-matrix.
    This print requirement is not within the scope of this task, refer to task #xxx.

POST invoice/internal

  1. Creates a new internal invoice.

PUT invoice/internal/{id}

  1. Updates an existing internal invoice identified by {id}.
  2. Updating of an internal invoice only allowed for invoice with status:
    • New
    • Confirmed (within accounting period)
  3. Updating a confirmed invoice after accounting period requires the following action:
    • Cancel the invoice identified by {id}
    • Create a CN for the invoice identified by {id}
    • Create a new invoice with updated information (with a new ID and invoice no).

GET invoice/internal/{id}/status

  1. Returns a collection (log) of status of the internal invoice identified by {id}, sorted by CREATE_DATE of the status.
  2. This API returns all records and does not support any get-params.

POST invoice/internal/{id}/status

  1. Creates a new status for the internal invoice.
  2. This API is used to change the latest status of an internal invoice and creates a log of the status change of the invoice, e.g. confirmed, rejected, cancelled.

GET invoice/internal/{iiv_id}/notes

  1. Returns list of CN/DN associated with the specific internal invoice.
  2. This API does not require to return details of the internal invoice itself.

GET invoice/internal/{iiv_id}/notes/{id}

  1. Returns CN/DN details of an internal invoice identified by {id}.
  2. Returns CN/DN view model with dummy data if {id} is -1, and empty view model with default values if {id} is 0.
  3. Returns 404 if the CN/DN does not belong to internal invoice with id {iiv_id}.
  4. Returns the printable format of the CN/DN when request specifies request header "Accept". Support MIME type of application/pdf and use GET params to determine A4 or dot-matrix.
    This print requirement is not within the scope of this task, refer to task #xxx.

POST invoice/internal/{iiv_id}/notes

  1. Creates a new CN/DN for internal invoice identified by {iiv_id}.

PUT invoice/internal/{iiv_id}/notes/{id}

  1. Updates an existing CN/DN for internal invoice identified by {iiv_id}.
  2. Returns 404 if the CN/DN does not belong to internal invoice with id {iiv_id}

GET invoice/internal/{iiv_id}/notes/{id}/status

  1. Returns a collection (log) of status of the CN/DN identified by {id}, sorted by CREATE_DATE of the status.
  2. This API returns all records and does not support any get-params.

POST invoice/internal/{iiv_id}/notes/{id}/status

  1. Creates a new status for CN/DN for internal invoice identified by {iif_id}.
  2. This API is used to change the latest status of a CN/DN for internal invoice and creates a log of the status change of the invoice, e.g. confirmed, rejected, cancelled.

Others

  1. API for internal invoice does not implement the DELETE method.
  2. Estimation: 80 hours, including database schema design and implementation, FO integration.
Comments
Commits

Terence Goh change status to In progress
Wednesday March 15, 2017 - 11:23:59

Terence Goh was assigned by Terence Goh
Thursday March 16, 2017 - 01:55:41

Terence Goh change status to Ready for Testing
Wednesday May 17, 2017 - 07:48:51
Display Comment and Event



uBugtrack - Built with ♥ by a passionate small team located in Nice, France.
Plans & pricing - News & Changelog - uBugtrack API - Simple Agile Methodology - Privacy - Status
Follow on twitter