# Business Logic — FUW01901SFLogic.init() [145 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW01901SF.FUW01901SFLogic` |
| Layer | Screen Logic (Web Controller/Service Layer — `eo.web.webview` package) |
| Module | `FUW01901SF` (Package: `eo.web.webview.FUW01901SF`) |

## 1. Role

### FUW01901SFLogic.init()

This method performs the initial screen processing for the **Mail Add-On (Email Add-on) Service Contract List Display** screen (FUW01901SF). It serves as the central orchestrator that prepares all data required to display discounted service contracts, fee costs, initial fees, NG words, business parameters, and security pack agreements on the customer-facing web screen.

The method implements a **preparation-invocation-mapping** design pattern typical of the X31/X33 framework used at K-Opticom. It first performs a device/terminal legality check (`checkOrosi`) to ensure the request originates from an authorized device, then gathers shared common info (customer contract data) and screen-specific service form beans. It populates an input data map by invoking a series of "setter" methods on the `FUSV0053_FUSV0053OPDBMapper` object — each of which maps service codes, screen parameters, and comparison data into `dataMap`.

Once the input data is prepared, the method delegates to `invokeService(paramMap, dataMap, outputMap)` which routes to the appropriate service component batch (SC) to query the backend. After receiving results in `outputMap`, it executes a "getter" mapping phase to extract processed data back into the service form bean. Finally, it computes mail add-on quota statistics (stock count, max count, possible additions, free additions), validates the mail add-on count against a maximum threshold, determines pricing flags (paid/free, mansion type, pack contract), conditionally sets free pricing information, and configures the next screen navigation target.

