الفرق بين المراجعتين لصفحة «تصميم:دواسوا/data»
اذهب إلى التنقل
اذهب إلى البحث
(بالنقل عن تصميم:دواسوا/API و الإضافة) |
(استكمال) |
||
| سطر 1: | سطر 1: | ||
<div dir="ltr" style="direction: ltr;"> | <div dir="ltr" style="direction: ltr;"> | ||
| − | === | + | === Basic data structures === |
| − | Listing data record is comprised of the following two data structures: | + | Listing data record is comprised of the following two data structures, that are used to describe an entry through [[../API|API]] actions: |
=== <var>package-info</var> === | === <var>package-info</var> === | ||
| سطر 23: | سطر 23: | ||
; <var>email-address</var> <nowiki>:</nowiki> [[#string(email-address)|string(email-address)]] | ; <var>email-address</var> <nowiki>:</nowiki> [[#string(email-address)|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. | : 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> | + | ; <var>nickname</var> <nowiki>:</nowiki> string |
: A friendly name to greet the user by those contacting regarding a listing. | : A friendly name to greet the user by those contacting regarding a listing. | ||
; <var>phone-number</var> <nowiki>:</nowiki> [[#string(phone-number)|string(phone-number)]] | ; <var>phone-number</var> <nowiki>:</nowiki> [[#string(phone-number)|string(phone-number)]] | ||
| سطر 31: | سطر 31: | ||
| − | === | + | === Stored records === |
| + | Stored data preserves some operational information in addition to the basic entry structure: | ||
== Listings == | == Listings == | ||
| + | ; id | ||
| + | : <code>base62(sha256(<var>email-address</var> . sha256(<var>name</var> . <var>expiry</var> . <var>submission-date</var>)))</code> | ||
| + | : entry's unique identifier | ||
; [[#package-info|package-info]] | ; [[#package-info|package-info]] | ||
; [[#contact-info|contact-info]] | ; [[#contact-info|contact-info]] | ||
| سطر 39: | سطر 43: | ||
== Archive == | == Archive == | ||
| + | ; id | ||
; [[#package-info|package-info]] | ; [[#package-info|package-info]] | ||
; [[#contact-info|contact-info]] | ; [[#contact-info|contact-info]] | ||
: except: | : except: | ||
| − | :: <var> | + | :: <var>nickname</var> is omitted |
| − | :: <var>email-address</var> is replaced with <code>base62( | + | :: <var>email-address</var> is replaced with <code>base62(sha256(<var>email-address</var>))</code> |
| − | :: <var>phone-number</var> is replaces with <code>base62( | + | :: <var>phone-number</var> is replaces with <code>base62(sha256(<var>phone-number</var>))</code> |
| − | ; removal-date | + | ; submission-date |
| + | ; instatement-date | ||
| + | ; removal-date | ||
; <var>removal-reason</var> : possible values: | ; <var>removal-reason</var> : possible values: | ||
:; <kbd>unconfirmed</kbd> : | :; <kbd>unconfirmed</kbd> : | ||
مراجعة 00:55، 2 يناير 2017
Basic data structures
Listing data record is comprised of the following two data structures, that are used to describe an entry through API actions:
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)
- 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.
- nickname : string
- A friendly name to greet the user by those contacting regarding a listing.
- phone-number : string(phone-number)
- An optional method to contact a user by those interested in a listing. If entered then it is visible.
- email_address_visible : boolean
- Determines whether the email address is visible. Ignored if no valid phone number is entered.
Stored records
Stored data preserves some operational information in addition to the basic entry structure:
Listings
- id
base62(sha256(email-address . sha256(name . expiry . submission-date)))- entry's unique identifier
- package-info
- contact-info
- submission-date
- timestamp
- instatement-date
- timestamp
Archive
- id
- package-info
- contact-info
- except:
- nickname is omitted
- email-address is replaced with
base62(sha256(email-address)) - phone-number is replaces with
base62(sha256(phone-number))
- submission-date
- instatement-date
- removal-date
- removal-reason
- possible values:
- unconfirmed
- removed-by-user
- expired