{"openapi":"3.0.4","info":{"title":"API","version":"1.0.0"},"servers":[{"url":"http://localhost:8000"}],"tags":[{"name":"Auth"},{"name":"User Release"},{"name":"User Cash"},{"name":"User Transporters"}],"paths":{"/auth/login":{"post":{"tags":["Auth"],"summary":"Login","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Login successful","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}}},"/user/release":{"get":{"tags":["User Release"],"summary":"Get user release data","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"}],"responses":{"200":{"description":"User release data fetched successfully","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserReleaseResponse"}}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}},"post":{"tags":["User Release"],"summary":"Create user release","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserReleaseRequest"}}}},"responses":{"200":{"description":"User release created successfully","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}}},"/user/cash":{"get":{"tags":["User Cash"],"summary":"Get user cash data","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"}],"responses":{"200":{"description":"User cash data fetched successfully","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserCashResponse"}}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}},"post":{"tags":["User Cash"],"summary":"Create user cash entry","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserCashRequest"}}}},"responses":{"200":{"description":"User cash entry created successfully","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}}},"/user/release/{reference_number}":{"get":{"tags":["User Release"],"summary":"Get release by reference number","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"},{"name":"reference_number","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Release fetched successfully","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetReleaseByReferenceResponse"}}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}}},"/user/transporters":{"get":{"tags":["User Transporters"],"summary":"Get transporters","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"}],"responses":{"200":{"description":"Transporters fetched successfully","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTransportersResponse"}}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}},"post":{"tags":["User Transporters"],"summary":"Create transporter","security":[{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AppTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransporterRequest"}}}},"responses":{"200":{"description":"Transporter created successfully","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}},"default":{"description":"Fetch error","headers":{"App-Type":{"$ref":"#/components/headers/AppTypeHeader"},"Authorization":{"$ref":"#/components/headers/AuthorizationHeader"}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"AppTypeHeader":{"name":"App-Type","in":"header","required":true,"schema":{"type":"string"}}},"headers":{"AppTypeHeader":{"schema":{"type":"string"}},"AuthorizationHeader":{"schema":{"type":"string"}}},"schemas":{"LoginRequest":{"type":"object","required":["username","password"],"properties":{"username":{"type":"string"},"password":{"type":"string"}}},"Client":{"type":"object","required":["client_name","fiscal_number","phone_number","address"],"properties":{"client_name":{"type":"string"},"fiscal_number":{"type":"string"},"phone_number":{"type":"string"},"address":{"type":"string"}}},"Release":{"type":"object","required":["reference_number","client_name","goods","employee_name","status","profit","release_number"],"properties":{"reference_number":{"type":"string"},"client_name":{"type":"string"},"goods":{"type":"string"},"employee_name":{"type":"string"},"status":{"type":"string"},"profit":{"type":"number"},"release_number":{"type":"string"}}},"GetUserReleaseResponse":{"type":"object","required":["clients","releases"],"properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"releases":{"type":"array","items":{"$ref":"#/components/schemas/Release"}}}},"ReleaseDetails":{"type":"object","required":["reference_number","number_of_containers","declaration_number","vessel","origin_country","destination_country","from","to"],"properties":{"reference_number":{"type":"string"},"number_of_containers":{"type":"integer","minimum":1},"declaration_number":{"type":"string"},"vessel":{"type":"string"},"origin_country":{"type":"string"},"destination_country":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}}},"Container":{"type":"object","required":["container_number","goods","quantity","net_weight_kg","gross_weight_kg"],"properties":{"container_number":{"type":"string"},"goods":{"type":"string"},"quantity":{"type":"integer","minimum":1},"net_weight_kg":{"type":"number","exclusiveMinimum":true,"minimum":0},"gross_weight_kg":{"type":"number","exclusiveMinimum":true,"minimum":0}}},"CreateUserReleaseRequest":{"type":"object","required":["client","release_details","containers"],"properties":{"client":{"$ref":"#/components/schemas/Client"},"release_details":{"$ref":"#/components/schemas/ReleaseDetails"},"containers":{"type":"array","items":{"$ref":"#/components/schemas/Container"}}}},"CostLinesDictionary":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"GetUserCashResponse":{"type":"object","required":["releases","cost_lines","currencies","employees"],"properties":{"releases":{"type":"array","items":{"$ref":"#/components/schemas/Release"}},"cost_lines":{"$ref":"#/components/schemas/CostLinesDictionary"},"currencies":{"type":"array","items":{"type":"string"}},"employees":{"type":"array","items":{"type":"string"}}}},"CreateUserCashRequest":{"type":"object","required":["release_reference_number","client_name","cost_line","cost_type","other_type","currency","date","attachment_path","invoice_type","in_out","notes","payment_method","paid_by"],"properties":{"release_reference_number":{"type":"string"},"client_name":{"type":"string"},"cost_line":{"type":"string"},"cost_type":{"type":"string"},"other_type":{"type":"string","nullable":true},"currency":{"type":"string"},"date":{"type":"string"},"attachment_path":{"type":"string","nullable":true},"invoice_type":{"type":"string","enum":["from","with"]},"in_out":{"type":"string","enum":["in","out"]},"notes":{"type":"string","nullable":true},"payment_method":{"type":"string","enum":["cash","check"]},"paid_by":{"type":"string"}}},"ReleaseCostLine":{"type":"object","required":["name","cost_lbp","cost_usd","status"],"properties":{"name":{"type":"string"},"cost_lbp":{"type":"number","exclusiveMinimum":true,"minimum":0},"cost_usd":{"type":"number","exclusiveMinimum":true,"minimum":0},"status":{"type":"string"}}},"GetReleaseByReferenceResponse":{"type":"object","required":["cost_lines"],"properties":{"cost_lines":{"type":"array","items":{"$ref":"#/components/schemas/ReleaseCostLine"}}}},"Transporter":{"type":"object","required":["name","phone","amount_owed"],"properties":{"name":{"type":"string"},"phone":{"type":"string"},"amount_owed":{"type":"number"}}},"GetTransportersResponse":{"type":"object","required":["transporters"],"properties":{"transporters":{"type":"array","items":{"$ref":"#/components/schemas/Transporter"}}}},"CreateTransporterRequest":{"type":"object","required":["name","phone"],"properties":{"name":{"type":"string"},"phone":{"type":"string"}}}}}}