The method is the entry point for the FUW01901SF screen (likely accessed via screen ID `FUW01901`), providing a comprehensive view of the customer's current service status, available discounts, and email add-on management options.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["init()"])
    CHECK_OROSI(["Check Device<br/>checkOrosi"])
    GET_COMMON_BEAN(["Get Common Info Bean<br/>getCommonInfoBean"])
    GET_CUSTOMER_INFO(["Get Customer Contract Info<br/>getCommoninfoBeanInfo"])
    EXTRACT_SSO_BEAN(["Extract SSO Info Bean"])
    EXTRACT_SVC_BEAN(["Extract Service Info Bean"])
    GET_SERVICE_BEAN(["Get Service Form Bean"])
    CREATE_BEAN_ARRAY(["Create Bean Array [bean, ssoInfoBean, svcKeiInfoBean]"])
    CREATE_PARAM_MAP(["Create paramMap with USECASE_ID_FUSV0053"])
    CREATE_MAPPER(["Create FUSV0053_FUSV0053OPDBMapper"])
    CREATE_DATAMAP(["Create dataMap"])
    SET_01SC(["setFUSV005301SC - Discount Service Contract List"])
    SET_02SC(["setFUSV005302SC - Fee Cost Option Service Agreement"])
    SET_03SC(["setFUSV005303SC - Fee Plan Fixed Unit Price List"])
    SET_01CC(["setFUSV005301CC - Initial Fee List Comparison CC"])
    SET_04SC(["setFUSV005304SC - NG Word List"])
    SET_05SC(["setFUSV005305SC - Business Parameter Management"])
    SET_06SC(["setFUSV005306SC - Business Parameter Management"])
    SET_07SC(["setFUSV005307SC - Business Parameter Management"])
    SET_08SC(["setFUSV005308SC - Fee Cost Sub-Option Service List"])
    SET_02CC(["setFUSV005302CC - Security Pack Agreement Display CC"])
    CREATE_OUTPUT_MAP(["Create outputMap"])
    INVOKE_SERVICE(["invokeService(paramMap, dataMap, outputMap)"])
    CATCH_WEB_EXC(["catch JCCWebServiceException"])
    GET_01SC(["getFUSV005301SC - Discount Service Contract List"])
    GET_02SC(["getFUSV005302SC - Fee Cost Option Service Agreement"])
    GET_04SC(["getFUSV005304SC - NG Word List"])
    GET_05SC(["getFUSV005305SC - Business Parameter Management"])
    GET_06SC(["getFUSV005306SC - Business Parameter Management"])
    GET_07SC(["getFUSV005307SC - Business Parameter Management"])
    GET_08SC(["getFUSV005308SC - Fee Cost Sub-Option Service List"])
    GET_02CC(["getFUSV005302CC - Security Pack Agreement Display CC"])
    GET_MLAD_STKU(["Get Mail Add Stock Count"])
    SET_MLAD_STKU(["Set MLAD_STKU_CNT to bean"])
    GET_MLAD_MAX_CNT(["Get Mail Add Max Count from bean"])
    SET_MLAD_ADD_PSB(["Set Mail Add Possible Count"])
    GET_MLAD_MRYO_CNT(["Get Mail Add Free Count from bean"])
    SET_MLAD_MRYO(["Set Mail Add Free Count"])
    CHK_MAX_MLAD(["chkMaxMladCnt(bean)"])
    MAX_MLAD_EXCEED{"Max Count Exceeded?"}
    THROW_CONTRACT_ERROR(["throw JCCBusinessException<br/>ERROR_CODE_0102"])
    SET_PAY_FLG(["Set Pay Flag"])
    SET_MANSION_DIV(["Set Mansion Division"])
    REGET_MURYO(["Re-read MLAD_MRYO_CNT"])
    REGET_PAY_FLG(["Re-read PAY_FLG"])
    REGET_PACK_FLG(["Re-read PACK_KEI_FLG"])
    REGET_MANSION_FLG(["Re-read MANSION_DIV"])
    FREE_PRICING_CHECK{"Free Pricing Eligible?"}
    SET_FREE_PRICING(["Set Free Pricing Info Map"])
    SET_PRICING_AREA(["Set Pricing Area"])
    SET_PRICING_DAY(["Set Pricing Display Now Day"])
    SET_NEXT_SCREEN(["Set Next Screen ID"])
    SET_NEXT_NAME(["Set Next Screen Name"])
    RETURN_TRUE(["return true"])
    END_THROW(["Exit: Error"])

    START --> CHECK_OROSI
    CHECK_OROSI --> GET_COMMON_BEAN
    GET_COMMON_BEAN --> GET_CUSTOMER_INFO
    GET_CUSTOMER_INFO --> EXTRACT_SSO_BEAN
    EXTRACT_SSO_BEAN --> EXTRACT_SVC_BEAN
    EXTRACT_SVC_BEAN --> GET_SERVICE_BEAN
    GET_SERVICE_BEAN --> CREATE_BEAN_ARRAY
    CREATE_BEAN_ARRAY --> CREATE_PARAM_MAP
    CREATE_PARAM_MAP --> CREATE_MAPPER
    CREATE_MAPPER --> CREATE_DATAMAP
    CREATE_DATAMAP --> SET_01SC
    SET_01SC --> SET_02SC
    SET_02SC --> SET_03SC
    SET_03SC --> SET_01CC
    SET_01CC --> SET_04SC
    SET_04SC --> SET_05SC
    SET_05SC --> SET_06SC
    SET_06SC --> SET_07SC
    SET_07SC --> SET_08SC
    SET_08SC --> SET_02CC
    SET_02CC --> CREATE_OUTPUT_MAP
    CREATE_OUTPUT_MAP --> INVOKE_SERVICE
    INVOKE_SERVICE --> CATCH_WEB_EXC
    INVOKE_SERVICE --> GET_01SC
    CATCH_WEB_EXC --> THROW_CONTRACT_ERROR
    THROW_CONTRACT_ERROR --> END_THROW
    GET_01SC --> GET_02SC
    GET_02SC --> GET_04SC
    GET_04SC --> GET_05SC
    GET_05SC --> GET_06SC
    GET_06SC --> GET_07SC
    GET_06SC --> GET_08SC
    GET_07SC --> GET_08SC
    GET_08SC --> GET_02CC
    GET_02CC --> GET_MLAD_STKU
    GET_MLAD_STKU --> SET_MLAD_STKU
    SET_MLAD_STKU --> GET_MLAD_MAX_CNT
    GET_MLAD_MAX_CNT --> SET_MLAD_ADD_PSB
    SET_MLAD_ADD_PSB --> GET_MLAD_MRYO_CNT
    GET_MLAD_MRYO_CNT --> SET_MLAD_MRYO
    SET_MLAD_MRYO --> CHK_MAX_MLAD
    CHK_MAX_MLAD --> MAX_MLAD_EXCEED
    MAX_MLAD_EXCEED -->|true| THROW_CONTRACT_ERROR
    MAX_MLAD_EXCEED -->|false| SET_PAY_FLG
    SET_PAY_FLG --> SET_MANSION_DIV
    SET_MANSION_DIV --> REGET_MURYO
    REGET_MURYO --> REGET_PAY_FLG
    REGET_PAY_FLG --> REGET_PACK_FLG
    REGET_PACK_FLG --> REGET_MANSION_FLG
    REGET_MANSION_FLG --> FREE_PRICING_CHECK
    FREE_PRICING_CHECK -->|true| SET_FREE_PRICING
    FREE_PRICING_CHECK -->|false| SET_PRICING_AREA
    SET_FREE_PRICING --> SET_PRICING_AREA
    SET_PRICING_AREA --> SET_PRICING_DAY
    SET_PRICING_DAY --> SET_NEXT_SCREEN
    SET_NEXT_SCREEN --> SET_NEXT_NAME
    SET_NEXT_NAME --> RETURN_TRUE
