Files
edr-platform/apps/edr-freight-web/backoffice/src/constants/URLS.ts
2026-06-05 21:07:04 +03:00

175 lines
5.7 KiB
TypeScript

export const URL_CONSTANTS = {
AUTH: {
LOGIN: "/auth/login",
REGISTER: "/auth/register",
REFRESH_TOKEN: "/auth/refresh-token",
LOGOUT: "/auth/logout",
PROFILE: "/auth/profile",
},
USERS: {
SIGN_UP: "/api/auth/signup",
GENERATE_VERIFICATION_CODE: "/api/auth/generate-verification-code",
BASE: "/users",
BY_ID: (id: string | number) => `/users/${id}`,
SET_PASSWORD: "/api/auth/set-password",
ME: "/api/auth/me"
},
ROLES: {
BASE: "/roles",
BY_ID: (id: string | number) => `/roles/${id}`,
},
PERMISSIONS: {
BASE: "/permissions",
BY_ID: (id: string | number) => `/permissions/${id}`,
},
PRODUCTS: {
BASE: "/products",
BY_ID: (id: string | number) => `/products/${id}`,
},
ORDERS: {
BASE: "/orders",
BY_ID: (id: string | number) => `/orders/${id}`,
},
FILES: {
BASE: "/files",
UPLOAD: "/files/upload",
FILE_UPLOAD_SETTINGS: "/files/upload",
FILE_UPLOAD_SETTINGS_BY_CODE: "/file-upload-settings/by-code",
DOWNLOAD: (id: string | number) => `/files/${id}/download`,
DELETE: (id: string | number) => `/files/${id}`,
BY_ID: (id: string | number) => `/files/${id}`,
},
SETTINGS: {
BASE: "/settings",
GENERAL: "/settings/general",
SECURITY: "/settings/security",
NOTIFICATIONS: "/settings/notifications",
},
DROPDOWN_SETTINGS: {
BASE: "/dropdown-settings",
BY_ID: (id: string) => `/api/dropdown-settings/${id}`,
BY_CODE: (code: string) =>
`/dropdown-settings/by-code/${encodeURIComponent(code)}`,
OPTIONS: (id: string) => `/dropdown-settings/${id}/options`,
OPTION_BY_ID: (optionId: string) =>
`/api/dropdown-settings/options/${optionId}`,
},
CUSTOMERS: {
BASE: "/customers",
BY_ID: (id: string | number) => `/customers/${id}`,
BOOKINGS: (id: string | number) => `/customers/${id}/bookings`,
},
CUSTOMERS_API: {
BASE: "/api/customers",
BY_ID: (id: string) => `/api/customers/${id}`,
BY_USER_ID: (id: string) => `/api/customers/user/${id}`
},
BOOKINGS: {
BASE: "/bookings",
REFERENCE_DATA: "/bookings/reference-data",
LIST_SUMMARY: "/bookings/list-summary",
BY_ID: (id: string) => `/bookings/${id}`,
QUEUE: (queue: string) => `/bookings/queues/${queue}`,
STAFF_ACCEPT: (id: string) => `/bookings/${id}/staff/accept`,
STAFF_REQUEST_CHANGES: (id: string) =>
`/bookings/${id}/staff/request-changes`,
STAFF_REJECT: (id: string) => `/bookings/${id}/staff/reject`,
APPROVE_STEP: (id: string, stepId: string) =>
`/bookings/${id}/approval-steps/${stepId}/approve`,
REJECT_STEP: (id: string, stepId: string) =>
`/bookings/${id}/approval-steps/${stepId}/reject`,
CONTRACT_GENERATE: (id: string) => `/bookings/${id}/contract/generate`,
CONTRACT_VIEW: (id: string) => `/bookings/${id}/contract/view`,
CONTRACT_DOCUMENT: (id: string) => `/bookings/${id}/contract/document`,
CONTRACT_SIGN: (id: string) => `/bookings/${id}/contract/sign`,
CONTRACT_DOWNLOAD: (id: string) => `/bookings/${id}/contract`,
SUMMARY: (id: string) => `/bookings/${id}/summary`,
CUSTOMER_SIGN: (id: string) => `/bookings/${id}/customer/sign`,
MARKETING_APPROVE: (id: string) => `/bookings/${id}/marketing/approve`,
PAYMENT_PAY: (id: string) => `/bookings/${id}/payment/pay`,
START_TRANSIT: (id: string) => `/bookings/${id}/operations/start-transit`,
COMPLETE: (id: string) => `/bookings/${id}/operations/complete`,
CANCEL: (id: string) => `/bookings/${id}/cancel`,
CONSOLIDATION: (id: string) => `/bookings/${id}/consolidation`,
},
OTP: {
SEND: "/api/otp/send",
VERIFY: "/api/otp/verify",
},
LOCOMOTIVES: {
BASE: "/locomotives",
},
TRAIN_SCHEDULING: {
ELIGIBLE_BOOKINGS: "/train-scheduling/container/eligible-bookings",
PREVIEW: "/train-scheduling/container/preview",
SCHEDULES: "/train-scheduling/container/schedules",
SCHEDULE_BY_ID: (id: string) => `/train-scheduling/container/schedules/${id}`,
CANCEL_SCHEDULE: (id: string) =>
`/train-scheduling/container/schedules/${id}/cancel`,
},
RULE_ENGINE: {
CARGO_TYPES: "/cargo-types",
CARGO_TYPE_BY_ID: (id: string) => `/cargo-types/${id}`,
CONTAINER_TYPES: "/container-types",
CONTAINER_TYPE_BY_ID: (id: string) => `/container-types/${id}`,
PRIORITY_RULES: "/priority-rules",
PRIORITY_RULE_BY_ID: (id: string) => `/priority-rules/${id}`,
SERVICE_TYPES: "/service-types",
SERVICE_TYPE_BY_ID: (id: string) => `/service-types/${id}`,
SURCHARGE_TYPES: "/surcharge-types",
SURCHARGE_TYPE_BY_ID: (id: string) => `/surcharge-types/${id}`,
WEIGHT_LIMIT_RULES: "/weight-limit-rules",
WEIGHT_LIMIT_RULE_BY_ID: (id: string) => `/weight-limit-rules/${id}`,
YARDS: "/yards",
YARD_BY_ID: (id: string) => `/yards/${id}`,
SHIPPING_LINES: "/shipping-lines",
SHIPPING_LINE_BY_ID: (id: string) => `/shipping-lines/${id}`,
RATES: "/rates",
RATES_LIVE: "/rates/live",
RATE_BY_ID: (id: string) => `/rates/${id}`,
RATE_SUBMIT: (id: string) => `/rates/${id}/submit`,
RATE_APPROVE: (id: string) => `/rates/${id}/approve`,
APPROVAL_RULES: "/approval-rules",
APPROVAL_RULE_BY_ID: (id: string) => `/approval-rules/${id}`,
APPROVAL_RULES_CHAIN: "/approval-rules/chain",
},
RATE_MATRIX: {
BASE: '/api/rate-matrices',
DRAFT: '/api/rate-matrices/draft',
SUBMIT: (id: string) => `/api/rate-matrices/${id}/submit`,
AUTHORIZE: (id: string) => `/api/rate-matrices/${id}/authorize`,
LIST: '/api/rate-matrices',
DETAIL: (id: string) => `/api/rate-matrices/${id}`,
},
REFERENCE: {
PORTS: '/api/reference/ports',
CITIES: '/api/reference/cities',
CONTAINER_TYPES: '/api/reference/container-types',
CURRENCIES: '/api/reference/currencies',
},
};