-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shared-types): move billing related types to shared folder (#2400)
* ref: move billing related types to root shared folder * ref(server): extend from shared types * ref(client): use shared types * feat: remove export for ILogin type
- Loading branch information
Showing
5 changed files
with
52 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { AgencyDto } from './agency' | ||
import { FormDto } from './form/form' | ||
import { UserDto } from './user' | ||
|
||
/** | ||
* The name `Login` may cause confusion. | ||
* This type relates to the data stored when a form respondent logs in to the | ||
* form via any of the public form auth methods (Singpass, Corppass, MyInfo, | ||
* etc). | ||
*/ | ||
export type LoginBase = { | ||
admin: UserDto['_id'] | ||
form: FormDto['_id'] | ||
agency: AgencyDto['_id'] | ||
authType: FormDto['authType'] | ||
// A login must be for a form that has an esrvcId. | ||
esrvcId: NonNullable<FormDto['esrvcId']> | ||
} | ||
|
||
export type FormBillingStatistic = { | ||
adminEmail: UserDto['email'] | ||
formName: FormDto['title'] | ||
formId: FormDto['_id'] | ||
authType: FormDto['authType'] | ||
total: number | ||
} | ||
|
||
// yr: The year to get the billing information for | ||
// mth: The month to get the billing information for | ||
// esrvcId: The id of the form | ||
export type BillingQueryDto = { | ||
esrvcId: NonNullable<FormDto['esrvcId']> | ||
yr: string | ||
mth: string | ||
} | ||
|
||
export type BillingInfoDto = { loginStats: FormBillingStatistic[] } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1 @@ | ||
import { LoginStatistic } from '../../types' | ||
|
||
// yr: The year to get the billing information for | ||
// mth: The month to get the billing information for | ||
// esrvcId: The id of the form | ||
export type BillingQueryDto = { | ||
esrvcId: string | ||
yr: string | ||
mth: string | ||
} | ||
|
||
export type BillingInfoDto = { loginStats: LoginStatistic[] } | ||
export { BillingQueryDto, BillingInfoDto } from '../../../shared/types/billing' |
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