```

**Processing Summary:**

1. **Device Legality Check**: Verifies the request originates from an authorized device (illegal terminal / orosi check).
2. **Common Info Acquisition**: Retrieves the shared common info bean and extracts customer contract data (SSO info, service info).
3. **Service Form Bean Acquisition**: Retrieves the screen-specific service form bean and assembles a bean array combining all three beans.
4. **Input Data Preparation (Upper Mapping)**: Creates an `FUSV0053_FUSV0053OPDBMapper` instance and populates `dataMap` with 10 setter calls, each mapping different screen data areas (discount contracts, fee costs, fee plans, initial fees, NG words, business parameters, sub-option services, security packs).
5. **Service Invocation**: Calls `invokeService(paramMap, dataMap, outputMap)` within a try-catch block. On `JCCWebServiceException`, throws a `JCCBusinessException` with error code `ERROR_CODE_0002`.
6. **Output Data Extraction (Lower Mapping)**: Extracts results from `outputMap` via 7 getter calls, populating the service form bean with screen data.
7. **Mail Add-On Quota Computation**: Reads the current stock count of email add-ons, the max capacity, computes the possible addition count and free addition count, and stores them in the bean.
8. **Max Count Validation**: If `chkMaxMladCnt(bean)` returns true, throws a contract error (`ERROR_CODE_0102`).
9. **Pricing & Display Flags**: Sets the pay flag, mansion division flag, and re-reads all flags for the pricing eligibility check.
10. **Free Pricing Condition**: If the customer has free additions remaining AND is a mansion type, OR has a pack contract, OR does not need to pay, then sets the free pricing info map.
11. **Pricing Area Mapping**: Maps the complete pricing area to the screen.
12. **Display Date Setup**: Sets the current date as the pricing display date.
13. **Next Screen Configuration**: Sets the next screen ID and screen name for navigation.
14. **Return**: Always returns `true`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. All data is obtained from inherited base classes (`super.getCommonInfoBean()`, `super.getServiceFormBean()`) and instance state. |
| - | `this` (FUW01901SFLogic instance) | `FUW01901SFLogic` | The logic instance providing access to screen context, utility methods (`getScreenId`), and the JCC framework infrastructure. |

### External State / Instance Fields Read:

| Field | Type | Business Description |
|-------|------|---------------------|
| (inherited from base class) | - | Provides `getScreenId()` for determining the next navigation screen ID |

### Bean Array Fields (used in mapper operations):

| Bean | Source | Business Description |
|------|--------|---------------------|
| `bean` (X31SDataBeanAccess) | `super.getServiceFormBean()` | Service form bean holding screen-level data including mail add-on counts, pay flag, mansion division, and all FUSV0053 pricing data |
| `ssoInfoBean` (X31SDataBeanAccess) | `resultMap.get(CommonInfoCFConst.SSO_INFO)` | Single Sign-On info bean carrying session and customer identity data |
| `svcKeiInfoBean` (X31SDataBeanAccess) | `resultMap.get(CommonInfoCFConst.SVC_KEI_INFO)` | Service detail info bean carrying service contract line item data |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JFUWebCommon.checkOrosi` | JFUWebCommon | - | Checks device legality (oroshi/illegal terminal check) before screen processing |
| - | `X31SDataBeanAccess.getDataBeanArray` | - | - | Retrieves a data bean array from the bean (called by `getCommoninfoBeanInfo`) |
| - | `X31SDataBeanAccess.sendMessageString` | - | - | Sets a string value in the service form bean |
| - | `X31SDataBeanAccess.sendMessageLong` | - | - | Gets/sets a long value in the service form bean |
| - | `X31SDataBeanAccess.sendMessageBoolean` | - | - | Gets/sets a boolean value in the service form bean |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005301SC` | FUSV005301SC | - | Maps discount service contract list data (with service specification designation) into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005302SC` | FUSV005302SC | - | Maps fee cost option service agreement data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005303SC` | FUSV005303SC | - | Maps fee plan fixed unit price (optional charge price) list data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005301CC` | FUSV005301CC | - | Maps initial fee list comparison comparison component data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005304SC` | FUSV005304SC | - | Maps NG word list data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005305SC` | FUSV005305SC | - | Maps business parameter management data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005306SC` | FUSV005306SC | - | Maps business parameter management data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005307SC` | FUSV005307SC | - | Maps business parameter management data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005308SC` | FUSV005308SC | - | Maps fee cost sub-option service list data into dataMap |
| - | `FUSV0053_FUSV0053OPDBMapper.setFUSV005302CC` | FUSV005302CC | - | Maps security pack agreement display control data into dataMap (added 2017/04/17) |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005301SC` | FUSV005301SC | - | Extracts discount service contract list data from outputMap into the service form bean |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005302SC` | FUSV005302SC | - | Extracts fee cost option service agreement data from outputMap into the service form bean |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005304SC` | FUSV005304SC | - | Extracts NG word list data from outputMap into the service form bean |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005305SC` | FUSV005305SC | - | Extracts business parameter management data from outputMap into the service form bean |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005306SC` | FUSV005306SC | - | Extracts business parameter management data from outputMap into the service form bean |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005307SC` | FUSV005307SC | - | Extracts business parameter management data from outputMap into the service form bean |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005308SC` | FUSV005308SC | - | Extracts fee cost sub-option service list data from outputMap into the service form bean |
| R | `FUSV0053_FUSV0053OPDBMapper.getFUSV005302CC` | FUSV005302CC | - | Extracts security pack agreement display control data from outputMap into the service form bean |
| - | `JPCBatCommon.invokeService` | JPCBatCommon | - | Core service invocation — routes paramMap/dataMap to SC layer and returns results in outputMap |
| - | `chkMaxMladCnt` | FUW01901SFLogic | - | Validates whether mail add-on count has exceeded maximum allowed threshold |
| - | `setPayFlg` | FUW01901SFLogic | - | Determines whether the pricing is paid or free by analyzing outputMap data |
| - | `getMansionDiv` | FUW01901SFLogic | - | Determines if the customer is a mansion (multi-unit dwelling) type |
| R | `JFUWebCommon.getScreenId` | JFUWebCommon | - | Retrieves the next screen ID from the current screen context |
| - | `JFUWebCommon.setFreePrcInfoMap` | JFUWebCommon | - | Sets the free pricing information map for display (conditional) |
| - | `JFUWebCommon.setPrcInfoArea` | JFUWebCommon | - | Maps the complete pricing area display data to the service form bean |
| - | `JFUWebCommon.setPrcDspNowDay` | JFUWebCommon | - | Sets the current date as the pricing display date on the screen |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUW01901 | `FUW01901SFLogic.init()` (entry point) | `invokeService -> FUSV0053 SCs (01-08)` |
| 2 | Screen:FUW01901 | `FUW01901SFController.invoke()` -> `FUW01901SFLogic.init()` | `FUSV005301SC (R), FUSV005302SC (R), FUSV005304SC (R), FUSV005305SC (R), FUSV005306SC (R), FUSV005307SC (R), FUSV005308SC (R)` |

