Noon Database Structure
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | 01/09/2023 | Hristiyan | First publish |
v1.1 | 27/07/2024 | Hristiyan | Added new script logic for splitting orders by country code |
v1.2 | 17/02/2024 | Milen | Change the split orders logic |
v1.3 | 25/02/2025 | Milen | Change for the country_code of SA orders |
v1.4 | 14/03/2025 | Milen | Additional changes within the file split/drop logic |
For the first phase of our Noon integration we will build our connection purely based on csv files exchange. Next year they plan to launch API integration but for now it will be csv files in which they send us very limited information about an order and we send them price update csvs.
The received csv file itself is an invoice or credit note that will be sent to an sFTP from where we need to pick it and create orders/store cancellations in Hemi based on the information in the csv invoice/credit note.
The integration we are targeting is the SFTP connection via csv feeds and for this we want to use the FTP Credentials
table in Hemi. We should look for a record with type
‘Noon’
The .csv files are comma (,) delimited and there are no enclosing characters.
Database
We will need an additional table named Account Noon - here we will be storing all the Noon details required from the connection to work and this is our starting point :
Field Name | Type | Required | Comment |
---|---|---|---|
Ftp Credentials | Integer | Yes | An enumeration dropdown list linked to table FTP Credentials where we can pick whichever FTP connection is needed |
Partner ID | Enum/Text | Yes | A field that will be used when we send price updates. Varchar type as usually the ID consists of a few numbers. |
Country Code | Dropdown | Yes | A field that will be used for price updates. |
We need to have 3 values in the dropdown menu : ae
,sa
, eg
Please note it is case sensitive and needs to be lowercase. |
<v1.1>Since Noon are sending us one file for all the different country codes, we have to introduce a new script for which will split orders from the file. We want to control this script from the FTP Credentials table through an ftp path labelled “Orders split”. <v1.2> We will need to split orders based on the first 3 symbols of the marketplace order ID picked up from source_document (column - G) in the import files. If we have an order beginning with NAE or IAE, we are to create the splitted file in the ‘ae’ subfolder. If we have an order beginning with NSA, we are to put the splitted file in the ‘sa’ subfolder. </v1.2>
<v1.4> All the orders that have different source_document prefixes than ‘NAE’, ‘IAE’ or ‘NSA’, should be combined in a file and dropped in a subfolder named ‘row’ without any additional changes to the file generated </v1.4>
The new files should be with extention .csv and the name can be the same as the initial file just with added country code as extention (example - customer_invoice_report_82174_20231104-ae.csv) </v1.1.>
<v1.3> When creating the file that is to be dropped in the ‘sa’ subfolder, we are to edit the country_code (column N) to have a ‘sa’ value instead of ‘ae’/ </v1.3>