-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
129 additions
and
1 deletion.
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,63 @@ | ||
/** | ||
* This file is part of alf.io. | ||
* | ||
* alf.io is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* alf.io is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with alf.io. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package alfio.model; | ||
|
||
import ch.digitalfondue.npjt.ConstructorAnnotationRowMapper.Column; | ||
import lombok.Getter; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.UUID; | ||
|
||
@Getter | ||
public class Subscription { | ||
|
||
private final UUID id; | ||
private final String firstName; | ||
private final String lastName; | ||
private final String email; | ||
private final String code; | ||
private final long subscriptionDescriptorId; | ||
private final String reservationId; | ||
private final int usageCount; | ||
private final int organizationId; | ||
private final ZonedDateTime creationTime; | ||
private final ZonedDateTime updateTime; | ||
|
||
public Subscription(@Column("id") UUID id, | ||
@Column("first_name") String firstName, | ||
@Column("last_name") String lastName, | ||
@Column("email") String email, | ||
@Column("code") String code, | ||
@Column("subscription_descriptor_fk") long subscriptionDescriptorId, | ||
@Column("reservation_id_fk") String reservationId, | ||
@Column("usage_count") int usageCount, | ||
@Column("organization_id_fk") int organizationId, | ||
@Column("creation_ts") ZonedDateTime creationTime, | ||
@Column("update_ts") ZonedDateTime updateTime) { | ||
this.id = id; | ||
this.firstName = firstName; | ||
this.lastName = lastName; | ||
this.email = email; | ||
this.code = code; | ||
this.subscriptionDescriptorId = subscriptionDescriptorId; | ||
this.reservationId = reservationId; | ||
this.usageCount = usageCount; | ||
this.organizationId = organizationId; | ||
this.creationTime = creationTime; | ||
this.updateTime = updateTime; | ||
} | ||
} |
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,63 @@ | ||
/** | ||
* This file is part of alf.io. | ||
* | ||
* alf.io is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* alf.io is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with alf.io. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package alfio.model; | ||
|
||
import ch.digitalfondue.npjt.ConstructorAnnotationRowMapper.Column; | ||
import lombok.Getter; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
@Getter | ||
public class SubscriptionDescriptor { | ||
|
||
public enum SubscriptionAvailability { | ||
ONCE_PER_EVENT, UNLIMITED | ||
} | ||
|
||
private final long id; | ||
private final int maxEntries; | ||
private final ZonedDateTime creation; | ||
private final ZonedDateTime validFrom; | ||
private final ZonedDateTime validTo; | ||
private final int price; | ||
private final String currency; | ||
private final SubscriptionAvailability availability; | ||
private final boolean isPublic; | ||
private final int organizationId; | ||
|
||
public SubscriptionDescriptor(@Column("id") long id, | ||
@Column("max_entries") int maxEntries, | ||
@Column("creation_ts") ZonedDateTime creation, | ||
@Column("valid_from") ZonedDateTime validFrom, | ||
@Column("valid_to") ZonedDateTime validTo, | ||
@Column("price_cts") int price, | ||
@Column("currency") String currency, | ||
@Column("availability") SubscriptionAvailability availability, | ||
@Column("is_public") boolean isPublic, | ||
@Column("organization_id_fk") int organizationId) { | ||
this.id = id; | ||
this.maxEntries = maxEntries; | ||
this.creation = creation; | ||
this.validFrom = validFrom; | ||
this.validTo = validTo; | ||
this.price = price; | ||
this.currency = currency; | ||
this.availability = availability; | ||
this.isPublic = isPublic; | ||
this.organizationId = organizationId; | ||
} | ||
} |
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