-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(demo): add checkout form models and country field (#2615)
- Loading branch information
Showing
9 changed files
with
99 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
apps/demo/src/app/checkout/components/forms/address-form/factories/address-form.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
apps/demo/src/app/checkout/components/forms/address-form/models/address-form.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { | ||
FormControl, | ||
FormGroup, | ||
} from '@angular/forms'; | ||
|
||
import { | ||
DaffCountry, | ||
DaffSubdivision, | ||
} from '@daffodil/geography'; | ||
|
||
export type AddressFormGroup = FormGroup<{ | ||
firstname: FormControl<string>; | ||
lastname: FormControl<string>; | ||
street: FormControl<string>; | ||
city: FormControl<string>; | ||
country: FormControl<DaffCountry['id']>; | ||
state: FormControl<DaffSubdivision['id']>; | ||
postcode: FormControl<string>; | ||
telephone: FormControl<string>; | ||
}>; |
11 changes: 11 additions & 0 deletions
11
apps/demo/src/app/checkout/components/payment/payment-form/models/payment-form.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FormGroup } from '@angular/forms'; | ||
|
||
import { AddressFormGroup } from '../../../forms/address-form/models/address-form.type'; | ||
import { PaymentInfoFormGroup } from '../../payment-info-form/models/payment-form.type'; | ||
|
||
export type PaymentFormGroup = FormGroup<{ | ||
paymentInfo: PaymentInfoFormGroup; | ||
address: AddressFormGroup; | ||
}>; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
apps/demo/src/app/checkout/components/payment/payment-info-form/models/payment-form.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { | ||
FormControl, | ||
FormGroup, | ||
} from '@angular/forms'; | ||
|
||
export type PaymentInfoFormGroup = FormGroup<{ | ||
name: FormControl<string>; | ||
cardnumber: FormControl<string>; | ||
month: FormControl<string>; | ||
year: FormControl<string>; | ||
securitycode: FormControl<string>; | ||
}>; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters