wip
This commit is contained in:
@@ -17,17 +17,17 @@ export interface SponsorshipSlotConfig {
|
||||
}
|
||||
|
||||
export interface SponsorshipPricingProps {
|
||||
mainSlot?: SponsorshipSlotConfig;
|
||||
secondarySlots?: SponsorshipSlotConfig;
|
||||
mainSlot?: SponsorshipSlotConfig | undefined;
|
||||
secondarySlots?: SponsorshipSlotConfig | undefined;
|
||||
acceptingApplications: boolean;
|
||||
customRequirements?: string;
|
||||
customRequirements?: string | undefined;
|
||||
}
|
||||
|
||||
export class SponsorshipPricing implements IValueObject<SponsorshipPricingProps> {
|
||||
readonly mainSlot?: SponsorshipSlotConfig;
|
||||
readonly secondarySlots?: SponsorshipSlotConfig;
|
||||
readonly mainSlot: SponsorshipSlotConfig | undefined;
|
||||
readonly secondarySlots: SponsorshipSlotConfig | undefined;
|
||||
readonly acceptingApplications: boolean;
|
||||
readonly customRequirements?: string;
|
||||
readonly customRequirements: string | undefined;
|
||||
|
||||
private constructor(props: SponsorshipPricingProps) {
|
||||
this.mainSlot = props.mainSlot;
|
||||
@@ -212,8 +212,10 @@ export class SponsorshipPricing implements IValueObject<SponsorshipPricingProps>
|
||||
maxSlots: 1,
|
||||
};
|
||||
|
||||
const base = this.props;
|
||||
|
||||
return new SponsorshipPricing({
|
||||
...this,
|
||||
...base,
|
||||
mainSlot: {
|
||||
...currentMain,
|
||||
...config,
|
||||
@@ -234,8 +236,10 @@ export class SponsorshipPricing implements IValueObject<SponsorshipPricingProps>
|
||||
maxSlots: 2,
|
||||
};
|
||||
|
||||
const base = this.props;
|
||||
|
||||
return new SponsorshipPricing({
|
||||
...this,
|
||||
...base,
|
||||
secondarySlots: {
|
||||
...currentSecondary,
|
||||
...config,
|
||||
@@ -248,8 +252,10 @@ export class SponsorshipPricing implements IValueObject<SponsorshipPricingProps>
|
||||
* Enable/disable accepting applications
|
||||
*/
|
||||
setAcceptingApplications(accepting: boolean): SponsorshipPricing {
|
||||
const base = this.props;
|
||||
|
||||
return new SponsorshipPricing({
|
||||
...this,
|
||||
...base,
|
||||
acceptingApplications: accepting,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user