MongoDB databases:
- Dev:
PinDeliveryDev
- Prod:
PinDeliveryProd
Connection string format:
mongodb://pindelivery:<password>@localhost:27017/?authSource=<dbname>
Active packages in the system.
| Field |
Type |
Description |
_id |
ObjectID |
Primary key |
ReadableID |
string |
Human-readable ID (e.g., PD40000000) |
TrackingNumber |
string |
Tracking number for external use |
VendorCode |
string |
Vendor-specific code |
Status |
string |
Current status (see Status Values) |
SubStatus |
string |
Sub-status detail |
SenderID |
ObjectID |
Reference to Clients collection |
Sender |
string |
Sender name (denormalized) |
ReceiverName |
string |
Receiver first name |
ReceiverLastname |
string |
Receiver last name |
ReceiverPhone |
string |
Receiver phone |
ReceiverStreet |
string |
Delivery street |
ReceiverNumber |
string |
Delivery house number |
ReceiverMunicipality |
string |
Delivery municipality |
ReceiverCity |
string |
Delivery city |
ReceiverPostalCode |
string |
Postal code |
ReceiverLatitude |
float64 |
Geocoded latitude |
ReceiverLongitude |
float64 |
Geocoded longitude |
CODAmount |
float64 |
Cash on delivery amount |
DeclaredValue |
float64 |
Declared package value |
Weight |
float64 |
Package weight |
Note |
string |
Delivery note |
Direction |
string |
SEND or RETURN |
CourierID |
ObjectID |
Assigned courier |
ZoneID |
ObjectID |
Assigned delivery zone |
Vendor |
string |
Package vendor |
DelegatedTo |
string |
B2B delegation target vendor |
DelegatedTrackingNumber |
string |
Partner tracking number |
CorrectionReason |
string |
Reason for correction |
CorrectionNote |
string |
Correction details |
DeliveryAttempts |
int |
Number of delivery attempts |
CreatedAt |
time |
Creation timestamp |
UpdatedAt |
time |
Last update timestamp |
Same schema as Packages. Archived packages are moved here after final status.
| Field |
Type |
Description |
_id |
ObjectID |
Primary key |
Name |
string |
Company/client name |
Username |
string |
Login username |
Password |
string |
Hashed password |
Email |
string |
Contact email |
Phone |
string |
Contact phone |
Street |
string |
Business street |
Number |
string |
Business house number |
Municipality |
string |
Business municipality |
City |
string |
Business city |
PostalCode |
string |
Business postal code |
Latitude |
float64 |
Geocoded latitude |
Longitude |
float64 |
Geocoded longitude |
APRStreet |
string |
APR registered street |
APRMunicipality |
string |
APR municipality |
APRCity |
string |
APR city |
Role |
string |
Always Client |
Vendor |
string |
Associated vendor |
API_Key |
string |
API key for integrations |
BrandedDeliverySticker |
bool |
Custom sticker flag |
BankAccount |
string |
Bank account number |
BankModel |
string |
Payment model |
BankReference |
string |
Payment reference |
PTT |
float64 |
Postal fee |
CanCreatePackages |
bool |
Permission flag |
CanDeliverPackages |
bool |
Permission flag |
Webhook |
object |
Webhook configuration (see below) |
PartnerAPIURL |
string |
B2B partner API URL |
PartnerAPIKey |
string |
B2B partner API key |
PartnerWebhookKey |
string |
B2B webhook verification key |
| Field |
Type |
Description |
URL |
string |
Webhook endpoint URL |
Method |
string |
HTTP method (GET/POST/PUT/PATCH) |
Headers |
map[string]string |
Custom headers |
Body |
string |
Body template (with placeholders) |
URLEncode |
bool |
URL-encode template values in URL |
| Field |
Type |
Description |
_id |
ObjectID |
Primary key |
Name |
string |
First name |
Lastname |
string |
Last name |
Phone |
string |
Phone number |
DeviceID |
string |
Assigned device ID |
Active |
bool |
Active status |
ZoneIDs |
[]ObjectID |
Assigned delivery zones |
| Field |
Type |
Description |
_id |
ObjectID |
Primary key |
Name |
string |
First name |
Lastname |
string |
Last name |
Username |
string |
Login username |
Password |
string |
Hashed password |
Role |
string |
Owner or Admin |
| Field |
Type |
Description |
_id |
ObjectID |
Primary key |
Name |
string |
Zone name |
CityID |
ObjectID |
Reference to Municipalities |
Markers |
[]LatLng |
Polygon vertices defining zone boundary |
Color |
string |
Display color on map |
| Field |
Type |
Description |
_id |
ObjectID |
Primary key |
CityName |
string |
City name |
Municipalities |
[]object |
List of |
Note: The CitiesCollection is empty. All city data lives in Municipalities.
| Collection |
Purpose |
LogsCollection |
Action audit logs (who did what, when) |
CallLogsCollection |
Courier phone call logs |
BillingCollection |
Monthly billing records per client |
Configuration |
App-wide settings |
News |
News/announcements for clients |
PackageCounter |
Auto-increment counter for ReadableID generation |
HouseNumbersCollection |
Address geocoding cache |
| Status |
Serbian Display |
Description |
AWAITING |
Cekanje |
Package created, awaiting pickup |
STORAGE |
U magacinu |
Package in warehouse |
IN_TRANSPORT |
U transportu |
Package being transported |
IN_DELIVERY |
U dostavi |
Out for delivery |
DELIVERED |
Dostavljeno |
Successfully delivered |
RETURNED |
Vraceno |
Returned to sender |
UNSUCCESSFUL |
Neuspesno |
Delivery failed |
CANCELLED |
Otkazano |
Package cancelled |
Key indexes for performance:
Packages: compound index on {Status, SenderID}, index on TrackingNumber, ReadableID
Clients: unique index on Username, index on API_Key
Archive: index on SenderID, TrackingNumber