|
- import { Component, OnInit } from '@angular/core';
- import { DateInputProperties } from 'src/app/widgets/form/date-input/date-input.component';
- import { GenericInputProperties } from 'src/app/widgets/form/generic-input/generic-input.component';
- import { SelectInputProperties } from 'src/app/widgets/form/select-input/select-input.component';
-
- @Component({
- selector: 'app-register-business',
- templateUrl: './register-business.component.html',
- styleUrls: ['./register-business.component.scss']
- })
- export class RegisterBusinessComponent implements OnInit {
- formState: 'CHECK_NAME' | 'INIT_REGISTER' |
- 'REGISTER_FORM' | 'SELECT_PLAN' |
- 'ACKNOWLEDGEMENT' | 'RECEIPT' | undefined = 'CHECK_NAME';
- nameToCheck: string = 'JK Enterprises ACRA';
- isAppealing: boolean = false;
- agreeToReserve: boolean = false;
- error?: {
- message: string,
- isUnique: boolean,
- isInvalid: boolean,
- }
-
- selectedPaymentTab: 'overview'|'details' = 'overview';
- years: Array<number> = (new Array(15)).fill(1).map((value, index) => index + 1);
-
- paymentChild: Window | null = null;
- childCheck: number | undefined;
-
- registerForm: Array<SelectInputProperties|DateInputProperties|GenericInputProperties> = [{
- name: 'Entity Type',
- type: 'select',
- options: [
- 'BUSINESS',
- 'LOCAL COMPANY',
- 'LIMITED LIABILITY PARTNERSHIP',
- 'FOREIGN COMPANY',
- 'LIMITED PARTNERSHIP',
- 'PUBLIC ACCOUNTING FIRM'
- ]
- }, {
- name: 'Company Category',
- type: 'select',
- options: [
- 'PUBLIC COMPANY LIMITED BY SHARES',
- 'PUBLIC COMPANY LIMITED BY GUARANTEE',
- 'PRIVATE COMPANY LIMITED BY SHARES',
- 'EXEMPT PRIVATE COMPANY LIMITED BY SHARES'
- ]
- }, {
- name: 'Company Suffix',
- type: 'select',
- options: ['LLC', 'LTD', 'PVT LTD', 'INC']
- }, {
- name: 'Drop the Suffix "Limited" or "Berhad"?',
- type: 'select',
- options: ['YES', 'NO']
- }];
-
-
- acknowledgementDetails: Array<{
- name: string,
- value: string | number,
- amount?: number,
- highlight?: boolean,
- }> = [{
- name: 'UEM',
- value: '---'
- }, {
- name: 'Entity Name',
- value: this.nameToCheck
- }, {
- name: 'Transaction Number',
- value: '39047729362923293',
- highlight: true,
- }, {
- name: 'Receipt Number',
- value: 'ACRA38293',
- highlight: true
- }, {
- name: 'EP Reference No.',
- value: '20910038829384470'
- }, {
- name: 'Payment Date',
- value: '06/11/2021 11:28:01'
- }, {
- name: 'Description',
- value: 'Application for Business Name',
- amount: 15
- }];
-
- receiptDetails: Array<{
- name: string,
- value: string | number,
- }> = [{
- name: 'Receipt Number',
- value: 'ACRA38293',
- }, {
- name: 'ARN',
- value: 'ARN2021110294038',
- }, {
- name: 'EP Reference No.',
- value: '20910038829384470'
- }, {
- name: 'Tax ID',
- value: 'M9-0C038921',
- }, {
- name: 'Paid By',
- value: 'KOH YA TING',
- }, {
- name: 'Payment Date',
- value: '06/11/2021 11:28:01'
- }, {
- name: 'Paid Via',
- value: 'Net Banking',
- }];
-
- constructor() { }
-
- ngOnInit(): void {
- }
-
- confirmName() {
- if (!this.error?.isUnique) {
- this.isAppealing = true;
- }
- this.formState = 'REGISTER_FORM';
- }
-
- goBackToFormDetails() {
- if (typeof this.childCheck !== 'undefined') {
- window.clearInterval(this.childCheck);
- this.childCheck = undefined;
- }
-
- if (this.paymentChild && !this.paymentChild.closed) {
- this.paymentChild?.close()
- }
-
- this.formState = 'REGISTER_FORM'
- }
-
- payForReservation() {
- this.paymentChild = window.open('/mock', '_blank', 'toolbar=0,status=0,width=626,height=436');
-
- this.childCheck = window.setInterval(() => {
- if (this.paymentChild && this.paymentChild.closed) {
- this.formState = 'ACKNOWLEDGEMENT';
- window.clearInterval(this.childCheck);
- this.childCheck = undefined;
- }
- }, 1000);
- }
-
- checkName() {
- this.formState = 'INIT_REGISTER';
-
- if (this.nameToCheck === 'JK Enterprises') {
- this.error = {
- message: this.nameToCheck + ' is unavailable',
- isUnique: false,
- isInvalid: false,
- };
- } else {
- this.error = {
- message: this.nameToCheck + ' is available',
- isUnique: true,
- isInvalid: false
- };
- }
- }
-
- print() {
- window.print();
- }
-
- }
|