Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add _id to all model interfaces #75

Merged
merged 3 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/models/sms_count.server.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SmsCountSchema.statics.logSms = async function (
this: ISmsCountModel,
{ otpData, msgSrvcSid, smsType, logType }: LogSmsParams,
) {
const schemaData: ISmsCount = {
const schemaData: Omit<ISmsCount, '_id'> = {
...otpData,
msgSrvcSid,
smsType,
Expand Down
1 change: 1 addition & 0 deletions src/types/agency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface IAgency {
logo: string
created: Date
lastModified?: Date
_id: Document['_id']
}

export interface IAgencySchema extends IAgency, Document {}
1 change: 1 addition & 0 deletions src/types/field/baseField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface IField {
disabled: boolean
fieldType: BasicFieldType
myInfo?: IMyInfo
_id: Document['_id']
}

// Manual override since mongoose types don't have generics yet.
Expand Down
2 changes: 2 additions & 0 deletions src/types/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export interface IForm {
msgSrvcName?: string

responseMode: ResponseMode

_id: Document['_id']
}

export interface IFormSchema extends IForm, Document {
Expand Down
1 change: 1 addition & 0 deletions src/types/form_feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface IFormFeedback {
comment: string
created: Date
lastModified?: Date
_id: Document['_id']
}

export interface IFormFeedbackSchema extends Document {}
1 change: 1 addition & 0 deletions src/types/form_logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface IConditionSchema extends ICondition, Document {
export interface ILogic {
conditions: IConditionSchema[]
logicType: LogicType
_id: Document['_id']
}

export interface ILogicSchema extends ILogic, Document {}
Expand Down
1 change: 1 addition & 0 deletions src/types/form_statistics_total.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Document } from 'mongoose'
export interface IFormStatisticsTotal {
totalCount: number
lastSubmission: Date
_id: Document['_id']
}

export interface IFormStatisticsTotalSchema
Expand Down
1 change: 1 addition & 0 deletions src/types/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ILogin {
authType: AuthType
esrvcId: string
created: Date
_id: Document['_id']
}

export interface ILoginSchema extends ILogin, Document {}
1 change: 1 addition & 0 deletions src/types/myinfo_hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface IMyInfoHash {
fields: IHashes
expireAt: Date
created: Date
_id: Document['_id']
}

export interface IMyInfoHashSchema extends IMyInfoHash, Document {}
1 change: 1 addition & 0 deletions src/types/sms_count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface ISmsCount {
logType: LogType
smsType: SmsType
createdAt?: Date
_id: Document['_id']
}

export interface ISmsCountSchema extends ISmsCount, Document {}
1 change: 1 addition & 0 deletions src/types/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface ISubmission {
submissionType: SubmissionType
created: Date
lastModified: Date
_id: Document['_id']
}

export interface ISubmissionSchema extends ISubmission, Document {
Expand Down
1 change: 1 addition & 0 deletions src/types/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface IToken {
expireAt: Date
numOtpAttempts: number
numOtpSent: number
_id: Document['_id']
}

export interface ITokenSchema extends IToken, Document {}
1 change: 1 addition & 0 deletions src/types/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface IUser {
betaFlag?: {
allowSms?: boolean
}
_id: Document['_id']
}

export interface IUserSchema extends IUser, Document {}
Expand Down