**Note:** This `init()` method follows the standard screen logic pattern where the screen controller invokes `init()` as the first processing step. The FUW01901SF screen is the primary and likely sole caller. The call chain is: `Controller.invoke() -> Logic.init() -> invokeService() -> FUSV0053 SC batch services`.

## 6. Per-Branch Detail Blocks

### Block 1 — CHECK `[device legality check]` (L128)

> Performs a device/terminal legality check (oroshi check) to ensure the request originates from an authorized device. This is a security gate that prevents access from illegal/unregistered terminals.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.checkOrosi(this)` // Device legality check [oroshi = illegal terminal detection] |

### Block 2 — COMMON INFO ACQUISITION `[shared form bean]` (L132–139)

> Retrieves the shared common form bean and extracts customer contract information. The method follows a two-step process: first obtaining the common info bean, then calling a helper to extract customer data into a result map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean = super.getCommonInfoBean()` // Get shared form bean data bean access [L135] |
| 2 | CALL | `resultMap = getCommoninfoBeanInfo(commoninfoBean, null)` // Get customer contract info [L138] |

### Block 3 — BEAN EXTRACTION `[from resultMap]` (L141–143)

> Extracts the SSO (Single Sign-On) info bean and service detail info bean from the resultMap using constant keys.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ssoInfoBean = (X31SDataBeanAccess) resultMap.get(CommonInfoCFConst.SSO_INFO)` // Extract SSO info bean [-> SSO_INFO key] |
| 2 | SET | `svcKeiInfoBean = (X31SDataBeanAccess) resultMap.get(CommonInfoCFConst.SVC_KEI_INFO)` // Extract service detail info bean [-> SVC_KEI_INFO key] |

### Block 4 — SERVICE FORM BEAN ACQUISITION `[service form bean]` (L147–151)

> Retrieves the screen-specific service form bean and creates a bean array combining all three beans (service form, SSO info, service detail info) for use in mapper operations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean = super.getServiceFormBean()` // Get service form bean [L149] |
| 2 | SET | `beanArray = { bean, ssoInfoBean, svcKeiInfoBean }` // Create combined bean array [L151] |

