//
//  DOWebEntry.h
//  DOCore
//
//  Created by Ben Dolman on 7/15/14.
//
//

#import <DOCore/DOWebObject.h>

@class DOUUID;
@class DOWebLocation;
@class DOWebWeather;
@class DOWebSteps;
@class DOWebMusic;
@class DOJournalEntryFile;
@class DOWebImage;
@class DOCreator;

extern DOUUID *DOConvertLegacyIDToEntryUUID(NSString *legacyID);

@interface DOWebEntry : DOWebObject

@property (nonatomic, copy) DOUUID *entryID;
@property (nonatomic, copy) NSDate *date;
@property (nonatomic, assign, getter = isStarred) BOOL starred;
@property (nonatomic, copy) NSString *legacyID;
@property (nonatomic, copy) NSString *body;
@property (nonatomic, copy) NSTimeZone *timeZone;
@property (nonatomic, copy) NSArray *tags;
@property (nonatomic, copy) NSArray *moments;
@property (nonatomic, strong) DOWebLocation *location;
@property (nonatomic, strong) DOWebWeather *weather;
@property (nonatomic, strong) DOWebSteps *steps;
@property (nonatomic, strong) NSString *activity;
@property (nonatomic, strong) DOWebMusic *music;
@property (nonatomic, copy) NSDictionary *clientMeta;
@property (nonatomic, strong) DOWebImage *image;
@property (nonatomic, copy) NSString *version;

/**
 * Initializes the object with the contents of the entry file.
 * Returns nil if entryFile is nil.
 * @note This does not add the image from the entry file
 */
- (id)initWithEntryFile:(DOJournalEntryFile *)entryFile;

/**
 * Updates an entry file to match the contents of this entry
 * @note This does not update the image from entry file
 */
- (void)updateEntryFile:(DOJournalEntryFile *)entryFile;

/**
 * Converts this object to DOJournalEntryFile.
 */
- (DOJournalEntryFile *)entryFile;

@end

@interface DOWebEntry (Legacy)

@property (nonatomic, copy) NSDate *legacyFileEditDate;
@property (nonatomic, copy) DOCreator *legacyFileCreator;
@property (nonatomic, copy) NSURL *legacyFilePublishURL;

@end