agmission/Development/client/src/app/shared/global.ts
Devin Major ad7db99f07
Some checks failed
Server Tests / Mocha – Unit & Utility Tests (push) Successful in 1m29s
Server Tests / Jest – Integration Tests (push) Failing after 1m57s
all Data Export API changes until may 8 2026
2026-05-08 11:48:21 -04:00

1033 lines
65 KiB
TypeScript

import { FitBoundsOptions } from 'leaflet';
/** The user types. This is used to refer to user roles regarding to different access permissions of app/module functionality as well */
export enum RoleIds { ADMIN = "0", APP = "1", APP_ADM = "2", CLIENT = "3", OFFICER = "4", PILOT = "5", INSPECTOR = "6", DEVICE = "9", VENDOR = "10", PARTNER = "20", PARTNER_SYSTEM_USER = "21" };
export enum JobStatus { NEW = 0, READY = 1, DOWNLOADED = 2, SPRAYED = 3, ARCHIVED = 9 };
export enum Units { OZ = 0, GAL, LB, LIT, KG, /*GR, CC, PT*/ };
export enum DRAW { SPRAY, PIVOT, XCL, WAYPOINT, BUFFER, PLACE, OBSTACLE, ABLINE, EDGE_BUFFER };
export enum PANE {
GeoItems = 'GeoItems', SprayZones = 'SprayZones', XCLZones = 'XCLZones', GridLines = 'GridLines', FlightPaths = 'FlightPaths', SprayData = 'SprayData',
Tracks = 'Tracks', ABLine = 'ABLine', Obstacles = 'Obstacles'
}
export enum KEY_CODE { BACK = 8, DELETE = 46, ENTER = 13, ESCAPE = 27, KeyB = 66, KeyG = 71, LEFT = 37, RIGHT = 39 };
export enum VehType { FIXEDSWING = 0, HELICOPTER = 1, TRUCK = 2 };
export const vehTypes: any = Object.freeze({
[VehType.FIXEDSWING]: $localize`:Fixed wing aircraft type@@fixedSwing:Fixed Wing`,
[VehType.HELICOPTER]: $localize`:Helicopter aircraft type@@helicoper:Helicopter`
});
export enum MatType { LIQUID = 0, DRY = 1 };
export const matTypes: any = Object.freeze({
[MatType.LIQUID]: $localize`:Liquid material type@@liquid:Liquid`,
[MatType.DRY]: $localize`:Dry material type@@dry:Dry`
});
export enum MatType2 { WET = 'wet', DRY = 'dry' };
// NOTE: Refactor to use only MatType2 later, but need to migrate existing usages of MatType first
// mostly bc MatType values were used in settings and persisted in DB
export enum ProdType { ACTIVE = 1, CARRIER = 9 };
export const ProdTypes: any = Object.freeze({
[ProdType.ACTIVE]: $localize`:Active product type@@typeActive:Active`,
[ProdType.CARRIER]: $localize`:Carrier product type@@typeCarrier:Carrier`
});
export enum RateUnit { OZPA = 0, GPA = 1, LBPA = 2, LPH = 3, KGPH = 4 };
export enum SSE_Events { LOGIN = "login", DATA = "d", ERROR = "error" };
// Source System Constants
// AGNAV is the native AgMission system (special case)
// All other systems are dynamic partners retrieved via API
export const SourceSystem = Object.freeze({
AGNAV: 'agnav' // Native AgMission system - special case
});
// Reserved partner codes that should be treated as known systems
export const KnownPartnerCodes = Object.freeze({
SATLOC: 'satloc' // Keep for backward compatibility, but use dynamic partner matching
});
// Type for source system values (AGNAV only, partners are dynamic)
export type SourceSystemType = typeof SourceSystem[keyof typeof SourceSystem];
// Type for known partner codes
export type KnownPartnerCodeType = typeof KnownPartnerCodes[keyof typeof KnownPartnerCodes];
// Type that allows both native systems and known partner codes (for transition period)
export type SystemOrPartnerType = SourceSystemType | KnownPartnerCodeType;
// Operational Status Constants - Consolidates sync, connection, and integration statuses
export const OperationalStatus = Object.freeze({
ACTIVE: 'active',
PENDING: 'pending',
ERROR: 'error',
INACTIVE: 'inactive',
SYNCED: 'synced',
CONNECTED: 'connected',
DISCONNECTED: 'disconnected',
TESTING: 'testing'
});
// Type for operational status values
export type OperationalStatusType = typeof OperationalStatus[keyof typeof OperationalStatus];
// Assignment Status Constants - Job assignment workflow statuses
export const AssignStatus = Object.freeze({
NEW: 0, // same as pending
DOWNLOADED: 1, // for native agnav system
UPLOADED: 2, // Status for jobs uploaded to partner systems like satloc
ERROR: 3
});
// Type for assignment status values
export type AssignStatusType = typeof AssignStatus[keyof typeof AssignStatus];
// Application data source types
export const SysDataTypes = Object.freeze({
AGNAV: 'agnav',
SATLOC: 'satloc',
});
// UI Label Constants
export const Labels = Object.freeze({
// Core AgMission system labels (translatable)
AGMISSION_NATIVE: $localize`:AgMission Native system@@agmissionNative:AgMission Native`,
AGMISSION_NATIVE_SYSTEM: $localize`:AgMission Native System@@agmissionNativeSystem:AgMission Native System`,
// Partner system brand names (NON-TRANSLATABLE - remain same in all languages)
AGNAV_BRAND_NAME: 'AgNav',
AGMISSION_BRAND_NAME: 'AgMission', // Just the brand name, 'Native' should be translated
SATLOC_BRAND_NAME: 'Satloc',
// Translatable descriptive terms for system types
NATIVE_SYSTEM_TYPE: $localize`:Native system type@@nativeSystemType:Native`,
CONNECTION_TEST_FAILED: $localize`:Connection test failed message@@connectionTestFailed:Connection test failed`,
CONNECTION_TEST_FAILED_WITH_ERROR: $localize`:Connection test failed with error@@connectionTestFailedWithError:Connection test failed -`,
FAILED_TO_LOAD_AIRCRAFT: $localize`:Failed to load aircraft error message@@failedToLoadAircraft:Failed to load aircraft list. Please try again.`,
FAILED_TO_LOAD_PARTNERS: $localize`:Failed to load partners error message@@failedToLoadPartners:Failed to load partners`,
NEVER: $localize`:Never@@never:Never`,
LOADING_PARTNERS: $localize`:Loading partners message@@loadingPartners:Loading partners...`,
LOADING_AVAILABLE_AIRCRAFT: $localize`:Loading available aircraft message@@loadingAvailableAircraft:Loading available aircraft...`,
LOADING_SUBSCRIPTION_DATA: $localize`:Loading subscription packages message@@loadingSubscriptionData:Loading subscription packages...`,
UP_TO: $localize`:Up to (max limit prefix)@@upTo:Up to`,
SELECT_PARTNER_SYSTEM: $localize`:Select Partner System label@@selectPartnerSystem:Select Partner System`,
PARTNER_SYSTEM_LABEL: $localize`:Partner System account type label@@partnerSystemLabel:Partner System`,
AIRCRAFT_INTEGRATION: $localize`:Aircraft Integration label@@aircraftIntegration:Aircraft Integration`,
AVAILABLE_AIRCRAFT: $localize`:Available Aircraft label@@availableAircraft:Available Aircraft`,
SELECT_AIRCRAFT: $localize`:Select Aircraft label@@selectAircraft:Select Aircraft`,
SELECTED_AIRCRAFT_DETAILS: $localize`:Selected Aircraft Details label@@selectedAircraftDetails:Selected Aircraft Details`,
AIRCRAFT_ID: $localize`:Aircraft ID label@@aircraftId:Aircraft ID`,
NO_AVAILABLE_AIRCRAFT_FOUND: $localize`:No available aircraft found message@@noAvailableAircraftFound:No available aircraft found for`,
NO_AIRCRAFT_AVAILABLE_TITLE: $localize`:No aircraft available title@@noAircraftAvailableTitle:No Aircraft Available`,
PARTNER_AIRCRAFT_ERROR_TITLE: $localize`:Partner aircraft error title@@partnerAircraftErrorTitle:Aircraft Load Error`,
// Search and filter constants
SEARCH_PLACEHOLDER: $localize`:Search placeholder text@@searchPlaceholder:Search`,
ERROR_LOADING_PARTNER_CUSTOMERS: $localize`:Error loading partner customers@@errorLoadingPartnerCustomers:Error loading partner customers`,
// Account management constants
TEST_CONNECTION: $localize`:Test connection button label@@testConnection:Test Connection`,
CONNECTION_TEST_ONLY_FOR_EXISTING: $localize`:Connection test availability message@@connectionTestOnlyForExisting:Connection test is only available for existing partner system users`,
CONNECTION_TEST_FAILED_LOG: $localize`:Connection test failed log message@@connectionTestFailedLog:Connection test failed`,
FAILED_TO_LOAD_PARTNER_SYSTEM_USERS: $localize`:Failed to load partner system users@@failedToLoadPartnerSystemUsers:Failed to load existing partner system users`,
FAILED_TO_LOAD_PARTNER_SYSTEM_USER_DATA: $localize`:Failed to load partner system user data@@failedToLoadPartnerSystemUserData:Failed to load partner system user data`,
// Customer Management Constants
FROM_PARTNER: $localize`:From Partner label@@fromPartner:From Partner`,
NONE_AGNAV_DIRECT_CUSTOMER: $localize`:None AgNav direct customer option@@noneAgNavDirectCustomer:None (AgNav Direct Customer)`,
AGNAV_DIRECT_CUSTOMER: $localize`:AgNav direct customer label@@agNavDirectCustomer:AgNav Direct Customer`,
// Job Assignment Constants
PACKAGE_INACTIVE: $localize`:Package inactive tooltip@@packageInactive:Package inactive`,
AGNAV_DEFAULT: $localize`:AgMission Native default label@@agnavDefault:AgNav`,
SATLOC_AIRCRAFT_TOOLTIP: $localize`:Satloc aircraft tooltip@@satlocAircraftTooltip:Satloc Aircraft - Enhanced tracking capabilities`,
AGNAV_AIRCRAFT_TOOLTIP: $localize`:AgMission Native aircraft tooltip@@agnavAircraftTooltip:AgNav Aircraft - Standard tracking system`,
DOWNLOAD_OPTIONS_AGNAV_ONLY_TOOLTIP: $localize`:Download options AgNav only tooltip@@downloadOptionsAgNavOnlyTooltip:Download options are only available for AgNav aircraft due to system compatibility requirements.`,
STOP_ASSIGNMENT_STATUS_POLLING: $localize`:Stop assignment status polling tooltip@@stopAssignmentStatusPolling:Stop assignment status polling`,
START_ASSIGNMENT_STATUS_POLLING: $localize`:Start assignment status polling tooltip@@startAssignmentStatusPolling:Start assignment status polling`,
// Partner constraint messages
PARTNER_CONSTRAINT_TITLE: $localize`:Partner account constraint title@@partnerConstraintTitle:Account Constraint`,
PARTNER_CODE_CONSTRAINT_TITLE: $localize`:Partner code constraint title@@partnerCodeConstraintTitle:Partner Code Constraint`,
CANNOT_DEACTIVATE_PARTNER_PREFIX: $localize`:Cannot deactivate partner prefix@@cannotDeactivatePartnerPrefix:Cannot deactivate partner account with`,
CANNOT_DEACTIVATE_PARTNER_SUFFIX: $localize`:Cannot deactivate partner suffix@@cannotDeactivatePartnerSuffix:active customer(s). Please contact customers to remove their dependency before deactivating this partner.`,
CANNOT_CHANGE_PARTNER_CODE_PREFIX: $localize`:Cannot change partner code prefix@@cannotChangePartnerCodePrefix:Cannot change partner code while`,
CANNOT_CHANGE_PARTNER_CODE_SUFFIX: $localize`:Cannot change partner code suffix@@cannotChangePartnerCodeSuffix:active customer(s) exist. Partner code changes would break customer integrations.`,
PARTNER_CODE_LOCKED_MESSAGE: $localize`:Partner code locked message@@partnerCodeLockedMessage:Partner code cannot be modified after creation to ensure system integrity and consistency.`,
PARTNER_ACCOUNT_LOCKED_MESSAGE: $localize`:Partner account locked message@@partnerAccountLockedMessage:Account status cannot be modified after creation to ensure system integrity and consistency.`,
PARTNER_SYSTEM_USER_ACCOUNT_STATUS_MESSAGE: $localize`:Partner system user account status message@@partnerSystemUserAccountStatusMessage:Account status is managed by the partner system and cannot be modified directly`,
// Constraint message component titles
CONSTRAINT_INFO_TITLE: $localize`:Constraint information title@@constraintInfoTitle:Information`,
CONSTRAINT_WARNING_TITLE: $localize`:Constraint warning title@@constraintWarningTitle:Warning`,
CONSTRAINT_ERROR_TITLE: $localize`:Constraint error title@@constraintErrorTitle:Error`,
PROMO_TITLE: $localize`:Promo banner title@@promoTitle:Promotion`,
// Promo banner messages
PROMO_ALL_PACKAGES_PREFIX: $localize`:Promo all packages prefix@@promoAllPackagesPrefix:PROMO: All packages`,
PROMO_UNTIL: $localize`:Promo until@@promoUntil:until`,
PROMO_VALID_UNTIL: $localize`:Promo valid until (stacked format)@@promoValidUntil:Valid until`,
ACTIVE_PROMO: $localize`:Label for active promo on subscribed item@@activePromo:Active Promo`,
// Renewal promo incentive message parts
RENEW_BY_PREFIX: $localize`:Renew by prefix for promo message@@renewByPrefix:Renew by`,
AND_GET: $localize`:And get connector for promo message@@andGet:and get`,
OFF_SUFFIX: $localize`:OFF suffix for discount@@offSuffix:OFF`,
FREE: $localize`:Free discount label@@free:FREE`,
// Promo checkout auto-apply (WI-4)
PROMO_AUTO_APPLIED: $localize`:Promo auto applied notice@@promoAutoApplied:Promotional pricing will be applied`,
// Promo expiry warning labels (WI-5)
PROMO_APPLIED: $localize`:Promo applied label@@promoApplied:Promo applied`,
PROMO_EXPIRES_IN: $localize`:Promo expires in X days@@promoExpiresIn:Expires in`,
PROMO_DAYS_REMAINING: $localize`:Promo days remaining@@promoDaysRemaining:days remaining`,
PROMO_EXPIRING_SOON: $localize`:Promo expiring soon warning@@promoExpiringSoon:Promo expiring soon`,
PROMO_AFTER_EXPIRY: $localize`:After promo expiry@@promoAfterExpiry:After promo expires`,
PROMO_NORMAL_BILLING: $localize`:Normal billing resumes@@promoNormalBilling:Normal billing will resume`,
TOTAL_PROMO_SAVINGS: $localize`:Total promo savings summary@@totalPromoSavings:Total Promo Savings`,
PLAN_REFUND: $localize`:Plan refund label@@planRefund:Plan Refund`,
// Promo description time units
PROMO_FOR: $localize`:Promo for (duration prefix)@@promoFor:for`,
PROMO_MONTH: $localize`:Month (singular)@@promoMonth:month`,
PROMO_MONTHS: $localize`:Months (plural)@@promoMonths:months`,
PROMO_DAYS: $localize`:Days (plural)@@promoDays:days`,
PROMO_NO_EXPIRATION: $localize`:No expiration@@promoNoExpiration:No expiration`,
PROMO_UNTIL_SUBSCRIPTION_ENDS: $localize`:Until subscription ends@@promoUntilSubscriptionEnds:until subscription ends`,
// Promo expiry text patterns
PROMO_VALID_UNTIL_COLON: $localize`:Valid until with colon@@promoValidUntilColon:Valid until:`,
PROMO_DISCOUNT_ENDS: $localize`:Discount ends@@promoDiscountEnds:Discount ends:`,
PROMO_ONLY: $localize`:Only (urgency prefix)@@promoOnly:Only`,
PROMO_DAYS_UNTIL_EXPIRES: $localize`:Days until promo expires@@promoDaysUntilExpires:days until promo expires`,
PROMO_DAYS_REMAINING_SUFFIX: $localize`:Days remaining suffix@@promoDaysRemainingSuffix:days remaining`,
// Promo type labels for accessibility
PROMO_TYPE_PERMANENT: $localize`:Permanent discount promo type@@promoTypePermanent:Permanent Discount`,
PROMO_TYPE_TIME_LIMITED: $localize`:Time limited offer promo type@@promoTypeTimeLimited:Time-Limited Offer`,
PROMO_TYPE_ENDING_SOON: $localize`:Ending soon promo type@@promoTypeEndingSoon:Ending Soon`,
PROMO_TYPE_LIMITED_TIME: $localize`:Limited time promo type@@promoTypeLimitedTime:Limited Time`,
PROMO_TYPE_PROMOTIONAL_PERIOD: $localize`:Promotional period promo type@@promoTypePromotionalPeriod:Promotional Period`,
PROMO_TYPE_ONE_TIME: $localize`:One-time discount promo type@@promoTypeOneTime:One-Time Discount`,
PROMO_TYPE_FREE: $localize`:FREE promotion promo type@@promoTypeFree:FREE Promotion`,
// Synthetic pending promo fallback strings (used when promoDetails is unavailable)
DISCOUNT_APPLIED: $localize`:Discount applied fallback name@@discountApplied:Discount Applied`,
DISCOUNT_DISPLAY_FALLBACK: $localize`:Generic discount display fallback@@discountDisplayFallback:Discount`,
// Promo management tooltips
CANNOT_EDIT_REPEATING_PROMO: $localize`:Cannot edit repeating promo tooltip@@cannotEditRepeatingPromo:Repeating coupons use duration-based discounts and cannot have redemption deadlines modified`,
// Promo reactivation (combined activate + validUntil flow)
PROMO_ACTIVATE_TOOLTIP: $localize`:Activate promo tooltip@@promoActivateTooltip:Promo is inactive — click to set a new expiry date and re-activate`,
PROMO_ACTIVATE_INFO: $localize`:Activate promo info@@promoActivateInfo:Set a new Valid Until date. The promo will be re-enabled for new subscriptions until this date.`,
PROMO_NAME: $localize`:Promo name field label@@promoName:Promo Name`,
PROMO_NAME_PLACEHOLDER: $localize`:Promo name input placeholder@@promoNamePlaceholder:Enter promo display name`,
PROMO_ACTIVATED_SUCCESS: $localize`:Promo activated success@@promoActivatedSuccess:Promo activated successfully.`,
PROMO_ACTIVATE_FAILED: $localize`:Promo activate failed@@promoActivateFailed:Failed to activate promo. Please try again.`,
// Subscription data integrity warnings
MULTIPLE_PACKAGES_WARNING: $localize`:Multiple packages warning@@multiplePackagesWarning:Multiple packages detected. Only one package subscription is allowed at a time. Please contact support to resolve this issue.`,
// Constraint message collapsible mode labels
VIEW_CONSTRAINT_MESSAGE: $localize`:View constraint message aria label@@viewConstraintMessage:View message`,
CLOSE_CONSTRAINT_MESSAGE: $localize`:Close constraint message aria label@@closeConstraintMessage:Close message`,
// Partner system account constraints
NO_AVAILABLE_VENDORS_TITLE: $localize`:No available vendors title@@noAvailableVendorsTitle:Partner System Configuration`,
NO_AVAILABLE_VENDORS_MESSAGE: $localize`:No available vendors message@@noAvailableVendorsMessage:All partner system types are already configured for this account. Only one partner system account per type is allowed.`,
// Disabled states feedback messages
ACCOUNT_TYPE_DISABLED_TITLE: $localize`:Account type disabled title@@accountTypeDisabledTitle:Account Type Locked`,
ACCOUNT_TYPE_DISABLED_MESSAGE: $localize`:Account type disabled message@@accountTypeDisabledMessage:Account type cannot be changed for existing accounts to maintain data integrity.`,
// Note: VENDOR_SYSTEM_DISABLED_* kept for fallback in vendorSystemConstraintMessage/Title getters
VENDOR_SYSTEM_DISABLED_TITLE: $localize`:Vendor system disabled title@@vendorSystemDisabledTitle:Partner System Locked`,
VENDOR_SYSTEM_DISABLED_MESSAGE: $localize`:Vendor system disabled message@@vendorSystemDisabledMessage:Partner system cannot be changed for existing accounts to prevent data loss.`,
// Partner system account soft-lock confirmation labels (WI-3)
VENDOR_CHANGE_CONFIRM_TITLE: $localize`:Vendor change confirm title@@vendorChangeConfirmTitle:Change Partner System`,
VENDOR_CHANGE_CONFIRM_MESSAGE: $localize`:Vendor change confirm message@@vendorChangeConfirmMessage:Changing the partner system may cause data loss for existing partner integrations. Are you sure you want to continue?`,
VENDOR_DELETE_CONFIRM_TITLE: $localize`:Vendor delete confirm title@@vendorDeleteConfirmTitle:Delete Partner System Account`,
VENDOR_DELETE_CONFIRM_MESSAGE: $localize`:Vendor delete confirm message@@vendorDeleteConfirmMessage:WARNING: This is a partner system account. Deleting it will remove all partner integration configurations. Are you sure you want to delete this account?`,
// Partner flow specific disabled messages
ACCOUNT_TYPE_FLOW_DISABLED_TITLE: $localize`:Account type flow disabled title@@accountTypeFlowDisabledTitle:Account Type Pre-configured`,
ACCOUNT_TYPE_FLOW_DISABLED_MESSAGE: $localize`:Account type flow disabled message@@accountTypeFlowDisabledMessage:Account type is automatically set based on the partner integration workflow. This ensures the correct account configuration for your selected partner system.`,
VENDOR_SYSTEM_FLOW_DISABLED_TITLE: $localize`:Vendor system flow disabled title@@vendorSystemFlowDisabledTitle:Partner System Pre-configured`,
VENDOR_SYSTEM_FLOW_DISABLED_MESSAGE: $localize`:Vendor system flow disabled message@@vendorSystemFlowDisabledMessage:Partner system is automatically set based on your partner selection from the vehicle configuration. This ensures proper integration setup.`,
TEST_CONNECTION_UNAVAILABLE_TITLE: $localize`:Test connection unavailable title@@testConnectionUnavailableTitle:Test Connection Unavailable`,
TEST_CONNECTION_UNAVAILABLE_MESSAGE: $localize`:Test connection unavailable message@@testConnectionUnavailableMessage:Test connection will be available after saving the account.`,
MANUALLY_REFRESH_ASSIGNMENT_STATUS: $localize`:Manually refresh assignment status tooltip@@manuallyRefreshAssignmentStatus:Manually refresh assignment status`,
ASSIGN_ALL_AVAILABLE_AIRCRAFT: $localize`:Assign all available aircraft tooltip@@assignAllAvailableAircraft:Assign all available aircraft to this job`,
// Partner system validation messages - Progressive Enhancement Model
PARTNER_ACCOUNT_REQUIRED: $localize`:Partner account required message@@partnerAccountRequired:Partner system account required to enable aircraft enhancement features.`,
CREATE_PARTNER_ACCOUNT: $localize`:Create partner account button@@createPartnerAccount:Create Partner Account`,
AUTHENTICATION_FAILED: $localize`:Authentication failed message@@authenticationFailed:Authentication failed for partner system. Partner enhancement features disabled.`,
FIX_AUTHENTICATION: $localize`:Fix authentication button@@fixAuthentication:Fix Authentication`,
TEST_CONNECTION_RETRY: $localize`:Test connection retry button@@testConnectionRetry:Test Connection`,
PARTNER_VALIDATION_ERROR: $localize`:Partner validation error@@partnerValidationError:Unable to validate partner system.`,
// Additional validation messages for new component
VALIDATING_PARTNER_SYSTEM: $localize`:Validating partner system@@validatingPartnerSystem:Validating partner system connection...`,
PARTNER_ACCOUNT_NOT_FOUND: $localize`:Partner account not found@@partnerAccountNotFound:Partner System Account Not Found`,
PARTNER_ACCOUNT_CREATE_GUIDANCE: $localize`:Partner account create guidance@@partnerAccountCreateGuidance:Create a partner account to enable enhanced aircraft features and synchronization.`,
PARTNER_AUTH_FAILED: $localize`:Partner authentication failed@@partnerAuthFailed:Partner Authentication Failed`,
PARTNER_AUTH_FIX_GUIDANCE: $localize`:Partner auth fix guidance@@partnerAuthFixGuidance:Authentication credentials are invalid. Fix authentication to enable partner features.`,
PARTNER_VALIDATION_SUCCESS: $localize`:validated@@validated:Validated`,
PARTNER_VALIDATION_SUCCESS_MESSAGE: $localize`:Partner validation success message@@partnerValidationSuccessMessage:Partner system validated successfully`,
LAST_VALIDATED: $localize`:Last validated@@lastValidated:Last validated`,
TAIL_NUMBER: $localize`:Tail Number label@@tailNumberLabel:Tail Number:`,
PARTNER_SYSTEM: $localize`:Partner System label@@partnerSystemLabel:Partner System:`,
// Progressive Enhancement Messages
PARTNER_INTEGRATED: $localize`:Partner integrated indicator@@partnerIntegrated:Partner integrated`,
// Error messages for partner aircraft loading
FAILED_TO_LOAD_AIRCRAFT_FROM_PARTNER: $localize`:Failed to load aircraft from partner system@@failedToLoadAircraftFromPartner:Failed to load aircraft from partner system`,
UNKNOWN_ERROR: $localize`:Unknown error message@@unknownError:Unknown error`,
// Account Edit connection test error messages
CONNECTION_TEST_ONLY_AVAILABLE_FOR_PARTNER_USERS: $localize`:Connection test only for partner users@@connectionTestOnlyForPartnerUsers:Connection test only available for Partner System User accounts`,
// Trial Charge Banner Messages
YOUR_TRIAL_IS_ACTIVE_UNTIL: $localize`:Your trial is active until@@yourTrialIsActiveUntil:Your trial is active until`,
YOU_WILL_BE_CHARGED_ON_THAT_DATE: $localize`:You will be charged on that date@@youWillBeChargedOnThatDate:You will be charged on that date unless auto-renew is disabled.`,
NO_CHARGE_WILL_BE_MADE_TODAY: $localize`:No charge will be made today@@noChargeWillBeMadeToday:No charge will be made today.`,
// Promo Labels
VALID_UNTIL: $localize`:Valid until date label@@validUntil:Valid until:`,
DISCONTINUING_SOON: $localize`:Discontinuing soon warning@@discontinuingSoon:Discontinuing soon`,
UPGRADE_TO_ESSENTIAL_1_PLUS: $localize`:Upgrade to Essential 1 Plus message@@upgradeToEssential1Plus:Upgrade to Essential 1 Plus`,
// Subscription billing labels
NEXT_BILL_AMOUNT_INCL_TAX: $localize`:Next bill amount including tax@@nextBillAmountInclTax:Next Bill Amount (including tax):`,
NEXT_BILL_AMOUNT_BEFORE_TAX: $localize`:Next bill amount before tax@@nextBillAmountBeforeTax:Next Bill Amount (before tax):`,
NEXT_BILL_AMOUNT: $localize`:Next bill amount label@@nextBillAmount:Next Bill Amount:`,
// Partner List Constants
PARTNER_LIST_TITLE: $localize`:Partner list title@@partnerListTitle:Partner List`,
ALL_STATUS_FILTER: $localize`:All status filter@@allStatusFilter:All`,
ACTIVE_STATUS: $localize`:Active status@@activeStatus:Active`,
INACTIVE_STATUS: $localize`:Inactive status@@inactiveStatus:Inactive`,
NAME_COLUMN_HEADER: $localize`:Name column header@@nameColumnHeader:Name`,
PARTNER_CODE_COLUMN_HEADER: $localize`:Partner code column header@@partnerCodeColumnHeader:Partner Code`,
EMAIL_COLUMN_HEADER: $localize`:Email column header@@emailColumnHeader:Email`,
PHONE_COLUMN_HEADER: $localize`:Phone column header@@phoneColumnHeader:Phone`,
USERNAME_COLUMN_HEADER: $localize`:Username column header@@usernameColumnHeader:Username`,
ACTIVE_COLUMN_HEADER: $localize`:Active column header@@activeColumnHeader:Active`,
CREATED_COLUMN_HEADER: $localize`:Created column header@@createdColumnHeader:Created`,
NEW_BUTTON_LABEL: $localize`:New button label@@newButtonLabel:New`,
DETAIL_BUTTON_LABEL: $localize`:Detail button label@@detailButtonLabel:Detail`,
TOTAL_PARTNERS: $localize`:Total partners text@@totalPartners:Total:`,
PARTNERS_COUNT_SUFFIX: $localize`:Partners count suffix@@partnersCountSuffix:partners`,
MISSING_USERNAME_PASSWORD_FOR_CONNECTION_TEST: $localize`:Missing username password for connection test@@missingUsernamePasswordForConnectionTest:Missing username or password for connection test`,
MISSING_CUSTOMER_PARTNER_ID_FOR_CONNECTION_TEST: $localize`:Missing customer partner ID for connection test@@missingCustomerPartnerIdForConnectionTest:Missing customer ID or partner ID for connection test`,
ACCOUNT_MISSING_CREDENTIALS_FOR_CONNECTION_TEST: $localize`:Account missing credentials for connection test@@accountMissingCredentialsForConnectionTest:Account missing credentials for connection test`,
AUTHENTICATION_FAILED_CHECK_CREDENTIALS: $localize`:Authentication failed check credentials@@authenticationFailedCheckCredentials:Authentication failed - please check credentials`,
PARTNER_ACCOUNT_CREATED_SUCCESSFULLY: $localize`:Partner account created successfully@@partnerAccountCreatedSuccessfully:Partner account created successfully`,
ACCOUNT_AUTHENTICATION_SUCCESSFUL: $localize`:Account authentication successful@@accountAuthenticationSuccessful:Account authentication successful`,
LOADING_VENDOR_OPTIONS: $localize`:Loading vendor options@@loadingVendorOptions:Loading vendor options...`,
// Vehicle List internationalization
AGNAV_SYSTEM: $localize`:AgNav system name@@agnavSystem:AgNav`,
PARTNER_SYSTEM_DEFAULT: $localize`:Partner system default name@@partnerSystemDefault:Partner System`,
LAST_SYNC_PREFIX: $localize`:Last sync prefix@@lastSyncPrefix:Last Sync:`,
TAIL_NUMBER_PREFIX: $localize`:Tail number prefix@@tailNumberPrefix:Tail Number:`,
VALIDATING_AUTHENTICATION: $localize`:Validating authentication message@@validatingAuthentication:Validating authentication...`,
AUTHENTICATION_VALID: $localize`:Authentication valid message@@authenticationValid:Authentication valid`,
AUTHENTICATION_FAILED_WITH_ERROR: $localize`:Authentication failed with error@@authenticationFailedWithError:Authentication failed -`,
NO_SYSTEM_ACCOUNT_FOUND: $localize`:No system account found error@@noSystemAccountFound:No system account found`,
MISSING_CREDENTIALS: $localize`:Missing credentials error@@missingCredentials:Missing credentials`,
AUTHENTICATION_FAILED_SHORT: $localize`:Authentication failed short@@authenticationFailedShort:Authentication failed`,
// Job Assignment internationalization
N_A: $localize`:Not available abbreviation@@notAvailable:N/A`,
UNKNOWN_PARTNER: $localize`:Unknown partner fallback@@unknownPartner:Unknown`,
PARTNER_ACCOUNT_DOES_NOT_EXIST: $localize`:Partner account does not exist error@@partnerAccountDoesNotExist:Partner account does not exist`,
PARTNER_AUTHENTICATION_FAILED: $localize`:Partner authentication failed error@@partnerAuthenticationFailed:Partner authentication failed`,
AUTHENTICATION_VALIDATION_FAILED: $localize`:Authentication validation failed error@@authenticationValidationFailed:Authentication validation failed`,
NO_CUSTOMER_ID_FOR_AUTH_VALIDATION: $localize`:No customer ID for authentication validation@@noCustomerIdForAuthValidation:No current customer ID available for authentication validation`,
NO_PARTNER_ID_FOR_AUTH_VALIDATION: $localize`:No partner ID for authentication validation@@noPartnerIdForAuthValidation:No partner ID available for authentication validation`,
AUTHENTICATION_FAILURE_REASON: $localize`:Authentication failure reason@@authenticationFailureReason:authentication failure`,
SATLOC_AUTHENTICATION_FAILED: $localize`:Satloc authentication failed@@satlocAuthenticationFailed:Failed to authenticate with Satloc - please check username and password`,
PACKAGE_NOT_ENABLED_WARNING: $localize`:Package not enabled warning@@packageNotEnabledWarning:Package not enabled - cannot assign to job`,
PACKAGE_NOT_ENABLED_REASON: $localize`:Package not enabled reason@@packageNotEnabledReason:package not enabled`,
PARTNER_AIRCRAFT_DEFAULT: $localize`:Partner aircraft default tooltip@@partnerAircraftDefault:Partner Aircraft`,
SATLOC_AIRCRAFT_PREFIX: $localize`:Satloc aircraft prefix for notes@@satlocAircraftPrefix:Satloc aircraft:`,
// Enhanced aircraft tooltip labels
AIRCRAFT_TYPE_PREFIX: $localize`:Aircraft type prefix@@aircraftTypePrefix:Type:`,
SYNC_STATUS_PREFIX: $localize`:Sync status prefix@@syncStatusPrefix:Sync:`,
STATUS_PREFIX: $localize`:Status prefix@@statusPrefix:Status:`,
AIRCRAFT_STATUS_PREFIX: $localize`:Aircraft status prefix@@aircraftStatusPrefix:Status:`,
AIRCRAFT_STATUS_INACTIVE: $localize`:Aircraft status inactive@@aircraftStatusInactive:Inactive`,
AIRCRAFT_STATUS_PACKAGE_DISABLED: $localize`:Aircraft status package disabled@@aircraftStatusPackageDisabled:Package Disabled`,
// Vehicle Edit tooltip internationalization
SAVE_TOOLTIP_NO_ACCOUNT: $localize`:Save tooltip for missing partner account@@saveTooltipNoAccount:Aircraft will be saved with basic AgMission data. Create partner account to enable enhanced features.`,
SAVE_TOOLTIP_AUTH_FAILED: $localize`:Save tooltip for auth failed@@saveTooltipAuthFailed:Aircraft will be saved with basic AgMission data. Fix authentication to enable partner enhancement features.`,
SAVE_TOOLTIP_BASE_MESSAGE: $localize`:Save tooltip base message@@saveTooltipBaseMessage:Aircraft will be saved with full AgMission +`,
SAVE_TOOLTIP_INTEGRATION_SUFFIX: $localize`:Save tooltip integration suffix@@saveTooltipIntegrationSuffix:integration.`,
SAVE_TOOLTIP_NATIVE: $localize`:Save tooltip for native aircraft@@saveTooltipNative:Aircraft will be saved as AgMission native aircraft.`,
GENERIC_PARTNER: $localize`:Generic partner name@@genericPartner:partner`,
// Save before test dialog labels
SAVE_BEFORE_TEST_TITLE: $localize`:Save before test dialog title@@saveBeforeTestTitle:Save Changes Before Testing`,
SAVE_BEFORE_TEST_MESSAGE: $localize`:Save before test message@@saveBeforeTestMessage:You have modified the credentials. The system must save these changes before testing to ensure accurate validation.`,
SAVE_BEFORE_TEST_WARNING_TITLE: $localize`:Save before test warning title@@saveBeforeTestWarningTitle:Unsaved Changes Detected`,
SAVE_BEFORE_TEST_WARNING_MESSAGE: $localize`:Save before test warning message@@saveBeforeTestWarningMessage:Testing requires the latest credentials to be saved in the database for accurate partner authentication.`,
SAVE_AND_TEST_BUTTON: $localize`:Save and test button label@@saveAndTestButton:Save and Test`,
CANCEL_BUTTON: $localize`:Cancel button label@@cancelButton:Cancel`,
// Post-save validation labels (Phase 4)
// Note: Success labels removed - navigation happens immediately, so success message never displays
POST_SAVE_VALIDATION_FAILED_TITLE: $localize`:Post-save validation failed title@@postSaveValidationFailedTitle:Authentication Failed`,
VALIDATING_CREDENTIALS: $localize`:Validating credentials message@@validatingCredentials:Validating saved credentials...`,
// Vehicle activation labels for partner systems
VEHICLE_ACTIVATION: $localize`:Vehicle activation section title@@vehicleActivation:Vehicle Activation`,
PARTNER_ACCOUNT_REQUIRED_FOR_ACTIVATION: $localize`:Partner account required for activation@@partnerAccountRequiredForActivation:Partner system account required before activating vehicle`,
PARTNER_AUTH_REQUIRED_FOR_ACTIVATION: $localize`:Partner auth required for activation@@partnerAuthRequiredForActivation:Valid partner authentication required before activating vehicle`,
PARTNER_AIRCRAFT_REQUIRED_FOR_ACTIVATION: $localize`:Partner aircraft required for activation@@partnerAircraftRequiredForActivation:Partner aircraft selection required before activating vehicle`,
// ARIA accessibility labels for vehicle list
SYSTEM_TYPE_PREFIX: $localize`:System type ARIA prefix@@systemTypePrefix:System type:`,
PARTNER_SYSTEM_PREFIX: $localize`:Partner system ARIA prefix@@partnerSystemPrefix:Partner system:`,
AUTHENTICATION_IN_PROGRESS: $localize`:Authentication in progress ARIA@@authenticationInProgress:authentication in progress`,
AUTHENTICATION_SUCCESSFUL: $localize`:Authentication successful ARIA@@authenticationSuccessful:authenticated successfully`,
SYNCHRONIZED: $localize`:Synchronized status@@synchronized:Synchronized`,
SYNCHRONIZING: $localize`:Synchronizing status@@synchronizing:Synchronizing`,
SYNC_ERROR: $localize`:Sync error status@@syncError:Sync error`,
// ARIA accessibility labels for assignment status
PROCESSING_ASSIGNMENT: $localize`:Processing assignment@@processingAssignment:Processing assignment`,
// Job Assignment UI tooltip enhancements
ASSIGN_BUTTON_ARCHIVED_TOOLTIP: $localize`:Assign button archived tooltip@@assignButtonArchivedTooltip:Cannot assign aircraft to archived jobs`,
ASSIGN_BUTTON_NO_BOUNDARY_TOOLTIP: $localize`:Assign button no boundary tooltip@@assignButtonNoBoundaryTooltip:Job must have spray areas or exclusion zones before assignment`,
ASSIGN_BUTTON_READY_TOOLTIP: $localize`:Assign button ready tooltip@@assignButtonReadyTooltip:Assign selected aircraft to this job`,
PICK_LIST_SOURCE_TOOLTIP: $localize`:Pick list source tooltip@@pickListSourceTooltip:Available aircraft - drag or use arrows to assign to job`,
PICK_LIST_TARGET_TOOLTIP: $localize`:Pick list target tooltip@@pickListTargetTooltip:Assigned aircraft - drag or use arrows to remove from job`,
DOWNLOAD_OPTIONS_DROPDOWN_TOOLTIP: $localize`:Download options dropdown tooltip@@downloadOptionsDropdownTooltip:Select job download format - options vary by aircraft type`,
CLEAR_ASSIGNMENT_STATUS_TOOLTIP: $localize`:Clear assignment status tooltip@@clearAssignmentStatusTooltip:Clear assignment status history for this job`,
ASSIGNMENT_STATUS_TABLE_TOOLTIP: $localize`:Assignment status table tooltip@@assignmentStatusTableTooltip:Real-time assignment status tracking with actions for each aircraft`,
// Assignment status icon tooltips
ASSIGNMENT_STATUS_NEW_TOOLTIP: $localize`:Assignment status new tooltip@@assignmentStatusNewTooltip:Assignment pending - waiting for processing`,
ASSIGNMENT_STATUS_DOWNLOADED_TOOLTIP: $localize`:Assignment status downloaded tooltip@@assignmentStatusDownloadedTooltip:Assignment completed - job downloaded to aircraft`,
ASSIGNMENT_STATUS_UPLOADED_TOOLTIP: $localize`:Assignment status uploaded tooltip@@assignmentStatusUploadedTooltip:Assignment completed - job uploaded to partner system`,
ASSIGNMENT_STATUS_ERROR_TOOLTIP: $localize`:Assignment status error tooltip@@assignmentStatusErrorTooltip:Assignment failed - check error details`,
// Partner integration workflow step labels
INTEGRATION_PROGRESS_LABEL: $localize`:Integration progress label@@integrationProgressLabel:Partner integration progress`,
VALIDATE_PARTNER_ACCOUNT: $localize`:Validate partner account step@@validatePartnerAccount:Validate Partner Account`,
SELECT_PARTNER_AIRCRAFT: $localize`:Select partner aircraft step@@selectPartnerAircraft:Select Partner Aircraft`,
COMPLETE_VALIDATION_FIRST: $localize`:Complete validation first placeholder@@completeValidationFirst:Complete partner validation first`,
AIRCRAFT_SELECTION_AVAILABLE_AFTER_VALIDATION: $localize`:Aircraft selection available after validation@@aircraftSelectionAvailableAfterValidation:Aircraft selection will be available after successful partner account validation`,
PARTNER_VALIDATION_REQUIRED_TITLE: $localize`:Partner validation required title@@partnerValidationRequiredTitle:Partner Validation Required`,
// Aircraft selection validation constraints
AIRCRAFT_SELECTION_REQUIRED_TITLE: $localize`:Aircraft selection required title@@aircraftSelectionRequiredTitle:Available Aircraft Required`,
AIRCRAFT_SELECTION_REQUIRED_MESSAGE: $localize`:Aircraft selection required message@@aircraftSelectionRequiredMessage:Please select an available aircraft from the partner system to continue.`,
SYSTEM_TYPE_REQUIRED_TITLE: $localize`:System type required title@@systemTypeRequiredTitle:System Type Required`,
SYSTEM_TYPE_REQUIRED_MESSAGE: $localize`:System type required message@@systemTypeRequiredMessage:Please select a system type for the Satloc aircraft configuration.`,
PARTNER_INTEGRATION_INCOMPLETE_TITLE: $localize`:Partner integration incomplete title@@partnerIntegrationIncompleteTitle:Partner Integration Incomplete`,
PARTNER_INTEGRATION_INCOMPLETE_MESSAGE: $localize`:Partner integration incomplete message@@partnerIntegrationIncompleteMessage:Complete all required partner integration steps to enable aircraft creation.`,
// Account completion reminder messages
ACCOUNT_INCOMPLETE_TITLE: $localize`:Account incomplete title@@accountIncompleteTitle:Account Information Incomplete`,
ACCOUNT_INCOMPLETE_MESSAGE: $localize`:Account incomplete message@@accountIncompleteMessage:Username, password, and active status are required for a complete account. The aircraft will be saved but the account will remain inactive until all required fields are completed.`,
// Partner-managed field messages
PARTNER_SYSTEM_MANAGED_TITLE: $localize`:Partner system managed title@@partnerSystemManagedTitle:Partner System Managed`,
TAIL_NUMBER_PARTNER_MANAGED_MESSAGE: $localize`:Tail number partner managed message@@tailNumberPartnerManagedMessage:Tail number is managed by the partner system. Changes must be made in the partner system to update this field.`,
// Field requirement tooltips
REQUIRED_FOR_PARTNER_INTEGRATION_TOOLTIP: $localize`:Required for partner integration tooltip@@requiredForPartnerIntegrationTooltip:Required for partner integration`,
REQUIRED_FOR_SATLOC_INTEGRATION_TOOLTIP: $localize`:Required for Satloc integration tooltip@@requiredForSatlocIntegrationTooltip:Required for Satloc integration`,
SELECT_SYSTEM_TYPE_PLACEHOLDER: $localize`:Select system type placeholder@@selectSystemTypePlaceholder:Select System Type`,
SYSTEM_TYPE: $localize`:System type label@@systemType:System Type`,
SYSTEM_TYPE_SELECTION_REQUIRED: $localize`:System type selection required@@systemTypeSelectionRequired:System type selection required`,
SYSTEM_TYPE_SELECTION_TOOLTIP: $localize`:System type selection tooltip@@systemTypeSelectionTooltip:Select the Satloc system type for this aircraft to ensure proper integration and data synchronization`,
// Package activation reminder tooltip
PACKAGE_ACTIVATION_REMINDER: $localize`:Package activation reminder@@packageActivationReminder:Your new aircraft is ready! Activate the package to enable job assignment and make this aircraft available for operations.`,
ACTIVATE_PACKAGE_ACTION: $localize`:Activate package action@@activatePackageAction:Activate Package`,
AIRCRAFT_READY_TITLE: $localize`:Aircraft ready title@@aircraftReadyTitle:Aircraft Ready`,
// Package limit management
PACKAGE_LIMIT_REACHED_TITLE: $localize`:Package limit reached title@@packageLimitReachedTitle:Package Limit Reached`,
PACKAGE_LIMIT_REACHED_MESSAGE: $localize`:Package limit reached message@@packageLimitReachedMessage:You've reached your package activation limit`,
MANAGE_PACKAGE_LIMIT_ACTION: $localize`:Manage package limit action@@managePackageLimitAction:Manage Limits`,
PACKAGE_ACTIVATED_SUCCESS: $localize`:Package activated success@@packageActivatedSuccess:Package activated successfully! Aircraft is now available for job assignment.`,
SUCCESS_TITLE: $localize`:Success title@@successTitle:Success`,
PACKAGE_LIMIT_UPGRADE_MESSAGE: $localize`:Package limit upgrade message@@packageLimitUpgradeMessage:To activate more aircraft, please upgrade your package or deactivate an existing aircraft to make room for this one.`,
UPGRADE_REQUIRED_TITLE: $localize`:Upgrade required title@@upgradeRequiredTitle:Upgrade Required`,
// Aircraft ready tooltip - conditional display (edge case messaging)
AIRCRAFT_NOT_READY_NO_CREDENTIALS: $localize`:Aircraft not ready no credentials@@aircraftNotReadyNoCredentials:Complete account credentials (username, password) and activate the account before enabling package activation.`,
AIRCRAFT_NOT_READY_LIMIT_REACHED: $localize`:Aircraft not ready limit reached@@aircraftNotReadyLimitReached:Package activation limit reached. Upgrade your plan or deactivate another aircraft to proceed.`,
// Trial Checkout Payment Page - Charge Date Banner (Solution A)
YOUR_TRIAL_ACTIVE_UNTIL: $localize`:Trial active until label@@yourTrialActiveUntil:Your trial is active until`,
YOUR_SUBSCRIPTION_AFTER_TRIAL: $localize`:Subscription after trial header@@yourSubscriptionAfterTrial:Your Subscription After Trial Ends`,
ITEMS: $localize`:Items column header@@items:Items`,
PRICE: $localize`:Price column header@@price:Price`,
PAID_PRICE: $localize`:Paid price label@@paidPrice:Paid Price`,
PLUS_APPLICABLE_TAX: $localize`:Plus applicable tax@@plusApplicableTax:Plus Applicable Tax`,
SUBTOTAL: $localize`:Subtotal label@@subtotal:Subtotal`,
TAX_ESTIMATED: $localize`:Tax estimated label@@taxEstimated:Tax (estimated)`,
TOTAL_BEFORE_TAX: $localize`:Total before tax label@@totalBeforeTax:Total Before Tax`,
// Trial Checkout Confirm Page - Charge Date Banner (Solution A)
TRIAL_ACTIVE_UNTIL_CONFIRM: $localize`:Trial active until confirm@@trialActiveUntilConfirm:Your trial is active until`,
CHARGED_ON_THAT_DATE: $localize`:Charged on that date@@chargedOnThatDate:You will be charged on that date.`,
NO_CHARGE_TODAY_CONFIRM: $localize`:No charge today confirm@@noChargeTodayConfirm:No charge will be made today`,
AIRCRAFT_NOT_READY_AUTH_FAILED: $localize`:Aircraft not ready auth failed@@aircraftNotReadyAuthFailed:Partner authentication failed. Verify credentials and retry before activating package.`,
// Subscription Status Badge Labels
SUBSCRIPTION_STATUS_ACTIVE: $localize`:Subscription status active@@subscriptionStatusActive:Active`,
SUBSCRIPTION_STATUS_TRIAL: $localize`:Subscription status trial@@subscriptionStatusTrial:Trial`,
SUBSCRIPTION_STATUS_PAST_DUE: $localize`:Subscription status past due@@subscriptionStatusPastDue:Past Due`,
SUBSCRIPTION_STATUS_CANCELED: $localize`:Subscription status canceled@@subscriptionStatusCanceled:Canceled`,
SUBSCRIPTION_STATUS_INCOMPLETE: $localize`:Subscription status incomplete@@subscriptionStatusIncomplete:Incomplete`,
// Promo Display Labels
PROMO_DISCOUNT_LABEL: $localize`:Promo discount label@@promoDiscountLabel:Discount:`,
PROMO_EXPIRES_LABEL: $localize`:Promo expires label@@promoExpiresLabel:Expires:`,
PROMO_DURATION_LABEL: $localize`:Promo duration label@@promoDurationLabel:Duration:`,
LOADING_TEXT: $localize`:Loading text@@loadingText:Loading...`
});
// Partner system types - matching backend constants
export enum SystemTypes {
PLATINUM = 'platinum',
TITANIUM = 'titanium',
G4 = 'g4',
BANTAM2 = 'bantam2',
FALCON = 'falcon'
}
export const Roles: any = Object.freeze({
[RoleIds.ADMIN]: $localize`:System Admin User Type@@sysAdminUType:System Admin`,
[RoleIds.APP]: $localize`:Applicator/Master User Type@@masterUType:Master`,
[RoleIds.APP_ADM]: $localize`:Office Admin User Type@@adminUType:Admin`,
[RoleIds.CLIENT]: $localize`:Client User Type@@clientUType:Client`,
[RoleIds.OFFICER]: $localize`:Officer User Type@@officerUType:Officer`,
[RoleIds.PILOT]: $localize`:Pilot/Operator User Type@@pilotUType:Pilot`,
[RoleIds.INSPECTOR]: $localize`:Inspector User Type@@inspectorUType:Inspector`,
[RoleIds.DEVICE]: $localize`:Aircraft User Type@@airCraftUType:Aircraft`,
[RoleIds.VENDOR]: $localize`:Vendor User Type@@vendorUType:Vendor`,
[RoleIds.PARTNER]: $localize`:Partner Organization Type@@partnerUType:Partner`,
[RoleIds.PARTNER_SYSTEM_USER]: $localize`:Partner System User Type@@partnerSystemUserUType:Partner System`
});
export const globals = Object.freeze({
confirmSaveJobMsg: $localize`:Save Job confirmation message@@confirmSaveJobMsg:Do you want to save the Job ?`,
confirmDeleteThing: $localize`:@@deleteThingConfirm:Delete the #thing# ?`,
usernameExistedVal: $localize`:@@userNameTakenVal:The Username was taken. Please try another.`,
usernameReqVal: $localize`:@@usernameReqVal:Username is required`,
usernameInvalidVal: $localize`:@@usernameInvalidVal:Valid Username is an email address`,
all: $localize`:@@all:All`,
statusNew: $localize`:@@new:New`,
statusReady: $localize`:@@ready:Ready`,
statusDownloaded: $localize`:@@downloaded:Downloaded`,
statusUploaded: $localize`:@@uploaded:Uploaded`,
statusError: $localize`:@@error:Error`,
statusSprayed: $localize`:@@sprayed:Sprayed`,
statusArchived: $localize`:@@archived:Archived`,
statusInvoiced: $localize`:@@invoiced:Invoiced`,
// Assignment status messages
assignmentInProgress: $localize`:@@assignmentInProgress:Assignment in progress...`,
assignmentDownloaded: $localize`:@@assignmentDownloaded:Assignment downloaded to aircraft`,
assignmentCompleted: $localize`:@@assignmentCompleted:Assignment completed successfully`,
assignmentFailed: $localize`:@@assignmentFailed:Assignment failed`,
unknownStatus: $localize`:@@unknownStatus:Unknown status`,
// Assignment warning messages
noAircraftSelectedForAssignment: $localize`:@@noAircraftSelectedForAssignment:No aircraft selected for assignment`,
failedToRefreshAssignmentStatus: $localize`:@@failedToRefreshAssignmentStatus:Failed to refresh assignment status`,
noAircraftWithAssignmentStatusFound: $localize`:@@noAircraftWithAssignmentStatusFound:No aircraft with assignment status found to re-assign`,
noAircraftDetailsFoundForReassignment: $localize`:@@noAircraftDetailsFoundForReassignment:No aircraft details found for re-assignment`,
// Assignment action labels
clearStatus: $localize`:@@clearStatus:Clear Status`,
resetToAvailable: $localize`:@@resetToAvailable:Reset to Available`,
noReload: $localize`:@@notReload:No reload`,
reloadByMinutes: $localize`:@@reloadEvery#Minutes:Reload every #count# minutes`,
active: $localize`:@@active:Active`,
packageActive: $localize`:@@packageActive:Package Active`,
notActive: $localize`:@@notActive:Not Active`,
name: $localize`:@@name:Name`,
address: $localize`:@@address:Address`,
userName: $localize`:@@userName:UserName`,
contact: $localize`:@@contact:Contact`,
phone: $localize`:@@phone:Phone`,
email: $localize`:@@email:Email`,
desc: $localize`:@@description:Description`,
unitId: $localize`:@@unitId:UnitId`,
partner: $localize`:@@partner:Partner`,
agnav: 'AgNav .no1',
agnavPrj: 'AgNav .prj',
esriShape: 'ESRI .shp',
mapOnly: $localize`:@@mapOnly:Map Only`,
ac: 'Ac',
ha: 'Ha',
acre: 'Acre',
hectare: 'Hectare',
ozPerAc: 'oz/ac',
ozsPerAcre: 'ounces/acre',
galPerAc: 'gal/ac',
galsPerAcre: 'gallons/acre',
lbPerAc: 'lbs/ac',
lbsPerAccre: 'pounds/arce',
litPerHa: 'lit/ha',
litsPerHectare: 'liters/hectare',
kgPerHa: 'kg/ha',
kgsPerHectare: 'kilograms/hectar',
num: $localize`:@@Num:N°`,
agl: $localize`:@@AGL:AGL`,
amsl: $localize`:@@AMSL:AMSL`,
done: $localize`:@@done:Done`,
importing: $localize`:@@importing:Importing`,
cancel: $localize`:@@cancel:Cancel`,
cancelling: $localize`:@@cancelling:Cancelling`,
cancelled: $localize`:@@cancelled:Cancelled`,
yes: $localize`:@@yes:Yes`,
no: $localize`:@@no:No`,
showPwd: $localize`:@@showPwd:Show password`,
hidePwd: $localize`:@@hidePwd:Hide password`,
spray: $localize`:@@spray:Spray`,
exclusion: $localize`:@@exclusion:Exclusion`,
xcl: $localize`:@@xcl:XCL`,
wpt: $localize`:@@wpt:WPT`,
buffer: $localize`:@@buffer:Buffer`,
place: $localize`:@@place:Place`,
noName: $localize`:@@noName:NoName`,
tap: $localize`:@@tap:Tap`,
click: $localize`:@@click:Click`,
clearAll: $localize`:@@clearAll:Clear all`,
from: $localize`:@@from:From`,
color: $localize`:@@color:Color`,
blue: $localize`:@@blue:Blue`,
green: $localize`:@@green:Green`,
yellow: $localize`:@@yellow:Yellow`,
purple: $localize`:@@purple:Purple`,
black: $localize`:@@black:Black`,
orange: $localize`:@@orange:Orange`,
red: $localize`:@@red:Red`,
gray: $localize`:@@gray:Gray`,
darkblue: $localize`:@@darkblue:DarkBlue`,
darkcyan: $localize`:@@darkcyan:DarkCyan`,
darkgreen: $localize`:@@darkgreen:DarkGreen`,
lime: $localize`:@@lime:Lime`,
brown: $localize`:@@brown:Brown`,
// Items
sprayZone: $localize`:@@sprayZone:Spray Zone`,
pivotZone: $localize`:@@pivotZone:Pivot Spray Zone`,
xclZone: $localize`:@@xclZone:Exclusion Zone`,
waypoint: $localize`:@@waypoint:WayPoint`,
bufferZone: $localize`:@@bufferZone:Buffer Zone`,
edgeBufferZone: $localize`:@@edgeBufferZone:Advanced Buffer Tools`,
placeMark: $localize`:@@placeMark:PlaceMark`,
obstacle: $localize`:@@obstacle:Obstacle`,
userObstacle: $localize`:@@userObstacle:User Obstacles`,
// Map Tiles/Layers
satellite: $localize`:@@satellite:Satellite`,
streetMap: $localize`:@@streetMap:Street Map`,
obstacles: $localize`:@@obstacles:Obstacles`,
mapLabels: $localize`:@@mapLabels:Map Labels`,
mapStreets: $localize`:@@mapStreets:Map Streets`,
gridLines: $localize`:@@gridLines:Grid Lines`,
flightPaths: $localize`:@@flightPaths:Flight Paths`,
andHigher: $localize`:@@andHigher:and higher`,
windSpeed: $localize`:@@windSpeed:Wind Speed`,
windDirection: $localize`:@@windDirection:Wind Direction`,
temperature: $localize`:@@temperature:Temperature`,
humidity: $localize`:@@humidity:Humidity`,
precip: $localize`:@@precip:Precip.`,
pressure: $localize`:@@pressure:Pressure`,
details: $localize`:@@details:Details`,
poweredBy: $localize`:Weather Api attribution.@@poweredBy:Powered by`,
load: $localize`:@@load:Load`,
create: $localize`:@@create:Create`,
save: $localize`:@@save:Save`,
delete: $localize`:@@delete:Delete`,
back: $localize`:@@back:Back`,
assign: $localize`:@@assign:Assign`,
download: $localize`:@@download:Download`,
map: $localize`:@@map:Map`,
send: $localize`:@@send:Send`,
myLoc: $localize`:@@myLoc:My Location`,
doThingsFailed: $localize`:@@loadItemFailed:#do# #thing# failed`,
doThingsSuccess: $localize`:@@loadItemSuccess:#do# #thing# success`,
deleteEntFailedWR: $localize`:@@deleteEntFailedWR:The #item# is being used in at least one Job`,
deleteEntFailedWRL: $localize`:@@deleteEntFailedWRL:The #item# is being used in at least one Job or Library`,
locDisabled: $localize`:@@locDisabled:Please enable Location`,
locNA: $localize`:@@locNA:Location is not available`,
edit: $localize`:@@edit:Edit`,
addToLib: $localize`:@@addToLib:Add to Library`,
none: $localize`:@@none:None`,
server500Err: $localize`:@@backendErr:We're currently experiencing some technical issues. Please try again shortly. If the issue persists, feel free to reach out to our support team.`,
inactive: $localize`:@@inactive:inactive`,
invoice: $localize`:@@invoice:invoice`,
invoiceSetting: $localize`:@@invoiceSetting:invoice setting`,
customers: $localize`:@@customers:Customers`,
customer: $localize`:@@customer:Customer`,
accounts: $localize`:@@accounts:Accounts`,
account: $localize`:@@account:Account`,
accountType: $localize`:@@accountType:Account Type`,
masterAcc: $localize`:@@masterAcc:Master Account`,
subAcc: $localize`:@@subAcc:Account Linked to Master Account: #account#`,
clients: $localize`:@@clients:Clients`,
client: $localize`:@@client:Client`,
jobs: $localize`:@@jobs:Jobs`,
job: $localize`:@@job:Job`,
aircraft: $localize`:@@airCraft:Aircraft`,
pilots: $localize`:@@pilots:Pilots`,
pilot: $localize`:@@pilot:pilot`,
products: $localize`:@@products:Products`,
product: $localize`:@@product:Product`,
crops: $localize`:@@crops:Crops`,
crop: $localize`:@@crop:Crop`,
item: $localize`:@@item:Item`,
selectedItems: $localize`:@@selectedItems:selected Items`,
applicationRate: $localize`:@@applicationRate:Application Rate`,
applProfile: $localize`:@@applProfile:Applicator Profile`,
userProfile: $localize`:@@userProfile:User Profile`,
package: $localize`:@@package:Package`,
maxAcres: $localize`:@@maxAcres:Max Acres`,
price: $localize`:@@price:Price`,
attention: $localize`:@@attention:Attention`,
subscription: $localize`:@@subscription:Subscription`,
subPlans: $localize`:@@subPlans:Subscription Plans`,
signupResources: $localize`:@@signupResources:Signup Resources`,
// Wireframe 1: Promotion card display labels (subscription renewal UI)
currentPrice: $localize`:Current price label@@currentPrice:Current Price`,
regularPrice: $localize`:Regular price label@@regularPrice:Regular Price`,
youSave: $localize`:You save label@@youSave:You Save`,
promotionExpires: $localize`:Promotion expires label@@promotionExpires:Promotion expires in`,
days: $localize`:Days label@@days:days`,
renewsOn: $localize`:Renews on label@@renewsOn:Renews`,
at: $localize`:At label (for pricing)@@at:at`,
discountContinues: $localize`:Discount continues label@@discountContinues:Discount continues after renewal`,
invalidFileSizeMsgS: `{0}: ${$localize`:Used in Upload function as {0}<colon> Invalid file size,@@invalidFileSize:Invalid file size`}, `,
invalidFileSizeMsgD: `${$localize`:Used in Upload function as maximum upload size is {0}.@@maxUploadSizeIs:maximum upload size is`} {0}.`,
invalidFileTypeMsgS: `{0}: ${$localize`:Used in Upload function as {0}<colon> Invalid file type, @@invalidFileType:Invalid file type`}, `,
invalidFileTypeMsgD: `${$localize`:Used in Upload function as allowed file types<colon> {0}.@@allowFileTypes:allowed file types`}: {0}.`,
emptyFilterMsg: $localize`:@@emptyFilterMsg:No results found`,
dupAreaMsg: $localize`:@@emptyFilterMsg:duplicated area was not added`,
dupAreasMsg: $localize`:@@emptyFilterMsg:duplicated areas were not added`,
addResult: $localize`:@@addResult:Add Result`,
saveChanges1stMsg: $localize`:@@saveChanges1stMsg:Please save changes first`,
unitIdTakenMsg: $localize`:@@unitIdTakenMsg:UnitId was taken. Please try another.`,
clientNAMsg: `{0}: ${$localize`:Error message when no Client exists@@clientNAMsg:At least one Client need to be defined`}, `,
zoomIn: $localize`:@@zoomIn:Zoom in`,
zoomOut: $localize`:@@zoomOut:Zoom out`,
fileTooLarge: $localize`:@@fileTooLarge:File too large (maximum 30MB)`,
notFound404: $localize`:@@notFound404:Page not found`,
itemsNotFound: $localize`:@@itemsNotFound:Job items not found`,
invalidJobFile: $localize`:@@invalidJobFile:Invalid Job File`,
wrongJobFile: $localize`:@@wrongJobFile:Zip file belongs to another job`,
jobNotFound: $localize`:@@jobNotFound:Job not found`,
corruptedZip: $localize`:@@corruptedZip:Corrupted zip file`,
duplicatedFile: $localize`:@@duplicatedFile:Duplicated file`,
reachedAreaLimit: $localize`:@@reachedAreaLimit:Reached maximum areas limit`,
noJobInfo: $localize`:@@noJobInfo:Job info not found`,
serverError: $localize`:@@serverError:Server Error. Please contact AgNav`,
defaultApiError: $localize`:@@defaultApiError:Unknown Error. Please contact AgNav Support`,
wrongCredential: $localize`:@@wrongCredential:Incorrect username or password`,
accountInActive: $localize`:@@accountInActive:Account is inactive or expired`,
invalidAccount: $localize`:@@invalidAccount:Can not login with Aircraft account`,
areasNotFound: $localize`:@@areasNotFound:Areas not found`,
invalidAreasFile: $localize`:@@invalidAreasFile:Invalid Areas file`,
shapePrjNotFound: $localize`:@@shapePrjNotFound:ESRI Shape projection (.prj) not found`,
createdDate: $localize`:@@createdDate:Created Date`,
invalidSwath: $localize`:@@invalidSwath:Can not generate gridlines. Invalid Swath Width`,
pwdChangedOk: $localize`:@@pwdChangedOk:Password changed successfully.`,
oldBrowserErrMsg: 'Your browser is not supported. Please install the latest version of Chrome/FireFox/Edge/Safari for best experience !',
subNotFound: $localize`:@@subNotFound:Subscription not found`,
pkgSubNotFound: $localize`:@@pkgSubNotFound:Package Subscription not found`,
trkSubNotFound: $localize`:@@trkSubNotFound:Tracking Subscription not found`,
reachedVehcicleLimit: $localize`:@@reachedVehcicleLimit:Reached maximum vehicles limit`,
// Console message constants for consistent logging
consoleFailedToLoadPartners: 'Failed to load partners:',
consoleFailedToLoadExistingAssignments: 'Failed to load existing assignments:',
consoleNoJobAvailableForAssignment: 'No job available for assignment',
consoleAssignmentStatusPollingError: 'Assignment status polling error:',
consoleFailedToRefreshAssignmentStatus: 'Failed to refresh assignment status:',
consolePartnerNotFoundInCache: 'Partner not found in cache for vehicle',
consoleCannotRefreshAssignmentStatus: 'Cannot refresh assignment status: No job available',
consoleMismatchStatusEntries: 'Mismatch: status entries but only aircraft details found',
weatherInfoNA: $localize`:@@weatherInfoNA:Weather Info is not yet available at the location.`,
dateRange: {
today: $localize`:@@today: Today`,
yesterday: $localize`:@@yesterday:Yesterday`,
thisweek: $localize`:@@thisweek:This Week`,
lastMonthRange: $localize`:@@last#month:Last #count# month`,
lastYearRange: $localize`:@@last#year:Last #count# year`,
},
apiErrorMsg(resp) {
switch (resp) {
case 'file_too_large':
return this.fileTooLarge;
case '404':
return this.notFound404;
case 'invalid_job_file':
return this.invalidJobFile;
case 'items_not_found':
return this.itemsNotFound;
case 'wrong_job_file':
return this.wrongJobFile;
case 'job_not_found':
return this.jobNotFound;
case 'corrupted_zip':
return this.corruptedZip;
case 'server_error':
return this.serverError;
case 'no_job_info':
return this.noJobInfo;
case 'wrong_credential':
return this.wrongCredential;
case 'acc_inactive':
return this.accountInActive;
case 'invalid_account':
return this.invalidAccount;
case 'empty_shp_file':
case 'areas_not_found':
return this.areasNotFound;
case 'invalid_areas_file':
return this.invalidAreasFile;
case 'prj_not_found':
return this.shapePrjNotFound;
case 'unitIdTaken':
return this.unitIdTakenMsg;
case 'duplicated_file':
return this.duplicatedFile;
case 'reached_area_limit':
return this.reachedAreaLimit;
case 'reached_vehicles_limit':
return this.reachedVehcicleLimit;
case 'subscription_not_found':
return this.subNotFound;
case 'pkg_subscription_not_found':
return this.pkgSubNotFound;
case 'trk_subscription_not_found':
return this.trkSubNotFound;
case '1006': // Status 200, code 1006 -> No location found matching parameter 'q' from WeatherAPI
return this.weatherInfoNA;
default:
return this.defaultApiError || 'An unknown error occurred. Please try again later or contact support.';
}
}
});
export const JobStatuses: any = Object.freeze({
[JobStatus.NEW]: globals.statusNew,
[JobStatus.READY]: globals.statusReady,
[JobStatus.DOWNLOADED]: globals.statusDownloaded,
[JobStatus.SPRAYED]: globals.statusSprayed,
[JobStatus.ARCHIVED]: globals.statusArchived,
});
export const locales = {
en: {
firstDayOfWeek: 0,
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: 'Today',
clear: 'Clear',
dateFormat: 'mm/dd/yy',
weekHeader: 'Wk'
},
pt: {
firstDayOfWeek: 1,
dayNames: ["domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"],
dayNamesShort: ["dom", "seg", "ter", "qua", "qui", "sex", "sáb"],
dayNamesMin: ["do", "se", "te", "qa", "qi", "se", "sá"],
monthNames: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
monthNamesShort: ["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"],
today: 'hoje',
clear: 'borrar',
dateFormat: 'dd/mm/yy',
weekHeader: 'Wk'
},
es: {
firstDayOfWeek: 0,
dayNames: ["Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"],
dayNamesShort: ["Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab"],
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
monthNamesShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
today: 'Hoy',
clear: 'Claro',
dateFormat: 'dd/mm/yy',
weekHeader: 'Wk'
}
}
export const GC = Object.freeze({
MAX_UP_FSIZE: 110 * 1e6, // bytes
NEW_AREA: -2147483647,
MAP_MODE: 2147483647,
MAX_TRK_DIST: 1000, // meters
MAX_ZOOM_ITEM: 17,
MIN_SWATH: 4,
HA2SM: 10000,
ACR2HA: 0.404686,
KMPH2MPS: 0.277778,
LPHA2GPA: 0.106906,
LPHA2OZPA: 13.684,
GPA2OZPA: 0.0730778,
KGPHA2LBSPA: 0.892179,
LIT2GAL: 0.264172,
KG2LB: 2.20462,
STRIPE_PK: 'pk_test_51LlCfSJxyI1MWs2Ty9utAc7QHhAa4YT6VPosvDdFtRaRQJchCLgd4NGvnarZQsCKiQUfJeOmnzs81w0AktP0N1o300Jd4q4m8n',
ccRegex: RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}$/),
emailRegex: RegExp(/^(([^<>\(\)\[\]\\.,;:\s@"]+(\.[^<>\(\)\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),
itemNameRegex: RegExp(/^([a-zA-Z0-9_\-]|[a-zA-Z0-9_\-][\sa-zA-Z0-9_\-]*[a-zA-Z0-9_\-])$/),
nameURegex: RegExp(/^[\p{L}0-9-_]+([\s][\p{L}0-9-_]+)*$/u),
leadingSpaceRegex: RegExp(/^[^\s].*$/),
passwordNoSpaceRegex: RegExp(/^\S+$/),
get fbOps() { return (<FitBoundsOptions>{ padding: [50, 50], maxZoom: this.MAX_ZOOM_ITEM }) },
colors: {
['blue']: globals.blue,
['green']: globals.green,
['yellow']: globals.yellow,
['purple']: globals.purple,
['black']: globals.black,
['orange']: globals.orange,
['red']: globals.red,
['gray']: globals.gray,
['darkblue']: globals.darkblue,
['darkcyan']: globals.darkcyan,
['darkgreen']: globals.darkgreen,
['lime']: globals.lime,
['brown']: globals.brown,
},
selAll: { label: globals.all, value: null },
selColors: [
{ label: globals.black, value: 'black' }, { label: globals.purple, value: 'purple' },
{ label: globals.blue, value: 'blue' }, { label: globals.green, value: 'green' },
{ label: globals.yellow, value: 'yellow' }, { label: globals.orange, value: 'orange' }, { label: globals.red, value: 'red' }
],
DAYS: 'days',
BYDATE: 'byDate',
selJobStatuses: [
{ label: globals.statusNew, value: JobStatus.NEW },
{ label: globals.statusReady, value: JobStatus.READY },
{ label: globals.statusDownloaded, value: JobStatus.DOWNLOADED },
{ label: globals.statusSprayed, value: JobStatus.SPRAYED },
{ label: globals.statusArchived, value: JobStatus.ARCHIVED }
],
selSprZoneColors: [
{ label: globals.blue, value: 'blue' },
{ label: globals.green, value: 'green' },
{ label: globals.yellow, value: 'yellow' },
{ label: globals.orange, value: 'orange' },
{ label: globals.purple, value: 'purple' }
],
selProdTypes: [
{ label: ProdTypes[ProdType.ACTIVE], value: ProdType.ACTIVE },
{ label: ProdTypes[ProdType.CARRIER], value: ProdType.CARRIER },
]
});
export const invoiceStatus = Object.freeze({
NEW: 'new',
DRAFT: 'draft',
OPEN: 'open',
PAID: 'paid',
VOID: 'void',
UNCOLLECTIBLE: 'uncollectible'
});
export enum CostingItemType {
BY_ACRE = 0,
BY_HA = 1,
BY_AMOUNT = 2
}
export enum CostingItemUnit {
OZ = 0,
GAL = 1,
LB = 2,
LIT = 3,
KG = 4,
ACRE = 5,
HA = 6,
HOUR = 7
}
export const jobListStatus = Object.freeze({
ALL: 'all',
NEW: 'new',
READY: 'ready',
DOWNLOAD: 'download',
SPRAY: 'spray',
INVOICED: 'invoiced'
});
export const jobInvoiceStatus = Object.freeze({
NONE: 'none',
INVOICED: 'invoiced'
})
export const maxLogoSize = 5;
export const allowedLogoFormats = ['image/jpeg', 'image/png', 'image/jpg'];
export const allowedLogoFileExt = ['.JPEG', '.JPG', '.PNG'];
/**
* Generic error handler that processes errors through a chain of middleware functions.
*
* This function iterates through a series of middleware functions, passing each the provided parameters.
* The first middleware that returns a truthy value (an error) will cause the chain to stop,
* and that error will be returned. If no middleware returns an error, a default error is returned.
*
* @param {any} params - The parameters object containing error information to be processed by middleware
* @param {...Function} funcs - One or more middleware functions that will process the error
* @returns {any} The first error returned by any middleware, or a default error message if all middleware return falsy
*
* @example
* // Basic usage with a single middleware function
* return errorHandler(error, handleAppError);
*
* @example
* // Usage with multiple middleware functions that are processed in order
* return errorHandler(error, handleNetworkError, handleAuthError, handleBusinessError);
*/
export const errorHandler = (params, ...funcs) => {
for (const middlewareFunc of funcs) {
const error = middlewareFunc.call(this, params);
const hasError = !!error;
if (hasError) {
return error
} else {
return globals.defaultApiError;
};
}
}
export const AC = 'aircraft';