### Block 5 — INPUT DATA PREPARATION `[upper mapping / setter phase]` (L153–186)

> Creates the use case parameter map and mapper, then populates the input data map with all service codes. Each setter call maps a different pricing/contract data area into `dataMap` with a function code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, String>(16)` // Create param map [L154] |
| 2 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, USECASE_ID_FUSV0053)` // Set use case ID [-> USECASE_ID_FUSV0053 = "FUSV0053"] |
| 3 | SET | `mapper = new FUSV0053_FUSV0053OPDBMapper()` // Create mapper [L156] |
| 4 | SET | `dataMap = new HashMap<String, Object>()` // Create data map [L158] |
| 5 | CALL | `mapper.setFUSV005301SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Discount service contract list (FUNC_CD_1) [L161] |
| 6 | CALL | `mapper.setFUSV005302SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_2)` // Fee cost option service agreement (FUNC_CD_2) [L163] |
| 7 | CALL | `mapper.setFUSV005303SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Fee plan fixed unit price list (FUNC_CD_1) [L165] |
| 8 | CALL | `mapper.setFUSV005301CC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Initial fee list comparison CC (FUNC_CD_1) [L167] |
| 9 | CALL | `mapper.setFUSV005304SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // NG word list (FUNC_CD_1) [L169] |
| 10 | CALL | `mapper.setFUSV005305SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Business parameter management (FUNC_CD_1) [L171] |
| 11 | CALL | `mapper.setFUSV005306SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Business parameter management (FUNC_CD_1) [L173] |
| 12 | CALL | `mapper.setFUSV005307SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Business parameter management (FUNC_CD_1) [L175] |
| 13 | CALL | `mapper.setFUSV005308SC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Fee cost sub-option service list (FUNC_CD_1) [L177] |
| 14 | CALL | `mapper.setFUSV005302CC(beanArray, dataMap, JPCModelConstant.FUNC_CD_1)` // Security pack agreement display CC (FUNC_CD_1) [ANK-3149-00-00 add start] [L180] |

### Block 6 — SERVICE INVOCATION `[try-catch]` (L188–202)

> Creates the output map and invokes the service. The method catches `JCCWebServiceException` and converts it to a `JCCBusinessException` with error code `ERROR_CODE_0002`. Any other exception propagates up.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outputMap = new HashMap<String, Object>()` // Create output map [L190] |
| 2 | CALL | `invokeService(paramMap, dataMap, outputMap)` // Invoke service batch — routes to SC layer [L193] |

**Block 6.1 — Exception Handler** `(L195–197)`

| # | Type | Code |
|---|------|------|
| 1 | CATCH | `catch (JCCWebServiceException se)` // Web service exception [L195] |
| 2 | RETURN | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0002)` // Error code 0002 — service invocation failure [L196] |

**Block 6.2 — Exception Handler** `(L198–200)`

| # | Type | Code |
|---|------|------|
| 1 | CATCH | `catch (JCCBusinessException be)` // Business exception — rethrow [L198] |
| 2 | RETURN | `throw be` // Propagate business exception [L199] |

### Block 7 — OUTPUT DATA EXTRACTION `[lower mapping / getter phase]` (L205–225)

