سطر 5: |
سطر 5: |
| <code>( <var>name</var>: string, <var>count</var>: int, <var>index</var>: int ): listings-enumeration</code> | | <code>( <var>name</var>: string, <var>count</var>: int, <var>index</var>: int ): listings-enumeration</code> |
| | | |
− | Returns <var>count</var> number of listings having <var>name</var> as the name, starting with <var>index</var>. Each listing item is comprised of basic [[#package-info|package information]] sans [[#contact-info|contact information]] processed properly. | + | Returns <var>count</var> number of listings having <var>name</var> as the name, starting with <var>index</var>. Each listing item is comprised of basic [[../data#package-info|package information]] sans [[../data#contact-info|contact information]] processed properly. |
| | | |
| This is a GET request via the URL <code>/lookup?<var>name</var>=&<var>count</var>=&<var>index</var>=</code> | | This is a GET request via the URL <code>/lookup?<var>name</var>=&<var>count</var>=&<var>index</var>=</code> |
سطر 13: |
سطر 13: |
| <code>( <var>id</var>: string(id) ): item-info</code> | | <code>( <var>id</var>: string(id) ): item-info</code> |
| | | |
− | Returns details information on a specific listing item; comprised of the [[#package-info|package information]] and the [[#contact-info|contact information]]. | + | Returns details information on a specific listing item; comprised of the [[../data#package-info|package information]] and the [[../data#contact-info|contact information]]. |
| | | |
| This is a GET request via the URL <code>/item/<var>id</var></code> | | This is a GET request via the URL <code>/item/<var>id</var></code> |
سطر 19: |
سطر 19: |
| | | |
| == <code>request_insertion</code> == | | == <code>request_insertion</code> == |
− | <code>( <var>package-info</var>: [[#package-info|package-info]], <var>contact-info:</var> [[#contact-info|contact-info]], <var>accept-terms</var>: boolean )</code> | + | <code>( <var>package-info</var>: [[../data#package-info|package-info]], <var>contact-info:</var> [[../data#contact-info|contact-info]], <var>accept-terms</var>: boolean )</code> |
| | | |
| Initiates an [[../workflow#insertion request|insertion request]]. Where: | | Initiates an [[../workflow#insertion request|insertion request]]. Where: |
− | * [[#package-info|package-info]] : package information record | + | * [[../data#package-info|package-info]] : package information record |
− | * [[#contact-info|contact-info]] : contact information record | + | * [[../data#contact-info|contact-info]] : contact information record |
| * accept-terms : a boolean flag indicating the acceptance of the terms of service. | | * accept-terms : a boolean flag indicating the acceptance of the terms of service. |
| This request is a POST request | | This request is a POST request |
سطر 47: |
سطر 47: |
| <code>( <var>token</var>: string([[/cryptographic token|cryptographic token]]) )</code> | | <code>( <var>token</var>: string([[/cryptographic token|cryptographic token]]) )</code> |
| | | |
− | Initiates the [[../workflow#Listing removal|removal of a listing]] from the public listings into the [[../data storage#archive|archive]]. Listings removed via this procedure have a status flag <kbd>removed-by-user</kbd>. | + | Initiates the [[../workflow#Listing removal|removal of a listing]] from the public listings into the [[../data#archive|archive]]. Listings removed via this procedure have a status flag <kbd>removed-by-user</kbd>. |
| | | |
| == <code>get_user_listings</code> == | | == <code>get_user_listings</code> == |
سطر 54: |
سطر 54: |
| Initiates a [[../workflow#Listings retrieval|listings retrieval]] procedure | | Initiates a [[../workflow#Listings retrieval|listings retrieval]] procedure |
| | | |
− |
| |
− | === data structures ===
| |
− | 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)
| |
− | : email address identifies a user who enlists an item. It is used to communicate with the user to confirm his listing, and to confirm the removal of a listing. It's a user's means to control his listings. It could be made invisible to viewers of a listing unless no phone number is given, in which case it is the only means to contact the user by those interested in a listing.
| |
− | ; <var>name</var> <nowiki>:</nowiki> string
| |
− | : A friendly name to greet the user by those contacting regarding a listing.
| |
− | ; <var>phone_number</var> <nowiki>:</nowiki> string(phone-number)
| |
− | : An optional method to contact a user by those interested in a listing. If entered then it is visible.
| |
− | ; <var>email_address_visible</var> <nowiki>:</nowiki> boolean
| |
− | : Determines whether the email address is visible. Ignored if no valid phone number is entered.
| |
| </div> | | </div> |