mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 19:58:11 +00:00
Merge freight/develop into feature/trains-management
This commit is contained in:
50
apps/edr-freight-web/backoffice/src/constants/QUERY_KEYS.ts
Normal file
50
apps/edr-freight-web/backoffice/src/constants/QUERY_KEYS.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { BookingListFilter } from "@/services/bookings.service";
|
||||
import type { RuleEngineListParams } from "@/services/ruleEngine/ruleEngine.service";
|
||||
import type { RuleEngineResourceSlug } from "@/types/rule-engine";
|
||||
|
||||
export const QUERY_KEYS = {
|
||||
USERS: {
|
||||
ROOT: ["users"] as const,
|
||||
ADD: ["users", "add"] as const,
|
||||
},
|
||||
|
||||
FILES: {
|
||||
ROOT: ["file-upload-settings"] as const,
|
||||
list: () => ["file-upload-settings", "list"] as const,
|
||||
byId: (id: string) => ["file-upload-settings", "detail", id] as const,
|
||||
byCode: (code: string) => ["file-upload-settings", "by-code", code] as const,
|
||||
},
|
||||
|
||||
DROPDOWN_SETTINGS: {
|
||||
ROOT: ["dropdown-settings"] as const,
|
||||
list: () => ["dropdown-settings", "list"] as const,
|
||||
byId: (id: string) => ["dropdown-settings", "detail", id] as const,
|
||||
byCode: (code: string) => ["dropdown-settings", "by-code", code] as const,
|
||||
},
|
||||
|
||||
CUSTOMERS: {
|
||||
ROOT: ["customers"] as const,
|
||||
list: () => ["customers", "list"] as const,
|
||||
byId: (id: string) => ["customers", "detail", id] as const,
|
||||
},
|
||||
|
||||
BOOKINGS: {
|
||||
ROOT: ["bookings"] as const,
|
||||
list: (filter?: BookingListFilter) =>
|
||||
["bookings", "list", filter ?? {}] as const,
|
||||
byId: (id: string) => ["bookings", "detail", id] as const,
|
||||
},
|
||||
|
||||
RULE_ENGINE: {
|
||||
ROOT: ["rule-engine"] as const,
|
||||
list: (resource: RuleEngineResourceSlug | string, params?: RuleEngineListParams) =>
|
||||
["rule-engine", "list", resource, params ?? {}] as const,
|
||||
detail: (resource: RuleEngineResourceSlug | string, id: string) =>
|
||||
["rule-engine", "detail", resource, id] as const,
|
||||
chain: ["rule-engine", "approval-rules", "chain"] as const,
|
||||
selectOptions: (
|
||||
resource: RuleEngineResourceSlug | string,
|
||||
params?: Record<string, unknown>,
|
||||
) => ["rule-engine", "select-options", resource, params ?? {}] as const,
|
||||
},
|
||||
} as const;
|
||||
@@ -1,25 +0,0 @@
|
||||
export const QUERY_KEYS = {
|
||||
USERS: "users",
|
||||
ADD_USER: "add_user",
|
||||
CUSTOMER: "Customers",
|
||||
FILES: {
|
||||
FILE_UPLOAD_SETTINGS: "file-upload-settings",
|
||||
BY_CODE: "by-code"
|
||||
},
|
||||
DROPDOWN_SETTINGS: {
|
||||
ROOT: "dropdown-settings",
|
||||
LIST: "list",
|
||||
BY_ID: "by-id",
|
||||
BY_CODE: "by-code"
|
||||
},
|
||||
CUSTOMERS: {
|
||||
ROOT: "customers",
|
||||
LIST: "list",
|
||||
BY_ID: "by-id"
|
||||
},
|
||||
RULE_ENGINE: {
|
||||
ROOT: "rule-engine",
|
||||
list: (resource: string) => ["rule-engine", resource, "list"] as const,
|
||||
chain: ["rule-engine", "approval-rules", "chain"] as const,
|
||||
},
|
||||
}
|
||||
@@ -77,9 +77,33 @@ export const URL_CONSTANTS = {
|
||||
|
||||
BOOKINGS: {
|
||||
BASE: "/bookings",
|
||||
BY_ID: (id: string | number) => `/bookings/${id}`,
|
||||
CANCEL: (id: string | number) => `/bookings/${id}/cancel`,
|
||||
CONFIRM: (id: string | number) => `/bookings/${id}/confirm`,
|
||||
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_PNR: (id: string) => `/bookings/${id}/payment/pnr`,
|
||||
PAYMENT_PROOF: (id: string) => `/bookings/${id}/payment/proof`,
|
||||
PAYMENT_VERIFY: (id: string) => `/bookings/${id}/payment/verify`,
|
||||
PAYMENT_REQUEST_LETTER: (id: string) =>
|
||||
`/bookings/${id}/payment/request-letter`,
|
||||
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: {
|
||||
|
||||
Reference in New Issue
Block a user