> Extracts results from the outputMap into the service form bean. These getters complement the setters in Block 5, completing the round-trip data exchange.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getFUSV005301SC(bean, outputMap)` // Discount service contract list [L207] |
| 2 | CALL | `mapper.getFUSV005302SC(bean, outputMap)` // Fee cost option service agreement [L209] |
| 3 | CALL | `mapper.getFUSV005304SC(bean, outputMap)` // NG word list [L211] |
| 4 | CALL | `mapper.getFUSV005305SC(bean, outputMap)` // Business parameter management [L213] |
| 5 | CALL | `mapper.getFUSV005306SC(bean, outputMap)` // Business parameter management [L215] |
| 6 | CALL | `mapper.getFUSV005307SC(bean, outputMap)` // Business parameter management [L217] |
| 7 | CALL | `mapper.getFUSV005308SC(bean, outputMap)` // Fee cost sub-option service list [L219] |
| 8 | CALL | `mapper.getFUSV005302CC(bean, outputMap)` // Security pack agreement display CC [ANK-3149-00-00 add end] [L222] |

### Block 8 — MAIL ADD-ON QUOTA COMPUTATION `[email add-on statistics]` (L227–241)

> Computes and stores email add-on quota statistics in the service form bean. Four key metrics are calculated:
> - **Stock Count**: How many email add-ons are currently active
> - **Max Count**: Maximum email add-ons allowed
> - **Possible Count**: How many more can be added (max - stock)
> - **Free Count**: How many free additions remain (free allowance - stock)

| # | Type | Code |
|---|------|------|
| 1 | SET | `mladCnt = (Integer) resultMap.get(FUW01901SFConst.MLAD_STKU_CNT)` // Get stock count [-> MLAD_STKU_CNT] |
| 2 | SET | `bean.sendMessageString(FUW01901SFConst.MLAD_STKU_CNT, X31CWebConst.DATABEAN_SET_VALUE, String.valueOf(mladCnt))` // Set stock count to bean [L229] |
| 3 | SET | `mladMaxCnt = bean.sendMessageLong(FUW01901SFConst.MLAD_MAX_CNT, X31CWebConst.DATABEAN_GET_VALUE).intValue()` // Get max count [-> MLAD_MAX_CNT] |
| 4 | SET | `bean.sendMessageString(FUW01901SFConst.MLAD_ADD_PSB_CNT, X31CWebConst.DATABEAN_SET_VALUE, String.valueOf(mladMaxCnt - mladCnt))` // Set possible add count [-> MLAD_ADD_PSB_CNT] |
| 5 | SET | `mladMuryoCnt = bean.sendMessageLong(FUW01901SFConst.MLAD_MRYO_CNT, X31CWebConst.DATABEAN_GET_VALUE).intValue()` // Get free count [-> MLAD_MRYO_CNT] |
| 6 | SET | `bean.sendMessageString(FUW01901SFConst.MLAD_MRYO_CNT, X31CWebConst.DATABEAN_SET_VALUE, String.valueOf(mladMuryoCnt - mladCnt))` // Set free add count [-> MLAD_MRYO_CNT] |

### Block 9 — MAX COUNT VALIDATION `[if]` (L245–247)

> Validates that the mail add-on count has not exceeded the maximum allowed threshold. If exceeded, throws a contract error.

**Block 9 — IF** `(chkMaxMladCnt(bean))` `[max count exceeded]` (L245)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` // Contract state error [-> ERROR_CODE_0102] |

### Block 10 — PRICING FLAGS `[set pay flag, mansion division]` (L249–252)

