Skip to content

Admin billing accounts: always set payment_terms_id = 1 when send update #1095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import _ from 'lodash'
import classNames from 'classnames'
import moment from 'moment'

import { EnvironmentConfig } from '~/config'
import {
Button,
InputDatePicker,
Expand Down Expand Up @@ -133,7 +134,7 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
name: billingAccount.name,
paymentTerms: billingAccount.paymentTerms
? parseInt(billingAccount.paymentTerms, 10) ?? 0
: undefined,
: EnvironmentConfig.ADMIN.DEFAULT_PAYMENT_TERMS,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider checking if EnvironmentConfig.ADMIN.DEFAULT_PAYMENT_TERMS is defined and valid before using it as a fallback value. This ensures that the application does not encounter unexpected behavior if the configuration is missing or incorrect.

poNumber: billingAccount.poNumber,
salesTax: billingAccount.salesTax,
startDate: billingAccount.startDate,
Expand Down
1 change: 1 addition & 0 deletions src/config/environments/default.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const ADMIN = {
AV_SCAN_SCORER_REVIEW_TYPE_ID: '68c5a381-c8ab-48af-92a7-7a869a4ee6c3',
CHALLENGE_URL: 'https://www.topcoder-dev.com/challenges',
CONNECT_URL: 'https://connect.topcoder-dev.com',
DEFAULT_PAYMENT_TERMS: 1,
DIRECT_URL: 'https://www.topcoder-dev.com/direct',
ONLINE_REVIEW_URL: 'https://software.topcoder-dev.com/review',
WORK_MANAGER_URL: 'https://challenges.topcoder-dev.com',
Expand Down
1 change: 1 addition & 0 deletions src/config/environments/global-config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface GlobalConfig {
},
ADMIN: {
CONNECT_URL: string
DEFAULT_PAYMENT_TERMS: number
DIRECT_URL: string
WORK_MANAGER_URL: string
ONLINE_REVIEW_URL: string
Expand Down
1 change: 1 addition & 0 deletions src/config/environments/prod.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const ADMIN = {
AV_SCAN_SCORER_REVIEW_TYPE_ID: '55bbb17d-aac2-45a6-89c3-a8d102863d05',
CHALLENGE_URL: 'https://www.topcoder.com/challenges',
CONNECT_URL: 'https://connect.topcoder.com',
DEFAULT_PAYMENT_TERMS: 1,
DIRECT_URL: 'https://www.topcoder.com/direct',
ONLINE_REVIEW_URL: 'https://software.topcoder.com/review',
WORK_MANAGER_URL: 'https://challenges.topcoder.com',
Expand Down