Skip to content

Commit

Permalink
Adds support for setting an external identifier / alias on an attende…
Browse files Browse the repository at this point in the history
…e model
  • Loading branch information
craigpaul committed Aug 11, 2020
1 parent 5794080 commit 15473ef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/models/attendee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Model from './model';
import { ResponseModel } from './response';

export interface AttendeeModel extends ModelInterface {
alias(alias: string | number): this;

answers(answers: AnswerModel | AnswerModel[]): this;

as(identifier: number): this;
Expand All @@ -30,6 +32,7 @@ export interface AttendeeAttributes {
}

export interface AttendeeParameters {
alias?: string | number;
address?: string;
answers?: AnswerModel[] | [];
cell_phone?: string;
Expand Down Expand Up @@ -80,6 +83,12 @@ export default class Attendee extends Model implements AttendeeModel {
};
}

public alias(alias: string | number): this {
this.attributes.alias = alias;

return this;
}

public answers(answers: AnswerModel | AnswerModel[]): this {
this.attributes.answers = Array.isArray(answers) ? answers : [answers];

Expand Down

0 comments on commit 15473ef

Please sign in to comment.