الفرق بين المراجعتين لصفحة «تصميم:دواسوا/API»
اذهب إلى التنقل
اذهب إلى البحث
(بداية) |
(data structures) |
||
| سطر 3: | سطر 3: | ||
; <code>Lookup ( <var>name</var>: string, <var>count</var>: int, <var>index</var>: int )</code> | ; <code>Lookup ( <var>name</var>: string, <var>count</var>: int, <var>index</var>: int )</code> | ||
| − | : returns <var>count</var> number of listings having <var>name</var> as the name, starting with <var>index | + | : returns <var>count</var> number of listings having <var>name</var> as the name, starting with <var>index</var> |
| − | ; <code>Insert_pending ( <var> | + | ; <code>Insert_pending ( <var>package_info</var>: [[#package_info|package_info]], <var>contact_info:</var> [[#contact_info|contact_info]], <var>accept_terms</var>: boolean )</code> |
: initiates the process of inserting a listing. The final insertion into the index is completed with insert_instate. Where: | : initiates the process of inserting a listing. The final insertion into the index is completed with insert_instate. Where: | ||
| − | :* <var>name</var>: | + | :* package_info : package information record as indicated in [[#package_info|package_info]] |
| − | + | :* contact_info : contact information record as indicated in [[#contact_info|contact_info]] | |
| − | + | :* accept_terms : a flag indicating the acceptance of the terms of service. | |
| − | + | ||
| − | + | Listing data record is comprised of the following two data structures: | |
| − | + | == <var>package_info</var> == | |
| + | ; <var>name</var> <nowiki>:</nowiki> string | ||
| + | : the name of the medicine in Latin script | ||
| + | ; <var>name_arabic</var> <nowiki>:</nowiki> string | ||
| + | : the name of the medicine in Arabic script, if available (optional) | ||
| + | ; <var>expiry</var> <nowiki>:</nowiki> date | ||
| + | : the date of expiry of the medicine. The significance is in the precision of months, i.e YYYY/MM | ||
| + | ; <var>package_state</var> <nowiki>:</nowiki> string(<kbd>fabrica</kbd> | <kbd>opened</kbd> | <kbd>partial</kbd>) : The case of the packaging of the medicine. | ||
| + | ; <var>governrate</var> <nowiki>:</nowiki> string(predefined) | ||
| + | : the governerate where the package is to be picked up | ||
| + | ; <var>description</var> <nowiki>:</nowiki> text | ||
| + | : a brief description, and/or notes by the submitter | ||
| + | ; <var>photo</var> <nowiki>:</nowiki> blob | ||
| + | : an optional photograph of the package | ||
| + | |||
| + | == <var>contact_info</var> == | ||
| + | ; <var>email_address</var> <nowiki>:</nowiki> string(email-address) | ||
| + | : | ||
| + | ; <var>name</var> <nowiki>:</nowiki> string | ||
| + | : | ||
| + | ; <var>phone_number</var> <nowiki>:</nowiki> string(phone-number) | ||
| + | : | ||
| + | ; <var>email_address_visible</var> <nowiki>:</nowiki> boolean | ||
| + | |||
</div> | </div> | ||
مراجعة 19:05، 29 ديسمبر 2016
The API should implement the following verbs:
Lookup ( name: string, count: int, index: int )- returns count number of listings having name as the name, starting with index
Insert_pending ( package_info: package_info, contact_info: contact_info, accept_terms: boolean )- initiates the process of inserting a listing. The final insertion into the index is completed with insert_instate. Where:
- package_info : package information record as indicated in package_info
- contact_info : contact information record as indicated in contact_info
- accept_terms : a flag indicating the acceptance of the terms of service.
Listing data record is comprised of the following two data structures:
package_info
- name : string
- the name of the medicine in Latin script
- name_arabic : string
- the name of the medicine in Arabic script, if available (optional)
- expiry : date
- the date of expiry of the medicine. The significance is in the precision of months, i.e YYYY/MM
- package_state : string(fabrica | opened | partial)
- The case of the packaging of the medicine.
- governrate : string(predefined)
- the governerate where the package is to be picked up
- description : text
- a brief description, and/or notes by the submitter
- photo : blob
- an optional photograph of the package
contact_info
- email_address : string(email-address)
- name : string
- phone_number : string(phone-number)
- email_address_visible : boolean