> Sets the pay flag (paid vs. free) and mansion division (mansion vs. non-mansion) boolean flags on the service form bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bean.sendMessageBoolean(FUW01901SFConst.PAY_FLG, X31CWebConst.DATABEAN_SET_VALUE, setPayFlg(bean, outputMap))` // Set pay flag [-> PAY_FLG] |
| 2 | CALL | `bean.sendMessageBoolean(FUW01901SFConst.MANSION_DIV, X31CWebConst.DATABEAN_SET_VALUE, getMansionDiv(bean, commoninfoBean, outputMap))` // Set mansion division [-> MANSION_DIV] |

### Block 11 — FLAG RE-READING `[for pricing eligibility check]` (L254–263)

> Re-reads all relevant flags from the bean to evaluate the free pricing eligibility condition. The flags read are: free count, pay flag, pack contract flag (added 2017/04/13 ANK-3149-00-00), and mansion flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `muryoCnt = bean.sendMessageLong(FUW01901SFConst.MLAD_MRYO_CNT, X31CWebConst.DATABEAN_GET_VALUE).intValue()` // Read free count [L255] |
| 2 | SET | `payFlg = bean.sendMessageBoolean(FUW01901SFConst.PAY_FLG, X31CWebConst.DATABEAN_GET_VALUE)` // Read pay flag [L257] |
| 3 | SET | `packFlg = bean.sendMessageBoolean(FUW01901SFConst.PACK_KEI_FLG, X31CWebConst.DATABEAN_GET_VALUE)` // Read pack contract flag [ANK-3149-00-00 mod] [L259] |
| 4 | SET | `manshonFlg = bean.sendMessageBoolean(FUW01901SFConst.MANSION_DIV, X31CWebConst.DATABEAN_GET_VALUE)` // Read mansion flag [L261] |

### Block 12 — FREE PRICING ELIGIBILITY CHECK `[if]` (L264–271)

> Determines whether to set free pricing information. Free pricing is eligible if ANY of these conditions is true:
> 1. Has free additions remaining (muryoCnt > 0) AND is a mansion type (manshonFlg)
> 2. Has a pack contract (packFlg)
> 3. Does not need to pay (!payFlg)

**Block 12 — IF** `((muryoCnt > 0 && manshonFlg) || packFlg || !payFlg)` `[free pricing eligible]` (L264)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.setFreePrcInfoMap(outputMap, FUSV005303SC)` // Set free pricing info map [L267] |

### Block 13 — PRICING AREA MAPPING `[mandatory]` (L273)

> Maps the complete pricing area to the service form bean. This is always executed regardless of the free pricing eligibility. It uses the fee plan fixed unit price SC, initial fee comparison CC, and the current screen ID.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.setPrcInfoArea(bean, outputMap, FUSV005303SC, FUSV005301CC, JFUScreenConst.SCREEN_ID_FUW01901)` // Set pricing area [L273] |

### Block 14 — DISPLAY DATE SETUP `[mandatory]` (L276)

> Sets the current date as the pricing display date on the screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.setPrcDspNowDay(this)` // Set current date as pricing display date [L276] |

### Block 15 — NEXT SCREEN CONFIGURATION `[mandatory]` (L279–282)

> Configures the next screen navigation target by setting the next screen ID (dynamically determined) and the fixed screen name.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JFUWebCommon.getScreenId(this))` // Set next screen ID [-> NEXT_SCREEN_ID] |
| 2 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_NAME_FUW01901)` // Set next screen name [-> SCREEN_NAME_FUW01901] |

### Block 16 — RETURN `[always returns true]` (L284)

