Skip to content

Commit

Permalink
Add declare button
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Aug 30, 2024
1 parent dcdb6ec commit 7bc6a30
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 64 deletions.
40 changes: 33 additions & 7 deletions clients/banking/src/components/MerchantProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
spacings,
} from "@swan-io/lake/src/constants/design";
import { showToast } from "@swan-io/lake/src/state/toasts";
import { identity } from "@swan-io/lake/src/utils/function";
import { filterRejectionsToResult } from "@swan-io/lake/src/utils/gql";
import { isNotNullish } from "@swan-io/lake/src/utils/nullish";
import { LakeModal } from "@swan-io/shared-business/src/components/LakeModal";
Expand All @@ -40,6 +41,7 @@ import {
} from "../graphql/partner";
import { formatNestedMessage, t } from "../utils/i18n";
import { GetRouteParams, Router } from "../utils/routes";
import { useTgglFlag } from "../utils/tggl";
import { CheckDeclarationWizard } from "./CheckDeclarationWizard";
import {
MerchantProfilePaymentMethodCardRequestModal,
Expand All @@ -61,11 +63,11 @@ const styles = StyleSheet.create({
flexShrink: 1,
flexGrow: 1,
paddingHorizontal: spacings[24],
paddingTop: spacings[32],
paddingTop: spacings[4],
},
contentDesktop: {
paddingHorizontal: spacings[40],
paddingTop: spacings[40],
paddingTop: spacings[16],
},
merchantNameContainer: {
flex: 1,
Expand Down Expand Up @@ -105,9 +107,9 @@ const styles = StyleSheet.create({
marginRight: negativeSpacings[16],
},
stepDot: {
backgroundColor: colors.partner[50],
backgroundColor: colors.current[50],
borderWidth: 1,
borderColor: colors.partner[100],
borderColor: colors.current[100],
borderRadius: 12,
alignItems: "center",
justifyContent: "center",
Expand All @@ -116,7 +118,7 @@ const styles = StyleSheet.create({
},
stepDotText: {
fontFamily: fonts.primary,
color: colors.partner[500],
color: colors.current[500],
textAlign: "center",
fontSize: 14,
lineHeight: 24,
Expand Down Expand Up @@ -456,6 +458,8 @@ export const MerchantProfileSettings = ({
params,
onUpdate,
}: Props) => {
const checkDeclarationEnabled = useTgglFlag("checks");

const [requestMerchantPaymentMethods] = useMutation(RequestMerchantPaymentMethodsDocument);
const [isEditModalOpen, setIsEditModalOpen] = useState(false);

Expand Down Expand Up @@ -513,6 +517,28 @@ export const MerchantProfileSettings = ({

return (
<ScrollView contentContainerStyle={[styles.content, large && styles.contentDesktop]}>
{Option.all([checkDeclarationEnabled, checkPaymentMethod.flatMap(identity)]).isSome() && (
<>
<Box direction="row" alignItems="center">
<LakeButton
icon="check-regular"
size="small"
color="current"
onPress={() => {
Router.push("AccountMerchantsProfileSettings", {
...params,
check: "declare",
});
}}
>
{t("merchantProfile.declareCheckButton")}
</LakeButton>
</Box>

<Space height={32} />
</>
)}

<LakeHeading level={2} variant="h4">
{t("merchantProfile.settings.information.title")}
</LakeHeading>
Expand Down Expand Up @@ -1118,7 +1144,7 @@ export const MerchantProfileSettings = ({
<Step number={2}>
{formatNestedMessage("check.next.description.step2", {
colored: text => (
<LakeText variant="smallMedium" color={colors.partner[500]}>
<LakeText variant="smallMedium" color={colors.current[500]}>
{text}
</LakeText>
),
Expand All @@ -1128,7 +1154,7 @@ export const MerchantProfileSettings = ({
<Space height={40} />

<LakeButton
color="partner"
color="current"
onPress={() => {
Router.push("AccountMerchantsProfileSettings", {
...params,
Expand Down
1 change: 1 addition & 0 deletions clients/banking/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@
"merchantProfile.area.paymentLinks": "Payment links",
"merchantProfile.area.payments": "Payments",
"merchantProfile.area.settings": "Settings",
"merchantProfile.declareCheckButton": "Declare checks",
"merchantProfile.list.Active": "Active",
"merchantProfile.list.Inactive": "Inactive",
"merchantProfile.list.name": "Name",
Expand Down
133 changes: 76 additions & 57 deletions types/tggl/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,94 +15,113 @@ declare module 'tggl-client' {
environmentType: "sandbox" | "live" | "admin"
serviceName: string
countryCode: string
cardToken: string
iban: string
capitalDepositCaseId: string
}

export interface TgglFlags {
deactivateUser: true
kycUseNewAmlLevelThreshold: true
frontendActivateMerchantProfileInWebBanking: true
sepaGatewayPublishSctInstEventsThroughFastKafkaTopics: true
merchantDashboard: true
enableIdentityTheftPreventionPage: true
SepaDirectDebitV2ActivationFlag: true
notificationManagerCardPaymentRefusedNotification: true
use_fourthine_workflow_api: true
asset_freeze_approve_list_enabled: true
checks: true
webhookSubscriptionLimit: true
cms_call_cema_carte_for_choose_pin: true
swan_account_membership_migration: true
back_office_bank_verlag_event_generation_improvements: true
use_mailjet_subaccount_for_mass_emailing: true
incomingForeignTransferScreeningEnabled: true
sepaDirectDebitInV2: true
merchantWebBanking: true
sepaGatewayPublishSctInstEventsThroughFastKafkaTopics: true
international_gateway_nats_consumer_enabled: true
frontendActivateMerchantProfileInWebBanking: true
teamManagementV2: true
isPusherFixed: true
account_contract_use_swan_templates_for_tcu_notifications: true
account_contract_use_swan_tcu_templates_for_disabled_projects: true
paymentLink: true
bankingBulkTransfer: true
requestCardPaymentMethod: true
beneficiaries: true
KYCUseInternalSystemToCollectSupportingDocuments: true
merchantWebBanking: true
kycAccountHoldersVerificationsView: true
merchantPaymentMethodRequestUpdate: true
monextNewRejectionCodeActivation: true
choosePINCode: true
paymentLink: true
account_contract_choose_pin_code_enabled: true
bankingBulkTransfer: true
shouldUseICTV2: true
teamManagementV2: true
requestCardPaymentMethod: true
swan_account_membership_migration: true
account_contract_use_swan_tcu_templates_for_disabled_projects: true
billing_v2_account_invoice_updated_event_enabled: boolean
paymentLedgerCommunicationMode: "kafka" | "kafka_shadow_nats" | "nats_fallback_kafka" | "nats"
end_customer_billing_enabled: boolean
enable_transaction_statements: boolean
dataExportUser: boolean
handle_triple_webhook: boolean
use_swan_public_data_s3: boolean
return_transaction_mutation: boolean
enable_document_generation_by_document_convertor: boolean
kycUseNewAmlLevelThreshold: true
account_contract_use_swan_templates_for_tcu_notifications: true
kycAccountHoldersVerificationsView: true
deactivateUser: true
KYCAllowGraphQLRequests: true
swan_generate_missing_bank_details: true
activateCardPaymentMethod: true
useTwilioVerifyServiceSidAlan: true
incomingForeignTransferScreeningEnabled: true
card_management_system_activate_jobs_with_monext_call: boolean
sandboxIdentification: boolean
mutationAddSepaTrustedBeneficiary: boolean
use_enriched_transaction_data: boolean
testFrontEnd: boolean
new_physical_card_model_enabled: boolean
dataExportTransactions: boolean
ciao_es_enabled: boolean
setIssuingProcessorCardProductOnRenewFeature: boolean
incomingTransferInstScreeningEnabled: boolean
company_onboarding_requires_ubo_residency_address: boolean
notificationServiceUsageRatio: 0.8 | 1 | 0.5 | 0 | 0.2
incomingTransferScreeningDualRunEnabled: boolean
enableSandboxMutations: boolean
card_management_system_schedules_enabled: boolean
end_customer_billing_enabled: boolean
billing_v2_enabled: boolean
card_management_system_outboxer_enabled: boolean
addInternationalBeneficiary: boolean
isCheckRedirectVerificationCodeCalled: boolean
isPhoneNumberCountryCodeBlocked: boolean
closure_subscription_enabled: boolean
use_enriched_transaction_data: boolean
use_optimized_count_in_paginate: boolean
international_credit_transfer_outgoing_remittance_settlement_enabled: boolean
return_transaction_mutation: boolean
account_contract_enable_maestro_provider_in_print_physical_card: boolean
billing_v2_account_invoice_updated_event_enabled: boolean
isScaDelegationEnabled: boolean
account_contract_enable_maestro_provider: boolean
notificationServiceUsageRatio: 0.8 | 1 | 0.5 | 0 | 0.2
card_management_system_outboxer_enabled: boolean
card_management_system_schedules_enabled: boolean
lago_end_customer_enabled: boolean
testFrontEnd: boolean
account_contract_monext_openapi_enabled: boolean
isNotificationsServiceEnabled: boolean
send_transaction_enriched_webhook: boolean
closure_subscription_enabled: boolean
incomingTransferScreeningEnabled: boolean
sandboxIdentification: boolean
renewVirtualCardFeature: boolean
account_contract_card_services_activated: boolean
addSepaBeneficiary: boolean
account_contract_card_jobs_activated: boolean
renewPhysicalCardFeature: boolean
account_contract_card_services_activated: boolean
isNotificationsServiceEnabled: boolean
handle_triple_webhook: boolean
swan_supports_local_italian_iban: true
mutationAddInternationalTrustedBeneficiary: boolean
card_management_system_create_default_card_product_when_new_project: boolean
end_customer_usage_payment_v2_enabled: boolean
account_contract_enable_maestro_provider: boolean
kycUseKycServiceForCompanyWorkflow: boolean
card_management_system_activate_finalize_saga_use_case: boolean
cancelPhysicalCardAtExpirationFeature: boolean
end_customer_ict_billing_enabled: boolean
testScalaFeatureFlag: "ASBABSBSDBAA"
new_physical_card_model_enabled: boolean
account_contract_send_tcu_notifications: true | null
use_optimized_count_in_paginate: boolean
toRenewPhysicalCardFeatureEnabled: boolean
initiate_international_credit_transfer_outgoing: boolean
useInternationalBeneficiary: boolean
international_credit_transfer_outgoing_remittance_settlement_enabled: boolean
isCallToFeatureFlagProviderInBackground: boolean
ciao_es_enabled: boolean
return_ict_in_enabled: boolean
disable_emails_for_capital_deposit_case: boolean
complete_capital_deposit_case_enabled: boolean
incomingForeignTransferScreeningLimit: 50
switch_simulate_to_invoice_v2: boolean
account_contract_enable_maestro_provider_in_print_physical_card: boolean
international_credit_transfer_swift_markup_enabled: boolean
setIssuingProcessorCardProductOnRenewFeature: boolean
incomingTransferScreeningLimit: 50
name_matching_use_valid_names_enabled: boolean
isScaDelegationEnabled: boolean
twilioRatio: 0.8 | 1 | 0.5 | 0 | 0.95 | 0.6
incomingTransferScreeningLimit: 50
dataExportUser: boolean
monextNewRejectionCodeActivation: boolean
enable_document_generation_by_document_convertor: boolean
incomingTransferScreeningDualRunEnabled: boolean
send_transaction_enriched_webhook: boolean
enable_transaction_statements: boolean
isPhoneNumberCountryCodeBlocked: boolean
card_management_system_cance_cards_on_account_closed: boolean
dataExportCards: boolean
dataExportAccount: boolean
dataExportAccountHolder: boolean
dataExportOnboarding: boolean
screeningSctInAndFctInWithNats: boolean
card_management_system_activate_finalize_saga_use_case: boolean
processed_identification_requires_valid_redirect_verification_status: boolean
addSepaBeneficiary: boolean
}
}

0 comments on commit 7bc6a30

Please sign in to comment.