| # | Type | Code |
|---|------|------|
| 1 |RETURN | `return true` // Processing always succeeds; errors are thrown as exceptions |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `oroshi` (おりし) | Japanese term | Illegal terminal/device — device legality check (`checkOrosi`) ensures the request comes from an authorized, registered device. Prevents access from unregistered or tampered terminals. |
| `mlad` | Field abbreviation | Mail Add — email add-on service. Customers can subscribe to additional email accounts beyond their base plan. `mlad_stku_cnt` = current active email add-ons; `mlad_max_cnt` = maximum allowed; `mlad_add_psb_cnt` = possible additions; `mlad_mryo_cnt` = free additions remaining. |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for service contract line items. Used to identify individual service agreements. |
| `odr_naiyo_cd` | Field | Order content code — classifies the type of order (e.g., FTTH registration, mail service change, equipment delivery). |
| SSO | Acronym | Single Sign-On — shared session identity information passed across the screen, including customer authentication and session data. |
| FUNC_CD_1 | Constant | Function code "1" — standard function mode used for most data mapping operations (discount contracts, fee plans, NG words, etc.). |
| FUNC_CD_2 | Constant | Function code "2" — special function mode used for fee cost option service agreement mapping. |
| USECASE_ID_FUSV0053 | Constant | Use case identifier "FUSV0053" — identifies the service use case batch to invoke via `invokeService`. Routes the request to the correct SC layer. |
| PAY_FLG | Constant | Payment flag — indicates whether the pricing is paid (true) or free (false). Determines customer payment obligation. |
| MANSION_DIV | Constant | Mansion division — boolean flag indicating if the customer resides in a mansion (multi-unit residential building). Affects pricing eligibility and free pricing conditions. |
| PACK_KEI_FLG | Constant | Pack contract flag — indicates if the customer has a bundle/pack contract. Added in ANK-3149-00-00 (2017/04/13). Customers with pack contracts are eligible for free pricing regardless of other conditions. |
| MLAD_STKU_CNT | Constant | Mail Add Stock Count — number of email add-ons currently active/registered for the customer. |
| MLAD_MAX_CNT | Constant | Mail Add Maximum Count — maximum number of email add-ons allowed per customer plan. |
| MLAD_ADD_PSB_CNT | Constant | Mail Add Possible Count — remaining number of email add-ons that can still be added (max - current stock). |
| MLAD_MRYO_CNT | Constant | Mail Add Free Count — number of free email add-ons remaining (free allowance - current stock). |
| ERROR_CODE_0002 | Constant | Service invocation error — thrown when `JCCWebServiceException` occurs during `invokeService`. Indicates the backend service call failed. |
| ERROR_CODE_0102 | Constant | Contract state error — thrown when `chkMaxMladCnt` detects that the mail add-on count has exceeded the maximum allowed threshold. Indicates the customer has reached their email add-on limit. |
| FUSV005301SC | SC Code | Discount Service Contract List SC — handles discounted service contract data with service specification designation. Returns contract eligibility and discount details. |
| FUSV005302SC | SC Code | Fee Cost Option Service Agreement SC — handles optional service agreement fee cost data. Returns optional service pricing and customer agreement status. |
| FUSV005303SC | SC Code | Fee Plan Fixed Unit Price SC — handles fee plan fixed unit price (optional charge price) list data. Used for free pricing info mapping. |
| FUSV005301CC | CC Code | Initial Fee List Comparison CC — comparison component for initial fee data. Returns one-time setup/registration fee information. |
| FUSV005304SC | SC Code | NG Word List SC — handles NG (bad/inappropriate) word list data. Used for content filtering validation. |
| FUSV005305SC | SC Code | Business Parameter Management SC — manages business parameter configuration data. |
| FUSV005306SC | SC Code | Business Parameter Management SC — manages business parameter configuration data. |
| FUSV005307SC | SC Code | Business Parameter Management SC — manages business parameter configuration data. |
| FUSV005308SC | SC Code | Fee Cost Sub-Option Service List SC — handles sub-option service list fee cost data. Returns additional optional service pricing. |
| FUSV005302CC | CC Code | Security Pack Agreement Display CC — security pack agreement display control component. Added in ANK-3149-00-00 (2017/04/17). Controls security pack product display and agreement status. |
| JPCBatCommon | CBS Class | Job Processing Common — common batch service invocation class. `invokeService` is the central method that routes parameter maps to the appropriate SC layer. |
| JCCWebServiceException | Exception Class | Web service exception — thrown when the service invocation layer encounters a communication or runtime error. |
| JCCBusinessException | Exception Class | Business exception — thrown for business rule violations (e.g., contract state errors, max count exceeded). |
| SCREEN_ID_FUW01901 | Constant | Screen ID "FUW01901" — the unique identifier for this screen, used in pricing area mapping. |
| SCREEN_NAME_FUW01901 | Constant | Screen name constant — human-readable display name for the FUW01901 screen. |
| X31SDataBeanAccess | Class | X31 Service Data Bean Access — framework class for accessing and manipulating screen bean data via `sendMessageString`, `sendMessageLong`, `sendMessageBoolean`, `getDataBeanArray`. |
| FUSV0053_FUSV0053OPDBMapper | Class | FUSV0053 Operation DB Mapper — data mapping class that bridges screen beans with SC layer data. Provides `set*SC`/`set*CC` (input mapping) and `get*SC`/`get*CC` (output extraction) methods. |
| ANK-3149-00-00 | Change Request | Internal change request/ticket number. Two modifications: (1) 2017/04/13 — added `PACK_KEI_FLG` for pack contract flag handling; (2) 2017/04/17 — added `FUSV005302CC` for security pack agreement display. |
| UPPER MAPPING (上マッピング) | Japanese term | Input data mapping phase — the process of populating the `dataMap` with input parameters before service invocation. |
| LOWER MAPPING (下マッピング) | Japanese term | Output data extraction phase — the process of extracting results from `outputMap` into the service form bean after service invocation. |
| FTTH | Business term | Fiber To The Home — fiber-optic internet service, the core broadband offering of K-Opticom. |
